/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
:root {
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 14px;
  --radius-sm: 10px;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);

  /* Palette */
  --primary:       #4f46e5;
  --primary-dark:  #4338ca;
  --primary-glow:  rgba(79,70,229,.18);
  --primary-soft:  rgba(79,70,229,.08);
  --success:       #059669;
  --success-soft:  rgba(5,150,105,.09);
  --danger:        #dc2626;
  --danger-soft:   rgba(220,38,38,.09);
  --warning:       #d97706;
  --warning-soft:  rgba(217,119,6,.09);
  --info:          #0284c7;
  --info-soft:     rgba(2,132,199,.09);
  --purple:        #7c3aed;
  --purple-soft:   rgba(124,58,237,.09);
  --teal:          #0d9488;
  --teal-soft:     rgba(13,148,136,.09);

  /* Neutral */
  --bg:       #f1f5f9;
  --surface:  #ffffff;
  --border:   rgba(226,232,240,1);
  --text:     #0f172a;
  --text-2:   #334155;
  --muted:    #64748b;
  --muted-2:  #94a3b8;

  /* Sidebar */
  --sb-bg:    #0f172a;
  --sb-border: rgba(255,255,255,.06);

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 6px 20px rgba(0,0,0,.05);
  --shadow-lg: 0 4px 6px rgba(0,0,0,.05), 0 20px 40px rgba(0,0,0,.08);
}

/* ═══════════════════════════════════════════
   BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

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

.app-backdrop {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(ellipse at 75% -5%,  rgba(79,70,229,.07)  0%, transparent 50%),
    radial-gradient(ellipse at 0%  100%, rgba(13,148,136,.05) 0%, transparent 50%);
}

/* ═══════════════════════════════════════════
   SIDEBAR OVERLAY
═══════════════════════════════════════════ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 199;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  color: #fff;
  position: fixed; top: 0; left: 0; height: 100%;
  z-index: 200;
  display: flex; flex-direction: column;
  padding: 0;
  overflow-y: auto; overflow-x: hidden;
  transform: translateX(0);
  transition: transform var(--transition), box-shadow var(--transition);
  border-right: 1px solid var(--sb-border);
}
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,.4); }
}

/* Brand */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sb-border);
}
.brand img {
  width: 38px; height: 38px; border-radius: 10px;
  object-fit: contain; flex-shrink: 0;
  background: rgba(255,255,255,.1);
}
.brand-title   { font-weight: 700; font-size: .95rem; line-height: 1.2; letter-spacing: -.01em; }
.brand-subtitle { color: rgba(255,255,255,.4); font-size: .7rem; margin-top: 1px; }

/* Close btn (mobile) */
.sidebar-close {
  display: none; position: absolute; top: 16px; right: 14px;
  background: rgba(255,255,255,.1); border: none; color: #fff;
  border-radius: 8px; width: 30px; height: 30px; font-size: 1rem;
  cursor: pointer; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.sidebar-close:hover { background: rgba(255,255,255,.18); }
@media (max-width: 991px) { .sidebar-close { display: flex; } }

/* Nav scroll area */
.sb-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }

.nav-section {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.28);
  padding: 16px 10px 6px; user-select: none;
}
.nav-section:first-child { padding-top: 8px; }

