/* assets/css/design-system.css
   ============================================================================
   NEW DESIGN SYSTEM — replaces assets/css/modern-ui.css
   ----------------------------------------------------------------------------
   This file is the single visual source of truth for the redesigned UI.
   It loads AFTER bootstrap.min.css and style.css (see includes/partials/head.php)
   and intentionally overrides both. style.css is kept in place only because
   dozens of not-yet-redesigned pages still depend on structural rules inside
   it (grid helpers, plugin skins, etc.) — nothing here removes functionality,
   only repaints it. As each module gets its dedicated redesign pass, its
   section below grows; nothing here should ever be "stacked" — if a rule
   needs to change, edit it in place.

   Every class/ID targeted below is a class already used by assets/js/script.js
   or includes/nav-menu.php (submenu, sidebar-menu, toggle_btn, mobile_btn,
   mini-sidebar, slimscroll, notification-status-dot, chat-status-dot,
   toggle-password, pass-input, searchinputs, dropdown-menu, etc). None of
   those selectors are renamed — only restyled — so existing JS keeps working.

   TABLE OF CONTENTS
   1. Design Tokens
   2. Base / Reset
   3. Typography
   4. Layout Shell (.main-wrapper / .page-wrapper / .content)
   5. Header
   6. Sidebar / Navigation
   7. Buttons
   8. Forms & Inputs
   9. Cards / Panels
   10. Tables
   11. Badges / Status Pills
   12. Alerts
   13. Dropdowns
   14. Modals
   15. Pagination
   16. Authentication (login / forgot-password / 2FA / lock-screen)
   17. Dashboard primitives (metric blocks, activity feed, action list)
   18. Empty / Loading states
   19. Utilities
   20. Responsive
   21. Accessibility
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Lexend:wght@500;600;700&display=swap');

/* ============================================================================
   1. DESIGN TOKENS
   ============================================================================ */
:root {
  /* --- Brand --- */
  --c-primary: #146356;
  --c-primary-dark: #0e4b41;
  --c-primary-light: #e6f1ee;
  --c-accent: #c9932f;
  --c-accent-light: #fbf1de;

  /* --- Surfaces --- */
  --c-bg: #f4f6f5;
  --c-surface: #ffffff;
  --c-surface-alt: #fafbfa;
  --c-border: #e3e8e6;
  --c-border-strong: #cdd6d2;

  /* --- Text --- */
  --c-text: #101c19;
  --c-text-muted: #5c6c67;
  --c-text-subtle: #8b9a95;
  --c-text-on-primary: #ffffff;

  /* --- Status --- */
  --c-success: #1a8f5e;
  --c-success-bg: #e7f7ef;
  --c-warning: #b3761f;
  --c-warning-bg: #fdf3e3;
  --c-danger: #c53c3c;
  --c-danger-bg: #fbeaea;
  --c-info: #2563a8;
  --c-info-bg: #e9f1fb;
  --c-neutral: #6b7573;
  --c-neutral-bg: #eef1f0;

  /* --- Shape --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* --- Elevation --- */
  --shadow-xs: 0 1px 2px rgba(16, 28, 25, 0.05);
  --shadow-sm: 0 2px 8px rgba(16, 28, 25, 0.06);
  --shadow-md: 0 8px 24px rgba(16, 28, 25, 0.08);
  --shadow-lg: 0 16px 40px rgba(16, 28, 25, 0.12);

  /* --- Type --- */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Lexend', 'Inter', -apple-system, sans-serif;

  /* --- Layout --- */
  --header-h: 64px;
  --sidebar-w: 264px;
  --sidebar-w-mini: 78px;

  /* --- Motion --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
}

/* ============================================================================
   2. BASE / RESET
   ============================================================================ */
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

*:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }

::selection { background: var(--c-primary-light); color: var(--c-primary-dark); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-subtle); }

/* Preloader */
#global-loader { background: var(--c-bg); }
.page-loader {
  width: 40px; height: 40px; margin: auto; position: relative; top: 45vh;
  border: 3px solid var(--c-border); border-top-color: var(--c-primary);
  border-radius: 50%; animation: ds-spin 0.7s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ============================================================================
   3. TYPOGRAPHY
   ============================================================================ */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--c-text);
  letter-spacing: -0.01em;
}
h1 { font-size: 28px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }
h4 { font-size: 16px; }
h5 { font-size: 14.5px; }
h6 { font-size: 12.5px; }

