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

:root {
  --bg: #07070f;
  --surface: #0d0d1a;
  --card: #111120;
  --card-hover: #16162a;
  --border: rgba(139, 92, 246, 0.15);
  --border-light: rgba(255, 255, 255, 0.06);
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-light: #a78bfa;
  --primary-glow: rgba(139, 92, 246, 0.25);
  --primary-bg: rgba(139, 92, 246, 0.08);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition: all 0.2s ease;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --nav-height: 64px;
  --nav-bg: rgba(7, 7, 15, 0.92);
  --nav-bg-bottom: rgba(7, 7, 15, 0.97);
}

/* ═══════════════════════════════ TEMALAR ═══════════════════════════════ */
html.theme-light {
  --bg: #eef0ff;
  --surface: #ffffff;
  --card: #ffffff;
  --card-hover: #f3f4ff;
  --border: rgba(139, 92, 246, 0.2);
  --border-light: rgba(0, 0, 0, 0.08);
  --text: #1a1830;
  --text-secondary: #4b5263;
  --text-muted: #8892a4;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.14);
  --nav-bg: rgba(238, 240, 255, 0.95);
  --nav-bg-bottom: rgba(255, 255, 255, 0.98);
  --primary-bg: rgba(139, 92, 246, 0.1);
}
html.theme-blue {
  --bg: #020d1a;
  --surface: #04101f;
  --card: #06152b;
  --card-hover: #0d1f3e;
  --border: rgba(59, 130, 246, 0.18);
  --border-light: rgba(255, 255, 255, 0.05);
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --primary-bg: rgba(59, 130, 246, 0.08);
}
html.theme-green {
  --bg: #020e07;
  --surface: #04130a;
  --card: #07180d;
  --card-hover: #0d2416;
  --border: rgba(16, 185, 129, 0.18);
  --border-light: rgba(255, 255, 255, 0.05);
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #34d399;
  --primary-glow: rgba(16, 185, 129, 0.25);
  --primary-bg: rgba(16, 185, 129, 0.08);
  --success: #34d399;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════ SCROLLBAR ═══════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ═══════════════════════════════ NAVBAR ═══════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  gap: 32px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand-text {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav-brand-dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-links a.active {
  color: var(--primary-light);
  background: var(--primary-bg);
}

.nav-profile {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.profile-btn:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.profile-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
}

.profile-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown a,
.profile-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.profile-dropdown a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.profile-dropdown button:hover {
  color: var(--error);
  background: var(--error-bg);
}

