:root {
  --ink: #17231f;
  --ink-soft: #4e625a;
  --muted: #788b83;
  --line: #dfe8e3;
  --line-strong: #cbd9d1;
  --surface: #ffffff;
  --canvas: #f3f7f5;
  --canvas-deep: #e9f1ed;
  --forest: #10231d;
  --forest-2: #17342a;
  --emerald: #20a878;
  --emerald-dark: #157a58;
  --mint: #d9f5e9;
  --amber: #c47b0b;
  --amber-soft: #fff2d6;
  --red: #bd3d3d;
  --red-soft: #fde7e7;
  --blue: #2974b8;
  --blue-soft: #e5f1fc;
  --shadow-xs: 0 1px 2px rgba(16, 35, 29, .05);
  --shadow-sm: 0 8px 24px rgba(16, 35, 29, .06);
  --shadow-md: 0 18px 50px rgba(16, 35, 29, .12);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 256px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--emerald-dark); text-decoration: none; }
a:hover { color: var(--emerald); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { letter-spacing: -.025em; }

:focus-visible {
  outline: 3px solid rgba(32, 168, 120, .28);
  outline-offset: 2px;
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  color: #dce9e3;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(46, 178, 128, .17), transparent 62%),
    linear-gradient(165deg, #122a22 0%, var(--forest) 58%, #0b1a15 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 18px 20px;
  color: #f5fbf8;
}

.brand:hover { color: #fff; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #73e3b7;
  border: 1px solid rgba(115, 227, 183, .22);
  border-radius: 13px;
  background: rgba(115, 227, 183, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.brand-mark svg { width: 27px; height: 27px; }

.brand-copy { display: flex; flex-direction: column; line-height: 1.18; }
.brand-copy strong { font-size: 20px; letter-spacing: -.04em; color: #f7fbf9; }
.brand-copy small { margin-top: 3px; font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #83a89a; text-transform: uppercase; }

.main-nav { flex: 1; padding: 9px 13px 22px; }

.nav-label {
  display: block;
  padding: 17px 12px 7px;
  color: #719487;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin: 2px 0;
  padding: 10px 12px;
  color: #b9cec5;
  border-radius: 10px;
  font-weight: 550;
  transition: color .15s ease, background .15s ease;
}

.nav-link svg { width: 19px; height: 19px; flex: 0 0 19px; fill: currentColor; opacity: .87; }
.nav-link:hover { color: #f5fbf8; background: rgba(255, 255, 255, .055); }
.nav-link.active { color: #f5fffb; background: rgba(66, 199, 149, .14); }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -13px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: #67dfb2;
}

.sidebar-foot { padding: 14px 14px 18px; border-top: 1px solid rgba(255, 255, 255, .07); }
.user-card { display: flex; gap: 10px; align-items: center; min-width: 0; padding: 7px 5px 13px; }
.avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  color: #0e3226;
  border-radius: 50%;
  background: #a8f2d4;
  font-size: 14px;
  font-weight: 800;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta strong { overflow: hidden; color: #f0f8f4; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { overflow: hidden; color: #82a397; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-actions { display: flex; gap: 6px; align-items: center; }
.sidebar-actions form { margin: 0; }
.icon-link {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #8faf9f;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
}
.icon-link:hover { color: #e8f7f0; border-color: rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .06); }
.icon-link svg { width: 17px; height: 17px; fill: currentColor; }

.sidebar-scrim { display: none; }

.app-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 18px;
  align-items: center;
  min-height: 78px;
  padding: 15px clamp(20px, 3.5vw, 46px);
  border-bottom: 1px solid rgba(203, 217, 209, .65);
  background: rgba(243, 247, 245, .88);
  backdrop-filter: blur(16px);
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 8px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.menu-button svg { width: 22px; height: 22px; fill: currentColor; }

.topbar-copy { flex: 1; min-width: 0; }
.eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--emerald-dark);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.topbar h1 { margin: 0; font-size: clamp(20px, 2vw, 26px); line-height: 1.2; font-weight: 720; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.today { color: var(--ink-soft); font-size: 12px; white-space: nowrap; }

.mode-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 5px 10px;
  color: #8a620e;
  border: 1px solid #f0dcae;
  border-radius: 999px;
  background: #fff8e8;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.mode-pill.live { color: #167451; border-color: #b9e8d6; background: #ecfbf4; }
.mode-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.content {
  flex: 1;
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: clamp(22px, 3.2vw, 40px) clamp(18px, 3.5vw, 46px) 36px;
}

.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 19px clamp(20px, 3.5vw, 46px) 25px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 11.5px;
}

/* Page building blocks */
.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 23px;
}
.page-head h2 { margin: 0 0 4px; font-size: 19px; font-weight: 700; }
.page-head p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.card-body { padding: 22px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-main { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 130px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -36px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--canvas-deep);
  opacity: .6;
}
.stat-top { display: flex; gap: 12px; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.stat-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--canvas); }
.stat-icon svg { width: 17px; height: 17px; fill: var(--emerald-dark); }
.stat-value { position: relative; z-index: 1; margin-top: 15px; font-size: clamp(22px, 2.3vw, 29px); font-weight: 760; letter-spacing: -.045em; line-height: 1; }
.stat-value small { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.stat-foot { position: relative; z-index: 1; display: flex; gap: 5px; align-items: center; margin-top: 11px; color: var(--muted); font-size: 11px; }
.stat-foot.positive { color: var(--emerald-dark); }
.stat-foot.warning { color: var(--amber); }

.money { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Buttons */
.btn {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  padding: 8px 14px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { color: var(--ink); border-color: #aebfb6; background: #fbfdfc; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; fill: currentColor; }
.btn-primary { color: #fff; border-color: var(--emerald-dark); background: var(--emerald-dark); box-shadow: 0 4px 12px rgba(21, 122, 88, .2); }
.btn-primary:hover { color: #fff; border-color: #116244; background: #116244; }
.btn-danger { color: var(--red); border-color: #efcaca; background: #fff; }
.btn-danger:hover { color: #a72f2f; border-color: #e0adad; background: #fff8f8; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-sm { min-height: 32px; padding: 6px 10px; border-radius: 8px; font-size: 11px; }
.btn-block { width: 100%; }
.btn:disabled { cursor: not-allowed; opacity: .55; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field > label, .form-label { color: var(--ink); font-size: 11.5px; font-weight: 650; }
.field .hint { color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.input, .select, .textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: #fff;
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 92px; resize: vertical; }
.select { padding-right: 30px; }
.input:hover, .select:hover, .textarea:hover { border-color: #b8c9c0; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(32, 168, 120, .12); }
.input::placeholder, .textarea::placeholder { color: #a4b2ab; }
.input:disabled, .select:disabled, .textarea:disabled { color: #77857e; background: #f4f7f5; cursor: not-allowed; }
.input[type="date"], .input[type="month"] { min-height: 40px; }
.field-error, .text-danger { color: var(--red); font-size: 10.5px; }
.validation-summary-errors { margin-bottom: 15px; padding: 10px 13px; color: var(--red); border: 1px solid #efcaca; border-radius: 9px; background: #fff7f7; font-size: 11.5px; }
.validation-summary-errors ul { margin: 0; padding-left: 17px; }
.validation-summary-valid { display: none; }

.check { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 12.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--emerald-dark); }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th {
  padding: 11px 15px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fafcfb;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .09em;
  text-align: left;
  text-transform: uppercase;
}
.data-table td { padding: 13px 15px; border-bottom: 1px solid #eaf0ed; font-size: 12.5px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .strong { font-weight: 650; }
.data-table .sub { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; font-weight: 400; white-space: normal; }
.data-table .actions { text-align: right; }
.row-actions { display: inline-flex; gap: 5px; align-items: center; }
.link-action { color: var(--emerald-dark); font-size: 11.5px; font-weight: 650; }
.link-action:hover { text-decoration: underline; text-underline-offset: 2px; }

.empty-state { padding: 54px 25px; color: var(--muted); text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; color: #8aa096; border-radius: 16px; background: var(--canvas); }
.empty-state-icon svg { width: 24px; height: 24px; fill: currentColor; }
.empty-state h3 { margin: 0 0 4px; color: var(--ink); font-size: 14px; }
.empty-state p { max-width: 380px; margin: 0 auto 16px; font-size: 12px; }

/* Badges and misc */
.badge {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { color: #13714f; background: #e2f7ed; }
.badge-amber { color: #93600c; background: var(--amber-soft); }
.badge-red { color: #a53232; background: var(--red-soft); }
.badge-blue { color: #236aa6; background: var(--blue-soft); }
.badge-gray { color: #5e6d66; background: #edf1ef; }
.badge-plain::before { display: none; }

.alert { margin-bottom: 19px; padding: 12px 15px; border: 1px solid transparent; border-radius: 10px; font-size: 12.5px; }
.alert-success { color: #125f43; border-color: #bde9d6; background: #edfbf4; }
.alert-error { color: #9c3030; border-color: #f0c6c6; background: #fff5f5; }
.alert-info { color: #275f89; border-color: #c9e2f5; background: #f1f9ff; }
.notice { display: flex; gap: 10px; padding: 13px 15px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; font-size: 11.5px; }
.notice strong { color: var(--ink); }

.divider { height: 1px; margin: 20px 0; border: 0; background: var(--line); }
.section-title { margin: 0 0 3px; font-size: 14px; font-weight: 700; }
.section-desc { margin: 0 0 18px; color: var(--muted); font-size: 11.5px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px !important; }
.mt-2 { margin-top: 14px !important; }
.mt-3 { margin-top: 22px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 14px !important; }
.mb-3 { margin-bottom: 22px !important; }
.w-100 { width: 100%; }
.text-right { text-align: right; }
.text-muted { color: var(--muted) !important; }
.text-soft { color: var(--ink-soft) !important; }
.text-green { color: var(--emerald-dark) !important; }
.text-red { color: var(--red) !important; }
.text-amber { color: var(--amber) !important; }
.text-lg { font-size: 18px !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .94em; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
}
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.toolbar .input, .toolbar .select { min-height: 35px; padding-top: 6px; padding-bottom: 6px; font-size: 11.5px; }
.toolbar .input { width: 210px; }
.toolbar .select { width: auto; min-width: 125px; }
.search-box { position: relative; }
.search-box .input { padding-left: 32px; }
.search-box svg { position: absolute; top: 10px; left: 10px; width: 15px; height: 15px; fill: var(--muted); pointer-events: none; }
.result-count { color: var(--muted); font-size: 11px; }

/* Dashboard */
.chart-card { min-height: 295px; }
.bars { display: flex; gap: clamp(10px, 2.4vw, 22px); align-items: flex-end; height: 190px; padding: 18px 6px 0; }
.bar-col { display: flex; flex: 1; flex-direction: column; gap: 8px; align-items: center; justify-content: flex-end; height: 100%; min-width: 30px; }
.bar-track { position: relative; display: flex; width: 100%; max-width: 43px; flex: 1; align-items: flex-end; border-radius: 7px 7px 3px 3px; background: #f0f5f2; }
.bar-fill { width: 100%; min-height: 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #4bd3a7, var(--emerald-dark)); transition: height .4s ease; }
.bar-fill.alt { background: linear-gradient(180deg, #a3dfcb, #6fbfa5); }
.bar-col:hover .bar-fill { filter: brightness(1.04); }
.bar-label { color: var(--muted); font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.bar-value { color: var(--ink-soft); font-size: 9.5px; font-weight: 600; white-space: nowrap; }

.donut-wrap { display: flex; gap: 19px; align-items: center; justify-content: center; min-height: 160px; }
.donut {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
  border-radius: 50%;
  background: conic-gradient(var(--emerald) 0 var(--p1), #f1c15d var(--p1) var(--p2), #e6eeea var(--p2) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .02);
}
.donut-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 88px; height: 88px; border-radius: 50%; background: #fff; }
.donut-inner strong { font-size: 20px; letter-spacing: -.04em; }
.donut-inner small { color: var(--muted); font-size: 9.5px; }
.legend { display: flex; flex-direction: column; gap: 11px; }
.legend-item { display: flex; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 11px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); }
.legend-dot.amber { background: #f1c15d; }
.legend-dot.gray { background: #dbe5e0; }
.legend-item strong { color: var(--ink); font-size: 11px; }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px solid #edf2ef; }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; border-radius: 9px; background: var(--canvas); font-size: 13px; }
.activity-copy { min-width: 0; }
.activity-copy strong { display: block; overflow: hidden; font-size: 11.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.activity-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.activity-amount { margin-left: auto; color: var(--emerald-dark); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-link { display: flex; gap: 9px; align-items: center; padding: 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; font-size: 11px; font-weight: 600; }
.quick-link:hover { color: var(--emerald-dark); border-color: #b8ddce; background: #f3fbf7; }
.quick-link svg { width: 16px; height: 16px; fill: var(--emerald-dark); }

/* Detail */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); gap: 19px; }
.detail-list { display: flex; flex-direction: column; gap: 0; }
.detail-row { display: flex; gap: 15px; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #edf2ef; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); font-size: 11.5px; }
.detail-row dd { margin: 0; font-size: 12px; font-weight: 600; text-align: right; }
.invoice-hero { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-start; justify-content: space-between; padding: 25px; border-bottom: 1px solid var(--line); }
.invoice-hero h3 { margin: 0 0 4px; font-size: 19px; }
.invoice-hero p { margin: 0; color: var(--muted); font-size: 11.5px; }
.invoice-total { text-align: right; }
.invoice-total small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; }
.invoice-total strong { font-size: 26px; letter-spacing: -.04em; }
.line-summary { display: flex; flex-direction: column; gap: 8px; max-width: 360px; margin-left: auto; }
.line-summary > div { display: flex; gap: 30px; justify-content: space-between; color: var(--ink-soft); font-size: 12px; }
.line-summary .grand { margin-top: 5px; padding-top: 11px; color: var(--ink); border-top: 1px solid var(--line); font-size: 14px; font-weight: 750; }

/* WhatsApp previews */
.wa-preview {
  max-width: 350px;
  padding: 14px 15px;
  color: #1f2c27;
  border: 1px solid #d6e9df;
  border-radius: 4px 14px 14px 14px;
  background: #e9f8ef;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.wa-preview::before { content: "Pratinjau pesan"; display: block; margin-bottom: 7px; color: #658075; font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.message-body { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 11px; }
.wa-log-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.wa-log-card:last-child { border-bottom: 0; }
.wa-log-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #e8f8f0; color: var(--emerald-dark); }
.wa-log-icon svg { width: 20px; height: 20px; fill: currentColor; }
.wa-log-main { min-width: 0; }
.wa-log-main strong { display: block; font-size: 12px; }
.wa-log-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.wa-log-main .message-body { margin-top: 7px; }

/* Reports */
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric { padding: 17px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.metric small { display: block; color: var(--muted); font-size: 10px; font-weight: 650; }
.metric strong { display: block; margin-top: 6px; font-size: 20px; letter-spacing: -.035em; }
.progress-list { display: flex; flex-direction: column; gap: 16px; }
.progress-item .progress-head { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 6px; color: var(--ink-soft); font-size: 11px; }
.progress-head strong { color: var(--ink); }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf2ef; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--emerald); }
.progress-fill.amber { background: #dfa63c; }
.progress-fill.blue { background: #5b9ad1; }

/* Login */
.auth-body { background: #eaf1ed; }
.auth-shell { display: grid; grid-template-columns: minmax(400px, 1.05fr) minmax(440px, .95fr); min-height: 100vh; }
.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 25px clamp(35px, 5vw, 75px) 29px;
  color: #dce9e3;
  background:
    radial-gradient(95% 70% at 5% 0%, rgba(51, 188, 136, .2), transparent 65%),
    radial-gradient(70% 70% at 100% 100%, rgba(45, 119, 91, .14), transparent 65%),
    linear-gradient(160deg, #132b23 0%, var(--forest) 62%, #0a1814 100%);
}
.auth-story::after {
  content: "";
  position: absolute;
  right: -160px;
  bottom: -220px;
  width: 540px;
  height: 540px;
  border: 1px solid rgba(118, 217, 177, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(118, 217, 177, .025), 0 0 0 140px rgba(118, 217, 177, .018);
  pointer-events: none;
}
.brand-light { padding: 0; min-height: 0; }
.auth-message { position: relative; z-index: 1; max-width: 560px; margin: auto 0; padding: 55px 0; }
.auth-message .eyebrow { color: #72d4ad; }
.auth-message h1 { margin: 15px 0 17px; color: #f2faf6; font-size: clamp(31px, 3.4vw, 48px); font-weight: 690; letter-spacing: -.045em; line-height: 1.1; }
.auth-message p { max-width: 495px; margin-bottom: 29px; color: #9eb8ad; font-size: 13.5px; line-height: 1.75; }
.auth-points { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 20px; margin: 0; padding: 0; list-style: none; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: #c2d8ce; font-size: 11.5px; }
.auth-points span { display: grid; place-items: center; width: 23px; height: 23px; color: #76d8b0; border: 1px solid rgba(118, 216, 176, .24); border-radius: 6px; font-size: 8px; font-weight: 750; }
.auth-foot { position: relative; z-index: 1; margin: 0; color: #658477; font-size: 10.5px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 8vw; background: #f8fbf9; }
.auth-card { width: 100%; max-width: 390px; }
.auth-heading { margin-bottom: 26px; }
.auth-heading h2 { margin: 0 0 7px; font-size: 25px; letter-spacing: -.04em; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 12.5px; }
.auth-card .field { margin-bottom: 15px; }
.auth-card .input { min-height: 45px; }
.auth-tip { margin-top: 19px; padding: 12px 14px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 10.5px; line-height: 1.6; }
.auth-tip strong { color: var(--ink); }
.password-toggle { position: relative; }
.password-toggle .input { padding-right: 43px; }
.password-toggle button { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 42px; height: 100%; padding: 0; color: var(--muted); border: 0; background: transparent; }
.password-toggle svg { width: 17px; height: 17px; fill: currentColor; }
.auth-links { display: flex; justify-content: space-between; gap: 15px; margin-top: 18px; font-size: 11px; }

@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-main { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr); }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1020px) {
  .sidebar { transform: translateX(-101%); transition: transform .22s ease; box-shadow: var(--shadow-md); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-scrim { position: fixed; inset: 0; z-index: 45; display: block; background: rgba(9, 23, 18, .38); }
  .app-main { margin-left: 0; }
  .menu-button { display: grid; place-items: center; }
  .dashboard-main { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: .9fr 1.1fr; }
  .auth-message h1 { font-size: 34px; }
}

@media (max-width: 760px) {
  .topbar { min-height: 66px; gap: 10px; }
  .today { display: none; }
  .mode-pill { padding: 4px 8px; font-size: 9.5px; }
  .content { padding-top: 20px; }
  .page-head { align-items: flex-start; }
  .page-head h2 { font-size: 17px; }
  .grid-2, .grid-3, .grid-4, .form-grid, .metric-row { grid-template-columns: 1fr; }
  .stat-grid { gap: 10px; }
  .stat-card { min-height: 116px; padding: 15px; }
  .stat-value { margin-top: 12px; font-size: 23px; }
  .stat-top { font-size: 10.5px; }
  .card-head { padding: 15px 17px; }
  .card-body { padding: 17px; }
  .card-pad { padding: 17px; }
  .toolbar { align-items: stretch; }
  .toolbar form { width: 100%; }
  .toolbar .input { width: 100%; }
  .search-box { flex: 1; }
  .invoice-hero { padding: 19px; }
  .invoice-total { text-align: left; }
  .auth-shell { display: block; }
  .auth-story { min-height: auto; padding: 22px 24px 26px; }
  .auth-message { padding: 35px 0 30px; }
  .auth-message h1 { max-width: 500px; font-size: 29px; }
  .auth-message p { font-size: 12px; }
  .auth-points { gap: 8px 12px; }
  .auth-panel { min-height: calc(100vh - 240px); padding: 35px 24px 55px; }
  .auth-card { max-width: 430px; }
  .auth-foot { display: none; }
  .data-table th, .data-table td { padding: 11px 12px; }
  .wa-log-card { grid-template-columns: 38px minmax(0, 1fr); padding: 15px; }
  .wa-log-card > .badge { grid-column: 2; justify-self: start; }
}

@media (max-width: 460px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-actions { gap: 0; }
  .quick-grid { grid-template-columns: 1fr; }
  .auth-points { grid-template-columns: 1fr; }
  .bars { gap: 6px; }
}

.script-block {
  margin: 0;
  padding: 18px;
  max-height: 70vh;
  overflow: auto;
  border-radius: 14px;
  background: #0f1f1a;
  color: #d8f3e7;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
  tab-size: 2;
  border: 1px solid rgba(255, 255, 255, .08);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .topbar, .app-footer, .page-actions, .no-print, .alert { display: none !important; }
  .app-main { margin: 0; }
  .content { max-width: none; padding: 0; }
  body { background: #fff; font-size: 11px; }
  .card { border: 0; box-shadow: none; }
  .invoice-hero { padding: 0 0 18px; }
  .data-table th, .data-table td { padding: 8px; }
  a { color: inherit; }
}

/* ===== Public payment page ===== */
.pay-page { background: #eff0f0; min-height: 100vh; }
.pay-header { max-width: 1120px; margin: 0 auto; padding: 20px 20px 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pay-secure { color: #2f6b53; font-size: 12px; font-weight: 600; }
.pay-wrap { max-width: 1120px; margin: 0 auto; padding: 12px 20px 40px; }
.pay-card { background: #fff; border: 1px solid var(--line, #e3e9e5); border-radius: 18px; box-shadow: 0 12px 40px rgba(15, 23, 42, .08); overflow: hidden; }
.pay-head { padding: 24px 26px; border-bottom: 1px solid var(--line, #e3e9e5); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pay-head h1 { margin: 4px 0 4px; font-size: 26px; }
.pay-head p { margin: 0; color: #658075; }
.pay-grid { display: grid; grid-template-columns: 1.35fr .9fr; }
.pay-invoice { padding: 24px 26px; border-right: 1px solid var(--line, #e3e9e5); }
.pay-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; color: #658075; font-size: 13px; margin-bottom: 18px; }
.pay-meta strong { color: #10231d; }
.pay-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.pay-parties > div { background: #f5f8f6; border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.6; }
.pay-label { display: block; color: #658075; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; margin-bottom: 4px; }
.pay-items { width: 100%; border-collapse: collapse; }
.pay-items th, .pay-items td { padding: 10px 0; border-bottom: 1px solid var(--line, #e3e9e5); text-align: left; }
.pay-items th.num, .pay-items td.num { text-align: right; }
.pay-totals { margin-top: 16px; display: grid; gap: 6px; }
.pay-totals > div { display: flex; justify-content: space-between; gap: 16px; color: #658075; font-size: 13px; }
.pay-total-row { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line, #e3e9e5); color: #10231d !important; font-size: 15px !important; }
.pay-total-row strong { font-size: 24px; color: #b42318; }
.pay-side { padding: 24px 22px; background: #fafbfc; }
.pay-side h2 { margin: 0 0 4px; font-size: 18px; }
.channel-list { display: grid; gap: 8px; margin-top: 14px; }
.channel-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line, #e3e9e5); border-radius: 10px; cursor: pointer; background: #fff; font-size: 13px; }
.channel-item:hover { border-color: #9fd3ba; }
.channel-item:has(input:checked) { border-color: #2f8f63; background: #ecfdf3; }
.channel-item input { accent-color: #2f8f63; }
.channel-name { flex: 1; font-weight: 600; }
.channel-fee { color: #2f6b53; font-size: 11px; }
.pay-bank { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line, #e3e9e5); font-size: 13px; line-height: 1.7; }
.pay-foot { padding: 14px 26px; border-top: 1px solid var(--line, #e3e9e5); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #658075; font-size: 11px; }
.pay-simple { padding: 22px 26px 26px; }
.pay-paid { padding: 6px 0; }
.pay-footer { max-width: 1120px; margin: 0 auto; padding: 0 20px 30px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: #658075; font-size: 11px; }

/* ===== Portal pelanggan ===== */
.portal-body { background: #eff0f0; min-height: 100vh; }
.portal-header { background: #fff; border-bottom: 1px solid var(--line, #e3e9e5); position: sticky; top: 0; z-index: 40; }
.portal-header-inner { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.portal-header .brand { min-width: 0; }
.portal-header .brand:hover { color: inherit; }
.portal-header .brand-copy strong { color: var(--ink); font-size: 17px; }
.portal-header .brand-copy small { color: var(--muted); }
.portal-logout { margin: 0; flex: 0 0 auto; }
.portal-main { max-width: 1120px; margin: 0 auto; padding: 22px 20px 40px; }
.portal-footer { max-width: 1120px; margin: 0 auto; padding: 0 20px 28px; }

/* Navigasi desktop */
.portal-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.portal-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 10px;
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    transition: background .15s ease, color .15s ease;
}
.portal-nav-link svg { width: 17px; height: 17px; fill: currentColor; flex: 0 0 auto; }
.portal-nav-link:hover { color: var(--emerald-dark); background: #f2f8f5; }
.portal-nav-link.active { color: var(--emerald-dark); background: var(--mint); }
.portal-nav-link:focus-visible { outline: 3px solid rgba(32, 168, 120, .28); outline-offset: 2px; }

/* Navigasi bawah (mobile) */
.portal-bottom-nav { display: none; }

/* Beranda */
.portal-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px 24px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-xs);
}
.portal-hero h2 { margin: 4px 0 4px; font-size: 24px; }
.portal-hero p { margin: 0; color: var(--muted); font-size: 12.5px; }
.portal-hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.portal-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.portal-action {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-xs);
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.portal-action:hover { color: var(--ink); border-color: #b9d8c9; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.portal-action:focus-visible { outline: 3px solid rgba(32, 168, 120, .28); outline-offset: 2px; }
.portal-action-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: var(--mint);
    color: var(--emerald-dark);
}
.portal-action-icon svg { width: 22px; height: 22px; fill: currentColor; }
.portal-action-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.portal-action-value { font-size: 20px; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; }
.portal-action-meta { color: var(--muted); font-size: 11.5px; }
.portal-action-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--emerald-dark);
    font-size: 12.5px;
    font-weight: 650;
}
.portal-action-cta::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }

.portal-split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }

.portal-list { list-style: none; margin: 0; padding: 6px 0; }
.portal-list-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid #eef3f0; }
.portal-list-row:last-child { border-bottom: 0; }
.portal-list-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.portal-list-main small { color: var(--muted); font-size: 10.5px; }
.portal-list-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; text-align: right; }

.portal-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.portal-summary-item { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.portal-summary-item span { display: block; color: var(--muted); font-size: 11px; }
.portal-summary-item strong { display: block; margin-top: 4px; font-size: 19px; font-weight: 750; letter-spacing: -.03em; }

.portal-tips { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.portal-tips li { margin-bottom: 6px; }
.portal-tips li:last-child { margin-bottom: 0; }

/* Status modem */
.portal-device {
    padding: 22px 24px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-xs);
}
.portal-device-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.portal-device-head h3 { margin: 4px 0 2px; font-size: 20px; }
.portal-device-head p { margin: 0; color: var(--muted); font-size: 12px; }
.portal-device-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid #eef3f0; color: var(--ink-soft); font-size: 12px; }

.portal-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding: 18px 22px;
    border-radius: var(--radius);
    background: #10231d;
    color: #e7f5ee;
}
.portal-callout strong { display: block; font-size: 14px; }
.portal-callout p { margin: 4px 0 0; color: #a8c9ba; font-size: 11.5px; }
.portal-callout .btn-primary { background: var(--emerald); border-color: var(--emerald); color: #06231a; }

@media (max-width: 1000px) {
  .portal-split { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .portal-header-inner { padding: 10px 16px; }
  .portal-nav { display: none; }
  .portal-main { padding: 18px 16px calc(84px + env(safe-area-inset-bottom)); }
  .portal-footer { padding: 0 16px calc(92px + env(safe-area-inset-bottom)); }
  .portal-hero { padding: 18px; }
  .portal-hero h2 { font-size: 21px; }
  .portal-actions { grid-template-columns: 1fr; gap: 12px; }
  .portal-summary { grid-template-columns: 1fr; gap: 10px; }
  .portal-list-row { padding: 12px 17px; }

  .portal-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 2px;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 -6px 20px rgba(16, 35, 29, .07);
  }
  .portal-bottom-nav .portal-nav-link {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    min-width: 0;
    padding: 6px 4px;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 600;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .portal-bottom-nav .portal-nav-link svg { width: 21px; height: 21px; }
  .portal-bottom-nav .portal-nav-link.active { background: var(--mint); }
}

@media (max-width: 420px) {
  .portal-action-value { font-size: 18px; }
  .portal-device { padding: 18px; }
  .portal-callout { padding: 16px 18px; }
  .portal-callout .btn { width: 100%; }
}

@media (max-width: 860px) {
  .pay-grid { grid-template-columns: 1fr; }
  .pay-invoice { border-right: 0; border-bottom: 1px solid var(--line, #e3e9e5); }
  .pay-parties { grid-template-columns: 1fr; }
}
/* ===== Bulk actions & modal ===== */
.bulk-toolbar { border-top: 1px solid var(--line); }
.inline-form { display: inline-block; margin: 0; }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell .btn, .actions-cell form { vertical-align: middle; }
.actions-cell form + .btn, .actions-cell .btn + form { margin-left: 4px; }
.row-check, #check-all { width: 16px; height: 16px; accent-color: #2f8f63; cursor: pointer; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .5);
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.modal-card h3 { margin: 0 0 6px; font-size: 18px; }
.modal-card > p { margin: 0 0 14px; color: #658075; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
/* ===== Toggle switch ===== */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch .switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: #d7e1db;
  transition: background .2s ease;
}
.switch .switch-track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
  transition: transform .2s ease;
}
.switch input:checked ~ .switch-track { background: #2f8f63; }
.switch input:checked ~ .switch-track::after { transform: translateX(24px); }
.switch input:focus-visible ~ .switch-track { outline: 2px solid #2f8f63; outline-offset: 2px; }
.switch .switch-text { line-height: 1.3; }
.row-check, #check-all { width: 18px; height: 18px; }
/* ===== Sortable table headers ===== */
.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.sort-link:hover { color: var(--emerald-dark); }
.sort-link.active { color: var(--ink); font-weight: 600; }
.sort-indicator { font-size: 9px; line-height: 1; color: var(--muted); }
.sort-link.active .sort-indicator { color: var(--emerald-dark); }
th.num .sort-link { width: 100%; justify-content: flex-end; }
/* ===== Tabs ===== */
.tabs { margin-top: 4px; }
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab-link {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tab-link:hover { color: var(--ink); border-color: #9fd3ba; }
.tab-link.active { color: var(--ink); background: #ecfdf3; border-color: #9fd3ba; }
.tab-panel[hidden] { display: none; }

/* ===== Confirmation dialog ===== */
.confirm-card { max-width: 480px; }
.btn-danger-solid { color: #fff; border-color: #b42318; background: #b42318; }
.btn-danger-solid:hover { color: #fff; border-color: #912018; background: #912018; }