/* ============================================================
   main.css – Global Design System
   Selçuk Hatun Ortaokulu Akademi
   Geliştirici: Semih Zengin
   ============================================================ */

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

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --primary:        hsl(220, 90%, 58%);
  --primary-dark:   hsl(220, 90%, 45%);
  --primary-light:  hsl(220, 90%, 70%);
  --accent:         hsl(262, 83%, 60%);
  --accent-dark:    hsl(262, 83%, 48%);
  --success:        hsl(142, 71%, 45%);
  --warning:        hsl(38, 92%, 52%);
  --danger:         hsl(0, 84%, 60%);
  --info:           hsl(199, 89%, 48%);

  --bg-darkest:     #090d16;
  --bg-dark:        #0f172a;
  --bg-card:        #1e293b;
  --bg-card-hover:  #334155;
  --bg-input:       #182234;
  --bg-sidebar:     #0b1324;

  --border:         #334155;
  --border-light:   #475569;

  --text-primary:   #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted:     #94a3b8;

  --glass-bg:       rgba(30, 41, 59, 0.85);
  --glass-border:   rgba(51, 65, 85, 0.8);

  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --radius-full:    9999px;

  --shadow-sm:      0 1px 4px rgba(0, 0, 0, 0.4);
  --shadow:         0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg:      0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow:    0 0 30px rgba(59, 130, 246, 0.25);

  --font-sans:      'Inter', sans-serif;
  --font-display:   'Outfit', sans-serif;

  --transition:     all 0.2s ease;
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-w:      260px;
  --topbar-h:       64px;
}

/* ── Light Theme Overrides ──────────────────────────────────── */
html[data-theme="light"] {
  --bg-darkest:     #f8fafc;
  --bg-dark:        #f1f5f9;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f8fafc;
  --bg-input:       #e2e8f0;
  --bg-sidebar:     #ffffff;

  --border:         #cbd5e1;
  --border-light:   #e2e8f0;

  --text-primary:   #0f172a;
  --text-secondary: #1e293b;
  --text-muted:     #475569;

  --glass-bg:       rgba(255, 255, 255, 0.95);
  --glass-border:   rgba(203, 213, 225, 0.8);

  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow:         0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg:      0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-glow:    0 0 20px rgba(59, 130, 246, 0.15);
}

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

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  height: 100vh; height: 100dvh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-light); }

img { max-width: 100%; display: block; }

button { cursor: pointer; font-family: inherit; }

input, select, textarea {
  font-family: inherit;
  font-size: 0.9rem;
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-darkest); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.text-xs    { font-size: 0.75rem; }
.text-sm    { font-size: 0.85rem; }
.text-base  { font-size: 0.95rem; }
.text-lg    { font-size: 1.1rem; }
.text-xl    { font-size: 1.25rem; }
.text-2xl   { font-size: 1.5rem; }
.text-3xl   { font-size: 2rem; }

.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }

.text-muted   { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-info    { color: var(--info); }

/* ── Layout ─────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* ── Spacing ────────────────────────────────────────────────── */
.p-1  { padding: 0.25rem; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 0.75rem; }
.p-4  { padding: 1rem; }
.p-6  { padding: 1.5rem; }
.p-8  { padding: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: 0.5rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition-slow);
}

.card:hover {
  border-color: hsla(220, 90%, 58%, 0.3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  transition: var(--transition-slow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--primary));
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px hsla(222, 47%, 5%, 0.5);
}

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  background: hsla(220, 90%, 58%, 0.15);
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card .stat-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .stat-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.4rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 15px hsla(220, 90%, 58%, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px hsla(220, 90%, 58%, 0.5);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), hsl(160, 71%, 38%));
  color: white;
}
.btn-success:hover { transform: translateY(-1px); filter: brightness(1.1); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), hsl(0, 70%, 50%));
  color: white;
}
.btn-danger:hover { transform: translateY(-1px); filter: brightness(1.1); }

