:root {
  --bg-app: #080B11;
  --bg-card: rgba(13, 18, 29, 0.78);
  --bg-card-header: rgba(18, 26, 42, 0.92);
  --bg-card-hover: rgba(22, 32, 51, 0.85);
  --bg-input: #0B101A;
  --bg-modal: #0D1321;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(16, 185, 129, 0.35);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-emerald: #10B981;
  --accent-emerald-light: #34D399;
  --accent-emerald-soft: rgba(16, 185, 129, 0.12);
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);

  --accent-cyan: #06B6D4;
  --accent-cyan-soft: rgba(6, 182, 212, 0.12);

  --accent-amber: #F59E0B;
  --accent-amber-soft: rgba(245, 158, 11, 0.14);

  --accent-blue: #3B82F6;
  --accent-blue-soft: rgba(59, 130, 246, 0.12);

  --accent-red: #F43F5E;
  --accent-red-soft: rgba(244, 63, 94, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --shadow-card-hover: 0 10px 30px -4px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-hover);
  --shadow-modal: 0 25px 60px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--border-strong);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: 
    radial-gradient(rgba(16, 185, 129, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
}

/* Ambient glow accents */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.07) 0%, transparent 70%);
  top: -100px;
  left: 10%;
}
.glow-2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
  top: 40%;
  right: -50px;
}

.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1420px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Header */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 0 16px var(--accent-emerald-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #FFFFFF 20%, #CBD5E1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 1px;
}

.student-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.7);
  padding: 8px 16px 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.student-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1.5px solid var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-emerald-light);
}

.student-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.student-name {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.status-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  display: inline-block;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.student-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Mobile Segment Tab Switcher */
.mobile-tab-switch {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.mobile-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-tab-btn.active {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
}

.settings-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.content-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Cards General */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
  padding: 18px 22px;
  background: var(--bg-card-header);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
}

.card-header.space-between {
  justify-content: space-between;
}

.title-with-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge-hint {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-clock {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.icon-shield {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.icon-telegram {
  background: var(--accent-blue-soft);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.card-body {
  padding: 20px 22px;
}

/* Time Tags */
.time-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 16px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.time-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  animation: fadeIn 0.15s ease-in;
}

.tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.tag-remove:hover {
  color: var(--accent-red);
  background: rgba(244, 63, 94, 0.1);
}

.add-time-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.time-input-wrapper {
  flex: 1;
}

.time-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.time-input:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px var(--accent-emerald-soft);
}

.quick-presets {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.presets-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #059669 0%, #10B981 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px var(--accent-emerald-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 8px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  color: var(--accent-emerald-light);
  border-color: var(--accent-emerald);
  background: var(--accent-emerald-soft);
}

/* Stealth Switch */
.stealth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.switch-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.switch-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

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

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

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #94A3B8;
  transition: 0.3s;
  border-radius: 50%;
}

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

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #ffffff;
}

.stealth-delay-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.delay-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.delay-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Telegram Actions */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93C5FD;
  transform: translateY(-1px);
}

/* Tabs Nav */
.tabs-nav {
  display: flex;
  gap: 6px;
  background: #090E18;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.tab-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Schedule Timeline */
.lessons-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lesson-card {
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(15, 22, 36, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.lesson-card:hover {
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(18, 28, 46, 0.8);
  transform: translateX(2px);
}

.lesson-time-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6px 10px;
  background: #0A0F1C;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-width: 105px;
  flex-shrink: 0;
}

.lesson-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-emerald-light);
}

.lesson-type-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: center;
}

.lesson-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lesson-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #F1F5F9;
  margin-bottom: 4px;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-item b {
  color: #E2E8F0;
}

.badge-online {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-weight: 600;
}

.badge-building-bayzak {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-weight: 600;
}

/* Grades Grid */
.grades-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.grade-card {
  background: rgba(14, 21, 35, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.grade-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.grade-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.grade-subject-title {
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #F8FAFC;
  line-height: 1.35;
}

.grade-details-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
}

.grade-card:hover .grade-details-badge {
  background: var(--accent-emerald-soft);
  color: var(--accent-emerald-light);
  border-color: rgba(16, 185, 129, 0.3);
}

.grade-teacher {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.grade-marks-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #090E18;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mark-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mark-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
  white-space: nowrap;
}

.mark-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.96rem;
  font-weight: 700;
}

.mark-val.has-grade {
  color: var(--accent-emerald-light);
}

.mark-val.has-grade-high {
  color: #34D399;
}

.mark-val.empty {
  color: var(--text-muted);
}

/* Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 13, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-dialog {
  background: var(--bg-modal);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  background: rgba(18, 26, 42, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-badge-discipline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: var(--accent-cyan-soft);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
}

.modal-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.modal-teacher {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-red);
  border-color: rgba(244, 63, 94, 0.3);
}

.modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Modal Metrics */
.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.metric-box {
  background: #090F1A;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.metric-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.metric-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.value-emerald { color: var(--accent-emerald-light); }
.value-cyan { color: var(--accent-cyan); }
.value-amber { color: var(--accent-amber); }

/* Daily Journal List */
.daily-journal-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.daily-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.daily-section-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #E2E8F0;
}

.daily-tag {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-emerald-light);
  background: var(--accent-emerald-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

.daily-journal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #090F1B;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.daily-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: #0C1424;
}

.daily-info-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.daily-week-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--text-secondary);
}

.daily-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: #CBD5E1;
}

.daily-topic {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.daily-status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge-present {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-emerald-light);
  background: var(--accent-emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
}

.daily-score-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: #F8FAFC;
  background: #111A2E;
  border: 1px solid var(--border-subtle);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  min-width: 44px;
  text-align: center;
}

.daily-score-pill.high {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald-light);
}

.grade-formula-box {
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.04);
  border: 1px dashed rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.formula-title {
  font-weight: 700;
  color: var(--accent-emerald-light);
  display: block;
  margin-bottom: 2px;
}

.formula-desc code {
  font-family: 'JetBrains Mono', monospace;
  color: #E2E8F0;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 4px;
}

.modal-footer {
  padding: 14px 24px;
  background: rgba(14, 20, 32, 0.95);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.modal-action-btn {
  padding: 8px 20px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #F8FAFC;
  border: 1px solid var(--accent-emerald);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px var(--accent-emerald-glow);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Skeleton */
.skeleton-loader {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ----------------------------------------------------
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ---------------------------------------------------- */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 360px 1fr;
    gap: 16px;
  }
}

@media (max-width: 860px) {
  .app-layout {
    padding: 14px 12px 64px;
  }

  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .student-badge {
    width: 100%;
    justify-content: flex-start;
  }

  /* Show mobile segment tabs */
  .mobile-tab-switch {
    display: grid;
  }

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

  /* Toggle active section on mobile */
  .section-column {
    display: none !important;
  }

  .section-column.active-section {
    display: flex !important;
  }

  .modal-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grades-grid {
    grid-template-columns: 1fr;
  }

  .lesson-card {
    flex-direction: column;
    gap: 10px;
  }

  .lesson-time-box {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .brand-title {
    font-size: 1.1rem;
  }

  .modal-dialog {
    max-height: 94vh;
  }

  .modal-body {
    padding: 16px;
  }

  .daily-info-wrap {
    gap: 6px;
  }

  .grade-marks-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
