:root {
  --green-950: #062a1f;
  --green-900: #0a3b2c;
  --green-800: #0f5132;
  --green-700: #14663f;
  --green-600: #1b7a4b;
  --green-100: #dcece3;
  --green-50: #edf7f1;
  --gold-600: #a9861c;
  --gold-500: #c9a227;
  --gold-200: #efdca0;
  --gold-50: #fbf5e2;
  --ink: #12241c;
  --ink-soft: #2c4038;
  --muted: #5f736b;
  --line: #e2ebe5;
  --bg: #f4f8f5;
  --white: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --info: #175cd3;
  --info-bg: #eff8ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 30, .06), 0 1px 3px rgba(16, 40, 30, .04);
  --shadow-md: 0 6px 18px rgba(16, 40, 30, .07);
  --shadow-lg: 0 24px 48px rgba(8, 30, 22, .18);
  --sidebar-w: 266px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; color: var(--green-900); }
p { margin: 0; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }

/* ---------- shell ---------- */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--green-900) 0%, var(--green-950) 100%);
  color: #e9f3ee;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.brand-logo {
  width: 44px; height: 44px; object-fit: contain; border-radius: 12px;
  background: #fff; padding: 4px; flex: 0 0 44px;
}
.brand-monogram {
  width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold-500), #e3c766);
  color: var(--green-900); font-weight: 700; font-size: 15px; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 18px; letter-spacing: .06em; color: #fff; }
.brand-text span { font-size: 11px; color: #a9c9ba; line-height: 1.3; }

.nav { padding: 14px 12px; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: #8fb4a3; padding: 0 10px 6px; font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  color: #d7e8df; font-weight: 500; font-size: 13.8px;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-link .icon { width: 18px; height: 18px; opacity: .9; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.is-active { background: rgba(201, 162, 39, .16); color: #fff; font-weight: 600; }
.nav-link.is-active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 3px; background: var(--gold-500);
}
.sidebar-footer { padding: 14px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .09); display: grid; gap: 10px; }
.sidebar-user { display: flex; gap: 10px; align-items: flex-start; }
.sidebar-user .icon { color: var(--gold-200); width: 18px; height: 18px; margin-top: 3px; }
.sidebar-user strong { display: block; font-size: 13px; color: #fff; line-height: 1.3; }
.sidebar-user span { font-size: 11px; color: #a9c9ba; line-height: 1.3; display: block; }
.sidebar-overlay { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { font-size: 19px; line-height: 1.25; }
.topbar-title p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-100);
}
.chip .icon { width: 14px; height: 14px; }
.chip-period { background: var(--gold-50); border-color: var(--gold-200); color: var(--gold-600); }
.user-menu { display: flex; align-items: center; gap: 9px; padding: 5px 9px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.user-menu:hover { border-color: var(--green-100); background: var(--green-50); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--green-700), var(--green-600));
  color: #fff; font-size: 11.5px; font-weight: 700;
}
.user-menu-text { display: flex; flex-direction: column; line-height: 1.2; }
.user-menu-text strong { font-size: 12.5px; color: var(--ink); }
.user-menu-text small { font-size: 11px; color: var(--muted); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--green-800);
  cursor: pointer;
}
.only-mobile { display: none; }

.content { padding: 24px 28px 40px; flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-bottom: 4px; }
.app-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px;
}

