/* ==========================================================================
   INSPIRER INTERNATIONAL SCHOOL SYSTEM - DESIGN SYSTEM & STYLES
   Brand Colors Extracted from School Logo:
   - Primary Crimson Maroon (Shield Crest): #8B1D2C
   - Dark Maroon Accent: #61101B
   - Warm Amber Gold (Book & Trim): #D4921B
   - Tree Leaf Green Accent: #6E9342
   - Deep Black / Charcoal (Emblem Typography): #141414
   ========================================================================== */

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

:root {
  /* Brand Palette from Logo */
  --brand-primary: #8B1D2C;
  --brand-primary-hover: #761623;
  --brand-primary-active: #61101B;
  --brand-dark: #61101B;
  --brand-deep: #420A11;
  --brand-tint: #FCF2F3;
  --brand-light: #F9E0E3;
  --brand-subtle: #F0B8BE;
  --brand-border: #E49FA7;

  /* Accent Gold from Book Emblem */
  --accent-gold: #D4921B;
  --accent-gold-hover: #B97B12;
  --accent-gold-tint: #FEF8EC;
  --accent-gold-light: #FDE8BF;

  /* Accent Tree Green from Knowledge Tree */
  --accent-tree: #6E9342;
  --accent-tree-tint: #F3F8ED;

  /* Neutrals */
  --charcoal-900: #141414; /* Logo Black */
  --charcoal-800: #242424;
  --charcoal-700: #363636;
  --charcoal-600: #4E4E4E;
  --charcoal-500: #6B6B6B;
  --charcoal-400: #8E8E8E;
  --charcoal-300: #BFBFBF;
  --charcoal-200: #E2E2E2;
  --charcoal-100: #F0F0F0;
  --charcoal-50:  #F8F9FA;
  --white: #ffffff;

  /* App Surfaces */
  --bg-app: #F8F9FA;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --border-color: #E5E8EC;
  --border-light: #ECEFF3;

  /* Text Colors */
  --text-main: #141414;
  --text-secondary: #4E4E4E;
  --text-muted: #7A7A7A;
  --text-inverse: #ffffff;

  /* Semantic Status Colors (Logo-harmonized) */
  --status-paid-text: #047857;
  --status-paid-bg: #ECFDF5;
  --status-paid-border: #A7F3D0;

  --status-pending-text: #B45309;
  --status-pending-bg: #FEF8EC;
  --status-pending-border: #FDE68A;

  --status-overdue-text: #b32b26;
  --status-overdue-bg: #fdeeee;
  --status-overdue-border: #f8c0bf;

  --status-partial-text: #854d0e;
  --status-partial-bg: #fef9c3;
  --status-partial-border: #facc15;

  --status-active-text: #047857;
  --status-active-bg: #ECFDF5;
  --status-active-border: #A7F3D0;

  --status-inactive-text: #64748B;
  --status-inactive-bg: #F1F5F9;
  --status-inactive-border: #CBD5E1;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(21, 21, 21, 0.04), 0 1px 2px rgba(21, 21, 21, 0.02);
  --shadow-md: 0 4px 12px rgba(21, 21, 21, 0.05), 0 2px 4px rgba(21, 21, 21, 0.02);
  --shadow-lg: 0 12px 28px rgba(21, 21, 21, 0.08), 0 4px 10px rgba(21, 21, 21, 0.03);
  --shadow-modal: 0 24px 48px rgba(21, 21, 21, 0.16), 0 8px 16px rgba(21, 21, 21, 0.08);

  /* Layout Measurements */
  --sidebar-width: 270px;
  --sidebar-collapsed-width: 76px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* ==========================================================================
   DARK THEME PALETTE
   ========================================================================== */
[data-theme="dark"] {
  /* User-Specified Palette Tokens */
  --bg-app: #0B0F14;             /* Main background */
  --bg-sidebar: #111722;         /* Sidebar background */
  --bg-header: #111722;          /* Top navigation */
  --bg-card: #171F2D;            /* Dashboard cards */
  --bg-card-hover: #1D2737;      /* Card hover background */
  --bg-elevated: #171F2D;
  --bg-input: #111722;
  --border-color: #293447;       /* Borders */
  --border-light: #293447;
  --border-hover: #38475f;

  /* Typography */
  --text-main: #F1F5F9;          /* Primary text */
  --text-secondary: #94A3B8;     /* Secondary text */
  --text-muted: #64748B;         /* Muted text */
  --text-inverse: #0B0F14;

  --charcoal-900: #F1F5F9;
  --charcoal-800: #E2E8F0;
  --charcoal-700: #CBD5E1;
  --charcoal-600: #94A3B8;
  --charcoal-500: #94A3B8;
  --charcoal-400: #64748B;
  --charcoal-300: #475569;
  --charcoal-200: #334155;
  --charcoal-100: #1E293B;
  --charcoal-50:  #111722;
  --white: #171F2D;

  /* Primary Accent: #E11D48 */
  --brand-primary: #E11D48;
  --brand-primary-hover: #BE123C;
  --brand-primary-active: #9F1239;
  --brand-dark: #E11D48;
  --brand-tint: rgba(225, 29, 72, 0.12);
  --brand-light: rgba(225, 29, 72, 0.22);
  --brand-subtle: rgba(225, 29, 72, 0.35);
  --brand-border: #E11D48;

  /* Status Tokens: Success (#10B981), Warning (#F59E0B), Error (#F87171), Info (#60A5FA) */
  --status-paid-text: #10B981;
  --status-paid-bg: rgba(16, 185, 129, 0.14);
  --status-paid-border: rgba(16, 185, 129, 0.32);

  --status-active-text: #10B981;
  --status-active-bg: rgba(16, 185, 129, 0.14);
  --status-active-border: rgba(16, 185, 129, 0.32);

  --status-pending-text: #F59E0B;
  --status-pending-bg: rgba(245, 158, 11, 0.14);
  --status-pending-border: rgba(245, 158, 11, 0.32);

  --status-partial-text: #F59E0B;
  --status-partial-bg: rgba(245, 158, 11, 0.14);
  --status-partial-border: rgba(245, 158, 11, 0.32);

  --accent-gold: #F59E0B;
  --accent-gold-tint: rgba(245, 158, 11, 0.14);
  --accent-gold-light: rgba(245, 158, 11, 0.32);

  --status-overdue-text: #F87171;
  --status-overdue-bg: rgba(248, 113, 113, 0.14);
  --status-overdue-border: rgba(248, 113, 113, 0.32);

  --status-info-text: #60A5FA;
  --status-info-bg: rgba(96, 165, 250, 0.14);
  --status-info-border: rgba(96, 165, 250, 0.32);

  --status-inactive-text: #94A3B8;
  --status-inactive-bg: rgba(148, 163, 184, 0.12);
  --status-inactive-border: rgba(148, 163, 184, 0.28);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.75);
  --shadow-modal: 0 24px 48px rgba(0, 0, 0, 0.9);
}

