:root {
  --sidebar-w: 230px;
  --accent: #1f6beb;
  --bg: #f4f6f9;
  --card-border: #e5e9f0;
  --sidebar-bg: #1b2a3b;
  --card-bg: #fff;
  --card-header-bg: #fafbfc;
  --text: #212529;
  --text-muted: #6c757d;
  --input-border: #dde2ea;
  --input-bg: #fff;
  --table-head-bg: #fafbfc;
  --row-hover: #f5f8ff;
  --nav-hover-bg: #f0f4ff;
  --nav-active-bg: #e8f0fe;
  --tag-chip-bg: #f8f9fa;
  --tag-chip-border: #dde2ea;
  --remark-bg: #fff;
  --region-track: #e8f0fe;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; transition: background 0.2s, color 0.2s; }

/* Layout */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: background 0.2s;
}

.sidebar-brand {
  padding: 20px 18px 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--card-border);
}

.sidebar-nav { padding: 10px 10px; flex: 1; overflow-y: auto; }

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--nav-hover-bg); color: var(--accent); }
.nav-item.active { background: var(--nav-active-bg); color: var(--accent); font-weight: 600; }
.nav-item i { font-size: 1rem; width: 18px; text-align: center; }

.sidebar-footer { padding: 14px; border-top: 1px solid var(--card-border); }

.main-area { flex: 1; overflow-y: auto; }
.page-content { padding: 28px 36px; max-width: 1600px; }

/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.card-header { background: var(--card-header-bg); border-bottom: 1px solid var(--card-border); padding: 12px 18px; font-weight: 600; font-size: 0.9rem; border-radius: 10px 10px 0 0 !important; }
.section-header { cursor: pointer; display: flex; align-items: center; user-select: none; }
.section-header:hover { background: var(--nav-hover-bg); }
.collapse-icon { transition: transform 0.2s; margin-left: auto; }
.section-header[aria-expanded="true"] .collapse-icon { transform: rotate(180deg); }

/* Form */
.field-label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 5px; display: block; }
.form-control, .form-select { font-size: 0.9rem; border-color: var(--input-border); border-radius: 7px; background-color: var(--input-bg); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,107,235,.12); background-color: var(--input-bg); color: var(--text); }

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  z-index: 999;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.autocomplete-item {
  padding: 8px 14px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text);
}
.autocomplete-item:hover, .autocomplete-item.active { background: var(--nav-active-bg); color: var(--accent); }

/* Table */
.crm-table thead th { background: var(--table-head-bg); font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid var(--card-border); padding: 10px 16px; }
.crm-table tbody td { padding: 12px 16px; font-size: 0.875rem; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--row-hover); }

