/* ============================================================
   ForLogicx School ERP — Theme
   Brand palette: deep blue #1F4E79 / #2E75B6 (ForLogicx)
   ============================================================ */

:root {
  --brand: #1F4E79;
  --brand-2: #2E75B6;
  --brand-3: #5B9BD5;
  --brand-light: #EAF1F8;
  --brand-lighter: #F4F8FC;

  --ink: #1B2733;
  --ink-2: #46586B;
  --ink-3: #6B7B8C;
  --muted: #93A1B0;
  --line: #E4EAF0;
  --line-2: #EEF2F6;
  --bg: #F4F6FA;
  --card: #FFFFFF;

  --success: #1E9E63;
  --success-bg: #E6F6EE;
  --warning: #C77700;
  --warning-bg: #FCF1DD;
  --danger: #D23B3B;
  --danger-bg: #FBE9E9;
  --info: #2E75B6;
  --info-bg: #E7F0FA;
  --purple: #7A5BD5;
  --purple-bg: #EFEAFB;
  --neutral: #5E6E7E;
  --neutral-bg: #EDF1F5;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16,38,64,.06), 0 1px 3px rgba(16,38,64,.05);
  --shadow: 0 2px 8px rgba(16,38,64,.07), 0 1px 3px rgba(16,38,64,.06);
  --shadow-lg: 0 10px 30px rgba(16,38,64,.14);
  --sidebar-w: 256px;
  --topbar-h: 62px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0; color: var(--ink); font-weight: 700; }
