/* ─── Reset & custom properties ────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --dark-navy: #050D50;
  --navy:      #004489;
  --grey:      #323E48;
  --cyan:      #66CCFF;
  --orange:    #F7AA14;
  --white:     #FFFFFF;
  --green:     #3AAA35;
  --bg:        #eef2f7;
}

/* ─── Base elements ─────────────────────────────────────────────────────────── */

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg);
  color: #222;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ─── Navigation ────────────────────────────────────────────────────────────── */

nav {
  background: var(--dark-navy);
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

nav .brand {
  font-family: 'Oswald', sans-serif;
  color: var(--orange);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.5px;
  flex: 1;
}

nav a.nav-link {
  color: var(--orange);
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: background 0.15s;
  font-weight: 400;
}

nav a.nav-link:hover {
  background: rgba(247, 170, 20, 0.18);
}

nav a.nav-link.active {
  background: rgba(247, 170, 20, 0.25);
  font-weight: 600;
}

/* ─── Main container ────────────────────────────────────────────────────────── */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ─── Page title ────────────────────────────────────────────────────────────── */

.page-title {
  font-family: 'Oswald', sans-serif;
  font-size: 26px;
  color: var(--dark-navy);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-title .actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ─── Dashboard stat grid ───────────────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─── Project grid ──────────────────────────────────────────────────────────── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Base button ───────────────────────────────────────────────────────────── */

.btn {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── Variants ──────────────────────────────────────────────────────────────── */

.btn-primary {
  background: var(--orange);
  color: var(--dark-navy);
}

.btn-primary:hover {
  background: #e89e0d;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}

.btn-outline:hover {
  background: rgba(0, 68, 137, 0.07);
}

.btn-danger {
  background: #c0392b;
  color: white;
}

.btn-danger:hover {
  background: #a93226;
}

.btn-ghost {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--orange);
  padding: 4px 6px;
  font-size: 16px;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

/* ─── Floating action button ────────────────────────────────────────────────── */

.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--dark-navy);
  color: var(--orange);
  border: none;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  z-index: 40;
}

.fab:hover {
  transform: scale(1.07);
}

/* ─── Generic card ──────────────────────────────────────────────────────────── */

.card {
  background: var(--navy);
  border-radius: 10px;
  padding: 16px;
  color: var(--white);
  transition: transform 0.15s, box-shadow 0.15s;
}

.card.clickable {
  cursor: pointer;
}

.card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* ─── Stat card (dashboard) ─────────────────────────────────────────────────── */

.stat-card {
  text-align: center;
}

.stat-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.stat-value {
  font-family: 'Oswald', sans-serif;
  font-size: 34px;
  color: var(--orange);
  font-weight: 600;
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

/* ─── Project card ──────────────────────────────────────────────────────────── */

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 160px;
}

.proj-header {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.proj-header .proj-name {
  flex: 1;
}

.project-card .proj-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  flex: 1;
  margin-bottom: 4px;
}

.project-card .proj-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.project-card .proj-counts {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 4px 0;
}

.progress-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  transition: width 0.3s;
}

.proj-pct {
  font-size: 12px;
  color: var(--orange);
  margin-top: 2px;
}

/* ─── Task card (list view) ─────────────────────────────────────────────────── */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  background: var(--navy);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.task-priority {
  font-size: 20px;
  flex-shrink: 0;
  color: var(--orange);
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-desc {
  font-weight: 700;
  color: var(--white);
  font-size: 14px;
}

.task-sub {
  font-size: 12px;
  color: var(--cyan);
  margin-top: 2px;
}

/* ─── Badges ────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-todo  { background: var(--grey);   color: var(--white); }

.badge-doing { background: var(--orange); color: var(--dark-navy); }

.badge-done  { background: var(--green);  color: var(--dark-navy); }

/* ─── Group headers (legacy list grouping) ──────────────────────────────────── */

.group-header {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  color: var(--dark-navy);
  font-weight: 600;
  padding: 10px 0 6px;
  border-bottom: 2px solid var(--navy);
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-count {
  background: var(--navy);
  color: white;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
}

/* ─── Kanban board ──────────────────────────────────────────────────────────── */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}

@media (max-width: 800px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

/* ─── Column ────────────────────────────────────────────────────────────────── */

.kanban-col {
  background: #e4e9f0;
  border-radius: 10px;
  overflow: hidden;
}

.kanban-col-header {
  padding: 10px 14px;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-header.todo  { background: var(--grey);   color: white; }

.kanban-col-header.doing { background: var(--orange); color: var(--dark-navy); }

.kanban-col-header.done  { background: var(--green);  color: white; }

.kanban-count {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  margin-left: auto;
}

.kanban-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}

/* ─── Card inside kanban ────────────────────────────────────────────────────── */

.kanban-card {
  background: var(--navy);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.kanban-card .task-desc {
  font-weight: 700;
  color: var(--white);
  font-size: 13px;
  line-height: 1.4;
}

.kanban-card .task-sub {
  font-size: 11px;
  color: var(--cyan);
  margin-top: 4px;
}

.kanban-card .task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.kanban-card .priority-pill {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
}

/* ─── Form card wrapper ──────────────────────────────────────────────────────── */

.form-card {
  background: white;
  border-radius: 10px;
  padding: 28px;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.form-title {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  color: var(--dark-navy);
  margin-bottom: 22px;
}

/* ─── Form group (label + field) ────────────────────────────────────────────── */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d0d5dd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fafafa;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--navy);
  background: white;
}

.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
  background: #f0f0f0;
  color: #666;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ─── Form meta (dates display) ─────────────────────────────────────────────── */

.form-meta {
  display: flex;
  gap: 16px;
  background: #f5f7fb;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.form-meta .meta-item {
  flex: 1;
}

.form-meta .meta-label {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-meta .meta-value {
  font-size: 13px;
  color: #333;
}

/* ─── Search box ────────────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box {
  padding: 8px 14px;
  border: 1.5px solid #d0d5dd;
  border-radius: 20px;
  font-size: 14px;
  width: 220px;
  background: white;
}

.search-box:focus {
  outline: none;
  border-color: var(--navy);
}

/* ─── Project selector chips ────────────────────────────────────────────────── */

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.chip {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--navy);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  background: white;
}

.chip.selected {
  background: var(--navy);
  color: white;
}

.chip.selected:hover {
  background: #003a75;
}

/* ─── Modal ─────────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: white;
  border-radius: 10px;
  padding: 28px;
  min-width: 300px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  color: var(--dark-navy);
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

.modal-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.modal-option:last-child {
  border-bottom: none;
}

.modal-option input[type="checkbox"],
.modal-option input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--navy);
}

.modal-option label {
  font-size: 14px;
  cursor: pointer;
  flex: 1;
}

.modal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  margin: 14px 0 6px;
}

/* ─── Loading spinner ───────────────────────────────────────────────────────── */

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid #ddd;
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 60px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Empty & error states ──────────────────────────────────────────────────── */

.empty {
  text-align: center;
  color: #999;
  padding: 50px 16px;
  font-size: 15px;
}

.error {
  text-align: center;
  color: #c0392b;
  padding: 40px 16px;
  font-size: 14px;
}

/* ─── Inline state tags ─────────────────────────────────────────────────────── */

.state-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.state-tag.todo  { background: #e8e8e8; color: var(--grey); }

.state-tag.doing { background: #fff3cd; color: #b7770d; }

.state-tag.done  { background: #d4edda; color: #1e6e2e; }

/* ─── Divider ───────────────────────────────────────────────────────────────── */

.divider {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 18px 0;
}

/* ─── Colour helpers ────────────────────────────────────────────────────────── */

.text-orange { color: var(--orange); }

.text-cyan   { color: var(--cyan); }

/* ─── Spacing helpers ───────────────────────────────────────────────────────── */

.mt-8  { margin-top: 8px; }

.mb-16 { margin-bottom: 16px; }
