/* =====================================================================
   Kotulo AHP — Project Management System
   Design system (no build step — cPanel friendly)
   ===================================================================== */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy-950: #071630;
  --navy-900: #0b1f3f;
  --navy-850: #0e2649;
  --navy-800: #12305a;
  --navy-700: #1b3f72;
  --blue: #1f6feb;
  --blue-600: #1a5fd0;
  --blue-50: #eaf2ff;
  --blue-100: #d6e6ff;
  --green: #16a34a;
  --green-50: #e8f7ee;
  --amber: #f08c1a;
  --amber-50: #fff3e3;
  --red: #e5383b;
  --red-50: #fdecec;
  --purple: #8b5cf6;
  --purple-50: #f2edfe;
  --teal: #0d9488;
  --gold: #f5a623;
  --ink: #0f1d33;
  --ink-2: #344360;
  --muted: #6b7a93;
  --faint: #98a4b8;
  --line: #e4e9f1;
  --line-2: #eef2f7;
  --bg: #eef2f7;
  --card: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 32, 64, .05), 0 1px 1px rgba(16, 32, 64, .03);
  --shadow-lg: 0 18px 50px rgba(9, 26, 54, .18);
  --sidebar: 248px;
  --topbar: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-600); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
[x-cloak] { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-sm { width: 15px; height: 15px; flex: none; }
.ic-xs { width: 13px; height: 13px; flex: none; }
.ic-lg { width: 24px; height: 24px; flex: none; }
.ic-xl { width: 30px; height: 30px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.hidden { display: none; }

/* ------------------------------------------------------------ Shell */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; background: linear-gradient(90deg, var(--navy-950) var(--sidebar), var(--bg) var(--sidebar)); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #cfd9ea; display: flex; flex-direction: column; z-index: 40;
  scrollbar-width: thin; scrollbar-color: #24406b transparent;
}
.brand {
  height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: var(--navy-950); border-bottom: 1px solid rgba(255,255,255,.06); flex: none;
}
.brand svg { width: 52px; height: 46px; flex: none; }
.brand-name { color: #fff; font-weight: 800; font-size: 20px; letter-spacing: .01em; line-height: 1.05; }
.brand-sub { color: #fff; font-size: 8.6px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; margin-top: 3px; opacity: .92; white-space: nowrap; }
.brand-loc { color: #b9c6dc; font-size: 10px; margin-top: 1px; }
.nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 13px; padding: 10px 14px; border-radius: 8px;
  color: #d5deec; font-size: 13.5px; font-weight: 500; transition: background .15s, color .15s;
}
.nav a .ic { width: 20px; height: 20px; opacity: .95; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(31,111,235,.35); }
.nav .nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #6f86aa; padding: 14px 14px 4px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 22px 18px 26px; text-align: center; color: #fff; }
.sidebar-foot svg { width: 120px; height: 64px; margin: 0 auto 6px; display: block; }
.sidebar-foot .tag { font-size: 16px; font-weight: 600; line-height: 1.3; }
.sidebar-foot .swoosh { display: block; margin: 6px auto 0; width: 140px; height: 12px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar); background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px; padding: 0 22px 0 26px; position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 22px; font-weight: 700; color: var(--ink); }
.topbar .sub { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; display: flex; gap: 10px; align-items: center; }
.topbar .sub .sep { width: 1px; height: 14px; background: #c8d1df; }
.search {
  margin-left: auto; position: relative; width: 230px;
}
.search input {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px 0 38px;
  font: inherit; color: var(--ink); background: #fff; outline: none;
}
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
.search .ic { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.search-results {
  position: absolute; top: 46px; left: 0; right: -120px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow: auto; z-index: 50;
}
.search-results a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink); align-items: flex-start; }
.search-results a:hover, .search-results a.hl { background: var(--blue-50); }
.search-results .kind { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.icon-btn {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  color: var(--ink-2); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn .dot {
  position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff;
}
.user-chip { display: flex; align-items: center; gap: 11px; cursor: pointer; padding: 4px 6px; border-radius: 10px; position: relative; }
.user-chip:hover { background: var(--line-2); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #7fb0ff, #3f7fe8);
  color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; flex: none;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.user-chip .n { font-weight: 600; font-size: 13.5px; }
.user-chip .r { color: var(--muted); font-size: 12.5px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
}
.dropdown a, .dropdown button {
  display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 7px; color: var(--ink);
  width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: var(--line-2); }
.dropdown .head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: 8px; color: var(--ink); }
.notif-item:hover { background: var(--line-2); }

.content { padding: 14px 14px 20px; display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 4px 4px 0; }
.page-head h2 { font-size: 21px; font-weight: 700; }
.page-head p { color: var(--muted); margin-top: 3px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue); }

/* ------------------------------------------------------------ Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.card-h h3 { font-size: 16px; font-weight: 700; }
.card-h .link { font-size: 12.5px; font-weight: 500; display: inline-flex; gap: 4px; align-items: center; }
.card-b { padding: 12px 18px 18px; }
.card-b.flush { padding: 0; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* ------------------------------------------------------------ Hero */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 164px;
  display: flex; align-items: stretch; background: var(--navy-900); color: #fff;
}
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(6,18,40,.88) 0%, rgba(6,18,40,.62) 32%, rgba(6,18,40,.12) 58%, rgba(6,18,40,.0) 70%);
}
.hero-in { position: relative; z-index: 2; display: flex; width: 100%; align-items: center; gap: 18px; padding: 18px 16px 18px 22px; }
.hero h2 { font-size: 29px; line-height: 1.12; font-weight: 800; text-transform: uppercase; letter-spacing: .005em; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.hero .loc { display: flex; align-items: center; gap: 9px; margin-top: 12px; font-size: 16.5px; font-weight: 500; }
.hero .loc .ic { color: var(--gold); width: 24px; height: 24px; }
.hero-stats { display: flex; align-self: flex-end; margin-left: 18px; background: rgba(8,20,42,.5); backdrop-filter: blur(3px); border-radius: 8px; }
.hero-stat { display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.hero-stat + .hero-stat { border-left: 1px solid rgba(255,255,255,.18); }
.hero-stat .ic { width: 34px; height: 34px; color: #e7eef9; }
.hero-stat b { display: block; font-size: 23px; font-weight: 700; line-height: 1.05; }
.hero-stat span { font-size: 13.5px; color: #e8eef8; }
.mix {
  margin-left: auto; background: rgba(9,22,46,.86); border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  padding: 12px 6px 10px; min-width: 430px; backdrop-filter: blur(4px);
}
.mix-t { font-size: 14px; font-weight: 600; padding: 0 12px 8px; }
.mix-cols { display: grid; grid-template-columns: repeat(3, 1fr); }
.mix-col { padding: 0 14px; }
.mix-col + .mix-col { border-left: 1px solid rgba(255,255,255,.14); }
.mix-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mix-head .ic { width: 28px; height: 28px; }
.mix-head b { font-size: 19px; font-weight: 700; display: block; line-height: 1.1; }
.mix-head span { font-size: 12px; color: #dce5f3; }
.mix-row { display: flex; justify-content: space-between; font-size: 12.5px; color: #e7eef9; padding: 1.5px 0; }
.mix-row::before { content: '▸'; color: #9fbfff; margin-right: 6px; font-size: 10px; line-height: 18px; }
.mix-row span:first-child { flex: 1; }
.mix-social .ic, .mix-social .mix-row::before { color: #5ea0ff; }
.mix-afford .ic, .mix-afford .mix-row::before { color: #35d07f; }
.mix-market .ic, .mix-market .mix-row::before { color: #ffb020; }

/* ------------------------------------------------------------ KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; gap: 14px; align-items: flex-start; padding: 16px 14px 14px; }
.kpi-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi-ic .ic { width: 26px; height: 26px; }
.kpi .t { font-size: 12px; font-weight: 600; color: var(--ink); }
.kpi .v { font-size: 15.5px; font-weight: 700; margin-top: 3px; color: var(--ink); line-height: 1.25; }
.kpi .v.big { font-size: 21px; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-purple { background: var(--purple-50); color: var(--purple); }
.tone-gray { background: var(--line-2); color: var(--muted); }
.tone-teal { background: #e6f6f4; color: var(--teal); }

.stat { padding: 16px 18px; }
.stat .t { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .delta-up { color: var(--green); font-weight: 600; }
.stat .delta-down { color: var(--red); font-weight: 600; }

/* ------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 500; font-size: 13.5px; cursor: pointer;
  background: var(--blue); color: #fff; transition: filter .15s, background .15s, box-shadow .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); color: #fff; }
.btn:active { filter: brightness(.96); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--blue-100); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; gap: 5px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-light:hover { background: var(--line-2); color: var(--ink); filter: none; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); filter: none; }
.btn-green { background: var(--green); }
.btn-amber { background: var(--amber); }
.btn-red { background: var(--red); }
.btn-purple { background: var(--purple); }
.btn-soft { background: var(--blue-50); color: var(--blue); }
.btn-soft:hover { color: var(--blue); background: var(--blue-100); filter: none; }
.btn-soft-red { background: var(--red-50); color: var(--red); }
.btn-soft-red:hover { color: var(--red); filter: brightness(.97); }
.btn-soft-green { background: var(--green-50); color: var(--green); }
.btn-soft-green:hover { color: var(--green); filter: brightness(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Tabs / segmented */
.seg { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.seg button, .seg a {
  height: 32px; padding: 0 20px; border-radius: 6px; border: 0; background: var(--line-2); color: var(--ink-2);
  font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.seg button.on, .seg a.on { background: var(--blue); color: #fff; box-shadow: 0 3px 10px rgba(31,111,235,.3); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.tabs a, .tabs button {
  padding: 12px 14px; color: var(--muted); font-weight: 500; border: 0; background: none; font: inherit; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--blue); border-bottom-color: var(--blue); }
.tabs .count { background: var(--line-2); color: var(--ink-2); border-radius: 99px; padding: 0 7px; font-size: 11px; }
.tabs .on .count { background: var(--blue-50); color: var(--blue); }

/* ------------------------------------------------------------ Badges & bars */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge.green { background: var(--green-50); color: #15803d; }
.badge.amber { background: var(--amber-50); color: #c2610c; }
.badge.red { background: var(--red-50); color: #c81e1e; }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.purple { background: var(--purple-50); color: #7040e0; }
.badge.gray { background: var(--line-2); color: var(--muted); }
.badge.dark { background: var(--navy-800); color: #fff; }
.dot-s { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.bar { height: 8px; border-radius: 99px; background: #e3e8f0; overflow: hidden; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--blue); }
.bar > i.green { background: var(--green); }
.bar > i.amber { background: var(--amber); }
.bar > i.red { background: var(--red); }
.bar > s { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; text-decoration: none; }
.bar.thin { height: 5px; }
.bar.thick { height: 12px; }

/* ------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--ink-2); background: #f4f7fb; padding: 9px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #fafcff; }
.t .num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tfoot td { background: #f4f7fb; font-weight: 700; border-top: 1px solid var(--line); }
.t.compact th { padding: 7px 8px; font-size: 11px; }
.t.compact td { padding: 6px 8px; font-size: 12px; }
.t .row-link { color: var(--ink); font-weight: 500; }
.t .row-link:hover { color: var(--blue); }
.t tr.group td { background: #f8fafd; font-weight: 600; color: var(--ink-2); font-size: 12px; }
.t td.desc { max-width: 520px; }
.inner-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }

/* ------------------------------------------------------------ Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; border: 1px solid #d6dde8; border-radius: 8px; padding: 0 12px; font: inherit; color: var(--ink);
  background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
.input.sm { height: 32px; font-size: 12.5px; padding: 0 9px; }
.input[readonly] { background: #f6f8fb; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.err { color: var(--red); font-size: 12px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.filters .input { width: auto; min-width: 150px; height: 34px; font-size: 13px; }

/* ------------------------------------------------------------ Drawer / modal */
.overlay { position: fixed; inset: 0; background: rgba(8, 20, 42, .45); z-index: 80; backdrop-filter: blur(1.5px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: #fff; z-index: 90;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.wide { width: min(920px, 100%); }
.drawer-h { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.drawer-h h3 { font-size: 17px; }
.drawer-b { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #fafbfd; }
.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100% - 32px));
  background: #fff; border-radius: 14px; z-index: 90; box-shadow: var(--shadow-lg);
}

/* ------------------------------------------------------------ Empty states */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .art { color: #a9b6ca; margin: 0 auto 12px; display: block; }
.empty h4 { color: var(--ink-2); font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.empty p { font-size: 12.5px; max-width: 360px; margin: 0 auto; }
.empty-row { display: flex; gap: 14px; align-items: center; padding: 6px 2px; }
.empty-row .ic-wrap { width: 46px; height: 46px; border-radius: 50%; background: #eef2f8; display: grid; place-items: center; color: #8492a8; flex: none; }
.empty-row b { font-size: 13px; font-weight: 600; color: var(--ink); display: block; }
.empty-row span { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------ Dashboard specifics */
.dash-row-1 { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.4fr) minmax(0, .9fr); gap: 14px; }
.dash-row-2 { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1.02fr) minmax(0, .84fr); gap: 14px; }
.side-stack { display: flex; flex-direction: column; gap: 14px; }

.gantt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.gantt th { font-weight: 500; color: var(--ink-2); font-size: 12px; padding: 7px 0; text-align: center; border-bottom: 1px solid var(--line); background: #f6f8fb; }
.gantt th:first-child { text-align: left; padding-left: 8px; width: 132px; }
.gantt td { height: 25px; border-bottom: 1px solid #f1f4f8; position: relative; padding: 0; }
.gantt td:first-child { padding-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 132px; }
.gantt .track { position: relative; height: 25px; }
.gantt .track .gl { position: absolute; top: 0; bottom: 0; width: 1px; background: #eef1f6; }
.gantt .b-plan { position: absolute; top: 6px; height: 13px; border-radius: 3px; background: #c9dcfb; }
.gantt .b-act { position: absolute; top: 6px; height: 13px; border-radius: 3px; background: var(--blue); }
.gantt .b-crit { background: var(--red) !important; }
.gantt .today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--amber); z-index: 2; }
.gantt .stat-pill { position: absolute; right: 4px; top: 4px; }
.legend { display: flex; gap: 22px; justify-content: center; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; }

.ms-list { list-style: none; margin: 0; padding: 4px 0 0; position: relative; }
.ms-list::before { content: ''; position: absolute; left: 13px; top: 18px; bottom: 18px; width: 2px; background: #e1e7f0; }
.ms-list li { display: flex; align-items: center; gap: 14px; padding: 6.5px 0; position: relative; font-size: 12.5px; }
.ms-dot { width: 28px; display: grid; place-items: center; z-index: 1; }
.ms-dot i { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #b5c0d1; display: block; }
.ms-dot.done i { background: var(--green); border-color: var(--green); }
.ms-dot.late i { background: var(--red); border-color: var(--red); }
.ms-dot.risk i { background: var(--amber); border-color: var(--amber); }
.ms-dot.up i { border-color: var(--blue); }
.ms-list .nm { flex: 1; color: var(--ink); }

.blocks-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.blocks-grid.row2 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; }
.blk {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 9px 9px; min-width: 0; background: #fff; color: var(--ink);
  transition: border .15s, box-shadow .15s, transform .15s; display: block;
}
.blk:hover { border-color: var(--blue-100); box-shadow: 0 6px 18px rgba(16,40,90,.08); transform: translateY(-1px); color: var(--ink); }
.blk-h { display: flex; gap: 7px; align-items: center; min-width: 0; }
.blk-h .ic { width: 20px; height: 20px; flex: none; }
.blk-h > div { min-width: 0; }
.blk-h b { font-size: 12.5px; display: block; white-space: nowrap; letter-spacing: -.01em; }
.blk-h span { font-size: 10.5px; color: var(--muted); white-space: nowrap; display: block; }
.blk .bar { margin-top: 12px; }
.blk .cap { font-size: 10.5px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }
.blk.type-A .blk-h .ic { color: #2f7cf6; }
.blk.type-B .blk-h .ic { color: #16a34a; }
.blk.type-C .blk-h .ic { color: #f08c1a; }

.qa { display: flex; align-items: center; gap: 18px; padding: 14px 18px; }
.qa h3 { font-size: 17px; font-weight: 700; white-space: nowrap; margin-right: 8px; }
.qa .btn { flex: 1; height: 38px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.feed li:last-child { border-bottom: 0; }
.feed .fi { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.feed .fi .ic { width: 15px; height: 15px; }
.feed .ft { font-size: 12.5px; color: var(--ink); line-height: 1.35; }
.feed .fm { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Block detail: floor stack */
.floors { display: flex; flex-direction: column-reverse; gap: 6px; }
.floor { display: grid; grid-template-columns: 54px 1fr; gap: 8px; align-items: stretch; }
.floor-l { font-size: 11.5px; font-weight: 600; color: var(--muted); display: grid; place-items: center; background: #f4f7fb; border-radius: 6px; }
.floor-units { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.unit {
  border-radius: 6px; padding: 7px 8px; font-size: 11.5px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; font: inherit; font-size: 11.5px;
}
.unit b { display: block; font-size: 12px; }
.unit span { color: var(--muted); font-size: 10.5px; }
.unit.s-not_started { background: #fff; }
.unit.s-structure { background: #eaf2ff; border-color: #c4d9fb; }
.unit.s-finishes { background: #fff3e3; border-color: #fbd7a8; }
.unit.s-snagging { background: #f2edfe; border-color: #d8c9fb; }
.unit.s-complete { background: #e8f7ee; border-color: #b6e3c6; }
.unit.s-handed_over { background: #16a34a; border-color: #16a34a; color: #fff; }
.unit.s-handed_over span { color: #e0f5e8; }

/* Risk heat map */
.heat { display: grid; grid-template-columns: 28px repeat(5, 1fr); gap: 4px; font-size: 11px; }
.heat .c { aspect-ratio: 1.6; border-radius: 6px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.heat .ax { display: grid; place-items: center; color: var(--muted); font-weight: 600; }

/* Attendance grid */
.att td { padding: 4px !important; text-align: center; }
.att-btn { width: 30px; height: 26px; border-radius: 5px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 11px; font-weight: 700; color: var(--muted); }
.att-btn.P { background: var(--green); color: #fff; border-color: var(--green); }
.att-btn.H { background: var(--amber); color: #fff; border-color: var(--amber); }
.att-btn.A { background: var(--red-50); color: var(--red); border-color: #f6c5c5; }
.att-btn.L { background: var(--purple-50); color: var(--purple); border-color: #d8c9fb; }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 9px; font-size: 13px; }
.alert.success { background: var(--green-50); color: #14692f; border: 1px solid #c3e8d1; }
.alert.error { background: var(--red-50); color: #a51b1b; border: 1px solid #f6caca; }
.alert.info { background: var(--blue-50); color: #1849a0; border: 1px solid var(--blue-100); }
.alert.warn { background: var(--amber-50); color: #8a4a06; border: 1px solid #fbdcae; }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { box-shadow: var(--shadow-lg); min-width: 280px; }

/* Definition list */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: 13px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }

.pagination { display: flex; gap: 4px; align-items: center; justify-content: flex-end; padding: 12px 18px; }
.pagination a, .pagination span { min-width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 7px; border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; padding: 0 8px; background: #fff; }
.pagination .on { background: var(--blue); color: #fff; border-color: var(--blue); }
.pagination .off { opacity: .45; }

.chart-box { position: relative; height: 230px; }
.chart-box.tall { height: 300px; }
.chart-box.short { height: 180px; }

.ring { --p: 0; --c: var(--blue); width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #e6ebf2 0); }
.ring > div { width: 76px; height: 76px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; }
.ring b { font-size: 19px; display: block; line-height: 1; }
.ring span { font-size: 10px; color: var(--muted); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-art { position: relative; background: var(--navy-900); color: #fff; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 44px; }
.login-art .hero-art { opacity: .9; }
.login-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,18,40,.85), rgba(6,18,40,.25) 45%, rgba(6,18,40,.9)); }
.login-art > * { position: relative; z-index: 2; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.login-form form { width: min(380px, 100%); }

/* Print */
@media print {
  .sidebar, .topbar, .no-print, .qa { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ------------------------------------------------------------ Responsive */
.mobile-toggle { display: none; }
@media (max-width: 1500px) {
  .mix { min-width: 380px; }
  .hero h2 { font-size: 25px; }
  .hero-stat { padding: 8px 12px; }
}
@media (max-width: 1320px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-row-1, .dash-row-2 { grid-template-columns: 1fr 1fr; }
  .dash-row-1 > :nth-child(2) { grid-column: span 2; order: 3; }
  .dash-row-2 > :first-child { grid-column: span 2; }
  .hero-in { flex-wrap: wrap; }
  .mix { margin-left: 0; width: 100%; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar); transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-toggle { display: grid; }
  .g-4, .g-5, .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blocks-grid, .blocks-grid.row2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 260px; }
}
@media (max-width: 720px) {
  .content { padding: 10px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar h1 { font-size: 16px; }
  .topbar .sub, .user-chip .meta { display: none; }
  .kpis, .g-2, .g-3, .g-4, .g-5, .g-6, .form-grid, .form-grid.g3, .dash-row-1, .dash-row-2 { grid-template-columns: 1fr; }
  .dash-row-1 > *, .dash-row-2 > *, .span-2, .span-3 { grid-column: auto !important; }
  .blocks-grid, .blocks-grid.row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h2 { font-size: 20px; }
  .hero-stats { margin-left: 0; }
  .mix { min-width: 0; }
  .mix-cols { grid-template-columns: 1fr; gap: 10px; }
  .mix-col + .mix-col { border-left: 0; }
  .qa { flex-wrap: wrap; }
  .qa .btn { flex: 1 1 45%; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
}

/* Drawer transitions */
.tr-in { animation: drawerIn .18s ease-out; }
.tr-out { animation: drawerIn .14s ease-in reverse; }
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Mobile refinements */
@media (max-width: 1024px) {
  .app { background: var(--bg); }
  .card-f { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .card-f > * { flex: 1 1 100%; }
  .week-strip { overflow-x: auto; grid-template-columns: repeat(7, 84px) !important; }
  .page-head > div:last-child { width: 100%; }
}
