/* ─── Design tokens ────────────────────────────────────────────── */
:root {
  --primary:        #2563eb;
  --primary-light:  #eff6ff;
  --primary-dark:   #1d4ed8;
  --teal:           #059669;
  --teal-light:     #ecfdf5;
  --purple:         #7c3aed;
  --purple-light:   #f5f3ff;
  --amber:          #d97706;
  --amber-light:    #fffbeb;
  --red:            #dc2626;
  --red-light:      #fef2f2;
  --sidebar-width:  240px;
  --topbar-height:  64px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --shadow-xs:      0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -2px rgba(0,0,0,.04);
  --border:         #e5e7eb;
  --border-strong:  #d1d5db;
  --bg-page:        #f7f8fc;
  --bg-card:        #ffffff;
  --bg-sidebar:     #0f172a;
  --text-primary:   #111827;
  --text-secondary: #6b7280;
  --text-tertiary:  #9ca3af;
  --transition:     all .18s cubic-bezier(.4,0,.2,1);
}

/* ─── Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ─── Top bar ───────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-width); right: 0;
  height: var(--topbar-height);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  transition: var(--transition);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.topbar-breadcrumb { font-size: 13px; color: var(--text-tertiary); }

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex; flex-direction: column;
  z-index: 200;
  overflow: hidden;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo-icon {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 700;
}
.sidebar-logo-text { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.sidebar-logo-version { font-size: 10px; color: rgba(255,255,255,.35); }
.sidebar-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: 18px 20px 6px;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 500;
  color: rgba(255,255,255,.55);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
  text-decoration: none;
}
.nav-item i { font-size: 17px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active {
  background: rgba(37,99,235,.35);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: var(--primary); color: #fff;
  padding: 2px 6px; border-radius: 99px;
  min-width: 18px; text-align: center;
}
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-md);
  transition: var(--transition); cursor: pointer;
}
.sidebar-user:hover { background: rgba(255,255,255,.07); }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85); }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.35); }

/* ─── Main content ───────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
}
.page-body { padding: 28px 32px; }

/* ─── Page header ────────────────────────────────────────────────── */
.page-header { margin-bottom: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 21px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; letter-spacing: -.3px; }
.page-header p   { font-size: 13px; color: var(--text-secondary); margin: 0; }
.page-header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }

