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

:root {
  /* Color Palette */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #6366f1; /* Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #a855f7; /* Purple */
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-focus: rgba(99, 102, 241, 0.4);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.15);

  /* Layout Variables */
  --sidebar-width: 260px;
  --header-height: 70px;
  --border-radius: 12px;
  --transition-speed: 0.25s;
}

:root[data-theme="blue"] { --theme-primary: #3767d6; --theme-primary-hover: #2855bf; --theme-soft: #e8efff; }
:root[data-theme="emerald"] { --theme-primary: #078b68; --theme-primary-hover: #057254; --theme-soft: #e3f7f0; }
:root[data-theme="violet"] { --theme-primary: #7046c5; --theme-primary-hover: #5a35a7; --theme-soft: #f0eaff; }
:root[data-theme="amber"] { --theme-primary: #b86b00; --theme-primary-hover: #965600; --theme-soft: #fff1d6; }
:root[data-theme="rose"] { --theme-primary: #c43d68; --theme-primary-hover: #a62d55; --theme-soft: #ffe8ef; }
:root[data-theme="slate"] { --theme-primary: #365b78; --theme-primary-hover: #27445b; --theme-soft: #e7f0f6; }
:root[data-theme="blue"] { --theme-secondary: #53b8ff; --theme-success: #0eaa76; --theme-highlight: #eef4ff; }
:root[data-theme="emerald"] { --theme-secondary: #36c995; --theme-success: #078b68; --theme-highlight: #e8fbf4; }
:root[data-theme="violet"] { --theme-secondary: #a179ed; --theme-success: #159a81; --theme-highlight: #f3efff; }
:root[data-theme="amber"] { --theme-secondary: #f0a83a; --theme-success: #b86b00; --theme-highlight: #fff6e6; }
:root[data-theme="rose"] { --theme-secondary: #f184a3; --theme-success: #c43d68; --theme-highlight: #fff0f4; }
:root[data-theme="slate"] { --theme-secondary: #74a7c9; --theme-success: #287f73; --theme-highlight: #edf4f8; }
:root[data-theme] { --accent-primary: var(--theme-primary); --accent-primary-hover: var(--theme-primary-hover); --accent-secondary: var(--theme-secondary); --accent-success: var(--theme-success); }

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Page Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Layout */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  transition: all var(--transition-speed) ease;
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-menu {
  flex: 1;
  padding: 24px 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.sidebar-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition-speed) ease;
}

.sidebar-item a:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sidebar-group-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-speed) ease;
}

.sidebar-section-label.collapsed .sidebar-group-toggle svg {
  transform: rotate(-90deg);
}

.sidebar-subitem a {
  padding-left: 42px !important;
  font-size: 0.9rem;
}

.sidebar-item.active a {
  background-color: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.user-profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--border-radius);
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-primary);
  border: 2px solid var(--accent-primary);
}

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

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
}

.btn-logout:hover {
  background-color: var(--accent-danger);
  color: white;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  transition: all var(--transition-speed) ease;
}

/* Header */
.main-header {
  height: var(--header-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.mobile-menu-toggle,
.sidebar-overlay {
  display: none;
}

.page-title h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  margin-left: auto;
  margin-right: 12px;
}
.header-search-btn:hover {
  border-color: var(--theme-primary, var(--accent-primary));
  color: var(--text-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary, var(--accent-primary)) 12%, transparent);
}
.header-search-btn svg {
  width: 15px;
  height: 15px;
  color: var(--theme-primary, var(--accent-primary));
}
.header-search-kbd {
  display: inline-flex;
  align-items: center;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  letter-spacing: 0.05em;
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  flex-shrink: 0;
}
.header-icon-btn:hover {
  background: var(--theme-soft);
  color: var(--theme-primary);
  border-color: color-mix(in srgb, var(--theme-primary) 30%, transparent);
  transform: translateY(-1px);
}
.header-icon-btn svg {
  width: 16px;
  height: 16px;
}

.header-academic-year { display: flex; align-items: center; gap: 7px; padding: 7px 11px; background: var(--theme-soft); border: 1px solid color-mix(in srgb, var(--theme-primary) 16%, transparent); border-radius: 8px; color: var(--text-secondary); font-size: .68rem; }
.header-academic-year svg { width: 15px; color: var(--theme-primary); }
.header-academic-year span { white-space: nowrap; }
.header-academic-year select { min-width: 92px; padding: 2px 20px 2px 4px; border: 0; background: transparent; color: var(--theme-primary); font-size: .72rem; font-weight: 800; cursor: pointer; }
.header-academic-year select:disabled { cursor: default; opacity: .9; }
.header-academic-year.is-unset { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }
.header-academic-year.is-unset svg, .header-academic-year.is-unset select { color: var(--accent-warning); }

/* Main Content Panel */
.content-body {
  padding: 32px;
  flex: 1;
}

.theme-settings-card { max-width: 680px; margin-top: 20px; }
.theme-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.theme-option { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 13px; border: 2px solid var(--border-color); border-radius: 10px; background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; text-align: left; }
.theme-option:hover, .theme-option[aria-checked="true"] { border-color: var(--theme-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 15%, transparent); }
.theme-swatches { display: flex; width: 100%; height: 30px; gap: 4px; }
.theme-swatches i { flex: 1; border-radius: 6px; background: var(--option-color); }
.theme-swatches i:nth-child(2) { background: var(--option-secondary); }
.theme-swatches i:nth-child(3) { background: var(--option-soft); }
.theme-option b { font-size: .82rem; }
.theme-option small { color: var(--text-secondary); font-size: .68rem; }
.theme-blue { --option-color: #3767d6; --option-secondary: #53b8ff; --option-soft: #eef4ff; }
.theme-emerald { --option-color: #078b68; --option-secondary: #36c995; --option-soft: #e8fbf4; }
.theme-violet { --option-color: #7046c5; --option-secondary: #a179ed; --option-soft: #f3efff; }
.theme-amber { --option-color: #b86b00; --option-secondary: #f0a83a; --option-soft: #fff6e6; }
.theme-rose { --option-color: #c43d68; --option-secondary: #f184a3; --option-soft: #fff0f4; }
.theme-slate { --option-color: #365b78; --option-secondary: #74a7c9; --option-soft: #edf4f8; }
.mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mode-option { display: grid; grid-template-columns: 38px 1fr; align-items: center; column-gap: 10px; padding: 13px; border: 2px solid var(--border-color); border-radius: 10px; background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; text-align: left; }
.mode-option:hover, .mode-option[aria-checked="true"] { border-color: var(--theme-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 15%, transparent); }
.mode-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: var(--theme-primary); background: var(--theme-soft); }
.mode-icon svg { width: 19px; height: 19px; }
.mode-option b { font-size: .82rem; }.mode-option small { color: var(--text-secondary); font-size: .68rem; }

/* Dashboard overview */
.dashboard-hero {
  align-items: flex-end;
  background:
    radial-gradient(circle at 88% 20%, rgba(56, 189, 248, 0.18), transparent 28%),
    linear-gradient(120deg, #172554 0%, #1e293b 52%, #164e63 100%);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.22);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  overflow: hidden;
  padding: 28px 30px;
  position: relative;
}

.dashboard-hero::after {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: '';
  height: 210px;
  position: absolute;
  right: 7%;
  top: -130px;
  width: 210px;
}

.dashboard-hero h2 {
  font-size: clamp(1.65rem, 2.5vw, 2.25rem);
  letter-spacing: -0.04em;
  margin: 9px 0 8px;
  position: relative;
  z-index: 1;
}

.dashboard-hero p {
  color: #cbd5e1;
  font-size: 0.92rem;
  max-width: 620px;
  position: relative;
  z-index: 1;
}

.dashboard-eyebrow {
  align-items: center;
  color: #7dd3fc;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 7px;
  letter-spacing: 0.12em;
  position: relative;
  text-transform: uppercase;
  z-index: 1;
}

.dashboard-hero-meta {
  align-items: flex-end;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  gap: 7px;
  min-width: 90px;
  position: relative;
  z-index: 1;
}

.dashboard-hero-meta strong { color: #f8fafc; font-size: 1rem; }
.dashboard-live-dot { background: #34d399; border-radius: 50%; box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.12); height: 8px; width: 8px; }
.dashboard-kpis .card,
.dashboard-finance-kpis .card { border-top: 2px solid rgba(125, 211, 252, 0.22); }
.dashboard-kpis .stat-value { font-size: 2.15rem; }
.dashboard-panel { overflow: hidden; }
.dashboard-panel-fees { border-color: rgba(34, 197, 94, 0.18); }
.dashboard-panel-attendance { border-color: rgba(52, 211, 153, 0.18); }
.dashboard-panel-inquiries { border-color: rgba(168, 85, 247, 0.18); }
.dashboard-lower-charts { grid-template-columns: 1.15fr 0.9fr 0.9fr; }
.dashboard-activity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Cards System */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.stat-icon.secondary { background: rgba(168, 85, 247, 0.15); color: var(--accent-secondary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }

/* Common Layout Elements */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 600;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background-color: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.badge-warning { background-color: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.badge-info { background-color: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-danger {
  background-color: var(--accent-danger);
  color: white;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn var(--transition-speed) ease;
}

.modal-content-lg {
  max-width: 1080px;
}

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

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Forms styling */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-speed) ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Grid helper for forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.form-section {
  padding: 4px 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}

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

.form-section h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.toggle-row {
  min-height: 41px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--accent-primary);
  color: var(--text-primary);
  padding: 16px 20px;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  min-width: 280px;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left-color: var(--accent-success); }
.toast.danger { border-left-color: var(--accent-danger); }
.toast.warning { border-left-color: var(--accent-warning); }

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

/* Chart container */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .dashboard-hero-meta {
    align-items: flex-start;
    flex-direction: row;
    min-width: 0;
  }

  .dashboard-hero-meta strong { margin-left: auto; }

  .dashboard-finance-kpis {
    grid-template-columns: 1fr;
  }

  .dashboard-lower-charts,
  .dashboard-activity-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .form-grid,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 96%;
  }
}

.chart-card {
  height: 380px;
}

.inquiry-report-card {
  margin-bottom: 32px;
}

.inquiry-report-header {
  align-items: center;
  margin-bottom: 20px;
}

.report-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 5px;
}

.inquiry-report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.inquiry-report-stats div {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
}

.inquiry-report-stats span {
  color: var(--text-secondary);
  display: block;
  font-size: 0.75rem;
}

.inquiry-report-stats strong {
  display: block;
  font-size: 1.45rem;
  margin-top: 6px;
}

.inquiry-report-charts {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 2fr);
  gap: 24px;
}

.inquiry-report-chart h4 {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.inquiry-report-chart > div {
  height: 220px;
  position: relative;
}

@media (max-width: 720px) {
  .inquiry-report-stats,
  .inquiry-report-charts {
    grid-template-columns: 1fr 1fr;
  }

  .inquiry-report-header {
    align-items: flex-start;
  }
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

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

.report-section-card {
  align-items: center;
  display: flex;
  gap: 16px;
  min-height: 130px;
  transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.report-fee-card.full-width {
  grid-column: 1 / -1;
}

.report-section-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

.report-section-icon {
  align-items: center;
  background: rgba(99, 102, 241, 0.14);
  border-radius: 12px;
  color: var(--accent-primary);
  display: flex;
  flex-shrink: 0;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.report-section-content {
  flex: 1;
}

.report-section-content span,
.report-section-content small {
  color: var(--text-secondary);
  display: block;
}

.report-section-content strong {
  display: block;
  font-size: 1.8rem;
  margin: 4px 0;
}

.report-section-content small {
  font-size: 0.75rem;
}

.report-arrow {
  color: var(--text-muted);
}

.report-error {
  color: var(--accent-danger);
}

.report-fee-card {
  margin-top: 20px;
  padding: 24px;
  width: 100%;
}

.report-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 18px 0 20px;
}

.report-metric-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 14px;
  padding: 16px 18px;
}

.report-metric-box.success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

.report-metric-box.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.report-metric-box.info {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.2);
}

.report-metric-box span {
  color: var(--text-secondary);
  display: block;
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.report-metric-box strong {
  font-size: 1.35rem;
}

.report-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.report-panel {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
}

.report-panel h4 {
  margin: 0 0 12px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.report-table th,
.report-table td {
  border-bottom: 1px solid var(--border-color);
  padding: 10px 8px;
  text-align: left;
}

.report-table th {
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.tc-panel {
  margin-bottom: 24px;
}

.tc-print-document {
  background: #fff;
  color: #111827;
  margin: 24px auto;
  max-width: 850px;
  min-height: 900px;
  padding: 56px;
}

.tc-heading {
  border-bottom: 2px solid #111827;
  margin-bottom: 36px;
  padding-bottom: 18px;
  text-align: center;
}

.tc-heading h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.tc-heading h2 {
  font-size: 1.35rem;
  letter-spacing: 2px;
}

.tc-details {
  border: 1px solid #cbd5e1;
  display: grid;
  gap: 0 32px;
  grid-template-columns: 1fr 1fr;
  padding: 22px;
}

.tc-details p {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 0;
}

.tc-declaration {
  line-height: 1.8;
  margin-top: 42px;
}

.tc-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 130px;
}

.tc-signatures span {
  border-top: 1px solid #111827;
  min-width: 150px;
  padding-top: 10px;
  text-align: center;
}

.month-checkbox-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}

.student-fee-profile {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: 8px;
  background: var(--bg-primary);
}

.student-fee-profile div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.student-fee-profile span {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.student-fee-profile strong {
  color: var(--text-primary);
}

.professional-receipt {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.receipt-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--accent-primary);
  color: white;
}

.receipt-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--accent-primary);
  font-size: 24px;
  font-weight: 800;
}

.receipt-brand h2,
.receipt-brand p {
  margin: 0;
}

.receipt-brand p {
  margin-top: 4px;
  font-size: 0.8rem;
  opacity: 0.85;
}

.receipt-number {
  margin-left: auto;
  text-align: right;
}

.receipt-number span,
.receipt-meta span,
.receipt-amounts span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.receipt-number span {
  color: #d1fae5;
}

.receipt-number strong,
.receipt-meta strong,
.receipt-amounts strong {
  display: block;
  margin-top: 4px;
}

.receipt-meta,
.receipt-amounts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.receipt-amounts {
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-primary);
}

@media (max-width: 700px) {
  .receipt-amounts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.receipt-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-align: center;
}

@media (max-width: 800px) {
  .student-fee-profile {
    grid-template-columns: repeat(2, 1fr);
  }
}

.theme-settings-card .section-title { color: var(--text-primary); }
@media (max-width: 700px) {
  .theme-options { grid-template-columns: repeat(2, 1fr); }
}

/* Reference-style admin dashboard */
  body.dashboard-page {
    --bg-primary: #f6f8fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef2f8;
    --text-primary: #1f2a44;
    --text-secondary: #6f7d98;
    --text-muted: #9aa6bb;
    --border-color: #e8edf5;
    --shadow-sm: 0 2px 8px rgba(31, 42, 68, 0.05);
    background: #f6f8fc;
    color: #1f2a44;
  }

  .dashboard-page .sidebar {
    background: #fff;
    border-right: 1px solid #e9edf5;
    width: 230px;
  }
  .dashboard-page .sidebar-brand { height: 58px; padding: 0 16px; border-bottom: 1px solid #edf0f6; }
  .dashboard-page .brand-icon { width: 28px; height: 28px; border-radius: 7px; font-size: .9rem; background: linear-gradient(135deg, #4b6ff0, #53b8ff); }
  .dashboard-page .brand-name { color: #253457; background: none; -webkit-text-fill-color: initial; font-size: .95rem; }
  .dashboard-page .sidebar-menu { padding: 16px 12px; gap: 5px; }
  .dashboard-page .sidebar-item a { color: #5f6d87; font-size: .86rem; padding: 11px 12px; border-radius: 7px; gap: 10px; }
  .dashboard-page .sidebar-item a svg { width: 16px; height: 16px; }
  .dashboard-page .sidebar-item.active a { background: var(--theme-soft); color: var(--theme-primary); box-shadow: none; font-weight: 700; }
  .dashboard-page .sidebar-item a:hover { background: var(--theme-soft); color: var(--theme-primary); }
  .dashboard-page .sidebar-section-label {
    color: #a3aec1;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 18px 10px 6px;
    text-transform: uppercase;
  }
  .dashboard-page .sidebar-group-toggle { min-height: 30px; color: #52617d; }
  .dashboard-page .sidebar-group-toggle svg { width: 16px; height: 16px; }
  .dashboard-page .sidebar-footer { padding: 10px; border-top: 1px solid #edf0f6; }
  .dashboard-page .user-profile-summary { margin-bottom: 8px; padding: 4px; gap: 8px; }
  .dashboard-page .user-avatar { width: 28px; height: 28px; border: 0; background: #eaf0ff; color: #4b6ff0; font-size: .75rem; }
  .dashboard-page .user-name { color: #34415c; font-size: .7rem; }
  .dashboard-page .user-role { color: #9aa6bb; font-size: .62rem; }
  .dashboard-page .btn-logout { padding: 7px; font-size: .7rem; border-radius: 6px; }
  .dashboard-page .main-wrapper { margin-left: 230px; }
  .dashboard-page .main-header { height: 58px; background: #fff; border-bottom: 1px solid #e9edf5; padding: 0 20px; }
  .dashboard-page .page-title h1 { font-size: 1.05rem; color: #1c2944; }
  .dashboard-page .header-actions { font-size: .72rem !important; }
  .dashboard-page .header-actions .badge { background: #eef2ff; color: #4767dd; }
  .dashboard-content { padding: 18px 20px 28px; max-width: 1600px; }
  .dashboard-report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
  .dashboard-primary-column { min-width: 0; }
  .dashboard-right-rail { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; }
  .dashboard-rail-heading { display: flex; align-items: center; justify-content: space-between; padding: 2px 3px 4px; }
  .dashboard-rail-heading span { display: block; color: #9aa6bb; font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
  .dashboard-rail-heading h2 { margin-top: 3px; color: #2d3a58; font-size: 1rem; }
  .dashboard-rail-heading > svg { width: 19px; color: #4d6fe8; }
  .dashboard-rail-card { padding: 14px; background: #fff; border: 1px solid #e8edf5; border-radius: 8px; box-shadow: 0 2px 7px rgba(35, 55, 90, .035); }
  .dashboard-rail-card header { display: flex; align-items: center; justify-content: space-between; color: #52617d; font-size: .72rem; font-weight: 800; }
  .dashboard-rail-card header svg { width: 16px; height: 16px; color: #4d6fe8; }
  .dashboard-rail-card > strong { display: block; margin-top: 12px; color: #2d3a58; font-size: 1.45rem; }
  .dashboard-rail-card > p { margin-top: 3px; color: #9aa6bb; font-size: .66rem; }
  .dashboard-rail-card > a { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; color: #4d6fe8; font-size: .64rem; font-weight: 700; }
  .dashboard-rail-card > a svg { width: 12px; }
  .rail-progress { height: 6px; margin-top: 12px; overflow: hidden; background: #edf1f7; border-radius: 10px; }
  .rail-progress span { display: block; width: 0; height: 100%; background: #34b96b; border-radius: inherit; transition: width .5s ease; }
  .rail-split, .rail-fee-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: #8d99ae; font-size: .64rem; }
  .rail-split b, .rail-fee-row b { color: #35425e; }
  .rail-fee-row { padding-top: 8px; border-top: 1px solid #f0f2f7; }
  .rail-activity-list { margin-top: 11px; }
  .rail-activity-item { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 9px 0; border-top: 1px solid #f0f2f7; }
  .rail-activity-item:first-child { border-top: 0; }
  .rail-activity-item > span:nth-child(2) { min-width: 0; }
  .rail-activity-item b, .rail-activity-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-activity-item b { color: #35425e; font-size: .66rem; }
  .rail-activity-item small { margin-top: 3px; color: #9aa6bb; font-size: .58rem; }
  .rail-activity-item > strong { color: #27a96a; font-size: .64rem; white-space: nowrap; }
  .rail-activity-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 6px; }
  .rail-activity-icon svg { width: 13px; height: 13px; }
  .rail-activity-icon.payment { color: #27a96a; background: #eafbf0; }
  .rail-activity-icon.notice { color: #966de1; background: #f4efff; }
  .rail-empty { display: block; padding: 12px 0; color: #9aa6bb; font-size: .65rem; }
  .dashboard-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .dashboard-breadcrumb { color: #7d89a1; font-size: .72rem; }
  .dashboard-breadcrumb span { margin: 0 7px; color: #c4cada; }
  .dashboard-actions { display: flex; gap: 8px; }
  .dashboard-page .btn { border-radius: 5px; box-shadow: none; }
  .dashboard-page .btn-primary { background: var(--theme-primary); color: #fff; }
  .dashboard-page .btn-secondary { background: #e5eaf3; color: #3f4d68; border: 0; }
  .dashboard-alert { display: flex; align-items: center; gap: 8px; border: 1px solid #6bd96d; background: #effff0; color: #38ae43; border-radius: 18px; padding: 7px 12px; font-size: .72rem; margin-bottom: 14px; }
  .dashboard-alert svg { width: 14px; }
  .dashboard-alert button { border: 0; background: transparent; color: #38ae43; margin-left: auto; font-size: 1rem; cursor: pointer; }
  .dashboard-welcome { min-height: 76px; padding: 17px 20px; border-radius: 6px; background: linear-gradient(105deg, #131126, #19152f 68%, #171329); color: #fff; display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; overflow: hidden; position: relative; }
  .dashboard-welcome:after { content: ''; position: absolute; right: 13%; top: -60px; width: 180px; height: 150px; border: 12px solid #2e48a7; border-radius: 42px; transform: rotate(-9deg); opacity: .8; }
  .dashboard-welcome h2 { font-size: 1.28rem; margin-bottom: 5px; position: relative; z-index: 1; }
  .dashboard-welcome p, .dashboard-updated { color: #b8b4cd; font-size: .7rem; position: relative; z-index: 1; }
  .dashboard-updated { display: flex; align-items: center; gap: 5px; }
  .dashboard-updated svg { width: 12px; }
  .dashboard-updated strong { color: #fff; font-weight: 500; }
  .dashboard-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
  .dashboard-kpi, .dashboard-panel, .dashboard-footer-cards a { background: #fff; border: 1px solid #dbe2ee; border-radius: 7px; box-shadow: 0 3px 10px rgba(35, 55, 90, .06); }
  .dashboard-kpi { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 13px; position: relative; }
  .kpi-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 5px; }
  .kpi-icon svg { width: 20px; }
  .kpi-icon.pink { color: #e56d93; background: #fff0f4; }.kpi-icon.blue { color: #4f83ed; background: #eef4ff; }.kpi-icon.yellow { color: #e9ae27; background: #fff8e7; }.kpi-icon.purple { color: #916ee2; background: #f4efff; }
  .dashboard-kpi strong { display: block; font-size: 1.22rem; color: #263453; }.dashboard-kpi span { display: block; color: #8c98ad; font-size: .66rem; margin-top: 2px; }.dashboard-kpi footer { grid-column: 1 / -1; border-top: 1px solid #f0f2f7; padding-top: 8px; color: #919cb0; font-size: .64rem; }.kpi-badge { color: #27ba6d; background: #effcf4; border-radius: 3px; padding: 3px 5px; font-size: .58rem; font-weight: 600; align-self: start; }
  .dashboard-main-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
  .dashboard-three-grid { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 14px; margin-bottom: 14px; }
  .dashboard-bottom-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 14px; }
  .dashboard-single-panel-grid { grid-template-columns: 1fr; }
  .dashboard-single-panel-grid .dashboard-chart-medium { height: 245px; }
  .dashboard-panel { padding: 14px; overflow: hidden; }
  .dashboard-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }.dashboard-panel-header h3 { font-size: .88rem; color: #253452; font-weight: 800; }.dashboard-panel-header p { font-size: .65rem; color: #697792; margin-top: 4px; }  .dashboard-panel-header a { color: var(--theme-primary); font-size: .65rem; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }.dashboard-panel-header a svg { width: 11px; }
  .dashboard-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }.dashboard-stat-row span, .attendance-summary span { display: block; color: #9aa6bb; font-size: .63rem; }.dashboard-stat-row strong { display: block; color: #2c3a58; font-size: .94rem; margin-top: 4px; }.dashboard-chart-large { height: 205px; }.dashboard-chart-medium { height: 205px; }.dashboard-chart-small { height: 132px; position: relative; }.dashboard-chart-small canvas, .dashboard-chart-large canvas, .dashboard-chart-medium canvas { width: 100% !important; height: 100% !important; }
  .attendance-highlight { text-align: center; padding: 3px; }.attendance-highlight strong { display: block; color: #4d6fe8; font-size: 1.55rem; }.attendance-highlight span { color: #8d99ae; font-size: .65rem; }.attendance-summary { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin: 14px 0 4px; }.attendance-summary b { color: #2c3a58; font-size: .9rem; display: block; }
  .quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }.quick-links a { background: #fafbfe; border: 1px solid #f0f2f7; padding: 10px 5px; text-align: center; color: #71809b; font-size: .64rem; border-radius: 5px; }.quick-links i { width: 27px; height: 27px; display: grid; place-items: center; margin: 0 auto 5px; border-radius: 50%; }.quick-links svg { width: 14px; }.quick-green { color: #39bf67; background: #eaffef; }.quick-blue { color: #4d7beb; background: #edf3ff; }.quick-yellow { color: #eab02b; background: #fff8e5; }.quick-purple { color: #9a6be9; background: #f5efff; }
  .inquiry-stats { grid-template-columns: repeat(4, 1fr); }.inquiry-stats strong { font-size: .9rem; }.compact-panel .dashboard-chart-small { height: 115px; }.dashboard-average { color: #8d99ae; font-size: .65rem; border-top: 1px solid #f1f3f7; padding-top: 8px; }.dashboard-average strong { color: #2c3a58; margin-left: 3px; }
  .role-dashboard .role-metric { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; align-items: center; padding: 18px 4px; }
  .role-dashboard .role-metric strong { color: #3f5fd2; font-size: 1.2rem; }
  .role-dashboard .role-metric span { color: #93a0b5; font-size: .65rem; }
  .role-dashboard .kpi-icon.green { color: #34b96b; background: #eafbf0; }
  .dashboard-panel .activity-list { max-height: 205px; overflow: auto; }.dashboard-panel .activity-item { padding: 10px 0; border-bottom: 1px solid #f0f2f7; color: #71809b; font-size: .7rem; }.dashboard-panel .activity-item:last-child { border-bottom: 0; }.dashboard-panel .activity-icon { width: 25px; height: 25px; }.dashboard-panel .activity-details strong { color: #34415c; font-size: .7rem; }.dashboard-panel .activity-time { color: #a2acc0; font-size: .6rem; margin-top: 3px; }
  .dashboard-modules-panel { margin-top: 14px; }
  .dashboard-module-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
  .dashboard-module-grid a { border: 1px solid #edf0f6; border-radius: 6px; padding: 10px 8px; min-height: 80px; background: #fbfcfe; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
  .dashboard-module-grid a:hover { border-color: #bfcdf7; box-shadow: 0 5px 14px rgba(61, 89, 158, .1); transform: translateY(-2px); }
  .dashboard-module-grid i { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; margin-bottom: 7px; }
  .dashboard-module-grid svg { width: 14px; }
  .dashboard-module-grid span, .dashboard-module-grid small { display: block; }
  .dashboard-module-grid span { color: #35425e; font-size: .67rem; font-weight: 700; }
  .dashboard-module-grid small { color: #9aa6bb; font-size: .57rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .module-blue { color: #4d7beb; background: #edf3ff; }.module-purple { color: #966de1; background: #f4efff; }.module-green { color: #34b96b; background: #eafbf0; }.module-orange { color: #ed9d32; background: #fff4e5; }.module-red { color: #e56a78; background: #fff0f2; }.module-yellow { color: #d6a324; background: #fff8e5; }.module-teal { color: #27aaa2; background: #e8fbfa; }.module-indigo { color: #5b6de7; background: #eef0ff; }.module-pink { color: #dc6fa4; background: #fff0f6; }.module-cyan { color: #3cabc6; background: #eaf9fc; }.module-lime { color: #76ad42; background: #f2fbe9; }.module-slate { color: #71819d; background: #eef2f7; }
  .dashboard-footer-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }.dashboard-footer-cards a { padding: 13px; display: grid; grid-template-columns: 1fr auto; }.dashboard-footer-cards span { color: #8c98ad; font-size: .66rem; }.dashboard-footer-cards strong { color: #2c3a58; font-size: 1rem; margin-top: 5px; }.dashboard-footer-cards i { grid-column: 2; grid-row: 1 / span 2; width: 31px; height: 31px; padding: 7px; color: #4d6fe8; background: #eef2ff; border-radius: 5px; }
  .dashboard-page .chart-card { background: #fff; }.dashboard-page .activity-list { color: #71809b; }
  @media (max-width: 1100px) { .dashboard-module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  @media (max-width: 1200px) { .dashboard-report-layout { grid-template-columns: minmax(0, 1fr) 230px; } }
  @media (max-width: 1050px) { .dashboard-report-layout { grid-template-columns: 1fr; }.dashboard-right-rail { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }.dashboard-rail-heading { grid-column: 1 / -1; }.dashboard-main-grid, .dashboard-bottom-grid { grid-template-columns: 1fr 1fr; }.dashboard-three-grid { grid-template-columns: 1fr 1fr; }.dashboard-three-grid .compact-panel:last-child { grid-column: span 2; } }
  @media (max-width: 720px) {
    .dashboard-page .sidebar { width: min(300px, 86vw); transform: translateX(-100%); box-shadow: 12px 0 30px rgba(31, 42, 68, .16); transition: transform .25s ease; z-index: 120; }
    .dashboard-page .main-wrapper { margin-left: 0; }
    .dashboard-page.sidebar-open .sidebar { transform: translateX(0); }
    .dashboard-page .sidebar-overlay { position: fixed; inset: 0; display: block; border: 0; background: rgba(24, 35, 58, .35); opacity: 0; pointer-events: none; z-index: 110; transition: opacity .25s ease; }
    .dashboard-page.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .dashboard-page .main-header { padding: 0 14px; gap: 10px; }
    .dashboard-page .page-title h1 { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .dashboard-page .header-actions { gap: 8px; }
    .dashboard-page .header-actions > * { font-size: .75rem !important; }
    .mobile-menu-toggle { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid #e5eaf3; border-radius: 8px; color: #4767dd; background: #f5f7ff; cursor: pointer; }
    .mobile-menu-toggle svg { width: 19px; height: 19px; }
    .dashboard-content { padding: 12px; }
    .dashboard-kpi-grid, .dashboard-main-grid, .dashboard-three-grid, .dashboard-bottom-grid, .dashboard-footer-cards { grid-template-columns: 1fr; }
    .dashboard-right-rail { grid-template-columns: 1fr; }
    .dashboard-rail-heading { grid-column: auto; }
    .dashboard-three-grid .compact-panel:last-child { grid-column: auto; }
    .dashboard-toolbar, .dashboard-welcome { align-items: flex-start; flex-direction: column; gap: 12px; }
    .dashboard-actions { width: 100%; display: flex; }
    .dashboard-actions .btn { flex: 1; text-align: center; }
    .dashboard-welcome { min-height: 105px; }
    .dashboard-chart-large, .dashboard-chart-medium, .dashboard-chart-small { max-width: 100%; overflow: hidden; }
  }
  @media (max-width: 720px) {.dashboard-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr))} };


.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  color: var(--accent-primary);
  font-size: 1.1rem;
}

.activity-details {
  flex: 1;
  font-size: 0.85rem;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

html[data-color-mode="night"] body {
  --bg-primary: #101827;
  --bg-secondary: #172235;
  --bg-tertiary: #202f46;
  --text-primary: #eef4ff;
  --text-secondary: #aebbd0;
  --text-muted: #8492a8;
  --border-color: #2c3b53;
  background: #101827;
  color: #eef4ff;
}
html[data-color-mode="night"] .main-header,
html[data-color-mode="night"] .sidebar,
html[data-color-mode="night"] .card,
html[data-color-mode="night"] .table-container,
html[data-color-mode="night"] .modal-content,
html[data-color-mode="night"] .theme-option,
html[data-color-mode="night"] .mode-option {
  background: #172235;
  border-color: #2c3b53;
  color: #eef4ff;
}
html[data-color-mode="night"] .form-control,
html[data-color-mode="night"] select,
html[data-color-mode="night"] textarea {
  background: #101827;
  color: #eef4ff;
  border-color: #3a4b66;
}
html[data-color-mode="night"] .sidebar-item a,
html[data-color-mode="night"] .sidebar-group-toggle,
html[data-color-mode="night"] .section-title,
html[data-color-mode="night"] .page-title h1,
html[data-color-mode="night"] th,
html[data-color-mode="night"] td {
  color: #dce7f7;
}
html[data-color-mode="night"] .report-subtitle,
html[data-color-mode="night"] .form-group label,
html[data-color-mode="night"] .text-muted {
  color: #aebbd0;
}
html[data-color-mode="night"] .dashboard-page {
  --bg-primary: #101827;
  --bg-secondary: #172235;
  --text-primary: #eef4ff;
  --text-secondary: #aebbd0;
  --border-color: #2c3b53;
  background: #101827;
  color: #eef4ff;
}
html[data-color-mode="night"] .dashboard-page .main-header,
html[data-color-mode="night"] .dashboard-page .sidebar,
html[data-color-mode="night"] .dashboard-page .dashboard-kpi,
html[data-color-mode="night"] .dashboard-page .dashboard-panel,
html[data-color-mode="night"] .dashboard-page .dashboard-footer-cards a,
html[data-color-mode="night"] .dashboard-page .dashboard-rail-card {
  background: #172235;
  border-color: #2c3b53;
}
html[data-color-mode="night"] .dashboard-page .dashboard-kpi strong,
html[data-color-mode="night"] .dashboard-page .dashboard-panel-header h3,
html[data-color-mode="night"] .dashboard-page .dashboard-rail-card > strong,
html[data-color-mode="night"] .dashboard-page .dashboard-rail-heading h2 {
  color: #eef4ff;
}
html[data-color-mode="night"] .dashboard-page .dashboard-panel-header p,
html[data-color-mode="night"] .dashboard-page .dashboard-rail-card > p,
html[data-color-mode="night"] .dashboard-page .dashboard-kpi span,
html[data-color-mode="night"] .dashboard-page .dashboard-rail-heading span {
  color: #aebbd0;
}
html[data-color-mode="night"] .dashboard-page .sidebar-item a:hover,
html[data-color-mode="night"] .dashboard-page .sidebar-item.active a {
  background: color-mix(in srgb, var(--theme-primary) 22%, #172235);
}
@media (max-width: 700px) {
  .mode-options { grid-template-columns: 1fr; }
}

/* Theme-aware dashboard accents override reference defaults. */
body.dashboard-page .sidebar-item.active a,
body.dashboard-page .sidebar-item a:hover,
body.dashboard-page .dashboard-panel-header a,
body.dashboard-page .dashboard-rail-card > a,
body.dashboard-page .dashboard-rail-heading > svg,
body.dashboard-page .dashboard-rail-card header svg,
body.dashboard-page .attendance-highlight strong,
body.dashboard-page .dashboard-footer-cards i {
  color: var(--theme-primary);
}
body.dashboard-page .sidebar-item.active a,
body.dashboard-page .sidebar-item a:hover,
body.dashboard-page .dashboard-footer-cards i {
  background: var(--theme-soft);
}
body.dashboard-page .dashboard-rail-card,
body.dashboard-page .dashboard-kpi,
body.dashboard-page .dashboard-panel,
body.dashboard-page .dashboard-footer-cards a {
  border-color: color-mix(in srgb, var(--theme-primary) 18%, #dbe2ee);
}
body.dashboard-page .dashboard-rail-card header,
body.dashboard-page .dashboard-panel-header h3,
body.dashboard-page .dashboard-kpi strong,
body.dashboard-page .dashboard-rail-card > strong {
  color: #17233d;
}
body.dashboard-page .dashboard-panel-header p,
body.dashboard-page .dashboard-rail-card > p,
body.dashboard-page .dashboard-rail-heading span,
body.dashboard-page .dashboard-kpi span,
body.dashboard-page .dashboard-module-grid small {
  color: #667492;
}
body.dashboard-page .dashboard-panel-header a:hover,
body.dashboard-page .dashboard-rail-card > a:hover {
  color: var(--theme-primary-hover);
}
body.dashboard-page .mobile-menu-toggle {
  color: var(--theme-primary);
  background: var(--theme-soft);
  border-color: color-mix(in srgb, var(--theme-primary) 22%, #dbe2ee);
}

/* Keep every authenticated page visually aligned with the dashboard navigation. */
body:not(.dashboard-page) .sidebar {
  width: 230px;
  background: #fff;
  border-right: 1px solid #e9edf5;
}
body:not(.dashboard-page) .sidebar-brand {
  height: 58px;
  padding: 0 16px;
  gap: 10px;
  border-bottom: 1px solid #edf0f6;
}
body:not(.dashboard-page) .brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: .9rem;
}
body:not(.dashboard-page) .brand-name {
  color: #253457;
  background: none;
  -webkit-text-fill-color: initial;
  font-size: .95rem;
}
body:not(.dashboard-page) .sidebar-menu { padding: 16px 12px; gap: 5px; }
body:not(.dashboard-page) .sidebar-item a {
  color: #5f6d87;
  font-size: .86rem;
  padding: 11px 12px;
  border-radius: 7px;
  gap: 10px;
}
body:not(.dashboard-page) .sidebar-item a svg { width: 16px; height: 16px; }
body:not(.dashboard-page) .sidebar-item.active a,
body:not(.dashboard-page) .sidebar-item a:hover {
  background: var(--theme-soft);
  color: var(--theme-primary);
  box-shadow: none;
}
body:not(.dashboard-page) .sidebar-item.active a { font-weight: 700; }
body:not(.dashboard-page) .sidebar-section-label {
  color: #a3aec1;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 18px 10px 6px;
  text-transform: uppercase;
}
body:not(.dashboard-page) .sidebar-group-toggle { min-height: 30px; color: #52617d; }
body:not(.dashboard-page) .sidebar-group-toggle svg { width: 16px; height: 16px; }
body:not(.dashboard-page) .sidebar-footer { padding: 10px; border-top: 1px solid #edf0f6; }
body:not(.dashboard-page) .user-profile-summary { margin-bottom: 8px; padding: 4px; gap: 8px; }
body:not(.dashboard-page) .user-avatar { width: 28px; height: 28px; border: 0; background: var(--theme-soft); color: var(--theme-primary); font-size: .75rem; }
body:not(.dashboard-page) .user-name { color: #34415c; font-size: .7rem; }
body:not(.dashboard-page) .user-role { color: #9aa6bb; font-size: .62rem; }
body:not(.dashboard-page) .btn-logout { padding: 7px; font-size: .7rem; border-radius: 6px; }
body:not(.dashboard-page) .main-wrapper { margin-left: 230px; }
body:not(.dashboard-page) .main-header {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid #e9edf5;
  padding: 0 20px;
}
body:not(.dashboard-page) .page-title h1 { font-size: 1.05rem; color: #1c2944; }
body:not(.dashboard-page) .content-body { padding: 18px 20px 28px; }

/* Internal modules share the same visual language as the front dashboard. */
.dashboard-page .content-body > .page-header,
.dashboard-page .content-body > .section-header {
  margin-bottom: 16px;
}
.dashboard-page .page-header h1,
.dashboard-page .content-body > .section-header h2 {
  color: #1c2944;
  font-size: 1.2rem;
  font-weight: 800;
}
.dashboard-page .page-header p,
.dashboard-page .content-body > .section-header p {
  margin-top: 4px;
  color: #697792;
  font-size: .76rem;
}
.dashboard-page .content-body > .card,
.dashboard-page .content-body > .card-list,
.dashboard-page .content-body > section > .card {
  border: 1px solid #dbe2ee;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(35, 55, 90, .06);
}

/* Internal pages use layered surfaces rather than one large white canvas. */
.dashboard-page .content-body:not(.dashboard-content) {
  background: #f1f4f9;
}
.dashboard-page .content-body:not(.dashboard-content) > .card,
.dashboard-page .content-body:not(.dashboard-content) > .card-list,
.dashboard-page .content-body:not(.dashboard-content) > section > .card {
  background: #fbfcfe;
}
.dashboard-page .content-body:not(.dashboard-content) > .card::before,
.dashboard-page .content-body:not(.dashboard-content) > .card-list::before {
  content: '';
  display: block;
  height: 3px;
  margin: -1px -1px 14px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-secondary));
  opacity: .9;
}
.dashboard-page .content-body:not(.dashboard-content) .table-responsive {
  background: #fff;
  box-shadow: inset 0 1px 0 #eef2f7;
}
.dashboard-page .content-body:not(.dashboard-content) .form-control,
.dashboard-page .content-body:not(.dashboard-content) input,
.dashboard-page .content-body:not(.dashboard-content) select,
.dashboard-page .content-body:not(.dashboard-content) textarea {
  background: #fff;
  border-color: #cfd8e6;
  color: #253452;
}
.dashboard-page .content-body:not(.dashboard-content) .form-control:focus,
.dashboard-page .content-body:not(.dashboard-content) input:focus,
.dashboard-page .content-body:not(.dashboard-content) select:focus,
.dashboard-page .content-body:not(.dashboard-content) textarea:focus {
  border-color: var(--theme-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 14%, transparent);
}
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) {
  background: #101827;
}
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) > .card,
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) > .card-list,
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) > section > .card,
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) .table-responsive,
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) .form-control,
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) input,
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) select,
html[data-color-mode="night"] .dashboard-page .content-body:not(.dashboard-content) textarea {
  background: #172235;
}
.dashboard-page .content-body .card h2 {
  color: #253452;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.dashboard-page .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.dashboard-page .tabs .tab {
  border: 1px solid #dbe2ee;
  background: #e9eef6;
  color: #52617d;
  border-radius: 7px;
  padding: 9px 14px;
}
.dashboard-page .tabs .tab.active,
.dashboard-page .tabs .tab:hover {
  background: var(--theme-primary);
  border-color: var(--theme-primary);
  color: #fff;
}
.dashboard-page .form-grid {
  gap: 12px;
  margin-bottom: 16px;
}
.dashboard-page .form-grid .btn { align-self: end; }
.dashboard-page .table-responsive {
  overflow-x: auto;
  border: 1px solid #e1e7f0;
  border-radius: 7px;
}
.dashboard-page .table-responsive table { min-width: 620px; }
.dashboard-page .table-responsive th {
  background: #f4f7fb;
  color: #52617d;
  font-size: .68rem;
  padding: 11px 12px;
}
.dashboard-page .table-responsive td {
  color: #34415c;
  font-size: .75rem;
  padding: 11px 12px;
}
.dashboard-page .table-responsive tr:hover td { background: var(--theme-soft); }
html[data-color-mode="night"] .dashboard-page .page-header h1,
html[data-color-mode="night"] .dashboard-page .content-body > .section-header h2,
html[data-color-mode="night"] .dashboard-page .content-body .card h2 {
  color: #eef4ff;
}
html[data-color-mode="night"] .dashboard-page .page-header p,
html[data-color-mode="night"] .dashboard-page .content-body > .section-header p {
  color: #aebbd0;
}
html[data-color-mode="night"] .dashboard-page .content-body > .card,
html[data-color-mode="night"] .dashboard-page .content-body > .card-list,
html[data-color-mode="night"] .dashboard-page .content-body > section > .card {
  background: #172235;
  border-color: #2c3b53;
}
html[data-color-mode="night"] .dashboard-page .tabs .tab {
  background: #202f46;
  border-color: #3a4b66;
  color: #dce7f7;
}
html[data-color-mode="night"] .dashboard-page .table-responsive {
  border-color: #2c3b53;
}
html[data-color-mode="night"] .dashboard-page .table-responsive th {
  background: #101827;
  color: #aebbd0;
}
html[data-color-mode="night"] .dashboard-page .table-responsive td {
  color: #dce7f7;
}
html[data-color-mode="night"] .dashboard-page .form-control,
html[data-color-mode="night"] .dashboard-page input,
html[data-color-mode="night"] .dashboard-page select,
html[data-color-mode="night"] .dashboard-page textarea {
  background: #101827;
  color: #eef4ff;
  border-color: #3a4b66;
}
.payroll-page-header { align-items: end; }
.payroll-page-header .btn { white-space: nowrap; }
.eyebrow { display: block; margin-bottom: 6px; color: var(--theme-primary); font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted-text { color: var(--text-secondary); font-size: .8rem; }
.payroll-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.payroll-stat-card { display: flex; align-items: center; gap: 13px; min-height: 104px; padding: 17px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); }
.payroll-stat-card span, .payroll-stat-card small { display: block; color: var(--text-secondary); font-size: .72rem; }
.payroll-stat-card strong { display: block; margin: 4px 0; color: var(--text-primary); font-size: 1.45rem; }
.payroll-stat-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border-radius: 10px; }
.payroll-stat-icon.primary { color: var(--accent-primary); background: rgba(99,102,241,.13); }
.payroll-stat-icon.success { color: var(--accent-success); background: rgba(16,185,129,.13); }
.payroll-stat-icon.warning { color: var(--accent-warning); background: rgba(245,158,11,.15); }
.payroll-stat-icon.info { color: #0e7490; background: rgba(14,116,144,.13); }
.payroll-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(245px, .75fr); gap: 18px; align-items: start; }
.payroll-form-card .section-header { align-items: flex-start; margin-bottom: 20px; }
.payroll-form-card h2, .payroll-records-card h2, .payroll-side-panel h2 { margin: 0 0 4px; font-size: 1.15rem; }
.payroll-step { color: var(--theme-primary); font-size: 1.55rem; font-weight: 800; }
.payroll-form-card .form-section { margin-bottom: 17px; }
.payroll-form-card .form-section h4 { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; color: var(--theme-primary); }
.payroll-form-card label { display: flex; flex-direction: column; gap: 6px; color: var(--text-secondary); font-size: .74rem; font-weight: 700; }
.payroll-form-card label > span { color: var(--text-primary); font-size: .76rem; }
.payroll-form-card label em { color: var(--accent-danger); font-style: normal; }
.field-hint { color: var(--text-secondary); font-size: .67rem; font-weight: 400; line-height: 1.35; }
.section-helper { margin: -5px 0 14px; color: var(--text-secondary); font-size: .74rem; }
.currency-input { display: flex; align-items: center; overflow: hidden; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 7px; }
.currency-input b { padding-left: 12px; color: var(--text-secondary); font-size: .85rem; }
.currency-input input { border: 0 !important; background: transparent !important; box-shadow: none !important; }
.payroll-form-card input, .payroll-form-card select, .payroll-form-card textarea { min-height: 42px; }
.payroll-form-card textarea { min-height: 82px; resize: vertical; }
.payroll-form-card input:focus, .payroll-form-card select:focus, .payroll-form-card textarea:focus, .currency-input:focus-within { border-color: var(--theme-primary); box-shadow: 0 0 0 3px rgba(71,103,221,.12); outline: 0; }
.payroll-form-card input, .payroll-form-card select, .payroll-form-card textarea { width: 100%; box-sizing: border-box; }
.payroll-form-card .full-width { grid-column: 1 / -1; }
.payroll-net-preview { display: flex; flex-direction: column; justify-content: center; padding: 10px 14px; background: var(--theme-soft); border: 1px solid rgba(71,103,221,.18); border-radius: 8px; }
.payroll-net-preview span, .payroll-net-preview small { color: var(--text-secondary); font-size: .7rem; }
.payroll-net-preview strong { margin: 3px 0; color: var(--theme-primary); font-size: 1.25rem; }
.payroll-form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.payroll-side-panel { padding: 22px; color: #fff; background: linear-gradient(145deg, #20365b, #30538b); border-radius: var(--border-radius); box-shadow: var(--shadow-md); }
.payroll-side-panel .eyebrow { color: #b9d5ff; }
.payroll-side-panel h2 { color: #fff; }
.payroll-checklist { display: grid; gap: 15px; margin: 24px 0; }
.payroll-checklist div { display: flex; align-items: flex-start; gap: 9px; color: #e1ebfb; font-size: .79rem; line-height: 1.45; }
.payroll-checklist svg { width: 16px; flex: 0 0 16px; color: #82e4b0; }
.payroll-side-note { display: flex; gap: 10px; padding: 13px; color: #dbe9ff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: 8px; }
.payroll-side-note svg { flex: 0 0 18px; color: #a9d0ff; }
.payroll-side-note strong { display: block; margin-bottom: 3px; color: #fff; font-size: .78rem; }
.payroll-side-note p { margin: 0; font-size: .7rem; line-height: 1.45; }
.payroll-records-card { margin-top: 18px; }
.payroll-records-card .section-header { margin-bottom: 15px; }
.record-count { color: var(--text-secondary); font-size: .75rem; }
.payroll-toolbar { display: flex; gap: 10px; margin-bottom: 13px; }
.payroll-toolbar select { min-width: 135px; }
.search-field { display: flex; align-items: center; gap: 8px; flex: 1; padding: 0 11px; border: 1px solid var(--border-color); border-radius: 7px; }
.search-field svg { width: 16px; color: var(--text-secondary); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.payroll-table { min-width: 900px !important; }
.payroll-table td small, .employee-cell small { display: block; margin-top: 3px; color: var(--text-secondary); font-size: .68rem; }
.employee-cell { display: flex; align-items: center; gap: 9px; }
.employee-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; color: var(--theme-primary); background: var(--theme-soft); border-radius: 50%; font-weight: 800; }
.salary-breakdown { display: grid; gap: 2px; color: var(--text-secondary); font-size: .7rem; }
.salary-breakdown .positive { color: var(--accent-success); }
.salary-breakdown .negative { color: var(--accent-danger); }
.net-salary { color: var(--text-primary); }
.empty-state { padding: 38px 16px !important; text-align: center; }
.empty-state svg, .empty-state strong, .empty-state span { display: block; margin: 0 auto 7px; }
.empty-state svg { color: var(--text-secondary); }
.empty-state span { color: var(--text-secondary); font-size: .75rem; }
.attendance-report-card .section-header { align-items: flex-start; }
.attendance-report-actions, .report-row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.attendance-report-actions .btn, .report-row-actions .btn { white-space: nowrap; }
.attendance-report-summary { display: flex; align-items: stretch; gap: 0; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--border-color); border-radius: 8px; background: var(--bg-primary); }
.report-status { display: flex; align-items: center; justify-content: space-between; flex: 1; min-width: 0; padding: 11px 15px; border-left: 4px solid var(--theme-primary); background: var(--theme-soft); }
.report-status + .report-status { border-left-width: 1px; border-left-style: solid; border-left-color: var(--border-color); }
.report-status span { color: var(--text-secondary); font-size: .76rem; font-weight: 700; }
.report-status strong { color: var(--text-primary); font-size: 1.25rem; }
.report-status.present { border-color: var(--accent-success); }
.report-status.absent { border-color: var(--accent-danger); }
.report-status.late { border-color: var(--accent-warning); }
.report-status.excused { border-color: var(--accent-primary); }
.attendance-lock-notice { margin: -4px 0 14px; padding: 10px 13px; color: #854d0e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 7px; font-size: .78rem; font-weight: 600; }
html[data-color-mode="night"] .attendance-lock-notice { color: #fde68a; background: #422006; border-color: #92400e; }
html[data-color-mode="night"] .payroll-stat-card, html[data-color-mode="night"] .payroll-form-card, html[data-color-mode="night"] .payroll-records-card { background: #172235; border-color: #2c3b53; }
html[data-color-mode="night"] .search-field { border-color: #3a4b66; }
html[data-color-mode="night"] .payroll-net-preview { background: #202f46; }
.academic-years-page .page-header { align-items: end; }
.academic-years-page .page-header .btn { white-space: nowrap; }
.academic-year-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.academic-year-stat { display: flex; align-items: center; gap: 13px; min-height: 82px; padding: 16px 18px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); }
.academic-year-stat > svg { width: 22px; height: 22px; padding: 10px; color: var(--theme-primary); background: var(--theme-soft); border-radius: 10px; }
.academic-year-stat span { display: block; color: var(--text-secondary); font-size: .72rem; }
.academic-year-stat strong { display: block; margin-top: 4px; color: var(--text-primary); font-size: 1.25rem; }
.academic-year-stat.current > svg { color: var(--accent-success); background: rgba(16,185,129,.13); }
.academic-year-layout { display: grid; grid-template-columns: minmax(0, 1fr) 275px; gap: 18px; align-items: start; }
.academic-year-form-card .section-header { align-items: flex-start; }
.academic-year-form-card h2, .academic-year-records h2 { margin: 0 0 4px; font-size: 1.15rem; }
.academic-year-form-card .section-header > .academic-year-icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--theme-primary); background: var(--theme-soft); border-radius: 10px; }
.academic-year-form-card label { display: flex; flex-direction: column; gap: 6px; color: var(--text-primary); font-size: .76rem; font-weight: 700; }
.academic-year-form-card label em { color: var(--accent-danger); font-style: normal; }
.academic-year-form-card label small { color: var(--text-secondary); font-size: .67rem; font-weight: 400; }
.academic-year-form-card input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; }
.academic-year-form-card input:not([type="checkbox"]), .academic-year-form-card select { min-height: 44px; }
.academic-year-form-card .toggle-row { align-self: end; min-height: 44px; box-sizing: border-box; justify-content: flex-start; gap: 9px; }
.academic-year-form-card .toggle-row input { width: 17px; height: 17px; flex: 0 0 17px; accent-color: var(--theme-primary); }
.academic-year-form-card .toggle-row span { color: var(--text-primary); font-size: .73rem; line-height: 1.3; }
.academic-year-form-card .btn { align-self: end; min-height: 44px; justify-content: center; }
.academic-year-form-actions { display: flex; align-items: end; justify-content: flex-end; gap: 8px; }
.academic-year-form-actions .btn { width: auto; }
.academic-year-help { display: flex; gap: 10px; padding: 18px; color: #e7f0ff; background: linear-gradient(145deg, #20365b, #30538b); border-radius: var(--border-radius); box-shadow: var(--shadow-md); }
.academic-year-help > svg { flex: 0 0 18px; color: #a9d0ff; }
.academic-year-help strong { display: block; margin-bottom: 5px; color: #fff; font-size: .8rem; }
.academic-year-help p { margin: 0; color: #dbe9ff; font-size: .73rem; line-height: 1.5; }
.academic-year-records { margin-top: 18px; }
.academic-year-records .btn { gap: 5px; }
.academic-year-records .btn svg { width: 14px; }
.year-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.academic-year-records .badge { margin-left: 7px; vertical-align: middle; }
.profile-identity { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.profile-identity h2 { margin: 0 0 5px; color: var(--text-primary); }
.profile-identity p { margin: 0; color: var(--text-secondary); }
.profile-student-photo, .profile-person-photo { display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; border-radius: 50%; background: var(--theme-soft); }
.profile-student-photo { width: 88px; height: 88px; }
.profile-photo, .profile-photo-fallback { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-fallback { display: grid; place-items: center; color: var(--theme-primary); font-size: 1.35rem; font-weight: 800; }
.profile-photo.large { width: 100%; height: 100%; }
.profile-people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.profile-person-card { display: flex; align-items: center; gap: 12px; padding: 15px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--border-radius); }
.profile-person-photo { width: 48px; height: 48px; }
.profile-person-card > div:last-child { min-width: 0; }
.profile-person-card span, .profile-person-card small { display: block; color: var(--text-secondary); font-size: .7rem; }
.profile-person-card strong { display: block; margin: 3px 0; color: var(--text-primary); }
html[data-color-mode="night"] .academic-year-stat, html[data-color-mode="night"] .academic-year-form-card, html[data-color-mode="night"] .academic-year-records { background: #172235; border-color: #2c3b53; }
@media (max-width: 700px) {
  .dashboard-page .content-body { padding: 14px; }
  .dashboard-page .form-grid { grid-template-columns: 1fr; }
  .dashboard-page .form-grid .btn { width: 100%; }
  .dashboard-page .tabs .tab { flex: 1 1 auto; }
  .payroll-page-header { align-items: flex-start; gap: 14px; }
  .payroll-page-header .btn { width: 100%; justify-content: center; }
  .payroll-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .payroll-layout { grid-template-columns: 1fr; }
  .payroll-toolbar { flex-direction: column; }
  .payroll-toolbar select { width: 100%; }
  .payroll-form-actions { flex-direction: column-reverse; }
  .payroll-form-actions .btn { justify-content: center; }
  .academic-years-page .page-header { align-items: flex-start; gap: 14px; }
  .academic-years-page .page-header .btn { width: 100%; justify-content: center; }
  .academic-year-stats { grid-template-columns: 1fr; }
  .academic-year-layout { grid-template-columns: 1fr; }
  .attendance-report-summary { display: grid; grid-template-columns: repeat(2, 1fr); }
  .report-status + .report-status { border-left-width: 4px; }
  .attendance-report-actions { width: 100%; }
  .attendance-report-actions .btn { flex: 1; justify-content: center; }
  .profile-people-grid { grid-template-columns: 1fr; }
}
html[data-color-mode="night"] body:not(.dashboard-page) .sidebar,
html[data-color-mode="night"] body:not(.dashboard-page) .main-header {
  background: #172235;
  border-color: #2c3b53;
}
html[data-color-mode="night"] body:not(.dashboard-page) .brand-name,
html[data-color-mode="night"] body:not(.dashboard-page) .page-title h1,
html[data-color-mode="night"] body:not(.dashboard-page) .user-name {
  color: #eef4ff;
}
html[data-color-mode="night"] body:not(.dashboard-page) .sidebar-item a,
html[data-color-mode="night"] body:not(.dashboard-page) .sidebar-group-toggle {
  color: #dce7f7;
}
html[data-color-mode="night"] body:not(.dashboard-page) .sidebar-item.active a,
html[data-color-mode="night"] body:not(.dashboard-page) .sidebar-item a:hover {
  background: color-mix(in srgb, var(--theme-primary) 22%, #172235);
  color: #fff;
}
@media (max-width: 900px) {
  body:not(.dashboard-page) .sidebar {
    width: min(300px, 86vw);
    transform: translateX(-100%);
    box-shadow: 12px 0 30px rgba(31, 42, 68, .16);
    z-index: 120;
  }
  body:not(.dashboard-page) .main-wrapper { margin-left: 0; }
  body:not(.dashboard-page).sidebar-open .sidebar { transform: translateX(0); }
  body:not(.dashboard-page) .main-header { padding: 0 14px; gap: 10px; }
  body:not(.dashboard-page) .sidebar-overlay { position: fixed; inset: 0; display: block; background: rgba(24, 35, 58, .35); opacity: 0; pointer-events: none; z-index: 110; }
  body:not(.dashboard-page).sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
}

/* Shared navigation appearance across all authenticated pages. */
/* Admin navigation: distinct groups, generous targets, and a clear active page. */
body.dashboard-page .sidebar{background:linear-gradient(180deg,#f9fbff 0%,#f0f4fc 100%);border-right:1px solid #dbe3f1;box-shadow:3px 0 18px #20304a06}
body.dashboard-page .sidebar-brand{min-height:74px;height:auto;padding:18px 16px;background:#ffffffb3;border-bottom:1px solid #dfe7f3;gap:11px}
body.dashboard-page .brand-icon{width:36px;height:36px;flex-shrink:0;border-radius:11px;box-shadow:0 4px 10px #4965c52b}
body.dashboard-page .brand-name{font-size:15px;line-height:1.4;color:#253858;overflow-wrap:anywhere}
body.dashboard-page .sidebar-menu{padding:14px 10px;gap:5px;scrollbar-width:thin;scrollbar-color:#c0cde3 transparent}
body.dashboard-page .sidebar-section-label{margin:12px 0 3px;letter-spacing:normal}
body.dashboard-page .sidebar-group-toggle{padding:10px 11px;min-height:43px;border:1px solid #dfe7f3;border-radius:9px;background:#eaf0fa;color:#435778;font-size:11px;font-weight:700;letter-spacing:.25px;text-align:left;gap:8px}
body.dashboard-page .sidebar-group-toggle>span{flex:1;line-height:1.5}
body.dashboard-page .sidebar-group-toggle:hover{background:#e0e9f9;border-color:#c5d3eb}
body.dashboard-page .sidebar-group-toggle[aria-expanded="true"]{background:#e3ebfb;border-color:#c9d8f3;color:#334f92}
body.dashboard-page .sidebar-item a{position:relative;padding:10px 11px;min-height:43px;font-size:12px;line-height:1.5;border-radius:9px;color:#4d5e79;border:1px solid transparent;gap:10px}
body.dashboard-page .sidebar-item a svg{width:18px;height:18px;flex-shrink:0;color:#7689ac}
body.dashboard-page .sidebar-item a:hover{background:#e6edfb;color:#334f92;border-color:#d5dff3}
body.dashboard-page .sidebar-item.active a{background:#dde7fc;color:#294984;border-color:#c1d1f1;font-weight:700;box-shadow:inset 3px 0 #5274ce,0 2px 6px #3a5a9210}
body.dashboard-page .sidebar-item.active a svg{color:#3b60b7}
body.dashboard-page .sidebar-subitem a{padding-left:18px}
body.dashboard-page .sidebar-footer{padding:12px;background:#ffffffb3;border-top:1px solid #dbe3f1}
body.dashboard-page .user-profile-summary{padding:8px;margin-bottom:9px;border-radius:9px;background:#eaf0fa;gap:10px}
body.dashboard-page .user-avatar{width:34px;height:34px;flex-shrink:0;background:#dbe5fc;color:#34569a;font-size:14px}
body.dashboard-page .user-info{min-width:0}
body.dashboard-page .user-name{font-size:12px;color:#304361;white-space:normal;overflow-wrap:anywhere}
body.dashboard-page .user-role{font-size:10px;color:#61728f;text-transform:capitalize}
body.dashboard-page .btn-logout{min-height:37px;border:1px solid #e7d7df;border-radius:8px;background:#fff4f6;color:#a04b61;font-size:12px}
body.dashboard-page .btn-logout:hover{background:#fbe5eb;color:#8f354d}
body.dashboard-page .sidebar a:focus-visible,body.dashboard-page .sidebar button:focus-visible{outline:3px solid #7697dd;outline-offset:2px}


html[data-color-mode="night"] body.dashboard-page .sidebar{background:linear-gradient(180deg,#18263c,#142034);border-color:#34445e}
html[data-color-mode="night"] body.dashboard-page .sidebar-brand,html[data-color-mode="night"] body.dashboard-page .sidebar-footer{background:#1c2b43;border-color:#34445e}
html[data-color-mode="night"] body.dashboard-page .sidebar-group-toggle,html[data-color-mode="night"] body.dashboard-page .user-profile-summary{background:#24344e;color:#c2cfea;border-color:#344965}
html[data-color-mode="night"] body.dashboard-page .sidebar-group-toggle:hover,html[data-color-mode="night"] body.dashboard-page .sidebar-group-toggle[aria-expanded="true"]{background:#2b4162;color:#e0e9ff;border-color:#465f84}
html[data-color-mode="night"] body.dashboard-page .sidebar-item a{color:#c2cfea}
html[data-color-mode="night"] body.dashboard-page .sidebar-item a:hover,html[data-color-mode="night"] body.dashboard-page .sidebar-item.active a{background:#2c4164;color:#edf2ff;border-color:#425c85}
html[data-color-mode="night"] body.dashboard-page .sidebar-item a svg{color:#9fb7e1}
html[data-color-mode="night"] body.dashboard-page .brand-name,html[data-color-mode="night"] body.dashboard-page .user-name{color:#e0e9fa}
html[data-color-mode="night"] body.dashboard-page .user-role{color:#a6b8d5}
html[data-color-mode="night"] body.dashboard-page .btn-logout{background:#3a2939;color:#edb1c6;border-color:#5a3a4c}
body.dashboard-page .sidebar-item a{font-size:14px;font-weight:600;color:#263c5d;line-height:1.5}
body.dashboard-page .sidebar-group-toggle{font-size:13px;font-weight:700;color:#304969;letter-spacing:0}
body.dashboard-page .sidebar-item.active a{font-weight:700;color:#203e79}
body.dashboard-page .sidebar-item a svg{color:#526d96;stroke-width:2.2}
html[data-color-mode="night"] body.dashboard-page .sidebar-item a{color:#e1e9f8}
html[data-color-mode="night"] body.dashboard-page .sidebar-group-toggle{color:#d5e1f5}

/* Each authorized report is a direct child of the collapsible Reports menu. */
.reports-submenu{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:4px}
.reports-submenu .sidebar-item{margin:0}
body.dashboard-page .reports-submenu .sidebar-subitem a{padding:9px 10px 9px 20px!important;gap:9px;align-items:flex-start}
.reports-submenu .sidebar-item a span{min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.45}
.reports-submenu .sidebar-item a svg{flex-shrink:0;margin-top:2px;width:16px;height:16px}
.report-menu-status{padding:12px;font-size:12px;color:var(--text-secondary)}
#reports-submenu-container[hidden]{display:none!important}

/* Keep the software name readable in the sidebar. */
.sidebar .sidebar-brand { height:auto; min-height:74px; }
.sidebar .brand-name { white-space:normal; font-size:15px; line-height:1.35; }
.sidebar .brand-icon { flex-shrink:0; }

/* School identity in the shared top bar. */
.main-header .page-title { min-width:0; }
.main-header .header-school-name { font-size:.95rem; font-weight:700; color:var(--text-primary); line-height:1.3; overflow-wrap:anywhere; }
.main-header .page-title h1 { font-size:.8rem; color:var(--text-secondary); margin-top:3px; }
.main-header { height:auto; min-height:var(--header-height); gap:12px; padding-top:10px; padding-bottom:10px; }
@media(max-width:700px) { .main-header .header-school-name { font-size:.85rem; } }

/* Shared field contrast for forms, filters, dialogs and editable tables. */
:root {
  --field-bg:#ffffff;
  --field-text:#18263c;
  --field-border:#7c8ca3;
  --field-placeholder:#58677c;
  --field-label:#293d56;
  --field-disabled-bg:#e9eef4;
  --field-focus:var(--theme-primary,#3767d6);
}
:root[data-color-mode="night"] {
  --field-bg:#142238;
  --field-text:#f1f5fc;
  --field-border:#8294ad;
  --field-placeholder:#b0bed2;
  --field-label:#e0e9f7;
  --field-disabled-bg:#27364b;
  --field-focus:#9bbcff;
  color-scheme:dark;
}
:root:not([data-color-mode="night"]) { color-scheme:light; }
html:root body :is(input,select,textarea):not(:where([type="hidden"],[type="checkbox"],[type="radio"],[type="range"],[type="color"],[type="button"],[type="submit"],[type="reset"])) {
  background-color:var(--field-bg)!important;
  color:var(--field-text)!important;
  border:1px solid var(--field-border)!important;
  border-radius:8px;
  font-size:14px;
  font-weight:500;
  line-height:1.5;
  min-height:40px;
  padding:9px 12px;
  caret-color:var(--field-focus);
  transition:border-color .15s,box-shadow .15s;
}
html:root body :is(input,textarea)::placeholder {color:var(--field-placeholder)!important;opacity:1;font-weight:400;}
html:root body :is(input,select,textarea):not(:where([type="hidden"],[type="checkbox"],[type="radio"],[type="range"],[type="color"],[type="button"],[type="submit"],[type="reset"])):hover:not(:disabled):not(:focus) {border-color:var(--field-label)!important;}
html:root body :is(input,select,textarea):focus-visible {
  outline:2px solid var(--field-focus)!important;
  outline-offset:2px;
  border-color:var(--field-focus)!important;
  box-shadow:0 0 0 4px color-mix(in srgb,var(--field-focus) 16%,transparent)!important;
}
html:root body :is(input,select,textarea):is(:disabled,[readonly]) {background-color:var(--field-disabled-bg)!important;color:var(--field-placeholder)!important;opacity:1;}
html:root body :is(input,select,textarea):disabled {cursor:not-allowed;}
html:root body :is(input,select,textarea)[aria-invalid="true"] {border-color:#c83d4b!important;}
html:root body :is(input[type="checkbox"],input[type="radio"]) {accent-color:var(--theme-primary,#3767d6);width:17px;height:17px;vertical-align:middle;flex-shrink:0;}
html:root body :is(.form-group>label,form label,.form-label,.hr-fields label,.att-toolbar label,.format-controls label) {color:var(--field-label);font-weight:600;}
html:root body :is(.currency-input,.search-field):has(input) {border:1px solid var(--field-border);background:var(--field-bg);border-radius:8px;}
html:root body :is(.currency-input,.search-field)>input {border:0!important;background:transparent!important;}
html:root body :is(.currency-input,.search-field):focus-within {outline:2px solid var(--field-focus);outline-offset:2px;}
html:root body select option {background:var(--field-bg);color:var(--field-text);}
@media(prefers-reduced-motion:reduce) {html:root body :is(input,select,textarea){transition:none;}}
.attendance-options{display:flex;flex-wrap:wrap;gap:8px;min-width:280px}.attendance-options label{display:inline-flex!important;align-items:center;gap:6px;padding:7px 9px;border:1px solid var(--border-color);border-radius:6px;font-size:12px;cursor:pointer;white-space:nowrap}.attendance-options input[type=radio]{width:17px!important;height:17px!important;min-width:17px;margin:0!important;padding:0!important;accent-color:var(--accent-primary,#5367ec)}.attendance-options label:has(input:checked){border-color:var(--accent-primary,#5367ec);background:#5367ec12}.attendance-options input:focus-visible{outline:2px solid var(--accent-primary,#5367ec);outline-offset:3px}.attendance-options label:has(input:disabled){opacity:.65;cursor:default}

/* Rich dashboard palettes and appearance choices */
:root[data-theme="midnight"] { --theme-primary: #203759; --theme-primary-hover: #16263f; --theme-secondary: #d1a64b; --theme-soft: #eaf0f8; --theme-highlight: #eaf0f8; --theme-success: #078b68; }
.theme-midnight { --option-color: #203759; --option-secondary: #d1a64b; --option-soft: #eaf0f8; }
:root[data-theme="teal"] { --theme-primary: #086d77; --theme-primary-hover: #05545c; --theme-secondary: #2dd4bf; --theme-soft: #e3f5f4; --theme-highlight: #e3f5f4; --theme-success: #078b68; }
.theme-teal { --option-color: #086d77; --option-secondary: #2dd4bf; --option-soft: #e3f5f4; }
:root[data-theme="ruby"] { --theme-primary: #9e2648; --theme-primary-hover: #7e1d38; --theme-secondary: #f28c79; --theme-soft: #fce9ee; --theme-highlight: #fce9ee; --theme-success: #078b68; }
.theme-ruby { --option-color: #9e2648; --option-secondary: #f28c79; --option-soft: #fce9ee; }
:root[data-theme="indigo"] { --theme-primary: #4936b1; --theme-primary-hover: #38278e; --theme-secondary: #a89aff; --theme-soft: #eeebff; --theme-highlight: #eeebff; --theme-success: #078b68; }
.theme-indigo { --option-color: #4936b1; --option-secondary: #a89aff; --option-soft: #eeebff; }
:root[data-theme="forest"] { --theme-primary: #236448; --theme-primary-hover: #184c35; --theme-secondary: #d6ad4f; --theme-soft: #e9f3e9; --theme-highlight: #e9f3e9; --theme-success: #078b68; }
.theme-forest { --option-color: #236448; --option-secondary: #d6ad4f; --option-soft: #e9f3e9; }
:root[data-theme="sunset"] { --theme-primary: #aa431d; --theme-primary-hover: #873215; --theme-secondary: #f2ac69; --theme-soft: #fff0e5; --theme-highlight: #fff0e5; --theme-success: #078b68; }
.theme-sunset { --option-color: #aa431d; --option-secondary: #f2ac69; --option-soft: #fff0e5; }

.theme-palette-scroll { max-height: 320px; overflow-y: auto; padding: 5px; scrollbar-gutter: stable; scrollbar-color: var(--theme-primary) var(--theme-soft); }
.dashboard-style-heading { margin: 20px 0 12px; font-size: .95rem; }
.dashboard-style-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile-design-sample { display: grid; place-items: center; width: 100%; height: 52px; border-radius: 8px; font-size: 1.15rem; font-weight: 700; }
.sample-bold { background: var(--theme-primary); color: white; }
.sample-gradient { background: linear-gradient(125deg, var(--theme-primary), var(--theme-primary-hover)); color: white; border-right: 5px solid var(--theme-secondary); }
.sample-soft { background: var(--theme-soft); color: var(--theme-primary-hover); }
.theme-option:focus-visible, .theme-palette-scroll:focus-visible { outline: 3px solid var(--theme-secondary); outline-offset: 3px; }
body.dashboard-page .dashboard-module-grid a { border-radius: 12px; border: 1px solid var(--theme-primary); padding: 14px 12px; min-height: 100px; box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-primary) 18%, transparent); }
html[data-dashboard-style="bold"] body.dashboard-page .dashboard-module-grid a { background: var(--theme-primary); }
html[data-dashboard-style="gradient"] body.dashboard-page .dashboard-module-grid a { background: linear-gradient(125deg, var(--theme-primary), var(--theme-primary-hover)); border-bottom: 4px solid var(--theme-secondary); }
html[data-dashboard-style="bold"] body.dashboard-page .dashboard-module-grid a span,
html[data-dashboard-style="gradient"] body.dashboard-page .dashboard-module-grid a span { color: #fff; font-size: .75rem; }
html[data-dashboard-style="bold"] body.dashboard-page .dashboard-module-grid a small,
html[data-dashboard-style="gradient"] body.dashboard-page .dashboard-module-grid a small { color: #fff; opacity: .9; font-size: .64rem; }
html:not([data-dashboard-style="soft"]) body.dashboard-page .dashboard-module-grid a i { color: #fff; background: #ffffff26; width: 34px; height: 34px; }
html[data-dashboard-style="soft"] body.dashboard-page .dashboard-module-grid a { background: var(--theme-soft); }
html[data-dashboard-style="soft"] body.dashboard-page .dashboard-module-grid a span,
html[data-dashboard-style="soft"] body.dashboard-page .dashboard-module-grid a small { color: var(--theme-primary-hover); }
body.dashboard-page .dashboard-module-grid a:hover { border-color: var(--theme-secondary); box-shadow: 0 7px 18px color-mix(in srgb, var(--theme-primary) 30%, transparent); }
body.dashboard-page .dashboard-module-grid a:focus-visible { outline: 3px solid var(--theme-secondary); outline-offset: 3px; }
body.dashboard-page .dashboard-kpi { border-top: 4px solid var(--theme-primary); border-radius: 12px; }
body.dashboard-page .dashboard-welcome { background: linear-gradient(110deg, var(--theme-primary-hover), var(--theme-primary)); border-radius: 12px; }
body.dashboard-page .dashboard-welcome p, body.dashboard-page .dashboard-updated { color: #fff; }
body.dashboard-page .dashboard-welcome:after { border-color: var(--theme-secondary); opacity: .35; }
@media (max-width: 480px) { .dashboard-style-options { grid-template-columns: 1fr; } .theme-palette-scroll { max-height: 300px; } }

/* Sleek custom scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-muted) 35%, transparent) transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-muted) 35%, transparent);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text-muted) 60%, transparent);
}

/* Universal Command Palette (Ctrl+K) Styles */
.command-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 20px;
  animation: cmdBackdropFade 0.18s ease-out;
}
.command-palette-backdrop.active {
  display: flex;
}
@keyframes cmdBackdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.command-palette-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 75vh;
  animation: cmdModalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cmdModalScale {
  from { transform: scale(0.96) translateY(-8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.command-palette-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.command-palette-search-icon {
  width: 20px;
  height: 20px;
  color: var(--theme-primary, var(--accent-primary));
  flex-shrink: 0;
}
.command-palette-input {
  flex: 1;
  background: transparent !important;
  border: 0 !important;
  color: var(--text-primary) !important;
  font-size: 1rem !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: auto !important;
  caret-color: var(--theme-primary, var(--accent-primary));
}
.command-palette-input::placeholder {
  color: var(--text-muted) !important;
}
.command-palette-kbd-esc {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  letter-spacing: 0.05em;
}
.command-palette-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: thin;
}
.command-category-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 10px 10px 4px;
}
.command-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.12s ease;
  color: var(--text-primary);
  text-decoration: none;
  user-select: none;
}
.command-palette-item:hover,
.command-palette-item.selected {
  background: var(--theme-soft, rgba(99, 102, 241, 0.1));
  color: var(--theme-primary, #6366f1);
}
.command-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(125, 125, 125, 0.08);
  color: inherit;
  flex-shrink: 0;
}
.command-item-icon svg {
  width: 16px;
  height: 16px;
}
.command-palette-item.selected .command-item-icon {
  background: var(--theme-primary, #6366f1);
  color: #ffffff;
}
.command-item-info {
  flex: 1;
  min-width: 0;
}
.command-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.command-item-category {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.command-item-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(125, 125, 125, 0.1);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.command-item-badge.action {
  background: color-mix(in srgb, var(--accent-success) 14%, transparent);
  color: var(--accent-success);
}
.command-item-badge kbd {
  font-size: 0.65rem;
  font-weight: 700;
}
.command-palette-footer {
  padding: 9px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.03);
}
.cmd-kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 0.66rem;
  font-weight: 600;
  margin-right: 4px;
}
.command-palette-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
}
.command-palette-empty svg {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Dashboard & Night mode adjustments for header tools and command palette */
.dashboard-page .header-search-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
  height: 34px;
}
.dashboard-page .header-search-btn:hover {
  background: #ffffff;
  border-color: var(--theme-primary);
  color: #1e293b;
}
.dashboard-page .header-icon-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}
.dashboard-page .header-icon-btn:hover {
  background: var(--theme-soft);
  color: var(--theme-primary);
}

html[data-color-mode="night"] .header-search-btn {
  background: #101827;
  border-color: #2c3b53;
  color: #aebbd0;
}
html[data-color-mode="night"] .header-search-btn:hover {
  border-color: var(--theme-primary);
  color: #ffffff;
}
html[data-color-mode="night"] .header-icon-btn {
  background: #101827;
  border-color: #2c3b53;
  color: #aebbd0;
}
html[data-color-mode="night"] .header-icon-btn:hover {
  background: color-mix(in srgb, var(--theme-primary) 22%, #172235);
  color: #ffffff;
}

@media (max-width: 768px) {
  .header-search-text,
  .header-search-kbd {
    display: none;
  }
  .header-search-btn {
    padding: 7px;
    border-radius: 8px;
    margin-right: 6px;
    margin-left: 6px;
    height: 32px;
    width: 32px;
    justify-content: center;
  }
}

