:root {
  --navy: #012261;
  --navy-deep: #011a4d;
  --navy-line: rgba(255, 255, 255, 0.08);
  --blue: #1f4fd8;
  --blue-soft: #2a5ae8;
  --content-bg: #f4f6fb;
  --text-dim: #9fb0d4;
  --text-muted: #8893a8;
  --ink: #1a2233;
  --card: #ffffff;
  --border: #e6e9f2;
  --sidebar-w: 280px;

  /* Typography (Figma): Inter carries headings + content; JetBrains Mono is
     used for machine-ish text — labels, IDs, counts, timestamps, codes. */
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", ui-monospace, monospace;
}

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

/* Form controls opt out of font inheritance by default and fall back to the
   browser's Arial — which was silently breaking the type on every button. */
button, input, select, textarea { font-family: inherit; }

html { background: var(--content-bg); }

body {
  font-family: var(--font-sans);
  background: var(--content-bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* page-transition fade on navigation */
.main { transition: opacity 0.2s ease; }
body.is-leaving .main { opacity: 0; }

.mono { font-family: var(--font-mono); }

/* --- Mono text, per the Figma frames -----------------------------------
   Applied centrally so every page (User Access, Area, Template Form,
   Automated Form, Issue/Request, Report & Tasks, Dashboard) stays in step. */
th,                              /* column headers: REPORT ID, OFFICE AREA … */
.table-foot .count,              /* "Showing 6 out of 6 entries"             */
.pager .pg,                      /* pagination digits                        */
.id-link,                        /* GART6, TASK-MO-25000012                  */
.field label,                    /* form field labels                        */
.detail-field .dlabel,           /* TASK ID / ASSIGNEE / PERIODE …           */
.rc-card .rc-label,              /* REPORT NAME / PERIOD & FREQUENCY …       */
.pill,                           /* COMPLETED / ON PROGRESS pills            */
.cell-date .time,                /* HH:MM:SS under a date                    */
.topbar .date,                   /* topbar date                              */
.user-chip .meta .role,          /* ADMIN GA (topbar)                        */
.side-foot .meta .role {         /* ADMIN GA (sidebar)                       */
  font-family: var(--font-mono);
}

.uppercase, .uppercase * { text-transform: uppercase; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100dvh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
}

.brand {
  padding: 38px 26px 26px;
  text-align: center;
}
.brand-logo { display: block; width: 190px; max-width: 100%; height: auto; margin: 0 auto; }
.brand h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: 0.5px;
}
.brand .sub {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav { padding: 18px 16px; flex: 1; }
.nav-section {
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5e6f9a;
  padding: 14px 16px 8px;
}
.nav-section:first-child { padding-top: 4px; }

.nav-item, .nav-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 13px;
  margin: 3px 0;
  border-radius: 10px;
  color: #b9c5e4;
  text-decoration: none;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.nav-item > span:not(.ico):not(.chevron),
.nav-toggle > span:not(.ico):not(.chevron) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item:hover, .nav-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-item:hover .ico, .nav-toggle:hover .ico { color: #fff; }
.nav-item.active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.nav-item .ico, .nav-toggle .ico {
  flex: 0 0 22px;
  display: grid;
  place-items: center;
  color: #8fa0c8;
  transition: color 0.15s;
}
.nav-item.active .ico { color: #fff; }
.nav-item .ico svg, .nav-toggle .ico svg { width: 19px; height: 19px; }
.nav-item .ico .mi, .nav-toggle .ico .mi {
  width: 20px; height: 20px; background-color: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat;
  mask: var(--i) center / contain no-repeat;
}

.nav-toggle .chevron { margin-left: auto; font-size: 11px; color: #6b7ca6; transition: transform 0.25s; }
.nav-toggle.open .chevron { transform: rotate(180deg); color: #b9c5e4; }
/* highlight a parent whose child is active */
.nav-toggle.has-active { color: #fff; }
.nav-toggle.has-active .ico { color: #fff; }

.submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
  margin-left: 14px;
  border-left: 1px solid var(--navy-line);
  padding-left: 6px;
}
.submenu.open { max-height: 400px; }
.submenu .nav-item { font-size: 13.5px; padding: 10px 14px; }

/* user footer pinned to bottom of sidebar */
.side-foot {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--navy-line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.side-foot .avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #25305a; border: 1px solid var(--navy-line); }
.side-foot .meta { min-width: 0; flex: 1; }
.side-foot .meta .name { font-size: 13.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .meta .role { font-size: 10.5px; letter-spacing: 1.5px; color: var(--text-dim); text-transform: uppercase; }
.side-foot .out { color: #8fa0c8; display: grid; place-items: center; padding: 7px; border-radius: 8px; }
.side-foot .out:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ---------- Main ---------- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  padding: 22px 36px;
  background: var(--content-bg);
}
.topbar .title { font-size: 21px; font-weight: 700; color: var(--navy); }
.topbar .divider { width: 1px; height: 22px; background: #cfd6e6; margin: 0 18px; }
.topbar .date { font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }
.topbar .spacer { flex: 1; }

/* hamburger (mobile only) + drawer overlay */
.nav-burger {
  display: none; background: none; border: none; cursor: pointer; color: var(--navy);
  padding: 8px; margin-right: 6px; border-radius: 8px; place-items: center;
}
.nav-burger:hover { background: #e9edf6; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(6, 12, 30, 0.45);
  z-index: 40; opacity: 0; transition: opacity 0.2s;
}
.sidebar-overlay.show { opacity: 1; }

.topbar .logout {
  background: none; border: none; cursor: pointer;
  color: var(--navy); display: grid; place-items: center; padding: 8px;
  border-radius: 8px;
}
.topbar .logout:hover { background: #e9edf6; }

.user-chip { display: flex; align-items: center; gap: 14px; padding-left: 22px; margin-left: 8px; border-left: 1px solid #cfd6e6; }
.user-chip .meta { text-align: right; }
.user-chip .meta .name { font-weight: 700; font-size: 14.5px; color: var(--navy); }
.user-chip .meta .role { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; }
.user-chip .avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--navy); background: #d9deea; }

.content { padding: 14px 36px 48px; flex: 1; }

/* ---------- Cards / widgets ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.stat .label { font-size: 12.5px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }
.stat .value { font-size: 32px; font-weight: 800; color: var(--navy); margin-top: 8px; }
.stat .trend { font-size: 12px; color: #16a34a; margin-top: 6px; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-top: 24px; }
.panel h2 { font-size: 16px; color: var(--navy); margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
tbody tr:hover { background: #f7f9fd; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.open { background: #fef3c7; color: #92580c; }
.badge.done { background: #dcfce7; color: #15803d; }
.badge.progress { background: #dbeafe; color: #1e40af; }

.empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }

.dash-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 90px 24px; min-height: 50vh;
}
.dash-empty .de-ico {
  width: 80px; height: 80px; border-radius: 20px; display: grid; place-items: center;
  background: #eef3ff; color: var(--blue); margin-bottom: 22px;
}
.dash-empty .de-ico svg { width: 38px; height: 38px; }
.dash-empty h2 { font-size: 24px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.dash-empty p { font-size: 15px; color: var(--text-muted); max-width: 420px; line-height: 1.6; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 22px; }
.page-head .pg-title { font-size: 24px; font-weight: 700; color: var(--navy); }
.page-head .pg-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.page-head .spacer { flex: 1; min-width: 0; }
/* the title block should not stretch/shrink; keep its text left-aligned */
.page-head > div:first-child { align-self: flex-start; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: 12px; border: none; cursor: pointer;
  font-family: inherit;   /* buttons don't inherit the page font on their own */
  font-size: 14.5px; font-weight: 600; text-decoration: none; transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 8px 20px rgba(12, 28, 76, 0.28); }
.btn-primary:hover { background: #112766; }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: none; color: var(--text-muted); }
.btn-ghost:hover { color: var(--ink); }

/* ---------- Data table card ---------- */
.table-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 3px rgba(16,24,40,0.05); }
/* Only the table itself scrolls horizontally when its columns don't fit --
   the toolbar/search bar and table-foot stay put, so scrolling the table
   never drags the surrounding card's edges out of alignment with it. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-card table { width: 100%; min-width: max-content; }
.table-card thead th { background: #fbfcff; padding: 16px 22px; }
.table-card td { padding: 18px 22px; }
.table-card tbody tr { border-top: 1px solid var(--border); }
.table-card .u-name { font-weight: 700; color: var(--navy); }
.table-card .u-muted { color: #58627a; }

.status-dot { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-dot.active { color: #15803d; }
.status-dot.active::before { background: #22c55e; }
.status-dot.inactive { color: #6b7280; }
.status-dot.inactive::before { background: #9ca3af; }
.status-dot.new { color: #2563eb; } .status-dot.new::before { background: #2563eb; }
.status-dot.scheduled { color: #b45309; } .status-dot.scheduled::before { background: #f59e0b; }
.status-dot.progress { color: #c2410c; } .status-dot.progress::before { background: #f97316; }
.status-dot.cancelled { color: #6b7280; } .status-dot.cancelled::before { background: #9ca3af; }
.status-dot.rejected { color: #dc2626; } .status-dot.rejected::before { background: #ef4444; }
.status-dot.completed { color: #16a34a; } .status-dot.completed::before { background: #22c55e; }

.cell-date { font-size: 13.5px; color: #58627a; line-height: 1.35; }
.cell-date .time { font-size: 12px; color: #9aa3b6; }
.cell-date.closed-green { color: #16a34a; } .cell-date.closed-green .time { color: #16a34a; }
.cell-date.overdue-red { color: #ef4444; } .cell-date.overdue-red .time { color: #ef4444; }
.dvalue.overdue-red { color: #ef4444; }

.thumb img { cursor: zoom-in; }
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 12, 24, 0.86);
  display: grid; place-items: center; padding: 32px;
  animation: modalFade 0.18s ease;
}
.lightbox-overlay[hidden] { display: none !important; }
.lightbox-img { max-width: min(90vw, 1100px); max-height: 88vh; border-radius: 8px; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.lightbox-close {
  position: absolute; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08); color: #fff;
  display: grid; place-items: center; cursor: pointer; transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.18); }
.id-link { font-weight: 700; color: var(--navy); }

.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: #58627a; display: grid; place-items: center; cursor: pointer; transition: all 0.15s; }
.icon-btn:hover { border-color: var(--navy); color: var(--navy); background: #f4f6fb; }
.icon-btn svg { width: 17px; height: 17px; }

.table-foot { display: flex; align-items: center; padding: 18px 22px; border-top: 1px solid var(--border); }
.table-foot .count { font-size: 13px; color: var(--text-muted); }
.table-foot .pager { margin-left: auto; display: flex; gap: 8px; }
.pager .pg { min-width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: #58627a; display: grid; place-items: center; cursor: pointer; font-size: 14px; text-decoration: none; }
.pager .pg.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager .pg:hover:not(.active) { background: #f4f6fb; }

/* ---------- Form ---------- */
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 1px 3px rgba(16,24,40,0.05); width: 100%; }
.form-card .fc-head { display: flex; align-items: center; gap: 12px; padding: 22px 28px; border-bottom: 1px solid var(--border); }
.form-card .fc-head .fc-ico { width: 34px; height: 34px; border-radius: 9px; background: #eef2fc; color: var(--navy); display: grid; place-items: center; }
.fc-ico .mi { width: 19px; height: 19px; background-color: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.form-card .fc-head h2 { font-size: 17px; color: var(--navy); }
.form-body { padding: 26px 28px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.field input, .field select {
  width: 100%; padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px;
  font-size: 14.5px; color: var(--ink); background: #fff; font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: #aab2c4; }
.date-range {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border); border-radius: 11px; background: #fff;
  overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
}
.date-range:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,79,216,0.12); }
.date-range input {
  flex: 1; min-width: 0; border: none !important; border-radius: 0 !important;
  background: transparent; box-shadow: none !important;
}
.date-range input:focus { box-shadow: none !important; outline: none; transform: none !important; }
.date-range .dr-sep {
  flex: 0 0 auto; align-self: stretch; display: grid; place-items: center;
  padding: 0 14px; color: var(--blue); font-size: 15px;
  background: #f4f6fb; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.date-range input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.6; }
.date-range input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,79,216,0.12); }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2358627a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px; }
.form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 20px 28px; border-top: 1px solid var(--border); }
.form-msg { margin-right: auto; font-size: 13.5px; }
.form-msg.err { color: #dc2626; }
.form-msg.ok { color: #15803d; }
.auto-flash { margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; font-size: 13.5px;
  background: #eef6ee; color: #15803d; border: 1px solid #cfe6cf; }

.field textarea {
  width: 100%; padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px;
  font-size: 14.5px; color: var(--ink); background: #fff; font-family: inherit; resize: vertical; min-height: 88px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea::placeholder { color: #aab2c4; }
.field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,79,216,0.12); }
.field-hint { margin: 7px 2px 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }

/* ---------- Toolbar (search + filter) ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; padding: 20px 22px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #9aa3b6; }
.search input { width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--border); border-radius: 11px; font-size: 14px; font-family: inherit; }
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,79,216,0.12); }
.toolbar select {
  padding: 11px 38px 11px 14px; border: 1px solid var(--border); border-radius: 11px; font-size: 14px; color: var(--ink);
  background: #fff; font-family: inherit; appearance: none; min-width: 190px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2358627a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.toolbar select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,79,216,0.12); }
.icon-btn.danger:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.row-actions { display: inline-flex; gap: 8px; }

/* ---------- Checklist builder ---------- */
.checklist-head { display: flex; align-items: center; margin: 8px 0 14px; }
.checklist-head h3 { font-size: 15px; color: var(--navy); }
.checklist-head p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.checklist-head .spacer { flex: 1; }
.btn-soft { background: #eef2fc; color: var(--navy); padding: 9px 16px; border-radius: 10px; font-size: 13.5px; }
.btn-soft:hover { background: #e2e9fb; }
.btn-soft svg { width: 16px; height: 16px; }
.check-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.check-row .grip { color: #c2cad9; flex: 0 0 auto; }
.check-row input { flex: 1; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; font-size: 14px; font-family: inherit; }
.check-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,79,216,0.12); }
.check-row .rm { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: #9aa3b6; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.check-row .rm:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }

/* ---------- Request form extras ---------- */
.btn-danger { background: #dc2626; color: #fff; box-shadow: 0 8px 20px rgba(220,38,38,0.28); }
.btn-danger:hover { background: #b91c1c; }
.fc-head .spacer { flex: 1; }
.fc-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.dropzone {
  border: 2px dashed #c7d0e3; border-radius: 14px; background: #f8faff; padding: 30px 20px;
  text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dropzone.drag { border-color: var(--blue); background: #eef3ff; }
.dropzone .dz-ico { color: #9aabcc; }
.dropzone .dz-ico svg { width: 34px; height: 34px; }
.dropzone .dz-title { font-weight: 600; color: var(--navy); margin-top: 8px; font-size: 14.5px; }
.dropzone .dz-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Modal (close task request) ---------- */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 22, 48, 0.55);
  display: grid; place-items: center; padding: 20px;
  animation: modalFade 0.18s ease;
}
.modal-overlay[hidden] { display: none !important; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 560px; max-height: 90vh; background: #fff; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(12, 22, 48, 0.35); overflow: hidden;
  display: flex; flex-direction: column;
  animation: modalPop 0.22s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.modal .modal-body { overflow-y: auto; }
.modal .tm-id { color: var(--blue); font-size: 14px; font-weight: 600; }
@keyframes modalPop { from { transform: translateY(14px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 14px; padding: 22px 24px; background: #f6f8fc; border-bottom: 1px solid var(--border); }
.modal-ico { width: 42px; height: 42px; border-radius: 11px; background: #fdecec; color: #ef4444; display: grid; place-items: center; flex: 0 0 auto; }
.modal-ico.edit { background: #eef3ff; color: var(--blue); }
.readonly-field { background: #f4f6fb !important; color: #58627a !important; cursor: default; font-family: var(--font-mono); font-size: 13.5px !important; }
.modal-ico svg { width: 22px; height: 22px; }
.modal-head h3 { font-size: 19px; font-weight: 700; color: var(--ink); flex: 1; }
.modal-x { background: none; border: none; color: #8893a8; cursor: pointer; display: grid; place-items: center; padding: 4px; border-radius: 8px; transition: background 0.15s, color 0.15s; }
.modal-x:hover { background: #eef1f7; color: var(--ink); }
.modal-body { padding: 22px 24px 6px; }
.modal-warn { border-left: 4px solid #ef4444; background: #fbfcfe; padding: 14px 16px; border-radius: 8px; font-size: 13.5px; color: #4a5468; line-height: 1.5; margin-bottom: 20px; }
.modal-body .field { margin-bottom: 18px; }
.modal-body .req { color: #ef4444; font-weight: 600; font-size: 12px; float: right; }
.modal-body textarea { width: 100%; min-height: 96px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; font-size: 14.5px; font-family: inherit; color: var(--ink); resize: vertical; }
.modal-body textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,79,216,0.12); }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 18px 24px 24px; }
.modal-foot .btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.confirm-check { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-top: 4px; }
.confirm-check input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--blue); cursor: pointer; }
.confirm-check span { font-size: 14.5px; color: var(--ink); line-height: 1.5; }

/* Weekend include toggle (nice switch card).
   NOTE: selectors are scoped to `label.wk-toggle` to out-rank `.field label`,
   and text props are explicitly reset because text-transform/letter-spacing
   inherit from that label rule. */
label.wk-toggle {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: #f8fafc; cursor: pointer; margin: 12px 0 0;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-transform: none; letter-spacing: normal; font-weight: 400;
  -webkit-user-select: none; user-select: none;
}
label.wk-toggle[hidden] { display: none; }   /* class selector would otherwise beat the UA [hidden] rule */
label.wk-toggle:hover { border-color: #b9c4da; }
.wk-toggle input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; pointer-events: none; }
.wk-toggle .wk-ico { width: 38px; height: 38px; border-radius: 10px; background: #eef2fc; color: var(--navy); display: grid; place-items: center; flex: 0 0 auto; transition: background 0.15s, color 0.15s; }
.wk-toggle .wk-ico svg { width: 20px; height: 20px; }
.wk-toggle .wk-text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; gap: 2px; }
.wk-toggle .wk-title { font-size: 14.5px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: normal; line-height: 1.3; }
.wk-toggle .wk-sub { font-size: 12px; color: var(--text-muted); text-transform: none; letter-spacing: normal; font-weight: 400; line-height: 1.4; }
.wk-toggle .wk-switch { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #cbd3e1; flex: 0 0 46px; transition: background 0.2s; }
.wk-toggle .wk-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,0.3); transition: transform 0.2s; }
.wk-toggle input:checked ~ .wk-switch { background: var(--blue); }
.wk-toggle input:checked ~ .wk-switch::after { transform: translateX(20px); }
label.wk-toggle:has(input:checked) { border-color: var(--blue); background: #eef3ff; box-shadow: 0 0 0 3px rgba(31,79,216,0.10); }
label.wk-toggle:has(input:checked) .wk-ico { background: var(--blue); color: #fff; }
.wk-toggle input:focus-visible ~ .wk-switch { outline: 2px solid var(--blue); outline-offset: 2px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.thumb {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px 10px 10px; background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
}
.thumb:hover { box-shadow: 0 6px 16px rgba(16,24,40,0.08); border-color: #d6dcec; transform: translateY(-1px); }
.thumb img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: #eef2fc; flex: 0 0 auto; }
.thumb .t-meta { font-size: 12.5px; min-width: 0; }
.thumb .t-meta .t-name { font-weight: 600; color: var(--ink); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .t-meta .t-size { color: #9aa3b6; margin-top: 2px; }
.thumb .t-rm {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  color: #ef4444; cursor: pointer; background: #fef2f2; border: 1px solid #fde0e0;
  display: grid; place-items: center; transition: background 0.15s, color 0.15s;
}
.thumb .t-rm:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* ---------- Read-only detail ---------- */
.detail-field { margin-bottom: 22px; }
.detail-field .dlabel { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.detail-field .dvalue { font-size: 15px; color: var(--ink); }
.detail-field .dvalue.muted { color: #58627a; }
.detail-field .dvalue.mono { font-family: var(--font-mono); font-size: 13.5px; }
.detail-row { display: flex; flex-direction: column; gap: 0; }
.detail-row .detail-field { width: 100%; }

/* ---------- Task detail (summary + checklist) ---------- */
.summary-card { padding: 26px 28px; }
.summary-card .sc-title { font-size: 21px; font-weight: 700; color: var(--ink); padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.sc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.sc-grid .detail-field { margin-bottom: 0; }
.sc-grid .dvalue { font-weight: 600; }

.check-list { display: flex; flex-direction: column; }
.check-item { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border-bottom: 1px solid #f0f2f8; }
.check-item:last-child { border-bottom: none; }
.check-item .cb { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #d4dae8; background: #fff; display: grid; place-items: center; color: #fff; }
.check-item.done .cb { background: var(--navy); border-color: var(--navy); }
.check-item .cl-text { flex: 1; font-size: 15px; color: var(--ink); }
.check-item .cl-time { color: #9aa3b6; font-size: 12.5px; }

.section-head { display: flex; align-items: center; gap: 11px; margin: 28px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.section-head .sh-ico { color: var(--navy); display: grid; place-items: center; }
.section-head .sh-ico svg { width: 20px; height: 20px; }
.section-head h3 { font-size: 16px; font-weight: 700; color: var(--ink); }

.completion-box { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; font-size: 14.5px; color: #4a5468; line-height: 1.55; background: #fbfcfe; }

.evidence { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 4px; }
.ev-thumb { width: 150px; height: 130px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); display: block; transition: box-shadow 0.15s, transform 0.12s; }
.ev-thumb:hover { box-shadow: 0 8px 20px rgba(16,24,40,0.12); transform: translateY(-2px); }
.ev-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ev-empty { width: 150px; height: 130px; border-radius: 12px; background: #e9edf5; display: grid; place-items: center; color: #b7c0d4; }
.ev-empty svg { width: 46px; height: 46px; }

/* ---------- Report summary cards ---------- */
.report-cards { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 20px; margin-bottom: 36px; }
.rc-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px; box-shadow: 0 1px 3px rgba(16,24,40,0.05); }
.rc-card .rc-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.rc-card .rc-title { font-size: 22px; font-weight: 700; color: var(--navy); margin: 10px 0 14px; }
.rc-card .rc-tags { display: flex; flex-wrap: wrap; gap: 8px 20px; color: #58627a; font-size: 13.5px; }
.rc-card .rc-tags span { display: inline-flex; align-items: center; gap: 7px; }
.rc-card .rc-tags svg { width: 16px; height: 16px; color: #9aa3b6; }
.rc-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 14px; }
.rc-row .k { color: var(--text-muted); }
.rc-row .v { font-weight: 700; color: var(--navy); }
.rc-total { margin-top: 16px; font-size: 14px; color: #58627a; }

@media (max-width: 1000px) {
  .report-cards { grid-template-columns: 1fr 1fr; }
  .report-cards .rc-card:first-child { grid-column: 1 / -1; }   /* Report Name spans full width */
}
@media (max-width: 640px) {
  .report-cards { grid-template-columns: 1fr; }
  .head-actions { flex-wrap: wrap; }
}

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.pill.progress { background: #fef3c7; color: #b45309; } .pill.progress::before { background: #f59e0b; }
.pill.completed { background: #dcfce7; color: #15803d; } .pill.completed::before { background: #22c55e; }
.pill.inactive { background: #f3f4f6; color: #6b7280; } .pill.inactive::before { background: #9ca3af; }

.status-dot.purple { color: #7c3aed; } .status-dot.purple::before { background: #8b5cf6; }

.head-actions { display: flex; gap: 12px; }

/* ---------- Micro-interactions ---------- */
.card, .rc-card, .stat { transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s; will-change: transform; }
.card:hover, .rc-card:hover, .stat:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(16,24,40,0.1); }
.btn { transition: transform 0.12s cubic-bezier(.2,.8,.2,1), background 0.15s, box-shadow 0.2s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.icon-btn { transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s; }
.icon-btn:hover { transform: translateY(-2px); }
.table-card tbody tr { transition: background 0.15s, box-shadow 0.2s; }
.table-card tbody tr:hover { background: #f7f9fd; box-shadow: inset 3px 0 0 var(--blue); }
.nav-item, .nav-toggle { transition: background 0.18s, color 0.15s; }
.field input, .field select, .field textarea, .search input, .toolbar select { transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s; }
.field input:focus, .field textarea:focus { transform: translateY(-1px); }

/* entrance prep — JS reveals these; no-JS still shows them */
.gs-fade { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .js-anim .gs-fade { opacity: 0; }
}

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }

/* Left branded panel */
.login-hero {
  position: relative; overflow: hidden; color: #fff; padding: 64px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 120% at 0% 0%, #15306e 0%, var(--navy) 45%, var(--navy-deep) 100%);
}
.login-hero .aurora { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; pointer-events: none; }
.login-hero .a1 { width: 460px; height: 460px; background: #2a5ae8; top: -120px; right: -120px; }
.login-hero .a2 { width: 380px; height: 380px; background: #1b9bd8; bottom: -140px; left: -80px; opacity: 0.4; }
.login-hero .a3 { width: 280px; height: 280px; background: #7aa0ff; top: 40%; left: 30%; opacity: 0.25; }
.login-hero .grid-lines {
  position: absolute; inset: 0; opacity: 0.06; pointer-events: none;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 48px 48px;
}
.login-hero .hero-top, .login-hero .hero-mid, .login-hero .hero-bot { position: relative; z-index: 1; }
.login-hero .brand-mark { font-size: 15px; letter-spacing: 3px; text-transform: uppercase; color: #9fb6e8; }
.login-hero h1 { font-size: 56px; font-weight: 800; line-height: 1.02; margin-bottom: 18px; }
.login-hero .tag { font-size: 16px; color: #c4d2f0; max-width: 420px; line-height: 1.6; }
.login-hero .feature { display: flex; align-items: center; gap: 12px; color: #cdd9f3; font-size: 14px; margin-top: 14px; }
.login-hero .feature svg { width: 18px; height: 18px; color: #7aa0ff; flex: 0 0 auto; }
.login-hero .hero-bot { font-size: 12.5px; color: #8295c0; letter-spacing: 1px; }

/* Right form panel */
.login-form-side { display: grid; place-items: center; padding: 40px; background: var(--content-bg); }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card .lc-logo {
  width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 22px; display: grid; place-items: center;
  background: var(--navy); color: #fff; box-shadow: 0 12px 26px rgba(12,28,76,0.3);
}
.login-card .lc-logo svg { width: 30px; height: 30px; }
.login-card h2 { font-size: 26px; font-weight: 800; color: var(--navy); }
.login-card .sub { color: var(--text-muted); font-size: 14px; margin-top: 8px; margin-bottom: 30px; }
.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.12s;
}
.gbtn:hover { box-shadow: 0 10px 24px rgba(16,24,40,0.12); border-color: #cfd6e6; transform: translateY(-2px); }
.gbtn:active { transform: translateY(0) scale(0.98); }
.gbtn.loading { opacity: 0.7; pointer-events: none; }
.login-err { margin-top: 18px; color: #dc2626; font-size: 13px; min-height: 18px; }
.login-foot { margin-top: 26px; font-size: 12px; color: var(--text-muted); }

.access-notice {
  margin: 14px 0 22px;
  padding: 14px 16px;
  border: 1px solid #fde3c2;
  background: #fff8f0;
  border-radius: 12px;
  text-align: left;
}
.access-notice .an-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: #b45309;
}
.access-notice .an-badge svg { width: 14px; height: 14px; }
.access-notice p { margin: 7px 0 0; font-size: 12.5px; line-height: 1.5; color: #7c5b33; }

/* Legal pages (Terms of Service) */
.legal-wrap { min-height: 100dvh; background: var(--bg, #f4f6fb); padding: 40px 20px; }
.legal-card { max-width: 780px; margin: 0 auto; background: #fff; border: 1px solid #e6e9f0;
  border-radius: 16px; box-shadow: 0 12px 40px rgba(16,24,40,0.06); overflow: hidden; }
.legal-head { display: flex; align-items: center; gap: 16px; padding: 28px 34px;
  border-bottom: 1px solid #eef1f6; }
.legal-head .lc-logo { width: 46px; height: 46px; flex: 0 0 46px; display: flex;
  align-items: center; justify-content: center; background: #0b1e46; border-radius: 12px; }
.legal-head .lc-logo svg { width: 22px; height: 22px; stroke: #fff; }
.legal-head h1 { margin: 0; font-size: 26px; color: #0b1e46; }
.legal-sub { margin: 4px 0 0; font-size: 12px; color: var(--text-muted, #667085); }
.legal-body { padding: 26px 34px 8px; }
.legal-notice { background: #fff8f0; border: 1px solid #fde3c2; color: #7c5b33;
  border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.55; margin-bottom: 22px; }
.legal-body h2 { font-size: 15px; color: #0b1e46; margin: 22px 0 6px; }
.legal-body p { font-size: 13.5px; line-height: 1.65; color: #475467; margin: 0; }
.legal-foot { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; padding: 20px 34px 28px; border-top: 1px solid #eef1f6; margin-top: 18px; }
.legal-foot a { color: #0b57d0; text-decoration: none; font-size: 13.5px; font-weight: 600; }
.legal-foot a:hover { text-decoration: underline; }
.legal-foot .mono { font-size: 11px; color: var(--text-muted, #667085); }

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}

@media (max-width: 880px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.22s ease; z-index: 50;
    box-shadow: 0 0 40px rgba(0,0,0,0.3); width: min(300px, 84vw); }
  .sidebar.show { transform: none; }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .nav-burger { display: inline-grid; }
  .topbar { padding: 16px 18px; }
  .topbar .divider, .topbar .date { display: none; }
  .content { padding: 12px 18px 40px; }
  /* topbar: keep title + user, drop noise */
  .user-chip { padding-left: 14px; gap: 10px; }
  .user-chip .avatar { width: 36px; height: 36px; }
  body.nav-open { overflow: hidden; }
}

@media (max-width: 560px) {
  .topbar .title { font-size: 18px; }
  .user-chip .meta { display: none; }         /* just avatar on tiny screens */
  .content { padding: 10px 14px 36px; }
}

/* ===================== Dashboard ===================== */
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sec-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--navy); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.sec-ico svg { width: 22px; height: 22px; }
.sec-title h2 { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.sec-title p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.year-filter { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: var(--navy); }
.year-filter svg { width: 16px; height: 16px; }
.year-filter select { border: none; background: none; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; outline: none; font-family: inherit; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 1px 3px rgba(16,24,40,0.05); }

.dash-fm { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.fm-left { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 1px 3px rgba(16,24,40,0.05); display: flex; flex-direction: column; }
.sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sc-label { font-size: 11px; letter-spacing: 1px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.sc-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; }
.sc-ico svg { width: 17px; height: 17px; }
.sc-ico.soft { background: #eef2fc; color: var(--navy); }
.sc-ico.warn { background: #fef3e2; color: #f59e0b; }
.sc-ico.ok { background: #e7f7ee; color: #16a34a; }
.sc-value { font-size: 34px; font-weight: 800; color: var(--ink); margin-top: 14px; line-height: 1; letter-spacing: -0.5px; }
.sc-bar { height: 6px; border-radius: 99px; background: #eef1f6; margin-top: 14px; overflow: hidden; }
.sc-bar span { display: block; height: 100%; border-radius: 99px; background: #f59e0b; }
.sc-foot { font-size: 12px; color: var(--text-muted); margin-top: auto; padding-top: 12px; }

.matrix-card { padding: 22px 24px; }
.mc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.mc-head h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.mc-note { font-size: 12px; color: var(--text-muted); }
.mx-row { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 14px; margin-bottom: 14px; }
.mx-row:last-child { margin-bottom: 0; }
.mx-label { font-size: 11px; letter-spacing: 0.6px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.mx-track { height: 12px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.mx-bar { height: 100%; border-radius: 99px; min-width: 0; transition: width 0.5s ease; }
.mx-val { font-size: 14px; font-weight: 700; color: var(--ink); text-align: right; }

.donut-card { padding: 22px 24px; margin: 0; display: flex; flex-direction: column; }
.donut-card h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.donut-card .dc-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
/* center the donut + legend group vertically when the card is stretched to match its neighbour */
.donut { position: relative; width: min(190px, 100%); aspect-ratio: 1 / 1; height: auto; margin: auto auto 0; }
.donut-legend { margin-bottom: auto; }
.donut svg { width: 100%; height: 100%; transform: rotate(0deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dc-num { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1; }
.dc-lbl { font-size: 10px; letter-spacing: 1.5px; color: var(--text-muted); font-weight: 600; margin-top: 3px; }
.donut-legend { list-style: none; margin-top: 16px; }
.donut-legend li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; color: var(--ink); }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.donut-legend .lg-name { flex: 1; }
.donut-legend .lg-pct { font-weight: 700; color: var(--ink); }

.req-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 22px; }
.req-card { background: var(--card); border: 1px solid var(--border); border-left-width: 4px; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(16,24,40,0.05); }
.req-card.b-blue { border-left-color: var(--blue); }
.req-card.b-green { border-left-color: #16a34a; }
.req-card.b-red { border-left-color: #ef4444; }
.req-card.b-gray { border-left-color: #94a3b8; }
.req-card.b-orange { border-left-color: #f59e0b; }
.rc-lbl { font-size: 10.5px; letter-spacing: 0.8px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.rc-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.rc-num { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1; }
.rc-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.rc-ico svg { width: 18px; height: 18px; }
.rc-ico.blue { background: #eef2fc; color: var(--blue); }
.rc-ico.green { background: #e7f7ee; color: #16a34a; }
.rc-ico.red { background: #fdecec; color: #ef4444; }
.rc-ico.gray { background: #eef1f6; color: #64748b; }
.rc-ico.orange { background: #fef3e2; color: #f59e0b; }

.dash-cr { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.dash-cr .donut-card { order: 2; }   /* keep the donut on the right, matching section 1 */
.servicelog { padding: 0; }
.sl-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; }
.sl-head h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.sl-tabs { display: inline-flex; background: #eef1f6; border-radius: 9px; padding: 3px; }
.sl-tab { border: none; background: none; padding: 7px 16px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-muted); border-radius: 7px; cursor: pointer; font-family: inherit; }
.sl-tab.active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(16,24,40,0.12); }

@media (max-width: 1000px) {
  .dash-fm, .dash-cr { grid-template-columns: 1fr; }
  .dash-cr .donut-card { order: 0; }   /* natural stacking order on narrow screens */
  .req-cards { grid-template-columns: repeat(3, 1fr); }
  /* full-width donut card: lay donut + legend side by side so it isn't empty */
  .donut-card { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 6px 30px; align-items: center; }
  .donut-card h3, .donut-card .dc-sub { grid-column: 1 / -1; }
  .donut { margin: 10px auto; }
  .donut-legend { margin-top: 0; align-self: center; }
}

@media (max-width: 760px) {
  /* section header: let the year filter drop below the title */
  .sec-head { flex-wrap: wrap; }
  .sec-head .spacer { display: none; }
  .sec-head .year-filter { margin-left: 56px; }
  .req-cards { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  /* phones: donut back to vertical (side-by-side too cramped) */
  .donut-card { display: block; }
  .donut { margin: 18px auto 6px; }
  .donut-legend { margin-top: 16px; }
}

@media (max-width: 460px) {
  .req-cards { grid-template-columns: 1fr; }
  .matrix-card, .donut-card { padding: 18px 16px; }
  .sc-value { font-size: 30px; }
}