.sidebar .nav-link {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.65);
  border-radius: 10px; padding: 9px 10px;
  font-size: .875rem; font-weight: 500;
  transition: all var(--transition); position: relative;
  margin-bottom: 1px;
}
.sidebar .nav-link .nav-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  background: transparent;
  transition: all var(--transition);
}
.sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}
.sidebar .nav-link:hover .nav-icon { background: rgba(255,255,255,.08); }
.sidebar .nav-link.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(79,70,229,.4);
}
.sidebar .nav-link.active .nav-icon {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* Sidebar footer */
.sb-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--sb-border);
}
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 12px; margin-bottom: 4px;
}
.sb-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: #fff;
}
.sb-user-name  { font-size: .82rem; font-weight: 600; color: rgba(255,255,255,.9); line-height: 1.2; }
.sb-user-role  { font-size: .68rem; color: rgba(255,255,255,.4); text-transform: capitalize; }
.sb-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px; border-radius: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.6); font-size: .84rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.sb-logout:hover { background: rgba(220,38,38,.15); border-color: rgba(220,38,38,.3); color: #fca5a5; }

/* ═══════════════════════════════════════════
   CONTENT AREA
═══════════════════════════════════════════ */
.content-area {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}
@media (max-width: 991px) { .content-area { margin-left: 0; } }

/* ═══════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 100;
  background: rgba(241,245,249,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
}

.topbar-toggle {
  display: none; border: none; background: transparent;
  color: var(--text); font-size: 1.25rem; padding: 6px;
  border-radius: 8px; cursor: pointer; line-height: 1;
  transition: background var(--transition); flex-shrink: 0;
}
.topbar-toggle:hover { background: rgba(0,0,0,.06); }
@media (max-width: 991px) { .topbar-toggle { display: flex; align-items: center; } }

.topbar-title { flex: 1; min-width: 0; }
.topbar-title .page-label {
  font-size: .67rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); line-height: 1;
}
.topbar-title h1 {
  font-size: 1.1rem; font-weight: 700; margin: 2px 0 0;
  line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 50px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: #fff; flex-shrink: 0;
}
.user-info { line-height: 1.25; }
.user-info .u-name { font-size: .82rem; font-weight: 600; color: var(--text); }
.user-info .u-role { font-size: .68rem; color: var(--muted); text-transform: capitalize; }
@media (max-width: 479px) { .user-info { display: none; } }

/* ═══════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════ */
main.container-fluid { padding: 24px; flex: 1; }
@media (max-width: 767px) { main.container-fluid { padding: 16px; } }
@media (max-width: 479px) { main.container-fluid { padding: 12px; } }

/* ═══════════════════════════════════════════
   CARDS
═══════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius) var(--radius) 0 0 !important;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-body { padding: 20px; }
.card-title { font-size: .95rem; font-weight: 700; color: var(--text); margin: 0; }

/* ── Stat Cards ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.stat-body { min-width: 0; }
.stat-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
@media (max-width: 575px) { .stat-value { font-size: 1.5rem; } .stat-icon { width: 42px; height: 42px; font-size: 1.1rem; } }

/* ═══════════════════════════════════════════
   DASHBOARD QUICK ACTIONS
═══════════════════════════════════════════ */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 479px) { .qa-grid { grid-template-columns: 1fr; } }
.qa-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text); font-weight: 600; font-size: .875rem;
  transition: all var(--transition); cursor: pointer;
}
.qa-item:hover {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px); box-shadow: 0 4px 12px var(--primary-glow);
}
.qa-item .qa-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}

/* ── Today Summary ── */
.today-stat { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.today-stat + .today-stat { border-top: 1px solid var(--border); }
.today-stat-label { font-size: .875rem; color: var(--text-2); }
.today-stat-val { font-size: 1.1rem; font-weight: 700; }

/* ── Class list items ── */
.class-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; gap: 8px;
}
.class-list-item + .class-list-item { border-top: 1px solid var(--border); }
.class-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 8px; padding: 4px 10px;
  font-size: .8rem; font-weight: 600;
}

/* ═══════════════════════════════════════════
   ATTENDANCE CARDS (mark attendance page)
═══════════════════════════════════════════ */
.attendance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
@media (max-width: 479px) { .attendance-grid { grid-template-columns: 1fr; } }

