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

:root {
  /* Shulevora Dynamic Branding (injected via theme.js) */
  --shulevora-primary: #4f46e5;
  --shulevora-secondary: #10b981;
  --shulevora-accent: #f59e0b;
  
  /* Standardized Premium SaaS Palette */
  --primary: var(--shulevora-primary);
  --primary-light: #6366f1;
  --primary-dark: #3730a3;
  --primary-alpha: rgba(79, 70, 229, 0.1);
  --primary-alpha-hover: rgba(79, 70, 229, 0.15);

  --success: var(--shulevora-secondary);
  --success-light: #34d399;
  --success-bg: #ecfdf5;

  --warning: var(--shulevora-accent);
  --warning-light: #fbbf24;
  --warning-bg: #fffbeb;

  --danger: #ef4444; 
  --danger-bg: #fef2f2;

  --info: #3b82f6;
  --info-bg: #eff6ff;

  /* Neutrals & Surfaces - High Contrast for Readability */
  --bg-color: #f8fafc; 
  --surface-solid: #ffffff;
  --surface-hover: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Glassmorphism & Elevation */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  
  /* Shadows - Layered for Premium Depth */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-btn: 0 4px 14px 0 rgba(0, 0, 0, 0.1);

  /* Geometry - Refined Golden Ratio */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 40px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Premium Communication UI Extensions */
  --comm-bubble-me: var(--primary);
  --comm-bubble-them: #f1f5f9;
  --comm-padding-x: 2.5rem;
  --comm-padding-y: 2rem;
  --comm-card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Premium Table System Tokens */
  --table-bg: rgba(255, 255, 255, 0.9);
  --table-header-bg: #f8fafc;
  --table-row-hover: rgba(241, 245, 249, 0.5);
  --table-row-stripe: rgba(248, 250, 252, 0.3);
  --table-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  --table-border: 1px solid var(--border-color);
  
  --badge-radius: 100px;

  /* Global Layering Scale - Synced with tokens.css */
  --z-deep: var(--z-deep);
  --z-base: var(--z-base);
  --z-nav-rail: var(--z-nav);
  --z-sidebar: var(--z-sidebar);
  --z-modal: var(--z-modal);
  --z-toast: var(--z-toast);
  --z-critical: var(--z-critical);
}

body {
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Global Header Standardization - Compact Pro System */
h1 { 
    text-align: center !important; 
    font-size: 1.6rem !important; 
    margin: 0 auto !important;
}
h2 { 
    text-align: center !important; 
    font-size: 1.4rem !important; 
    margin: 0 auto !important;
}

#app {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  z-index: var(--z-layout);
}

/* Portal root for body-level overlays */
#shulevora-portal-root {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: var(--z-overlay);
}

#shulevora-portal-root > * {
    pointer-events: auto;
}

:root {
  /* Premium 3D Navigation Tokens */
  --nav-btn-bg: transparent;
  --nav-btn-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --nav-btn-elevation: 0px;
  --nav-btn-active-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --nav-btn-active-elevation: 1px;
  --nav-accent: var(--primary);
}

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

.page-header, .breathable-card, .tab-item {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Vibrant Palette for Communication */
:root {
  --vibrant-blue: #2563eb;
  --vibrant-blue-light: #eff6ff;
  --vibrant-rose: #e11d48;
  --vibrant-rose-light: #fff1f2;
  --vibrant-emerald: #059669;
  --vibrant-emerald-light: #ecfdf5;
  --vibrant-amber: #d97706;
  --vibrant-amber-light: #fffbeb;
  --vibrant-purple: #7c3aed;
  --vibrant-purple-light: #f5f3ff;
  
  --layout-max-width: 100%;
  --sidebar-width: 320px;
  --card-shadow-vibrant: 0 4px 20px -2px rgba(0, 0, 0, 0.1), 0 2px 8px -2px rgba(0, 0, 0, 0.05);
  
  --premium-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --premium-indigo-glow: 0 0 20px rgba(79, 70, 229, 0.3);
}

/* ==========================================================================
   PREMIUM AERO UI SYSTEM
   ========================================================================== */

.premium-header-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.premium-header-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.phc-title-area {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.phc-title {
  color: var(--text-main);
  font-size: 2.2rem !important;
  font-weight: 900 !important;
  letter-spacing: -0.04em !important;
  margin: 0 !important;
  text-align: left !important;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.phc-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

.phc-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Glass Stat Cards */
.glass-stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.glass-stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-2xl);
  border-color: var(--primary-alpha);
}

.gsc-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  background: white;
  box-shadow: var(--shadow-sm);
}

.gsc-label {
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.gsc-value {
  font-size: 1.75rem;
  font-weight: 950;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Command Hero - Dashboard Only */
.command-hero {
  background: linear-gradient(135deg, var(--primary-tone-900) 0%, var(--primary-tone-950) 100%);
  border-radius: 32px;
  padding: 3.5rem;
  margin-bottom: 2.5rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -12px var(--shadow-2xl);
}

.command-hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(225deg, var(--primary-alpha) 0%, transparent 100%);
  pointer-events: none;
}

.centered-container {
  max-width: 100% !important;
  width: 100%;
  overflow-x: hidden;
  margin: 0 auto;
  padding: 0 var(--page-padding) !important;
}

.container {
  max-width: 100% !important;
  width: 100%;
  overflow-x: hidden;
}

.vibrant-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow-vibrant);
  border: 1px solid rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.vibrant-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
}

