/* ── VIP Medical Group – Clinic Launch Tracker ── */
:root {
  /* Brand */
  --color-primary: #0a1f44;
  --color-primary-hover: #133068;
  --color-accent: #c9a84c;
  --color-accent-hover: #e8c96e;

  /* Surfaces */
  --color-surface: #ffffff;
  --color-surface-subtle: #f5f7fa;
  --color-border: #d8dce8;
  --color-border-subtle: #eef0f5;

  /* Text */
  --color-text: #2c3345;
  --color-text-secondary: #555f70;
  --color-text-muted: #8892a4;
  --color-text-inverse: #ffffff;

  /* Semantic states */
  --color-success: #2e9e6b;
  --color-success-bg: #d1fae5;
  --color-success-text: #065f46;
  --color-warning: #e08d2a;
  --color-warning-bg: #fff3cd;
  --color-warning-text: #92400e;
  --color-danger: #d94040;
  --color-danger-bg: #fee2e2;
  --color-danger-text: #991b1b;
  --color-info: #3b82f6;
  --color-info-bg: #dbeafe;
  --color-info-text: #1d4ed8;

  /* Legacy aliases (keep for compatibility) */
  --navy: var(--color-primary);
  --navy-light: var(--color-primary-hover);
  --gold: var(--color-accent);
  --gold-light: var(--color-accent-hover);
  --white: var(--color-surface);
  --off-white: var(--color-surface-subtle);
  --gray-100: var(--color-border-subtle);
  --gray-200: var(--color-border);
  --gray-400: var(--color-text-muted);
  --gray-600: var(--color-text-secondary);
  --gray-800: var(--color-text);
  --success: var(--color-success);
  --warning: var(--color-warning);
  --danger: var(--color-danger);
  --info: var(--color-info);

  /* Sizing */
  --radius: 8px;
  --touch-target: 44px;
  --shadow: 0 2px 8px rgba(10,31,68,.12);
  --shadow-lg: 0 6px 24px rgba(10,31,68,.18);
  --transition: .18s ease;
}

/* ── Skip to main content (a11y) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-accent);
  color: var(--color-primary);
  font-weight: 700;
  padding: 10px 18px;
  z-index: 9999;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
  font-size: 14px;
}
.skip-link:focus { top: 0; }

/* ── Focus styles (keyboard nav) ── */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* SVG icon baseline alignment */
.icon { vertical-align: middle; flex-shrink: 0; }

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--off-white);
  color: var(--gray-800);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Nav ── */
.navbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 60px;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.navbar-brand .logo-vip {
  color: var(--gold);
  font-size: 18px;
}

.navbar-brand .logo-sep { color: var(--gray-400); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.navbar-links a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  padding: 10px 12px;
  min-height: var(--touch-target);
  border-radius: var(--radius);
  font-size: 14px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar-links a:hover { color: var(--color-text-inverse); background: rgba(255,255,255,.12); }
.navbar-links a:focus-visible { outline-color: var(--color-accent); }

.notif-badge {
  background: var(--gold);
  color: var(--navy);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  margin-left: auto;
  padding: 10px;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--color-text-inverse);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger:focus-visible { outline-color: var(--color-accent); }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-accent);
  font-size: 14px;
  padding: 8px 8px;
  white-space: nowrap;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  color: var(--color-text-inverse) !important;
  padding: 10px 14px;
  min-height: var(--touch-target);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--navy); }
