/* ============================================================================
   MADAN MOHAN MALVIYA SCHOOL ERP - MODERN DESIGN SYSTEM & STYLESHEET
   ============================================================================ */

:root {
  /* Color Palette - Dark Mode (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-sidebar: #0d1322;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --accent-primary: #6366f1;   /* Indigo */
  --accent-secondary: #8b5cf6; /* Violet */
  --accent-cyan: #06b6d4;      /* Cyan */
  --accent-success: #10b981;   /* Emerald */
  --accent-warning: #f59e0b;   /* Amber */
  --accent-danger: #ef4444;    /* Rose */
  --accent-telegram: #0088cc;  /* Telegram Blue */

  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Tokens */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(241, 245, 249, 0.95);
  --bg-sidebar: #0f172a;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(99, 102, 241, 0.2);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

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

html, body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

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

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

.school-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 1.8rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.school-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.school-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mobile-close-sidebar {
  display: none;
}

/* Session Isolation Dropdown Widget */
.sidebar-session-widget {
  margin: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.sidebar-session-widget label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-dropdown {
  width: 100%;
  padding: 8px 12px;
  background: #111827;
  color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.session-dropdown:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.keyboard-scroll-panel:focus {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.keyboard-scroll-panel {
  scrollbar-gutter: stable both-edges;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  margin-top: 8px;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.status-dot.green { background-color: var(--accent-success); box-shadow: 0 0 8px var(--accent-success); }
.status-dot.amber { background-color: var(--accent-warning); }

/* Navigation Menu */
.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  padding: 12px 12px 6px 12px;
  letter-spacing: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
  transition: var(--transition);
  position: relative;
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #ffffff;
  background: var(--gradient-brand);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.nav-item.highlight-nav {
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
}

.nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--accent-danger);
  color: #ffffff;
}

.nav-badge.pulse {
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* Sidebar Footer & Role Switcher */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
}

.role-selector-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.role-dropdown {
  padding: 6px 10px;
  background: #1e293b;
  color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: calc(100vw - 280px);
}

/* Top Navbar */
.top-navbar {
  height: 70px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  backdrop-filter: blur(12px);
}

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

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

.global-search-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  width: 420px;
  cursor: pointer;
  transition: var(--transition);
}

.global-search-trigger:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.search-icon {
  color: var(--text-muted);
}

.search-placeholder {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-shortcut {
  margin-left: auto;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* Right Nav Controls */
.right-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-nfc-tap {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-nfc-tap:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-telegram {
  background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
  color: #ffffff;
}

/* User Avatar Card */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border-color);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #7c3aed 100%);
  border: 2px solid var(--accent-primary);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  user-select: none;
}

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

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--accent-cyan);
}

/* Content Body */
.content-body {
  flex: 1;
  padding: 28px;
  min-width: 0;
  max-width: 100%;
}

/* Page Header Component */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  max-width: 100%;
}

.glass-card:hover {
  border-color: var(--border-glow);
}

/* Grid Layouts */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* KPI Cards */
.kpi-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.kpi-icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.kpi-icon-box.purple { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.kpi-icon-box.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.kpi-icon-box.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.kpi-icon-box.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.kpi-icon-box.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }

.kpi-data {
  display: flex;
  flex-direction: column;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Table Styles */
.data-table-container {
  position: relative !important;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  display: block;
}

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

/* Broadsheet table - max-content and border-collapse separate allow Chrome native overflow scroll */
.data-table-broadsheet {
  width: max-content !important;
  min-width: 3400px !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  text-align: center;
  table-layout: fixed;
}

.data-table th {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-info { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-secondary); border: 1px solid rgba(139, 92, 246, 0.3); }

/* Student Profile Modal & Drawer */
.student-profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.student-photo-large {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.timeline-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.timeline-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.timeline-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-weight: 600;
}

.timeline-body {
  padding: 18px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 650px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: scale(0.95);
  transition: var(--transition);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

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

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

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

/* NFC Waves Animation */
.nfc-modal-box { text-align: center; }
.nfc-scanner-waves {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nfc-card-icon {
  font-size: 2.5rem;
  color: var(--accent-success);
  z-index: 2;
}

.wave {
  position: absolute;
  border: 2px solid var(--accent-success);
  border-radius: 50%;
  animation: ripple 2s infinite ease-out;
}
.wave1 { width: 60px; height: 60px; animation-delay: 0s; }
.wave2 { width: 80px; height: 80px; animation-delay: 0.6s; }
.wave3 { width: 100px; height: 100px; animation-delay: 1.2s; }

@keyframes ripple {
  0% { opacity: 1; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(1.3); }
}

.sample-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 24px;
}

.sample-nfc-card-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  transition: var(--transition);
}

.sample-nfc-card-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent-success);
}