.text-gradient-vibrant {
  background: linear-gradient(135deg, var(--vibrant-blue) 0%, var(--vibrant-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.platform-announcement-banner {
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

/* ==========================================================================
   PREMIUM DATA TABLE SYSTEM
   ========================================================================== */

.premium-table-container {
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* very subtle */
  border: 1px solid #aabdd2;
  overflow: auto;
}

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

.premium-table thead {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: #1e293b;
}

.premium-table th {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff;
  border: 1px solid #334155;
  background: #1e293b;
  white-space: nowrap;
}

.premium-table td {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  color: #111827;
  border: 1px solid #aabdd2;
  vertical-align: middle;
  white-space: nowrap;
}

.premium-table tbody tr {
  background: #ffffff;
}

.premium-table tbody tr:nth-child(even) {
  background: #d9effa;
}

.premium-table tbody tr:hover td {
  filter: brightness(0.97);
}

/* Frozen Column Support */
.premium-table .frozen {
  position: sticky;
  z-index: 5;
  background: inherit;
}

.premium-table th.frozen {
  z-index: 10;
  background: #1e293b !important; /* Match thead bg */
}

/* Vertical shadow divider for frozen columns */
.premium-table td.frozen:last-of-type, 
.premium-table th.frozen:last-of-type {
  border-right: 2px solid #aabdd2 !important;
  box-shadow: 4px 0 8px rgba(0,0,0,0.05);
}

/* Compact Pro Modifier */
.dt-compact .premium-table th,
.dt-compact .premium-table td {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.dt-compact .metric-card-premium {
  padding: 1rem;
}

.dt-compact .metric-value {
  font-size: 1.5rem;
}

.dt-compact .dt-root {
  gap: 1rem !important;
}

.premium-table th.sortable {
  cursor: pointer;
}

.premium-table th.sortable:hover {
  background: #334155;
}

.premium-table th i.sort-icon {
  margin-left: 0.25rem;
  opacity: 0.4;
  transition: opacity 0.2s;
  color: #94a3b8;
}

.premium-table th.active i.sort-icon {
  opacity: 1;
  color: #38bdf8;
}

/* Column Resizing System */
.premium-table th {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.resizer {
  position: absolute;
  right: 0;
  top: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  height: 100%;
  z-index: 10;
  transition: background 0.2s;
}

.resizer:hover, .resizer.resizing {
  background: var(--primary-alpha);
  border-right: 2px solid var(--primary);
}

.premium-table th.resizing {
  user-select: none;
}

/* Alignment Utilities */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

/* Cell Content Alignment */
.premium-table th.text-center, .premium-table td.text-center { text-align: center !important; }
.premium-table th.text-right, .premium-table td.text-right { text-align: right !important; }

/* Premium Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.875rem;
  border-radius: var(--badge-radius);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge i { font-size: 0.85rem; }

.status-badge-active, .status-badge-paid, .status-badge-present {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.status-badge-inactive, .status-badge-unpaid, .status-badge-absent {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

.status-badge-partial, .status-badge-suspended, .status-badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.status-badge-alumni, .status-badge-transferred {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.status-badge-voided {
    background: #f8fafc;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    font-style: italic;
    opacity: 0.8;
}

/* Premium Metric Cards */
.metric-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card-premium {
  background: white;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.metric-card-premium:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.metric-card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, var(--primary));
}

.metric-card-premium .metric-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.metric-card-premium .metric-value {
  font-size: 2rem;
  font-weight: 950;
  color: var(--text-main);
  line-height: 1;
}

.metric-card-premium .metric-subvalue {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
}

/* Table Actions Customization */
.table-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-table-action {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-table-action:hover {
  background: var(--primary-alpha);
  color: var(--primary);
  border-color: var(--primary-alpha);
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.skeleton-row {
  height: 60px;
  width: 100%;
  margin-bottom: 1px;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--surface-tonal-bg, #f8fafc);
  color: var(--text-main);
  overflow: hidden; /* Global scroll lock. Internal scrolling only. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

h1, h2, h3 { 
  color: var(--text-main); 
  letter-spacing: -0.03em;
}

h1 { 
  font-size: 2.2rem; 
  font-weight: 950; 
  line-height: 1.1; 
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 1.25rem;
}

h1::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 4px;
  background: var(--primary);
  border-radius: 4px;
}

h2 { 
  font-size: 1.8rem; 
  font-weight: 850; 
  line-height: 1.2; 
  margin-bottom: 0.5rem;
}

h3 { 
  font-size: 1.4rem; 
  font-weight: 800; 
  line-height: 1.3; 
}

h4 { 
  font-size: 0.85rem; 
  line-height: 1.5; 
  text-transform: uppercase; 
  letter-spacing: 0.1em; 
  color: var(--text-muted); 
  font-weight: 800; 
}

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

p {
  margin: 0 0 1rem 0;
  color: var(--text-muted);
}

/* ==========================================================================
   LAYOUT ENGINE & GRID
   ========================================================================== */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Clamp to screen */
}

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-color);
}

.app-sidebar {
  width: var(--sidebar-width, 320px);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0;
  border-radius: 0;
  position: sticky;
  top: 0;
  z-index: var(--z-sidebar);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  overflow: visible;
  box-shadow: 20px 0 50px rgba(0,0,0,0.1);
  border-right: 1px solid rgba(255,255,255,0.05);
}

.app-sidebar.collapsed {
  width: var(--sidebar-collapsed-width, 90px);
  margin-left: 0;
}

/* --- CUSTOM SCROLLBAR (Admin Style) --- */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar-nav {
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #e0e0e0;
  border-radius: 10px;
  border: 2px solid #ffffff;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #bdbdbd;
}

/* --- MODERN SECTION HEADERS --- */
.nav-group-section-header {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-group-text, rgba(148, 163, 184, 0.7));
  padding: 0.5rem 1.25rem 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  opacity: 0.6;
}

.header-divider {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.collapsed .nav-group-section-header {
  display: none;
}

.nav-group {
  margin-bottom: 0.25rem;
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 2px; /* 2px gap between buttons for high density */
}

.collapsed .nav-group-label span {
  display: none;
}

/* --- ADMIN NAV ITEMS (Google Pill Style) --- */
/* --- TRUE 3D GLOSSY BUTTONS --- */
.nav-item-m3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 38px;
  padding: 0 1.25rem;
  margin: 0.15rem 0.75rem;
  border-radius: 10px;
  color: var(--sidebar-text);
  background: var(--sidebar-btn-bg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 500;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.nav-item-m3.active {
  background: var(--sidebar-btn-active-bg) !important;
  color: #ffffff !important;
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
}

/* Aura Active Indicator */
.nav-item-m3.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 4px;
  background: white;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px white;
}

.nav-item-m3:hover:not(.active) {
  background: var(--sidebar-btn-hover-bg);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-item-m3:active {
  transform: scale(0.98);
}

.nav-item-m3 i:first-child {
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.nav-item-m3 span {
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.nav-item-m3.active i:first-child,
.nav-item-m3.active span {
  text-shadow: none;
}

.nav-item-m3 .caret-right {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.6;
  transition: transform 0.2s;
}

.nav-item-m3:hover .caret-right {
  transform: translateX(3px);
  opacity: 1;
}

.nav-item-m3:active {
  background: rgba(0,0,0,0.1);
}

/* --- LOGO HEXAGON SHAPE --- */
.brand-logo-node {
  background: #ffffff;
  color: var(--primary);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  width: 42px !important;
  height: 42px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Sidebar Collapsed Re-styling */
.collapsed .nav-item-m3 {
  justify-content: flex-start;
  padding: 0 0 0 calc(45px - 19px); /* Precise alignment for 38px icon in 90px rail */
  margin: 4px 0;
  width: 100%;
  border-radius: 0;
}

/* Nested Indentation for Grouped Items */
.nav-group-items .nav-item-m3 {
  padding-left: 0.875rem; /* No deep indentation needed for filled buttons */
}


/* Tooltip for Collapsed Mode */
.nav-item-m3 .sidebar-tooltip {
  position: absolute;
  left: 100%;
  margin-left: 1.5rem;
  background: #1e293b;
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
}

.collapsed .nav-item-m3:hover .sidebar-tooltip {
  opacity: 1;
  transform: translateX(0);
}

.nav-item-m3 .sidebar-tooltip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1e293b;
}

/* --- SIDEBAR FOOTER & PROFILE --- */
.sidebar-footer {
  padding: 1rem 0;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
}

.profile-card-3d {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--nav-btn-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.profile-card-3d:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  background: var(--nav-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px var(--primary-alpha);
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.collapsed .sidebar-footer {
  margin: 1.5rem 0 0.5rem;
  padding: 1.5rem 0;
  align-items: center;
}

.collapsed .profile-card-3d {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-radius: 10px;
}

.collapsed .profile-info,
.collapsed .profile-card-3d i {
  display: none;
}

/* Logout Button Special Styling */
.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.logout-btn:active {
  transform: translateY(1px) !important;
  box-shadow: inset 0 2px 4px rgba(239, 68, 68, 0.2) !important;
}

/* Tooltip Context Expansion */
.sidebar-tooltip {
  pointer-events: none;
}

.collapsed .profile-card-3d::after {
  content: 'Account';
  position: absolute;
  left: 100%;
  margin-left: 1rem;
  background: #1e293b;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.collapsed .profile-card-3d:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* --- SIDEBAR HEADER --- */
.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  color: #ffffff;
  position: relative;
  z-index: 100;
}

.collapsed .sidebar-header {
  padding: 2rem 0.75rem;
}


/* --- SIDEBAR FOOTER & PROFILE --- */
.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.75rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0,0,0,0.02);
}

.profile-card-3d {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem;
  background: var(--surface-solid);
  border-radius: 16px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
}

.profile-card-3d:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-alpha);
}

.collapsed .profile-card-3d {
  padding: 0;
  width: 52px;
  height: 52px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
  border-radius: 12px;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--nav-btn-active);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.app-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2000;
  overflow: visible;
}

.app-topbar {
  height: var(--header-height, 64px);
  background: var(--bg-taskbar, var(--surface-solid));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  color: var(--taskbar-text, var(--text-main));
}

.app-topbar i {
  color: var(--taskbar-icon, inherit);
}

/* Header Zones */
.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.header-left {
  flex: 1;
  gap: var(--space-3);
  min-width: 0;
}

.header-center {
  flex: 2;
  justify-content: center;
  padding: 0 var(--space-4);
}

.header-right {
  flex: 1;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* Breadcrumbs & Title */
.breadcrumb-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--taskbar-text, var(--text-muted));
  min-width: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  transition: color 0.2s;
  cursor: pointer;
}

.breadcrumb-item:hover {
  color: var(--primary);
}

.breadcrumb-item.active {
  color: var(--text-main);
  font-weight: 700;
  cursor: default;
}

.breadcrumb-separator {
  color: var(--border-color);
  font-size: 0.8rem;
}

/* Global Search Component */
.global-search-wrapper {
  width: 100%;
  max-width: 540px;
  position: relative;
}

.search-input-group {
  position: relative;
  width: 100%;
}

.search-input-group i {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.15rem;
  transition: color 0.3s;
}

.search-input-group input {
  width: 100%;
  padding: 0.75rem 1.25rem 0.75rem 3rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-main);
}

.search-input-group input:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-alpha);
  outline: none;
}

.search-input-group input:focus + i {
  color: var(--primary);
}

.search-kbd {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  background: var(--surface-solid);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

/* Search Dropdown */
.search-results-overlay {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  max-height: 480px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
  animation: dropdownShow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-category {
  padding: 1.25rem 1.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}

.search-result-item:hover {
  background: var(--primary-alpha);
}

.result-icon {
  width: 38px;
  height: 38px;
  background: var(--surface-solid);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.1rem;
}

.result-content {
  flex: 1;
}

.result-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

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

/* --- HEADER WORKSPACE SWITCHER --- */
.header-workspace-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.65rem 0.4rem 0.4rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin-left: 0.5rem;
}

.header-workspace-pill:hover {
  border-color: var(--primary-alpha);
  background: var(--surface-solid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.hw-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 4px 8px var(--primary-alpha);
}

.hw-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hw-caret {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.header-workspace-item {
  padding: 0.75rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s;
  cursor: pointer;
  color: var(--text-main);
  margin-top: 2px;
}

.header-workspace-item:hover {
  background: var(--bg-color);
  transform: translateX(4px);
}

.header-workspace-item.active {
  background: var(--primary-alpha);
  color: var(--primary);
}

.hwi-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Header Actions */
.header-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--taskbar-icon, var(--text-muted));
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  background: transparent;
  border: none;
}

.header-action-btn:hover {
  background: var(--primary-alpha);
  color: var(--primary);
  transform: translateY(-3px);
}

.header-action-btn:active {
  transform: translateY(0) scale(0.95);
}

.header-action-btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* User Profile Trigger */
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem 0.25rem 0.75rem;
  background: var(--bg-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.profile-trigger:hover {
  border-color: var(--primary-alpha);
  background: var(--surface-solid);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.profile-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px var(--primary-alpha);
}

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

@media (max-width: 1024px) {
  .header-center { display: none; }
}

@media (max-width: 768px) {
  .header-left { display: none; } /* hamburger will still show on left in mobile grid */
  .app-topbar { padding: 0 1rem; }
}

.app-content {
  flex: 1;
  padding: 2.5rem;
  background-color: var(--surface-tonal-bg);
  background-image: 
    radial-gradient(at 0% 0%, var(--surface-tint) 0, transparent 50%), 
    radial-gradient(at 50% 0%, rgba(255,255,255,0.5) 0, transparent 50%);
  min-height: 100vh;
}

/* Constrain and center all page content within the scroll area */
.app-content > div {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* 12-Column Grid System */
.grid { display: grid; }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Responsive Grid Adapters (Mobile First approximation) */
@media (min-width: 1600px) {
  .dt-root {
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
  }
}
@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cols-3 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .app-sidebar { display: none; /* In full implementation, this becomes a slide-out drawer */ }
  .app-content { padding: 1.25rem; }
  .grid-cols-4, .grid-cols-2 { grid-template-columns: 1fr; }
}

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

/* Cards & Panels */
.glass-panel {
  background: var(--surface-solid);
  background-image: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card {
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle, var(--border-color));
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  padding: var(--card-padding-sm) var(--card-padding);
  border-bottom: 1px solid var(--border-subtle, var(--border-color));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: var(--card-padding);
}

.card-metric {
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle, var(--border-color));
  padding: 1.75rem 2.25rem;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-metric:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  transform: translateY(-5px) scale(1.02);
  border-color: var(--primary-alpha);
}

.card-metric .title {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-metric .value {
  font-size: 2.2rem;
  font-weight: 950;
  color: var(--text-main);
  margin-top: 0.75rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.card-metric .desc {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  user-select: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px var(--primary-alpha);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-subtle, var(--border-color));
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-light);
  transform: translateY(-1px);
}

/* Forms & Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

.input-control {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle, var(--border-color));
  background: white;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  color: var(--text-main);
  width: 100%;
}

.input-control::placeholder {
  color: var(--text-light);
}

.input-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
}

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

.table thead {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-subtle, var(--border-color));
}

.table th {
  padding: 0.875rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table td {
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);
}

.table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
  background-color: var(--surface-hover);
}

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

/* Badges & Status Chips */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-emerald { background: var(--success-bg); color: var(--success); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-blue { background: var(--info-bg); color: var(--info); }
.badge-gray { background: var(--bg-color); color: var(--text-muted); border: 1px solid var(--border-subtle, var(--border-color)); }

/* Navigation Item Refinement */
.sidebar-nav {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-alpha);
  color: var(--primary);
  font-weight: 600;
}

.nav-item i {
  font-size: 1.25rem;
  color: inherit;
}

.nav-item-m3.locked {
  cursor: pointer; 
  position: relative;
  pointer-events: auto !important;
}

.nav-item-m3.locked i:first-child {
  /* Icon colors maintained */
}

.nav-item-m3.locked:hover {
  background: var(--admin-grey-hover) !important;
}


.upgrade-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease;
}

.upgrade-card {
  background: white;
  padding: 3rem;
  border-radius: 24px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 40px 100px -20px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--border-subtle, var(--border-color));
}
.animation-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

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

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}

