/* =========================================================
   LEDGER — Fee Management
   Design tokens
   ========================================================= */
:root{
  --ink-900:#123b5d;
  --ink-800:#123b5d;
  --ink-700:#167d8d;
  --ink-600:#2d7182;
  --teal:#167d8d;
  --gold-500:#c89b3c;
  --gold-600:#a97c24;
  --paper:#f5f7f9;
  --paper-100:#f5f7f9;
  --paper-card:#ffffff;
  --rule:#dbe3ea;
  --line:#e4e9ee;
  --text-900:#263746;
  --text-600:#718096;
  --text-400:#8b9aaa;
  --danger:#c94c4c;
  --danger-bg:#fbeaea;
  --success:#3a8065;
  --success-bg:#e8f3ee;
  --warn:#a97c24;
  --warn-bg:#f8f0dc;

  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Courier New", Courier, monospace;

  --radius: 6px;
  --shadow-sm:0 1px 3px rgba(18,59,93,.07);
  --shadow-md:0 8px 24px rgba(18,59,93,.14);
  --sidebar-w: 248px;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family: var(--font-body);
  background:linear-gradient(135deg,#f7fbff 0%,#f2f6fa 48%,#edf5f8 100%);
  color: var(--text-900);
  font-size:14px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3{font-family:var(--font-display); font-weight:600; margin:0; color:var(--ink-900);}
p{margin:0;}
button{font-family:inherit; cursor:pointer;}
input,select,textarea{font-family:inherit; font-size:14px;}
table{font-variant-numeric: tabular-nums;}

/* =========================================================
   Sidebar
   ========================================================= */
.sidebar{
  position:fixed; top:0; left:0; bottom:0; width:var(--sidebar-w);
  background:linear-gradient(180deg,#082f52 0%,#064b70 55%,#073a5c 100%);
  border-right:1px solid #123b5d;
  color:#fff;
  display:flex; flex-direction:column;
  padding:22px 16px;
  z-index:40;
}
.brand{display:flex; align-items:center; gap:10px; padding:0 6px 22px; border-bottom:1px solid rgba(255,255,255,.18); margin-bottom:14px;}
.brand-mark{
  font-family:var(--font-display); font-size:26px; color:var(--gold-500);
  width:62px; height:44px; display:flex; align-items:center; justify-content:center;
  border:none; border-radius:5px; background:#fff; padding:3px;
  flex-shrink:0;
}
.brand-text strong{display:block; font-family:var(--font-display); font-size:17px; letter-spacing:.3px; color:#fff;}
.brand-text small{display:block; font-size:11px; letter-spacing:.6px; text-transform:uppercase; color:#cbd8e2;}

.nav{display:flex; flex-direction:column; gap:2px; flex:1; overflow-y:auto;}
.nav-item{
  display:flex; align-items:center; gap:10px;
  background:transparent; border:none; color:#dbe6ee;
  text-align:left; padding:10px 10px; border-radius:5px;
  font-size:13.5px; letter-spacing:.2px;
}
.nav-item .ni{font-family:var(--font-mono); font-size:10.5px; color:#d9ba73; width:18px; flex-shrink:0;}
.nav-item:hover{background:rgba(22,145,170,.42);color:#fff;transform:translateX(2px);}
.nav-item.active{background:linear-gradient(90deg,#1388a0,#1aa0b7); color:#fff; font-weight:600; box-shadow:inset 4px 0 0 #f0b82f,0 4px 12px rgba(0,0,0,.14);}
.nav-item.active .ni{color:#f1cf80;}

.sidebar-foot{display:flex; flex-direction:column; gap:8px; padding-top:14px; border-top:1px solid rgba(255,255,255,.18); margin-top:10px;}
.ghost-btn{
  background:transparent; border:1px solid rgba(255,255,255,.3); color:#e8eff4;
  border-radius:5px; padding:8px 10px; font-size:12.5px;
}
.ghost-btn:first-child{background:linear-gradient(90deg,#12869f,#17a0b7);border-color:#27b2c7;color:#fff;}
.ghost-btn:hover{border-color:var(--gold-500); color:#fff; background:rgba(255,255,255,.12);}

.menu-toggle{
  display:none; position:fixed; top:14px; left:14px; z-index:50;
  width:38px; height:38px; border-radius:6px; border:1px solid var(--rule);
  background:var(--paper-card); font-size:18px; color:var(--ink-800);
}
.scrim{display:none; position:fixed; inset:0; background:rgba(18,36,31,.4); z-index:35;}

.file-banner{
  display:none; align-items:center; gap:14px; flex-wrap:wrap;
  position:sticky; top:0; z-index:30;
  background:#fbf3da; border-bottom:1px solid var(--gold-500);
  padding:10px 20px 10px calc(var(--sidebar-w) + 20px);
  font-size:13px; color:var(--ink-900);
}
@media (max-width: 980px){
  .file-banner{padding-left:20px; padding-top:56px;}
}

/* =========================================================
   Main
   ========================================================= */
.main{margin-left:var(--sidebar-w); padding:28px 34px 60px; min-height:100vh;}
.page{display:none;}
.page.active{display:block; animation:fade .18s ease;}
@keyframes fade{from{opacity:0; transform:translateY(4px);} to{opacity:1; transform:none;}}

.page-head{display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap;}
.eyebrow{font-size:11px; text-transform:uppercase; letter-spacing:1.2px; color:var(--gold-600); font-weight:600; margin-bottom:4px;}
.page-head h1{font-size:26px;}
.today{font-size:12.5px; color:var(--text-600); font-family:var(--font-mono);}
.head-actions{display:flex; gap:10px; flex-wrap:wrap;}

/* Buttons */
.btn{border-radius:5px; padding:9px 16px; font-size:13.5px; font-weight:600; border:1px solid transparent; transition:.12s;}
.btn.primary{background:linear-gradient(135deg,#123b5d,#167d8d); color:#fff; box-shadow:0 3px 8px rgba(18,59,93,.18);}
.btn.primary:hover{background:linear-gradient(135deg,#167d8d,#1a9bb0); transform:translateY(-1px);}
.btn.ghost{background:var(--paper-card); border-color:var(--rule); color:var(--ink-800);}
.btn.ghost:hover{border-color:var(--gold-500); color:var(--gold-600);}
.btn.danger{background:var(--danger-bg); color:var(--danger); border-color:transparent;}
.btn.danger:hover{background:var(--danger);color:#fff;}
.btn.small{padding:5px 10px; font-size:12px;}
.btn:disabled{opacity:.45; cursor:not-allowed;}

/* Stat grid */
.stat-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:22px;}
.stat-grid.small{margin-bottom:18px;}
.stat-card{
  background:var(--paper-card); border:1px solid var(--line); border-radius:var(--radius);
  padding:17px 18px; box-shadow:0 6px 18px rgba(18,59,93,.09); border-top:4px solid var(--ink-800);
  position:relative; overflow:hidden; min-height:108px;
}
.stat-card::after{position:absolute;right:15px;bottom:13px;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;font-size:21px;font-family:"Segoe UI Emoji","Segoe UI Symbol",sans-serif;}
.stat-card.students{border-top-color:#1594a8;background:linear-gradient(145deg,#fff 58%,#e5f7fa);}
.stat-card.students::after{content:"●";color:#1388a0;background:#dff3f6;}
.stat-card.classes{border-top-color:#347fd1;background:linear-gradient(145deg,#fff 58%,#eaf2fe);}
.stat-card.classes::after{content:"◆";color:#347fd1;background:#e3effd;}
.stat-card.collection{border-top-color:#e2a51c;background:linear-gradient(145deg,#fff 58%,#fff3d8);}
.stat-card.collection::after{content:"▣";color:#d5950c;background:#fceed0;}
.stat-card.outstanding{border-top-color:var(--danger);background:linear-gradient(145deg,#fff 58%,#fde9e9);}
.stat-card.outstanding::after{content:"!";font-weight:700;color:#c94c4c;background:#f9dddd;}
.stat-card.today{border-top-color:var(--success);background:linear-gradient(145deg,#fff 58%,#e8f5ed);}
.stat-card.today::after{content:"$";font-weight:700;color:#3a8065;background:#dceee4;}
.stat-card .sc-label{font-size:11px; text-transform:uppercase; letter-spacing:.6px; color:var(--text-400); font-weight:600;}
.stat-card .sc-value{font-family:var(--font-display); font-size:26px; color:var(--ink-900); margin-top:6px;}
.stat-card .sc-value.gold{color:var(--gold-600);}
.stat-card .sc-value.danger{color:var(--danger);}
.stat-card .sc-value.success{color:var(--success);}
.gender-panel{background:linear-gradient(135deg,#ffffff 0%,#f1fbff 45%,#fff4fb 100%);}
.gender-chart-layout{display:flex;align-items:center;justify-content:center;gap:42px;flex-wrap:wrap;padding:8px 4px 16px;}
.gender-pie{width:210px;height:210px;border-radius:50%;display:grid;place-items:center;box-shadow:0 10px 30px rgba(18,59,93,.16);transition:background .3s ease;}
.gender-pie-centre{width:116px;height:116px;border-radius:50%;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;box-shadow:inset 0 0 0 1px #e3eaf0;text-align:center;}
.gender-pie-centre strong{font-family:var(--font-display);font-size:32px;color:var(--ink-900);line-height:1;}
.gender-pie-centre span{font-size:11px;color:var(--text-600);margin-top:7px;}
.gender-legend{min-width:270px;display:grid;gap:9px;}
.gender-legend-row{display:grid;grid-template-columns:16px 1fr 42px 42px;align-items:center;gap:9px;background:rgba(255,255,255,.82);border:1px solid #e1e9ef;border-radius:8px;padding:10px 12px;}
.gender-dot{width:12px;height:12px;border-radius:50%;}
.gender-legend-row strong{font-size:17px;text-align:right;color:var(--ink-900);}.gender-legend-row small{text-align:right;color:var(--text-600);}

/* Panels */
.panel{background:rgba(255,255,255,.96); border:1px solid #dbe5ed; border-radius:10px; padding:20px 22px; margin-bottom:20px; box-shadow:0 7px 22px rgba(18,59,93,.08);}
.panel-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
.panel-head h2{font-size:16px;}
.muted{color:var(--text-600); font-size:13px; margin-bottom:14px;}

/* Toolbar */
.toolbar{display:flex; gap:10px; flex-wrap:wrap; margin-bottom:16px;}
.toolbar input, .toolbar select{
  padding:8px 12px; border:1px solid var(--line); border-radius:5px; background:#fff; color:var(--text-900);
}
.toolbar input[type=search]{flex:1; min-width:220px;}
.inline-label{display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--text-600);}
.inline-label input{padding:7px 10px;}
.outstanding-actions{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:14px;}
.outstanding-actions .muted{margin:0;}
.out-check{width:16px; height:16px; accent-color:var(--ink-800);}
.wa-preview{min-height:150px; resize:vertical;}
.wa-recipient{padding:10px 12px; background:var(--paper-100); border:1px solid var(--line); border-radius:5px; margin-bottom:14px;}
.announcement-help{margin-top:12px;}
.attendance-actions{margin-bottom:12px;}
.attendance-save{margin-top:14px;}
.attendance-search{margin-bottom:12px;}
.attendance-status-buttons{display:flex;gap:6px;flex-wrap:wrap;}
.attendance-status-btn{min-width:72px;padding:7px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font:inherit;font-size:12px;font-weight:700;cursor:pointer;transition:.15s ease;}
.attendance-status-btn:hover{border-color:var(--teal);transform:translateY(-1px);}
.attendance-status-btn.active[data-status="present"]{background:#dcfce7;border-color:#16a34a;color:#166534;box-shadow:0 0 0 2px rgba(22,163,74,.12);}
.attendance-status-btn.active[data-status="absent"]{background:#fee2e2;border-color:#dc2626;color:#991b1b;box-shadow:0 0 0 2px rgba(220,38,38,.12);}
.attendance-status-btn.active[data-status="leave"]{background:#fef3c7;border-color:#d97706;color:#92400e;box-shadow:0 0 0 2px rgba(217,119,6,.12);}

/* Tables */
.table-wrap{overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius);}
table{width:100%; border-collapse:collapse; min-width:640px;}
thead th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.5px;
  color:#fff; font-weight:600; background:linear-gradient(90deg,#123b5d,#0f5275); padding:10px 14px; border-bottom:1px solid #123b5d;
  white-space:nowrap;
}
tbody td{padding:11px 14px; border-bottom:1px solid var(--line); font-size:13.5px; vertical-align:middle;}
tbody tr:last-child td{border-bottom:none;}
tbody tr:nth-child(even){background:#f8fbfd;}
tbody tr:hover{background:#eaf6f8;}
th.num, td.num{text-align:right; font-variant-numeric:tabular-nums;}
.row-actions{display:flex; gap:6px; flex-wrap:wrap;}
.empty-row td{text-align:center; color:var(--text-400); padding:34px; font-style:italic;}
.report-total-row td{font-weight:800;background:#e7f4f7!important;color:#123b5d;border-top:2px solid #167d8d;border-bottom:none;}

/* Badges */
.badge{display:inline-block; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:700; letter-spacing:.3px;}
.badge.paid{background:var(--success-bg); color:var(--success);}
.badge.partial{background:var(--warn-bg); color:var(--warn);}
.badge.unpaid{background:var(--danger-bg); color:var(--danger);}
.badge.active{background:var(--success-bg); color:var(--success);}
.badge.inactive{background:#eee; color:var(--text-600);}

/* Pager */
.pager{display:flex; justify-content:center; gap:6px; margin-top:14px;}
.pager button{border:1px solid var(--line); background:#fff; padding:6px 11px; border-radius:5px; font-size:12.5px;}
.pager button.active{background:var(--ink-800); color:#fff; border-color:var(--ink-800);}

/* Forms */
.form-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px;}
.form-grid label{display:flex; flex-direction:column; gap:5px; font-size:12.5px; color:var(--text-600); font-weight:600;}
.form-grid input, .form-grid select, .form-grid textarea{
  padding:9px 11px; border:1px solid var(--line); border-radius:5px; font-size:13.5px; color:var(--text-900); background:#fff;
}
.form-grid .full{grid-column:1/-1;}
.form-actions{grid-column:1/-1; display:flex; justify-content:flex-end; gap:10px; margin-top:6px;}
fieldset{border:1px dashed var(--rule); border-radius:6px; padding:12px 14px; grid-column:1/-1;}
fieldset legend{font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--gold-600); font-weight:700; padding:0 6px;}

/* Modal */
.modal-scrim{display:none; position:fixed; inset:0; background:rgba(18,36,31,.45); z-index:60; align-items:flex-start; justify-content:center; overflow-y:auto; padding:40px 16px;}
.modal-scrim.open{display:flex;}
.modal{background:#fff; border-radius:8px; width:100%; max-width:620px; padding:26px 28px; box-shadow:var(--shadow-md); animation:fade .16s ease;}
.modal h2{font-size:18px; margin-bottom:16px;}
.modal-close-row{display:flex; justify-content:flex-end; margin-top:18px; gap:10px;}

/* Toast */
.toast{
  position:fixed; bottom:22px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--ink-900); color:#fff; padding:11px 20px; border-radius:6px; font-size:13px;
  opacity:0; pointer-events:none; transition:.22s; z-index:80; box-shadow:var(--shadow-md);
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
.toast.error{background:var(--danger);}

/* Chart (hand-rolled bars) */
.chart-wrap{display:flex; align-items:flex-end; gap:18px; height:180px; padding:10px 6px 0;}
.chart-col{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:8px; height:100%;}
.chart-bar{width:100%; max-width:46px; background:linear-gradient(180deg,#20a8be,#08627e); border-radius:6px 6px 0 0; transition:height .3s ease; box-shadow:0 3px 9px rgba(8,98,126,.22);}
.chart-col:nth-child(2) .chart-bar{background:linear-gradient(180deg,#2a9dc2,#176a9c);}
.chart-col:nth-child(3) .chart-bar{background:linear-gradient(180deg,#438bd1,#345fa7);}
.chart-col:nth-child(4) .chart-bar{background:linear-gradient(180deg,#1ea6a3,#147371);}
.chart-col:nth-child(5) .chart-bar{background:linear-gradient(180deg,#168ba5,#075b79);}
.chart-col:last-child .chart-bar{background:linear-gradient(180deg,#e1b95f,var(--gold-500));}
.chart-label{font-size:11px; color:var(--text-600);}
.chart-value{font-size:11px; color:var(--text-400); font-family:var(--font-mono);}

/* =========================================================
   Print — vouchers & receipts (ledger paper aesthetic)
   ========================================================= */
.print-only{display:none;}
.voucher-sheet{
  width:720px; margin:0 auto; background:#fffdf7; padding:34px 38px;
  border:1px solid var(--rule);
  background-image: repeating-linear-gradient(#fffdf7, #fffdf7 27px, #efe9d6 28px);
}
.voucher-head{display:flex; justify-content:space-between; align-items:flex-start; border-bottom:2px solid var(--ink-800); padding-bottom:10px; margin-bottom:16px;}
.voucher-head h2{font-size:20px; color:var(--ink-900);}
.voucher-head .vh-sub{font-size:12px; color:var(--text-600);}
.voucher-stamp{font-family:var(--font-mono); font-size:11px; border:1.5px solid var(--gold-600); color:var(--gold-600); padding:4px 10px; border-radius:4px; transform:rotate(-3deg);}
.voucher-meta{display:grid; grid-template-columns:1fr 1fr; gap:6px 24px; font-size:13px; margin-bottom:16px;}
.voucher-meta div span{color:var(--text-600); display:inline-block; min-width:110px;}
.voucher-table{width:100%; border-collapse:collapse; margin-bottom:14px;}
.voucher-table th{text-align:left; font-size:11px; text-transform:uppercase; color:var(--text-600); border-bottom:1px solid var(--ink-800); padding:6px 4px;}
.voucher-table td{padding:7px 4px; border-bottom:1px dotted var(--rule); font-size:13.5px;}
.voucher-total-row td{font-weight:700; border-top:2px solid var(--ink-800); border-bottom:none; font-size:15px;}
.voucher-foot{display:flex; justify-content:space-between; margin-top:26px; font-size:11px; color:var(--text-600);}

/* Two copies on one printed page */
.voucher-page{width:720px; margin:0 auto;}
.voucher-copy{
  background:#fffdf7; padding:20px 30px;
  background-image: repeating-linear-gradient(#fffdf7, #fffdf7 22px, #efe9d6 23px);
}
.voucher-copy .voucher-head{padding-bottom:8px; margin-bottom:10px;}
.voucher-copy .voucher-meta{margin-bottom:10px; gap:4px 24px;}
.voucher-copy .voucher-table th, .voucher-copy .voucher-table td{padding:5px 4px; font-size:12.5px;}
.voucher-copy .voucher-foot{margin-top:14px;}
.voucher-logo{height:42px; max-width:120px; object-fit:contain; flex-shrink:0;}
.voucher-cut{
  display:flex; align-items:center; justify-content:center;
  border-top:1px dashed var(--ink-800); border-bottom:1px dashed var(--ink-800);
  padding:6px 0; margin:2px 0; font-size:10px; letter-spacing:.8px; text-transform:uppercase; color:var(--text-400);
  background:#fff;
}

@media print{
  body *{visibility:hidden;}
  .print-only, .print-only *{visibility:visible;}
  .print-only{display:block; position:absolute; top:0; left:0; width:100%;}
  .voucher-sheet{border:none;}
  @page{size:A4; margin:12mm;}
  .voucher-page{width:100%;}
  .print-only .voucher-page{page-break-after:always;}
  .print-only .voucher-page:last-child{page-break-after:auto;}
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px){
  .sidebar{transform:translateX(-100%); transition:transform .2s ease; box-shadow:var(--shadow-md);}
  .sidebar.open{transform:translateX(0);}
  .scrim.open{display:block;}
  .menu-toggle{display:flex; align-items:center; justify-content:center;}
  .main{margin-left:0; padding:76px 16px 50px;}
  .page-head{flex-direction:column; align-items:flex-start;}
}
@media (max-width: 560px){
  table{min-width:520px;}
  .voucher-sheet{width:100%; padding:20px;}
  .voucher-meta{grid-template-columns:1fr;}
}

/* 1.9.0 bulk selection and consolidated voucher layout */
[hidden]{display:none!important}
.badge.arrears{background:#fde2e2;color:#9d1c1c}
.badge.current{background:#dff4e7;color:#17663a}
.badge.advance{background:#e2edff;color:#174f9b}
.voucher-meta>div{overflow-wrap:anywhere}
.voucher-table td{overflow-wrap:anywhere}
@media(max-width:650px){.gv-student-row{grid-template-columns:auto 1fr!important}.gv-final-amount{grid-column:2}.form-actions{flex-wrap:wrap}}

/* =========================================================
   FEE MANAGER 2.0 — EMBOSSED 3D INTERFACE
   Raised "plates" for every control; pressed-in when active.
   Pure CSS (no images) so it prints/scales/themes cleanly.
   ========================================================= */
:root{
  --e-hi:rgba(255,255,255,.85);          /* top bevel highlight */
  --e-lo:rgba(8,40,66,.28);              /* bottom bevel shade   */
  --e-teal-1:#2bb3c9; --e-teal-2:#12879f; --e-teal-3:#0b5a74; --e-teal-edge:#08435a;
  --e-plate-1:#ffffff; --e-plate-2:#e8eff5; --e-plate-edge:#b9c8d5; --e-plate-drop:#a9bacb;
  --e-red-1:#ef6b6b; --e-red-2:#c94c4c; --e-red-edge:#8f2f2f;
}
@media (prefers-reduced-motion: reduce){ *{transition:none!important; animation:none!important;} }

/* ---------- Buttons ---------- */
.btn{
  position:relative; border-radius:9px; padding:10px 18px; font-weight:700; letter-spacing:.2px;
  border:1px solid var(--e-plate-edge);
  transition:transform .08s ease, box-shadow .08s ease, filter .12s ease;
  -webkit-tap-highlight-color:transparent; user-select:none;
}
.btn:active:not(:disabled){ transform:translateY(3px); }
.btn.primary{
  color:#fff; text-shadow:0 -1px 0 rgba(0,0,0,.38);
  background:linear-gradient(180deg,var(--e-teal-1) 0%,var(--e-teal-2) 52%,var(--e-teal-3) 100%);
  border-color:var(--e-teal-edge);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 3px rgba(0,0,0,.22),
             0 3px 0 var(--e-teal-edge), 0 7px 14px rgba(8,67,90,.32);
}
.btn.primary:hover{ filter:brightness(1.08); background:linear-gradient(180deg,#3cc4d9 0%,#1595ae 52%,#0d6682 100%); transform:none; }
.btn.primary:active:not(:disabled){
  box-shadow:inset 0 3px 7px rgba(0,0,0,.4), 0 0 0 var(--e-teal-edge), 0 1px 2px rgba(8,67,90,.3); filter:brightness(.96);
}
.btn.ghost{
  color:var(--ink-800); text-shadow:0 1px 0 rgba(255,255,255,.9);
  background:linear-gradient(180deg,var(--e-plate-1) 0%,var(--e-plate-2) 100%);
  box-shadow:inset 0 1px 0 #fff, inset 0 -2px 3px rgba(18,59,93,.08),
             0 3px 0 var(--e-plate-drop), 0 6px 12px rgba(18,59,93,.14);
}
.btn.ghost:hover{ border-color:var(--teal); color:#0b5a74; filter:brightness(1.02); }
.btn.ghost:active:not(:disabled){ box-shadow:inset 0 3px 6px rgba(18,59,93,.22), 0 0 0 var(--e-plate-drop); }
.btn.danger{
  color:#fff; text-shadow:0 -1px 0 rgba(0,0,0,.35);
  background:linear-gradient(180deg,var(--e-red-1) 0%,var(--e-red-2) 100%); border-color:var(--e-red-edge);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 3px rgba(0,0,0,.2), 0 3px 0 var(--e-red-edge), 0 7px 14px rgba(143,47,47,.28);
}
.btn.danger:hover{ background:linear-gradient(180deg,#f47b7b 0%,#d65656 100%); color:#fff; }
.btn.danger:active:not(:disabled){ box-shadow:inset 0 3px 7px rgba(0,0,0,.4), 0 0 0 var(--e-red-edge); }
.btn.small{ padding:6px 12px; border-radius:7px; }
.btn.small.primary,.btn.small.danger{ box-shadow:inset 0 1px 0 rgba(255,255,255,.5), inset 0 -1px 2px rgba(0,0,0,.2), 0 2px 0 var(--e-teal-edge), 0 4px 8px rgba(8,67,90,.25); }
.btn.small.danger{ box-shadow:inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 2px rgba(0,0,0,.2), 0 2px 0 var(--e-red-edge), 0 4px 8px rgba(143,47,47,.22); }
.btn.small.ghost{ box-shadow:inset 0 1px 0 #fff, 0 2px 0 var(--e-plate-drop), 0 4px 8px rgba(18,59,93,.12); }
.btn.small:active:not(:disabled){ transform:translateY(2px); }
.btn:focus-visible,.nav-item:focus-visible,.ghost-btn:focus-visible,.pager button:focus-visible{ outline:3px solid rgba(43,179,201,.55); outline-offset:2px; }
.btn:disabled{ opacity:.5; box-shadow:inset 0 1px 0 rgba(255,255,255,.4), 0 1px 0 rgba(0,0,0,.15); }

/* ---------- Sidebar & menu ---------- */
.sidebar{
  background:linear-gradient(180deg,#0a3a5e 0%,#075074 52%,#06415f 100%);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.08), 6px 0 22px rgba(6,40,66,.28);
}
.brand{ border-bottom:1px solid rgba(0,0,0,.28); box-shadow:0 1px 0 rgba(255,255,255,.12); }
.brand-mark{
  border-radius:10px; background:linear-gradient(180deg,#fff 0%,#e4edf4 100%);
  box-shadow:inset 0 1px 0 #fff, inset 0 -2px 3px rgba(18,59,93,.15), 0 3px 0 rgba(0,0,0,.35), 0 6px 12px rgba(0,0,0,.28);
}
.brand-mark.initials{
  color:#fff; font-family:var(--font-body); font-weight:800; font-size:19px; letter-spacing:1px;
  text-shadow:0 -1px 0 rgba(0,0,0,.35);
  background:linear-gradient(180deg,#e7b84a 0%,#c89b3c 55%,#a97c24 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 3px rgba(0,0,0,.25), 0 3px 0 #7a5614, 0 6px 12px rgba(0,0,0,.28);
}
.brand-text{ min-width:0; }
.brand-text strong{ font-size:15px; line-height:1.18; white-space:normal; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; word-break:break-word; text-shadow:0 -1px 0 rgba(0,0,0,.35); }
.nav{ gap:7px; padding:4px 3px 8px; }
.nav-item{
  position:relative; border-radius:10px; padding:11px 12px; color:#e9f2f8;
  background:linear-gradient(180deg,rgba(255,255,255,.17) 0%,rgba(255,255,255,.05) 100%);
  border:1px solid rgba(255,255,255,.16); border-bottom-color:rgba(0,0,0,.3);
  text-shadow:0 -1px 0 rgba(0,0,0,.35);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.3), inset 0 -2px 3px rgba(0,0,0,.18), 0 3px 0 rgba(0,0,0,.38), 0 6px 10px rgba(0,0,0,.2);
  transition:transform .08s ease, box-shadow .08s ease, background .12s ease;
}
.nav-item:hover{
  transform:none; color:#fff;
  background:linear-gradient(180deg,rgba(255,255,255,.27) 0%,rgba(255,255,255,.1) 100%);
}
.nav-item:active{ transform:translateY(3px); box-shadow:inset 0 3px 6px rgba(0,0,0,.4), 0 0 0 rgba(0,0,0,.38); }
.nav-item.active{
  color:#fff; font-weight:700; transform:translateY(2px);
  background:linear-gradient(180deg,#0e6f88 0%,#1593ac 100%);
  border-color:#0a4f64;
  box-shadow:inset 0 3px 7px rgba(0,0,0,.42), inset 5px 0 0 #f0b82f, 0 1px 0 rgba(255,255,255,.18);
}
.nav-item .ni{ text-shadow:none; }
.ghost-btn{
  border-radius:9px; color:#eef5fa; border:1px solid rgba(255,255,255,.2); border-bottom-color:rgba(0,0,0,.3);
  background:linear-gradient(180deg,rgba(255,255,255,.18) 0%,rgba(255,255,255,.05) 100%);
  text-shadow:0 -1px 0 rgba(0,0,0,.3);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.3), 0 3px 0 rgba(0,0,0,.35), 0 5px 9px rgba(0,0,0,.2);
  transition:transform .08s ease, box-shadow .08s ease;
}
.ghost-btn:first-child{ background:linear-gradient(180deg,#2bb3c9 0%,#12879f 55%,#0b6a83 100%); border-color:#0a4f64; }
.ghost-btn:hover{ background:linear-gradient(180deg,rgba(255,255,255,.3) 0%,rgba(255,255,255,.12) 100%); border-color:rgba(255,255,255,.35); }
.ghost-btn:first-child:hover{ background:linear-gradient(180deg,#3cc4d9 0%,#1595ae 55%,#0d7893 100%); }
.ghost-btn:active{ transform:translateY(3px); box-shadow:inset 0 3px 6px rgba(0,0,0,.4), 0 0 0 rgba(0,0,0,.35); }
.menu-toggle{
  border-radius:10px; border:1px solid var(--e-plate-edge);
  background:linear-gradient(180deg,#fff 0%,#e8eff5 100%);
  box-shadow:inset 0 1px 0 #fff, 0 3px 0 var(--e-plate-drop), 0 6px 12px rgba(18,59,93,.2);
}
.menu-toggle:active{ transform:translateY(3px); box-shadow:inset 0 3px 6px rgba(18,59,93,.25); }

/* ---------- Pager, attendance toggles ---------- */
.pager button{
  border-radius:8px; min-width:34px; font-weight:700; color:var(--ink-800);
  background:linear-gradient(180deg,#fff 0%,#e8eff5 100%); border:1px solid var(--e-plate-edge);
  box-shadow:inset 0 1px 0 #fff, 0 2px 0 var(--e-plate-drop), 0 4px 8px rgba(18,59,93,.12);
}
.pager button:active{ transform:translateY(2px); box-shadow:inset 0 2px 5px rgba(18,59,93,.25); }
.pager button.active{
  color:#fff; text-shadow:0 -1px 0 rgba(0,0,0,.35); border-color:var(--e-teal-edge);
  background:linear-gradient(180deg,#0e6f88 0%,#12879f 100%);
  box-shadow:inset 0 3px 6px rgba(0,0,0,.4);
  transform:translateY(1px);
}
.attendance-status-btn{
  border-radius:9px; background:linear-gradient(180deg,#fff 0%,#e8eff5 100%); border:1px solid var(--e-plate-edge);
  box-shadow:inset 0 1px 0 #fff, 0 2px 0 var(--e-plate-drop), 0 4px 8px rgba(18,59,93,.12);
}
.attendance-status-btn:hover{ transform:none; }
.attendance-status-btn:active{ transform:translateY(2px); }
.attendance-status-btn.active{ transform:translateY(1px); box-shadow:inset 0 3px 6px rgba(0,0,0,.28)!important; }

/* ---------- Raised cards, recessed fields ---------- */
.panel,.card{
  border-radius:14px; border:1px solid #cfdbe6;
  background:linear-gradient(180deg,#ffffff 0%,#f6f9fc 100%);
  box-shadow:inset 0 1px 0 #fff, 0 2px 0 #c3d1de, 0 10px 24px rgba(18,59,93,.12);
}
.stat-card{
  border-radius:14px; border:1px solid #cfdbe6; border-top-width:4px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9), 0 3px 0 #c3d1de, 0 12px 24px rgba(18,59,93,.13);
}
.modal{
  border-radius:16px; border:1px solid #c9d7e3;
  background:linear-gradient(180deg,#ffffff 0%,#f4f8fb 100%);
  box-shadow:inset 0 1px 0 #fff, 0 4px 0 #b9c9d8, 0 30px 60px rgba(8,40,66,.38);
}
.form-grid input,.form-grid select,.form-grid textarea,.toolbar input,.toolbar select,.inline-label input{
  border-radius:8px; border:1px solid #bccbd8; background:linear-gradient(180deg,#f1f5f9 0%,#ffffff 22%);
  box-shadow:inset 0 2px 4px rgba(18,59,93,.14), 0 1px 0 #fff; transition:box-shadow .12s ease, border-color .12s ease;
}
.form-grid input:focus,.form-grid select:focus,.form-grid textarea:focus,.toolbar input:focus,.toolbar select:focus{
  outline:none; border-color:var(--e-teal-2); box-shadow:inset 0 2px 4px rgba(18,59,93,.14), 0 0 0 3px rgba(43,179,201,.28);
}
input[type=file]{ font-size:12.5px; }
input[type=file]::file-selector-button{
  margin-right:10px; padding:7px 13px; border-radius:7px; font-weight:700; cursor:pointer; color:var(--ink-800);
  background:linear-gradient(180deg,#fff 0%,#e8eff5 100%); border:1px solid var(--e-plate-edge);
  box-shadow:inset 0 1px 0 #fff, 0 2px 0 var(--e-plate-drop);
}
input[type=file]::file-selector-button:active{ transform:translateY(2px); box-shadow:inset 0 2px 5px rgba(18,59,93,.25); }
.table-wrap{ border-radius:12px; box-shadow:inset 0 1px 0 #fff, 0 2px 0 #c3d1de, 0 8px 18px rgba(18,59,93,.09); }
thead th{ text-shadow:0 -1px 0 rgba(0,0,0,.35); }
.toast{ border-radius:10px; box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 4px 0 rgba(0,0,0,.35), 0 12px 26px rgba(0,0,0,.35); }
.badge{ box-shadow:inset 0 1px 0 rgba(255,255,255,.7), 0 1px 2px rgba(18,59,93,.16); }
.file-banner .btn{ margin-left:2px; }

/* Never print the 3D chrome */
@media print{ .btn,.nav-item,.panel,.card,.modal{ box-shadow:none!important; } }

/* Mobile: hide the hamburger while the drawer is open so it never covers the logo */
body:has(.sidebar.open) .menu-toggle{ display:none; }