p { margin: 0; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #A9B6C5; }

/* ============================== LOGIN ============================== */
.login-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(32px, 7vw, 96px);
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 38px; }
.login-logo, .sidebar-logo, .login-side-inner .lg {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 19px; letter-spacing: .5px;
  box-shadow: 0 6px 16px rgba(31,78,121,.35);
}
.login-brand h1 { font-size: 21px; }
.login-brand p { color: var(--ink-3); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-hint { color: var(--ink-3); font-size: 12.5px; text-align: center; margin-top: 4px; }
.login-footer { margin-top: 36px; color: var(--muted); font-size: 12px; }
.login-side {
  background: linear-gradient(150deg, var(--brand) 0%, #163a5c 60%, #11304b 100%);
  color: #fff; display: grid; place-items: center; padding: 40px;
  position: relative; overflow: hidden;
}
.login-side::before, .login-side::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.login-side::before { width: 380px; height: 380px; top: -120px; right: -90px; }
.login-side::after { width: 280px; height: 280px; bottom: -100px; left: -60px; background: rgba(91,155,213,.12); }
.login-side-inner { max-width: 420px; position: relative; z-index: 1; }
.login-side-inner h2 { color: #fff; font-size: 30px; line-height: 1.25; margin-bottom: 26px; }
.login-side-inner ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.login-side-inner li { font-size: 16px; padding-left: 30px; position: relative; color: #DCE8F4; }
.login-side-inner li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  width: 20px; height: 20px; border-radius: 6px; background: rgba(255,255,255,.16);
  display: grid; place-items: center; font-size: 12px; color: #fff;
}
@media (max-width: 880px) { .login-screen { grid-template-columns: 1fr; } .login-side { display: none; } }

/* ============================== SHELL ============================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, #1c466d 0%, var(--brand) 40%, #173a5b 100%);
  color: #cfe0ef; display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; height: 100vh; z-index: 50;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.sidebar-logo { width: 40px; height: 40px; border-radius: 11px; font-size: 15px; box-shadow: none; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.sidebar-brand-text strong { color: #fff; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand-text span { color: #9fc0dd; font-size: 11.5px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 6px 12px 18px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-color: transparent; }
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px;
  color: #7fa3c4; padding: 16px 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 9px; color: #cfe0ef; cursor: pointer; font-size: 13.5px;
  font-weight: 500; margin-bottom: 2px; transition: background .12s, color .12s;
  white-space: nowrap; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.nav-item .nav-ic { width: 18px; height: 18px; flex-shrink: 0; opacity: .92; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--brand-3); color: #06243c; font-size: 10.5px;
  font-weight: 700; padding: 1px 7px; border-radius: 20px;
}
.sidebar-foot { padding: 12px 18px; font-size: 11px; color: #7fa3c4; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(13,28,43,.5); z-index: 45;
}

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}
.topbar-burger { display: none; }
.topbar-title { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.topbar-title .crumb-main { color: var(--ink); font-weight: 700; font-size: 15px; }
.topbar-title .crumb-sep { color: var(--muted); margin: 0 7px; }
.topbar-spacer { flex: 1; }
.topbar-search { position: relative; }
.topbar-search input {
  width: 230px; height: 38px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 12px 0 34px; font-size: 13px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2393A1B0' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E") no-repeat 11px center;
}
.topbar-search input:focus { outline: none; border-color: var(--brand-2); background-color: #fff; }
.role-switch select {
  height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 8px;
  font-size: 12.5px; color: var(--ink-2); background: var(--bg);
}
.user-menu { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 13px; }
.user-meta span { font-size: 11.5px; color: var(--ink-3); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-2);
  position: relative;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn[data-count]::after {
  content: attr(data-count); position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff; font-size: 9px; font-weight: 700;
  min-width: 15px; height: 15px; border-radius: 10px; display: grid; place-items: center; padding: 0 3px;
}

.content { flex: 1; padding: 22px 26px 40px; max-width: 1500px; width: 100%; margin: 0 auto; }
.app-footer {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 26px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line);
}

/* ============================== PAGE HEADER ============================== */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head-text h2 { font-size: 21px; }
.page-head-text p { color: var(--ink-3); font-size: 13.5px; margin-top: 3px; }
.page-head-actions { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ============================== BUTTONS ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s;
  background: var(--card); color: var(--ink); text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #19405f; text-decoration: none; }
.btn-secondary { background: var(--brand-2); color: #fff; }
.btn-secondary:hover { background: #2766a1; }
.btn-outline { border-color: var(--line); color: var(--ink-2); background: var(--card); }
.btn-outline:hover { border-color: var(--brand-2); color: var(--brand); background: var(--brand-lighter); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b62f2f; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============================== CARDS ============================== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 15px; }
.card-head .sub { color: var(--ink-3); font-size: 12.5px; }
.card-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.card-tight .card-body { padding: 14px; }

/* grid helpers */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 18px; flex-wrap: wrap; }
.col { flex: 1; min-width: 0; }
/* vertical rhythm between adjacent block rows (fixes cards touching on the dashboard) */
.grid + .grid, .row + .row, .grid + .row, .row + .grid { margin-top: 18px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ============================== STAT CARDS ============================== */
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; gap: 14px; align-items: flex-start;
}
.stat-ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-light); color: var(--brand);
}
.stat-ic svg { width: 22px; height: 22px; }
.stat-ic.green { background: var(--success-bg); color: var(--success); }
.stat-ic.amber { background: var(--warning-bg); color: var(--warning); }
.stat-ic.red { background: var(--danger-bg); color: var(--danger); }
.stat-ic.purple { background: var(--purple-bg); color: var(--purple); }
.stat-ic.blue { background: var(--info-bg); color: var(--info); }
.stat-main { min-width: 0; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-label { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.stat-trend { font-size: 11.5px; font-weight: 600; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ============================== TABLES ============================== */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .4px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--brand-lighter); white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: middle; }
table.tbl tbody tr:hover { background: var(--brand-lighter); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.center, table.tbl th.center { text-align: center; }
.tbl .strong { color: var(--ink); font-weight: 600; }
.tbl-clickable tbody tr { cursor: pointer; }

.table-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line-2);
}
.table-toolbar .grow { flex: 1; }
.search-box { position: relative; min-width: 220px; }
.search-box input {
  width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 12px 0 34px; font-size: 13px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2393A1B0' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E") no-repeat 11px center;
}
.search-box input:focus { outline: none; border-color: var(--brand-2); }

.pagination { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.pagination .pg-info { color: var(--ink-3); font-size: 12.5px; margin-right: auto; }
.pg-btn {
  min-width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 8px;
  font-size: 12.5px; cursor: pointer; color: var(--ink-2); padding: 0 8px;
}
.pg-btn:hover:not(:disabled) { border-color: var(--brand-2); color: var(--brand); }
.pg-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg-btn:disabled { opacity: .45; cursor: default; }

/* ============================== BADGES / PILLS ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.no-dot::before { display: none; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge-primary { background: var(--brand-light); color: var(--brand); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: var(--brand-light); color: var(--brand); }

/* ============================== FORMS ============================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-label .req { color: var(--danger); }
.field input, .field select, .field textarea,
input.inp, select.inp, textarea.inp {
  height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); background: #fff; width: 100%;
}
.field textarea, textarea.inp { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus,
.inp:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(46,117,182,.12); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 11.5px; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--brand); text-transform: uppercase;
  letter-spacing: .5px; margin: 6px 0 2px; grid-column: 1 / -1;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-2);
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar select, .filter-bar input {
  height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; font-size: 13px; background: #fff;
}

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #cdd8e3; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ============================== TABS ============================== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-3); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--brand); text-decoration: none; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* ============================== AVATAR / MEDIA ============================== */
.avatar {
  border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--brand-3)); color: #fff;
  display: inline-grid; place-items: center; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sq { border-radius: 10px; }

/* photo slot — person silhouette placeholder (stands in for an uploaded photo) */
.photo {
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0; vertical-align: middle;
  border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}
.photo .sil { width: 66%; height: 66%; }
.photo.sq { border-radius: 12px; place-items: end center; }
.photo.sq .sil { width: 84%; height: 84%; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .nm { font-weight: 600; color: var(--ink); }
.cell-user .sub { font-size: 11.5px; color: var(--ink-3); }

/* ============================== MODAL ============================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(13,28,43,.45); display: grid; place-items: center;
  z-index: 100; padding: 20px; animation: fade .15s ease;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; animation: pop .16s ease;
}
.modal.modal-lg { max-width: 820px; }
.modal.modal-sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 16px; }
.modal-head .sub { font-size: 12.5px; color: var(--ink-3); }
.modal-close { margin-left: auto; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ============================== TOAST ============================== */
.toast-host { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand-2);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 12px 16px; min-width: 260px; max-width: 360px;
  display: flex; gap: 11px; align-items: flex-start; animation: slidein .2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .t-ic { flex-shrink: 0; margin-top: 1px; }
.toast .t-title { font-weight: 700; font-size: 13.5px; }
.toast .t-msg { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }

/* ============================== MISC ============================== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty-state .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--bg); display: grid; place-items: center; margin: 0 auto 14px; color: var(--muted); }
.empty-state h4 { font-size: 15px; margin-bottom: 4px; }
.empty-state p { font-size: 13px; max-width: 340px; margin: 0 auto; }

.progress { height: 7px; background: var(--line); border-radius: 10px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand-2); border-radius: 10px; }
.progress.green > span { background: var(--success); }
.progress.amber > span { background: var(--warning); }
.progress.red > span { background: var(--danger); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 9px 16px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; }

.divider { height: 1px; background: var(--line-2); margin: 16px 0; border: none; }
.muted { color: var(--ink-3); }
.text-sm { font-size: 12.5px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.items-center { align-items: center; }
.wrap { flex-wrap: wrap; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* chart */
.chart svg { display: block; width: 100%; height: auto; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

/* attendance / marks grids */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 10px; }
.att-cell {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: #fff; padding: 5px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; color: var(--ink-3); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button.on-P { background: var(--success); color: #fff; }
.seg button.on-A { background: var(--danger); color: #fff; }
.seg button.on-L { background: var(--warning); color: #fff; }
.seg button.on-H { background: var(--info); color: #fff; }

/* id-card preview (CR80) */
.idcard {
  width: 320px; height: 202px; border-radius: 14px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--brand), var(--brand-2)); box-shadow: var(--shadow-lg); flex-shrink: 0;
}
.idcard .ic-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.idcard .ic-logo { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.idcard .ic-school { font-size: 12px; font-weight: 700; line-height: 1.1; }
.idcard .ic-body { display: flex; gap: 12px; padding: 4px 14px; align-items: center; }
.idcard .ic-photo { width: 64px; height: 76px; border-radius: 8px; background: rgba(255,255,255,.92); color: var(--brand); display: grid; place-items: end center; font-weight: 800; font-size: 22px; overflow: hidden; }
.idcard .ic-photo .sil { width: 80%; height: auto; }
.idcard .ic-name { font-size: 15px; font-weight: 800; }
.idcard .ic-meta { font-size: 10.5px; opacity: .92; line-height: 1.5; margin-top: 3px; }
.idcard .ic-foot { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.18); font-size: 9px; padding: 4px 14px; display: flex; justify-content: space-between; }

/* responsive shell */
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .app-shell.nav-open .sidebar-backdrop { display: block; }
  .main { margin-left: 0; }
  .topbar-burger { display: grid; }
  .topbar-search { display: none; }
  .user-meta { display: none; }
}
@media (max-width: 560px) {
  .content { padding: 16px 14px 32px; }
  .role-switch { display: none; }
  .page-head-actions { width: 100%; }
}

/* print (receipts, payslips, id cards, report cards) */
@media print {
  .sidebar, .topbar, .app-footer, .sidebar-backdrop, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .print-sheet { box-shadow: none !important; border: none !important; }
}
.print-sheet { background: #fff; }