/* Base Surfaces in Dark Mode */
[data-theme="dark"] body,
[data-theme="dark"] .main-wrapper,
[data-theme="dark"] .app-container {
  background-color: #0B0F14 !important;
  color: var(--text-main);
}

/* Sidebar & Header Navigation (#111722) */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .sidebar-header,
[data-theme="dark"] .sidebar-footer,
[data-theme="dark"] .top-header {
  background-color: #111722 !important;
  border-color: #293447 !important;
  color: var(--text-main);
}

[data-theme="dark"] .nav-group-title {
  color: #64748B;
}

[data-theme="dark"] .nav-item {
  color: #94A3B8;
}

[data-theme="dark"] .nav-item:hover {
  background-color: #1D2737;
  color: #F1F5F9;
}

[data-theme="dark"] .nav-item.active {
  background-color: #E11D48 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}

[data-theme="dark"] .submenu-item {
  color: #94A3B8;
}

[data-theme="dark"] .submenu-item:hover {
  background-color: #1D2737;
  color: #F1F5F9;
}

[data-theme="dark"] .submenu-item.active {
  background-color: rgba(225, 29, 72, 0.14) !important;
  color: #E11D48 !important;
  border-left-color: #E11D48 !important;
}

/* Dashboard Cards & Surfaces (#171F2D) */
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] dialog.modal-dialog,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .login-card-container {
  background-color: #171F2D !important;
  border-color: #293447 !important;
  color: var(--text-main);
}

/* Card Hover State (#1D2737) */
[data-theme="dark"] .card:hover,
[data-theme="dark"] .stat-card:hover {
  background-color: #1D2737 !important;
  border-color: #38475f !important;
}

/* Card Headers and Footers */
[data-theme="dark"] .card-header,
[data-theme="dark"] .modal-header {
  border-bottom-color: #293447 !important;
  color: #F1F5F9;
}

[data-theme="dark"] .card-footer,
[data-theme="dark"] .modal-footer {
  background-color: #111722 !important;
  border-top-color: #293447 !important;
}

/* Typography & Titles */
[data-theme="dark"] .page-title,
[data-theme="dark"] .card-title,
[data-theme="dark"] .stat-value,
[data-theme="dark"] .modal-title {
  color: #F1F5F9 !important;
}

[data-theme="dark"] .page-subtitle,
[data-theme="dark"] .stat-title,
[data-theme="dark"] .card-subtitle {
  color: #94A3B8 !important;
}

[data-theme="dark"] .stat-desc,
[data-theme="dark"] .breadcrumbs,
[data-theme="dark"] .text-muted {
  color: #64748B !important;
}

/* Data Tables */
[data-theme="dark"] .data-table thead th {
  background-color: #111722 !important;
  color: #94A3B8 !important;
  border-bottom: 1px solid #293447 !important;
}

[data-theme="dark"] .data-table tbody tr {
  border-bottom: 1px solid #293447 !important;
}

[data-theme="dark"] .data-table tbody td {
  background-color: #171F2D !important;
  color: #F1F5F9 !important;
  border-bottom: 1px solid #293447 !important;
}

[data-theme="dark"] .data-table tbody tr:hover td {
  background-color: #1D2737 !important;
}

/* Form Controls & Inputs */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .search-input-wrapper input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: #111722 !important;
  border-color: #293447 !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: #E11D48 !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.22) !important;
}

[data-theme="dark"] .form-label {
  color: #94A3B8;
}

/* Buttons */
[data-theme="dark"] .btn-primary {
  background-color: #E11D48 !important;
  border-color: #E11D48 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35);
}

[data-theme="dark"] .btn-primary:hover {
  background-color: #BE123C !important;
  border-color: #BE123C !important;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.45);
}

[data-theme="dark"] .btn-secondary {
  background-color: #171F2D !important;
  border-color: #293447 !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: #1D2737 !important;
  border-color: #E11D48 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .btn-outline {
  border-color: #E11D48 !important;
  color: #E11D48 !important;
  background-color: transparent !important;
}

[data-theme="dark"] .btn-outline:hover {
  background-color: rgba(225, 29, 72, 0.14) !important;
}

/* Header Action Controls */
[data-theme="dark"] .global-search-trigger {
  background-color: #171F2D !important;
  border-color: #293447 !important;
  color: #94A3B8 !important;
}

[data-theme="dark"] .global-search-trigger:hover {
  border-color: #E11D48 !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .global-search-trigger kbd {
  background-color: #111722;
  border-color: #293447;
  color: #64748B;
}

[data-theme="dark"] .icon-btn {
  background-color: #171F2D !important;
  border-color: #293447 !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .icon-btn:hover {
  background-color: #1D2737 !important;
  border-color: #E11D48 !important;
  color: #E11D48 !important;
}

[data-theme="dark"] .user-profile-btn,
[data-theme="dark"] .role-tag-btn,
[data-theme="dark"] .db-status-pill,
[data-theme="dark"] .collapse-btn {
  background-color: #171F2D !important;
  border-color: #293447 !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .user-role-display-pill {
  background: rgba(225, 29, 72, 0.14) !important;
  border-color: rgba(225, 29, 72, 0.3) !important;
  color: #fda4af !important;
}

/* Status Badges */
[data-theme="dark"] .badge-paid,
[data-theme="dark"] .badge-active,
[data-theme="dark"] .badge-present {
  background-color: rgba(16, 185, 129, 0.14) !important;
  color: #10B981 !important;
  border-color: rgba(16, 185, 129, 0.32) !important;
}

[data-theme="dark"] .badge-pending,
[data-theme="dark"] .badge-partial,
[data-theme="dark"] .badge-leave {
  background-color: rgba(245, 158, 11, 0.14) !important;
  color: #F59E0B !important;
  border-color: rgba(245, 158, 11, 0.32) !important;
}

[data-theme="dark"] .badge-overdue,
[data-theme="dark"] .badge-absent,
[data-theme="dark"] .badge-danger {
  background-color: rgba(248, 113, 113, 0.14) !important;
  color: #F87171 !important;
  border-color: rgba(248, 113, 113, 0.32) !important;
}

