:root{
  --bg:#F3F5F8;
  --surface:#FFFFFF;
  --ink:#11162A;
  --muted:#66708A;
  --border:#E3E7EE;
  --sidebar:#0D1326;
  --sidebar-2:#171F3B;
  --sidebar-text:#AEB6D4;
  --accent:#0E8074;
  --accent-dark:#0A6359;
  --accent-soft:#E4F5F2;
  --amber:#D97706;
  --amber-soft:#FDF1DF;
  --red:#DC2626;
  --red-soft:#FCE9E9;
  --green:#15803D;
  --green-soft:#E7F5EC;
  --radius:12px;
  --shadow:0 1px 2px rgba(17,22,42,0.04), 0 8px 24px -12px rgba(17,22,42,0.10);
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  font-family:'Inter',sans-serif;
  background:var(--bg);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.display{font-family:'Space Grotesk',sans-serif;}
.mono{font-family:'IBM Plex Mono',monospace;}
button{font-family:inherit; cursor:pointer;}
input,select{font-family:inherit;}

/* ---------- LOGIN ---------- */
#loginScreen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at 15% 20%, rgba(14,128,116,0.15), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(217,119,6,0.10), transparent 40%),
    var(--sidebar);
  padding:24px;
}
.login-card{
  position:relative;
  width:100%;
  max-width:420px;
  background:var(--surface);
  border-radius:18px;
  padding:40px 34px 34px;
  box-shadow:0 30px 70px -20px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04);
  overflow:hidden;
}
.login-card::before{
  content:"";
  position:absolute; top:0; left:0; right:0; height:5px;
  background:linear-gradient(90deg, var(--accent), #14A392 40%, var(--amber) 100%);
}
.login-logo-wrap{
  display:flex; justify-content:center; margin-bottom:16px;
}
.login-logo{
  width:78px; height:78px; object-fit:contain;
  background:#fff; border-radius:50%;
  padding:8px;
  box-shadow:0 0 0 4px var(--accent-soft), 0 8px 22px -8px rgba(14,128,116,0.35);
}
.login-brand{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-bottom:4px;
}
.login-brand .sys-name{
  font-family:'Space Grotesk',sans-serif;
  font-size:19px; font-weight:700; letter-spacing:0.02em;
  color:var(--ink);
  text-align:center;
}
.login-card p.tag{color:var(--muted); font-size:13px; margin-bottom:28px; text-align:center; font-weight:500;}
.field{margin-bottom:16px;}
.field label{display:block; font-size:12.5px; font-weight:600; color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:0.04em;}
.field select, .field input{
  width:100%; padding:11px 12px; border:1.5px solid var(--border); border-radius:9px;
  font-size:14.5px; background:#FAFBFC; transition:border-color .15s;
}
.field select:focus, .field input:focus{outline:none; border-color:var(--accent); background:#fff;}
.btn-primary{
  width:100%; padding:12px; border:none; border-radius:9px;
  background:var(--accent); color:#fff; font-weight:600; font-size:14.5px;
  transition:background .15s;
  margin-top:6px;
}
.btn-primary:hover{background:var(--accent-dark);}
.login-hint{
  margin-top:18px; padding:12px 14px; background:var(--accent-soft); border-radius:9px;
  font-size:12.5px; color:var(--accent-dark); line-height:1.6;
}
.login-error{
  margin-top:10px; padding:10px 12px; background:var(--red-soft); color:var(--red);
  border-radius:8px; font-size:13px; display:none;
}

/* ---------- APP SHELL ---------- */
#app{display:none; min-height:100vh;}
.shell{display:flex; min-height:100vh;}
.sidebar{
  width:250px; flex-shrink:0; background:var(--sidebar);
  display:flex; flex-direction:column; padding:20px 14px;
}
.brand{
  display:flex; align-items:center; gap:10px; padding:8px 8px 20px 8px;
  border-bottom:1px solid rgba(255,255,255,0.08); margin-bottom:8px;
}
.brand-logo{
  width:38px; height:38px; object-fit:contain; background:#fff; border-radius:50%;
  padding:4px; flex-shrink:0; box-shadow:0 0 0 2px rgba(14,128,116,0.4);
}
.brand-text{display:flex; flex-direction:column; line-height:1.25; min-width:0;}
.brand-title{
  color:#fff; font-weight:700; font-size:12.5px; letter-spacing:0.01em;
  font-family:'Space Grotesk',sans-serif; white-space:normal;
}
.brand-sub{color:var(--sidebar-text); font-size:10px; font-weight:500; margin-top:1px;}
.nav-section-label{
  color:#5C6690; font-size:11px; font-weight:600; text-transform:uppercase;
  letter-spacing:0.06em; padding:14px 10px 6px;
}
.nav-item{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:9px; color:var(--sidebar-text);
  font-size:14px; font-weight:500; cursor:pointer; margin-bottom:2px;
  transition:background .12s, color .12s;
}
.nav-item .ic{width:18px; text-align:center; font-size:15px;}
.nav-item:hover{background:var(--sidebar-2); color:#fff;}
.nav-item.active{background:var(--accent); color:#fff;}
.nav-badge{
  margin-left:auto; background:var(--red); color:#fff; font-size:10.5px; font-weight:700;
  padding:1px 7px; border-radius:20px; line-height:1.5;
}
.sidebar-foot{margin-top:auto; padding:14px 10px 4px; border-top:1px solid rgba(255,255,255,0.08);}
.user-chip{display:flex; align-items:center; gap:10px; margin-bottom:10px;}
.user-chip .av{
  width:34px; height:34px; border-radius:50%; background:var(--accent);
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:13px;
}
.user-chip .meta .name{color:#fff; font-size:13.5px; font-weight:600;}
.user-chip .meta .role{color:var(--sidebar-text); font-size:11.5px;}
.logout-btn{
  width:100%; padding:8px; border-radius:8px; border:1px solid rgba(255,255,255,0.12);
  background:transparent; color:var(--sidebar-text); font-size:12.5px; font-weight:600;
}
.logout-btn:hover{background:var(--sidebar-2); color:#fff;}

.main{flex:1; min-width:0; display:flex; flex-direction:column;}
.topbar{
  height:64px; background:var(--surface); border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; padding:0 28px;
  position:sticky; top:0; z-index:5;
}
.topbar h1{font-size:19px; font-weight:700; letter-spacing:-0.01em;}
.topbar .sub{font-size:12.5px; color:var(--muted); margin-top:1px;}
.badge-role{
  padding:5px 12px; border-radius:20px; font-size:12px; font-weight:600;
  background:var(--accent-soft); color:var(--accent-dark);
}
.content{padding:26px 28px 60px; max-width:1280px; width:100%;}

/* ---------- CARDS / GRID ---------- */
.stat-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:22px;}
@media(max-width:1000px){.stat-grid{grid-template-columns:repeat(2,1fr);}}
.stat-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px 18px; box-shadow:var(--shadow);
}
.stat-card .lbl{font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:0.03em; margin-bottom:8px;}
.stat-card .val{font-size:26px; font-weight:700; font-family:'Space Grotesk',sans-serif;}
.stat-card .delta{font-size:12px; margin-top:6px; font-weight:600;}
.stat-card .delta.up{color:var(--green);}
.stat-card .delta.warn{color:var(--amber);}

.panel{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); margin-bottom:22px; overflow:hidden;
}
.panel-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--border);
}
.panel-head h3{font-size:15.5px; font-weight:700;}
.panel-head .hint{font-size:12px; color:var(--muted); margin-top:2px;}
.panel-body{padding:18px 20px;}

/* dept bar rows (signature element: ink-drop usage gauge) */
.dept-row{display:flex; align-items:center; gap:14px; padding:10px 0; border-bottom:1px solid #F1F2F5;}
.dept-row:last-child{border-bottom:none;}
.drop{
  width:30px; height:34px; flex-shrink:0; position:relative;
}
.drop svg{width:100%; height:100%; display:block;}
.dept-row .name{width:130px; font-size:13.5px; font-weight:600; flex-shrink:0;}
.dept-row .bar-track{flex:1; height:9px; background:#EEF0F4; border-radius:6px; overflow:hidden;}
.dept-row .bar-fill{height:100%; border-radius:6px; background:linear-gradient(90deg,var(--accent),#14A392);}
.dept-row .num{width:90px; text-align:right; font-size:12.5px; font-weight:600; color:var(--muted); flex-shrink:0;}

/* ---------- TABS ---------- */
.tabs{display:flex; gap:4px; margin-bottom:18px; border-bottom:1px solid var(--border); padding-bottom:0;}
.tab-btn{
  padding:10px 16px; font-size:13.5px; font-weight:600; color:var(--muted);
  border:none; background:none; border-bottom:2.5px solid transparent; margin-bottom:-1px;
}
.tab-btn.active{color:var(--accent-dark); border-bottom-color:var(--accent);}
.tab-panel{display:none;}
.tab-panel.active{display:block;}

/* ---------- FORMS ---------- */
.form-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; align-items:end;}
@media(max-width:900px){.form-grid{grid-template-columns:repeat(2,1fr);}}
.form-grid .field{margin-bottom:0;}
.form-grid .field label{margin-bottom:5px;}
.btn-add{
  padding:11px 14px; background:var(--accent); color:#fff; border:none; border-radius:9px;
  font-weight:600; font-size:13.5px; white-space:nowrap;
}
.btn-add:hover{background:var(--accent-dark);}
.btn-ghost{
  padding:8px 12px; background:transparent; border:1.5px solid var(--border); border-radius:8px;
  font-weight:600; font-size:12.5px; color:var(--ink);
}
.btn-ghost:hover{border-color:var(--accent); color:var(--accent-dark);}
.btn-danger-ghost{
  padding:6px 10px; background:var(--red-soft); border:none; border-radius:7px;
  font-weight:600; font-size:12px; color:var(--red);
}

/* ---------- TABLE ---------- */
.tbl-wrap{overflow-x:auto;}
table{width:100%; border-collapse:collapse; font-size:13.2px;}
thead th{
  text-align:left; padding:10px 14px; background:#FAFBFC; color:var(--muted);
  font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.03em;
  border-bottom:1px solid var(--border); white-space:nowrap;
}
tbody td{padding:11px 14px; border-bottom:1px solid #F1F2F5; white-space:nowrap;}
tbody tr:last-child td{border-bottom:none;}
tbody tr:hover{background:#FAFBFC;}
.tag{
  padding:3px 9px; border-radius:6px; font-size:11.5px; font-weight:600;
}
.tag.dept{background:var(--accent-soft); color:var(--accent-dark);}
.tag.month{background:#EEF0FA; color:#3B4270;}
.filter-row{display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap;}
.filter-row select, .filter-row input[type=text]{
  padding:8px 11px; border:1.5px solid var(--border); border-radius:8px; font-size:13px; background:#FAFBFC;
}
.empty-state{padding:34px 20px; text-align:center; color:var(--muted); font-size:13.5px;}

/* user mgmt */
.user-card{
  padding:12px 14px; border:1px solid var(--border); border-radius:10px; margin-bottom:8px;
}
.user-card .row{
  display:flex; align-items:center; justify-content:space-between;
}
.user-card .actions{display:flex; align-items:center; gap:8px;}
.reset-box{
  display:flex; align-items:center; gap:8px; margin-top:12px; padding-top:12px;
  border-top:1px dashed var(--border);
}
.reset-box input{
  flex:1; padding:8px 11px; border:1.5px solid var(--border); border-radius:8px; font-size:13px; background:#FAFBFC;
}
.reset-box input:focus{outline:none; border-color:var(--accent); background:#fff;}
.btn-reset{
  padding:8px 12px; background:var(--sidebar); color:#fff; border:none; border-radius:8px;
  font-weight:600; font-size:12px; white-space:nowrap;
}
.btn-reset:hover{background:var(--sidebar-2);}
.btn-cancel{
  padding:8px 10px; background:transparent; border:1.5px solid var(--border); border-radius:8px;
  font-weight:600; font-size:12px; color:var(--muted);
}
.user-card .av{
  width:36px; height:36px; border-radius:9px; background:var(--sidebar); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:13px; flex-shrink:0;
}
.user-card .info{display:flex; align-items:center; gap:12px;}
.user-card .name{font-size:13.5px; font-weight:600;}
.user-card .meta{font-size:12px; color:var(--muted); margin-top:1px;}

.toast{
  position:fixed; bottom:24px; right:24px; background:var(--ink); color:#fff;
  padding:12px 18px; border-radius:10px; font-size:13.5px; font-weight:500;
  box-shadow:0 10px 30px rgba(0,0,0,0.25); display:none; z-index:50;
}
.toast.show{display:block; animation:slideUp .2s ease;}
@keyframes slideUp{from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);}}

.two-col{display:grid; grid-template-columns:1.3fr 1fr; gap:18px;}
@media(max-width:980px){.two-col{grid-template-columns:1fr;}}

/* custom confirm modal (browser confirm() is blocked in sandboxed preview) */
.modal-overlay{
  display:none; position:fixed; inset:0; background:rgba(13,19,38,0.55);
  align-items:center; justify-content:center; z-index:100; padding:20px;
}
.modal-overlay.show{display:flex;}
.modal-box{
  background:#fff; border-radius:14px; padding:26px 26px 20px; max-width:360px; width:100%;
  box-shadow:0 30px 70px -20px rgba(0,0,0,0.5); text-align:center;
}
.modal-icon{
  width:42px; height:42px; border-radius:50%; background:var(--red-soft); color:var(--red);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:19px;
  margin:0 auto 14px;
}
.modal-box p{font-size:14px; color:var(--ink); line-height:1.5; margin-bottom:20px;}
.modal-actions{display:flex; gap:10px; justify-content:center;}
.modal-actions .btn-ghost{flex:1; padding:10px;}
.btn-modal-danger{
  flex:1; padding:10px; border:none; border-radius:8px; background:var(--red); color:#fff;
  font-weight:600; font-size:13.5px;
}
.btn-modal-danger:hover{background:#B91C1C;}

/* bulk select + delete bar */
.bulk-bar{
  display:none; align-items:center; justify-content:space-between;
  background:var(--red-soft); border:1px solid #F5C6C6; border-radius:9px;
  padding:9px 14px; margin-bottom:12px; font-size:13px; font-weight:600; color:var(--red);
}
.bulk-bar.show{display:flex;}
.bulk-bar .bulk-actions{display:flex; gap:8px;}
.bulk-bar button{padding:7px 12px; border-radius:7px; font-size:12.5px; font-weight:600; border:none;}
.bulk-bar .btn-bulk-delete{background:var(--red); color:#fff;}
.bulk-bar .btn-bulk-delete:hover{background:#B91C1C;}
.bulk-bar .btn-bulk-clear{background:#fff; color:var(--muted); border:1.5px solid #F5C6C6;}
input[type=checkbox]{width:16px; height:16px; accent-color:var(--accent); cursor:pointer;}

/* dept row with date/month meta line (dashboard breakdown sections) */
.dept-row-detailed{padding:10px 0; border-bottom:1px solid #F1F2F5;}
.dept-row-detailed:last-child{border-bottom:none;}
.dept-row-detailed .dept-row{border-bottom:none; padding:0;}
.dept-row-meta{display:flex; align-items:center; gap:6px; margin-top:7px; font-size:11px; color:var(--muted); flex-wrap:wrap;}
.dept-row-meta .last-date{margin-left:auto; font-weight:600; color:var(--ink); font-size:11px; white-space:nowrap;}
.empty-meta{font-size:11px; color:var(--muted); font-style:italic;}

/* ---------- REQUEST FORM MODULE ---------- */
.form-textarea{
  width:100%; padding:10px 12px; border:1.5px solid var(--border); border-radius:9px;
  font-size:14px; font-family:inherit; background:#FAFBFC; resize:vertical; min-height:70px;
}
.form-textarea:focus{outline:none; border-color:var(--accent); background:#fff;}
.field-full{grid-column:1/-1;}
.checkbox-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px 16px; margin-top:4px;
}
@media(max-width:800px){.checkbox-grid{grid-template-columns:repeat(2,1fr);}}
.checkbox-item{display:flex; align-items:center; gap:8px; font-size:13.5px; color:var(--ink);}
.checkbox-item input{flex-shrink:0;}
.other-input{
  margin-top:8px; padding:8px 11px; border:1.5px solid var(--border); border-radius:8px;
  font-size:13px; width:100%; background:#FAFBFC;
}

.status-badge{
  padding:4px 11px; border-radius:20px; font-size:11.5px; font-weight:700; white-space:nowrap;
}
.status-pending{background:var(--amber-soft); color:var(--amber);}
.status-progress{background:#E7ECFB; color:#3B4FBD;}
.status-completed{background:var(--green-soft); color:var(--green);}

.req-card{border:1px solid var(--border); border-radius:11px; margin-bottom:12px; overflow:hidden;}
.req-card-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px; cursor:pointer; background:#fff;
}
.req-card-head:hover{background:#FAFBFC;}
.req-card-left{display:flex; align-items:center; gap:12px; min-width:0;}
.req-icon{
  width:38px; height:38px; border-radius:9px; background:var(--accent-soft); color:var(--accent-dark);
  display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0;
}
.req-title{font-size:13.5px; font-weight:700;}
.req-sub{font-size:12px; color:var(--muted); margin-top:2px;}
.req-card-right{display:flex; align-items:center; gap:10px; flex-shrink:0;}
.req-chevron{color:var(--muted); font-size:13px; transition:transform .15s;}
.req-card.open .req-chevron{transform:rotate(90deg);}
.req-card-body{display:none; padding:0 18px 18px; border-top:1px solid var(--border); background:#FBFCFD;}
.req-card.open .req-card-body{display:block;}
.req-detail-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:12px 20px; margin-top:16px;
}
@media(max-width:900px){.req-detail-grid{grid-template-columns:repeat(2,1fr);}}
.req-detail-item .lbl{font-size:10.5px; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:0.03em; margin-bottom:3px;}
.req-detail-item .val{font-size:13.5px; font-weight:500;}
.req-chip-row{display:flex; flex-wrap:wrap; gap:6px; margin-top:4px;}
.req-chip{background:var(--accent-soft); color:var(--accent-dark); font-size:11.5px; font-weight:600; padding:3px 9px; border-radius:6px;}
.req-problem-box{
  background:#fff; border:1px solid var(--border); border-radius:9px; padding:12px 14px; margin-top:14px;
  font-size:13.5px; line-height:1.6; color:var(--ink);
}
.it-section{
  margin-top:18px; padding-top:16px; border-top:1.5px dashed var(--border);
}
.it-section h4{font-size:12.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; color:var(--muted); margin-bottom:12px;}
.req-actions-row{display:flex; gap:10px; margin-top:14px; flex-wrap:wrap;}