p { color: var(--c-text-muted); }
.text-dark { color: var(--c-text) !important; }
.text-muted { color: var(--c-text-muted) !important; }
.text-primary { color: var(--c-primary) !important; }
.fw-semibold { font-weight: 600 !important; }

/* ============================================================================
   4. LAYOUT SHELL
   ============================================================================ */
.main-wrapper { background: var(--c-bg); }

.page-wrapper {
  margin: 0 0 0 var(--sidebar-w);
  padding: var(--header-h) 0 0;
  min-height: 100vh;
  transition: margin var(--dur-base) var(--ease);
}
body.mini-sidebar .page-wrapper { margin-left: var(--sidebar-w-mini); }

.page-wrapper > .content {
  padding: 28px 32px 40px;
  max-width: 1600px;
}

/* Page header pattern used across redesigned pages */
.ds-page-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}
.ds-page-head h2 { margin: 0 0 4px; }
.ds-page-head .ds-subtitle { color: var(--c-text-muted); font-size: 13.5px; margin: 0; }
.ds-page-head .ds-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================================
   5. HEADER
   ============================================================================ */
.header {
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: none;
  left: var(--sidebar-w);
  display: flex; align-items: stretch;
  transition: left var(--dur-base) var(--ease);
}
body.mini-sidebar .header { left: var(--sidebar-w-mini); }

.header-left {
  width: var(--sidebar-w);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-right: 1px solid var(--c-border);
  flex-shrink: 0;
  transition: width var(--dur-base) var(--ease);
}
body.mini-sidebar .header-left { width: var(--sidebar-w-mini); padding: 0 16px; }

.header-left .logo img { height: 30px; width: auto; }
.header-left .logo-small { display: none; }
body.mini-sidebar .header-left .logo-normal { display: none; }
body.mini-sidebar .header-left .logo-small { display: block; }
body.mini-sidebar .header-left .logo-small img { height: 26px; }

#toggle_btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-muted); margin-left: auto;
  transition: background var(--dur-fast) var(--ease);
}
#toggle_btn:hover { background: var(--c-surface-alt); color: var(--c-text); }

.header-user { flex: 1; display: flex; align-items: stretch; min-width: 0; }
.header-user .nav.user-menu {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 0 20px; margin: 0;
}

/* Global search */
.nav-search-inputs { flex: 1; max-width: 420px; }
.top-nav-search { position: relative; width: 100%; }
.top-nav-search .searchinputs {
  display: flex; align-items: center; gap: 8px;
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 0 6px 0 14px; height: 40px;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.top-nav-search .searchinputs:focus-within {
  border-color: var(--c-primary); background: var(--c-surface);
}
.top-nav-search .searchinputs input {
  border: 0; background: transparent; flex: 1; height: 100%;
  font-size: 13.5px; color: var(--c-text); outline: none;
}
.top-nav-search .searchinputs input::placeholder { color: var(--c-text-subtle); }
.top-nav-search .search-addon button {
  border: 0; background: var(--c-surface); width: 28px; height: 28px;
  border-radius: var(--radius-sm); color: var(--c-text-subtle);
  display: flex; align-items: center; justify-content: center;
}
.top-nav-search .responsive-search { display: none; }

/* Header icon buttons (notifications, chat, theme, fullscreen, add-new) */
.header-user .btn-outline-light,
.header-user .dark-mode-toggle {
  width: 40px; height: 40px; padding: 0 !important;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border) !important; background: var(--c-surface) !important;
  border-radius: var(--radius-md) !important;
  color: var(--c-text-muted) !important;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.header-user .btn-outline-light:hover,
.header-user .dark-mode-toggle:hover {
  background: var(--c-primary-light) !important; color: var(--c-primary) !important;
  border-color: var(--c-primary-light) !important;
}
.header-user .btn-outline-light i, .header-user .dark-mode-toggle i { font-size: 18px; }
#light-mode-toggle { display: none; }

.notification-status-dot, .chat-status-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-danger); border: 2px solid var(--c-surface);
}
.notification-status-dot:before, .chat-status-dot:before { content: none; }