[data-theme="dark"] .badge-inactive,
[data-theme="dark"] .badge-left {
  background-color: rgba(148, 163, 184, 0.12) !important;
  color: #94A3B8 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

/* Date Pill Group */
[data-theme="dark"] .date-pill-group {
  background-color: #111722;
  border: 1px solid #293447;
}

[data-theme="dark"] .date-pill {
  color: #94A3B8;
}

[data-theme="dark"] .date-pill:hover {
  background-color: #1D2737;
  color: #F1F5F9;
}

[data-theme="dark"] .date-pill.active {
  background-color: #E11D48 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35);
}

/* Custom Date Filter Bar in Dashboard */
[data-theme="dark"] .dash-custom-date-bar {
  background-color: #171F2D !important;
  border-color: #293447 !important;
}

[data-theme="dark"] .dash-custom-date-bar span {
  color: #F1F5F9 !important;
}

/* Attendance Today Banner */
[data-theme="dark"] .attendance-today-card {
  background: linear-gradient(135deg, #171F2D, rgba(225, 29, 72, 0.1)) !important;
  border-color: #293447 !important;
}

[data-theme="dark"] .printable-doc {
  background-color: #ffffff;
  color: #141414;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-deep);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Layout Container */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: width var(--transition-normal), transform var(--transition-normal);
}

/* IMPORTANT: Logo Area Contains ONLY The Provided Logo */
.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 205px;
  height: 50px;
}

/* Existing logo only - no title text beside it */
.logo-img {
  max-height: 44px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.collapse-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--charcoal-500);
  background-color: var(--charcoal-50);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.collapse-btn:hover {
  color: var(--charcoal-900);
  background-color: var(--brand-tint);
  border-color: var(--brand-subtle);
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--charcoal-200) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--charcoal-200);
  border-radius: 4px;
}

.nav-group {
  margin-bottom: 20px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal-400);
  padding: 6px 12px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
  text-align: left;
}

.nav-item:hover {
  background-color: var(--brand-tint);
  color: var(--charcoal-900);
}

.nav-item.active {
  background-color: var(--brand-primary);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(139, 29, 44, 0.35);
}

.nav-icon {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  flex-shrink: 0;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-chevron {
  width: 14px;
  height: 14px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  transition: transform var(--transition-fast);
}

.nav-item.open .nav-chevron {
  transform: rotate(90deg);
}

/* Submenu */
.nav-submenu {
  display: none;
  padding-left: 28px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.nav-submenu.open {
  display: block;
}

.submenu-item {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 500;
  margin-bottom: 2px;
  transition: all var(--transition-fast);
  position: relative;
}

.submenu-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--charcoal-300);
  transition: all var(--transition-fast);
}

.submenu-item:hover {
  color: var(--charcoal-900);
  background-color: var(--brand-tint);
}

.submenu-item:hover::before {
  background-color: var(--brand-primary);
}

.submenu-item.active {
  color: var(--brand-primary) !important;
  font-weight: 700 !important;
  background-color: var(--brand-tint) !important;
  border-left: 3px solid var(--brand-primary);
  padding-left: 10px;
}

.submenu-item.active::before {
  background-color: var(--brand-primary);
  width: 7px;
  height: 7px;
}

.nav-item.has-sub.active-parent {
  color: var(--brand-primary);
  font-weight: 700;
  background-color: var(--brand-tint);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
}

.sidebar-footer .nav-item {
  padding: 8px 12px;
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .logo-wrapper {
  max-width: 36px;
  overflow: hidden;
}

.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-submenu {
  display: none !important;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .nav-icon {
  margin-right: 0;
}

/* ==========================================================================
   MAIN CONTENT WRAPPER & TOP HEADER
   ========================================================================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100% - var(--sidebar-width));
  transition: margin-left var(--transition-normal), width var(--transition-normal), max-width var(--transition-normal);
  background-color: var(--bg-app);
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
  max-width: calc(100% - var(--sidebar-collapsed-width));
}

/* Header */
.top-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--charcoal-700);
  background: var(--charcoal-50);
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumbs span.current {
  color: var(--charcoal-900);
  font-weight: 600;
}

.page-title-badge {
  font-size: 18px;
  font-weight: 700;
  color: var(--charcoal-900);
  letter-spacing: -0.015em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Global Search Trigger */
.global-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background-color: var(--charcoal-50);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  min-width: 240px;
  transition: all var(--transition-fast);
}

.global-search-trigger:hover {
  background-color: var(--white);
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 29, 44, 0.15);
}

.search-icon-sm {
  width: 16px;
  height: 16px;
  stroke: var(--charcoal-400);
}

.search-shortcut {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--charcoal-100);
  color: var(--charcoal-600);
  border: 1px solid var(--border-color);
  font-weight: 600;
}

/* Role Selector Dropdown */
.role-badge-selector {
  position: relative;
}

.role-tag-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-deep);
  transition: all var(--transition-fast);
}

.role-tag-btn:hover {
  background: var(--brand-light);
}

.role-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--brand-primary);
}

/* Header Action Icons */
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal-600);
  background-color: var(--charcoal-50);
  border: 1px solid var(--border-color);
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--charcoal-900);
  background-color: var(--white);
  border-color: var(--brand-primary);
}

.notification-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background-color: var(--brand-primary);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* User Profile Header */
.user-menu-wrapper {
  position: relative;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
}

.user-profile-btn:hover {
  background-color: var(--charcoal-50);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(139, 29, 44, 0.25);
}

.user-info-text {
  text-align: left;
  line-height: 1.2;
}

.user-name-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--charcoal-900);
}

.user-role-text {
  font-size: 11.5px;
  color: var(--brand-dark);
  font-weight: 500;
}

/* Dropdown Menus */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  padding: 6px;
  z-index: 200;
  display: none;
  animation: fadeInDown 0.15s ease-out;
}

.dropdown-menu.show {
  display: block;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background-color: var(--brand-tint);
  color: var(--charcoal-900);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

/* ==========================================================================
   PAGE CONTENT CONTAINER
   ========================================================================== */
.page-content {
  flex: 1;
  padding: 24px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--charcoal-900);
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: var(--white);
  border: 1px solid var(--brand-primary);
  box-shadow: 0 2px 6px rgba(139, 29, 44, 0.25);
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  box-shadow: 0 4px 12px rgba(139, 29, 44, 0.35);
}

.btn-primary:active {
  background-color: var(--brand-primary-active);
  transform: translateY(1px);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--charcoal-700);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--charcoal-50);
  border-color: var(--charcoal-300);
  color: var(--charcoal-900);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-dark);
  border: 1px solid var(--brand-subtle);
}