/* Badges */
.badge-level { background: var(--nav-active-bg); color: var(--accent); padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.status-badge.s-active { background: #d1fae5; color: #065f46; }
.status-badge.s-warning { background: #fef3c7; color: #92400e; }
.status-badge.s-lost { background: #fee2e2; color: #991b1b; }

.stat-value { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }

/* Avatar */
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.avatar-sm { width: 26px; height: 26px; font-size: 0.7rem; }

/* Remarks */
.remark-item { background: var(--remark-bg); border: 1px solid var(--card-border); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; }
.remark-content { color: var(--text); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }

/* Login */
.login-page { background: var(--bg); }
.login-card { border-radius: 14px; border: 1px solid var(--card-border); background: var(--card-bg); }

/* Buttons */
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #1558c7; border-color: #1558c7; }

/* Tag Select */
.tag-select { border: 1px solid var(--input-border); border-radius: 8px; padding: 8px 10px; background: var(--input-bg); min-height: 44px; cursor: text; transition: border-color 0.15s, box-shadow 0.15s; }
.tag-select:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,107,235,.12); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 500;
  cursor: pointer; border: 1.5px solid var(--tag-chip-border); color: var(--text-muted); background: var(--tag-chip-bg);
  transition: all 0.15s; user-select: none;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--nav-active-bg); }
.tag-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag-chip.selected .chip-x { opacity: 0.7; }
.chip-x { font-size: 0.75rem; line-height: 1; }
.tag-custom-input {
  border: 1px dashed var(--input-border); border-radius: 20px; padding: 3px 12px;
  font-size: 0.78rem; outline: none; color: var(--text-muted); background: transparent; width: 160px;
}
.tag-custom-input:focus { border-color: var(--accent); color: var(--accent); }
.tag-custom-input::placeholder { color: var(--text-muted); opacity: 0.6; }

/* Followup highlight */
.followup-soon { color: #d97706; font-weight: 600; }
.followup-overdue { color: #dc2626; font-weight: 600; }


/* ── Task status classes (replaces inline styles in tasks.html) ──────────── */
.task-status-done    { background: #d1fae5; color: #065f46; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.task-status-pending { background: #fef3c7; color: #92400e; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
/* ── Pending count badge (tasks page header) ─────────────────────────────── */
.badge-pending { background: #fef3c7 !important; color: #92400e !important; }

/* ── Pending tasks notice (dashboard) ───────────────────────────────────── */
.pending-notice { background: rgba(217,119,6,.07); border: 1px solid rgba(217,119,6,.2); border-radius: 8px; }
.pending-notice-text { color: #92400e; }

/* ── Completion % label ─────────────────────────────────────────────────── */
.pct-label { font-size: .72rem; font-weight: 600; white-space: nowrap; }
.pct-high  { color: #16a34a; }
.pct-mid   { color: #d97706; }
.pct-low   { color: #dc2626; }


/* ── KPI Cards (Hero 1) ──────────────────────────────────────────── */
.kpi-card {
  padding: 1.4rem 1.6rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  border-left-width: 4px;
  background: var(--card-bg);
  transition: box-shadow .15s, transform .15s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .035;
  pointer-events: none;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.10); }
.kpi-blue  { border-left-color: #1f6beb; }
.kpi-green { border-left-color: #3eb87a; }
.kpi-amber { border-left-color: #d97706; }
.kpi-red   { border-left-color: #dc2626; }
.kpi-blue::before  { background: #1f6beb; }
.kpi-green::before { background: #3eb87a; }
.kpi-amber::before { background: #d97706; }
.kpi-red::before   { background: #dc2626; }
.kpi-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .35rem;
}
.kpi-number {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: .3rem;
}
.kpi-sub { font-size: .75rem; color: var(--text-muted); }

/* ── 添加情况 Card (Hero 2) ─────────────────────────────────────── */
.add-time-pill {
  font-size: .75rem;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-weight: 500;
}
.add-time-week  { background: rgba(92,150,216,.12); color: #3a74c0; }
.add-time-month { background: rgba(124,96,204,.12); color: #6040a8; }

.add-status-row { text-align: center; }
.add-status-item {
  padding: .75rem .5rem;
  transition: background .12s;
  border-radius: 8px;
}
.add-status-num { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.add-status-lbl { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; font-weight: 500; }

.add-prop-bar {
  height: 6px;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
  gap: 2px;
  background: var(--card-border);
}
.add-prop-seg { height: 100%; border-radius: 2px; transition: width .4s; }

/* ── War Board (Hero 3) ─────────────────────────────────────────── */
.war-board-card { overflow: hidden; }
.war-col { display: flex; flex-direction: column; }
.war-col-header {
  display: flex;
  align-items: center;
  padding: .65rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  border-bottom: 1px solid var(--card-border);
}
.war-col-header-red   { color: #dc2626; background: rgba(220,38,38,.05); }
.war-col-header-amber { color: #d97706; background: rgba(217,119,6,.05); }

.war-list { overflow-y: auto; max-height: 380px; }
.war-item {
  border-bottom: 1px solid var(--card-border);
  color: var(--text);
  transition: background .1s;
}
.war-item:last-child { border-bottom: none; }
.war-item:hover { background: var(--nav-hover-bg); }

.war-badge-level {
  font-size: .62rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: 4px;
  background: var(--nav-active-bg);
  color: var(--accent);
}
.war-badge-red {
  font-size: .62rem; font-weight: 600;
  padding: .15rem .45rem; border-radius: 4px;
  background: rgba(220,38,38,.12); color: #dc2626;
}
.war-badge-amber {
  font-size: .62rem; font-weight: 600;
  padding: .15rem .45rem; border-radius: 4px;
  background: rgba(217,119,6,.12); color: #d97706;
}

.war-overdue-pill {
  font-size: .7rem; font-weight: 700;
  color: #dc2626;
  background: rgba(220,38,38,.1);
  padding: .15rem .5rem;
  border-radius: 20px;
  white-space: nowrap;
}

.war-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: .82rem;
}

/* ── Dashboard view bar ──────────────────────────────────────────────────── */
.dash-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0 .75rem;
  border-bottom: 1px solid var(--card-border);
}

.dash-viewbar-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.015em;
}
.dash-viewbar-title > i { color: var(--accent); font-size: 1.1rem; }
.dash-viewbar-scope { color: var(--text-muted); font-weight: 400; font-size: .9rem; }

/* Segmented control container */
.dash-view-segment {
  display: inline-flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 3px;
  gap: 1px;
}
.dash-view-divider {
  width: 1px;
  height: 16px;
  background: var(--card-border);
  flex-shrink: 0;
  margin: 0 1px;
}

/* Pills inside segment */
.dash-vpill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 5px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
  line-height: 1.4;
}
.dash-vpill:hover:not(.active) {
  background: var(--nav-hover-bg);
  color: var(--text);
}
.dash-vpill.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.dash-vpill.active:hover { opacity: .92; }

/* Bootstrap dropdown caret adjustment */
.dash-vpill.dropdown-toggle::after { margin-left: .15rem; opacity: .8; }

/* AM dot indicator */
.dash-am-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
  flex-shrink: 0;
}

/* AM dropdown menu */
.dash-am-dropdown {
  min-width: 170px;
  border-color: var(--card-border);
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.13);
}
.dash-am-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  border-radius: 5px;
  font-size: .82rem;
  color: var(--text);
  padding: .42rem .6rem;
}
.dash-am-item:hover { background: var(--nav-hover-bg); color: var(--text); }
.dash-am-item.active { background: var(--nav-active-bg); color: var(--accent); font-weight: 600; }
.dash-am-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .8;
}
.dash-am-item.active .dash-am-avatar { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   UI POLISH — better font, dark sidebar, card depth
   ═══════════════════════════════════════════════════════════════════════════ */

/* Font upgrade */
body {
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ── Sidebar: dark rail ──────────────────────────────────────────────────── */
.sidebar {
  border-right: none;
  box-shadow: 2px 0 12px rgba(0,0,0,.18);
}

.sidebar-brand {
  color: rgba(255,255,255,.9);
  border-bottom-color: rgba(255,255,255,.08);
  padding: 22px 18px 18px;
  letter-spacing: -.01em;
}
.sidebar-brand i { color: #60a5fa; }

.sidebar .nav-section-label {
  color: rgba(255,255,255,.28);
  letter-spacing: .08em;
}

.sidebar .nav-item {
  color: rgba(255,255,255,.5);
  position: relative;
  border-radius: 7px;
}
.sidebar .nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: background .15s;
}
.sidebar .nav-item:hover {
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.82);
}
.sidebar .nav-item.active {
  background: rgba(96,165,250,.14);
  color: #fff;
  font-weight: 600;
}
.sidebar .nav-item.active::before {
  background: #60a5fa;
}
.sidebar .nav-item i { opacity: .75; }
.sidebar .nav-item.active i,
.sidebar .nav-item:hover i { opacity: 1; }

/* Collapsible nav parent */
.nav-item-parent {
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: none;
  outline: none;
  box-shadow: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: rgba(255,255,255,.5);
}
.nav-item-parent:hover { background: rgba(255,255,255,.07) !important; color: rgba(255,255,255,.82) !important; }
.nav-item-parent:focus { outline: none; box-shadow: none; }
.nav-item-parent .nav-caret {
  margin-left: auto;
  font-size: .72rem;
  opacity: .45;
  transition: transform .2s;
}
.nav-item-parent[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.nav-item-parent.active-parent { color: rgba(255,255,255,.82) !important; }

/* Sub-menu items */
.nav-sub-item {
  padding-left: 2.4rem !important;
  font-size: .82rem;
}
.nav-sub-item::before { display: none; }

/* Sidebar footer */
.sidebar-footer {
  border-top-color: rgba(255,255,255,.08);
}
.sidebar-footer .fw-semibold { color: rgba(255,255,255,.85) !important; }
.sidebar-footer .text-muted  { color: rgba(255,255,255,.38) !important; }

.sidebar .btn-outline-secondary {
  color: rgba(255,255,255,.45);
  border-color: rgba(255,255,255,.1);
}
.sidebar .btn-outline-secondary:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.8);
  border-color: rgba(255,255,255,.18);
}

/* ── Cards: subtle depth ─────────────────────────────────────────────────── */
.card {
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.04);
  border-radius: 12px;
}
.card-header {
  border-radius: 12px 12px 0 0 !important;
  font-size: .875rem;
  letter-spacing: -.005em;
}

/* ── Main content area ───────────────────────────────────────────────────── */
.page-content {
  padding: 24px 32px;
}

/* ── Buttons: consistent radius ─────────────────────────────────────────── */
.btn { border-radius: 8px; font-family: inherit; font-weight: 500; }
.btn-sm { border-radius: 6px; font-size: .8rem; }

/* ── Form controls ───────────────────────────────────────────────────────── */
.form-control, .form-select {
  font-family: inherit;
  border-radius: 8px;
}

/* ── Table refinement ────────────────────────────────────────────────────── */
.crm-table {
  font-family: inherit;
}
.crm-table thead th {
  font-size: .72rem;
  letter-spacing: .06em;
}

/* ── Light-mode bg tweak: fractionally warmer ────────────────────────────── */
:root { --bg: #f0f4f8; }

/* ── btn-xs ──────────────────────────────────────────────────────────────── */
.btn-xs {
  padding: 2px 5px;
  font-size: .72rem;
  border-radius: 4px;
  border: none;
  background: transparent;
  line-height: 1;
  cursor: pointer;
  opacity: .5;
  transition: opacity .15s;
}
.btn-xs:hover { opacity: 1; }
.remark-del-btn { margin-left: 4px; }

/* ── Remark type selector ────────────────────────────────────────────────── */
.remark-type-opt {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  padding: .3rem .7rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  transition: all .12s;
  user-select: none;
}
.remark-type-opt input[type="radio"] { accent-color: var(--accent); }
.remark-type-opt:has(input:checked) {
  border-color: var(--accent);
  background: rgba(31,107,235,.07);
  color: var(--accent);
}
.remark-type-followup:has(input:checked) {
  border-color: #d97706;
  background: rgba(217,119,6,.07);
  color: #92400e;
}

/* ── Task create box ─────────────────────────────────────────────────────── */
.task-create-box {
  background: rgba(217,119,6,.04);
  border: 1px solid rgba(217,119,6,.25);
  border-radius: 8px;
  padding: .9rem 1rem;
}

/* ── Remark flag badge ───────────────────────────────────────────────────── */
.remark-flag-badge {
  font-size: .66rem;
  font-weight: 700;
  padding: .12rem .48rem;
  border-radius: 4px;
  background: rgba(217,119,6,.12);
  color: #d97706;
  white-space: nowrap;
}

/* ── Dashboard main tabs ─────────────────────────────────────────────────── */
.dash-main-tabs { border-bottom: 1px solid var(--card-border); padding-bottom: 0; gap: .25rem; }
.dash-main-tabs .nav-link {
  color: var(--text-muted); font-size: .85rem; font-weight: 500;
  padding: .45rem 1rem; border-radius: 8px 8px 0 0;
  border: 1px solid transparent; border-bottom: none;
  transition: background .15s, color .15s;
}
.dash-main-tabs .nav-link:hover { background: var(--nav-hover-bg); color: var(--text); }
.dash-main-tabs .nav-link.active {
  background: var(--card-bg); color: var(--accent);
  border-color: var(--card-border); border-bottom-color: var(--card-bg);
  margin-bottom: -1px;
}

/* ── Sidebar profile link ─────────────────────────────────────────────────── */
.sidebar-profile-link {
  padding: .35rem .5rem;
  border-radius: 8px;
  transition: background .15s;
}
.sidebar-profile-link:hover {
  background: rgba(255,255,255,.08);
}

/* ── Flash Toast (Bootstrap Toast override) ──────────────────────────────── */
#flashToast {
  min-width: 280px;
  border-radius: 10px !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.22) !important;
  font-size: .875rem;
  font-weight: 500;
}
#flashToast .toast-body { gap: .5rem; }
.flash-toast-bar {
  height: 3px;
  background: rgba(255,255,255,.35);
  animation: toastCountdown 3.5s linear forwards;
  border-radius: 0 0 10px 10px;
}
@keyframes toastCountdown {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── Mobile Topbar ────────────────────────────────────────────────────────── */
.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: var(--sidebar-bg);
  z-index: 1040;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
  padding: 0 14px;
  gap: 10px;
}
.mobile-topbar-brand {
  font-size: .9rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  flex: 1;
  letter-spacing: -.01em;
}
.mobile-topbar-brand i { color: #60a5fa; }
.hamburger-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 1.4rem;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── Offcanvas nav (mobile) ───────────────────────────────────────────────── */
#mobileNav {
  background: var(--sidebar-bg);
  max-width: 260px;
}
#mobileNav .offcanvas-header {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 20px 18px 16px;
}
#mobileNav .offcanvas-title {
  font-size: .95rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
}
#mobileNav .btn-close {
  filter: invert(1) grayscale(1);
  opacity: .45;
}
#mobileNav .sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}
#mobileNav .sidebar-footer .fw-semibold { color: rgba(255,255,255,.85) !important; }
#mobileNav .btn-outline-secondary {
  color: rgba(255,255,255,.45);
  border-color: rgba(255,255,255,.1);
}
#mobileNav .btn-outline-secondary:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.8);
  border-color: rgba(255,255,255,.18);
}

/* ── Responsive layout ────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .app-shell {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .main-area {
    overflow-y: visible;
    width: 100%;
    padding-top: 54px;
  }
  .page-content {
    padding: 16px 14px;
  }
  /* Stack KPI cards vertically */
  .kpi-card { margin-bottom: .75rem; }
  /* Reduce KPI number size */
  .kpi-number { font-size: 2rem; }
  /* Make war board columns stack */
  .war-list { max-height: 260px; }
  /* Stat cards */
  .stat-value { font-size: 1.6rem; }
  /* Filter collapsible toggle */
  .filter-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .6rem .85rem;
    background: none;
    border: none;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
  }
  .filter-toggle-btn .filter-caret { transition: transform .2s; }
  .filter-toggle-btn[aria-expanded="true"] .filter-caret { transform: rotate(180deg); }
}
@media (min-width: 768px) {
  .filter-toggle-btn { display: none; }
  #filterFormBody { display: block !important; }
}

.completion-field-row { color: var(--text); transition: background .15s; }
.completion-field-row:hover { background: var(--bg); }
