/* Oakridge School Online Attendance - Modern Design System */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-dark: #1e40af;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --info: #6366f1;
  --info-light: #eef2ff;
  --info-border: #c7d2fe;
  --info-text: #3730a3;

  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --sidebar-width: 250px;
  --header-height: 64px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-app: #090d16;
  --bg-surface: #111827;
  --bg-card: #141d2e;
  --bg-subtle: #1e293b;
  --bg-hover: #26334d;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --border-color: #1e293b;
  --border-subtle: #334155;

  --primary-light: #1e3a8a;
  --success-light: #064e3b;
  --success-border: #047857;
  --success-text: #a7f3d0;

  --danger-light: #7f1d1d;
  --danger-border: #b91c1c;
  --danger-text: #fecaca;

  --warning-light: #78350f;
  --warning-border: #b45309;
  --warning-text: #fde68a;

  --info-light: #312e81;
  --info-border: #4338ca;
  --info-text: #c7d2fe;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: block;
}

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

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

.sidebar-header {
  padding: 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.school-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.school-logo svg {
  width: 24px;
  height: 24px;
  stroke: white;
}

.school-title {
  display: flex;
  flex-direction: column;
}

.school-title h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.school-title span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-menu {
  padding: 1rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: var(--transition);
}

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

.nav-item.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-stats-pill {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-app);
}

/* Top Navigation Bar */
.topbar {
  height: var(--header-height);
  background: var(--bg-surface);
  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: 30;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}