/* Academic year pill */
.header-user .dropdown > a.btn-outline-light.fw-normal {
  width: auto; padding: 0 14px !important; gap: 6px; font-size: 13px; font-weight: 500 !important;
  color: var(--c-text) !important;
}

/* Profile trigger */
.header-user .dropdown .avatar.avatar-md {
  width: 38px; height: 38px; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--c-border);
}
.header-user .dropdown .avatar.avatar-md img { object-fit: cover; width: 100%; height: 100%; }

/* Dropdown panels (notifications, add-new, profile) */
.header-user .dropdown-menu {
  border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); margin-top: 10px !important; padding: 8px;
}
.notification-dropdown { width: 380px; max-width: 90vw; padding: 20px !important; }
.notification-title { font-family: var(--font-display); font-size: 15px; margin: 0; }
.header-user .dropdown-item {
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--c-text);
  padding: 8px 10px !important;
}
.header-user .dropdown-item:hover { background: var(--c-primary-light); color: var(--c-primary-dark); }

/* Mobile trigger + mobile user menu (keep functional, hidden on desktop) */
.mobile_btn { display: none; }
.mobile-user-menu { display: none; }

/* ============================================================================
   6. SIDEBAR / NAVIGATION
   ============================================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  top: 0; padding-top: var(--header-h);
  transition: width var(--dur-base) var(--ease);
}
body.mini-sidebar .sidebar { width: var(--sidebar-w-mini); }

.sidebar-inner { height: 100%; }
#sidebar-menu.sidebar-menu { padding: 16px 12px 32px; }

/* School name block at top of sidebar */
#sidebar-menu > ul:first-child { margin-bottom: 12px; }
#sidebar-menu > ul:first-child li a {
  border: 1px solid var(--c-border) !important;
  background: var(--c-surface-alt) !important;
  border-radius: var(--radius-md) !important;
  padding: 10px !important;
}
#sidebar-menu > ul:first-child li a img {
  width: 30px; height: 30px; border-radius: var(--radius-sm); object-fit: cover;
}
#sidebar-menu > ul:first-child li a span {
  font-family: var(--font-display); font-weight: 600; font-size: 13.5px;
  color: var(--c-text) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.mini-sidebar #sidebar-menu > ul:first-child { display: none; }

/* Section headers ("Main", "Peoples", "Academic"...) */
.submenu-hdr {
  padding: 14px 10px 6px; margin: 0;
}
.submenu-hdr span {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--c-text-subtle);
}
body.mini-sidebar .submenu-hdr { text-align: center; padding: 14px 0 6px; }
body.mini-sidebar .submenu-hdr span { display: none; }

/* Links */
.sidebar-menu ul li a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: var(--radius-md);
  color: var(--c-text-muted); font-size: 13.5px; font-weight: 500;
  position: relative;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.sidebar-menu ul li a i {
  font-size: 18px; width: 20px; flex-shrink: 0; text-align: center;
  color: var(--c-text-subtle); transition: color var(--dur-fast) var(--ease);
}
.sidebar-menu ul li a:hover { background: var(--c-surface-alt); color: var(--c-text); }
.sidebar-menu ul li a:hover i { color: var(--c-primary); }

.sidebar-menu ul li a.active,
.sidebar-menu ul li.active > a {
  background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600;
}
.sidebar-menu ul li a.active i, .sidebar-menu ul li.active > a i { color: var(--c-primary); }
.sidebar-menu ul li a.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--c-primary); border-radius: var(--radius-pill);
}

/* Submenu (expandable groups) */
.sidebar-menu li.submenu > a .menu-arrow {
  margin-left: auto; width: 8px; height: 8px;
  border-right: 1.6px solid var(--c-text-subtle); border-bottom: 1.6px solid var(--c-text-subtle);
  transform: rotate(45deg); transition: transform var(--dur-fast) var(--ease);
}
.sidebar-menu li.submenu.active > a .menu-arrow,
.sidebar-menu li.submenu > a.subdrop .menu-arrow { transform: rotate(-135deg); }
.sidebar-menu li.submenu ul {
  padding-left: 30px; overflow: hidden;
  max-height: 0; transition: max-height var(--dur-base) var(--ease);
}
.sidebar-menu li.submenu ul li a { font-size: 13px; padding: 7px 10px; }
.sidebar-menu li.submenu.active ul,
.sidebar-menu li.submenu ul[style*="display: block"],
.sidebar-menu li.submenu ul[style*="display:block"] { max-height: 800px; }