/* Extra badge variants */
.badge-purple { background: rgba(124,58,237,0.1); color: #7c3aed; }
.badge-teal   { background: rgba(13,148,136,0.1); color: #0d9488; }
.badge-slate  { background: rgba(71,85,105,0.1);  color: #475569; }


/* Skeleton Loading Shimmer */
.skeleton {
  background: #e2e8f0;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Settings Vertical Nav */
.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.875rem 1.125rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  margin-bottom: 0.25rem;
}

.nav-item-btn i {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.nav-item-btn:hover {
  background: var(--bg-color);
  color: var(--text-main);
  transform: translateX(4px);
}

.nav-item-btn.active {
  background: var(--primary-alpha);
  color: var(--primary);
  border-color: var(--primary-alpha);
  box-shadow: 0 4px 12px var(--primary-alpha);
}

.nav-item-btn.active i {
  color: var(--primary);
}

/* Utilities */
.w-full { width: 100%; }
.h-full { height: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.font-bold { font-weight: 700; }
.font-numeric { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Auth Layouts */
.auth-container {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  background-image: radial-gradient(circle at top right, var(--primary-alpha) 0%, transparent 40%),
                    radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 3rem 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle, var(--border-color));
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--emerald, #10b981));
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 48px;
  height: 48px;
  background: var(--primary-alpha);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
}

.vibrant-modal-icon {
  width: 64px;
  height: 64px;
  background: var(--icon-tint-alpha);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-tint);
  font-size: 1.5rem;
  margin: 0 auto 1.5rem auto;
  border: 1px solid var(--icon-tint-alpha);
}

/* Custom tab buttons for profile */
.tab-btn {
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.tab-btn:hover {
  color: var(--text-main);
  background: var(--surface-hover);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ==========================================================================
   PARENT MOBILE EXPERIENCE ENGINE
   ========================================================================== */

/* Parent-specific color accents */
:root {
  --parent-accent: hsl(210, 70%, 42%);
  --parent-accent-light: hsl(210, 70%, 95%);
  --parent-warm: hsl(32, 90%, 50%);
  --parent-warm-bg: hsl(32, 100%, 95%);
  --parent-calm: hsl(160, 60%, 40%);
  --parent-calm-bg: hsl(160, 60%, 95%);
  --parent-danger: hsl(0, 72%, 51%);
  --parent-danger-bg: hsl(0, 86%, 97%);
  --parent-purple: hsl(270, 60%, 55%);
  --parent-purple-bg: hsl(270, 60%, 96%);
}

/* ---- Parent App Layout (Mobile-First, no sidebar) ---- */
.parent-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-color);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.parent-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--border-subtle, var(--border-color));
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  z-index: 20;
}

.parent-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.parent-topbar-logo {
  width: 30px;
  height: 30px;
  background: var(--parent-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 800;
}

.parent-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  padding-bottom: 5.5rem; /* room for bottom nav */
  scroll-behavior: smooth;
}

/* ---- Bottom Navigation Bar ---- */
.parent-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--surface-solid);
  border-top: 1px solid var(--border-subtle, var(--border-color));
  box-shadow: 0 -4px 12px rgba(0,0,0,0.07);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 0 0.625rem;
  z-index: 100;
}

.parent-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: var(--text-muted);
  position: relative;
  min-width: 56px;
}