.btn-warning {
  background: linear-gradient(135deg, var(--warning), hsl(30, 92%, 45%));
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(220, 90%, 58%, 0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-dark); color: #ffffff; }

input[type="date"], input[type="datetime-local"] {
  color-scheme: dark;
  background-color: var(--bg-input, #182234);
  border: 1px solid var(--border-light, #475569);
  color: var(--text-primary, #ffffff);
  font-weight: 600;
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.9) sepia(100%) saturate(300%) hue-rotate(200deg);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  background: rgba(255, 255, 255, 0.15);
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Dark mode badges */
.badge-primary   { background: rgba(59, 130, 246, 0.25); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-success   { background: rgba(16, 185, 129, 0.25); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-warning   { background: rgba(245, 158, 11, 0.25); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-danger    { background: rgba(239, 68, 68, 0.25);  color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-info      { background: rgba(6, 182, 212, 0.25);  color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.4); }
.badge-muted     { background: rgba(148, 163, 184, 0.2);  color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }
.badge-accent    { background: rgba(139, 92, 246, 0.25); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.4); }

/* Light mode badges */
html[data-theme="light"] .badge-primary   { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
html[data-theme="light"] .badge-success   { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
html[data-theme="light"] .badge-warning   { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
html[data-theme="light"] .badge-danger    { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
html[data-theme="light"] .badge-info      { background: #cff4fc; color: #087990; border: 1px solid #b6effb; }
html[data-theme="light"] .badge-muted     { background: #e2e8f0; color: #1e293b; border: 1px solid #cbd5e1; }
html[data-theme="light"] .badge-accent    { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--bg-input);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }

html[data-theme="light"] select.form-control option {
  background: #ffffff;
  color: #0f172a;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.avatar-lg { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.72rem; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: hsla(222, 47%, 5%, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  animation: scaleIn 0.2s forwards;
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: white; border-color: var(--danger); }

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

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-input);
  padding: 0.25rem;
  border-radius: var(--radius);
  width: fit-content;
}

.tab-btn {
  padding: 0.45rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px hsla(220, 90%, 58%, 0.4);
}

.tab-btn:hover:not(.active) { color: var(--text-primary); background: var(--bg-card); }

/* ── Alert / Notification ───────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 0.875rem;
}
.alert-success { background: hsla(142, 71%, 45%, 0.1); border-color: hsla(142, 71%, 45%, 0.3); color: hsl(142, 71%, 60%); }
.alert-danger  { background: hsla(0, 84%, 60%, 0.1);   border-color: hsla(0, 84%, 60%, 0.3);   color: hsl(0, 84%, 70%); }
.alert-warning { background: hsla(38, 92%, 52%, 0.1);  border-color: hsla(38, 92%, 52%, 0.3);  color: hsl(38, 92%, 65%); }
.alert-info    { background: hsla(199, 89%, 48%, 0.1); border-color: hsla(199, 89%, 48%, 0.3); color: hsl(199, 89%, 65%); }

/* ── Toast Notification ─────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  display: flex; align-items: center; gap: 0.75rem;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  font-size: 0.875rem;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--info); }
.toast-warning { border-left: 3px solid var(--warning); }

/* ── Search bar ─────────────────────────────────────────────── */
.search-bar {
  position: relative;
}
.search-bar input {
  padding-left: 2.5rem;
}
.search-bar .search-icon {
  position: absolute; left: 0.85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Progress bar ───────────────────────────────────────────── */
.progress-bar {
  width: 100%; height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* ── Attendance chips ───────────────────────────────────────── */
.att-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.att-btn.present  { background: var(--success); border-color: var(--success); color: white; }
.att-btn.absent   { background: var(--danger);  border-color: var(--danger);  color: white; }
.att-btn.late     { background: var(--warning); border-color: var(--warning); color: white; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-fade-in   { animation: fadeIn 0.4s ease; }
.animate-slide-up  { animation: slideUp 0.4s ease; }
.animate-scale-in  { animation: scaleIn 0.3s ease; }
.animate-float     { animation: float 3s ease-in-out infinite; }
.animate-pulse     { animation: pulse 2s ease-in-out infinite; }
.animate-spin      { animation: spin 1s linear infinite; }

/* ── Utility ────────────────────────────────────────────────── */
.hidden           { display: none !important; }
.visible          { display: block !important; }
.invisible        { visibility: hidden; }
.relative         { position: relative; }
.absolute         { position: absolute; }
.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.rounded          { border-radius: var(--radius); }
.rounded-full     { border-radius: var(--radius-full); }
.shadow           { box-shadow: var(--shadow); }
.shadow-lg        { box-shadow: var(--shadow-lg); }
.opacity-50       { opacity: 0.5; }
.cursor-pointer   { cursor: pointer; }
.select-none      { user-select: none; }
.whitespace-nowrap{ white-space: nowrap; }
.text-center      { text-align: center; }
.text-right       { text-align: right; }
.truncate         { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.6; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; }

/* ── Loading Spinner ────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Chart Container ────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  height: 200px;
}

/* ── Mini Donut ─────────────────────────────────────────────── */
.donut-chart {
  display: flex; align-items: center; gap: 1rem;
}

/* ── Gradient Text ──────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), hsl(262, 83%, 75%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Status Dot ─────────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.active  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.inactive{ background: var(--text-muted); }
.status-dot.warning { background: var(--warning); box-shadow: 0 0 6px var(--warning); }

/* ── Notification Bell ──────────────────────────────────────── */
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: white;
  border: 2px solid var(--bg-card);
}

/* ── Panel Layout (Shared for Admin) ────────────────────────── */
.panel-layout {
  display: flex;
  height: 100vh; height: 100dvh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: var(--transition-slow);
}

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

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-logo .logo-text h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--primary-light), hsl(262, 83%, 75%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo .logo-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-section {
  padding: 1rem 0.75rem 0.5rem;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.5rem;
  margin-bottom: 0.5rem;
}

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

.sidebar-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: linear-gradient(135deg, hsla(220, 90%, 58%, 0.2), hsla(262, 83%, 60%, 0.1));
  color: var(--primary-light);
  border: 1px solid hsla(220, 90%, 58%, 0.2);
}

.sidebar-item .item-icon { font-size: 1.1rem; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: var(--topbar-h);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 90;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

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

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 1.75rem;
  flex: 1;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Mobile App Layout ──────────────────────────────────────── */
.mobile-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  position: relative;
  overflow-x: hidden;
}

.mobile-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px);
}

.mobile-content {
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  flex: 1;
  padding: 1rem;
  padding-bottom: 80px;
  overflow-y: auto;
}

.mobile-nav {
  position: relative;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  z-index: 50;
  backdrop-filter: blur(20px);
}

.mobile-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 0.75rem 0.5rem;
  border: none; background: transparent;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  gap: 0.25rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.mobile-nav-item .nav-icon { font-size: 1.3rem; transition: var(--transition); }
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item.active .nav-icon { transform: scale(1.1); }

.mobile-nav-item::after {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 0 0 2px 2px;
}

.mobile-nav-item.active::after { width: 60%; }

/* ── LGS Countdown ──────────────────────────────────────────── */
.lgs-countdown {
  background: linear-gradient(135deg, hsla(262, 83%, 60%, 0.2), hsla(220, 90%, 58%, 0.15));
  border: 1px solid hsla(262, 83%, 60%, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}

.lgs-countdown .days {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), hsl(262, 83%, 75%));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

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

/* ── Print ──────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .mobile-nav { display: none; }
  .main-content { margin: 0; padding: 0; }
  body { background: white; color: black; }
}