body.mini-sidebar .sidebar-menu ul li a span { display: none; }
body.mini-sidebar .sidebar-menu ul li a { justify-content: center; padding: 10px; }
body.mini-sidebar .sidebar-menu li.submenu ul { display: none !important; }
body.mini-sidebar.expand-menu .sidebar { width: var(--sidebar-w); }
body.mini-sidebar.expand-menu .sidebar-menu ul li a span { display: inline; }
body.mini-sidebar.expand-menu .sidebar-menu ul li a { justify-content: flex-start; padding: 9px 12px; }
body.mini-sidebar.expand-menu .sidebar-menu li.submenu ul { display: block !important; }
body.mini-sidebar.expand-menu .page-wrapper { margin-left: var(--sidebar-w-mini); }

/* ============================================================================
   7. BUTTONS
   ============================================================================ */
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  border-radius: var(--radius-md); padding: 9px 18px;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  box-shadow: none;
}
.btn-primary {
  background: var(--c-primary); border-color: var(--c-primary); color: var(--c-text-on-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--c-primary-dark); border-color: var(--c-primary-dark);
}
.btn-outline-light { border-color: var(--c-border); color: var(--c-text); background: var(--c-surface); }
.btn-outline-light:hover { background: var(--c-surface-alt); color: var(--c-text); border-color: var(--c-border-strong); }
.btn-light { background: var(--c-surface-alt); border-color: var(--c-border); color: var(--c-text); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); }
.btn-success { background: var(--c-success); border-color: var(--c-success); }
.btn-icon { width: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn:focus-visible { outline-offset: 2px; }

/* ============================================================================
   8. FORMS & INPUTS
   ============================================================================ */
.form-label { font-size: 13px; font-weight: 600; color: var(--c-text); margin-bottom: 6px; }
.form-control, .form-select {
  border: 1px solid var(--c-border); border-radius: var(--radius-md);
  font-size: 13.5px; padding: 9px 12px; color: var(--c-text); background: var(--c-surface);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.form-control:focus, .form-select:focus {
  border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-light);
}
.form-control::placeholder { color: var(--c-text-subtle); }
.input-icon { position: relative; }
.input-icon .form-control { padding-left: 38px; }
.input-icon-addon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-subtle); display: flex; z-index: 2;
}
.pass-group { position: relative; }
.pass-group .toggle-password {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-subtle); cursor: pointer; font-size: 16px;
}
.form-check-input { border-color: var(--c-border-strong); }
.form-check-input:checked { background-color: var(--c-primary); border-color: var(--c-primary); }

/* ============================================================================
   9. CARDS / PANELS
   ============================================================================ */
.card {
  border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); background: var(--c-surface);
}
.card .card-body { padding: 22px; }
.card-title { font-family: var(--font-display); font-weight: 600; }

/* ============================================================================
   10. TABLES
   ============================================================================ */
.table { color: var(--c-text); font-size: 13.5px; }
.table thead th {
  background: var(--c-surface-alt); color: var(--c-text-subtle);
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  border-bottom: 1px solid var(--c-border); padding: 12px 16px; white-space: nowrap;
}
.table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table tbody tr:hover { background: var(--c-surface-alt); }
.table-responsive { border-radius: var(--radius-lg); }

/* ============================================================================
   11. BADGES / STATUS PILLS
   ============================================================================ */