.parent-nav-item i {
  font-size: 1.35rem;
  line-height: 1;
}

.parent-nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.parent-nav-item.active {
  color: var(--parent-accent);
}

.parent-nav-item.active i {
  transform: translateY(-1px);
}

.parent-nav-badge {
  position: absolute;
  top: 0;
  right: 8px;
  background: var(--parent-danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--surface-solid);
}

/* ---- Child Selector Pills ---- */
.child-selector {
  display: flex;
  gap: 0.625rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
}
.child-selector::-webkit-scrollbar { display: none; }

.child-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 2px solid var(--border-subtle, var(--border-color));
  background: var(--surface-solid);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}
.child-pill.active {
  border-color: var(--parent-accent);
  background: var(--parent-accent-light);
  color: var(--parent-accent);
}
.child-pill:hover:not(.active) {
  border-color: #cbd5e1;
  background: var(--surface-hover);
}

.child-pill-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--parent-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---- Hero Fee Card ---- */
.parent-hero-card {
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.parent-hero-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.parent-hero-card::after {
  content: '';
  position: absolute;
  bottom: -50px; left: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}

.hero-gradient-blue {
  background: linear-gradient(135deg, hsl(220,65%,30%) 0%, hsl(210,70%,40%) 100%);
  color: white;
}
.hero-gradient-green {
  background: linear-gradient(135deg, hsl(160,60%,30%) 0%, hsl(150,65%,40%) 100%);
  color: white;
}
.hero-gradient-amber {
  background: linear-gradient(135deg, hsl(28,80%,45%) 0%, hsl(38,90%,52%) 100%);
  color: white;
}
.hero-gradient-red {
  background: linear-gradient(135deg, hsl(0,65%,45%) 0%, hsl(10,70%,52%) 100%);
  color: white;
}

/* ---- Engagement Nudge Banner ---- */
.engagement-nudge {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.125rem;
  border-left: 4px solid;
  animation: fadeIn 0.5s ease-out;
}
.nudge-warning {
  background: var(--parent-warm-bg);
  border-color: var(--parent-warm);
  color: hsl(28,80%,35%);
}
.nudge-danger {
  background: var(--parent-danger-bg);
  border-color: var(--parent-danger);
  color: hsl(0,65%,40%);
}
.nudge-success {
  background: var(--parent-calm-bg);
  border-color: var(--parent-calm);
  color: hsl(160,55%,30%);
}
.nudge-info {
  background: var(--parent-accent-light);
  border-color: var(--parent-accent);
  color: var(--parent-accent);
}

.nudge-icon { font-size: 1.375rem; flex-shrink: 0; }
.nudge-text { flex: 1; font-size: 0.85rem; font-weight: 600; line-height: 1.4; }
.nudge-cta {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1.5px solid currentColor;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  color: inherit;
  transition: all var(--transition-fast);
}

/* ---- Section Label ---- */
.parent-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  margin-top: 0.25rem;
}

/* ---- Stat Row Cards ---- */
.parent-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.125rem;
}
.parent-stat-card {
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.parent-stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.parent-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-main);
  line-height: 1;
}
.parent-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ---- Quick Actions Grid ---- */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}
.quick-action-btn:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.quick-action-btn i {
  font-size: 1.4rem;
}
.quick-action-btn span {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
}

/* ---- Attendance Ring (CSS only) ---- */
.attendance-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.ring-container {
  position: relative;
  width: 80px;
  height: 80px;
}
.ring-svg {
  transform: rotate(-90deg);
}
.ring-track { fill: none; stroke: var(--border-subtle, var(--border-color)); stroke-width: 8; }
.ring-bar { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 0.8s ease; }
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

/* ---- Subject Score Cards ---- */
.subject-score-card {
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: var(--radius-lg);
  padding: 1rem 1.125rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.625rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.subject-score-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}
