/* ================================================================
   ANSHA SHINE KIDS SCHOOL — ERP SYSTEM
   Premium Design System v2.0  ·  World-Class Refresh v3.0
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --primary:       #1E3A5F;
  --primary-dark:  #0A1628;
  --primary-light: #2563EB;
  --primary-soft:  #EFF6FF;
  --accent:        #F59E0B;
  --accent-light:  #FEF3C7;
  --accent-dark:   #D97706;
  --success:       #059669;
  --success-bg:    #ECFDF5;
  --danger:        #DC2626;
  --danger-bg:     #FEF2F2;
  --warning:       #D97706;
  --warning-bg:    #FFFBEB;
  --info:          #0891B2;
  --info-bg:       #ECFEFF;
  --purple:        #7C3AED;
  --purple-bg:     #F5F3FF;

  --sidebar-w:     268px;
  --sidebar-bg:    #0f1f35;
  --header-h:      66px;
  --header-bg:     rgba(255,255,255,0.97);
  --body-bg:       #F0F4F9;
  --card-bg:       #ffffff;
  --border:        #E2E8F0;
  --shadow:        0 2px 16px rgba(30,58,95,0.10);
  --shadow-lg:     0 8px 40px rgba(30,58,95,0.18);
  --shadow-xl:     0 20px 60px rgba(30,58,95,0.22);

  --text:          #1C2B3A;
  --text-2:        #4A5A6A;
  --text-3:        #8A9BAA;
  --font:          'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     18px;
  --transition:    0.2s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--body-bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }
ul { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b0bec5; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ================================================================
   LAYOUT
   ================================================================ */

.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(160deg, #0A192F 0%, #1E3A5F 50%, #0D2137 100%);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,0.25);
}

/* ---------- Sidebar collapse toggle (desktop) ---------- */
.sidebar-collapse-btn {
  position: fixed;
  top: 72px;
  left: calc(var(--sidebar-w) - 15px);
  z-index: 250;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1E3A5F, #2563EB);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  transition: left var(--transition), transform .2s;
}
.sidebar-collapse-btn:hover { transform: scale(1.12); }
body.sidebar-collapsed .sidebar       { transform: translateX(-100%); }
body.sidebar-collapsed .main-wrapper  { margin-left: 0; }
body.sidebar-collapsed .sidebar-collapse-btn { left: 8px; }
@media (max-width: 720px) { .sidebar-collapse-btn { display: none; } }

.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; gap: 13px;
}
.sidebar-logo .logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #F59E0B, #FB923C);
  border-radius: 12px;
  display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(245,158,11,0.5);
  color: #fff;
}
.sidebar-logo .logo-text h1 { color: #fff; font-size: 14px; font-weight: 800; line-height: 1.3; letter-spacing: .1px; }
.sidebar-logo .logo-text p  { color: rgba(255,255,255,0.4); font-size: 10.5px; margin-top: 2px; }

.sidebar-branch {
  margin: 12px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 13px;
}
.sidebar-branch label { color: rgba(255,255,255,0.4); font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 5px; }
.sidebar-branch select {
  width: 100%; background: transparent; border: none;
  color: #fff; font-size: 13px; outline: none;
  cursor: pointer; font-family: var(--font); font-weight: 600;
}
.sidebar-branch select option { background: #1a3050; color: #fff; }

.sidebar-nav { padding: 6px 0 14px; flex: 1; }
.nav-section { margin-bottom: 2px; }
.nav-section-title {
  color: rgba(255,255,255,0.28);
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.2px;
  padding: 12px 22px 4px; font-weight: 700;
}
.nav-item a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 16px 10px 20px;
  color: rgba(255,255,255,0.60);
  font-size: 13px; font-weight: 500;
  transition: all 0.18s; border-radius: 0;
  position: relative; margin: 1px 8px; border-radius: 10px;
}
.nav-item a:hover {
  color: #fff;
  background: rgba(255,255,255,0.09);
}
.nav-item a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(245,158,11,0.28), rgba(251,146,60,0.14));
  border: 1px solid rgba(245,158,11,0.4);
  box-shadow: 0 4px 16px rgba(245,158,11,0.18);
  font-weight: 700;
}
.nav-item a .nav-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.65);
  transition: background 0.18s, box-shadow 0.18s;
}
.nav-item a:hover .nav-icon { background: rgba(255,255,255,0.14); color: #fff; }
.nav-item a.active .nav-icon {
  background: linear-gradient(135deg, #F59E0B, #FB923C);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245,158,11,0.5);
}
.nav-item a .badge {
  margin-left: auto; background: var(--accent);
  color: #fff; font-size: 10px; padding: 1px 7px;
  border-radius: 10px; font-weight: 700;
}
.nav-submenu { display: none; }
.nav-submenu.open { display: block; }
.nav-submenu .nav-item a { padding-left: 50px; font-size: 12.5px; }
.nav-has-sub > a::after { content: '›'; margin-left: auto; font-size: 16px; transition: transform var(--transition); }
.nav-has-sub.open > a::after { transform: rotate(90deg); }

/* ---------- Main Wrapper ---------- */
.main-wrapper {
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  flex: 1; overflow: hidden; height: 100vh;
}

/* ---------- Header ---------- */
.header {
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(30,58,95,0.08);
  display: flex; align-items: center; padding: 0 26px;
  gap: 16px; flex-shrink: 0; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 16px rgba(30,58,95,0.07);
}
.header-toggle {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: none; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 18px;
  background: var(--body-bg);
}
.header-toggle:hover { background: var(--primary-soft); }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.breadcrumb-item { color: var(--text-3); }
.breadcrumb-item:last-child { color: var(--text); font-weight: 700; }
.breadcrumb-sep { color: var(--text-3); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-date { color: var(--text-3); font-size: 12px; }
.header-btn {
  width: 40px; height: 40px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-2); font-size: 16px; position: relative;
  background: var(--body-bg); transition: all var(--transition);
}
.header-btn:hover { background: var(--primary-soft); color: var(--primary); transform: scale(1.05); }
.header-btn .notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px;
  background: linear-gradient(135deg, #ff6b6b, var(--danger));
  border-radius: 50%; border: 2px solid white;
}
.header-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 7px; border-radius: 30px;
  background: var(--body-bg); cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
}
.header-user:hover { background: var(--primary-soft); border-color: var(--primary-soft); }
.header-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 13px; font-weight: 800;
  box-shadow: 0 3px 10px rgba(30,58,95,0.35);
}
.header-user-info .name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.header-user-info .role { font-size: 11px; color: var(--text-3); }
.header-clock { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 4px 10px; border-radius: 20px; }

