@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #1c2830;
  --green: #1b7a43;
  --green-dark: #146536;
  --green-deep: #0e5a38;
  --mint: #e7f6ee;
  --mint-2: #f3faf6;
  --page: #f4f7f5;
  --card: #ffffff;
  --line: #e6eeea;
  --muted: #6b7780;
  --danger: #b42318;
  --ok: #157a45;
  --warn: #b54708;
  --shadow: 0 1px 2px rgba(16, 40, 28, 0.04), 0 8px 24px rgba(16, 40, 28, 0.04);
  --sidebar: 292px;
  --font: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--page);
  min-height: 100vh;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-weight: 750; letter-spacing: -0.03em; }
h1 { margin: 0; font-size: 1.25rem; }
h2 { margin: 0 0 10px; font-size: .98rem; }

.shell { display: flex; min-height: 100vh; background: var(--page); }
.sidebar {
  width: var(--sidebar);
  background: #12382c;
  border-right: 1px solid #0d2b22;
  color: #d7e6de;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  padding: 16px 0 12px 12px;
  border-right: 0;
  overflow: hidden;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #12382c;
  color: white;
  border-radius: 0;
  padding: 4px 12px 14px 8px;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.brand-mark, .brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark { background: #fff; }
.brand-badge { background: #fff; }
.brand strong {
  display: block;
  font-size: .92rem;
  letter-spacing: .03em;
  font-weight: 800;
  color: #fff;
}
.brand span { display: block; font-size: .68rem; color: #b7cfc3; margin-top: 2px; line-height: 1.3; font-weight: 500; }
.nav-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}
.nav-scroll::-webkit-scrollbar { width: 2px; height: 2px; }
.nav-scroll::-webkit-scrollbar-button,
.nav-scroll::-webkit-scrollbar-button:single-button,
.nav-scroll::-webkit-scrollbar-button:vertical:start:decrement,
.nav-scroll::-webkit-scrollbar-button:vertical:end:increment,
.nav-scroll::-webkit-scrollbar-button:vertical:start:increment,
.nav-scroll::-webkit-scrollbar-button:vertical:end:decrement {
  display: none;
  width: 0;
  height: 0;
  background: none;
  border: none;
}
.nav-scroll::-webkit-scrollbar-track { background: transparent; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 99px; }
.nav-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.35); }
.nav-scroll::-webkit-scrollbar-corner { display: none; }
.nav-label {
  margin: 12px 12px 4px;
  color: #8eaa9c;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
}
.nav-item, .nav-tree summary {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #d5e5dc;
  border-radius: 10px;
  padding: 7px 12px;
  margin: 1px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.nav-ico { width: 18px; height: 18px; display: grid; place-items: center; color: #c5d9ce; flex-shrink: 0; }
.nav-ico svg, .input-ico svg, .input-end svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-item:hover, .nav-tree summary:hover { background: rgba(255,255,255,.06); }
.nav-item.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: none;
}
.nav-item.active .nav-ico { color: var(--green); }
.nav-tree { margin: 2px 0; }
.nav-tree summary { list-style: none; }
.nav-tree summary::-webkit-details-marker { display: none; }
.nav-tree summary:after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.8px solid #9db5a8;
  border-bottom: 1.8px solid #9db5a8;
  transform: rotate(45deg);
  margin-left: auto;
  margin-bottom: 4px;
}
.nav-tree[open] summary:after { transform: rotate(-135deg); margin-bottom: -2px; }
.nav-sub {
  display: grid;
  margin: 2px 8px 8px 22px;
  padding: 2px 0 2px 12px;
  border-left: 1px solid rgba(255,255,255,.16);
}
.nav-sub a {
  text-decoration: none;
  color: #c5d6cc;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
}
.nav-sub a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-sub a.active { background: #fff; color: var(--green-dark); font-weight: 700; }
.sidebar-user {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 12px 4px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 8px;
  flex-shrink: 0;
  background: #12382c;
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
}
.sidebar-meta { min-width: 0; flex: 1; }
.sidebar-meta strong, .sidebar-meta small, .who strong, .who span, .topbar-left strong, .topbar-left span { display: block; }
.sidebar-meta strong { font-size: .82rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-meta small { color: #b7cfc3; font-size: .72rem; }
.who span, .topbar-left span { color: var(--muted); font-size: .75rem; }
.logout {
  border: 1px solid rgba(255,255,255,.18);
  background: transparent;
  color: #e7f3ec;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 700;
}
.logout:hover { background: rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left strong { font-size: .95rem; }
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}
.who { text-align: right; }
.content { padding: 24px 28px 40px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.eyebrow, .gallery-kicker {
  margin: 0 0 6px;
  color: var(--green);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .72rem;
  font-weight: 800;
}
.lede { margin: 6px 0 0; color: var(--muted); max-width: 68ch; line-height: 1.55; }
.muted { color: var(--muted); }

.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-size: .92rem; }
.flash-ok { background: #e8f7ee; color: #146536; }
.flash-err { background: #fdeceb; color: #8a2c25; }

.stat-grid, .card-grid, .split-page, .report-grid, .stack, .gallery-grid { display: grid; gap: 16px; }
.stat-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.stat, .panel, .unit-card, .shot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.stat { padding: 16px 18px; }
.stat span { font-size: .8rem; font-weight: 650; }
.stat b { display: block; font-size: 1.28rem; margin-top: 4px; color: var(--green-deep); letter-spacing: -0.03em; }
.split-page { grid-template-columns: minmax(280px, 340px) 1fr; align-items: start; }
.report-grid { grid-template-columns: 1fr 1fr; }
.panel { padding: 16px 18px; }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field.inline { grid-template-columns: 1fr 1fr; gap: 10px; }
label { font-size: .82rem; font-weight: 700; color: #314049; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d9e3de;
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(27, 122, 67, .14); }
.checks { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checks input { width: auto; }

.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  background: var(--green);
  color: white;
  font-weight: 700;
}
.btn:hover { background: var(--green-dark); }
.btn.ghost { background: #fff; color: #243038; border-color: #d5e0da; }
.btn.ghost:hover { background: #f6faf7; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3c7c3; }
.btn.danger:hover { background: #fff6f5; }
.btn.view { background: #fff; color: #175cd3; border-color: #c5d4f5; }
.btn.view:hover { background: #f4f7fd; }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.small { padding: 6px 10px; font-size: .8rem; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.filters input, .filters select { max-width: 260px; }
.presensi-filters .combo-field { width: min(340px, 100%); }
.presensi-filters .combo-panel input { max-width: none; }
.activity-filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.activity-unit { width: min(320px, 100%); margin: 0; }
.activity-unit label { display: block; margin-bottom: 6px; }
.activity-tools { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; }
.activity-tools input { width: min(260px, 100%); }
.log-desc { display: grid; gap: 4px; min-width: 220px; }
.log-person { font-weight: 600; }
.log-unit { display: block; margin-top: 2px; font-size: .75rem; font-weight: 500; color: #2a3136; }
.presensi-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.badge.belum { background: #eef2f4; color: #5c6b74; }
.btn.leave { background: #b54708; }
.btn.leave:hover { background: #8a3706; }
.presensi-filters > input, .presensi-filters > .btn { margin-bottom: 0; }

.table-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.indicator-toolbar { justify-content: space-between; align-items: flex-end; gap: 12px; }
.combo-field { margin: 0; width: min(420px, 100%); }
.combo { position: relative; }
.combo-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #d9e3de;
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  cursor: pointer;
  text-align: left;
}
.combo-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-trigger svg { width: 18px; height: 18px; flex: none; color: #6b7780; }
.combo-trigger:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(27, 122, 67, .14); }
.combo-panel {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(16, 40, 28, .12);
}
.combo-panel input { margin-bottom: 8px; }
.combo-list { max-height: 240px; overflow: auto; }
.combo-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.combo-list button strong { display: block; color: #173026; }
.combo-list button small { color: #80909a; }
.combo-list button:hover,
.combo-list button[aria-current="true"] { background: #f7fbf8; }
.combo-empty { margin: 0; padding: 10px 12px; }
.program-picks { display: grid; gap: 8px; }
.program-pick {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.program-pick:hover { border-color: #b7d7c4; background: #f7fbf8; }
.program-pick strong, .program-chosen strong { display: block; color: #173026; }
.program-pick small, .program-chosen small { color: #80909a; }
.program-pick em { font-style: normal; color: #1f9d55; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.program-chosen {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.dialog-program { margin: -4px 0 12px; }
.entry-dialog {
  border: 0;
  border-radius: 18px;
  padding: 20px 22px 18px;
  width: min(680px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(16, 40, 28, .2);
}
.entry-dialog::backdrop { background: rgba(12, 28, 22, .46); }
.entry-form { margin: 0; }
.entry-form h2 { margin-bottom: 12px; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.entry-wide { grid-column: 1 / -1; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: #f8fbf9; }
tr:hover td { background: #fbfefc; }
.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .75rem;
  font-weight: 700;
  background: #eef2f0;
  color: #3e4b53;
}
.badge.hadir, .badge.berjalan, .badge.sesuai, .badge.selesai, .badge.A { background: #e5f6ec; color: var(--ok); }
.badge.izin, .badge.sakit, .badge.direncanakan, .badge.rencana, .badge.perlu_perbaikan, .badge.berlangsung, .badge.B, .badge.C { background: #fff4e5; color: var(--warn); }
.badge.alpha, .badge.ditunda, .badge.tidak_sesuai, .badge.D, .badge.E { background: #fdeceb; color: var(--danger); }

.unit-card {
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.unit-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(16, 50, 32, .1); }
.unit-card img, .unit-card .cover-fallback { height: 148px; width: 100%; object-fit: cover; }
.cover-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1f8a52, #0e5a38);
  color: white;
  font-weight: 800;
}
.unit-body, .shot figcaption { padding: 10px 12px 12px; display: grid; gap: 3px; }
.unit-body strong, .shot figcaption { font-size: 13px; font-weight: 700; }
.pill-soft {
  justify-self: start;
  background: var(--mint);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 800;
}
.meter { height: 8px; background: #e7f0eb; border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #1b7a43, #7dcea0); }
.list-row { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pre { white-space: pre-wrap; }
.gallery-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.shot { padding: 0; overflow: hidden; cursor: zoom-in; display: flex; flex-direction: column; }
.shot img { width: 100%; height: 180px; object-fit: cover; }
.shot figcaption { color: #314049; font-weight: 650; }

.galeri-body { background: var(--page); min-height: 100vh; }
.auth-body {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.08), transparent 28%),
    linear-gradient(160deg, #0f6a40 0%, #0c5534 55%, #0a4630 100%);
  min-height: 100vh;
}
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.story-pane {
  color: white;
  padding: 44px 40px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100vh;
  justify-content: flex-start;
}
.story-brand { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
.story-brand strong { display: block; font-size: 1.05rem; }
.story-brand span { display: block; color: #d7f3e4; font-size: .82rem; }
.portal-pill {
  display: inline-flex;
  background: #d9f5e6;
  color: #146536;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 800;
}
.story-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 7vh;
  min-height: 0;
}
.story-copy-block { margin-top: 0; }
.story-copy-block h1 { font-size: clamp(1.45rem, 2vw, 1.85rem); max-width: 100%; line-height: 1.25; margin: 12px 0 8px; }
.story-copy-block p { margin: 0; max-width: 52ch; color: #e7f6ee; line-height: 1.5; font-size: 13.5px; }
.gallery-block { margin-top: 22px; }
.gallery-kicker { color: #d7f3e4; }
.mini-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.unit-tile {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #173026;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
  transition: transform .16s ease;
}
.unit-tile:hover { transform: translateY(-3px); }
.tile-photo { display: block; background: #d7e8dc; }
.tile-photo img, .tile-photo .cover-fallback { width: 100%; height: 92px; object-fit: cover; }
.tile-copy { padding: 8px 8px 10px; display: grid; gap: 2px; }
.tile-copy strong { font-size: 12px; line-height: 1.3; font-weight: 700; }
.tile-copy small { color: #66756e; font-size: 11px; }
.login-pane {
  background: #f7f8f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  min-height: 100vh;
}
.login-card { width: min(440px, 100%); }
.login-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-mark .brand-badge { background: var(--green); }
.login-mark strong { font-size: 1.15rem; letter-spacing: -0.03em; }
.login-mark span { color: #f0a202; }
.login-card h2 { font-size: 1.35rem; margin-bottom: 4px; }
.login-sub { margin: 0 0 18px; color: var(--muted); }
.login-card label { display: block; margin: 12px 0 6px; }
.input-shell { position: relative; }
.input-shell input { padding-left: 42px; padding-right: 42px; background: #fff; }
.input-ico, .input-end {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #8b9790;
  display: grid;
  place-items: center;
}
.input-ico { left: 14px; }
.input-end {
  right: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.input-end:hover { background: #f3f6f4; }
.login-note {
  margin: 14px 0;
  background: #e8f6ee;
  color: #1d5c3b;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: .9rem;
}
.login-submit { width: 100%; border-radius: 12px; padding: 13px 16px; font-size: 1rem; margin-top: 16px; }
.login-help, .login-demo { text-align: center; color: var(--muted); font-size: .88rem; }
.login-help a, .back-link { color: var(--green); font-weight: 800; text-decoration: none; }
.login-demo { margin-top: 8px; }
.galeri-page { max-width: 1080px; margin: 0 auto; padding: 28px 20px 48px; }
.galeri-hero {
  margin: 16px 0 18px;
  background: white;
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}
.galeri-hero p { margin: 0; color: var(--muted); }
.galeri-hero h1 { margin: 6px 0 8px; color: #143226; }
.galeri-hero small { color: var(--green-dark); font-weight: 700; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 24, 16, .82);
  display: none;
  place-items: center;
  padding: 24px;
  z-index: 40;
}
.lightbox.open { display: grid; }
.lightbox img { max-height: 82vh; border-radius: 16px; background: white; }

.dash {
  position: relative;
  margin: -24px -28px -40px;
  padding: 22px 28px 28px;
  background: linear-gradient(#f3f7fb, #f7faf8 62%);
  overflow: hidden;
}
.dash-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dash-head > div:nth-child(2) { flex: 1; min-width: 0; }
.dash-filter { display: grid; gap: 4px; min-width: 240px; }
.dash-filter label { font-size: .75rem; color: #667680; }
.dash-filter select { background: #fff; border-radius: 12px; padding: 9px 12px; }
.dash-leaf {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #e7f8ee;
  color: #1f9d55;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.dash-leaf svg, .metric-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dash-head h1 { font-size: 1.55rem; color: #173026; }
.dash-head p { margin: 2px 0 0; color: #7b8790; font-size: .92rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.metric, .dash-card {
  background: #fff;
  border: 1px solid #e7eef2;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(24, 49, 38, .04);
}
.metric { padding: 14px 16px 8px; min-height: 148px; position: relative; }
.metric-top, .metric-value, .dash-card-head, .dash-card-title, .act-row, .todo-row, .real-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.metric-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.metric-ico.sm { width: 32px; height: 32px; border-radius: 10px; }
.metric-ico.sm svg { width: 16px; height: 16px; }
.metric-ico.green { background: #e7f8ee; color: #1f9d55; }
.metric-ico.blue { background: #e8f3ff; color: #2f86e0; }
.metric-ico.amber { background: #fff4df; color: #e09a14; }
.metric-ico.violet { background: #f3eefe; color: #7c5cdb; }
.metric-ico.rose { background: #fdecef; color: #e25b73; }
.metric-info {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #d5dee6;
  color: #9aa7b2;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.metric-label { margin: 12px 0 2px; color: #5f6d76; font-weight: 650; }
.metric-value { justify-content: flex-start; align-items: baseline; }
.metric-value strong { font-size: 1.7rem; letter-spacing: -0.04em; color: #173026; }
.metric-delta { color: #1f9d55; font-weight: 800; font-size: .82rem; }
.metric-caption { margin: 0; color: #8b97a0; font-size: .78rem; }
.spark { width: 92px; height: 36px; margin-left: auto; display: block; }
.spark-area { fill: rgba(31, 157, 85, .16); }
.spark-line { fill: none; stroke: #2fbe6e; stroke-width: 2; }
.spark-blue .spark-area { fill: rgba(58, 160, 245, .16); }
.spark-blue .spark-line { stroke: #3aa0f5; }
.spark-amber .spark-area { fill: rgba(240, 180, 41, .2); }
.spark-amber .spark-line { stroke: #f0b429; }
.spark-violet .spark-area { fill: rgba(124, 107, 240, .16); }
.spark-violet .spark-line { stroke: #7c6bf0; }
.dash-mid, .dash-bottom { display: grid; gap: 14px; margin-bottom: 14px; }
.dash-mid { grid-template-columns: 1.15fr .95fr 1fr; }
.dash-bottom { grid-template-columns: 1.15fr 1.05fr .9fr; }
.dash-card { padding: 16px 16px 12px; }
.dash-card h2 { margin: 0; font-size: .98rem; }
.dash-card-head { justify-content: flex-start; align-items: flex-start; margin-bottom: 12px; }
.dash-card-head p { margin: 2px 0 0; color: #8b97a0; font-size: .78rem; }
.dash-card-head.split { justify-content: space-between; align-items: center; }
.dash-link { color: #1f9d55; font-weight: 800; text-decoration: none; font-size: .82rem; white-space: nowrap; }
.vbars { display: flex; align-items: flex-end; gap: 10px; height: 196px; padding-top: 8px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.vbar-val { font-size: .75rem; font-weight: 800; color: #314049; }
.vbar-track { flex: 1; width: 100%; max-width: 42px; display: flex; align-items: flex-end; margin: 6px 0; }
.vbar-track span { display: block; width: 100%; border-radius: 8px 8px 4px 4px; min-height: 8px; }
.vbar-name { font-size: .72rem; color: #667680; text-align: center; line-height: 1.2; }
.donut-wrap { display: flex; align-items: center; gap: 16px; min-height: 180px; }
.donut { position: relative; width: 148px; height: 148px; flex-shrink: 0; }
.donut svg { width: 100%; height: 100%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.donut-center strong { font-size: 1.35rem; color: #173026; }
.donut-center span { color: #8b97a0; font-size: .75rem; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.donut-legend li { display: grid; grid-template-columns: 10px 1fr; gap: 2px 8px; align-items: center; }
.donut-legend i { width: 10px; height: 10px; border-radius: 50%; grid-row: span 2; }
.donut-legend span { color: #5f6d76; }
.donut-legend b { color: #173026; font-size: .82rem; }
.real-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-bottom: 14px; }
.real-copy { min-width: 0; }
.real-top { justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.real-top strong { font-size: .84rem; }
.real-top span, .real-row > b { color: #667680; font-size: .78rem; white-space: nowrap; }
.real-row > b { color: #173026; font-size: .9rem; }
.trend { width: 100%; height: auto; overflow: visible; }
.trend-axis, .trend-label { fill: #8b97a0; font-size: 11px; }
.trend-val { fill: #1f9d55; font-size: 11px; font-weight: 700; }
.trend-grid { stroke: #eef2f4; stroke-width: 1; }
.trend-area { fill: rgba(47, 190, 110, .18); }
.trend-line { fill: none; stroke: #2fbe6e; stroke-width: 2.5; }
.trend-dot { fill: #fff; stroke: #2fbe6e; stroke-width: 2; }
.act-row { justify-content: flex-start; padding: 10px 0; border-top: 1px solid #f0f4f6; }
.act-row strong, .todo-row strong { display: block; font-size: .88rem; }
.act-row span, .todo-row small { color: #80909a; font-size: .75rem; }
.act-row .badge { margin-left: auto; }
.todo-row {
  text-decoration: none;
  background: #fff5f6;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  justify-content: flex-start;
}
.todo-row small { display: block; }
.todo-go { margin-left: auto; color: #e25b73; font-size: 1.2rem; font-weight: 700; }
@media (max-width: 1100px) {
  .stat-grid, .split-page, .report-grid { grid-template-columns: 1fr; }
  .metric-grid, .dash-mid, .dash-bottom { grid-template-columns: 1fr 1fr; }
  .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .login-split { grid-template-columns: 1fr; }
  .story-pane { min-height: auto; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    z-index: 30;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 16px 0 40px rgba(0,0,0,.08);
  }
  body.nav-open .sidebar { transform: none; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .stat-grid, .metric-grid, .dash-mid, .dash-bottom { grid-template-columns: 1fr; }
  .dash { margin: -16px -16px -40px; padding: 16px 16px 24px; }
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .sidebar, .topbar, .no-print, .flash { display: none !important; }
  .shell, .main, .content { display: block; padding: 0; background: white; }
  .panel, .stat { box-shadow: none; }
}