.subject-score-bar-track {
  height: 5px;
  background: var(--border-subtle, var(--border-color));
  border-radius: 9999px;
  flex: 1;
  overflow: hidden;
}
.subject-score-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s ease;
}

/* ---- Notice Card ---- */
.notice-card {
  background: var(--surface-solid);
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.notice-card.urgent {
  border-color: var(--parent-danger);
  border-left: 4px solid var(--parent-danger);
}
.notice-card.pinned {
  background: linear-gradient(135deg, hsl(220,65%,98%) 0%, hsl(210,70%,96%) 100%);
  border-color: var(--parent-accent);
  border-left: 4px solid var(--parent-accent);
}
.notice-unread-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--parent-accent);
  position: absolute;
  top: 1rem; right: 1rem;
  flex-shrink: 0;
}

/* ---- Message Bubble ---- */
.msg-thread {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0;
}
.msg-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.msg-bubble.from-parent {
  align-self: flex-end;
  background: var(--parent-accent);
  color: white;
  border-bottom-right-radius: 4px;
}
.msg-bubble.from-school {
  align-self: flex-start;
  background: var(--surface-hover);
  color: var(--text-main);
  border-bottom-left-radius: 4px;
}
.msg-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 500;
}
.msg-input-bar {
  display: flex;
  gap: 0.625rem;
  padding: 0.75rem;
  background: var(--surface-solid);
  border-top: 1px solid var(--border-subtle, var(--border-color));
  position: sticky;
  bottom: 0;
}
.msg-input {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle, var(--border-color));
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg-color);
  outline: none;
}
.msg-input:focus {
  border-color: var(--parent-accent);
}
.msg-send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--parent-accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}
.msg-send-btn:hover { opacity: 0.85; transform: scale(1.05); }

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0.5625rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border-subtle, var(--border-color));
}
.timeline-item {
  position: relative;
  padding: 0 0 1.25rem 0.875rem;
}
.timeline-dot {
  position: absolute;
  left: -1.1rem;
  top: 0.25rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--surface-solid);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.timeline-title { font-size: 0.875rem; font-weight: 600; color: var(--text-main); }
.timeline-desc { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.125rem; }
.timeline-date { font-size: 0.7rem; color: var(--text-light); margin-top: 0.2rem; }

/* ---- Office Selector Chips ---- */
.office-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scrollbar-width: none;
  margin-bottom: 1rem;
}
.office-chips::-webkit-scrollbar { display: none; }
.office-chip {
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  border: 1.5px solid var(--border-subtle, var(--border-color));
  background: var(--surface-solid);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.office-chip.active {
  border-color: var(--parent-accent);
  background: var(--parent-accent-light);
  color: var(--parent-accent);
}

/* ---- Toggle Switch ---- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 0.9rem; font-weight: 500; color: var(--text-main); }
.toggle-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.125rem; }
.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-subtle, var(--border-color));
  border-radius: 9999px;
  transition: background 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  left: 3px; top: 3px;
  background: white;
  transition: transform 0.25s;
  box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-slider { background: var(--parent-accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---- Fee Invoice Row ---- */
.fee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}
.fee-row:last-child { border-bottom: none; }
.fee-row:hover { background: var(--surface-hover); }

/* ---- Parent page header ---- */
.parent-page-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.parent-page-header h2 {
  font-size: 1.2rem;
  color: var(--text-main);
}
.parent-page-header p {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---- Responsive: full width on larger screens ---- */
@media (min-width: 481px) {
  .parent-app {
    border-left: 1px solid var(--border-subtle, var(--border-color));
    border-right: 1px solid var(--border-subtle, var(--border-color));
    box-shadow: var(--shadow-xl);
  }
  .parent-bottom-nav {
    border-radius: 0;
  }
}

/* ---- Compact attendance bar ---- */
.attendance-bar-track {
  height: 10px;
  background: var(--border-subtle, var(--border-color));
  border-radius: 9999px;
  overflow: hidden;
  flex: 1;
}
.attendance-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.8s ease;
}

/* ---- Parent Sidebar (Hidden on Mobile) ---- */
.parent-sidebar {
  display: none;
}

/* ---- Responsive Parent Portal (Tablet & Desktop) ---- */
@media (min-width: 768px) {
  body.parent-portal-active {
    background-color: #f1f5f9; /* Subtle contrast for centered app */
    min-height: 100vh;
  }
  .parent-portal-active .parent-app {
    max-width: 1100px; /* Reduced from full width for a focused feel */
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 64px 1fr;
    grid-template-areas:
      "sidebar topbar"
      "sidebar main";
    border: none;
    box-shadow: 0 0 60px rgba(0,0,0,0.08);
    background: white;
    min-height: 100vh;
    position: relative;
  }
  .parent-topbar {
    grid-area: topbar;
    padding: 0 2rem;
    border-bottom: 1px solid var(--border-subtle, var(--border-color));
  }
  .parent-topbar-brand {
    display: none;
  }
  .parent-sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    background: var(--surface-solid);
    border-right: 1px solid var(--border-subtle, var(--border-color));
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
  }
  .parent-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
  }
  .parent-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
  }
  .parent-nav-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
  }
  .parent-nav-item i {
    font-size: 1.35rem;
    margin-right: 0.5rem;
  }
  .parent-nav-item span {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
  }
  .parent-nav-item.active {
    background: var(--parent-accent-light);
  }
  .parent-scroll-area {
    grid-area: main;
    padding: 2rem;
    padding-bottom: 2rem;
  }
  .parent-bottom-nav {
    display: none; /* Hide bottom nav on tablet and up */
  }

  /* Refine Inner Grids for Tablet/Desktop */
  .quick-actions-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .parent-stat-row {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  .parent-stat-row .vibrant-card {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
  }
  .parent-top-cards {
    grid-template-columns: 1fr 1fr;
  }
  .parent-hero-card {
    padding: 2.5rem;
  }
  .parent-hero-card::before {
    width: 200px; height: 200px;
    top: -50px; right: -50px;
  }
}

@media (min-width: 1024px) {
  .parent-portal-active .parent-app {
    max-width: 1200px;
    grid-template-columns: 280px 1fr;
  }
  .parent-portal-active .parent-scroll-area {
    padding: 2.5rem 3rem;
  }
}

/* Premium 3D Modern Dialog System */
.shulevora-dialog-overlay, .vibrant-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  perspective: 1200px; /* Essential for 3D entry */
}

.shulevora-dialog-overlay.active, .vibrant-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.shulevora-dialog-card, .vibrant-modal-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  width: 100%;
  max-width: 480px;
  border-radius: 36px;
  padding: 3.5rem 3rem 3rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: 
    0 50px 100px -20px rgba(15, 23, 42, 0.3), 
    0 0 0 1px rgba(255, 255, 255, 0.7) inset,
    inset 0 4px 6px -1px rgba(255, 255, 255, 1);
  transform: scale(0.8) translateY(60px);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: visible !important; /* Critical to allow icon to pop out top */
}

.shulevora-dialog-card.wide, .vibrant-modal-card.wide {
  max-width: 640px;
}

.shulevora-dialog-overlay.active .shulevora-dialog-card, 
.vibrant-modal-overlay.active .vibrant-modal-card {
  transform: scale(1) translateY(0);
}

