/* SistemKoc - Premium Dark Theme CSS */
/* Mobile-first, glassmorphism, indigo accent */

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

:root {
  /* Dark theme (default) */
  --bg-body: #0f1019;
  --bg-card: #1a1b2e;
  --bg-card-hover: #1f2038;
  --bg-sidebar: #141522;
  --bg-input: #1e2035;
  --bg-glass: rgba(26, 27, 46, 0.7);
  --text: #e2e4ed;
  --text-secondary: #9395a5;
  --text-muted: #6b6d7b;
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-light: #a5b4fc;
  --accent: #a78bfa;
  --accent-pink: #f472b6;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 260px;
}

[data-theme="light"] {
  --bg-body: #eef0fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fc;
  --bg-sidebar: #312e81;
  --bg-input: #f3f4f8;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --text: #1e1e2e;
  --text-secondary: #64668a;
  --text-muted: #9395a5;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --border: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --sidebar-text: rgba(255, 255, 255, 0.9);
  --sidebar-text-muted: rgba(255, 255, 255, 0.5);
  --sidebar-hover: rgba(255, 255, 255, 0.1);
  --sidebar-active-bg: rgba(255, 255, 255, 0.15);
  --sidebar-border: rgba(255, 255, 255, 0.08);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* ========== UTILITIES ========== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 1rem; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
  color: #fff;
}
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-input); color: var(--text); }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; min-height: 36px; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { min-height: 100px; resize: vertical; }
.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.25rem;
}
.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ========== AUTH PAGES ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}
.auth-orb-1 {
  width: 400px; height: 400px;
  background: var(--primary);
  top: -10%; left: -10%;
}
.auth-orb-2 {
  width: 350px; height: 350px;
  background: var(--accent);
  bottom: -10%; right: -10%;
  animation-delay: -7s;
}
.auth-orb-3 {
  width: 250px; height: 250px;
  background: var(--accent-pink);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 2rem;
}
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo h1 {
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.auth-footer a { font-weight: 500; }
.google-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text);
}
.google-btn:hover { background: var(--bg-card-hover); border-color: var(--primary); }
.google-btn svg { width: 20px; height: 20px; }
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.auth-alert-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: var(--danger);
}
.auth-alert-success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--success);
}

/* ========== ROLE SELECTION ========== */
.role-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  .role-grid { grid-template-columns: repeat(2, 1fr); }
}
.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
}
.role-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
  color: var(--text);
}
.role-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.role-icon svg { color: #fff; }
.role-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.role-card p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.google-info-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.google-info-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 0 0.75rem;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
}
.hamburger-btn:hover { background: var(--bg-input); }
.header-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.header-icon-btn:hover { background: var(--bg-input); color: var(--text); }
.header-icon-btn svg { width: 20px; height: 20px; }
.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  overflow: hidden;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  z-index: 200;
  display: none;
}
.user-dropdown.active { display: block; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font);
  text-align: left;
}
.user-dropdown-item:hover { background: var(--bg-input); }
.user-dropdown-item svg { width: 18px; height: 18px; color: var(--text-secondary); }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 0.375rem 0; }
.user-dropdown-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem;
  overflow-y: auto;
  z-index: 90;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 80;
  display: none;
}
.sidebar-overlay.active { display: block; }
.sidebar-section {
  margin-bottom: 1.5rem;
}
.sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 450;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font);
  text-align: left;
  min-height: 44px;
}
.sidebar-item:hover {
  background: var(--bg-input);
  color: var(--text);
}
.sidebar-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}
.sidebar-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
}