.badge {
  font-weight: 600; font-size: 11.5px; border-radius: var(--radius-pill);
  padding: 4px 11px; display: inline-flex; align-items: center; gap: 5px;
}
.badge-success, .bg-success-transparent { background: var(--c-success-bg) !important; color: var(--c-success) !important; }
.badge-warning, .bg-warning-transparent { background: var(--c-warning-bg) !important; color: var(--c-warning) !important; }
.badge-danger, .bg-danger-transparent { background: var(--c-danger-bg) !important; color: var(--c-danger) !important; }
.badge-info, .bg-info-transparent { background: var(--c-info-bg) !important; color: var(--c-info) !important; }
.badge-primary, .bg-primary-transparent { background: var(--c-primary-light) !important; color: var(--c-primary-dark) !important; }
.badge-soft-success { background: var(--c-success-bg) !important; color: var(--c-success) !important; }
.badge-soft-warning { background: var(--c-warning-bg) !important; color: var(--c-warning) !important; }
.badge-soft-danger { background: var(--c-danger-bg) !important; color: var(--c-danger) !important; }
.badge-soft-info { background: var(--c-info-bg) !important; color: var(--c-info) !important; }
.badge-soft-primary { background: var(--c-primary-light) !important; color: var(--c-primary-dark) !important; }
.badge-soft-secondary { background: var(--c-neutral-bg) !important; color: var(--c-neutral) !important; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }

/* ============================================================================
   12. ALERTS
   ============================================================================ */