/* ═══════════════════════════════ PAGE LAYOUT ═══════════════════════════════ */
.page {
  min-height: 100vh;
  padding-top: var(--nav-height);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

.container-sm {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ═══════════════════════════════ CARDS ═══════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
}

/* ═══════════════════════════════ BUTTONS ═══════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  box-shadow: 0 4px 15px rgba(139,92,246,0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,92,246,0.4);
}

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

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--text);
}

.btn-danger {
  background: var(--error-bg);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--error);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.2);
}

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

.btn-ghost:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

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

.btn-icon:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary-light);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ═══════════════════════════════ FORMS ═══════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select option {
  background: var(--card);
  color: var(--text);
}

.input-error {
  border-color: var(--error) !important;
}

.error-msg {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
}

/* ═══════════════════════════════ ALERTS ═══════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(16,185,129,0.25);
  color: #6ee7b7;
}

/* ═══════════════════════════════ AUTH PAGES ═══════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(139,92,246,0.12) 0%, transparent 70%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-text {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, #8b5cf6, #a78bfa, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.auth-logo-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover { text-decoration: underline; }

.auth-divider {
  text-align: center;
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-btn { width: 100%; padding: 12px; font-size: 15px; border-radius: var(--radius-sm); }

/* ═══════════════════════════════ COUNTDOWN ═══════════════════════════════ */
.countdown-section {
  text-align: center;
  padding: 60px 24px 48px;
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--primary-bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 24px;
}

.countdown-badge .dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.countdown-title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 48px;
  background: linear-gradient(135deg, var(--text), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.countdown-cards {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.countdown-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 40px;
  min-width: 280px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: default;
}

.countdown-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.countdown-card-tyt:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.countdown-card-ayt:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 20px 60px rgba(245, 158, 11, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.countdown-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.countdown-card-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-light);
  margin-bottom: 6px;
}

.countdown-card-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.countdown-units {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.countdown-unit {
  text-align: center;
}

.countdown-number {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, var(--text), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  min-width: 52px;
}

.countdown-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 6px;
}

.countdown-separator {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1;
  margin-top: 4px;
}

/* ═══════════════════════════════ PLANNING ═══════════════════════════════ */
.date-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.date-display {
  flex: 1;
  text-align: center;
}

.date-display-day {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.date-display-full {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.today-btn {
  font-size: 12px;
  padding: 4px 12px;
  margin-top: 6px;
}

.add-task-form {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.add-task-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.add-task-row .form-group {
  margin-bottom: 0;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.task-item:hover {
  border-color: var(--border);
  background: var(--card-hover);
}

.task-item.completed {
  opacity: 0.5;
}

.task-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  background: transparent;
}

.task-checkbox:hover {
  border-color: var(--primary);
}

.task-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}

.task-checkbox.checked::after {
  content: '';
  width: 6px; height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
  display: block;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-subject {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-light);
  margin-bottom: 2px;
}

.task-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item.completed .task-desc {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-delete {
  width: 30px; height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.task-delete:hover {
  background: var(--error-bg);
  color: var(--error);
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-sub {
  font-size: 14px;
  color: var(--text-muted);
}

/* ═══════════════════════════════ EXAMS ═══════════════════════════════ */
.exam-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
  width: fit-content;
}

.exam-tab {
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.exam-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(139,92,246,0.3);
}

.exam-form {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 32px;
}

.exam-form-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.exam-form-title span {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.subject-row {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
}

.subject-row-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary-light);
  margin-bottom: 10px;
}

.subject-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.subject-inputs label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.subject-inputs input {
  padding: 6px 10px;
  font-size: 14px;
  text-align: center;
}

.net-display {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-light);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

.total-net-row {
  background: var(--primary-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.total-net-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.total-net-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-light);
}

.exam-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exam-item {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition);
  cursor: pointer;
}

.exam-item:hover {
  border-color: var(--border);
  background: var(--card-hover);
}

.exam-item-left {
  flex: 1;
  min-width: 0;
}

.exam-item-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-item-date {
  font-size: 13px;
  color: var(--text-muted);
}

.exam-item-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.exam-net-badge {
  text-align: center;
}

.exam-net-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
}

.exam-net-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exam-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.exam-sort label {
  font-size: 13px;
  color: var(--text-muted);
}

.exam-sort select {
  width: auto;
  font-size: 13px;
  padding: 6px 28px 6px 10px;
}

.exam-detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.exam-detail-modal.open {
  opacity: 1;
  visibility: visible;
}

.exam-detail-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.exam-detail-modal.open .exam-detail-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
}

.modal-close {
  width: 36px; height: 36px;
  border: none;
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--error-bg);
  color: var(--error);
}

.detail-subject-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--surface);
}

.detail-subject-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 120px;
}

.detail-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
}

.detail-correct { color: var(--success); }
.detail-wrong { color: var(--error); }
.detail-net { color: var(--primary-light); }

.detail-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 20px 0 10px;
}

/* ═══════════════════════════════ STATISTICS ═══════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-container {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.chart-wrapper {
  position: relative;
  height: 220px;
}

.last-exam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ═══════════════════════════════ MISSING TOPICS ═══════════════════════════════ */
.topics-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.topics-form {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: calc(var(--nav-height) + 20px);
}

.topics-form-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.topic-item {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  transition: var(--transition);
}

.topic-item:hover {
  border-color: var(--border);
}

.topic-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.topic-subject-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--primary-bg);
  border: 1px solid var(--border);
  color: var(--primary-light);
  white-space: nowrap;
}

.topic-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.topic-wrong-section {
  border-top: 1px solid var(--border-light);
  padding: 12px 16px;
}

.topic-study-section {
  border-top: 1px solid var(--border-light);
  padding: 12px 16px;
  background: rgba(52, 199, 89, 0.03);
}

.topic-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.section-label-wrong {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ef4444;
}

.section-label-study {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #34c759;
}