/* ─── Stat cards ─────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative; overflow: hidden;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-bottom: 14px;
}
.stat-card-val { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }
.stat-card-lbl { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.stat-card-trend { font-size: 11px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-card-trend.up   { color: var(--teal); }
.stat-card-trend.down { color: var(--red); }
.stat-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 0 var(--radius-lg) 0 60px;
  opacity: .06;
}
.stat-card.primary::after { background: var(--primary); }
.stat-card.primary .stat-card-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.teal::after    { background: var(--teal); }
.stat-card.teal .stat-card-icon { background: var(--teal-light); color: var(--teal); }
.stat-card.purple::after  { background: var(--purple); }
.stat-card.purple .stat-card-icon { background: var(--purple-light); color: var(--purple); }
.stat-card.amber::after   { background: var(--amber); }
.stat-card.amber .stat-card-icon { background: var(--amber-light); color: var(--amber); }

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-header {
  padding: 18px 22px 0;
  display: flex; align-items: center; justify-content: space-between;
  border: 0;
  background: transparent;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 0; }
.card-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.card-body { padding: 18px 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: #fafafa; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: #f3f4f6; border-color: #9ca3af; color: var(--text-primary); }
.btn-secondary i { color: var(--primary); }
.btn-success   { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-success:hover { filter: brightness(1.08); color: #fff; }
.btn-danger    { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-ai {
  background: linear-gradient(135deg, #6d28d9, #2563eb);
  color: #fff; border: none;
  box-shadow: 0 2px 8px rgba(99,60,219,.35);
}
.btn-ai:hover { filter: brightness(1.08); box-shadow: 0 4px 12px rgba(99,60,219,.45); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; border-radius: var(--radius-lg); }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ─── Roster grid ────────────────────────────────────────────────── */
.roster-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
.roster-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.roster-table th {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-align: center; padding: 10px 6px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  letter-spacing: .04em; text-transform: uppercase;
  position: sticky; top: 0; z-index: 2;
}
.roster-table th.week-head {
  background: var(--primary-light); color: var(--primary);
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  border-bottom: 2px solid #bfdbfe;
}
.roster-table th.today-head { color: var(--primary); font-weight: 700; }
.roster-table th.weekend-head { background: #f1f5f9; color: #64748b; }
.roster-table td { padding: 5px 4px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; text-align: center; }
.roster-table tr:last-child td { border-bottom: 0; }
.roster-table tr:hover td { background: #fafbff; }
.staff-cell {
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  padding: 8px 14px;
  white-space: nowrap; min-width: 150px;
  position: sticky; left: 0; background: var(--bg-card); z-index: 3;
  border-right: 1px solid var(--border);
  vertical-align: middle; text-align: left;
}
.staff-cell-inner { display: flex; align-items: center; gap: 10px; min-width: 0; }
.staff-cell-name { overflow: hidden; text-overflow: ellipsis; }
.roster-table th:first-child { position: sticky; left: 0; z-index: 4; }
.roster-table tr:hover .staff-cell { background: #fafbff; }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
}
.shift-badge {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  padding: 4px 9px; font-size: 11px; font-weight: 700;
  cursor: pointer; min-width: 38px;
  transition: var(--transition);
  user-select: none;
}
.shift-badge:hover { filter: brightness(.92); transform: scale(1.06); }
.shift-badge:active { transform: scale(.96); }
.shift-1     { background: #d1fae5; color: #065f46; }
.shift-lt    { background: #ede9fe; color: #5b21b6; }
.shift-h     { background: #fef3c7; color: #92400e; }
.shift-leave { background: #dbeafe; color: #1e40af; }
.shift-off   { background: #f3f4f6; color: #9ca3af; }
.shift-badge[data-locked="1"] { cursor: not-allowed; opacity: .92; }
.shift-dirty { outline: 2px solid var(--primary); outline-offset: 1px; }
.week-sep-col { width: 12px; background: var(--bg-page); border-left: 2px solid var(--border); border-right: 2px solid var(--border); }
.coverage-row td {
  font-size: 11px; font-weight: 700; text-align: center;
  padding: 6px 4px; background: #f9fafb;
  border-top: 2px solid var(--border); border-bottom: 0;
}
.coverage-row .staff-cell { background: #f9fafb; color: var(--text-secondary); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.coverage-ok   { color: var(--teal); }
.coverage-gap  { color: var(--amber); }
.coverage-crit { color: var(--red); }

/* ─── Roster nav / month bar ─────────────────────────────────────── */
.roster-nav {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-label { font-size: 15px; font-weight: 700; color: var(--text-primary); min-width: 130px; text-align: center; }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.view-toggle button {
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  background: none; border: none; cursor: pointer; color: var(--text-secondary);
  transition: var(--transition);
}
.view-toggle button.active { background: var(--primary); color: #fff; }
.roster-nav-right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ─── AI engine toggle ───────────────────────────────────────────── */
.engine-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.engine-option {
  position: relative; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--bg-card);
  transition: var(--transition);
}
.engine-option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.engine-option:hover { border-color: var(--border-strong); background: #fafbff; }
.engine-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}
.engine-option-title { font-size: 13px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.engine-option-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }
@media (max-width: 640px) { .engine-toggle { grid-template-columns: 1fr; } }

/* ─── AI planner progress ────────────────────────────────────────── */
.progress-bar-wrap { background: #f3f4f6; border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  transition: width .5s ease;
  width: 0;
}
.month-progress-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.month-chip {
  background: #f9fafb; border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: var(--transition);
}
.month-chip.done    { background: var(--teal-light); border-color: #a7f3d0; color: var(--teal); }
.month-chip.error   { background: var(--red-light);  border-color: #fecaca; color: var(--red); }
.month-chip.active  { background: var(--primary-light); border-color: #bfdbfe; color: var(--primary); }
.month-chip i { font-size: 15px; }
.spinner-mini { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-label { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; display: block; }
.form-control, .form-select {
  width: 100%; padding: 9px 13px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; font-family: inherit; color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition); outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.form-check-input { width: 16px; height: 16px; border-radius: 4px; cursor: pointer; accent-color: var(--primary); margin: 0; }
.form-check-label { font-size: 13px; color: var(--text-primary); cursor: pointer; }
.form-section { margin-bottom: 22px; }
.form-section-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ─── Tables ─────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); padding: 10px 16px; background: #f9fafb; border-bottom: 1px solid var(--border); text-align: left; }
.data-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.data-table tr:hover td { background: #fafbff; }
.data-table tr:last-child td { border-bottom: 0; }

/* ─── Badges / pills ─────────────────────────────────────────────── */
.badge-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600;
}
.badge-success { background: var(--teal-light);   color: var(--teal); }
.badge-warning { background: var(--amber-light);  color: var(--amber); }
.badge-danger  { background: var(--red-light);    color: var(--red); }
.badge-info    { background: var(--primary-light); color: var(--primary); }
.badge-purple  { background: var(--purple-light); color: var(--purple); }
.badge-gray    { background: #f3f4f6; color: #6b7280; }

/* ─── Toasts ─────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--text-primary); color: #fff;
  padding: 12px 16px; border-radius: var(--radius-lg);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInToast .25s cubic-bezier(.34,1.56,.64,1);
  min-width: 240px;
}
.toast-item.success { background: var(--teal); }
.toast-item.error   { background: var(--red); }
.toast-item.warning { background: var(--amber); }
.toast-item.danger  { background: var(--red); }
.toast-item i { font-size: 17px; }
@keyframes slideInToast { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── Skeleton loaders ───────────────────────────────────────────── */
.skeleton { background: #e5e7eb; border-radius: var(--radius-md); position: relative; overflow: hidden; }
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.6) 50%, transparent 100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ─── Empty states ───────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state-icon { font-size: 44px; color: var(--text-tertiary); margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 0 8px; }
.empty-state p  { font-size: 13px; color: var(--text-secondary); margin: 0 0 20px; max-width: 320px; margin-inline: auto; }

/* ─── Modals ─────────────────────────────────────────────────────── */
.modal-content { border: 0; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.modal-header  { border-bottom: 1px solid var(--border); padding: 20px 24px 16px; }
.modal-title   { font-size: 16px; font-weight: 700; }
.modal-body    { padding: 20px 24px; }
.modal-footer  { border-top: 1px solid var(--border); padding: 14px 24px; gap: 8px; }

/* ─── Login / Register page ──────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(37,99,235,.1), transparent 50%),
                    radial-gradient(circle at 80% 70%, rgba(124,58,237,.1), transparent 50%);
  pointer-events: none;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: rgba(255,255,255,.97); backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 25px 50px rgba(0,0,0,.35);
  position: relative;
  z-index: 1;
}
.auth-card.wide { max-width: 880px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.auth-card.wide .auth-pitch { padding: 40px; background: linear-gradient(135deg, #1e3a5f, #0f172a); color: #fff; }
.auth-card.wide .auth-form-side { padding: 40px; }
.auth-pitch h2 { font-size: 22px; font-weight: 800; margin-bottom: 14px; }
.auth-pitch p  { font-size: 13px; opacity: .8; margin-bottom: 28px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; }
.auth-pitch li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; font-size: 13px; opacity: .9; }
.auth-pitch li i { color: #60a5fa; margin-top: 2px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-mark {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--primary); display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 14px;
}
.auth-title { font-size: 22px; font-weight: 800; color: var(--text-primary); text-align: center; margin-bottom: 6px; }
.auth-sub   { font-size: 13px; color: var(--text-secondary); text-align: center; margin-bottom: 24px; }
.auth-error {
  background: var(--red-light); color: var(--red);
  border: 1px solid #fecaca; border-radius: var(--radius-md);
  padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
  animation: shake .4s ease;
}
@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.password-strength { height: 4px; background: #f3f4f6; border-radius: 99px; margin-top: 6px; overflow: hidden; }
.password-strength-bar { height: 100%; width: 0%; transition: var(--transition); }
.password-strength-bar.weak   { background: var(--red);   width: 30%; }
.password-strength-bar.medium { background: var(--amber); width: 65%; }
.password-strength-bar.strong { background: var(--teal);  width: 100%; }

/* ─── Year overview ──────────────────────────────────────────────── */
.year-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.year-table th, .year-table td { padding: 8px 10px; font-size: 12px; text-align: center; border-bottom: 1px solid #f3f4f6; }
.year-table th { background: #f9fafb; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 10px; }
.year-table td.name-cell { text-align: left; font-weight: 600; color: var(--text-primary); }
.year-table .totals-cell { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.year-cell-counts { display: flex; gap: 4px; justify-content: center; font-size: 10px; font-weight: 600; }
.year-cell-counts span { padding: 1px 5px; border-radius: 4px; }
.year-cell-counts .c-1  { background: #d1fae5; color: #065f46; }
.year-cell-counts .c-lt { background: #ede9fe; color: #5b21b6; }
.year-cell-counts .c-h  { background: #fef3c7; color: #92400e; }

/* ─── Bottom nav (mobile) ────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  display: none;
  justify-content: space-around; align-items: center;
  padding: 6px 0;
  z-index: 150;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px; font-size: 10px; font-weight: 500;
  color: var(--text-tertiary); min-width: 56px; min-height: 44px;
  border-radius: var(--radius-md);
}
.bottom-nav a i { font-size: 19px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a:active { background: var(--primary-light); }

/* ─── Bottom sheet (touch shift selector) ────────────────────────── */
.bottom-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -10px 30px rgba(0,0,0,.18);
  padding: 24px 16px 32px;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  z-index: 9000;
}
.bottom-sheet.open { transform: none; }
.bottom-sheet-grip { width: 40px; height: 4px; background: #d1d5db; border-radius: 99px; margin: 0 auto 18px; }
.bottom-sheet h3 { font-size: 14px; font-weight: 700; margin: 0 0 16px; }
.bottom-sheet-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bottom-sheet-options button {
  padding: 18px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; cursor: pointer;
}
.bottom-sheet-options button[data-type="1.0"] { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.bottom-sheet-options button[data-type="LT"]  { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.bottom-sheet-options button[data-type="H"]   { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.bottom-sheet-options button[data-type="OFF"] { background: #f3f4f6; color: #6b7280; }
.bottom-sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 8999; display: none; }
.bottom-sheet-backdrop.open { display: block; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
  .month-progress-list { grid-template-columns: repeat(2,1fr); }
  .auth-card.wide { grid-template-columns: 1fr; }
  .auth-card.wide .auth-pitch { display: none; }
}
@media (max-width: 640px) {
  .page-body { padding: 16px 16px 84px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .month-progress-list { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
  .bottom-nav { display: flex; }
  .topbar { padding: 0 16px; }
  .auth-card { padding: 24px; }
  .auth-card.wide .auth-form-side { padding: 24px; }
  input, select, textarea { font-size: 16px !important; }
  .btn { min-height: 40px; }
}

/* ─── Micro animations ───────────────────────────────────────────── */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn  { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.fade-up   { animation: fadeUp  .3s cubic-bezier(.34,1.3,.64,1) both; }
.fade-in   { animation: fadeIn  .25s ease both; }
.scale-in  { animation: scaleIn .2s ease both; }
.delay-1   { animation-delay: .05s; }
.delay-2   { animation-delay: .10s; }
.delay-3   { animation-delay: .15s; }
.delay-4   { animation-delay: .20s; }

/* ─── Enterprise polish ──────────────────────────────────────────── */
.kbd {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  background: #f3f4f6; border: 1px solid var(--border);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 10px; color: var(--text-secondary);
  box-shadow: 0 1px 0 var(--border-strong);
}
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 0 3px currentColor; opacity: .9;
}
.status-dot.live   { background: var(--teal);    color: rgba(5,150,105,.18); animation: pulse 1.6s ease-in-out infinite; }
.status-dot.draft  { background: var(--amber);   color: rgba(217,119,6,.18); }
.status-dot.idle   { background: var(--text-tertiary); color: rgba(156,163,175,.18); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px currentColor; } 50% { box-shadow: 0 0 0 6px transparent; } }

.divider { height: 1px; background: var(--border); margin: 12px 0; }
.divider-vertical { width: 1px; background: var(--border); align-self: stretch; margin: 0 4px; }

.tooltip-hint { position: relative; }
.tooltip-hint::after {
  content: attr(data-hint);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: #fff;
  padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 500;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.tooltip-hint:hover::after { opacity: 1; }

.data-table tr td:first-child, .data-table tr th:first-child { padding-left: 20px; }
.data-table tr td:last-child,  .data-table tr th:last-child  { padding-right: 20px; }

.card { transition: var(--transition); }
.card:hover { box-shadow: var(--shadow-sm); }

/* Refined nav-item focus ring */
.nav-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:focus-visible      { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Polished sidebar gradient at bottom */
.sidebar::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.25));
  pointer-events: none;
}

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