.btn-outline:hover {
  background-color: var(--brand-tint);
  border-color: var(--brand-primary);
  color: var(--brand-deep);
}

.btn-danger {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background-color: #fecaca;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  border-color: var(--brand-subtle);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--charcoal-900);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.card-body {
  padding: 22px;
}

.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  background-color: var(--charcoal-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   DASHBOARD STATS GRID (6 KPI Cards)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-subtle);
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--brand-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-trend.positive {
  background-color: var(--status-paid-bg);
  color: var(--status-paid-text);
}

.stat-trend.neutral {
  background-color: var(--brand-tint);
  color: var(--brand-dark);
}

.stat-trend.gold {
  background-color: var(--accent-gold-tint);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-light);
}

.stat-trend.negative {
  background-color: var(--status-overdue-bg);
  color: var(--status-overdue-text);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--charcoal-900);
  line-height: 1.2;
}

.stat-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   CHARTS & FINANCIAL DASHBOARD
   ========================================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-container {
  width: 100%;
  height: 270px;
  position: relative;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.chart-summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.summary-item .summary-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-item .summary-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--charcoal-900);
  margin-top: 2px;
}

/* Teacher Attendance Today Widget */
.attendance-today-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--white), var(--brand-tint));
  border: 1px solid var(--brand-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}

.attendance-stats-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.att-metric {
  display: flex;
  flex-direction: column;
}

.att-metric-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--charcoal-900);
}

.att-metric-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.att-rate-badge {
  font-size: 13px;
  font-weight: 700;
  background-color: var(--brand-primary);
  color: var(--white);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   TABLES (Optimized for full visibility & horizontal responsiveness)
   ========================================================================== */
.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  scrollbar-width: thin;
  scrollbar-color: var(--brand-subtle) var(--charcoal-100);
  box-sizing: border-box;
}

.table-wrapper::-webkit-scrollbar {
  height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: var(--charcoal-100);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--brand-subtle);
  border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--brand-primary);
}

.data-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  background-color: var(--charcoal-50);
  color: var(--charcoal-600);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
  background-color: var(--white);
  transition: background-color var(--transition-fast);
  white-space: nowrap;
}

.data-table tr:hover td {
  background-color: var(--brand-tint);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* User & Student Avatar In Table */
.table-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--brand-tint);
  border: 1px solid var(--brand-subtle);
  color: var(--brand-deep);
  font-weight: 700;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.table-user-info {
  display: flex;
  flex-direction: column;
}

.table-user-name {
  font-weight: 600;
  color: var(--charcoal-900);
  font-size: 13px;
}

.table-user-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-no-dot::before {
  display: none !important;
  content: none !important;
}

.badge-paid, .badge-active, .badge-present {
  background-color: var(--status-paid-bg);
  color: var(--status-paid-text);
  border: 1px solid var(--status-paid-border);
}

.badge-pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}

.badge-overdue, .badge-absent, .badge-danger {
  background-color: var(--status-overdue-bg);
  color: var(--status-overdue-text);
  border: 1px solid var(--status-overdue-border);
}

.badge-partial {
  background-color: #fef9c3 !important;
  color: #854d0e !important;
  border: 1px solid #facc15 !important;
  font-weight: 700 !important;
}

.badge-partial::before {
  background-color: #ca8a04 !important;
}

.badge-leave {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.badge-inactive, .badge-left {
  background-color: var(--status-inactive-bg);
  color: var(--status-inactive-text);
  border: 1px solid var(--status-inactive-border);
}

/* Table Actions (Compact, responsive, fits on screen) */
.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.table-actions .btn {
  padding: 4px 7px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  line-height: 1.2;
  white-space: nowrap;
}

.table-actions .btn.btn-icon {
  width: 29px;
  height: 29px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.table-actions .btn.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.table-actions .btn.btn-icon svg {
  display: block;
  pointer-events: none;
}

/* Status Toggle Badge Button */
.status-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3.5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  user-select: none;
  line-height: 1.2;
}

.status-toggle-btn .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-toggle-btn.status-active {
  background: #eef5ea;
  color: #2e5b1e;
  border-color: rgba(46, 91, 30, 0.22);
}

.status-toggle-btn.status-active .status-dot {
  background: #2e5b1e;
}

.status-toggle-btn.status-active:hover {
  background: #eef5ea;
  border-color: rgba(46, 91, 30, 0.22);
  box-shadow: none;
  transform: none;
}

.status-toggle-btn.status-inactive {
  background: #fde8e8;
  color: #991b1b;
  border-color: rgba(153, 27, 27, 0.22);
}

.status-toggle-btn.status-inactive .status-dot {
  background: #dc2626;
}

.status-toggle-btn.status-inactive:hover {
  background: #fde8e8;
  border-color: rgba(153, 27, 27, 0.22);
  box-shadow: none;
  transform: none;
}

/* Fee / Salary Print Button (Clickable to view/print official slip/receipt) */
.fee-paid-btn {
  cursor: pointer !important;
  color: var(--brand-primary) !important;
  background-color: var(--brand-tint) !important;
  border: 1px solid var(--brand-border) !important;
  font-weight: 600 !important;
  transition: all var(--transition-fast) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.fee-paid-btn.btn-icon {
  width: 29px !important;
  height: 29px !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
}

.fee-paid-btn:hover {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(139, 29, 44, 0.25);
}

/* ==========================================================================
   ATTENDANCE ROUND BUTTONS SYSTEM (P = Green, A = Red, L = Yellow)
   Round buttons with empty border only, fill on click
   ========================================================================== */
.att-round-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.att-round-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  background-color: transparent;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  border-width: 2px;
  border-style: solid;
  outline: none;
  padding: 0;
  line-height: 1;
}

.att-round-btn:hover {
  transform: scale(1.12);
}

.att-round-btn:active {
  transform: scale(0.95);
}

/* P = Present */
.att-round-btn.att-p {
  border-color: var(--brand-primary);
  color: var(--brand-dark);
  background-color: transparent;
}

.att-round-btn.att-p:hover:not(.active) {
  background-color: var(--brand-tint);
}

.att-round-btn.att-p.active {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(139, 29, 44, 0.4);
}

/* A = Absent (Red #dc2626) */
.att-round-btn.att-a {
  border-color: #dc2626;
  color: #dc2626;
  background-color: transparent;
}

.att-round-btn.att-a:hover:not(.active) {
  background-color: #fef2f2;
}

.att-round-btn.att-a.active {
  background-color: #dc2626 !important;
  border-color: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.45);
}