.topic-expand-btn {
  width: 28px; height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.topic-expand-btn.expanded {
  transform: rotate(180deg);
}

.topic-sections {
  display: none;
}

.topic-sections.visible {
  display: block;
}

.topic-date-add-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.topic-date-rem-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.topic-date-rem-btn-wrong {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.topic-date-rem-btn-wrong:hover {
  background: rgba(239, 68, 68, 0.25);
}

.topic-date-rem-btn-study {
  background: rgba(52, 199, 89, 0.1);
  color: #34c759;
}

.topic-date-rem-btn-study:hover {
  background: rgba(52, 199, 89, 0.25);
}

.topic-date-add-btn-wrong {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.topic-date-add-btn-wrong:hover {
  background: rgba(239, 68, 68, 0.28);
}

.topic-date-add-btn-study {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

.topic-date-add-btn-study:hover {
  background: rgba(52, 199, 89, 0.28);
}

.topic-dates-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 20px;
}

.topic-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-muted);
}

.topic-date-tag .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-wrong { background: #ef4444; }
.dot-study { background: #34c759; }

.topic-no-dates {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.topic-delete {
  width: 28px; height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}

.topic-delete:hover {
  background: var(--error-bg);
  color: var(--error);
}

/* ═══════════════════════════════ PROFILE ═══════════════════════════════ */
.profile-page {
  max-width: 520px;
}

.profile-section {
  margin-bottom: 24px;
}

.section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ═══════════════════════════════ LOADING ═══════════════════════════════ */
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}

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

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══════════════════════════════ BADGE ═══════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-tyt {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.25);
  color: #93c5fd;
}

.badge-ayt {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.25);
  color: #fcd34d;
}

/* ═══════════════════════════════ BOTTOM NAV ═══════════════════════════════ */
.bottom-nav {
  display: none; /* sadece mobilde göster */
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--nav-bg-bottom);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 8px 4px;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item svg {
    transition: transform 0.15s ease;
  }

  .bottom-nav-item.active {
    color: var(--primary-light);
  }

  .bottom-nav-item.active svg {
    filter: drop-shadow(0 0 6px rgba(139,92,246,0.5));
    transform: translateY(-1px);
  }

  .bottom-nav-item:active svg {
    transform: scale(0.88);
  }
}

/* ═══════════════════════════════ RESPONSIVE ═══════════════════════════════ */