.shulevora-dialog-icon, .vibrant-modal-icon {
  width: 90px;
  height: 90px;
  border-radius: 30px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  margin: 0 auto 2rem;
  transform: translateY(-50%);
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -45px;
  box-shadow: 
    0 25px 45px -10px rgba(14, 165, 233, 0.6),
    inset 0 4px 6px -1px rgba(255,255,255,0.4),
    0 0 0 8px #ffffff;
  border: none;
  z-index: 10;
}

/* Adjust title padding to account for the absolute positioned icon */
.shulevora-dialog-title, .vibrant-modal-title {
  margin-top: 1rem;
  font-size: 1.7rem;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 1rem;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.shulevora-dialog-body, .vibrant-modal-body {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.6;
  font-weight: 500;
  margin-bottom: 2.5rem;
}

.shulevora-dialog-actions, .vibrant-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
}

.vibrant-modal-actions.row-flex {
  flex-direction: row;
  justify-content: center;
}

.shulevora-dialog-btn, .vibrant-modal-btn {
  padding: 1.15rem 1.5rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
  width: 100%;
}

.shulevora-dialog-btn-primary, .vibrant-modal-btn-primary {
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 
    0 15px 35px -10px rgba(14, 165, 233, 0.5),
    inset 0 2px 4px rgba(255,255,255,0.3);
  border: 1px solid #0369a1;
}

.shulevora-dialog-btn-primary:hover, .vibrant-modal-btn-primary:hover {
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
  transform: translateY(-3px);
  box-shadow: 
    0 25px 50px -12px rgba(14, 165, 233, 0.6),
    inset 0 2px 4px rgba(255,255,255,0.4);
}

.shulevora-dialog-btn-secondary, .vibrant-modal-btn-secondary {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  color: #475569;
  border: 1px solid #cbd5e1;
  box-shadow: 
    0 10px 20px -5px rgba(0,0,0,0.05),
    inset 0 2px 0 rgba(255,255,255,1);
}

.shulevora-dialog-btn-secondary:hover, .vibrant-modal-btn-secondary:hover {
  background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a;
  transform: translateY(-3px);
  box-shadow: 
    0 15px 30px -5px rgba(0,0,0,0.1),
    inset 0 2px 0 rgba(255,255,255,1);
}

.shulevora-dialog-btn:active, .vibrant-modal-btn:active {
  transform: scale(0.97) translateY(0);
  box-shadow: none;
}

/* Super Admin Elegant UI System */
.sa-centered-main {
  max-width: min(1800px, 98vw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.section-collapsible {
  transition: all 0.3s ease;
  overflow: hidden;
}

.section-collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

.toggle-icon {
  transition: transform 0.3s ease;
  cursor: pointer;
}

.toggle-icon.rotated {
  transform: rotate(-90deg);
}

.sa-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle, var(--border-color));
}

.sa-header-item {
  flex: 1;
  padding: 0 1rem;
  font-size: 0.725rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sa-header-item:first-child { padding-left: 0; }
.sa-header-item:last-child { padding-right: 0; }

.sa-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  background: var(--surface-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.sa-data-row:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--primary-alpha);
  background: var(--bg-color);
}

.sa-row-section {
  flex: 1;
  padding: 0 1rem;
}

.sa-row-section:first-child { padding-left: 0; }
.sa-row-section:last-child { padding-right: 0; flex: 0 0 auto; min-width: 200px; text-align: right; }

.sa-label {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}


/* ---- Suspended / Read-Only Mode ---- */
.suspended-banner {
    background: #fff1f2;
    border-bottom: 2px solid #fee2e2;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #991b1b;
    z-index: 1000;
    position: sticky;
    top: 0;
    box-shadow: 0 4px 12px rgba(153, 27, 27, 0.08);
}

.suspended-banner-cta {
    background: #991b1b;
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.2s;
}

.suspended-banner-cta:hover {
    background: #7f1d1d;
    transform: scale(1.05);
}

.suspended-portal .app-sidebar {
    filter: grayscale(0.8) opacity(0.9);
}

.suspended-portal .btn-primary:not(#logoutBtn):not(.no-block),
.suspended-portal .btn-success:not(.no-block) {
    background: #94a3b8 !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

.feature-locked-card {
    max-width: 420px;
    padding: 3.5rem 2.5rem;
    border-radius: 32px;
}

.sa-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}

/* Refined List Headers */
.sa-list-header {
  display: flex;
  padding: 0 1.75rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sa-header-item {
  flex: 1;
  padding: 0 1rem;
}
.sa-header-item:first-child { padding-left: 0; }
.sa-header-item:last-child { padding-right: 0; flex: 0 0 auto; min-width: 200px; text-align: right; }

/* Dashboard Metric Enhancements */
.sa-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.sa-metric-card {
  background: white;
  padding: 1.75rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.sa-metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}


/* ---- Suspension Action Guard (Non-bypassable Overlay) ---- */
.app-main {
    position: relative; /* Ensure overlay covers this relative container */
}

.suspension-action-guard {
    position: fixed;
    inset: 0;
    backdrop-filter: blur(16px) grayscale(0.2);
    background: rgba(15, 23, 42, 0.5);
    z-index: 10000;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.guard-notice-card {
    background: white;
    max-width: 480px;
    width: 100%;
    padding: 3.5rem 3rem;
    border-radius: 32px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.guard-icon-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--btn-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    margin: 0 auto 2rem;
    box-shadow: 0 10px 25px -5px var(--primary-alpha);
}

.guard-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.guard-body {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 2.5rem;
}

.guard-cta-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---- Invoice Print Support ---- */
@media print {
    body * { visibility: hidden; }
    .invoice-modal-overlay { background: transparent !important; }
    .invoice-modal-overlay, .invoice-modal-overlay * { visibility: visible; }
    .invoice-modal-overlay .invoice-container { position: absolute; left: 0; top: 0; padding: 0 !important; margin: 0 !important; border: none; box-shadow: none; max-width: 100% !important; background: white; }
    .no-print, .no-print * { display: none !important; visibility: hidden !important; }
}

/* ==========================================================================
   MODAL & OVERLAY ENHANCEMENTS
   ========================================================================== */

/* The vibrant-modal rules have been merged into the Premium 3D Modern Dialog System above. */

/* Super Admin Tabs */
.sa-tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 10px;
}

.sa-tab:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.sa-tab.active {
    color: var(--primary);
    background: var(--primary-alpha);
}

.sa-tab.active::after {
    content: '';
    position: absolute;
    bottom: -0.6rem;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 10px var(--primary-alpha);
}

.sa-tab i {
    font-size: 1.1rem;
    opacity: 0.7;
}

.sa-tab.active i {
    opacity: 1;
}

.copy-pass-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

tr:hover .copy-pass-btn {
    opacity: 1;
}

/* --- High-Density Matrix Tables (Exams) --- */
#matrixMasterTable, #resultsAuditTable {
    width: max-content !important;
    min-width: 100%;
}

#matrixMasterTable th, #matrixMasterTable td,
#resultsAuditTable th, #resultsAuditTable td {
    padding: 0.15rem 0.35rem !important;
    white-space: nowrap;
}

#matrixMasterTable .input-cell,
.choice-btn {
    flex: 1;
    background: transparent;
    color: #64748b;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 0;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.choice-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #1e1b4b;
}