/* L = Leave (Yellow / Amber #f59e0b) */
.att-round-btn.att-l {
  border-color: #f59e0b;
  color: #d97706;
  background-color: transparent;
}

.att-round-btn.att-l:hover:not(.active) {
  background-color: #fffbeb;
}

.att-round-btn.att-l.active {
  background-color: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
}

.att-round-btn:disabled,
.att-round-btn.disabled-view {
  cursor: default !important;
  transform: none !important;
  pointer-events: none;
}
.att-round-btn:disabled:not(.active),
.att-round-btn.disabled-view:not(.active) {
  opacity: 0.35;
}
.att-round-btn:disabled.active,
.att-round-btn.disabled-view.active {
  opacity: 1;
}

/* ==========================================================================
   FILTER BARS & TOOLBARS (Flexible & Wrap-aware)
   ========================================================================== */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 100%;
}

.search-input-wrapper input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 13px;
  transition: all var(--transition-fast);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 29, 44, 0.18);
}

.search-icon-inside {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--charcoal-400);
}

.form-select, .form-input {
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 12.5px;
  color: var(--charcoal-800);
  transition: all var(--transition-fast);
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 29, 44, 0.18);
}

/* Date filter pills */
.date-pill-group {
  display: inline-flex;
  padding: 3px;
  background: var(--charcoal-100);
  border-radius: var(--radius-md);
}

.date-pill {
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--charcoal-600);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.date-pill.active {
  background: var(--brand-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(139, 29, 44, 0.32);
}

/* ==========================================================================
   FORMS (Multi-section clean style)
   ========================================================================== */
.form-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.form-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--charcoal-900);
  margin-bottom: 4px;
}

.form-section-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  align-items: start;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal-700);
  line-height: 1.3;
}

.form-label .required {
  color: var(--status-overdue-text);
  margin-left: 2px;
}

.form-group .form-select,
.form-group .form-input {
  width: 100%;
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
}

.input-prefix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-prefix {
  position: absolute;
  left: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal-500);
  pointer-events: none;
  z-index: 1;
}

.input-prefix-wrapper input {
  padding-left: 42px !important;
  width: 100%;
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
}

/* Enrollment Status Field Alignment in Student Modal */
#studStatusWrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

#studStatusWrapper .form-label {
  display: block;
}

#studStatusWrapper select.form-select,
#studStatus {
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   TABS
   ========================================================================== */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--charcoal-900);
}

.tab-btn.active {
  color: var(--brand-primary) !important;
  border-bottom: 2.5px solid var(--brand-primary) !important;
  background-color: var(--brand-tint);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-weight: 700;
}

/* ==========================================================================
   TIMELINE / RECENT ACTIVITY
   ========================================================================== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
}

.timeline-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand-tint);
  border: 1px solid var(--brand-subtle);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
}

.timeline-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal-800);
}

.timeline-time {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   MODAL DIALOGS (Modern <dialog> with backdrop blur)
   ========================================================================== */
dialog.modal-dialog {
  border: none;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-modal);
  padding: 0;
  max-width: 620px;
  width: 90vw;
  max-height: calc(100vh - 40px);
  margin: auto;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

dialog.modal-dialog:not([open]) {
  display: none !important;
}

dialog.modal-dialog form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}

dialog.modal-dialog.modal-lg {
  max-width: 820px;
}

dialog.modal-dialog::backdrop {
  background-color: rgba(21, 21, 21, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--charcoal-900);
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--charcoal-50);
  color: var(--charcoal-600);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(21, 21, 21, 0.05);
  line-height: 1;
}

.modal-close-btn svg {
  display: block;
  margin: auto;
  pointer-events: none;
  transition: transform var(--transition-fast), stroke var(--transition-fast);
}

.modal-close-btn:hover {
  background-color: var(--charcoal-900);
  color: var(--white);
  border-color: var(--charcoal-900);
  box-shadow: 0 4px 14px rgba(21, 21, 21, 0.2);
  transform: rotate(90deg);
}

.modal-close-btn:active {
  transform: rotate(90deg) scale(0.95);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--charcoal-50);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

/* ==========================================================================
   STUDENT WIZARD MODAL - 3 STEPS TABS & PROMINENT STYLING
   ========================================================================== */
dialog.modal-dialog.modal-prominent {
  max-width: 860px;
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 64px rgba(21, 21, 21, 0.22), 0 10px 24px rgba(21, 21, 21, 0.1);
  border: 1px solid var(--border-color);
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

dialog.modal-dialog.modal-prominent .modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

dialog.modal-dialog.modal-prominent .modal-footer {
  padding: 16px 28px;
  background-color: var(--charcoal-50);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-title-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-tint);
  border: 1px solid var(--brand-subtle);
  color: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}

/* Wizard Tabs Bar */
.student-wizard-nav,
.teacher-wizard-nav {
  display: flex;
  align-items: stretch;
  background: var(--charcoal-50);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  gap: 6px;
  flex-shrink: 0;
}

.wizard-nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
  text-align: left;
  flex: 1;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--text-secondary);
}

.wizard-nav-tab:hover {
  background: rgba(139, 29, 44, 0.08);
  color: var(--charcoal-900);
}

.wizard-nav-tab.active {
  background: var(--white);
  border-bottom-color: var(--brand-primary);
  color: var(--charcoal-900);
}

.wizard-nav-tab.completed {
  color: var(--charcoal-900);
}

.wizard-tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--charcoal-100);
  color: var(--charcoal-600);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.wizard-nav-tab.active .wizard-tab-icon {
  background: var(--brand-tint);
  color: var(--brand-dark);
  border: 1.5px solid var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 29, 44, 0.18);
}

.wizard-nav-tab.completed .wizard-tab-icon {
  background: var(--status-paid-bg);
  color: var(--status-paid-text);
  border: 1.5px solid var(--status-paid-border);
}

.wizard-tab-text {
  display: flex;
  flex-direction: column;
}

.wizard-tab-step {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.wizard-nav-tab.active .wizard-tab-step {
  color: var(--brand-dark);
}

.wizard-tab-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 2px;
}

.wizard-tab-divider {
  width: 1px;
  height: 28px;
  background: var(--border-color);
  align-self: center;
}