/* ── Tablet (≤1024px) ── */
@media (max-width: 1024px) {
  .container { max-width: 100%; padding: 32px 20px; }
  .container-sm { padding: 32px 20px; }
  .countdown-cards { gap: 16px; }
  .countdown-card { padding: 24px 28px; min-width: 240px; }
  .countdown-number { font-size: 34px; }
  .stats-grid { gap: 16px; }
  .last-exam-grid { gap: 16px; }
  .topics-layout { grid-template-columns: 280px 1fr; gap: 16px; }
  /* Desktop nav — daha dar ekranlarda sıkıştır */
  .navbar { gap: 12px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 6px 8px; font-size: 13px; }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {

  /* Navbar — sadece logo + profil */
  .navbar {
    padding: 0 16px;
    gap: 12px;
  }

  .nav-links { display: none; }

  /* Üst nav yüksekliği normal, alt nav için sayfa altına boşluk */
  .page {
    padding-top: var(--nav-height);
    padding-bottom: 72px;
  }

  /* Profil butonunda kullanıcı adı metnini gizle, sadece avatar kalsın */
  .nav-username-text { display: none; }
  .profile-btn { padding: 4px 4px; border-radius: 50%; }
  .profile-chevron { display: none; }

  /* Container */
  .container { padding: 20px 14px; }
  .container-sm { padding: 20px 14px; }

  /* Auth */
  .auth-card { padding: 28px 20px; }
  .auth-logo-text { font-size: 26px; }

  /* Countdown */
  .countdown-section { padding: 32px 16px 28px; }
  .countdown-title { font-size: 24px; margin-bottom: 28px; }
  .countdown-cards { flex-direction: column; align-items: stretch; gap: 12px; }
  .countdown-card { padding: 20px 20px; min-width: unset; width: 100%; max-width: 340px; margin: 0 auto; }
  .countdown-number { font-size: 30px; min-width: 38px; }
  .countdown-separator { font-size: 26px; }
  .quick-links { gap: 8px; }
  .quick-link { font-size: 13px; padding: 8px 14px; }

  /* Page header */
  .page-title { font-size: 22px; }

  /* Planning */
  .date-display-day { font-size: 18px; }
  .add-task-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .add-task-row .form-group { flex: unset !important; }
  .task-item { padding: 12px 12px; }

  /* Exams */
  .exam-tabs { width: 100%; }
  .exam-tab { flex: 1; padding: 8px 12px; font-size: 13px; }
  .exam-form { padding: 18px 14px; }
  .subject-grid { grid-template-columns: 1fr; }
  .subject-inputs { flex-wrap: wrap; gap: 6px; }
  .exam-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .exam-item-right { width: 100%; justify-content: space-between; }
  .modal-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .exam-detail-content { padding: 20px 16px; }
  .detail-stats { gap: 10px; font-size: 12px; }
  .detail-subject-name { font-size: 13px; min-width: 100px; }

  /* Statistics */
  .stats-grid { grid-template-columns: 1fr; gap: 14px; }
  .last-exam-grid { grid-template-columns: 1fr; gap: 14px; }
  .stats-summary { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-card { padding: 14px 10px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 10px; }

  /* Topics */
  .topics-layout { grid-template-columns: 1fr; gap: 16px; }
  .topics-form { position: static; }
  .topic-header { flex-wrap: wrap; gap: 8px; }

  /* Profile */
  .profile-page { max-width: 100%; }

  /* Cards */
  .card { padding: 16px 14px; }

  /* Buttons */
  .btn { padding: 9px 16px; font-size: 13px; }
}

/* ═══════════════════════════════ TIMER ═══════════════════════════════ */
.timer-card {
  text-align: center;
  padding: 36px 28px;
}

.timer-subject-wrap {
  max-width: 300px;
  margin: 0 auto 8px;
}

.timer-display {
  font-size: 76px;
  font-weight: 800;
  letter-spacing: -3px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--text), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 28px 0 32px;
  line-height: 1;
  transition: opacity 0.3s ease;
}

.timer-running .timer-display {
  animation: timerGlow 2s ease-in-out infinite;
}

@keyframes timerGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.timer-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.timer-controls .btn {
  min-width: 118px;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: var(--transition);
}

.session-item:hover {
  border-color: var(--border);
}

.session-subject-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--primary-bg);
  border: 1px solid var(--border);
  color: var(--primary-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.session-duration {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

/* ═══════════════════════════════ LEADERBOARD ═══════════════════════════════ */
.lb-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: var(--transition);
}

.lb-item.lb-clickable {
  cursor: pointer;
}

.lb-item.lb-clickable:hover {
  border-color: var(--border);
  background: var(--card-hover);
}

.lb-item.lb-me {
  border-color: rgba(139,92,246,0.5);
  background: var(--primary-bg);
}

.lb-rank {
  font-size: 18px;
  font-weight: 800;
  min-width: 32px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lb-avatar {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  flex-shrink: 0;
}

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

.lb-username {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-light);
  text-align: right;
  flex-shrink: 0;
}

.lb-score-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

/* ── Compact bottom nav (7+ items) — scrollable ── */
.bottom-nav.bottom-nav-compact {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  justify-content: flex-start;
}
.bottom-nav.bottom-nav-compact::-webkit-scrollbar { display: none; }
.bottom-nav.bottom-nav-compact .bottom-nav-item {
  flex: 0 0 52px;
  font-size: 9px;
  padding: 6px 2px;
}

/* ═══════════════════════════════ MESSAGES ═══════════════════════════════ */
.conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s ease;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.conv-item:hover { background: rgba(255,255,255,0.03); }
.conv-item:last-child { border-bottom: none; }

.conv-avatar {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  flex-shrink: 0;
}

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

.conv-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-preview {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.conv-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 3px;
}

/* ═══════════════════════════════ CHAT ═══════════════════════════════ */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  background: rgba(7, 7, 15, 0.96);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  min-height: 60px;
}

.chat-back {
  width: 36px; height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}