/* ---------- Page Content ---------- */
.main-content {
  flex: 1; overflow-y: auto;
  padding: 26px;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap; gap: 12px;
}
.page-title h1 {
  font-size: 22px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.page-title p  { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ================================================================
   COMPONENTS
   ================================================================ */

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(30,58,95,0.07);
  padding: 22px;
  box-shadow: 0 2px 16px rgba(30,58,95,0.08);
  transition: box-shadow 0.25s, transform 0.25s;
}
.card:hover { box-shadow: 0 6px 30px rgba(30,58,95,0.13); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 15px; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 9px;
}
.card-title .card-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
/* Vibrant card icon variants */
.card-icon-blue   { background: linear-gradient(135deg, #1E3A5F, #2563EB) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(30,58,95,0.35); }
.card-icon-green  { background: linear-gradient(135deg, #059669, #10B981) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(5,150,105,0.35); }
.card-icon-orange { background: linear-gradient(135deg, #D97706, #F59E0B) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(217,119,6,0.35); }
.card-icon-red    { background: linear-gradient(135deg, #DC2626, #EF4444) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(220,38,38,0.35); }
.card-icon-purple { background: linear-gradient(135deg, #7C3AED, #8B5CF6) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(124,58,237,0.35); }
.card-icon-teal   { background: linear-gradient(135deg, #0891B2, #06B6D4) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(8,145,178,0.35); }
.card-icon-yellow { background: linear-gradient(135deg, #D97706, #FBBF24) !important; color: #fff !important; box-shadow: 0 4px 12px rgba(217,119,6,0.35); }

/* ---------- Stat Cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(30,58,95,0.07);
  padding: 22px 20px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: 0 2px 16px rgba(30,58,95,0.08);
  position: relative; overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(30,58,95,0.16); }
.stat-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.orange::before { background: linear-gradient(90deg, var(--accent), #f0a150); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--success), #27ae60); }
.stat-card.red::before    { background: linear-gradient(90deg, var(--danger), #e74c3c); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--purple), #9b59b6); }
.stat-card.teal::before   { background: linear-gradient(90deg, #00838F, #00acc1); }
.stat-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon i { font-size: 22px; }
.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; }
.stat-value { font-size: 28px; font-weight: 900; color: var(--text); margin: 5px 0 4px; line-height: 1; }
.stat-change { font-size: 12px; display: flex; align-items: center; gap: 4px; font-weight: 600; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }
.stat-card::after {
  content: ''; position: absolute; right: -18px; bottom: -18px;
  width: 80px; height: 80px; border-radius: 50%; opacity: 0.07;
}
.stat-card.blue   .stat-icon { background: linear-gradient(135deg, #1E3A5F, #2563EB); color: #fff; box-shadow: 0 6px 20px rgba(30,58,95,0.45); }
.stat-card.blue::before      { background: linear-gradient(90deg, #1E3A5F, #2563EB); }
.stat-card.orange .stat-icon { background: linear-gradient(135deg, #D97706, #F59E0B); color: #fff; box-shadow: 0 6px 20px rgba(217,119,6,0.45); }
.stat-card.orange::before    { background: linear-gradient(90deg, #D97706, #FBBF24); }
.stat-card.green  .stat-icon { background: linear-gradient(135deg, #059669, #10B981); color: #fff; box-shadow: 0 6px 20px rgba(5,150,105,0.45); }
.stat-card.green::before     { background: linear-gradient(90deg, #059669, #34D399); }
.stat-card.red    .stat-icon { background: linear-gradient(135deg, #DC2626, #EF4444); color: #fff; box-shadow: 0 6px 20px rgba(220,38,38,0.45); }
.stat-card.red::before       { background: linear-gradient(90deg, #DC2626, #F87171); }
.stat-card.purple .stat-icon { background: linear-gradient(135deg, #7C3AED, #8B5CF6); color: #fff; box-shadow: 0 6px 20px rgba(124,58,237,0.45); }
.stat-card.purple::before    { background: linear-gradient(90deg, #7C3AED, #A78BFA); }
.stat-card.teal   .stat-icon { background: linear-gradient(135deg, #0891B2, #06B6D4); color: #fff; box-shadow: 0 6px 20px rgba(8,145,178,0.45); }
.stat-card.teal::before      { background: linear-gradient(90deg, #0891B2, #22D3EE); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px; border-radius: 10px;
  font-size: 13.5px; font-weight: 700;
  transition: all 0.2s;
  cursor: pointer; border: none; white-space: nowrap;
  letter-spacing: .1px;
}
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }
.btn-primary {
  background: linear-gradient(135deg, #1E3A5F, #2B5284);
  color: #fff;
  box-shadow: 0 4px 14px rgba(30,58,95,0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #162d4a, #1E3A5F); box-shadow: 0 6px 20px rgba(30,58,95,0.45); transform: translateY(-1px); }
.btn-accent {
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217,119,6,0.4);
}
.btn-accent:hover { background: linear-gradient(135deg, #B45309, #D97706); box-shadow: 0 6px 20px rgba(217,119,6,0.55); transform: translateY(-1px); }
.btn-success {
  background: linear-gradient(135deg, #059669, #10B981);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5,150,105,0.4);
}
.btn-success:hover { box-shadow: 0 6px 20px rgba(5,150,105,0.55); transform: translateY(-1px); }
.btn-danger {
  background: linear-gradient(135deg, #DC2626, #EF4444);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220,38,38,0.4);
}
.btn-danger:hover { box-shadow: 0 6px 20px rgba(220,38,38,0.55); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary); color: var(--primary);
}
.btn-outline:hover { background: var(--primary-soft); transform: translateY(-1px); }
.btn-ghost {
  background: var(--body-bg); color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn i { font-size: 13px; }
.btn-group { display: flex; gap: 0; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 10px 0 0 10px; }
.btn-group .btn:last-child  { border-radius: 0 10px 10px 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 11px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  letter-spacing: .2px;
}
.badge-blue    { background: linear-gradient(135deg,#EFF6FF,#DBEAFE); color: #1D4ED8; border: 1px solid rgba(37,99,235,0.2); }
.badge-orange  { background: linear-gradient(135deg,#FFFBEB,#FEF3C7); color: #B45309; border: 1px solid rgba(217,119,6,0.25); }
.badge-green   { background: linear-gradient(135deg,#ECFDF5,#D1FAE5); color: #065F46; border: 1px solid rgba(5,150,105,0.2); }
.badge-red     { background: linear-gradient(135deg,#FEF2F2,#FEE2E2); color: #B91C1C; border: 1px solid rgba(220,38,38,0.2); }
.badge-yellow  { background: linear-gradient(135deg,#FFFBEB,#FEF3C7); color: #92400E; border: 1px solid rgba(217,119,6,0.2); }
.badge-purple  { background: linear-gradient(135deg,#F5F3FF,#EDE9FE); color: #5B21B6; border: 1px solid rgba(124,58,237,0.2); }
.badge-gray    { background: linear-gradient(135deg,#F8FAFC,#F1F5F9); color: #475569; border: 1px solid #CBD5E1; }
.badge-teal    { background: linear-gradient(135deg,#ECFEFF,#CFFAFE); color: #0E7490; border: 1px solid rgba(8,145,178,0.2); }
.badge-dot::before { content: '●'; font-size: 7px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); letter-spacing: .2px; }
.form-label span { color: var(--danger); }
.form-control {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text); background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none; width: 100%;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30,58,95,0.09);
}
.form-control::placeholder { color: var(--text-3); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-text { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.input-group { display: flex; position: relative; }
.input-group .input-prefix {
  padding: 10px 13px; background: #f4f7fb;
  border: 1.5px solid var(--border); border-right: none;
  border-radius: 10px 0 0 10px;
  color: var(--text-3); font-size: 13px; white-space: nowrap; font-weight: 600;
}
.input-group .form-control { border-radius: 0 10px 10px 0; }
.search-box { position: relative; }
.search-box input { padding-left: 38px; }
.search-box .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--text-3); font-size: 14px;
}

/* ---------- Tables ---------- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }
.table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; min-width: 600px;
}
.table th {
  background: linear-gradient(135deg, #1E3A5F, #2B5284);
  padding: 12px 15px;
  text-align: left; font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase; letter-spacing: 0.7px;
  border: none; white-space: nowrap;
}
.table th:first-child { border-radius: var(--radius) 0 0 0; }
.table th:last-child  { border-radius: 0 var(--radius) 0 0; }
.table td {
  padding: 12px 15px; border-bottom: 1px solid #f0f4f9;
  color: var(--text); vertical-align: middle;
}
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: linear-gradient(135deg, #f8faff, #f4f7fc); }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 6px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  padding: 11px 22px; font-size: 13.5px; font-weight: 700;
  color: var(--text-3); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all var(--transition);
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Filter Bar ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.filter-bar .form-control { min-width: 160px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 18px; }
.page-btn {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text-2);
  background: var(--body-bg); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s;
}
.page-btn:hover, .page-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(30,58,95,0.3);
}
.page-info { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,20,40,0.6);
  backdrop-filter: blur(6px);
  z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  width: 100%; max-width: 620px;
  max-height: 90vh; overflow-y: auto;
  transform: scale(0.94) translateY(16px);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
  border: 1px solid rgba(255,255,255,0.9);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-lg { max-width: 860px; }
.modal-sm { max-width: 440px; }
.modal-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #f8faff, #fff);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-header h3 { font-size: 17px; font-weight: 800; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 18px;
  background: var(--body-bg); cursor: pointer;
  border: 1px solid var(--border); transition: all 0.15s;
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }
.modal-body { padding: 22px 26px; }
.modal-footer {
  padding: 16px 26px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  background: #fafbff;
}

/* ---------- Alert / Toast ---------- */
.alert {
  padding: 13px 18px; border-radius: 10px;
  font-size: 13.5px; display: flex; align-items: center; gap: 11px;
  margin-bottom: 14px; border-left: 4px solid transparent;
}
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.alert-info    { background: var(--info-bg);    color: var(--info);    border-color: var(--info); }

#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 14px 20px; border-radius: 12px;
  color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn 0.35s cubic-bezier(0.34,1.56,0.64,1), fadeOut 0.3s ease 3.7s forwards;
  min-width: 290px; max-width: 380px;
  border: 1px solid rgba(255,255,255,0.15);
}
.toast-success { background: linear-gradient(135deg, #059669, #10B981); }
.toast-danger  { background: linear-gradient(135deg, #DC2626, #EF4444); }
.toast-info    { background: linear-gradient(135deg, #1E3A5F, #2563EB); }
.toast-warning { background: linear-gradient(135deg, #D97706, #F59E0B); }
@keyframes slideIn    { from { transform: translateX(80px) scale(0.9); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }
@keyframes slideInTop { from { transform: translateY(-36px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes fadeOut    { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }

/* ── Mobile: toasts at TOP so they never cover bottom-sheet modals ── */
@media (max-width: 700px) {
  #toast-container {
    bottom: auto !important;
    top: 14px;
    left: 10px;
    right: 10px;
    align-items: stretch;
  }
  #toast-container .toast {
    min-width: 0; max-width: 100%;
    animation: slideInTop 0.35s cubic-bezier(0.34,1.56,0.64,1), fadeOut 0.3s ease 3.7s forwards;
  }
}

/* ── Hide voice FAB & panel when any modal is open ── */
body.modal-open #v-global-fab,
body.modal-open #v-panel,
body.modal-open #v-nav-toast { display: none !important; }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 800; flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-md { width: 42px; height: 42px; font-size: 16px; }
.avatar-lg { width: 54px; height: 54px; font-size: 20px; }
.avatar-xl { width: 72px; height: 72px; font-size: 27px; }
.av-blue   { background: linear-gradient(135deg, #1E3A5F, #2563EB); color: #fff; }
.av-orange { background: linear-gradient(135deg, #D97706, #F59E0B); color: #fff; }
.av-green  { background: linear-gradient(135deg, #059669, #10B981); color: #fff; }
.av-red    { background: linear-gradient(135deg, #DC2626, #EF4444); color: #fff; }
.av-purple { background: linear-gradient(135deg, #7C3AED, #8B5CF6); color: #fff; }

/* ---------- Progress ---------- */
.progress { height: 9px; background: #eef1f6; border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 10px; transition: width 0.5s ease; }
.progress-blue   { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.progress-orange { background: linear-gradient(90deg, var(--accent), #f0a150); }
.progress-green  { background: linear-gradient(90deg, var(--success), #27ae60); }
.progress-red    { background: linear-gradient(90deg, var(--danger), #e74c3c); }

/* ---------- Attendance Cells ---------- */
.att-cell {
  width: 36px; height: 36px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; cursor: pointer;
  transition: all 0.18s; border: 2px solid transparent;
}
.att-P { background: linear-gradient(135deg,#E6F5ED,#c8eeda); color: var(--success); border-color: rgba(26,122,74,0.3); }
.att-A { background: linear-gradient(135deg,#FDEDEC,#f5c6c2); color: var(--danger); border-color: rgba(192,57,43,0.3); }
.att-L { background: linear-gradient(135deg,#FEF9E7,#fdedc0); color: var(--warning); border-color: rgba(212,150,11,0.3); }
.att-H { background: linear-gradient(135deg,#EBF5FB,#b2d9f0); color: var(--info); border-color: rgba(26,107,154,0.3); }
.att-blank { background: #f4f6f8; color: #bbb; border-color: #e8e8e8; }
.att-cell:hover { transform: scale(1.12); box-shadow: 0 3px 10px rgba(0,0,0,0.12); }

/* ---------- Fee Status ---------- */
.fee-paid    { background: linear-gradient(135deg,#E6F5ED,#c8eeda); color: var(--success); }
.fee-partial { background: linear-gradient(135deg,#FEF9E7,#fdedc0); color: var(--warning); }
.fee-pending { background: linear-gradient(135deg,#FDEDEC,#f5c6c2); color: var(--danger); }
.fee-waived  { background: linear-gradient(135deg,#F5EEF8,#e8d5f0); color: #6A1B9A; }

/* ---------- CCTV ---------- */
.cctv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.cctv-feed {
  border-radius: var(--radius); overflow: hidden;
  border: 2px solid var(--border); background: #000;
  position: relative; transition: box-shadow 0.2s;
}
.cctv-feed.active { border-color: var(--success); box-shadow: 0 0 0 3px rgba(26,122,74,0.2); }
.cctv-screen {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #0a0e1a 0%, #1a2030 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.cctv-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(0deg,rgba(0,0,0,0.03) 0px,rgba(0,0,0,0.03) 1px,transparent 1px,transparent 2px);
}
.cctv-sim-content { text-align: center; color: rgba(255,255,255,0.4); }
.cctv-sim-content .room-icon { font-size: 48px; margin-bottom: 8px; display: block; }
.cctv-sim-content p { font-size: 12px; }
.cctv-live-badge {
  position: absolute; top: 10px; left: 10px;
  background: linear-gradient(135deg, #C0392B, #e74c3c);
  color: #fff; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; gap: 5px;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
.cctv-time { position: absolute; top: 10px; right: 10px; color: rgba(255,255,255,0.8); font-size: 11px; font-family: monospace; }
.cctv-footer {
  background: #111; padding: 9px 13px;
  display: flex; align-items: center; justify-content: space-between;
}
.cctv-footer .cam-name { color: #fff; font-size: 12px; font-weight: 700; }
.cctv-footer .cam-status { font-size: 11px; }

/* ---------- Misc Utilities ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.flex    { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.text-sm    { font-size: 12px; }
.text-muted { color: var(--text-3); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold  { font-weight: 700; }
.font-semi  { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.section-title {
  font-size: 15px; font-weight: 800; color: var(--text);
  margin-bottom: 16px; display: flex; align-items: center; gap: 9px;
}
.section-title::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--border), transparent); margin-left: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  background: var(--body-bg); border: 1.5px solid var(--border);
  font-size: 12px; color: var(--text-2); cursor: pointer;
  font-weight: 600; transition: all 0.15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.empty-state {
  text-align: center; padding: 56px 24px;
  color: var(--text-3);
}
.empty-state .empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.6; }
.empty-state h3 { font-size: 16px; color: var(--text-2); margin-bottom: 7px; font-weight: 700; }
.info-row { display: flex; gap: 8px; align-items: baseline; margin-bottom: 10px; }
.info-row .lbl { font-size: 12px; color: var(--text-3); width: 130px; flex-shrink: 0; font-weight: 600; }
.info-row .val { font-size: 13.5px; color: var(--text); font-weight: 600; }

/* ---------- Charts ---------- */
.chart-container { position: relative; }

/* ---------- Login Page ---------- */
.login-page { min-height: 100vh; display: flex; }
.login-left {
  width: 480px; flex-shrink: 0;
  background: linear-gradient(160deg, #0f1f35 0%, #1E3A5F 50%, #1a3050 100%);
  padding: 60px 48px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(232,131,42,0.12) 0%, transparent 60%);
}
.login-right {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px; background: var(--body-bg);
}
.login-brand { margin-bottom: 48px; position: relative; }
.login-brand .brand-icon {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, #E8832A, #f0a150);
  border-radius: 18px; display: flex; align-items: center;
  justify-content: center; font-size: 34px; margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(232,131,42,0.4);
}
.login-brand h1 { color: #fff; font-size: 26px; font-weight: 900; line-height: 1.2; }
.login-brand p  { color: rgba(255,255,255,0.55); font-size: 14px; margin-top: 6px; }
.login-features { display: flex; flex-direction: column; gap: 20px; position: relative; }
.login-feature { display: flex; gap: 14px; align-items: flex-start; }
.login-feature .feat-icon {
  width: 40px; height: 40px; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 11px; display: flex; align-items: center;
  justify-content: center; font-size: 18px; flex-shrink: 0; color: rgba(255,255,255,0.85);
}
.login-feature h4 { color: #fff; font-size: 14px; margin-bottom: 3px; font-weight: 700; }
.login-feature p  { color: rgba(255,255,255,0.48); font-size: 12.5px; }
.login-box {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 42px; width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(30,58,95,0.18);
  border: 1px solid rgba(30,58,95,0.07);
}
.login-box h2 { font-size: 24px; font-weight: 900; margin-bottom: 6px; }
.login-sub { color: var(--text-3); font-size: 14px; margin-bottom: 28px; }
.role-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.role-tab {
  flex: 1; padding: 9px 6px; border-radius: 9px;
  font-size: 12px; font-weight: 700; text-align: center;
  border: 1.5px solid var(--border); background: var(--body-bg);
  color: var(--text-2); cursor: pointer; transition: all 0.2s;
}
.role-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 14px rgba(30,58,95,0.35); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-268px); }
  .sidebar.open { transform: translateX(0); width: 268px; }
  .main-wrapper { margin-left: 0; }
  .header-toggle { display: flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .main-content { padding: 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ================================================================
   MOBILE-FIRST: Full web app parity for phone screens (≤700px)
   Every ERP page works identically on mobile & desktop
   ================================================================ */
@media (max-width: 700px) {

  /* ── Layout ── */
  .main-content { padding: 12px 10px 90px; }
  .page-header  { flex-wrap: wrap; gap: 8px; }
  .page-actions { flex-wrap: wrap; gap: 6px; width: 100%; }
  .page-actions .btn { flex: 1 1 auto; min-width: 0; justify-content: center; font-size: 12px; padding: 8px 12px; }
  .page-title h1 { font-size: 18px; }

  /* ── Stat cards ── */
  .stat-grid  { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .stat-value { font-size: 20px; }
  .stat-icon  { width: 42px; height: 42px; font-size: 17px; }
  .stat-label { font-size: 10px; }
  .stat-card  { padding: 14px; }

  /* ── Tables: scroll container ── */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    margin: 0 -2px;
  }
  .table { min-width: 540px; font-size: 12.5px; }
  .table th, .table td { padding: 9px 10px; }
  .table .btn-icon { width: 30px; height: 30px; border-radius: 7px; }

  /* ── Tabs: horizontal scroll ── */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    padding-bottom: 2px;
    gap: 0;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { padding: 10px 16px; font-size: 12px; white-space: nowrap; }

  /* ── Filter bar: horizontal scroll ── */
  .filter-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    padding-bottom: 6px;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar .form-control { min-width: 140px; font-size: 12px; }

  /* ── Chips: horizontal scroll ── */
  .chips, [class*="chip-bar"], [class*="chips-bar"] {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .chip { white-space: nowrap; font-size: 11px; padding: 5px 10px; }

  /* ── Modals: bottom-sheet style ── */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0;
  }
  .modal {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(100%) !important;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1) !important;
  }
  .modal-overlay.open .modal {
    transform: translateY(0) !important;
  }
}

/* ================================================================
   PROFESSIONAL POLISH — v3.0 additions
   ================================================================ */

/* ---------- Skeleton Loading ---------- */
@keyframes skeleton-sweep {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #e0e6ef 50%, #eef1f6 75%);
  background-size: 1200px 100%;
  animation: skeleton-sweep 1.6s infinite ease-in-out;
  border-radius: 8px;
  display: inline-block;
}
.skeleton-text    { height: 13px; width: 100%; border-radius: 6px; }
.skeleton-title   { height: 22px; width: 55%; border-radius: 6px; }
.skeleton-avatar  { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skeleton-btn     { height: 36px; width: 90px; border-radius: 10px; }
.skeleton-card    { height: 90px; border-radius: 14px; }

/* ---------- Table upgrades ---------- */
.table.striped tbody tr:nth-child(even) td { background: #fafbff; }
.table .sticky-top { position: sticky; top: 0; z-index: 2; }
.table .col-action { width: 1%; white-space: nowrap; text-align: center; }

/* Action icon buttons in tables */
.act-btns { display: flex; align-items: center; gap: 4px; justify-content: center; }
.act-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all 0.15s; cursor: pointer;
  border: 1.5px solid transparent; background: transparent;
}
.act-btn-view  { color: var(--info);    } .act-btn-view:hover  { background: var(--info-bg);    border-color: var(--info);    }
.act-btn-edit  { color: var(--primary); } .act-btn-edit:hover  { background: var(--primary-soft);border-color: var(--primary); }
.act-btn-del   { color: var(--danger);  } .act-btn-del:hover   { background: var(--danger-bg);  border-color: var(--danger);  }
.act-btn-send  { color: var(--success); } .act-btn-send:hover  { background: var(--success-bg); border-color: var(--success); }
.act-btn-print { color: var(--purple);  } .act-btn-print:hover { background: var(--purple-bg);  border-color: var(--purple);  }
.act-btn-more  { color: var(--text-3);  } .act-btn-more:hover  { background: var(--body-bg);    border-color: var(--border);  }

/* ---------- Financial amount styling ---------- */
.amt { font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.amt-credit { color: var(--success); }
.amt-debit  { color: var(--danger); }
.amt-neutral{ color: var(--text); }

/* ---------- Filter bar glass panel ---------- */
.filter-panel {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(30,58,95,0.08);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 14px rgba(30,58,95,0.07);
}
.filter-panel .form-control { background: #fff; }

/* ---------- Date preset chips (global) ---------- */
.date-presets {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.dp-chip {
  padding: 6px 15px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  color: var(--text-2); white-space: nowrap;
  transition: all .15s;
  box-shadow: 0 1px 4px rgba(30,58,95,0.06);
}
.dp-chip:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.dp-chip.active { background: linear-gradient(135deg,var(--primary),var(--primary-light)); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(30,58,95,0.28); }

/* ---------- Stat mini-bar inside card ---------- */
.mini-stat-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--body-bg); margin-bottom: 8px;
  border: 1px solid var(--border);
}
.mini-stat-bar:last-child { margin-bottom: 0; }
.mini-stat-bar .msb-icon { font-size: 18px; flex-shrink: 0; }
.mini-stat-bar .msb-label { font-size: 12px; color: var(--text-3); font-weight: 600; flex: 1; }
.mini-stat-bar .msb-val   { font-size: 15px; font-weight: 800; color: var(--text); }

/* ---------- KPI / summary strip ---------- */
.kpi-strip {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.kpi-item {
  flex: 1; min-width: 140px;
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid rgba(30,58,95,0.07);
  padding: 16px 18px;
  box-shadow: 0 2px 12px rgba(30,58,95,0.07);
  position: relative; overflow: hidden;
}
.kpi-item::after {
  content: ''; position: absolute; right: -14px; bottom: -14px;
  width: 70px; height: 70px; border-radius: 50%;
  background: currentColor; opacity: 0.05;
}
.kpi-lbl  { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px; }
.kpi-val  { font-size: 26px; font-weight: 900; line-height: 1; }
.kpi-sub  { font-size: 11.5px; color: var(--text-3); margin-top: 5px; font-weight: 600; }

/* ---------- Section divider ---------- */
.sec-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 18px; font-size: 12px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .5px;
}
.sec-divider::before, .sec-divider::after {
  content: ''; flex: 1; height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--border));
}
.sec-divider::before { background: linear-gradient(90deg, var(--border), transparent); }

/* ---------- Info list (label: value rows) ---------- */
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-list .il-row { display: flex; gap: 10px; align-items: baseline; }
.info-list .il-lbl { min-width: 130px; font-size: 12px; color: var(--text-3); font-weight: 700; flex-shrink: 0; }
.info-list .il-val { font-size: 13.5px; font-weight: 600; color: var(--text); }

/* ---------- Status dot ---------- */
.status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700;
}
.status-dot::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(currentColor,.2);
}

/* ---------- Card glow hover (premium feel) ---------- */
.card-glow:hover {
  box-shadow: 0 8px 40px rgba(30,58,95,0.16), 0 0 0 1px rgba(30,58,95,0.06) !important;
  transform: translateY(-2px) !important;
}

/* ---------- Scrollable table container with shadow hints ---------- */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-x::-webkit-scrollbar { height: 4px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---------- Better breadcrumb ─ active page has accent colour ---------- */
.breadcrumb-item.current { color: var(--primary); font-weight: 800; }

/* ---------- Sidebar footer location button ---------- */
#_sidebar_loc_status button {
  width: 100%; font-size: 11.5px; border-radius: 8px;
  transition: all .18s;
}
#_sidebar_loc_status button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ── Sidebar Sign-Out button ─────────────────────────────────── */
.sidebar-signout-btn {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  border-radius: 8px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
.sidebar-signout-btn .signout-label { display: none; }

/* On mobile — bigger button with visible "Sign Out" text */
@media (max-width: 768px) {
  .sidebar-signout-btn {
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 10px;
    background: rgba(220,38,38,0.18);
    border-color: rgba(220,38,38,0.4);
    color: #FCA5A5;
    gap: 8px;
  }
  .sidebar-signout-btn .signout-label { display: inline; }
  .modal-body { padding: 16px 16px 24px; }
  .modal-header { padding: 14px 16px; }
  .modal-header h3 { font-size: 15px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { flex: 1; justify-content: center; min-width: 0; }

  /* ── Forms: single column ── */
  .form-grid-2,
  .form-grid-3,
  .form-grid-4 { grid-template-columns: 1fr !important; gap: 12px; }
  .form-grid   { grid-template-columns: 1fr !important; gap: 12px; }
  .form-group label { font-size: 12px; }
  .form-control { font-size: 13px; padding: 9px 12px; }

  /* ── Cards ── */
  .card { padding: 14px; border-radius: 14px; }
  .card-header { padding-bottom: 10px; margin-bottom: 12px; }

  /* ── Touch-friendly buttons ── */
  .btn     { min-height: 40px; }
  .btn-sm  { min-height: 34px; padding: 6px 12px; font-size: 11.5px; }

  /* ── Attendance cells ── */
  .att-cell { width: 38px !important; height: 38px !important; font-size: 12px !important; border-radius: 9px !important; }

  /* ── Search box full width ── */
  .search-box { width: 100%; }
  .search-box input { width: 100%; }

  /* ── Pagination: compact ── */
  .pagination { flex-wrap: wrap; gap: 4px; }
  .page-btn   { width: 32px; height: 32px; font-size: 12px; }

  /* ── Voice FAB: avoid overlap with content ── */
  #v-global-fab { bottom: 18px !important; right: 14px !important; }
  #v-panel      { bottom: 82px !important; }
  #v-nav-toast  { bottom: 88px !important; }

  /* ── Header compact ── */
  .main-header { height: 56px; padding: 0 14px; }
  .header-brand { gap: 8px; }
  .header-brand img { width: 32px; height: 32px; }
  .header-title  { font-size: 13px; }

  /* ── Sidebar overlay backdrop ── */
  .sidebar.open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: -1;
  }
}

/* ================================================================
   WORLD-CLASS REFRESH  v3.0   (appended — wins on the cascade)
   Premium typography · layered shadows · glass header ·
   elevated cards · button sheen · focus glow · smooth motion
   ================================================================ */

/* ---- Design tokens, refined ---- */
:root {
  --font:       'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  --font-head:  'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
  --body-bg:    #EEF2F8;
  --border:     #E6ECF3;
  /* softer, layered, more expensive-looking shadows */
  --shadow:     0 1px 2px rgba(16,40,72,.04), 0 6px 20px rgba(16,40,72,.07);
  --shadow-lg:  0 4px 10px rgba(16,40,72,.07), 0 24px 60px rgba(16,40,72,.16);
  --shadow-xl:  0 8px 24px rgba(16,40,72,.10), 0 40px 90px rgba(16,40,72,.22);
  --radius:     14px;
  --radius-sm:  9px;
  --radius-lg:  20px;
}

/* ---- Base typography polish ---- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: .1px;
  /* subtle, expensive ambient background instead of a flat fill */
  background:
    radial-gradient(1100px 540px at 88% -8%, rgba(37,99,235,.07), transparent 60%),
    radial-gradient(900px 520px at -6% 8%,  rgba(245,158,11,.06), transparent 55%),
    var(--body-bg);
  background-attachment: fixed;
}
h1, h2, h3, .page-title h1, .card-title, .stat-value, .sidebar-logo .logo-text,
.modal-header h3 { font-family: var(--font-head); letter-spacing: -.2px; }
.page-title h1 { font-weight: 800; }
.stat-value { font-family: var(--font-head); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }

/* ---- Glassmorphic header ---- */
.header {
  background: rgba(255,255,255,.72);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(230,236,243,.9);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 22px rgba(16,40,72,.05);
}

/* ---- Sidebar: brand + active highlight ---- */
.sidebar { background: linear-gradient(165deg, #0A1A30 0%, #16335A 52%, #0B2138 100%); }
.nav-item a {
  position: relative;
  border-radius: 11px;
  margin: 1px 10px;
  transition: background .2s ease, color .2s ease, transform .15s ease;
}
.nav-item a:hover { transform: translateX(2px); }
.nav-item a.active {
  background: linear-gradient(100deg, rgba(245,158,11,.20), rgba(255,255,255,.06));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}
.nav-item a.active::before {
  content: '';
  position: absolute; left: -10px; top: 18%; bottom: 18%;
  width: 4px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #F59E0B, #FB923C);
  box-shadow: 0 0 14px rgba(245,158,11,.7);
}

/* ---- Cards: crisp border + tactile hover lift ---- */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.22,.61,.36,1), box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #DCE6F1; }

/* ---- Stat cards: premium glow + sheen ---- */
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .22s cubic-bezier(.22,.61,.36,1), box-shadow .22s ease;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.stat-card::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120px 80px at 100% 0%, rgba(255,255,255,.5), transparent 70%);
  pointer-events: none;
}
.stat-icon { border-radius: 14px; }

/* ---- Buttons: depth + moving sheen on hover ---- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: .2px;
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn::after {
  content: '';
  position: absolute; top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
}
.btn:hover::after { left: 140%; }

/* ---- Inputs: soft focus glow ring ---- */
.form-control {
  border-radius: var(--radius-sm);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(37,99,235,.14);
}

/* ---- Tables: clean rows, smooth hover ---- */
table tbody tr { transition: background .15s ease; }
table tbody tr:hover { background: var(--primary-soft); }

/* ---- Modals: deeper elevation ---- */
.modal { border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); }

/* ---- Badges: subtle lift ---- */
.badge { border-radius: 999px; font-weight: 600; letter-spacing: .2px; }

/* ---- Page enters with a gentle fade-up ---- */
@keyframes ascEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.main-content { animation: ascEnter .42s cubic-bezier(.22,.61,.36,1) both; }
@media (prefers-reduced-motion: reduce) {
  .main-content { animation: none; }
  .btn::after { display: none; }
}

/* ================================================================
   MOBILE ELEGANCE  v3.0   — native-app feel on phones
   safe-area aware · no input zoom · refined drawer & sheets ·
   comfortable touch targets · no tap-flash
   ================================================================ */

/* Kill the blue tap flash & text-selection on controls everywhere */
a, button, .btn, .nav-item a, .act-btn, .chip, .tab-btn, .stat-card, .card {
  -webkit-tap-highlight-color: transparent;
}
.btn, .nav-item a, .act-btn, .tab-btn { -webkit-user-select: none; user-select: none; }

@media (max-width: 700px) {

  /* ---- Respect notches / home-indicator (needs viewport-fit=cover) ---- */
  .main-content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .header { padding-right: calc(14px + env(safe-area-inset-right));
            padding-left:  calc(14px + env(safe-area-inset-left)); }
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }

  /* ---- Stop iOS auto-zoom: form fields must be ≥16px when focused ---- */
  .form-control, input, select, textarea { font-size: 16px !important; }
  .form-control { padding: 11px 14px; border-radius: 12px; }

  /* ---- Smooth, glitch-free scrolling ---- */
  body, .main-content { overscroll-behavior-y: contain; }
  .main-content { -webkit-overflow-scrolling: touch; }

  /* ---- Header: sticky frosted bar that feels native ---- */
  .header {
    position: sticky; top: 0;
    background: rgba(255,255,255,.80);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }

  /* ---- Drawer: rounded edge, soft shadow, blurred backdrop ---- */
  .sidebar {
    width: 84vw; max-width: 320px;
    border-radius: 0 22px 22px 0;
    box-shadow: 24px 0 60px rgba(0,0,0,.45);
  }
  .sidebar.open { width: 84vw; max-width: 320px; }
  .sidebar.open::after { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .nav-item a { padding-top: 12px; padding-bottom: 12px; min-height: 48px; }   /* thumb-friendly */
  .nav-item a:active { background: rgba(255,255,255,.12); }

  /* ---- Comfortable, springy touch targets ---- */
  .btn  { min-height: 46px; border-radius: 12px; }
  .btn:active  { transform: scale(.96); }
  .btn-sm { min-height: 38px; }
  .act-btn { width: 38px; height: 38px; }   /* 38px ≈ Apple's min tap size */

  /* ---- Cards: airy spacing, full-bleed elegance ---- */
  .card { padding: 16px; border-radius: 18px; }
  .stat-card { border-radius: 18px; }
  .stat-card:active { transform: scale(.985); }

  /* ---- Bottom-sheet modals: add a grab handle ---- */
  .modal { padding-top: 8px; }
  .modal::before {
    content: '';
    display: block;
    width: 40px; height: 5px;
    margin: 6px auto 2px;
    border-radius: 999px;
    background: #D5DEEA;
  }
  .modal-footer {
    position: sticky; bottom: 0;
    background: var(--card-bg);
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 20px rgba(16,40,72,.06);
  }

  /* ---- Floating action buttons clear of the home indicator ---- */
  #v-global-fab { bottom: calc(18px + env(safe-area-inset-bottom)) !important; }
}

/* Extra-small phones: single-column stats read better */
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr !important; }
  .page-title h1 { font-size: 17px; }
}

/* ================================================================
   EXPERIENCE FINISH v4 — selection, focus, toasts
   ================================================================ */

/* Brand text selection */
::selection { background: rgba(37,99,235,.18); color: var(--primary-dark); }

/* Visible-but-elegant keyboard focus (mouse clicks stay clean) */
:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn:focus-visible { outline-offset: 3px; }

/* Premium toasts: glass, slide-up, accent bar */
#toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 99999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
#toast-container > div {
  pointer-events: auto;
  border-radius: 14px !important;
  box-shadow: 0 10px 36px rgba(16,40,72,.28) !important;
  font-family: var(--font) !important;
  font-weight: 600;
  animation: toastIn .35s cubic-bezier(.34,1.4,.64,1) both;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 700px) {
  #toast-container { left: 14px; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { #toast-container > div { animation: none; } }

/* ================================================================
   MOBILE BOTTOM TAB BAR — one-thumb navigation (phones only)
   Injected by buildSidebar() as #_mob_tabbar
   ================================================================ */
#_mob_tabbar { display: none; }
@media (max-width: 700px) {
  #_mob_tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    display: flex; align-items: stretch;
    background: rgba(255,255,255,.88);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid rgba(226,232,240,.9);
    box-shadow: 0 -8px 30px rgba(16,40,72,.10);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #_mob_tabbar .mtab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 9px 2px 8px;
    background: none; border: none; cursor: pointer;
    text-decoration: none; color: var(--text-3);
    font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: .2px;
    -webkit-tap-highlight-color: transparent;
    transition: color .18s ease, transform .12s ease;
    position: relative; min-height: 54px;
  }
  #_mob_tabbar .mtab i { font-size: 17px; transition: transform .2s cubic-bezier(.34,1.4,.64,1); }
  #_mob_tabbar .mtab:active { transform: scale(.92); }
  #_mob_tabbar .mtab.on { color: var(--primary-light); }
  #_mob_tabbar .mtab.on i { transform: translateY(-1px) scale(1.12); }
  #_mob_tabbar .mtab.on::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 26px; height: 3px; border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--primary-light), #60A5FA);
    box-shadow: 0 2px 8px rgba(37,99,235,.5);
  }

  /* The 84vw drawer outgrows the old -268px hide offset — hide it fully */
  .sidebar { transform: translateX(-110%); }
  .sidebar.open { transform: translateX(0); }

  /* Lift floating buttons clear of the tab bar */
  .ansha-fab     { bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  .ansha-win     { bottom: calc(132px + env(safe-area-inset-bottom)) !important; }
  #v-global-fab  { bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  #v-panel       { bottom: calc(136px + env(safe-area-inset-bottom)) !important; }
  #v-nav-toast   { bottom: calc(142px + env(safe-area-inset-bottom)) !important; }
}
@media print { #_mob_tabbar { display: none !important; } }

/* ================================================================
   COLOR RICHNESS v5 — deeper, livelier palette (brand-safe)
   ================================================================ */

/* A touch more colour in the ambient canvas */
body {
  background:
    radial-gradient(1100px 540px at 88% -8%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(900px 520px at -6% 8%,  rgba(245,158,11,.09), transparent 55%),
    radial-gradient(700px 420px at 50% 115%, rgba(8,145,178,.07), transparent 60%),
    var(--body-bg);
  background-attachment: fixed;
}

/* Brand ribbon — a fine tricolour line under the header */
.header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px;
  background: linear-gradient(90deg, #1E3A5F 0%, #2563EB 35%, #06B6D4 60%, #F59E0B 100%);
  opacity: .85;
}
.header { position: sticky; }

/* Primary buttons: richer gradient + colored glow */
.btn-primary {
  background: linear-gradient(135deg, #1E3A5F 0%, #2356b8 60%, #2563EB 100%);
  box-shadow: 0 6px 18px rgba(37,99,235,.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #16335a, #1d4ed8);
  box-shadow: 0 10px 26px rgba(37,99,235,.45);
}
.btn-accent {
  background: linear-gradient(135deg, #D97706 0%, #F59E0B 70%, #FBBF24 100%);
  box-shadow: 0 6px 18px rgba(245,158,11,.40);
}
.btn-success { background: linear-gradient(135deg, #047857, #10B981); box-shadow: 0 6px 18px rgba(5,150,105,.35); }
.btn-danger  { background: linear-gradient(135deg, #B91C1C, #EF4444); box-shadow: 0 6px 18px rgba(220,38,38,.35); }

/* Table headers: brighter navy→blue sweep */
.table th { background: linear-gradient(120deg, #16335A 0%, #1E4A8A 55%, #2563EB 130%); }

/* Cards pick up a faint colour wash on hover */
.card:hover { border-color: rgba(37,99,235,.25); }
.card-glow:hover { box-shadow: 0 6px 18px rgba(37,99,235,.10), 0 24px 60px rgba(16,40,72,.16); }

/* Stat values: ink → deep navy for stronger contrast */
.stat-value { color: #11253F; }
.stat-label { color: #5B6B7B; }

/* Sidebar: deeper space-blue with an aurora tint */
.sidebar {
  background:
    radial-gradient(340px 240px at 115% 0%,  rgba(37,99,235,.30), transparent 60%),
    radial-gradient(280px 220px at -25% 100%, rgba(245,158,11,.16), transparent 60%),
    linear-gradient(168deg, #081526 0%, #14304F 55%, #0A1E36 100%);
}

/* Badges: a notch more saturation */
.badge-blue   { color: #1D4ED8; border-color: rgba(37,99,235,.35); }
.badge-green  { color: #047857; border-color: rgba(5,150,105,.35); }
.badge-red    { color: #B91C1C; border-color: rgba(220,38,38,.35); }
.badge-orange { color: #B45309; border-color: rgba(217,119,6,.4);  }
.badge-purple { color: #6D28D9; border-color: rgba(124,58,237,.35);}

/* Links */
a { transition: color .15s ease; }
a:hover { color: #D97706; }

/* Scrollbar matches the brand */
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #93A9C4, #6E8AAE); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #2563EB, #1E3A5F); }