.wizard-step-panel {
  display: none;
  animation: stepFadeIn 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-step-panel.active {
  display: block;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Top Meta Cards: Student ID & Photo */
.student-top-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

@media (max-width: 640px) {
  .student-top-meta-grid {
    grid-template-columns: 1fr;
  }
  .student-wizard-nav,
  .teacher-wizard-nav {
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding: 6px 10px !important;
  }
  .wizard-tab-btn {
    flex: 0 0 auto !important;
    min-width: 130px !important;
    padding: 8px 10px !important;
  }
  .wizard-tab-divider {
    display: none !important;
  }
}

.photo-upload-card {
  background: var(--brand-tint);
  border: 1.5px dashed var(--brand-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition-fast);
}

.photo-upload-card:hover {
  border-color: var(--brand-primary);
}

.photo-preview-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  color: var(--brand-dark);
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.photo-upload-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.photo-upload-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal-900);
}

.photo-upload-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.photo-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.student-id-badge-card {
  background: #ffffff;
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.student-id-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.student-id-val-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.student-id-val-display {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-dark);
  font-family: monospace, inherit;
  background: var(--brand-tint);
  border: 1px solid var(--brand-subtle);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.student-id-status-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--status-paid-text);
  background: var(--status-paid-bg);
  border: 1px solid var(--status-paid-border);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.modal-footer-wizard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.wizard-footer-left,
.wizard-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-note-box {
  background: var(--brand-tint);
  border: 1px solid var(--brand-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.info-note-icon {
  color: var(--brand-dark);
  flex-shrink: 0;
  margin-top: 2px;
}

.info-note-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal-900);
}

.info-note-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: 2px;
}


/* Empty State Widget */
.empty-state {
  text-align: center;
  padding: 42px 20px;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--charcoal-100);
  color: var(--charcoal-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--charcoal-800);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 16px;
}

/* ==========================================================================
   PRINTABLE RECEIPT & SALARY SLIP STYLES
   Logo at top: Existing academy logo ONLY. No text beside it.
   ========================================================================== */
.printable-doc {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  color: #000000;
}

.receipt-header-branding {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--charcoal-900);
}

.receipt-logo {
  max-height: 56px;
  max-width: 280px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
}

.receipt-doc-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  margin-top: 6px;
}

.receipt-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--charcoal-200);
}

.receipt-meta-label {
  font-weight: 600;
  color: var(--charcoal-600);
}

.receipt-meta-value {
  font-weight: 700;
  color: #000;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.receipt-table th, .receipt-table td {
  border: 1px solid #ddd;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
}

.receipt-table th {
  background-color: #f7f7f7;
  font-weight: 700;
}

.receipt-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
}

.signature-box {
  width: 180px;
  text-align: center;
  border-top: 1px solid #333;
  padding-top: 6px;
  font-size: 12px;
  font-weight: 600;
}

.receipt-footer-text {
  margin-top: 28px;
  text-align: center;
  font-size: 11px;
  color: var(--charcoal-500);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: var(--charcoal-900);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--brand-primary);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   PRINT MEDIA RULES
   ========================================================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .sidebar, .top-header, .page-header, .btn, .filter-toolbar, .toast, .no-print {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .page-content {
    padding: 0 !important;
  }
  .printable-doc {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
  }
  dialog.modal-dialog {
    position: static !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
  }
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */
/* ==========================================================================
   MOBILE DRAWER BACKDROP & DRAWER CLOSE BUTTON
   ========================================================================== */
.mobile-drawer-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--charcoal-50);
  color: var(--charcoal-700);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-close-btn:hover {
  background: var(--charcoal-900);
  color: var(--white);
  border-color: var(--charcoal-900);
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   NATIVE-FEEL MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + var(--sab));
  padding-bottom: var(--sab);
  background: var(--white);
  border-top: 1px solid var(--border-color);
  z-index: 995;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
  user-select: none;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  border: none;
  background: none;
  color: var(--charcoal-500);
  cursor: pointer;
  padding: 6px 0;
  position: relative;
  transition: all 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
  margin-bottom: 2px;
  transition: transform 0.16s ease, stroke 0.16s ease;
}

.mobile-nav-item span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.1;
}

.mobile-nav-item:active {
  transform: scale(0.94);
}

.mobile-nav-item.active {
  color: var(--brand-primary);
}

.mobile-nav-item.active svg {
  transform: translateY(-2px);
  stroke-width: 2.3;
}

.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 3px;
  background: var(--brand-primary);
  border-radius: 0 0 3px 3px;
}