.choice-btn.active {
    background: white;
    color: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

.input-premium {
    width: 100%;
    height: 52px;
    padding: 0 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: white;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    transition: all 0.2s;
    outline: none;
}

#matrixMasterTable .input-cell,
#resultsAuditTable .input-cell {
    width: 60px;
    height: 20px;
    padding: 0;
    margin: 0;
    border: 1px solid transparent;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-sizing: border-box;
    color: inherit;
}

#matrixMasterTable .input-cell:focus,
#resultsAuditTable .input-cell:focus {
    background: #fff;
    border: 1px solid var(--primary);
    border-radius: 4px;
    outline: none;
}

/* Remove numeric spinners for clean matrix UX */
#matrixMasterTable .input-cell::-webkit-outer-spin-button,
#matrixMasterTable .input-cell::-webkit-inner-spin-button,
#resultsAuditTable .input-cell::-webkit-outer-spin-button,
#resultsAuditTable .input-cell::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
#matrixMasterTable .input-cell[type=number],
#resultsAuditTable .input-cell[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}


/* Premium Toggle Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .4s;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}
/* ==========================================================================
   BREADCRUMB SYSTEM
   ========================================================================== */

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.breadcrumb-item {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.breadcrumb-item.active {
    color: var(--text-main);
    font-weight: 800;
}

.breadcrumb-item.clickable {
    cursor: pointer;
    color: var(--primary);
}

.breadcrumb-item.clickable:hover {
    background: var(--primary-alpha);
    color: var(--primary-dark);
}

.breadcrumb-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ==========================================================================
   3D GLOSSY TASKBAR ARCHITECTURE (SHULEVORA PRO)
   ========================================================================== */

:root {
  --taskbar-3d-bg: #ffffff;
  --taskbar-3d-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --taskbar-inset-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(255, 255, 255, 0.8);
}

.app-topbar-3d {
  height: 64px;
  background: var(--bg-card) !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* --- LEFT ZONE --- */
.header-left-3d {
  display: flex !important;
  align-items: center;
  gap: var(--space-3);
  z-index: 2;
}

/* --- CENTER ZONE: INSET 3D SEARCH --- */
.header-center-3d {
  flex: 1;
  max-width: 480px;
  margin: 0 var(--space-6);
  z-index: 2;
  display: block;
}

.taskbar-search-vessel {
  position: relative;
  display: flex !important;
  align-items: center;
  background: var(--slate-100); /* was slate-50 — deeper contrast on white header */
  border-radius: 12px;
  padding: 0 var(--space-4);
  height: 40px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0,0,0,0.1); /* more visible border */
}

.taskbar-search-vessel:focus-within {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}

.taskbar-search-vessel i {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.taskbar-search-input {
  background: transparent;
  border: none;
  width: 100%;
  height: 100%;
  padding: 0 var(--space-3);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
}

.taskbar-search-kbd {
  display: flex;
  align-items: center;
  gap: 2px;
  background: white;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

/* --- RIGHT ZONE: MINI 3D BUTTONS --- */
.header-right-3d {
  display: flex !important;
  align-items: center;
  gap: var(--space-3);
  z-index: 2;
}

.taskbar-action-btn-3d {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  padding: 0;
  margin: 0;
}

/* No gloss overlay needed in Aura theme */

.taskbar-action-btn-3d:hover {
  background: var(--slate-100);
  border-color: var(--border-color);
  color: var(--text-main);
}

.taskbar-action-btn-3d:active {
  background: var(--slate-200);
  transform: scale(0.95);
}

.taskbar-action-btn-3d i {
  font-size: 1.25rem;
}

/* 3D Notification Badge */
.taskbar-badge-3d {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger, #ef4444);
  color: white;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 900;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 3;
}

/* 3D Profile Section */
.taskbar-profile-3d {
  display: flex !important;
  align-items: center;
  gap: var(--space-2);
  padding: 4px;
  padding-right: var(--space-3);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  height: 40px;
}

.taskbar-profile-3d:hover {
  background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.1);
}


/* ==========================================================================
   PREMIUM 3D FLOATING TASKBAR (HAPTIC ENGINE)
   ========================================================================== */

.app-topbar-3d {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 2000;
}

.sidebar-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem 0.75rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 2001;
  transition: all 0.3s;
}

/* 3D Taskbar Gloss Layer */
.app-topbar-3d::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48%;
  background: linear-gradient(to bottom, 
    rgba(255,255,255,0.2), 
    rgba(255,255,255,0.02)
  );
  pointer-events: none;
  border-radius: 0;
}

.header-left-3d, .header-right-3d {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 2;
}

/* 3D Sunken Well (Search & Breadcrumbs) */
.taskbar-well-3d {
  background: var(--taskbar-well-bg, rgba(0,0,0,0.06));
  border-radius: 12px;
  padding: 0 1rem;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 
    inset 0 2px 5px rgba(0,0,0,0.15),
    inset 0 -1px 1px rgba(255,255,255,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  transition: all 0.2s;
}

/* Taskbar Action Buttons (Convex Small) */
.taskbar-action-btn-3d {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, 
    var(--taskbar-top), 
    var(--bg-taskbar) 50%, 
    var(--taskbar-bottom)
  );
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--taskbar-icon);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.3),
    0 4px 8px rgba(0,0,0,0.1);
  position: relative;
  z-index: 2;
}

.taskbar-action-btn-3d:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 8px 16px rgba(0,0,0,0.2);
}

.taskbar-action-btn-3d:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

/* Search Vessel Modernization */
.header-center-3d {
  flex: 1;
  max-width: 500px;
  margin: 0 1.5rem;
  z-index: 2;
}

.taskbar-search-vessel {
  width: 100%;
  position: relative;
  background: var(--taskbar-well-bg);
  border-radius: 12px;
  padding: 0 1rem;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 
    inset 0 2px 6px rgba(0,0,0,0.2),
    inset 0 -1px 1px rgba(255,255,255,0.05);
  border: 1px solid rgba(0,0,0,0.1);
}

.taskbar-search-vessel i {
  color: var(--taskbar-text);
  opacity: 0.6;
}

.taskbar-search-input {
  background: transparent;
  border: none;
  color: var(--taskbar-text);
  font-size: 0.875rem;
  font-weight: 500;
  width: 100%;
  outline: none;
}

.taskbar-search-input::placeholder {
  color: var(--text-muted); /* was taskbar-text */
  opacity: 0.7; /* was 0.5 */
}

.taskbar-search-kbd {
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--taskbar-text);
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Breadcrumb Container well refinement */
.breadcrumb-container {
  background: var(--taskbar-well-bg);
  padding: 0 1rem;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.05);
}

.breadcrumb-item {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--taskbar-text);
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.breadcrumb-item:hover {
  opacity: 1;
}

.breadcrumb-item.active {
  opacity: 1;
  color: white;
  cursor: default;
}

.breadcrumb-separator {
  color: var(--taskbar-text);
  opacity: 0.4;
  font-size: 0.7rem;
}

.taskbar-badge-3d {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 950;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-taskbar);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.taskbar-profile-3d {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 5px 14px 5px 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 300px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.05);
  z-index: 2;
}

.taskbar-profile-3d:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  transform: scale(1.02);
}