.card-name { font-weight: 700; color: var(--text-main); font-size: 0.9rem; }
.card-uid { font-family: monospace; font-size: 0.75rem; color: var(--accent-cyan); margin: 2px 0; }
.card-class { font-size: 0.72rem; color: var(--text-muted); }

.manual-uid-input-group {
  padding: 18px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
}

.input-with-button {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.input-with-button input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: monospace;
}

/* Global Search Modal Header */
.search-input-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 14px;
}

.modal-search-icon { font-size: 1.3rem; color: var(--accent-primary); }

#globalSearchInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1.1rem;
  color: var(--text-main);
}

.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
}

.search-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.search-empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }

/* ============================================================================
   RESPONSIVE MOBILE & TABLET DESIGN SYSTEM
   ============================================================================ */

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.sidebar-open .sidebar-overlay {
  display: block;
  opacity: 1;
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .global-search-trigger { width: 260px; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9999;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  .toggle-sidebar-btn {
    display: flex !important;
  }
}

@media (max-width: 768px) {
  .top-navbar {
    padding: 10px 14px;
    gap: 10px;
  }
  
  .global-search-trigger {
    flex: 1;
    max-width: 210px;
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  
  .search-shortcut {
    display: none !important;
  }
  
  .user-info {
    display: none !important;
  }

  .btn-nfc-tap {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .content-body {
    padding: 14px 12px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }

  .page-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-header .btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    text-align: center;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .page-subtitle {
    font-size: 0.8rem;
  }

  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .glass-card {
    padding: 14px;
    border-radius: 14px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 1.6rem;
  }

  /* Scrollable Data Tables on Mobile Touch Screens */
  .data-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid var(--border-color);
  }

  .data-table {
    min-width: 620px;
    font-size: 0.8rem;
  }

  .data-table th, .data-table td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  /* Responsive Bottom-Sheet Modals on Mobile Phones */
  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }

  .modal-box {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 16px !important;
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .top-navbar {
    padding: 8px 10px;
  }

  .global-search-trigger {
    display: none !important;
  }

  .page-header .btn {
    flex: 1 1 100%;
  }

  .modal-box {
    padding: 14px 12px !important;
  }
}

/* ============================================================================
   BROADSHEET MATRIX STICKY COLUMNS & SLIDER CONTROL RESPONSIVENESS
   ============================================================================ */
@media (min-width: 1025px) {
  .sticky-col-1 {
    position: sticky !important;
    left: 0 !important;
    z-index: 25 !important;
    background: #0f172a !important;
    border-right: 1px solid #334155 !important;
  }
  .sticky-col-2 {
    position: sticky !important;
    left: 50px !important;
    z-index: 25 !important;
    background: #0f172a !important;
    border-right: 1px solid #334155 !important;
  }
  .sticky-col-3 {
    position: sticky !important;
    left: 230px !important;
    z-index: 25 !important;
    background: #0f172a !important;
    border-right: 3px solid #6366f1 !important;
  }
}

@media (max-width: 1024px) {
  .sticky-col-1, .sticky-col-2, .sticky-col-3 {
    position: static !important;
    border-right: 1px solid #334155 !important;
  }
}

/* ============================================================================
   PREMIUM LOGIN PAGE
   ============================================================================ */
.login-page-wrap {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
}

.login-page-wrap::before {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
  pointer-events: none;
}

.login-page-wrap::after {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  bottom: -140px;
  left: -100px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.login-shell {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
}

.login-hero {
  padding: 48px 40px;
  background: linear-gradient(145deg, #1e1b4b 0%, #312e81 45%, #0e7490 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
}

.login-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
}

.login-hero h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1.15;
  margin: 24px 0 12px;
  font-weight: 800;
}

.login-hero p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 360px;
}

.login-hero-features {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.login-hero-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
}

.login-hero-feature i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
}

.login-panel {
  padding: 44px 40px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
}

.login-panel h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  margin: 0 0 6px;
  font-weight: 800;
}

.login-panel .login-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.login-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.login-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px 18px;
  font-size: 1rem;
  border-radius: 12px;
}

.login-hint {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.login-hint strong { color: var(--accent-cyan); }

.app-footer {
  padding: 14px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-color);
}

html[data-theme="light"] .login-shell {
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .login-panel {
  background: #ffffff;
}

html[data-theme="light"] .login-input {
  background: #f8fafc;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
  .login-hero {
    min-height: auto;
    padding: 32px 28px;
  }
  .login-hero h1 { font-size: 1.55rem; }
  .login-panel { padding: 32px 28px; }
}