.current-datetime {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Role Selector Switcher */
.role-switcher-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.role-switcher-box label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

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

.user-info-text .name {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
}

.user-info-text .role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.icon-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Page Content */
.content-body {
  padding: 1.75rem;
  flex: 1;
}

.page-section {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.page-section.active {
  display: block;
}

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

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title-group h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-title-group p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

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

.btn-success:hover {
  background: #059669;
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-light);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

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

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

.stat-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Charts & Dashboard Section */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

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

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-present {
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.badge-absent {
  background: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

.badge-late {
  background: var(--warning-light);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.badge-excused {
  background: var(--info-light);
  color: var(--info-text);
  border: 1px solid var(--info-border);
}

.badge-neutral {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* Filter Bar */
.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Attendance Marking Grid & Table */
.attendance-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tally-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.tally-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.tally-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tally-dot.p { background: var(--success); }
.tally-dot.a { background: var(--danger); }
.tally-dot.l { background: var(--warning); }
.tally-dot.e { background: var(--info); }

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Table Styles */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

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

.data-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-subtle);
}

.student-info-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Attendance Status Radio Switch Group */
.status-pill-group {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  gap: 2px;
}

.status-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: var(--transition);
}

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

.status-btn.selected-p {
  background: var(--success);
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.status-btn.selected-a {
  background: var(--danger);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.status-btn.selected-l {
  background: var(--warning);
  color: white;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.status-btn.selected-e {
  background: var(--info);
  color: white;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

/* Monthly Matrix View */
.matrix-container {
  overflow-x: auto;
  max-width: 100%;
}

.matrix-table th, .matrix-table td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  font-size: 0.75rem;
}

.matrix-table th.student-col, .matrix-table td.student-col {
  text-align: left;
  padding-left: 0.75rem;
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 2;
  box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

.matrix-cell {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 700;
}

.matrix-cell.P { background: var(--success-light); color: var(--success-text); }
.matrix-cell.A { background: var(--danger-light); color: var(--danger-text); }
.matrix-cell.L { background: var(--warning-light); color: var(--warning-text); }
.matrix-cell.E { background: var(--info-light); color: var(--info-text); }
.matrix-cell.empty { color: var(--text-light); }

.weekend-col {
  background: var(--bg-subtle) !important;
  color: var(--text-light);
}

/* Student Portal Styles */
.student-profile-header {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: white;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.student-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.student-large-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.attendance-gauge-box {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  text-align: right;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.attendance-gauge-rate {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

/* Calendar Grid */
.calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day-name {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-surface);
  transition: var(--transition);
}

.calendar-day:hover {
  border-color: var(--primary);
}

.calendar-day.other-month {
  opacity: 0.3;
  pointer-events: none;
}

.calendar-day.status-present {
  border-color: var(--success);
  background: var(--success-light);
}

.calendar-day.status-absent {
  border-color: var(--danger);
  background: var(--danger-light);
}

.calendar-day.status-late {
  border-color: var(--warning);
  background: var(--warning-light);
}

.calendar-day.status-excused {
  border-color: var(--info);
  background: var(--info-light);
}

.day-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  align-self: flex-end;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.15s ease-out;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

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

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

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

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

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  animation: slideIn 0.25s ease-out;
  max-width: 380px;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

.toast.toast-info {
  border-left: 4px solid var(--primary);
}

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

/* Print Stylesheet */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .sidebar, .topbar, .filter-bar, .header-actions, .bulk-actions, .status-pill-group, .icon-btn, #toast-container {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .content-body {
    padding: 0 !important;
  }
  .page-section {
    display: none !important;
  }
  .page-section.active {
    display: block !important;
  }
  .matrix-table {
    font-size: 9pt !important;
  }
}

/* Dynamic QR Attendance Styles */
.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.8s infinite;
  vertical-align: middle;
  margin-right: 4px;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.qr-projector-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.qr-canvas-container {
  padding: 0.75rem;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  display: inline-block;
  margin: 0.75rem 0;
  border: 3px solid var(--primary);
  position: relative;
  transition: transform 0.2s ease;
}

.qr-canvas-container.rotating {
  animation: qrPulse 0.4s ease;
}

@keyframes qrPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.qr-timer-track {
  width: 100%;
  max-width: 280px;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.qr-timer-progress {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 9999px;
  transition: width 0.1s linear;
}

.qr-code-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  display: inline-block;
  margin: 0.35rem 0;
  border: 1px dashed var(--primary);
}

.qr-live-attendees-box {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  margin-top: 0.75rem;
  text-align: left;
  background: var(--bg-subtle);
}

.scanner-viewfinder {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  margin: 1rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: rgba(37, 99, 235, 0.04);
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: scanLaser 2s infinite ease-in-out;
}

@keyframes scanLaser {
  0% { top: 0; }
  50% { top: 96%; }
  100% { top: 0; }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  /* Fix Top Navigation Bar Overlap */
  .topbar {
    height: 54px !important;
    padding: 0 0.75rem !important;
    gap: 0.5rem !important;
    position: sticky !important;
    top: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .topbar-left {
    gap: 0.5rem !important;
    flex-shrink: 0 !important;
  }
  .current-datetime {
    display: none !important; /* System status bar already shows time */
  }
  .topbar-right {
    gap: 0.4rem !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
  }
  .user-badge {
    padding: 2px !important;
    background: transparent !important;
    border: none !important;
    gap: 0 !important;
  }
  .user-info-text {
    display: none !important; /* Hide long name and role text on mobile to avoid overlap */
  }
  .user-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  }
  #btn-download-apk-top {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.75rem !important;
    height: 32px !important;
    white-space: nowrap !important;
  }
  #topbar-app-btn span:last-child {
    display: none !important;
  }
  #topbar-app-btn {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.8rem !important;
    height: 32px !important;
  }
  .topbar-right button[onclick="App.logout()"] span {
    display: none !important;
  }
  .topbar-right button[onclick="App.logout()"] {
    padding: 0.35rem 0.5rem !important;
    height: 32px !important;
    width: 32px !important;
    justify-content: center !important;
  }
  #topbar-qr-btn span:last-child {
    display: none !important;
  }
  #topbar-qr-btn {
    padding: 0.35rem 0.5rem !important;
    height: 32px !important;
  }

  /* Fix Page Padding & Horizontal Stretching */
  .content-body {
    padding: 0.85rem 0.65rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Fix Page Header & Action Buttons Overflow */
  .page-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
  }
  .page-title-group h2 {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
  }
  .page-title-group p {
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
    margin-top: 0.2rem !important;
  }
  .header-actions {
    width: 100% !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  .header-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.65rem 1rem !important;
    font-size: 0.875rem !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }

  /* Fix Student Hero Card */
  .student-profile-header {
    padding: 1rem 0.85rem !important;
    border-radius: 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
  }
  .student-meta {
    gap: 0.75rem !important;
    align-items: center !important;
  }
  .student-large-avatar {
    width: 50px !important;
    height: 50px !important;
    font-size: 1.2rem !important;
    flex-shrink: 0 !important;
  }
  .student-meta h3 {
    font-size: 1.2rem !important;
  }
  .attendance-gauge-box {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.6rem 0.85rem !important;
    box-sizing: border-box !important;
  }
  .attendance-gauge-rate {
    font-size: 1.5rem !important;
  }

  /* Fix Stat Cards Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
  }
  .stat-card {
    padding: 0.75rem 0.65rem !important;
    border-radius: 10px !important;
  }
  .stat-card-top {
    margin-bottom: 0.35rem !important;
  }
  .stat-title {
    font-size: 0.68rem !important;
    line-height: 1.1 !important;
  }
  .stat-value {
    font-size: 1.35rem !important;
  }
  .stat-subtext {
    font-size: 0.65rem !important;
  }
  .stat-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.9rem !important;
  }

  /* General Grids */
  .grid-2, .grid-3, .dev-studio-grid, .charts-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Broadcast Banner on Mobile */
  .ota-broadcast-banner {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.75rem !important;
  }
  .ota-broadcast-content {
    min-width: 0 !important;
    word-break: break-word !important;
  }

  /* Tables & Responsive Scrolling */
  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .table-card, .calendar-card, .card {
    padding: 0.75rem 0.65rem !important;
    border-radius: 10px !important;
  }

  /* Filter Bars */
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.75rem !important;
  }
  .filter-group {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .filter-group select, .filter-group input {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* ==============================================
   DEDICATED FULL-PAGE LOGIN SYSTEM
   ============================================== */
.login-screen-wrapper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-card-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  max-width: 440px;
  width: 100%;
  padding: 1.75rem 1.5rem;
  margin: auto;
  animation: zoomFade 0.25s ease-out;
}

@media (max-width: 600px) {
  .login-screen-wrapper {
    padding: 0.75rem 0.5rem;
    align-items: flex-start;
  }
  .login-card-container {
    padding: 1.25rem 0.85rem;
    border-radius: var(--radius-md);
    max-width: 100%;
    margin: 0.5rem auto;
  }
  .role-selector-cards {
    gap: 0.35rem;
  }
  .role-card {
    padding: 0.5rem 0.25rem;
  }
  .role-card-name {
    font-size: 0.8rem;
  }
  .role-card-desc {
    font-size: 0.65rem;
  }
}

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

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.75rem;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.login-logo svg {
  width: 30px;
  height: 30px;
}

.login-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Role Selector Cards */
.role-selector-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.role-card {
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.role-card:hover {
  border-color: var(--primary-light);
  background: var(--bg-subtle);
  transform: translateY(-2px);
}

.role-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.role-card-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.role-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.role-card-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.login-input {
  padding-left: 38px !important;
  font-size: 0.95rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.login-btn-primary {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.login-alert-box {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  margin-bottom: 1rem;
  text-align: left;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-action:hover {
  text-decoration: underline;
}

.demo-logins-box {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.demo-logins-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.demo-chips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.demo-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.credentials-reference-card {
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  overflow: hidden;
}

.creds-ref-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.creds-ref-content {
  padding: 0.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.creds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.creds-table th {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.creds-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
}



/* ======================================================= */
/* FORMULA 1 (F1) AESTHETIC LOADING SCREEN & TELEMETRY     */
/* ======================================================= */
.f1-splash-container {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at 50% 30%, #161822 0%, #07080b 70%, #030406 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "SF Pro Display", sans-serif;
  overflow: hidden;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.f1-splash-container.f1-dismissing {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.f1-carbon-mesh {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(45deg, rgba(255,255,255,0.02) 25%, transparent 25%), 
    linear-gradient(-45deg, rgba(255,255,255,0.02) 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.02) 75%), 
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.02) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  pointer-events: none;
  opacity: 0.6;
}

.f1-ambient-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0) 70%);
  filter: blur(50px);
  pointer-events: none;
  transition: background 0.4s ease;
}

.f1-content {
  position: relative;
  z-index: 2;
  max-width: 520px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* FIA Starting Gantry */
.f1-gantry-wrapper {
  background: rgba(18, 20, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1rem 1.4rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  width: 100%;
}

.f1-gantry-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #94a3b8;
  margin-bottom: 0.85rem;
  text-transform: uppercase;
}

.f1-gantry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.f1-light-col {
  flex: 1;
  background: #0d0f14;
  border: 1px solid #232733;
  border-radius: 12px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.f1-light {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1c202a;
  border: 2px solid #2d3345;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.f1-light::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.f1-light.red {
  background: #ff1e00;
  border-color: #ff5e4d;
  box-shadow: 0 0 24px #ff1e00, 0 0 45px rgba(255, 30, 0, 0.8), inset 0 0 8px #ffffff;
  transform: scale(1.08);
}

.f1-light.green {
  background: #00e676;
  border-color: #69f0ae;
  box-shadow: 0 0 26px #00e676, 0 0 55px rgba(0, 230, 118, 0.9), inset 0 0 8px #ffffff;
  transform: scale(1.08);
}

/* Racing Hero Title */
.f1-hero-title {
  width: 100%;
}

.f1-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.5rem;
}

.f1-red-tag {
  background: #e10600;
  color: white;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.f1-ota-tag {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #38bdf8;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  font-family: monospace;
}

.f1-hero-title h1 {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
  text-transform: uppercase;
}

.f1-race-status {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-height: 1.25rem;
  font-family: monospace;
}

/* Cockpit HUD & Tachometer */
.f1-cockpit-hud {
  background: rgba(15, 17, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1.2rem;
  width: 100%;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.f1-tach-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  font-family: monospace;
}

.f1-tach-header span:last-child {
  color: #f59e0b;
  font-size: 0.9rem;
}

.f1-tach-bar-wrapper {
  height: 14px;
  background: #090a0f;
  border: 1px solid #232733;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.4rem;
}

.f1-tach-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #eab308 55%, #ef4444 80%, #d946ef 100%);
  border-radius: 7px;
  transition: width 0.12s linear;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}

.f1-tach-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: #64748b;
  font-family: monospace;
  font-weight: 700;
  margin-bottom: 1rem;
}

.f1-tach-ticks .redline {
  color: #ef4444;
}

/* Telemetry Dials Grid */
.f1-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.f1-dial {
  background: #090b10;
  border: 1px solid #1e2230;
  border-radius: 10px;
  padding: 0.6rem 0.4rem;
  text-align: center;
}

.f1-dial-label {
  font-size: 0.6rem;
  color: #64748b;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.f1-dial-value {
  font-size: 1.05rem;
  font-weight: 900;
  color: #f8fafc;
  font-family: monospace;
}

.f1-dial-value small {
  font-size: 0.6rem;
  color: #94a3b8;
  font-weight: 700;
}

.f1-dial-value.highlight {
  color: #38bdf8;
  font-size: 1.25rem;
}

.f1-dial-value.drs {
  color: #10b981;
  font-size: 0.75rem;
}

/* Pit-Wall Status Bar */
.f1-pitwall-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 0.72rem;
  color: #64748b;
  font-family: monospace;
  padding: 0 0.25rem;
}

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

.f1-pitwall-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.f1-btn-skip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.f1-btn-skip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
  .f1-splash-container {
    padding: 0.75rem 0.5rem;
  }
  .f1-content {
    gap: 0.75rem;
  }
  .f1-hero-title h1 {
    font-size: 1.25rem;
  }
  .f1-gantry-wrapper {
    padding: 0.75rem 0.65rem;
  }
  .f1-light {
    width: 26px;
    height: 26px;
  }
  .f1-cockpit-hud {
    padding: 0.75rem;
  }
  .f1-telemetry-grid {
    gap: 0.35rem;
  }
  .f1-dial {
    padding: 0.4rem 0.2rem;
  }
  .f1-dial-value {
    font-size: 0.9rem;
  }
}

/* ======================================================= */
/* BROADCAST ANNOUNCEMENT BANNER                           */
/* ======================================================= */
.ota-broadcast-banner {
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 50%, #1d4ed8 100%);
  color: white;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  animation: slideDown 0.3s ease;
}

.ota-broadcast-banner.formula1 {
  background: linear-gradient(90deg, #7f1d1d 0%, #e10600 50%, #991b1b 100%);
  box-shadow: 0 4px 14px rgba(225, 6, 0, 0.35);
}

.ota-broadcast-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ota-banner-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

/* ======================================================= */
/* DEVELOPER STUDIO STYLES                                 */
/* ======================================================= */
.dev-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .dev-studio-grid {
    grid-template-columns: 1fr;
  }
}

.dev-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.dev-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.dev-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dev-telemetry-badge {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.725rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dev-telemetry-badge .pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-ring 1.5s infinite;
}

/* Logo Preset Chips */
.logo-chips-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.logo-chip-btn {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.logo-chip-btn:hover, .logo-chip-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Color Swatches */
.color-swatches-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.color-swatch-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.15s;
}

.color-swatch-btn:hover, .color-swatch-btn.active {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--primary);
}

/* Live Smartphone Preview Mockup */
.phone-mockup-wrapper {
  background: #0f172a;
  border-radius: 36px;
  padding: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  max-width: 320px;
  margin: 0 auto;
}

.phone-screen {
  background: #f8fafc;
  border-radius: 26px;
  overflow: hidden;
  min-height: 440px;
  display: flex;
  flex-direction: column;
}

.phone-dynamic-island {
  width: 90px;
  height: 18px;
  background: #000;
  border-radius: 20px;
  margin: 6px auto 8px;
}

.phone-preview-header {
  background: var(--primary);
  color: white;
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s;
}

.phone-preview-logo {
  font-size: 1.4rem;
}

.phone-preview-name {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}

.phone-preview-sub {
  font-size: 0.65rem;
  opacity: 0.85;
}

.phone-preview-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.phone-preview-card {
  background: white;
  border-radius: 10px;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.ota-push-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.ota-push-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}

.ota-push-btn:active {
  transform: translateY(0);
}

/* Simulator View Switcher Tabs */
.simulator-tab-group {
  display: flex;
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
  margin-bottom: 0.75rem;
}

.sim-tab-btn {
  flex: 1;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sim-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Android Home Screen Mockup */
.phone-homescreen {
  background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  min-height: 440px;
  border-radius: 26px;
  overflow: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-hs-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0 4px;
}

.phone-hs-clock {
  font-size: 2.2rem;
  font-weight: 300;
  color: white;
  text-align: center;
  margin: 18px 0 2px;
  letter-spacing: -0.02em;
}

.phone-hs-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  margin-bottom: 24px;
}

.phone-hs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  padding: 0 4px;
}

.phone-hs-app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.phone-hs-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
  overflow: hidden;
}

.phone-hs-app-item.featured .phone-hs-icon-box {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.5);
  animation: pulse-ring 2.5s infinite;
}

.phone-hs-app-name {
  color: white;
  font-size: 0.65rem;
  font-weight: 500;
  text-align: center;
  max-width: 62px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.phone-hs-dock {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-around;
  margin-bottom: 6px;
}

/* Custom Icon Upload Component */
.custom-icon-upload-wrapper {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.custom-icon-preview-slot {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.custom-icon-preview-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