.alert { border: 1px solid transparent; border-radius: var(--radius-md); font-size: 13.5px; padding: 12px 16px; }
.alert-danger { background: var(--c-danger-bg); border-color: #f3caca; color: #8f2b2b; }
.alert-success { background: var(--c-success-bg); border-color: #bfe6d3; color: #145c3f; }
.alert-warning { background: var(--c-warning-bg); border-color: #f0dcae; color: #7a5215; }

/* ============================================================================
   13. DROPDOWNS (generic, outside header)
   ============================================================================ */
.dropdown-menu {
  border: 1px solid var(--c-border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); font-size: 13.5px;
}
.dropdown-item:hover, .dropdown-item:focus { background: var(--c-primary-light); color: var(--c-primary-dark); }

/* ============================================================================
   14. MODALS
   ============================================================================ */
.modal-content { border: 1px solid var(--c-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--c-border); padding: 18px 22px; }
.modal-title { font-family: var(--font-display); font-weight: 600; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--c-border); padding: 16px 22px; }

/* ============================================================================
   15. PAGINATION
   ============================================================================ */
.pagination .page-link {
  border: 1px solid var(--c-border); color: var(--c-text-muted); margin: 0 3px;
  border-radius: var(--radius-sm) !important; font-size: 13px; font-weight: 500;
}
.pagination .page-item.active .page-link { background: var(--c-primary); border-color: var(--c-primary); }

.dataTables_wrapper { font-size: 13.5px; }
.dataTables_filter input, .dataTables_length select {
  border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 7px 12px; font-size: 13px;
}
.dataTables_filter input:focus, .dataTables_length select:focus { border-color: var(--c-primary); outline: none; }
.dataTables_info { color: var(--c-text-muted); font-size: 12.5px; }
.dataTables_paginate .pagination .page-link { border-radius: var(--radius-sm) !important; }

/* ============================================================================
   16. AUTHENTICATION
   ============================================================================ */
.ds-auth-page {
  min-height: 100vh; display: flex; background: var(--c-bg);
}
.ds-auth-visual {
  flex: 1.1; position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--c-primary-dark) 0%, var(--c-primary) 62%, #1f7a67 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px; color: #fff;
}
.ds-auth-visual::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 15% 20%, rgba(255,255,255,0.10) 0, transparent 40%),
                     radial-gradient(circle at 85% 80%, rgba(255,255,255,0.08) 0, transparent 45%);
}
.ds-auth-visual .ds-auth-brand { position: relative; display: flex; align-items: center; gap: 10px; }
.ds-auth-visual .ds-auth-brand img { height: 32px; }
.ds-auth-visual .ds-auth-brand span { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.ds-auth-visual .ds-auth-copy { position: relative; max-width: 380px; }
.ds-auth-visual .ds-auth-copy h2 {
  color: #fff; font-size: 28px; line-height: 1.3; margin-bottom: 12px;
}
.ds-auth-visual .ds-auth-copy p { color: rgba(255,255,255,0.78); font-size: 14px; }
.ds-auth-visual .ds-auth-stats {
  position: relative; display: flex; gap: 28px; margin-top: 28px;
}
.ds-auth-visual .ds-auth-stats div strong { display: block; font-family: var(--font-display); font-size: 20px; }
.ds-auth-visual .ds-auth-stats div span { font-size: 11.5px; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.04em; }
.ds-auth-visual .ds-auth-foot { position: relative; font-size: 12px; color: rgba(255,255,255,0.6); }

.ds-auth-form-side {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.ds-auth-card { width: 100%; max-width: 380px; }
.ds-auth-card .ds-auth-mobile-brand { display: none; }
.ds-auth-card h2 { margin-bottom: 6px; }
.ds-auth-card > p.ds-auth-lead { color: var(--c-text-muted); font-size: 13.5px; margin-bottom: 26px; }
.ds-auth-card .form-label { display: flex; justify-content: space-between; align-items: center; }
.ds-auth-card .form-control { height: 44px; }
.ds-auth-card .btn-primary { height: 44px; font-size: 14px; }
.ds-auth-foot-link { text-align: center; font-size: 13px; color: var(--c-text-muted); margin-top: 20px; }

.digit-group input {
  height: 56px; border: 1px solid var(--c-border) !important; border-radius: var(--radius-md) !important;
  font-family: var(--font-display); font-weight: 600;
}
.digit-group input:focus { border-color: var(--c-primary) !important; box-shadow: 0 0 0 3px var(--c-primary-light); }
.badge.bg-soft-danger { background: var(--c-danger-bg); color: var(--c-danger); display: block; padding: 8px 12px; }
.badge.bg-soft-danger p { margin: 0; color: inherit; font-size: 12px; font-weight: 500; }

.ds-child-switcher { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-child-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px;
  border: 1px solid var(--c-border); border-radius: var(--radius-pill);
  background: var(--c-surface); color: var(--c-text); text-decoration: none;
  font-size: 13px; font-weight: 600; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.ds-child-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ds-child-chip:hover { border-color: var(--c-border-strong); color: var(--c-text); }
.ds-child-chip.active { background: var(--c-primary-light); border-color: var(--c-primary); color: var(--c-primary-dark); }

.ds-child-banner {
  display: flex; align-items: center; gap: 16px; background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 18px 22px; margin-bottom: 20px;
}
.ds-child-banner .avatar img { width: 100%; height: 100%; object-fit: cover; }

.ds-settings-nav { display: flex; flex-direction: column; gap: 2px; }
.ds-settings-nav a {
  padding: 9px 14px; border-radius: var(--radius-md); color: var(--c-text-muted);
  font-size: 13.5px; font-weight: 500; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.ds-settings-nav a:hover { background: var(--c-surface-alt); color: var(--c-text); }
.ds-settings-nav a.active { background: var(--c-primary-light); color: var(--c-primary-dark); font-weight: 600; }

.ds-settings-row {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--c-border);
}
.ds-settings-row:last-child { border-bottom: 0; }
.ds-settings-row .ds-settings-label { flex: 1 1 260px; min-width: 200px; }
.ds-settings-row .ds-settings-label h6 { margin-bottom: 3px; font-size: 13.5px; }
.ds-settings-row .ds-settings-label p { margin: 0; font-size: 12.5px; color: var(--c-text-muted); }
.ds-settings-row .ds-settings-control { flex: 1 1 320px; min-width: 220px; }

.ds-attendance-group { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-attendance-pill {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 9px 14px; border-radius: var(--radius-pill); border: 1.5px solid var(--c-border);
  background: var(--c-surface); font-size: 12.5px; font-weight: 600; color: var(--c-text-muted);
  transition: all var(--dur-fast) var(--ease); user-select: none; white-space: nowrap;
}
.ds-attendance-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ds-attendance-pill:hover { border-color: var(--c-border-strong); }
.ds-attendance-pill.present:has(input:checked) { background: var(--c-success-bg); border-color: var(--c-success); color: var(--c-success); }
.ds-attendance-pill.late:has(input:checked) { background: var(--c-warning-bg); border-color: var(--c-warning); color: var(--c-warning); }
.ds-attendance-pill.absent:has(input:checked) { background: var(--c-danger-bg); border-color: var(--c-danger); color: var(--c-danger); }
.ds-attendance-pill.excused:has(input:checked) { background: var(--c-info-bg); border-color: var(--c-info); color: var(--c-info); }
.ds-attendance-pill.half_day:has(input:checked) { background: var(--c-primary-light); border-color: var(--c-primary); color: var(--c-primary-dark); }
@media (max-width: 767.98px) {
  .ds-attendance-pill { padding: 11px 14px; font-size: 13px; }
}

/* ============================================================================
   17. DASHBOARD PRIMITIVES
   ============================================================================ */
.ds-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.ds-metric {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 10px;
}
.ds-metric .ds-metric-top { display: flex; align-items: center; justify-content: space-between; }
.ds-metric .ds-metric-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--c-primary-light); color: var(--c-primary); font-size: 18px;
}
.ds-metric .ds-metric-label { font-size: 12.5px; color: var(--c-text-muted); font-weight: 500; }
.ds-metric .ds-metric-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--c-text); }
.ds-metric .ds-metric-delta { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.ds-metric .ds-metric-delta.up { color: var(--c-success); }
.ds-metric .ds-metric-delta.down { color: var(--c-danger); }

.ds-panel {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
}
.ds-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--c-border); }
.ds-panel-head h4 { margin: 0; }
.ds-panel-body { padding: 20px; }