.chat-back:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.chat-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.chat-header-name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}
.msg-row.msg-sent    { align-self: flex-end;   align-items: flex-end; }
.msg-row.msg-received{ align-self: flex-start; align-items: flex-start; }

.msg-bubble {
  padding: 9px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-sent     .msg-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.msg-received .msg-bubble { background: var(--card); border: 1px solid var(--border-light); color: var(--text); border-bottom-left-radius: 4px; }

.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  padding: 0 4px;
}

.chat-date-sep {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 0 6px;
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom)) 16px;
  background: rgba(7, 7, 15, 0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}
.chat-input-bar input {
  flex: 1;
  border-radius: 100px;
  padding: 10px 16px;
  font-size: 14px;
  margin-bottom: 0;
}
.chat-send-btn {
  width: 40px; height: 40px;
  border: none;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--primary-dark); transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ═══════════════════════════════ UNREAD BADGE ═══════════════════════════════ */
.bottom-nav-item { position: relative; }
.nav-links a     { position: relative; }

.nav-unread-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  line-height: 1;
}

.conv-unread-dot {
  width: 9px;
  height: 9px;
  min-width: 9px;
  background: var(--primary);
  border-radius: 50%;
  align-self: center;
  flex-shrink: 0;
}

.conv-preview-unread {
  color: var(--text-secondary) !important;
  font-weight: 600;
}

.conv-time-unread {
  color: var(--primary-light) !important;
  font-weight: 700;
}

/* ═══════════════════════════════ ROLE BADGES ═══════════════════════════════ */
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  line-height: 1.6;
}
.role-badge-coach {
  background: rgba(234,179,8,0.15);
  color: #eab308;
  border: 1px solid rgba(234,179,8,0.3);
}
.role-badge-admin {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
}

/* ═══════════════════════════════ COACH PAGE ═══════════════════════════════ */
.coach-student-card { margin-bottom: 12px; overflow: hidden; }
.coach-student-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 16px;
  gap: 12px;
  transition: background 0.15s;
  border-radius: var(--radius);
}
.coach-student-header:hover { background: rgba(255,255,255,0.03); }
.coach-student-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.coach-student-name { font-size: 15px; font-weight: 700; }
.coach-student-stats { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.coach-student-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 500px) {
  .coach-student-header { flex-wrap: wrap; }
  .coach-student-info { width: 100%; }
  .coach-student-actions { width: 100%; border-top: 1px solid var(--border-light); padding-top: 10px; margin-top: 4px; }
}
.coach-student-body { border-top: 1px solid var(--border-light); padding: 16px; }
.coach-chevron { transition: transform 0.2s; color: var(--text-muted); flex-shrink: 0; }
.coach-chevron.open { transform: rotate(180deg); }

/* ═══════════════════════════════ ADMIN PAGE ═══════════════════════════════ */
.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; }
@media (max-width: 500px) {
  .admin-table .col-field { display: none; }
}
.admin-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Small Mobile (≤420px) ── */
@media (max-width: 420px) {
  .countdown-number { font-size: 26px; min-width: 32px; }
  .countdown-label { font-size: 10px; }
  .countdown-separator { font-size: 22px; }
  .stats-summary { grid-template-columns: repeat(2, 1fr); }
  .nav-brand-text { font-size: 16px; }
  .profile-btn span { display: none; }
  .auth-card { padding: 24px 16px; }

  /* Timer mobile */
  .timer-display { font-size: 56px; letter-spacing: -2px; }
  .timer-controls .btn { min-width: 90px; }
}