/* Dark Theme overrides for Mobile Nav */
[data-theme="dark"] .mobile-bottom-nav {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .mobile-nav-item {
  color: var(--charcoal-400);
}

[data-theme="dark"] .mobile-nav-item.active {
  color: var(--brand-subtle);
}

[data-theme="dark"] .mobile-nav-item.active::after {
  background: var(--brand-subtle);
}

[data-theme="dark"] .mobile-drawer-close-btn {
  background: var(--bg-elevated);
  color: var(--charcoal-200);
  border-color: var(--border-color);
}

/* ==========================================================================
   FLUID RESPONSIVE CONTENT GRIDS
   ========================================================================== */
.dashboard-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.slip-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.classes-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.responsive-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.profile-banner-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.profile-fee-highlights {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--charcoal-50);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.teacher-salary-highlight {
  background: var(--charcoal-50);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  text-align: right;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Mobile & Tablet)
   ========================================================================== */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-content-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .settings-layout-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 768px) {
  /* Native App Shell */
  body {
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .app-container {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .main-wrapper,
  .sidebar.collapsed ~ .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding-bottom: calc(76px + var(--sab)) !important;
    overflow-x: hidden;
  }

  /* Slide-over Drawer Sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 84vw;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar .collapse-btn {
    display: none;
  }

  .mobile-drawer-close-btn {
    display: inline-flex;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--charcoal-50);
    color: var(--charcoal-800);
    cursor: pointer;
  }

  /* Compact Touch Header */
  .top-header {
    padding: 0 12px;
    height: 60px;
  }

  .header-left {
    gap: 8px;
  }

  .header-right {
    gap: 8px;
  }

  .page-content {
    padding: 12px 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  .card {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .card-body {
    padding: 14px 12px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .dashboard-content-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .profile-overview-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .settings-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .slip-tables-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .classes-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .responsive-card-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }

  .profile-banner-body {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  .profile-fee-highlights {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
    width: 100% !important;
  }

  .teacher-salary-highlight {
    text-align: left !important;
    width: 100% !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Header Controls on Mobile */
  .global-search-trigger {
    min-width: unset;
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }

  .global-search-trigger span,
  .global-search-trigger kbd {
    display: none;
  }

  .db-status-pill {
    padding: 4px 8px;
    font-size: 11px;
  }

  .user-role-display-pill {
    padding: 4px 10px;
    font-size: 11.5px;
  }

  /* Responsive Page Headers & Action Bars */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-header .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .page-header .page-actions .btn {
    flex: 1 1 auto;
    min-height: 42px;
    justify-content: center;
  }

  /* Touch-Optimized Statistics Cards */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  /* Search & Filter Toolbar */
  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-toolbar .search-input-wrapper {
    max-width: 100%;
    width: 100%;
  }

  .filter-toolbar .filter-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  /* Form & Input Touch Optimization (iOS Zoom Prevention) */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  input,
  select,
  textarea,
  .form-input,
  .form-select {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* Tables: Momentum Touch Scroll */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  .table-actions {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
  }

  .table-actions .btn {
    min-width: 34px;
    min-height: 34px;
    padding: 6px 8px;
  }

  /* Full Screen App Sheet Dialogs on Mobile */
  dialog.modal-dialog,
  dialog.modal-dialog.modal-lg,
  dialog.modal-dialog.modal-prominent {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border: none !important;
  }

  dialog.modal-dialog .modal-header {
    padding: 12px 16px;
    min-height: 52px;
  }

  dialog.modal-dialog .modal-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  dialog.modal-dialog .modal-footer {
    padding: 12px 16px calc(12px + var(--sab)) 16px;
    flex-direction: column-reverse;
    gap: 8px;
    width: 100%;
  }

  dialog.modal-dialog .modal-footer .btn {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
    font-weight: 600;
    justify-content: center;
  }

  /* Compact Centered Confirmation & Small Modals */
  dialog#confirmModal,
  dialog#changePasswordModal {
    width: calc(100vw - 28px) !important;
    max-width: 440px !important;
    height: auto !important;
    max-height: 90vh !important;
    border-radius: 18px !important;
    margin: auto !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
  }

  /* Wizard Steps & Navigation Tabs */
  .student-wizard-nav,
  .teacher-wizard-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 4px 0 8px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .wizard-nav-step {
    flex-shrink: 0;
    min-width: 110px;
    padding: 8px 10px;
  }

  .nav-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 6px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 2px;
  }

  .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  .breadcrumbs {
    display: none;
  }

  .top-header {
    padding: 0 10px;
  }

  /* Hide textual user info to fit small phone header */
  .user-name-text,
  .user-role-text,
  #roleSwitchHint {
    display: none !important;
  }

  .user-profile-btn {
    padding: 4px;
    gap: 4px;
  }

  .db-status-pill .db-status-text {
    display: none;
  }

  .db-status-pill {
    padding: 6px;
    min-width: unset;
  }

  .filter-toolbar .filter-group {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .responsive-card-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .profile-fee-highlights {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .stat-card {
    padding: 12px 10px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-title {
    font-size: 11.5px;
  }

  .login-card-container {
    border-radius: 12px;
  }

  .login-screen-overlay {
    padding: 12px;
  }
}

/* ==========================================================================
   SUPABASE CLOUD DB STATUS PILL
   ========================================================================== */
.db-status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--charcoal-50);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--charcoal-700);
  user-select: none;
  transition: all var(--transition-fast);
}

.db-status-pill:hover {
  background: var(--charcoal-100);
}

.db-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f59e0b;
  flex-shrink: 0;
}

.db-status-dot.connected {
  background-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.db-status-dot.syncing {
  background-color: #3b82f6;
  animation: pulseDot 0.8s infinite alternate;
}

.db-status-dot.error {
  background-color: #ef4444;
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

/* Icon-only Action Button (Class Card Edit etc.) */
.icon-btn-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--charcoal-700);
  border: 1px solid var(--border-color);
  background: var(--white);
  transition: all var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn-action:hover {
  background-color: var(--charcoal-50);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   AUTHENTICATION & USER ROLE DISPLAY STYLES
   ========================================================================== */

/* Header Role Display Pill (Read-only, no switcher) */
.user-role-display-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  user-select: none;
}

[data-theme="dark"] .user-role-display-pill {
  background: rgba(139, 29, 44, 0.2);
  border-color: rgba(240, 184, 190, 0.2);
  color: #fca5a5;
}

/* Fullscreen Clean White Login Screen Overlay (No Color Gradient) */
.login-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

[data-theme="dark"] .login-screen-overlay {
  background: #0B0F14;
}

.login-card-container {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
  animation: loginSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1 Solid Color Top Border */
.login-card-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--brand-primary, #8B1D2C);
  z-index: 2;
}

[data-theme="dark"] .login-card-container {
  background: #171F2D;
  border-color: #293447;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
}

@keyframes loginSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-brand-header {
  padding: 32px 28px 18px 28px;
  text-align: center;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

[data-theme="dark"] .login-brand-header {
  background: #171F2D;
  border-bottom-color: #293447;
}

.login-logo-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-bottom: 14px;
}

[data-theme="dark"] .login-logo-wrapper {
  background: #111722;
  border-color: #293447;
}

.login-brand-logo {
  max-height: 48px;
  width: auto;
  object-fit: contain;
}

.login-brand-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--charcoal-900, #141414);
  margin: 0 0 4px 0;
  letter-spacing: -0.3px;
}

[data-theme="dark"] .login-brand-title {
  color: #F1F5F9;
}

.login-brand-subtitle {
  font-size: 12.5px;
  color: var(--text-muted, #64748b);
  font-weight: 500;
  letter-spacing: 0.1px;
}

/* 2 Role Tabs */
.login-role-tabs-wrapper {
  padding: 16px 28px 0 28px;
}

.login-role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  border: 1px solid #e2e8f0;
}

[data-theme="dark"] .login-role-tabs {
  background: #111722;
  border-color: #293447;
}

.login-role-tab {
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.18s ease;
  user-select: none;
}

.login-role-tab:hover:not(.active) {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .login-role-tab {
  color: #94A3B8;
}

[data-theme="dark"] .login-role-tab:hover:not(.active) {
  color: #F1F5F9;
  background: #1D2737;
}

[data-theme="dark"] .login-input {
  background-color: #111722 !important;
  border-color: #293447 !important;
  color: #F1F5F9 !important;
}

[data-theme="dark"] .login-input:focus {
  border-color: #E11D48 !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.22) !important;
}

/* Tab active: Solid 1 Color (No gradient) */
.login-role-tab.active {
  background: var(--brand-primary, #8B1D2C);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(139, 29, 44, 0.25);
}

.login-card-body {
  padding: 22px 28px 28px 28px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--charcoal-400, #94a3b8);
  pointer-events: none;
}

.login-input {
  padding-left: 38px !important;
  padding-right: 40px !important;
  height: 44px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.login-input:focus {
  border-color: var(--brand-primary, #8B1D2C);
  box-shadow: 0 0 0 3px rgba(139, 29, 44, 0.12);
}

.login-toggle-eye {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  padding: 4px;
  color: var(--charcoal-400, #94a3b8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.login-toggle-eye:hover {
  color: var(--charcoal-800, #1e293b);
}

/* Submit button: Solid 1 Color (No gradient) */
.login-btn-submit {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  background: var(--brand-primary, #8B1D2C);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(139, 29, 44, 0.25);
  cursor: pointer;
  transition: all 0.18s ease;
}

.login-btn-submit:hover {
  background: #711422;
  box-shadow: 0 6px 18px rgba(139, 29, 44, 0.35);
  transform: translateY(-1px);
}

.login-btn-submit:active {
  transform: translateY(0);
}

.login-alert-box {
  padding: 10px 14px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Clickable Role Switch Pill (Super Admin only) */
.user-role-display-pill.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-role-display-pill.clickable:hover {
  background: rgba(139, 29, 44, 0.12);
  border-color: var(--brand-subtle, #f0b8be);
  transform: translateY(-1px);
}

/* Permission Toggle Cards and Switch Controls */
.perm-toggle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  transition: border-color 0.15s ease;
}

.perm-toggle-card:hover {
  border-color: var(--charcoal-300, #cbd5e1);
}

.perm-toggle-info {
  flex: 1;
  padding-right: 14px;
}

.perm-toggle-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--charcoal-900, #1e293b);
}

.perm-toggle-desc {
  font-size: 11.5px;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
  line-height: 1.35;
}

/* Toggle Switch Slider */
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-control input:checked + .switch-slider {
  background-color: var(--brand-primary, #8B1D2C);
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* Avatar Image Fill */
.avatar-circle img,
#headerAvatarCircle img,
#myProfileAvatarPreview img,
#manageAdminAvatarPreview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ==========================================================================
   CLASS HOMEWORK DIARY STYLES
   ========================================================================== */
.diary-controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.diary-controls-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.diary-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.diary-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--charcoal-50);
  color: var(--charcoal-700);
  cursor: pointer;
  transition: all 0.15s ease;
}

.diary-nav-btn:hover {
  background: var(--charcoal-900);
  color: var(--white);
  border-color: var(--charcoal-900);
}

.diary-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.diary-status-pill.status-draft {
  background: var(--charcoal-100);
  color: var(--charcoal-700);
  border: 1px solid var(--charcoal-300);
}

.diary-status-pill.status-saved {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.diary-status-pill.status-sent {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.diary-status-pill.status-edited {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.btn-whatsapp {
  background: #25D366;
  border-color: #20ba5a;
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-whatsapp:hover {
  background: #1eb857;
  border-color: #179e49;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.btn-diary-sent {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-diary-sent:hover {
  background: #059669 !important;
  border-color: #047857 !important;
}

.btn-diary-edited {
  background: #f59e0b !important;
  border-color: #d97706 !important;
  color: #ffffff !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Subjects Grid */
.diary-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.diary-subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.diary-subject-card:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 4px 14px rgba(139, 29, 44, 0.08);
}

.diary-subject-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.diary-subject-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diary-subject-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.diary-subject-name {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--charcoal-900);
}

.urdu-sub-badge {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(110, 147, 66, 0.12);
  color: #4b6b28;
  font-weight: 600;
  direction: rtl;
}

.diary-textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-main);
  background: var(--bg-input);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.diary-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(139, 29, 44, 0.12);
}

.diary-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-btn {
  background: var(--charcoal-100);
  border: 1px solid var(--charcoal-200);
  color: var(--charcoal-700);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.chip-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

/* Parent Note Card */
.diary-parent-note-card {
  background: #fffcf8;
  border: 1.5px solid #fed7aa;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.diary-parent-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.diary-parent-note-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #9a3412;
}

/* Printable Diary Sheet Styles (Used for Preview & html2pdf generation) */
.printable-diary-sheet {
  background: #ffffff;
  color: #111827;
  max-width: 800px;
  margin: 0 auto;
  padding: 28px 32px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  line-height: 1.45;
}

.diary-sheet-brand {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2.5px solid #8B1D2C;
  margin-bottom: 16px;
}

.diary-sheet-logo {
  max-height: 72px;
  max-width: 260px;
  object-fit: contain;
  margin: 0 auto 10px;
  display: block;
}

.diary-sheet-school-name {
  font-size: 20px;
  font-weight: 800;
  color: #8B1D2C;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.diary-sheet-school-sub {
  font-size: 11.5px;
  color: #4b5563;
  margin: 0 0 10px;
}

.diary-sheet-doc-badge {
  display: inline-block;
  background: #8B1D2C;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 20px;
  border-radius: 20px;
}

.diary-meta-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 12.5px;
}

.diary-meta-item {
  display: flex;
  flex-direction: column;
}

.diary-meta-lbl {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.diary-meta-val {
  font-weight: 800;
  color: #0f172a;
  font-size: 13.5px;
  margin-top: 2px;
}

.diary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.diary-table th,
.diary-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
  font-size: 12.5px;
  vertical-align: top;
}

.diary-table th {
  background: #f1f5f9;
  font-weight: 800;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11.5px;
}

.diary-table .sub-col {
  width: 160px;
  font-weight: 700;
  color: #8B1D2C;
}

.diary-table .task-col {
  color: #1e293b;
  line-height: 1.5;
}

.diary-sheet-parent-note {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-left: 5px solid #d97706;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 24px;
}

.diary-sheet-note-title {
  font-weight: 800;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diary-sheet-note-text {
  font-size: 12.5px;
  color: #451a03;
  line-height: 1.45;
}

.diary-sheet-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
  padding-top: 14px;
}

.diary-sig-box {
  border-top: 1.5px dashed #94a3b8;
  padding-top: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.diary-sheet-footer-notice {
  margin-top: 24px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
  font-size: 10.5px;
  color: #64748b;
  font-style: italic;
}

/* WhatsApp Modal Layout */
.wa-message-preview-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  color: #14532d;
  max-height: 220px;
  overflow-y: auto;
  line-height: 1.55;
  margin-bottom: 16px;
}

.wa-parent-contacts-table {
  width: 100%;
  border-collapse: collapse;
}

.wa-parent-contacts-table th,
.wa-parent-contacts-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
}

.wa-parent-contacts-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #475569;
}

@media print {
  .printable-diary-sheet {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
}