.ds-activity-list { list-style: none; margin: 0; padding: 0; }
.ds-activity-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-border); }
.ds-activity-list li:last-child { border-bottom: 0; }
.ds-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary); margin-top: 6px; flex-shrink: 0; }
.ds-activity-list .ds-activity-title { font-size: 13.5px; color: var(--c-text); font-weight: 500; }
.ds-activity-list .ds-activity-time { font-size: 12px; color: var(--c-text-subtle); }

.ds-action-list { list-style: none; margin: 0; padding: 0; }
.ds-action-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--c-border); border-radius: var(--radius-md); margin-bottom: 8px;
}
.ds-action-list li:last-child { margin-bottom: 0; }

.ds-quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.ds-quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 18px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  background: var(--c-surface); color: var(--c-text); transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.ds-quick-action:hover { border-color: var(--c-primary); box-shadow: var(--shadow-sm); color: var(--c-text); }
.ds-quick-action i { font-size: 22px; color: var(--c-primary); }
.ds-quick-action span { font-size: 12.5px; font-weight: 600; }

/* ============================================================================
   18. EMPTY / LOADING STATES
   ============================================================================ */
.ds-empty { text-align: center; padding: 48px 20px; }
.ds-empty i { font-size: 34px; color: var(--c-text-subtle); }
.ds-empty h5 { margin: 14px 0 4px; }
.ds-empty p { font-size: 13px; max-width: 340px; margin: 0 auto 16px; }

/* ============================================================================
   19. UTILITIES
   ============================================================================ */
.ds-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.ds-status-dot.success { background: var(--c-success); }
.ds-status-dot.warning { background: var(--c-warning); }
.ds-status-dot.danger { background: var(--c-danger); }

/* ============================================================================
   20. RESPONSIVE
   ============================================================================ */
@media (max-width: 991.98px) {
  .header { left: 0; }
  .header-left { width: auto; border-right: 0; padding: 0 12px; }
  .header-left .logo-normal { display: block; }
  #toggle_btn { display: none; }
  .mobile_btn {
    display: flex; align-items: center; margin-right: 8px;
  }
  .nav-search-inputs { display: none; }
  .top-nav-search .responsive-search { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
  .sidebar { left: -100%; box-shadow: none; z-index: 1030; }
  .sidebar.opened, body.slide-nav .sidebar { left: 0; box-shadow: var(--shadow-lg); }
  .page-wrapper, body.mini-sidebar .page-wrapper { margin-left: 0; }
  .page-wrapper > .content { padding: 20px 16px 32px; }

  .ds-auth-visual { display: none; }
  .ds-auth-form-side { padding: 24px; }
  .ds-auth-card .ds-auth-mobile-brand {
    display: flex; align-items: center; gap: 10px; margin-bottom: 28px;
  }
  .ds-auth-card .ds-auth-mobile-brand img { height: 28px; }
  .ds-auth-card .ds-auth-mobile-brand span { font-family: var(--font-display); font-weight: 700; color: var(--c-text); }
}

@media (max-width: 575.98px) {
  .ds-metric-grid { grid-template-columns: 1fr 1fr; }
  .ds-quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
   21. ACCESSIBILITY
   ============================================================================ */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}
button, a, .form-control, .form-select { min-height: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