.taskbar-avatar-3d {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--taskbar-top), var(--taskbar-bottom));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 0.85rem;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

@media (max-width: 1024px) {
  .app-topbar-3d {
    margin: 8px 12px;
    padding: 0 0.75rem;
  }
  .header-center-3d {
    display: none;
  }
}

/* PREMIUM 3D HEADER BRANDING */
.header-branding-vessel {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0 0.5rem;
  max-width: 320px;
  min-width: 0;
}

.hb-logo {
  width: 36px;
  height: 36px;
  background: white;
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.hb-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hb-name {
  font-size: 0.95rem;
  font-weight: 850;
  color: white;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.hb-tagline {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* PREMIUM 3D SIDEBAR WORKSPACE SWITCHER */
.sidebar-workspace-3d {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 5px 12px;
  margin: 0 0.5rem;
  background: var(--taskbar-well-bg, rgba(0,0,0,0.06));
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  border-radius: 12px;
  cursor: pointer;
  height: 42px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.sidebar-workspace-3d:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.sw-icon-node {
  width: 38px;
  height: 38px;
  background: white;
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.sw-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sw-name {
  font-size: 0.85rem;
  font-weight: 850;
  color: white;
  line-height: 1.1;
}

.sw-action {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.5);
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 2px;
}

.sw-caret {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
}

/* SIDEBAR WORKSPACE DROPDOWN */
.sidebar-dropdown-3d {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  padding: 0.75rem;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  border: 1px solid white;
  animation: slideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sd-header {
  font-size: 0.65rem;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 0.5rem;
}

.sidebar-workspace-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border-radius: 12px;
  transition: all 0.2s;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.85rem;
}

.sidebar-workspace-item:hover {
  background: var(--primary-alpha);
  color: var(--primary);
  transform: translateX(4px);
}

.sidebar-workspace-item.active {
  background: var(--bg-color);
  color: var(--primary);
}

.swi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--primary-alpha);
  color: var(--primary);
}

.sidebar-workspace-item.active .swi-icon {
  background: var(--primary);
  color: white;
}

/* --- THE SHULEVORA IMPORT WIZARD (PREMIUM DESIGN) --- */

.wizard-glass-node {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 20px 40px -12px rgba(0,0,0,0.15) !important;
    width: 740px !important;
    max-width: 95vw !important;
}

.dropzone-3d {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border-color: var(--primary);
    background: var(--primary-alpha);
}

.dropzone-3d:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -15px var(--primary-alpha);
    background: white;
}

.dropzone-3d.dragover {
    border-color: var(--success);
    background: var(--success-alpha);
    transform: scale(0.96);
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    opacity: 0.4;
}

.step-node.active { opacity: 1; transform: scale(1.1); }
.step-node.completed { opacity: 0.8; }

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: white;
    border: 2.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 900;
    transition: all 0.3s ease;
}

.step-node.active .step-circle {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 8px 16px -4px var(--primary-alpha);
}

.step-node.completed .step-circle {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 8px 16px -4px var(--success-alpha);
}

.preview-mini-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    background: white;
}

.preview-mini-table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 850;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.preview-mini-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.success-matrix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.matrix-item {
    padding: 1.5rem;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.matrix-item:hover { transform: translateY(-5px); }
.matrix-item h3 { font-size: 1.8rem; font-weight: 950; margin: 0; }
.matrix-item p { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; opacity: 0.7; margin: 0; }

/* ==========================================================================
   GLOBAL LAYERING AUTHORITY (PORTAL-DRIVEN)
   ========================================================================== */

#shulevora-portal-root {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important; /* Nuclear Tier Stacking */
    pointer-events: none !important;
    overflow: visible !important;
}

#shulevora-portal-root > * {
    pointer-events: auto !important;
}

/* Dropdown specific portal children */
[id$="-dropdown-portal"], 
#header-workspace-portal {
    position: fixed !important;
    z-index: var(--z-dropdown) !important;
    pointer-events: auto !important;
}

/* Force all legacy modal and dialog overlays to conform to the new hierarchy */
.shulevora-dialog-overlay, 
.vibrant-modal-overlay,
.workspace-overlay,
.modal-overlay,
.dialog-overlay,
.upgrade-overlay,
.shulevora-modal,
[id^="modal_"],
[id^="mod_overlay_"],
[id^="syncOverlay"],
[class*="modal-overlay"] {
    position: fixed !important;
    inset: 0 !important;
    z-index: var(--z-modal) !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Card Depth standard for Modals & Dialogs */
.shulevora-dialog-card,
.vibrant-modal-card,
.workspace-card,
.upgrade-card,
.shulevora-modal-content {
    background: white !important;
    border-radius: 24px !important;
    box-shadow: var(--shadow-2xl) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    position: relative !important;
    z-index: 10 !important; /* Internal to parent overlay */
}

/* Toast and Alert Priority */
.toast-notification,
.shulevora-alert,
[id^="alert_"] {
    position: fixed !important;
    z-index: var(--z-toast) !important;
}

/* Locking internal application layers to stay below global overlays */
.tabs-container,
.premium-table thead,
.sticky-header,
.app-sidebar,
.app-topbar-3d,
.sub-header {
    z-index: var(--z-sticky) !important;
}
/* --- Academic Hub Customizations --- */
.btn-activate-term {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-activate-term:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.2);
}

.btn-add-year:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.25) !important;
}

.btn-delete-year:hover {
    background: #e11d48 !important;
    color: white !important;
    border-color: #e11d48 !important;
}

/* ─── Premium Invoice Studio & Print Orchestration ─── */
@page {
    size: A4;
    margin: 0;
}

@media print {
    body { 
        background: white !important; 
        overflow: visible !important;
    }
    body * { visibility: hidden !important; }
    #invoice-preview-page, #invoice-preview-page * { 
        visibility: visible !important; 
    }
    #invoice-preview-page {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: 210mm !important;
        height: auto !important;
        margin: 0 !important;
        padding: 20mm !important;
        box-shadow: none !important;
        background: white !important;
        color: black !important;
        font-size: 11pt !important;
        border: none !important;
        box-sizing: border-box !important;
    }
    .no-print, .invoice-studio-overlay > *:not(.invoice-studio-container), .studio-toolbar, .builder-controls {
        display: none !important;
    }
    header, nav, .sidebar, .vibrant-rail, .vibrant-header { display: none !important; }
    
    /* Hide specific sections if needed */
    .sa-print-metadata { display: none !important; }
}

.invoice-studio-overlay {
    animation: saStudioIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes saStudioIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to { opacity: 1; backdrop-filter: blur(12px); }
}

.invoice-studio-container input, .invoice-studio-container select, .invoice-studio-container textarea {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: white !important;
}

.invoice-studio-container input::placeholder {
    color: rgba(255,255,255,0.3) !important;
}

.invoice-studio-container input:focus, .invoice-studio-container select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px var(--primary-alpha) !important;
    background: #0f172a !important;
}

#invoice-preview-page img {
    max-height: 60px;
    width: auto;
}

/* Scrollbar customization for the studio */
.invoice-studio-container *::-webkit-scrollbar {
    width: 6px;
}
.invoice-studio-container *::-webkit-scrollbar-track {
    background: transparent;
}
.invoice-studio-container *::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
.invoice-studio-container *::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}