/* ---------- grids ---------- */
.section { margin-top: 26px; }
.section:first-of-type { margin-top: 18px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 16px; }
.section-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.grid { display: grid; gap: 18px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stack { display: grid; gap: 18px; }

/* ---------- cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.card-tight { padding: 16px 18px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { font-size: 14.5px; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-flush { padding: 0; overflow: hidden; }

.stat-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; inset: 0 0 auto auto; width: 84px; height: 84px;
  background: radial-gradient(circle at top right, rgba(201, 162, 39, .16), transparent 70%);
}
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--green-50); color: var(--green-700); flex: 0 0 42px;
}
.tone-gold .stat-icon { background: var(--gold-50); color: var(--gold-600); }
.tone-blue .stat-icon { background: var(--info-bg); color: var(--info); }
.tone-amber .stat-icon { background: var(--warn-bg); color: var(--warn); }
.stat-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--green-900); line-height: 1.2; }
.stat-hint { font-size: 11.5px; color: var(--muted); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.2px; }
table.data th {
  text-align: left; padding: 11px 14px; background: #f7faf8; color: var(--ink-soft);
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid #eef3f0; vertical-align: top; }
table.data tbody tr:hover { background: #fbfdfc; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .nowrap { white-space: nowrap; }
.table-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #f1f4f2; color: var(--ink-soft); border: 1px solid #e5eae7; white-space: nowrap;
}
.badge-success { background: var(--ok-bg); color: var(--ok); border-color: #abefc6; }
.badge-warning { background: var(--warn-bg); color: var(--warn); border-color: #fedf89; }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.badge-info { background: var(--info-bg); color: var(--info); border-color: #b2ddff; }
.badge-gold { background: var(--gold-50); color: var(--gold-600); border-color: var(--gold-200); }
.badge-green { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none; line-height: 1.3;
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--green-800); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-700); }
.btn-gold { background: var(--gold-500); color: #2c2200; }
.btn-gold:hover { background: #d8b23a; }
.btn-secondary { background: #fff; color: var(--green-800); border-color: var(--line); }
.btn-secondary:hover { background: var(--green-50); border-color: var(--green-100); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.btn-danger:hover { background: #fee4e2; }
.btn-ghost { background: transparent; color: var(--green-700); }
.btn-ghost:hover { background: var(--green-50); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #eaf4ef; border-color: rgba(255, 255, 255, .14); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .16); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .req { color: var(--danger); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="date"], input[type="tel"], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid #d8e3dc;
  background: #fff; font-family: inherit; font-size: 13.5px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(27, 122, 75, .12);
}
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--green-700); }
.check-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fbfdfc; }
.check-row:hover { border-color: var(--green-100); background: var(--green-50); }
.check-row label { font-weight: 500; font-size: 13px; color: var(--ink-soft); }
.check-row small { display: block; font-size: 11px; color: var(--muted); }
.check-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.inline-form { display: inline; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { min-width: 170px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* ---------- flash + toasts ---------- */
.flash {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  font-size: 13px; font-weight: 500; margin-bottom: 18px; border: 1px solid transparent;
}
.flash .icon { width: 18px; height: 18px; }
.flash-success { background: var(--ok-bg); color: #05603a; border-color: #abefc6; }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.flash-info { background: var(--info-bg); color: var(--info); border-color: #b2ddff; }
.flash-close { margin-left: auto; background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; background: rgba(7, 24, 18, .45); backdrop-filter: blur(2px); }
.modal.is-open { display: flex; }
.modal-dialog {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg); margin: auto; border: 1px solid var(--line);
  animation: modalIn .16s ease-out;
}
.modal-dialog.modal-lg { max-width: 820px; }
@keyframes modalIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15.5px; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfdfc; border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { background: #f1f4f2; color: var(--ink); }

/* ---------- misc ---------- */
.empty-state { display: grid; place-items: center; gap: 8px; padding: 36px 20px; color: var(--muted); text-align: center; }
.empty-state .icon { width: 28px; height: 28px; opacity: .5; }
.empty-state p { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.empty-state small { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress { height: 8px; border-radius: 999px; background: #edf1ee; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green-700), var(--gold-500)); }
.kpi-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; font-weight: 700; color: var(--green-700); background: var(--green-50); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--green-100); }
.meta-list { display: grid; gap: 12px; }
.meta-item { display: grid; gap: 2px; }
.meta-item dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.meta-item dd { margin: 0; font-size: 13.2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 10px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-600); margin-top: 5px; }
.timeline strong { font-size: 13px; }
.timeline small { color: var(--muted); font-size: 11.5px; display: block; }

/* chart */
.chart-box { width: 100%; }
.chart-donut { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.chart-donut svg { flex: 0 0 auto; }
.chart-svg text { font-family: var(--font); }
.chart-legend { display: grid; gap: 7px; font-size: 12px; min-width: 180px; flex: 1; }
.chart-legend-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart-legend-name { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.chart-legend-row b { font-variant-numeric: tabular-nums; }

/* ---------- auth ---------- */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 26px 18px;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(201, 162, 39, .14), transparent 60%),
    radial-gradient(900px 500px at 88% 92%, rgba(27, 122, 75, .16), transparent 62%),
    linear-gradient(160deg, #f6faf7 0%, #eef5f0 100%);
}
.auth-card {
  width: 100%; max-width: 940px; display: grid; grid-template-columns: 1.05fr .95fr;
  background: #fff; border-radius: 22px; box-shadow: 0 24px 60px rgba(8, 40, 28, .13);
  overflow: hidden; border: 1px solid var(--line);
}
.auth-hero {
  background: linear-gradient(160deg, var(--green-900), var(--green-800) 55%, #0c4630);
  color: #eaf4ef; padding: 38px 34px; display: flex; flex-direction: column; gap: 18px;
  position: relative; overflow: hidden;
}
.auth-hero::after {
  content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, .28), transparent 70%);
  right: -90px; bottom: -70px;
}
.auth-hero .brand { border: none; padding: 0; }
.auth-hero h2 { color: #fff; font-size: 24px; line-height: 1.25; max-width: 330px; }
.auth-hero p { font-size: 13px; color: #c2d9ce; line-height: 1.6; }
.auth-hero .hero-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 9px; font-size: 12.5px; color: #d6e8df; }
.auth-hero .hero-list li { display: flex; gap: 8px; align-items: flex-start; }
.auth-hero .hero-list .icon { width: 15px; height: 15px; color: var(--gold-200); margin-top: 2px; }
.auth-hero .hero-foot { margin-top: auto; font-size: 11.5px; color: #9dbdae; }
.auth-form { padding: 38px 34px; display: flex; flex-direction: column; gap: 16px; }
.auth-form h3 { font-size: 18px; }
.auth-form .sub { font-size: 12.5px; color: var(--muted); }
.auth-form form { display: grid; gap: 14px; }
.auth-error { background: var(--danger-bg); border: 1px solid #fecdca; color: var(--danger); border-radius: 10px; padding: 11px 13px; font-size: 12.5px; }
.auth-note { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; line-height: 1.6; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.toggle-pass { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; display: grid; place-items: center; border-radius: 8px; }
.toggle-pass:hover { color: var(--green-700); background: var(--green-50); }

/* ---------- error page ---------- */
.error-body { display: grid; place-items: center; min-height: 100vh; background: var(--bg); padding: 24px; }
.error-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 40px; max-width: 460px; text-align: center; box-shadow: var(--shadow-md); }
.error-code { font-size: 44px; font-weight: 700; color: var(--gold-500); line-height: 1; }
.error-card h1 { font-size: 20px; margin: 10px 0; }
.error-card p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .auth-card { grid-template-columns: 1fr; max-width: 520px; }
  .auth-hero { display: none; }
}
@media (max-width: 992px) {
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; width: 280px;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .sidebar-overlay.is-open { display: block; position: fixed; inset: 0; background: rgba(7, 24, 18, .45); z-index: 35; }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .topbar-title h1 { font-size: 16.5px; }
  .chip-period { display: none; }
  .user-menu-text { display: none; }
  .content { padding: 18px 16px 32px; }
  .app-footer { padding: 14px 16px; }
  .grid { gap: 14px; }
  .card { padding: 16px 16px; }
  .section { margin-top: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .grid-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { flex-direction: column; gap: 10px; padding: 14px; }
  .stat-value { font-size: 18px; }
  .stat-label { font-size: 10.5px; }
  .page-actions { justify-content: stretch; }
  .page-actions .btn { flex: 1; }
  .modal { padding: 12px 10px; }
  .modal-body, .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .toolbar .field { min-width: 100%; }
  .auth-form { padding: 26px 20px; }
  table.data { font-size: 12.6px; }
  table.data th, table.data td { padding: 9px 10px; }
}
@media print {
  .sidebar, .topbar, .page-actions, .app-footer, .flash { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* ---------- status baris nonaktif ---------- */
tr.row-inactive td { background: #fbfbfa; color: #6b7a73; }
tr.row-inactive td a strong { color: #5f736b; }

/* ---------- status simpan (loading / anti double-submit) ---------- */
.btn.is-saving { position: relative; opacity: .85; cursor: progress; }
.btn.is-saving .icon { display: none; }
.btn .spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  display: inline-block; animation: sikma-spin .7s linear infinite; vertical-align: -2px;
}
@keyframes sikma-spin { to { transform: rotate(360deg); } }
form.is-submitting { opacity: .96; }
.modal form.is-submitting { cursor: progress; }
.form-note { font-size: 11.5px; color: var(--muted); }

/* ---------- notifikasi ---------- */
.bell-btn { position: relative; }
.bell-dot {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}
@media (max-width: 640px) {
  .bell-btn { display: none; }
  .stat-value { font-size: 17px; }
}

/* ---------- perbaikan responsif: grid kolom minimum pada layar kecil ---------- */
@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid > * { min-width: 0; }
  .card { min-width: 0; }
  .card-flush .table-wrap { max-width: 100%; }
  ol.list-plain { padding-left: 18px; }
  .card .between > div[style*="min-width"] { min-width: 0 !important; }
}