.attendance-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  cursor: pointer; transition: all var(--transition);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.attendance-card:hover { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(79,70,229,.08); }
.attendance-card.is-absent {
  background: rgba(220,38,38,.03);
  border-color: rgba(220,38,38,.35);
}
.attendance-card.is-absent:hover { box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.attendance-card input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0;
  cursor: pointer; accent-color: var(--danger); border-radius: 4px;
}
.attendance-card .card-body-text { flex: 1; min-width: 0; }
.attendance-card .fw-semibold { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attendance-card .small { font-size: .76rem; color: var(--muted); }
.status-badge { flex-shrink: 0; font-size: .7rem; padding: 3px 9px; border-radius: 50px; }

/* ═══════════════════════════════════════════
   AUTH
═══════════════════════════════════════════ */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 70% 10%, rgba(79,70,229,.12)  0%, transparent 55%),
    radial-gradient(ellipse at 10% 90%, rgba(13,148,136,.09) 0%, transparent 50%),
    var(--bg);
}
.auth-container { width: 100%; max-width: 420px; }
.auth-card {
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   TABLES
═══════════════════════════════════════════ */
.table-responsive { border-radius: var(--radius-sm); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { font-size: .875rem; margin-bottom: 0; color: var(--text); }
.table thead tr { background: #f8fafc; }
.table thead th {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
  border-bottom: 2px solid var(--border); padding: 10px 14px;
  white-space: nowrap;
}
.table tbody td { padding: 11px 14px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f8fafc; }
.table-striped > tbody > tr:nth-of-type(odd) > td { background: transparent; }
@media (max-width: 575px) {
  .table { font-size: .82rem; }
  .table thead th, .table tbody td { padding: 8px 10px; }
}

/* ═══════════════════════════════════════════
   FORMS
═══════════════════════════════════════════ */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(203,213,225,1);
  padding: 9px 12px; font-size: .875rem;
  background: var(--surface); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}
.form-control::placeholder { color: var(--muted-2); }
.form-label { font-size: .82rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-text { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.input-group-text {
  border: 1.5px solid rgba(203,213,225,1);
  background: #f8fafc; color: var(--muted);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.input-group .form-control:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .form-control:not(:first-child) { border-left: none; }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  border-radius: var(--radius-sm); font-weight: 600; font-size: .875rem;
  padding: 8px 16px; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary {
  background: var(--primary); border-color: var(--primary);
  color: #fff; box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-dark); border-color: var(--primary-dark);
  transform: translateY(-1px); box-shadow: 0 4px 14px var(--primary-glow);
  color: #fff;
}
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #047857; border-color: #047857; color: #fff; transform: translateY(-1px); }
.btn-outline-success { color: var(--success); border-color: var(--success); }
.btn-outline-success:hover { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-outline-danger { color: var(--danger); border-color: rgba(220,38,38,.4); }
.btn-outline-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-outline-secondary { color: var(--text-2); border-color: var(--border); background: var(--surface); }
.btn-outline-secondary:hover { background: #f1f5f9; color: var(--text); border-color: #cbd5e1; }
.btn-sm { padding: 5px 10px; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }

/* ═══════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════ */
.alert { border-radius: var(--radius-sm); font-size: .875rem; border: none; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: rgba(5,150,105,.08);  color: #065f46; border-left: 3px solid var(--success); }
.alert-danger   { background: rgba(220,38,38,.08);  color: #991b1b; border-left: 3px solid var(--danger); }
.alert-warning  { background: rgba(217,119,6,.08);  color: #92400e; border-left: 3px solid var(--warning); }
.alert-info     { background: rgba(2,132,199,.08);   color: #1e40af; border-left: 3px solid var(--info); }

/* ═══════════════════════════════════════════
   BADGES
═══════════════════════════════════════════ */
.badge { border-radius: 6px; font-weight: 600; font-size: .7rem; padding: 3px 8px; }
.text-bg-success { background: var(--success-soft) !important; color: var(--success) !important; }
.text-bg-danger  { background: var(--danger-soft)  !important; color: var(--danger)  !important; }
.text-bg-warning { background: var(--warning-soft) !important; color: var(--warning) !important; }
.text-bg-primary { background: var(--primary-soft) !important; color: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-danger  { background: var(--danger)  !important; }
.bg-primary { background: var(--primary) !important; }

/* ═══════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-title-wrap { min-width: 0; flex: 1; }
.page-title-wrap h5 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 479px) {
  .page-title-wrap h5 { font-size: .95rem; white-space: normal; }
  .page-title-wrap .small { display: none; }
}

/* ═══════════════════════════════════════════
   FILTERS TOOLBAR
═══════════════════════════════════════════ */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters .form-select, .filters .form-control { min-width: 0; flex: 1 1 160px; }
@media (max-width: 575px) {
  .filters .form-select, .filters .form-control { flex: 1 1 100%; }
}

/* ═══════════════════════════════════════════
   REPORT TABS
═══════════════════════════════════════════ */
.report-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.report-tabs .btn { flex: 1 1 auto; text-align: center; }
@media (max-width: 400px) { .report-tabs .btn { padding: 7px 10px; font-size: .82rem; } }

/* ═══════════════════════════════════════════
   FORM ACTIONS
═══════════════════════════════════════════ */
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
@media (max-width: 479px) {
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
}
.att-mark-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
@media (max-width: 575px) { .att-mark-header .btn { width: 100%; justify-content: center; } }

/* ═══════════════════════════════════════════
   TABLE ACTION BUTTONS
═══════════════════════════════════════════ */
.btn-action-group { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 575px) { .btn-action-group .btn { padding: 4px 8px; font-size: .78rem; } }

/* ═══════════════════════════════════════════
   DATATABLES OVERRIDES
═══════════════════════════════════════════ */
div.dataTables_wrapper { font-size: .875rem; padding: 4px 0; }
div.dataTables_wrapper > .row:first-child { margin-bottom: 16px !important; align-items: center; }
div.dataTables_wrapper > .row:last-child  { margin-top:    16px !important; align-items: center; }

div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(203,213,225,1);
  padding: 7px 10px; font-size: .82rem;
  color: var(--text); background: var(--surface);
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
div.dataTables_wrapper div.dataTables_length select { padding-right: 28px !important; min-width: 65px; }
div.dataTables_wrapper div.dataTables_filter input:focus,
div.dataTables_wrapper div.dataTables_length select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
}
div.dataTables_wrapper div.dataTables_filter label input { margin-left: 8px; }
div.dataTables_wrapper div.dataTables_length label select { margin: 0 6px; }
div.dataTables_wrapper .dataTables_info { font-size: .78rem; color: var(--muted); }
div.dataTables_wrapper .paginate_button {
  border-radius: 8px !important; padding: 4px 10px !important;
  font-size: .8rem !important; font-weight: 500 !important;
}
div.dataTables_wrapper .paginate_button.current {
  background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important;
}
div.dataTables_wrapper .paginate_button:hover:not(.current) {
  background: var(--primary-soft) !important; border-color: var(--primary) !important; color: var(--primary) !important;
}
@media (max-width: 767px) {
  div.dataTables_wrapper .row > div { text-align: center !important; margin-bottom: 8px; }
  div.dataTables_wrapper div.dataTables_filter,
  div.dataTables_wrapper div.dataTables_length { text-align: center !important; }
  div.dataTables_wrapper div.dataTables_filter label,
  div.dataTables_wrapper div.dataTables_length label { width: 100%; display: inline-flex; justify-content: center; align-items: center; }
}

/* ═══════════════════════════════════════════
   FLASH TOAST
═══════════════════════════════════════════ */
.flash-toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.flash-toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  animation: toastIn .35s cubic-bezier(.21,1.02,.73,1) forwards;
  pointer-events: all;
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
}
.flash-toast-success {
  background: rgba(240,253,244,.97);
  border-color: rgba(5,150,105,.2);
}
.flash-toast-danger {
  background: rgba(254,242,242,.97);
  border-color: rgba(220,38,38,.2);
}
.flash-toast-icon {
  font-size: 1.1rem; flex-shrink: 0; margin-top: 1px;
}
.flash-toast-success .flash-toast-icon { color: var(--success); }
.flash-toast-danger  .flash-toast-icon { color: var(--danger);  }
.flash-toast-body { flex: 1; min-width: 0; }
.flash-toast-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; line-height: 1; margin-bottom: 3px;
}
.flash-toast-success .flash-toast-title { color: #065f46; }
.flash-toast-danger  .flash-toast-title { color: #991b1b; }
.flash-toast-msg {
  font-size: .84rem; line-height: 1.4;
}
.flash-toast-success .flash-toast-msg { color: #047857; }
.flash-toast-danger  .flash-toast-msg { color: #b91c1c; }
.flash-toast-close {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 1rem; line-height: 1; margin-left: 4px; flex-shrink: 0;
  opacity: .5; transition: opacity var(--transition);
}
.flash-toast-close:hover { opacity: 1; }
.flash-toast-success .flash-toast-close { color: #065f46; }
.flash-toast-danger  .flash-toast-close { color: #991b1b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@media (max-width: 479px) {
  .flash-toast-wrap { bottom: 0; right: 0; left: 0; max-width: 100%; padding: 10px; }
  .flash-toast { border-radius: 12px; }
}

/* ═══════════════════════════════════════════
   MODAL
═══════════════════════════════════════════ */
.modal-content { border-radius: 20px; border: none; box-shadow: var(--shadow-lg); }
.modal-header  { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-body    { padding: 20px 22px; }
.modal-footer  { border-top: 1px solid var(--border); padding: 14px 22px; gap: 8px; }
@media (max-width: 575px) {
  .modal-dialog { margin: 8px; }
  .modal-footer .btn { flex: 1 1 auto; justify-content: center; }
}

/* ═══════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════ */
.progress { border-radius: 99px; background: rgba(226,232,240,.8); }
.progress-bar { border-radius: 99px; }

/* ═══════════════════════════════════════════
   MISC UTILITY
═══════════════════════════════════════════ */
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.fw-600 { font-weight: 600 !important; }
.text-primary  { color: var(--primary)  !important; }
.text-success  { color: var(--success)  !important; }
.text-danger   { color: var(--danger)   !important; }
.text-warning  { color: var(--warning)  !important; }
.text-muted    { color: var(--muted)    !important; }
.bg-primary-subtle { background: var(--primary-soft) !important; }
.border-primary-subtle { border-color: rgba(79,70,229,.2) !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.6); }

/* Monthly report summary compat */
@media (max-width: 575px) {
  .monthly-summary { gap: 12px !important; justify-content: flex-start; }
  .monthly-summary .text-center { min-width: 60px; }
}
@media (max-width: 400px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title h1 { font-size: .95rem; }
}