/* ═══════════════════════════════ ANNOUNCEMENTS ═══════════════════════════════ */
.announcement-item {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.announcement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.announcement-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 6px;
}
.announcement-date {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.announcement-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.announcement-section {
  width: 100%;
  max-width: 680px;
  margin: 0 auto 32px;
  padding: 0 24px;
}
@media (max-width: 768px) {
  .announcement-section { padding: 0 16px; }
}

/* ═══════════════════════════════ STUDYING RING ═══════════════════════════════ */
@keyframes studying-breathe {
  0%, 100% { box-shadow: 0 0 0 2.5px #10b981, 0 0 6px 3px rgba(16,185,129,0.35); }
  50%       { box-shadow: 0 0 0 2.5px #10b981, 0 0 16px 8px rgba(16,185,129,0.12); }
}
.conv-avatar.studying {
  animation: studying-breathe 2s ease-in-out infinite;
}

/* ═══════════════════════════════ GROUPS ═══════════════════════════════ */
.group-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  margin-bottom: 10px;
}
.group-item:hover { border-color: var(--primary); background: var(--primary-bg); }

.group-avatar {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.group-info  { flex: 1; min-width: 0; }
.group-name  { font-size: 15px; font-weight: 700; }
.group-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.group-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.group-tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.group-tab.active { color: var(--primary-light); border-bottom-color: var(--primary); }
.group-tab:hover  { color: var(--text); }

.group-panel {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  padding: 14px 16px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.member-study-status { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.member-study-status.active-now { color: var(--success); font-weight: 600; }

.group-msg-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-light);
  margin-bottom: 2px;
  padding: 0 4px;
}

.owner-badge {
  font-size: 10px;
  color: var(--warning);
  font-weight: 700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

/* ═══════════════════════════════ FLIP CLOCK ═══════════════════════════════ */
.flip-clock-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 24px;
  user-select: none;
}
.flip-pair {
  position: relative;
  display: flex;
  background: #1d1d1d;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.55);
}
.flip-pair-line {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: rgba(0,0,0,0.8);
  z-index: 20;
  pointer-events: none;
}
.fd {
  position: relative;
  width: 54px;
  height: 92px;
  perspective: 300px;
}
.fd + .fd { border-left: 1px solid rgba(0,0,0,0.4); }
.fd-half {
  position: absolute;
  left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  display: flex;
  justify-content: center;
}
/* upper: align-items flex-start → digit's TOP portion visible through clip */
.fd-top-half {
  top: 0;
  align-items: flex-start;
  padding-top: 5px;
  background: #252525;
}
/* lower: align-items flex-end → digit's BOTTOM portion visible through clip */
.fd-bottom-half {
  top: 50%;
  align-items: flex-end;
  padding-bottom: 5px;
  background: #1d1d1d;
}
.fd-half span {
  font-size: 82px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #888;
}
.fd-flap {
  position: absolute;
  left: 0; right: 0;
  height: 50%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  z-index: 3;
  backface-visibility: hidden;
}
.fd-flap span {
  font-size: 82px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #888;
}
.fd-flap-upper {
  top: 0;
  align-items: flex-start;
  padding-top: 5px;
  background: #252525;
  transform-origin: center bottom;
}
.fd-flap-lower {
  top: 50%;
  align-items: flex-end;
  padding-bottom: 5px;
  background: #1d1d1d;
  transform-origin: center top;
  transform: rotateX(90deg);
}
.fd-flap-upper.go { animation: fdUpper 0.26s ease-in forwards; }
.fd-flap-lower.go { animation: fdLower 0.26s ease-out 0.22s forwards; }
@keyframes fdUpper {
  0%   { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}
@keyframes fdLower {
  0%   { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* ═══════════════════════════════ SETTINGS ═══════════════════════════════ */
.settings-section { margin-bottom: 28px; }
.settings-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.theme-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
}
.theme-card:hover { border-color: var(--primary); }
.theme-card.active { border-color: var(--primary); background: var(--primary-bg); }
.theme-swatch {
  width: 36px; height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.theme-card-label { font-size: 13px; font-weight: 600; }
.theme-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.timer-style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.timer-style-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: var(--surface);
}
.timer-style-card:hover { border-color: var(--primary); }
.timer-style-card.active { border-color: var(--primary); background: var(--primary-bg); }
.timer-style-preview {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.flip-preview {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 6px;
}
.flip-preview-pair {
  display: flex;
  background: #1e1e1e;
  border-radius: 6px;
  overflow: hidden;
}
.flip-preview-pair span {
  width: 20px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #888;
  font-variant-numeric: tabular-nums;
}
.flip-preview-pair span + span { border-left: 1px solid rgba(0,0,0,0.5); }
.timer-style-name { font-size: 13px; font-weight: 600; }

.profile-avatar img,
.lb-avatar img,
.conv-avatar img,
.prev-winner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
