/* ============================================================
   3 SUKSES — Sistem Administrasi Pendidikan Generus Terpadu
   Tema: merah berani, putih, aksen emas + sidebar gelap
   ============================================================ */
:root {
  --red: #C4121A;
  --red-600: #A80E15;
  --red-700: #8E1010;
  --red-800: #7E0E14;
  --red-soft: #FCE9E9;
  --red-tint: #FDF4F4;
  --gold: #D4A017;
  --gold-2: #E9B949;
  --gold-soft: #FDF3E3;
  --cream: #FDF3E3;
  --ink: #1B1615;
  --ink-2: #3A3432;
  --muted: #7C7570;
  --line: #EAE3DC;
  --line-2: #F1EBE5;
  --bg: #F7F6F4;
  --white: #FFFFFF;
  --sidebar: #17110F;
  --sidebar-hover: #241E1C;
  --ok: #1F8A54;
  --warn: #C97B14;
  --bad: #C0392B;
  --info: #2563A8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(24, 20, 20, .05);
  --shadow-lg: 0 18px 44px rgba(24, 20, 20, .16);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.25; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.04rem; }
h3 { font-size: .96rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.only-mobile { display: none; }
code { background: #F5EFEA; padding: 1px 5px; border-radius: 5px; font-size: .85em; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 266px; flex: 0 0 266px; color: #fff; background: var(--sidebar);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
  background: linear-gradient(135deg, #E01B22, #B71017); color: #fff;
  font-weight: 800; display: grid; place-items: center; font-size: 1.05rem; overflow: hidden;
  box-shadow: 0 6px 16px rgba(196,18,26,.35);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 1.02rem; font-weight: 800; letter-spacing: .2px; color: #fff; }
.brand-text span { font-size: .68rem; color: #9C9490; line-height: 1.3; }
.nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: #CFC9C5; font-size: .875rem; margin-bottom: 4px; transition: .16s; font-weight: 500;
}
.nav-item:hover { background: var(--sidebar-hover); text-decoration: none; color: #fff; }
.nav-item.active {
  background: linear-gradient(120deg, #D3141C, #A80E15); color: #fff; font-weight: 600;
  box-shadow: 0 8px 20px rgba(196,18,26,.32);
}
.ico { width: 18px; height: 18px; flex: 0 0 18px; }
.ico-lg { width: 26px; height: 26px; }
.sidebar-foot { padding: 16px 18px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user { display: flex; flex-direction: column; }
.side-label { font-size: .72rem; color: #8A807C; }
.side-name { font-size: .875rem; font-weight: 700; color: #fff; }
.side-role { font-size: .72rem; color: #9C9490; }
.side-logout {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px;
  background: var(--sidebar-hover); border: 1px solid rgba(255,255,255,.12); color: #E9E5E2;
  border-radius: 10px; padding: 9px 12px; font-size: .84rem; font-weight: 600;
}
.side-logout:hover { background: #2E2725; color: #fff; text-decoration: none; }
.side-logout .ico { width: 16px; height: 16px; }
.side-meta { font-size: .68rem; color: #6E6663; margin-top: 10px; line-height: 1.4; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

/* ---------- Page hero ---------- */
.page-hero { display: flex; gap: 16px; align-items: flex-start; padding: 26px 30px 4px; flex-wrap: wrap; }
.hero-icon {
  width: 54px; height: 54px; flex: 0 0 54px; border-radius: 16px; background: var(--red-soft);
  color: var(--red); display: grid; place-items: center;
}
.hero-main { flex: 1 1 auto; min-width: 200px; }
.hero-main h1 { margin: 0; font-size: 1.85rem; font-weight: 800; letter-spacing: -.7px; color: var(--ink); line-height: 1.12; }
.hero-main p { margin: 6px 0 0; color: var(--muted); font-size: .95rem; max-width: 64ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; margin-left: auto; }
.hamburger {
  display: none; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 1.1rem; cursor: pointer; place-items: center;
}
.content { padding: 22px 30px 44px; flex: 1; }
.app-foot {
  padding: 16px 30px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between;
  gap: 12px; font-size: .78rem; color: var(--muted); flex-wrap: wrap; background: #fff;
}

/* ---------- Card ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 700; }
.card-head h2::before { content: ''; width: 4px; height: 17px; background: linear-gradient(180deg, var(--red), var(--gold)); border-radius: 3px; }
.card-body { padding: 18px 20px; }
.card-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.stats { gap: 18px; margin-bottom: 22px; }

/* ---------- Stat ---------- */
.stat { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); }
.stat.gold { border-left-color: var(--gold); }
.stat.green { border-left-color: var(--ok); }
.stat.blue { border-left-color: var(--info); }
.stat-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; flex: 0 0 42px; }
.stat.gold .stat-ico { background: var(--gold-soft); color: #A5760A; }
.stat.green .stat-ico { background: #E7F5EE; color: var(--ok); }
.stat.blue .stat-ico { background: #E8F0FA; color: var(--info); }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 1.5rem; line-height: 1.2; font-weight: 700; }
.stat-sub { font-size: .76rem; color: var(--muted); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
table.table { width: 100%; border-collapse: collapse; font-size: .87rem; background: #fff; }
table.table th, table.table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
table.table th { background: #FBF8F5; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #6E6864; white-space: nowrap; }
table.table tbody tr:hover { background: #FDF9F6; }
table.table td.num, table.table th.num { text-align: right; }
table.table .empty { text-align: center; padding: 28px; color: var(--muted); }
/* Border antar kolom: memudahkan membaca kolom kode / nama / sub materi */
table.table.grid-cols th + th, table.table.grid-cols td + td { border-left: 1px solid var(--line-2); }
.sort-link { color: inherit; }
.sort-link:hover { color: var(--red); text-decoration: none; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 2px 2px; flex-wrap: wrap; font-size: .82rem; }
.pager-btns { display: flex; gap: 6px; }
.pg { min-width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); padding: 0 8px; }
.pg:hover { border-color: var(--red); text-decoration: none; }
.pg.active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.pg.disabled { opacity: .45; }

/* ---------- Badge & status ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #F2EDE9; color: #6B5F58; white-space: nowrap; }
.badge.ok { background: #E7F5EE; color: var(--ok); }
.badge.warn { background: var(--gold-soft); color: #996B08; }
.badge.bad { background: var(--red-soft); color: var(--bad); }
.badge.info { background: #E8F0FA; color: var(--info); }
.badge.muted { background: #F1EEEC; color: var(--muted); }
.sym { font-weight: 800; font-size: 1rem; }
.sym-x { color: var(--red); }
.sym-h { color: var(--info); }
.sym-star { color: #B26A00; }
.cell-empty { color: #C9BFB8; }

/* ---------- Form ---------- */
.form-grid { display: grid; gap: 16px 18px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid .full { grid-column: 1 / -1; }
/* Border kolom: memudahkan melihat pasangan kolom & sub materi pada form entri */
.form-grid.bordered > label.field { border-left: 1px solid var(--line-2); padding-left: 18px; }
.form-grid.bordered > label.field:nth-child(odd),
.form-grid.bordered > label.field.full { border-left: 0; padding-left: 0; }
@media (max-width: 760px) {
  .form-grid.bordered > label.field { border-left: 0; padding-left: 0; }
}
label.field { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 600; color: #6E6864; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .74rem; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], input[type=email], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #E5DFD8; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .875rem; background: #fff; color: var(--ink); transition: .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,18,26,.1); }
textarea { min-height: 84px; resize: vertical; }
select[multiple] { min-height: 120px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 16px 18px; align-items: flex-end; }
.filter-bar label.field { flex: 1 1 175px; min-width: 150px; }
.filter-bar .filter-btn { display: flex; gap: 8px; align-items: center; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 500; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--red); }

/* ---------- Kartu filter (seperti contoh) ---------- */
.filter-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 22px;
}
.filter-fields { display: flex; flex-wrap: wrap; gap: 16px 18px; align-items: flex-end; }
.filter-fields label.field { flex: 1 1 180px; min-width: 150px; }
.filter-fields label.field.wide { flex: 2 1 300px; }
.filter-fields label.field.narrow { flex: 0 1 150px; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.field-search { position: relative; }
.field-search .ico { position: absolute; left: 12px; bottom: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.field-search input { padding-left: 34px; }

/* ---------- Button ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid #E5DFD8; background: #fff; color: var(--ink-2); font-size: .86rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: .16s; line-height: 1.2;
}
.btn:hover { border-color: #D8CFC7; color: var(--red); text-decoration: none; background: #FFFCFA; }
.btn .ico { width: 16px; height: 16px; flex: 0 0 16px; }
.btn.primary {
  background: linear-gradient(180deg, #D3141C, #B71017); border-color: #B71017; color: #fff;
  box-shadow: 0 8px 18px rgba(196,18,26,.22);
}
.btn.primary:hover { background: linear-gradient(180deg, #C1121A, #9E0D13); color: #fff; }
.btn.gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); color: #4A3405; }
.btn.gold:hover { color: #3A2803; }
.btn.danger { background: #fff; border-color: #EBC9C5; color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.small { padding: 7px 12px; font-size: .79rem; border-radius: 10px; }
.btn.block { width: 100%; justify-content: center; }
.btn-row { display: flex; gap: 7px; flex-wrap: wrap; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Alert / toast ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; margin-bottom: 16px; font-size: .86rem; }
.alert.info { background: #F4F8FD; border-color: #D6E4F5; color: #1D4E86; }
.alert.warn { background: var(--gold-soft); border-color: #EBD59A; color: #7A5606; }
.alert.error { background: #FDF0EF; border-color: #F0C9C5; color: #9E2A20; }
.alert.success { background: #EFF9F3; border-color: #C7E7D6; color: #146B41; }
.toast {
  position: fixed; top: 18px; right: 18px; z-index: 200; min-width: 260px; max-width: 380px;
  padding: 13px 18px; border-radius: var(--radius-sm); background: #fff; border-left: 5px solid var(--ok);
  box-shadow: var(--shadow-lg); font-size: .87rem; animation: toastIn .25s ease;
}
.toast.error { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(24,20,20,.5); display: none; z-index: 120; padding: 24px; overflow-y: auto; }
.modal.open { display: block; }
.modal-box { background: #fff; border-radius: var(--radius); max-width: 720px; margin: 24px auto; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-box.wide { max-width: 1000px; }
.modal-box.narrow { max-width: 460px; }
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, var(--red-700), var(--red)); color: #fff; }
.modal-head h3 { margin: 0; font-size: 1rem; color: #fff; }
.modal-head .x { background: rgba(255,255,255,.16); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.modal-body { padding: 20px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: #FFFCF9; }

/* ---------- Lembar PPS / matriks ---------- */
.pps-sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.pps-title { text-align: center; margin-bottom: 20px; }
.pps-title h2 { font-size: 1.2rem; letter-spacing: 1.6px; color: var(--red-700); margin-bottom: 4px; font-weight: 800; }
.pps-title h3 { font-size: .95rem; letter-spacing: .5px; margin: 0; color: var(--ink-2); font-weight: 600; }
.pps-title .level { display: inline-block; margin-top: 10px; background: var(--gold-soft); border: 1px solid #EBD59A; color: #7A5606; padding: 3px 14px; border-radius: 999px; font-weight: 700; font-size: .8rem; letter-spacing: 1px; }
.pps-title .year { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }

table.matrix { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 940px; background: #fff; }
table.matrix th, table.matrix td { border: 1px solid #EDE7E0; }
table.matrix th {
  background: var(--red-700); color: #fff; text-align: center; font-size: .72rem; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase; padding: 11px 8px; border-color: rgba(255,255,255,.22);
}
table.matrix th.grp { background: var(--red); font-size: .8rem; letter-spacing: 1.2px; padding: 12px 8px; }
table.matrix th.period { background: var(--red); font-size: .8rem; padding: 8px; width: 44px; }
table.matrix td.mat-col { text-align: left; font-size: .82rem; color: var(--ink-2); padding: 10px 12px; }
table.matrix td.no-col { width: 58px; text-align: center; font-weight: 600; color: #55504C; padding: 10px 6px; font-size: .8rem; }
table.matrix tr.cat-row td {
  background: var(--cream); color: #7A5B12; font-weight: 700; letter-spacing: .8px; font-size: .76rem;
  text-transform: uppercase; padding: 10px 12px; border-color: #F0E2C6;
}
table.matrix tr.group-row td { background: #F5F4F2; font-weight: 700; color: var(--ink); padding: 10px 12px; }
table.matrix td.per-cell { width: 44px; padding: 0; text-align: center; height: 42px; background: #fff; }
/* Pemisah kolom lebih tegas: mempermudah membaca sel per periode pada baris sub materi */
table.matrix th + th, table.matrix td + td { border-left: 1px solid #E2D8CF; }
table.matrix th:nth-child(9), table.matrix td:nth-child(9) { border-left: 2px solid #D6C9BE; }
table.matrix td.per-cell.local { background: #FFFDF6; }
table.matrix tr:hover td.per-cell { background: #FEFAF7; }
.cell-btn {
  width: 100%; height: 100%; min-height: 40px; border: 0; background: transparent; cursor: pointer;
  font-weight: 800; font-size: .95rem; transition: .12s; font-family: inherit; color: var(--ink);
}
.cell-btn:hover { background: var(--red-soft); }
.cell-btn.s-LEARNING { color: var(--red); }
.cell-btn.s-REVIEW { color: var(--info); }
.cell-btn.s-LOCAL { color: #B26A00; }
.cell-btn.saving { background: var(--gold-soft); }
.matrix-legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 18px; font-size: .82rem; color: var(--ink-2); }
.legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 16px; font-size: .82rem; }
.legend span.sym { font-size: 1rem; }
.legend .lg { display: flex; gap: 8px; align-items: center; }

/* ---------- Absensi ---------- */
.att-table td select { min-width: 110px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg label { padding: 5px 12px; font-size: .78rem; cursor: pointer; background: #fff; border-right: 1px solid var(--line); margin: 0; }
.seg label:last-child { border-right: 0; }
.seg input { display: none; }
.seg input:checked + span { font-weight: 700; }
.seg label:has(input:checked) { background: var(--red-soft); color: var(--red-700); }

/* ---------- Chart ---------- */
.chart { width: 100%; height: auto; }
.donut { position: relative; width: 150px; margin: 0 auto; }
.donut svg { width: 150px; height: 150px; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.donut-center strong { font-size: 1.3rem; display: block; }
.donut-center span { font-size: .72rem; color: var(--muted); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 26px;
  background: radial-gradient(circle at 12% 18%, #FBE3E0 0, transparent 46%), radial-gradient(circle at 88% 82%, #FDF1D6 0, transparent 44%), linear-gradient(140deg,#5E0A0F,#A80E15 55%,#7E0E14); }
.login-card { width: 100%; max-width: 940px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
.login-left { background: linear-gradient(160deg, var(--red) 0%, var(--red-800) 100%); color: #fff; padding: 40px 34px; display: flex; flex-direction: column; justify-content: space-between; }
.login-left .lg-logo { width: 64px; height: 64px; border-radius: 16px; background: #fff; color: var(--red); font-weight: 800; display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 20px; }
.login-left h1 { font-size: 1.7rem; letter-spacing: 1px; margin-bottom: 6px; font-weight: 800; }
.login-left .sub { color: #FBE3E0; font-size: .9rem; }
.login-left ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; font-size: .85rem; color: #FDEDEA; }
.login-left ul li::before { content: '\2713'; color: var(--gold-2); font-weight: 700; margin-right: 9px; }
.login-right { padding: 40px 34px; }
.login-right h2 { font-size: 1.15rem; }
.login-form { display: grid; gap: 14px; margin-top: 20px; }
.center-card { max-width: 520px; margin: 40px auto; text-align: center; padding: 34px !important; }
.deny-icon { font-size: 2.4rem; margin-bottom: 8px; }

/* ---------- Detail list ---------- */
.dl { display: grid; grid-template-columns: 190px 1fr; gap: 8px 16px; font-size: .87rem; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 10px 18px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: #6E6864;
  border: 1px solid var(--line); background: #fff;
}
.tab:hover { background: var(--red-tint); text-decoration: none; color: var(--red-700); }
.tab.active { color: #fff; border-color: #B71017; background: linear-gradient(180deg, #D3141C, #B71017); box-shadow: 0 8px 18px rgba(196,18,26,.22); }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--red-soft); color: var(--red-700); display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; }
.progress { height: 8px; border-radius: 999px; background: #F0E9E2; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); }
.hl-red { color: var(--red); font-weight: 700; }

/* ---------- Modul Keuangan ---------- */
.money-pos { color: var(--ok); font-weight: 600; }
.money-neg { color: var(--bad); font-weight: 600; }
.money-zero { color: var(--muted); }
.fin-recap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.fin-recap-title { display: flex; align-items: center; gap: 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .6px;
  color: #6E6864; border-bottom: 1px solid var(--line-2); padding-bottom: 8px; margin-bottom: 10px; }
.fin-recap-title .ico { width: 16px; height: 16px; color: var(--red); }
.fin-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .85rem; border-bottom: 1px dashed var(--line-2); }
.fin-line-name { color: var(--ink-2); }
.fin-line-val { font-weight: 600; white-space: nowrap; }
.fin-line-val.pos { color: var(--ok); }
.fin-line-val.neg { color: var(--bad); }
.fin-line.total { border-bottom: 0; border-top: 2px solid var(--line); margin-top: 6px; padding-top: 9px; font-weight: 700; }
tr.fin-total-row td { background: #FBF8F5; border-top: 2px solid var(--line); }
.fin-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0 18px; }
.fin-summary .box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fff; }
.fin-summary .box .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); display: block; }
.fin-summary .box .val { font-size: .98rem; font-weight: 700; }

/* ---------- Kartu filter pada header kartu daftar ---------- */
.card-head:has(> form.filter-bar) { flex-direction: column; align-items: stretch; gap: 14px; }
.card-head:has(> form.filter-bar) form.filter-bar { border-top: 1px solid var(--line-2); padding-top: 14px; }
.card-head form.filter-bar label.field { flex: 1 1 190px; }
.hero-actions form { display: inline-flex; flex-wrap: wrap; }
.hero-actions > * { flex: 0 1 auto; min-width: 0; }
.hero-actions .filter-bar label.field { min-width: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1150px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar { position: fixed; left: -290px; z-index: 60; transition: left .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .overlay.show { display: block; position: fixed; inset: 0; background: rgba(24,20,20,.5); z-index: 50; }
  .only-mobile { display: grid; }
  .hamburger { display: grid; }
  .page-hero { padding: 18px 16px 2px; gap: 12px; }
  .hero-main h1 { font-size: 1.5rem; }
  .hero-actions { margin-left: 0; width: 100%; }
  .content { padding: 18px 16px 36px; }
  .app-foot { padding: 14px 16px; }
  .login-card { grid-template-columns: 1fr; }
  .login-left { display: none; }
}
@media (max-width: 760px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .fin-recap { grid-template-columns: 1fr; gap: 24px; }
  .fin-summary { grid-template-columns: 1fr; }
  .hero-icon { width: 46px; height: 46px; flex: 0 0 46px; }
  .ico-lg { width: 22px; height: 22px; }
  .hero-main h1 { font-size: 1.35rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions > *, .hero-actions .btn, .hero-actions form { width: 100%; }
  .hero-actions .btn { justify-content: center; }
  .hero-actions .filter-bar { width: 100%; }
  .filter-fields label.field, .filter-fields label.field.wide { flex: 1 1 100%; }
  .toast { left: 14px; right: 14px; min-width: 0; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 8px; }
}

/* ---------- Cetak ---------- */
.print-sheet { background: #fff; padding: 18px; }
.print-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px double var(--red-700); padding-bottom: 12px; margin-bottom: 16px; }
.print-head .ph-logo { width: 62px; height: 62px; flex: 0 0 62px; }
.print-head .ph-text { flex: 1; text-align: center; }
.print-head .ph-text h1 { margin: 0; font-size: 1.25rem; letter-spacing: 2px; color: var(--red-700); }
.print-head .ph-text .sub { font-size: .82rem; color: #5C534B; }
.print-head .ph-text .inst { font-size: .9rem; font-weight: 700; letter-spacing: 1px; }
.print-title { text-align: center; margin: 12px 0 6px; font-weight: 700; text-decoration: underline; letter-spacing: .5px; }
.print-meta { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; margin-bottom: 12px; flex-wrap: wrap; }
.print-foot { margin-top: 26px; display: flex; justify-content: space-between; gap: 20px; font-size: .82rem; }
.ttd { text-align: center; min-width: 200px; }
.ttd .space { height: 62px; }
table.print-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
table.print-table th, table.print-table td { border: 1px solid #8C7F76; padding: 4px 6px; }
table.print-table th { background: var(--gold-soft); text-align: center; }
@media print {
  body { background: #fff; font-size: 11px; }
  .sidebar, .page-hero, .hero-actions, .app-foot, .filter-card, .no-print, .toast, .tabs { display: none !important; }
  .content, .main { padding: 0 !important; margin: 0 !important; }
  .card { border: 0; box-shadow: none; margin: 0; }
  .card-body { padding: 0; }
  .print-sheet { padding: 0; }
  a { color: #000; }
  @page { size: A4 portrait; margin: 12mm; }
  .landscape { page: landscape-page; }
  @page landscape-page { size: A4 landscape; margin: 8mm; }
}
@media print and (orientation: landscape) { @page { size: A4 landscape; margin: 8mm; } }