/* Light theme sidebar overrides */
[data-theme="light"] .header {
  background: var(--bg-sidebar);
  border-bottom-color: var(--sidebar-border);
}
[data-theme="light"] .header-logo {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .hamburger-btn {
  color: rgba(255,255,255,0.9);
}
[data-theme="light"] .hamburger-btn:hover {
  background: var(--sidebar-hover);
}
[data-theme="light"] .header-icon-btn {
  color: rgba(255,255,255,0.7);
}
[data-theme="light"] .header-icon-btn:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
[data-theme="light"] .user-avatar {
  border-color: rgba(255,255,255,0.2);
}
[data-theme="light"] .sidebar {
  border-right-color: var(--sidebar-border);
}
[data-theme="light"] .sidebar-section-title {
  color: var(--sidebar-text-muted);
}
[data-theme="light"] .sidebar-item {
  color: var(--sidebar-text);
}
[data-theme="light"] .sidebar-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
[data-theme="light"] .sidebar-item.active {
  background: var(--sidebar-active-bg);
  color: #fff;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  margin-top: 64px;
  padding: 1.25rem 1rem;
  min-height: calc(100vh - 64px);
}
.panel { display: none; }
.panel.active { display: block; }
.page-header {
  margin-bottom: 1.5rem;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

/* ========== STAT CARDS ========== */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; color: #fff; }
.stat-icon-indigo { background: linear-gradient(135deg, #6366f1, #818cf8); }
.stat-icon-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.stat-icon-pink { background: linear-gradient(135deg, #ec4899, #f472b6); }
.stat-icon-green { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-icon-amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ========== BADGES & TAGS ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-primary { background: rgba(99, 102, 241, 0.12); color: var(--primary); }
.badge-success { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.badge-warning { background: rgba(251, 191, 36, 0.12); color: var(--warning); }
.badge-danger { background: rgba(248, 113, 113, 0.12); color: var(--danger); }
.badge-purple { background: rgba(167, 139, 250, 0.12); color: var(--accent); }

/* ========== TABLES ========== */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}
.table tr:hover td { background: var(--bg-card-hover); }

/* Exam entry table compact inputs */
.exam-entry-table .form-input {
  height: 34px;
  min-width: 50px;
  font-variant-numeric: tabular-nums;
}
.exam-entry-table td { padding: 0.375rem 0.5rem; vertical-align: middle; }
.exam-entry-table th { padding: 0.5rem; }

/* Mobile exam entry — card layout per subject */
@media (max-width: 540px) {
  .exam-entry-table thead { display: none; }
  .exam-entry-table,
  .exam-entry-table tbody,
  .exam-entry-table tr,
  .exam-entry-table td { display: block; width: 100%; }
  .exam-entry-table tr {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    position: relative;
  }
  .exam-entry-table tr:last-child { border-bottom: none; }
  .exam-entry-table td {
    padding: 0.25rem 0;
    text-align: left !important;
  }
  .exam-entry-table td:first-child {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.375rem;
    color: var(--primary);
  }
  .exam-entry-table td:nth-child(2) {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  .exam-entry-table td:nth-child(2)::before { content: "Soru: "; }
  .exam-entry-table td:nth-child(3),
  .exam-entry-table td:nth-child(4),
  .exam-entry-table td:nth-child(5) {
    display: inline-block;
    width: 32%;
    vertical-align: top;
  }
  .exam-entry-table td:nth-child(3)::before { content: "D "; font-size: 0.75rem; color: var(--success); font-weight: 600; }
  .exam-entry-table td:nth-child(4)::before { content: "Y "; font-size: 0.75rem; color: var(--danger); font-weight: 600; }
  .exam-entry-table td:nth-child(5)::before { content: "B "; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
  .exam-entry-table td:nth-child(3) .form-input,
  .exam-entry-table td:nth-child(4) .form-input,
  .exam-entry-table td:nth-child(5) .form-input {
    width: 100%;
    min-width: 0;
  }
  .exam-entry-table td:nth-child(6) {
    margin-top: 0.375rem;
    font-size: 1rem;
  }
  .exam-entry-table td:nth-child(6)::before { content: "Net: "; font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
  /* Total row */
  .exam-entry-table tr[style*="background"] td:nth-child(2)::before,
  .exam-entry-table tr[style*="background"] td:nth-child(3)::before,
  .exam-entry-table tr[style*="background"] td:nth-child(4)::before,
  .exam-entry-table tr[style*="background"] td:nth-child(5)::before,
  .exam-entry-table tr[style*="background"] td:nth-child(6)::before { content: none; }
  .exam-entry-table tr[style*="background"] td { display: inline-block; width: auto; padding: 0 0.5rem; }
  .exam-entry-table tr[style*="background"] td:first-child { color: var(--text); }

  /* Exam modal wider on mobile */
  #exam-modal .modal { max-width: 100%; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 95vh; }
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}
.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
}
.modal-close:hover { background: var(--bg-input); color: var(--text); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ========== EMPTY STATE ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}
.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.empty-state p {
  font-size: 0.9375rem;
  max-width: 320px;
}

/* ========== TABS ========== */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  min-height: 44px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: calc(100% - 2rem);
}
.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.3s ease;
  box-shadow: var(--shadow);
  min-width: 260px;
}
.toast-success { background: rgba(52, 211, 153, 0.15); border: 1px solid rgba(52, 211, 153, 0.3); color: var(--success); }
.toast-error { background: rgba(248, 113, 113, 0.15); border: 1px solid rgba(248, 113, 113, 0.3); color: var(--danger); }
.toast-info { background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3); color: var(--primary); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== CALENDAR ========== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.calendar-header-cell {
  padding: 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
}
.calendar-cell {
  min-height: 44px;
  padding: 0.375rem;
  background: var(--bg-card);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.calendar-cell:hover { background: var(--bg-card-hover); }
.calendar-cell.today { background: rgba(99, 102, 241, 0.08); }
.calendar-cell.selected { background: rgba(99, 102, 241, 0.18); box-shadow: inset 0 0 0 2px var(--primary); border-radius: 6px; }

/* Calendar event cards scroll */
.cal-events-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.cal-events-scroll::-webkit-scrollbar { height: 4px; }
.cal-events-scroll::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 4px; }
.cal-events-scroll::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.cal-event-card {
  flex: 0 0 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem;
  scroll-snap-align: start;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cal-event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
@media (max-width: 640px) {
  .cal-event-card { flex: 0 0 220px; padding: 0.75rem; }
}
.calendar-cell.other-month { color: var(--text-muted); }
.calendar-cell-date {
  font-weight: 500;
  margin-bottom: 0.125rem;
}
.calendar-event {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.125rem;
}
@media (max-width: 767px) {
  .calendar-cell { min-height: 36px; padding: 0.25rem; }
  .calendar-event { display: none; }
  .calendar-cell.has-event::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin: 0.125rem auto 0;
  }
}

/* ========== LOADING ========== */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

/* ========== TASK LIST ========== */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.task-item:hover { background: var(--bg-card-hover); }
.task-item:last-child { border-bottom: none; }
.task-priority-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.375rem;
  flex-shrink: 0;
}
.priority-low { background: var(--success); }
.priority-medium { background: var(--primary); }
.priority-high { background: var(--warning); }
.priority-urgent { background: var(--danger); }
.task-info { flex: 1; min-width: 0; }
.task-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ========== NOTIFICATION LIST ========== */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { background: rgba(99, 102, 241, 0.04); }
.notif-item.unread .notif-title { font-weight: 600; }
.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon svg { width: 20px; height: 20px; color: #fff; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 0.875rem; margin-bottom: 0.125rem; }
.notif-message { font-size: 0.8125rem; color: var(--text-secondary); }
.notif-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ========== CONNECTION CARDS ========== */
.connection-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.connection-card:last-child { border-bottom: none; }
.connection-card.clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.connection-card.clickable:hover {
  background: rgba(129, 140, 248, 0.06);
}
.connection-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
  overflow: hidden;
}
.connection-avatar img { width: 100%; height: 100%; object-fit: cover; }
.connection-info { flex: 1; min-width: 0; }
.connection-name { font-weight: 500; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connection-role { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.connection-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
.connection-actions .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.6875rem; }

/* STUDENT CARDS GRID */
.student-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.student-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}
.student-card-info { flex: 1; }
.student-card.clickable { cursor: pointer; }
.student-card.clickable:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.student-card-top {
  text-align: center;
  padding: 1.25rem 1rem 0.75rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
}
[data-theme="light"] .student-card {
  background: #f0eef8;
  border-color: rgba(99,102,241,0.12);
}
[data-theme="light"] .student-card-top {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.1));
}
.student-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.student-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.student-card-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-card-role {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.student-card-group {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(99,102,241,0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  margin-top: 0.375rem;
}
.student-card-info {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
}
.student-card-detail {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  padding: 0.2rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.student-card-actions {
  display: flex;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 480px) {
  .student-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
  .student-card-top { padding: 1rem 0.5rem 0.5rem; }
  .student-card-avatar { width: 44px; height: 44px; font-size: 0.875rem; }
  .student-card-name { font-size: 0.8125rem; }
  .student-card-info { padding: 0.375rem 0.625rem; }
  .student-card-actions { padding: 0.375rem 0.5rem; }
}

/* ========== SEARCH ========== */
.search-box {
  position: relative;
}
.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.search-box input {
  padding-left: 2.5rem;
}

/* ========== PROFILE ========== */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  gap: 1rem;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  overflow: hidden;
  position: relative;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-upload {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.profile-avatar:hover .profile-avatar-upload { display: flex; }

/* ========== DESKTOP ========== */
@media (min-width: 1024px) {
  .hamburger-btn { display: none; }
  .sidebar {
    transform: translateX(0);
  }
  .sidebar-overlay { display: none !important; }
  .main-content {
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
  }
  .header {
    padding-left: 0.75rem;
  }
  .auth-card { padding: 2.5rem; }
}

/* ========== TABLET ========== */
@media (min-width: 768px) and (max-width: 1023px) {
  .main-content { padding: 1.25rem 1.5rem; }
}

/* ========== GOAL CARDS ========== */
.goal-card {
  cursor: pointer;
  transition: all var(--transition);
}
.goal-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}
.goal-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.goal-card-info {
  flex: 1;
  min-width: 0;
}
.goal-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.375rem;
}
.goal-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  align-items: center;
}
.goal-card-pct {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
}

/* ========== DASHBOARD V2 ========== */
.dash-top-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.dash-top-left { flex: 1; min-width: 0; }
.dash-top-right {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 60%;
}
.dash-widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  min-width: 170px;
  flex: 1;
  cursor: pointer;
  transition: all 0.2s;
}
.dash-widget-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.dash-widget-title {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}
.dash-widget-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.dash-widget-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 6px;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .dash-top-row { flex-direction: column; }
  .dash-top-right { max-width: 100%; }
}
.dash-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.dash-welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}
.dash-welcome-quote {
  color: var(--primary-light);
  font-size: 0.9375rem;
  font-style: italic;
  margin-top: 0.375rem;
  opacity: 0.85;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 1024px) {
  .dash-grid {
    grid-template-columns: 1fr 340px;
  }
}
@media (min-width: 1280px) {
  .dash-grid {
    grid-template-columns: 1fr 380px;
  }
}
.dash-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.dash-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Next Session Card */
.dash-next-session {
  padding: 0 !important;
  overflow: hidden;
}
.dash-ns-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.dash-ns-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  flex-wrap: wrap;
}
.dash-ns-date {
  width: 64px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.dash-ns-day {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}
.dash-ns-month {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.125rem;
}
.dash-ns-info {
  flex: 1;
  min-width: 0;
}
.dash-ns-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.dash-ns-time,
.dash-ns-location {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.125rem;
}
.dash-ns-join {
  flex-shrink: 0;
}
.dash-ns-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Progress Bars */
.dash-progress-item {
  padding: 0 0 1rem 0;
}
.dash-progress-item:last-child {
  padding-bottom: 0;
}
.dash-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.dash-progress-label {
  font-size: 0.875rem;
  font-weight: 500;
}
.dash-progress-pct {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.dash-progress-bar {
  width: 100%;
  height: 10px;
  background: var(--bg-input);
  border-radius: 5px;
  overflow: hidden;
}
.dash-progress-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s ease;
  min-width: 2px;
}
.dash-progress-green {
  background: linear-gradient(90deg, #10b981, #34d399);
}
.dash-progress-amber {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.dash-progress-indigo {
  background: linear-gradient(90deg, #6366f1, #818cf8);
}
.dash-progress-empty {
  text-align: center;
  padding: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Quick Links */
.dash-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.dash-quick-links {
  padding: 1rem 1.25rem;
}
.dash-qlink {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
.dash-qlink:last-child {
  border-bottom: none;
}
.dash-qlink:hover {
  padding-left: 0.25rem;
}
.dash-qlink-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-qlink-icon svg {
  width: 18px;
  height: 18px;
  color: #fff;
}
.dash-qlink-info {
  flex: 1;
  text-align: left;
}
.dash-qlink-label {
  font-size: 0.875rem;
  font-weight: 500;
}
.dash-qlink-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Focus Card */
.dash-focus-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.dash-focus-card::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.dash-focus-card::after {
  content: '';
  position: absolute;
  bottom: -15%;
  left: -5%;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.dash-focus-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
  margin-bottom: 0.5rem;
}
.dash-focus-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}
.dash-focus-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* Connections Avatar Stack */
.dash-conn-stack {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}
.dash-conn-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  border: 3px solid var(--bg-card);
  margin-left: -10px;
  overflow: hidden;
  flex-shrink: 0;
}
.dash-conn-avatar:first-child {
  margin-left: 0;
}
.dash-conn-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dash-conn-extra {
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.75rem;
}
.dash-conn-empty {
  text-align: center;
  padding: 1rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Stats Mini Row */
.dash-stats-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.dash-stat-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.dash-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.dash-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* ========== BADGE COLORS EXTRA ========== */
.badge-indigo { background: rgba(99,102,241,0.15); color: #818cf8; }
.badge-purple { background: rgba(167,139,250,0.15); color: #a78bfa; }

/* ========== GRID-4 responsive ========== */
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ========== COUNTDOWN ITEM ========== */
.dash-countdown-item:last-child { border-bottom: none !important; }

/* ========== STUDENT COUNTDOWN HERO (compact horizontal) ========== */
.cd-hero-card {
  background: linear-gradient(135deg, var(--cd-c1), var(--cd-c2));
  border-radius: var(--radius-lg, 0.75rem);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cd-hero-card::before {
  content: '';
  position: absolute;
  top: -80%;
  right: -10%;
  width: 140px;
  height: 140px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  pointer-events: none;
}
.cd-hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.cd-hero-left { flex: 1; min-width: 0; }
.cd-hero-title {
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cd-hero-cat-badge {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255,255,255,0.2);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
}
.cd-hero-meta {
  font-size: 0.6875rem;
  opacity: 0.65;
  margin-top: 0.125rem;
}
.cd-hero-numbers {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.cd-hero-num-block { text-align: center; }
.cd-hero-num {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.cd-hero-unit {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.65;
}
.cd-hero-separator {
  font-size: 1rem;
  font-weight: 300;
  opacity: 0.3;
  margin-top: -0.4rem;
}
@media (max-width: 480px) {
  .cd-hero-num { font-size: 1.25rem; }
  .cd-hero-separator { font-size: 0.875rem; }
}

/* ========== CLICKABLE CARD ========== */
.connection-card.clickable { cursor: pointer; transition: background var(--transition); }
.connection-card.clickable:hover { background: var(--bg-card-hover); }

/* ========== STAT ICON COLORS ========== */
.stat-icon-amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

/* ========== TABS WRAP ========== */
.tabs { flex-wrap: wrap; }

/* ========== EXAM HUB CARDS ========== */
.exam-hub-card {
  transition: all var(--transition);
}
.exam-hub-card:hover:not(.exam-hub-disabled) {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}
.exam-hub-disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
}

/* ========== EXAM CHARTS ========== */
/* ========== REPORT CARDS (Sınav Karnesi) ========== */
.report-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
}
.report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
  flex-wrap: wrap;
}
.report-card-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.report-card-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.report-card-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.report-stat {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}
.report-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.report-stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}
.report-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-left: 0.125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.report-subjects {
  padding: 0;
}
.report-subject-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}
.report-subject-row:last-child { border-bottom: none; }
.report-total-row {
  background: rgba(99,102,241,0.04);
  border-top: 1px solid var(--border);
  border-bottom: none;
}
.report-total-row .report-subject-name { font-weight: 700; }
.report-subject-name {
  min-width: 80px;
  width: 90px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
}
.report-subject-stats {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.report-dyb {
  font-size: 0.75rem;
  min-width: 72px;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  font-variant-numeric: tabular-nums;
}
.report-d { color: var(--success); font-weight: 600; }
.report-y { color: var(--danger); font-weight: 600; }
.report-b { color: var(--text-muted); }
.report-sep { color: var(--border); font-size: 0.625rem; margin: 0 1px; }
.report-net-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.report-net-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.6s ease;
}
.report-net-val {
  min-width: 36px;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.report-net-total {
  font-size: 0.9375rem;
  color: var(--primary);
}
.report-card-note {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}
@media (max-width: 540px) {
  .report-card-header { flex-direction: column; align-items: flex-start; }
  .report-card-header-right { width: 100%; justify-content: space-between; }
  .report-subject-name { min-width: 60px; width: 60px; font-size: 0.75rem; }
  .report-dyb { min-width: 60px; font-size: 0.6875rem; }
  .report-subject-stats { gap: 0.5rem; }
}

/* ========== TREND SUMMARY (stat boxes) ========== */
.trend-summary-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.trend-summary-item {
  flex: 1;
  min-width: 80px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  padding: 0.625rem 0.75rem;
  text-align: center;
}
.trend-summary-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.trend-summary-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ========== CHART CARDS (clean) ========== */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chart-card-title {
  font-weight: 600;
  font-size: 0.9375rem;
}
.chart-svg {
  width: 100%;
  overflow: visible;
}
.chart-legend-inline {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.chart-legend-tag {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Subject comparison bars */
.subj-compare-row {
  margin-bottom: 0.625rem;
}
.subj-compare-row:last-child { margin-bottom: 0; }
.subj-compare-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}
.subj-compare-diff {
  font-weight: 600;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.subj-compare-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.subj-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.subj-bar-bg {
  flex: 1;
  height: 7px;
  background: var(--border);
  border-radius: 3.5px;
  overflow: hidden;
}
.subj-bar-fill {
  height: 100%;
  border-radius: 3.5px;
  transition: width 0.6s ease;
  min-width: 3px;
}
.subj-bar-prev { background: var(--text-muted); opacity: 0.35; }
.subj-bar-curr { background: var(--primary); }
.subj-bar-val {
  font-size: 0.6875rem;
  color: var(--text-muted);
  min-width: 28px;
  font-variant-numeric: tabular-nums;
}
.subj-bar-val-curr { color: var(--primary); font-weight: 600; }

/* Percentile ring (single exam) */
.pct-ring {
  width: 80px;
  height: 80px;
  position: relative;
  flex-shrink: 0;
}
.pct-ring svg { width: 100%; height: 100%; }
.pct-ring-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease; }

/* ========== STUDENT GROUP SYSTEM ========== */
.group-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.group-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.group-legend-item:hover {
  border-color: var(--text-muted);
}
.group-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.group-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.group-color-picker {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.group-color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.group-color-option:hover {
  transform: scale(1.15);
}
.group-color-option.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg);
}
.group-color-option.selected::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.student-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
/* Group manage modal */
.group-manage-section {
  margin-bottom: 1.25rem;
}
.group-manage-section:last-child {
  margin-bottom: 0;
}
.group-manage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.group-manage-header h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
}
.group-student-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  transition: background 0.15s;
}
.group-student-row:hover {
  background: var(--hover);
}
.group-student-row .connection-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.65rem;
}
.group-student-row select {
  margin-left: auto;
  width: auto;
  min-height: auto;
  padding: 0.3rem 0.5rem;
  font-size: 0.8125rem;
  appearance: auto;
  -webkit-appearance: auto;
}
.group-manage-no-group {
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 0.5rem 0;
}

/* ===== PARENT CHILDREN CARDS ===== */
.parent-children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
@media (max-width: 480px) {
  .parent-children-grid { grid-template-columns: 1fr; }
}
.parent-child-card.card {
  padding: 0 !important;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.parent-child-card.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.pc-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}
.pc-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  overflow: hidden;
}
.pc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pc-info {
  flex: 1;
  min-width: 0;
}
.pc-name {
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.pc-coach {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.pc-stats-row {
  display: flex;
  border-top: 1px solid var(--border);
}
.pc-stat {
  flex: 1;
  text-align: center;
  padding: 0.625rem 0.25rem;
  border-right: 1px solid var(--border);
}
.pc-stat:last-child { border-right: none; }
.pc-stat-num {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
}
.pc-stat-lbl {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pc-progress {
  padding: 0.625rem 1.25rem 0.875rem;
  border-top: 1px solid var(--border);
}
.pc-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

/* HOME CARDS */
.home-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 1.75rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.home-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 12px 12px 0 0;
  background: var(--card-accent, var(--primary));
}
.home-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
[data-theme="light"] .home-card {
  background: color-mix(in srgb, var(--card-accent, var(--primary)) 8%, #ffffff);
  border-color: color-mix(in srgb, var(--card-accent, var(--primary)) 15%, transparent);
}
[data-theme="light"] .home-card:hover {
  background: color-mix(in srgb, var(--card-accent, var(--primary)) 14%, #ffffff);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--card-accent, var(--primary)) 15%, transparent);
}
.home-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.home-card-icon svg, .home-card-icon i {
  width: 26px;
  height: 26px;
}
.home-card-title {
  font-size: 1.125rem;
  font-weight: 650;
  color: var(--text);
}
.home-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.home-card-arrow {
  color: var(--text-muted);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.2s;
}
.home-card:hover .home-card-arrow {
  color: var(--primary);
}

@media (max-width: 640px) {
  .home-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .home-card {
    padding: 1.25rem;
  }
}

/* SIDEBAR WIDGETS */
.sw-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.sw-item:last-child { border-bottom: none; }
.sw-date-badge {
  min-width: 40px;
  text-align: center;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 0.375rem 0.25rem;
}
.sw-day {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.sw-month {
  display: block;
  font-size: 0.625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}
.sw-item-info { flex: 1; min-width: 0; }
.sw-item-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-item-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.sw-goal {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.sw-goal:last-child { border-bottom: none; }
.sw-goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}
.sw-goal-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.sw-goal-pct {
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.5rem;
}
.sw-progress-bar {
  height: 4px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}
.sw-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.sw-countdown {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}
.sw-countdown:last-child { border-bottom: none; }
.sw-cd-days {
  min-width: 44px;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  border-radius: 8px;
  padding: 0.375rem 0.25rem;
  line-height: 1;
}
.sw-cd-days small {
  display: block;
  font-size: 0.5625rem;
  font-weight: 500;
  opacity: 0.7;
  margin-top: 2px;
}
.sw-cd-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar widgets: force light text on dark sidebar in light theme */
[data-theme="light"] #sidebar-widgets .sidebar-section-title,
[data-theme="light"] #sidebar-widgets .sw-item-title,
[data-theme="light"] #sidebar-widgets .sw-goal-title,
[data-theme="light"] #sidebar-widgets .sw-cd-title {
  color: #fff;
}
[data-theme="light"] #sidebar-widgets .sw-item-sub,
[data-theme="light"] #sidebar-widgets .sw-month,
[data-theme="light"] #sidebar-widgets .text-muted {
  color: rgba(255,255,255,0.6);
}
[data-theme="light"] #sidebar-widgets .sw-day {
  color: #a5b4fc;
}
[data-theme="light"] #sidebar-widgets .sw-date-badge,
[data-theme="light"] #sidebar-widgets .sw-progress-bar {
  background: rgba(255,255,255,0.1);
}
[data-theme="light"] #sidebar-widgets .sw-goal,
[data-theme="light"] #sidebar-widgets .sw-item,
[data-theme="light"] #sidebar-widgets .sw-countdown {
  border-color: rgba(255,255,255,0.1);
}

/* PDF PAGE MANAGER */
.pdf-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.25rem;
}
.pdf-page-thumb {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  aspect-ratio: 0.707;
  background: #fff;
}
.pdf-page-thumb.deselected {
  border-color: var(--border);
  opacity: 0.4;
  filter: grayscale(1);
}
.pdf-page-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.pdf-page-num {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.625rem;
  text-align: center;
  padding: 2px 0;
  font-weight: 600;
}
.pdf-page-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.pdf-page-thumb.deselected .pdf-page-check {
  background: var(--text-muted);
}

/* WHITEBOARD COLOR BUTTONS */
.wb-color-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s;
}
.wb-color-btn.active {
  border-color: var(--primary);
  transform: scale(1.2);
}
.wb-color-btn:hover { transform: scale(1.15); }
}

/* SIDEBAR WIDGETS MOBILE */
.swm-section {
  padding: 0.5rem 0.75rem;
}
.swm-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0.5rem 0 0.25rem;
}
.swm-label:first-child { margin-top: 0; }
.swm-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  cursor: pointer;
}
.swm-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--primary);
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.swm-badge-accent {
  background: rgba(99,102,241,0.15);
  color: var(--primary-light);
}
.swm-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