.page-subtitle { font-size: 14px; color: var(--gray-400); margin-top: 2px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--navy); }
.card-body { padding: 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  min-height: var(--touch-target);
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-gold { background: var(--color-accent); color: var(--color-primary); font-weight: 600; }
.btn-gold:hover { background: var(--color-accent-hover); }
.btn-outline { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text-secondary); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-danger { background: var(--color-danger); color: var(--color-text-inverse); }
.btn-danger:hover { opacity: .88; }
.btn-sm { padding: 8px 13px; font-size: 13px; min-height: 36px; }
.btn-xs { padding: 5px 10px; font-size: 12px; min-height: 30px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 5px; }
.form-control {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,31,68,.08); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ── Status badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-not-started { background: var(--color-border-subtle); color: var(--color-text-secondary); }
.badge-in-progress { background: var(--color-info-bg); color: var(--color-info-text); }
.badge-complete { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-blocked { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge-overdue { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-gold { background: var(--color-accent); color: var(--color-primary); }

/* ── Progress bar ── */
.progress-bar-wrap { background: var(--gray-100); border-radius: 20px; height: 10px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  transition: width .4s ease;
}
.progress-label { font-size: 12px; color: var(--gray-400); margin-top: 3px; }

/* ── Clinic cards grid ── */
.clinics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.clinic-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--gold);
  padding: 20px;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.clinic-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.clinic-card-name { font-size: 17px; font-weight: 700; color: var(--navy); }
.clinic-card-meta { font-size: 13px; color: var(--gray-400); display: flex; gap: 16px; flex-wrap: wrap; }
.clinic-card-badges { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Department section ── */
.dept-section { margin-bottom: 24px; }
.dept-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  min-height: var(--touch-target);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  user-select: none;
}
.dept-header:focus-visible { outline: 3px solid var(--color-accent); outline-offset: -3px; }
.collapse-icon { transition: transform .2s ease; }
.dept-header-left { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dept-header-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.dept-body { border: 1px solid var(--gray-200); border-top: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }

/* ── Task table ── */
.task-table { width: 100%; border-collapse: collapse; }
.task-table th {
  background: var(--gray-100);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.task-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.task-table tr:last-child td { border-bottom: none; }
.task-table tr:hover td { background: var(--off-white); }
.task-table tr.task-overdue td { background: #fffbeb; }
.task-table tr.task-blocked td { background: #fff5f5; }

.task-name-link { color: var(--navy); text-decoration: none; font-weight: 500; }
.task-name-link:hover { color: var(--gold); text-decoration: underline; }

/* ── Task detail ── */
.task-detail-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white);
  padding: 24px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.task-detail-header h1 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.task-detail-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; opacity: .85; }

.task-detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
@media (max-width: 768px) { .task-detail-grid { grid-template-columns: 1fr; } }

/* ── Notes ── */
.note-thread { display: flex; flex-direction: column; gap: 12px; }
.note-item {
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
}
.note-header { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-400); margin-bottom: 6px; }
.note-author { font-weight: 600; color: var(--navy); }
.note-content { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.mention { color: var(--gold); font-weight: 600; }

/* ── Activity feed ── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-text { flex: 1; }
.activity-time { color: var(--gray-400); font-size: 11px; white-space: nowrap; }

/* ── Notifications ── */
.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: var(--transition);
}
.notif-item.unread { background: var(--color-info-bg); }
.notif-item:hover { background: var(--off-white); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); margin-top: 6px; flex-shrink: 0; }
.notif-dot.read { background: var(--gray-200); }

/* ── Dept progress grid (dashboard) ── */
.dept-progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.dept-progress-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.dept-progress-name { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.dept-progress-nums { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ── Stats row ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-number { font-size: 28px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.stat-card.gold .stat-number { color: var(--gold); }
.stat-card.success .stat-number { color: var(--success); }
.stat-card.danger .stat-number { color: var(--danger); }
.stat-card.warning .stat-number { color: var(--warning); }

/* ── Flash messages ── */
.flash-container { max-width: 1200px; margin: 12px auto 0; padding: 0 16px; }
.flash {
  padding: 11px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash-success { background: var(--color-success-bg); color: var(--color-success-text); border-left: 4px solid var(--color-success); }
.flash-error { background: var(--color-danger-bg); color: var(--color-danger-text); border-left: 4px solid var(--color-danger); }
.flash-info { background: var(--color-info-bg); color: var(--color-info-text); border-left: 4px solid var(--color-info); }

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #1a3a7a 100%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-text { font-size: 20px; font-weight: 800; color: var(--navy); }
.login-logo-sub { font-size: 14px; color: var(--gold); font-weight: 600; }
.login-divider { width: 40px; height: 3px; background: var(--gold); margin: 10px auto; border-radius: 2px; }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-400); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: var(--navy); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--gray-200); }

/* ── Filters bar ── */
.filters-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.filters-bar select { padding: 7px 11px; border: 1.5px solid var(--gray-200); border-radius: var(--radius); font-size: 13px; color: var(--gray-800); background: var(--white); cursor: pointer; }
.filters-bar select:focus { outline: none; border-color: var(--navy); }

/* ── Attachments ── */
.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--off-white); border-radius: var(--radius);
  font-size: 13px;
}
.attachment-icon { font-size: 18px; }
.attachment-name { flex: 1; color: var(--navy); text-decoration: none; font-weight: 500; }
.attachment-name:hover { text-decoration: underline; }
.attachment-meta { color: var(--gray-400); font-size: 11px; }

/* ── Quick Check ── */
.qc-select-row { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }

/* ── Misc ── */
.text-muted { color: var(--gray-400); }
.text-center { text-align: center; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--color-text-muted);
}
.empty-state-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--color-border);
}
.empty-state-icon svg { width: 48px; height: 48px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .navbar-links { display: none; flex-direction: column; position: fixed; top: 60px; left: 0; right: 0; background: var(--navy); padding: 16px; z-index: 999; }
  .navbar-links.open { display: flex; }
  .navbar-links a { padding: 10px 14px; }
  .hamburger { display: flex; }
  .task-table { font-size: 13px; }
  .task-table th, .task-table td { padding: 8px 10px; }
  /* Hide less-important columns on mobile */
  .task-col-phase, .task-col-assignee { display: none; }
  .clinics-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}
