/* ═══════════════════════════════════════════════════════════════
   Webtymize Academy Portal — Premium Design System
   Brand Colors: Navy #2B2D6E + Orange #E8692A
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Ink / Text */
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #64748b;
  --soft: #94a3b8;
  --faint: #cbd5e1;

  /* Surfaces */
  --panel: #ffffff;
  --surface: #f8fafc;
  --surface-strong: #f1f5f9;
  --surface-dim: #e2e8f0;
  --line: #e2e8f0;
  --line-soft: rgba(226, 232, 240, 0.6);

  /* Primary – Navy Blue (Brand) */
  --primary: #2B2D6E;
  --primary-light: #3a3d8a;
  --primary-dark: #1e2056;
  --primary-soft: #e8e8f4;
  --primary-softer: #f3f3fa;
  --primary-glow: rgba(43, 45, 110, 0.12);

  /* Accent – Orange (Brand) */
  --accent: #E8692A;
  --accent-strong: #d45a1f;
  --accent-dark: #b84a17;
  --accent-light: #f0854e;
  --accent-soft: #fef0e8;
  --accent-softer: #fff8f3;
  --accent-glow: rgba(232, 105, 42, 0.15);
  --accent-glow-strong: rgba(232, 105, 42, 0.25);

  /* Status */
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-glow: rgba(220, 38, 38, 0.12);
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --success: #16a34a;
  --success-soft: #f0fdf4;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.18);
  --shadow-primary: 0 4px 14px rgba(43, 45, 110, 0.25);
  --shadow-accent: 0 4px 14px rgba(232, 105, 42, 0.3);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }

h1 {
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.3;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

a:hover {
  color: var(--accent);
}

/* ── Ambient Background ──────────────────────────────────────── */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 340px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(43, 45, 110, 0.06), transparent),
    radial-gradient(ellipse 60% 50% at 80% 10%, rgba(232, 105, 42, 0.04), transparent),
    linear-gradient(180deg, var(--surface), transparent);
  pointer-events: none;
  z-index: -1;
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes checkPop {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

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

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

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes progressPulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow-strong); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.animate-in {
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.animate-in-delay-1 { animation-delay: 0.06s; }
.animate-in-delay-2 { animation-delay: 0.12s; }
.animate-in-delay-3 { animation-delay: 0.18s; }
.animate-in-delay-4 { animation-delay: 0.24s; }
.animate-in-delay-5 { animation-delay: 0.30s; }

/* ── Brand ───────────────────────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  object-fit: contain;
  transition: transform var(--duration-normal) var(--ease-spring);
}

.brand:hover .brand-logo {
  transform: scale(1.06) rotate(-2deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text .brand-main {
  font-weight: 800;
  font-size: 14px;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.brand-text .brand-sub {
  font-weight: 700;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Header (Glassmorphism) ──────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(20px, 4vw, 52px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  animation: slideInDown 0.4s var(--ease-out);
}

.topline {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topline h1 {
  font-size: 20px;
  font-weight: 700;
  padding-left: 20px;
  border-left: 2px solid var(--line);
  color: var(--ink-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Avatar ──────────────────────────────────────────────────── */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.avatar.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.avatar.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 17px;
}

.avatar svg,
.welcome-avatar svg {
  width: 62%;
  height: 62%;
}

/* ── Layout ──────────────────────────────────────────────────── */
main {
  width: min(1200px, calc(100vw - 40px));
  margin: 32px auto 60px;
}

.page-shell {
  display: grid;
  gap: 24px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* ── Stat Cards ──────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
  overflow: hidden;
}

/* Üstte ince renk şeridi */
.stat::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--duration-normal) ease;
}

.stat:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-glow);
  transform: translateY(-3px);
}

.stat:hover::after {
  opacity: 1;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

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

.stat-icon.navy {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.orange {
  background: var(--accent-soft);
  color: var(--accent);
}

.stat-icon.purple {
  background: #f3e8ff;
  color: #9333ea;
}

.stat-body {
  display: grid;
  gap: 2px;
}

.stat-body span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.stat-body strong {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ── Cards / Sections ────────────────────────────────────────── */
.card,
.section,
.table-wrap,
.upload-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-normal) ease, border-color var(--duration-normal) ease;
}

.card:hover,
.section:hover {
  box-shadow: var(--shadow-md);
}

.section {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.section-head {
  display: grid;
  gap: 5px;
}

.section-head p {
  font-size: 13.5px;
}

/* ── Forms ────────────────────────────────────────────────────── */
form {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
}

input::placeholder,
select::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:hover,
select:hover {
  border-color: var(--soft);
}

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

/* Password wrapper */
.input-group {
  position: relative;
}

.input-group input {
  padding-right: 44px;
}

.input-group .toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0;
  min-height: unset;
}

.input-group .toggle-password:hover {
  color: var(--muted);
  background: var(--surface);
}

.input-group .toggle-password svg {
  width: 18px;
  height: 18px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  position: relative;
  overflow: hidden;
}

button:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  box-shadow: var(--shadow-primary);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0px);
  box-shadow: none;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Orange CTA variant */
button.cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

button.cta:hover {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent-dark));
  box-shadow: var(--shadow-accent);
}

button.secondary {
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--ink-secondary);
  box-shadow: var(--shadow-xs);
}

button.secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-softer);
  box-shadow: var(--shadow-sm);
}

button.danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
}

button.danger:hover {
  box-shadow: 0 4px 14px var(--danger-glow);
}

button.ghost {
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 0 12px;
}

button.ghost:hover {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: none;
}

button.small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

button.icon-btn {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* Spinner inside button */
button .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.badge.active {
  background: var(--success-soft);
  color: var(--success);
}

.badge.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease infinite;
}

.badge.passive {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.passive::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  opacity: 0.5;
}

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap {
  overflow: hidden;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: middle;
}

th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  border-bottom: 1px solid var(--line-soft);
}

tbody tr {
  transition: background var(--duration-fast) ease;
}

tbody tr:hover {
  background: var(--surface);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.student-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-name {
  display: grid;
  gap: 2px;
}

.student-name strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

.student-name span {
  color: var(--soft);
  font-size: 12.5px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--faint);
}

/* ── Login Page ──────────────────────────────────────────────── */
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 6vw, 80px);
  background:
    radial-gradient(circle at 18% 22%, rgba(232, 105, 42, 0.18), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(58, 61, 138, 0.55), transparent 50%),
    linear-gradient(155deg, #15163f 0%, #23255f 38%, #34367e 68%, #b8501f 165%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

/* Dekoratif nokta-grid dokusu */
.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(135deg, #000 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(135deg, #000 0%, transparent 70%);
  pointer-events: none;
}

.login-brand::after {
  content: '';
  position: absolute;
  top: -25%;
  right: -18%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 105, 42, 0.22), transparent 68%);
  pointer-events: none;
  animation: floatGlow 12s ease-in-out infinite;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-24px, 26px) scale(1.08); }
}

.login-brand .brand {
  color: #fff;
  margin-bottom: 40px;
}

.login-brand .brand-text .brand-main {
  color: #fff;
}

.login-brand .brand-text .brand-sub {
  color: rgba(255, 255, 255, 0.7);
}

.login-brand .brand-logo-login {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.login-brand h1 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  position: relative;
}

.login-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.7;
  max-width: 420px;
  position: relative;
}

.login-features {
  display: grid;
  gap: 14px;
  margin-top: 40px;
  position: relative;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--duration-normal) ease, transform var(--duration-normal) var(--ease-spring), border-color var(--duration-normal) ease;
}

.login-feature:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(232, 105, 42, 0.4);
  transform: translateX(5px);
}

.login-feature-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(232, 105, 42, 0.2);
  flex-shrink: 0;
}

.login-feature-icon svg {
  width: 18px;
  height: 18px;
  color: #fbbf8e;
}

.login-feature span {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.login-form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  background: var(--panel);
}

.login-panel {
  width: min(420px, 100%);
  animation: fadeInUp 0.6s var(--ease-out);
}

.login-panel .brand {
  margin-bottom: 32px;
  display: none;
}

.login-panel h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.login-panel > p {
  margin-bottom: 28px;
  font-size: 15px;
}

.login-panel button[type="submit"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.login-panel button[type="submit"]:hover {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent-dark));
  box-shadow: var(--shadow-accent);
}

.login-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--soft);
  font-size: 12.5px;
}

/* ── Toast Notification ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  display: grid;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 440px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: toastIn 0.35s var(--ease-out);
}

.toast.leaving {
  animation: toastOut 0.25s ease forwards;
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-icon svg {
  width: 16px;
  height: 16px;
}

.toast.success .toast-icon {
  background: var(--success-soft);
  color: var(--success);
}

.toast.error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast.info .toast-icon {
  background: var(--primary-soft);
  color: var(--primary);
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 650;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
}

.toast-close {
  width: 28px;
  min-height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--soft);
  cursor: pointer;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  transform: none;
}

.toast-close svg {
  width: 14px;
  height: 14px;
}

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  animation: overlayIn 0.2s ease;
  overflow-y: auto;
}

.modal-overlay.closing {
  animation: overlayIn 0.15s ease reverse forwards;
}

.modal {
  width: min(520px, 100%);
  background: var(--panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  animation: scaleIn 0.3s var(--ease-out);
  overflow: hidden;
}

.modal-overlay.closing .modal {
  animation: scaleIn 0.15s ease reverse forwards;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: 18px;
  color: var(--primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

/* ── Confirm Dialog ──────────────────────────────────────────── */
.confirm-body {
  text-align: center;
  padding: 8px 0;
}

.confirm-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.confirm-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-icon svg {
  width: 28px;
  height: 28px;
}

.confirm-body h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.confirm-body p {
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto;
}

/* ── Password Reveal Box ─────────────────────────────────────── */
.password-reveal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-softer);
  border: 1px dashed var(--accent);
  margin-top: 4px;
}

.password-reveal code {
  flex: 1;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0.03em;
}

.password-reveal .copy-btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ── File List (Student Panel) ───────────────────────────────── */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
  color: inherit;
}

.file-card:hover {
  border-color: var(--primary-glow);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.file-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.file-icon.pdf {
  background: #fef2f2;
  color: #dc2626;
}

.file-icon.video {
  background: #f3e8ff;
  color: #9333ea;
}

.file-icon.image {
  background: #dbeafe;
  color: #2563eb;
}

.file-icon.zip {
  background: #fef9c3;
  color: #ca8a04;
}

.file-icon.doc {
  background: #dbeafe;
  color: #2563eb;
}

.file-icon.default {
  background: var(--surface-strong);
  color: var(--muted);
}

.file-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.file-info strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info span {
  font-size: 12px;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.file-action {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  text-decoration: none;
}

/* ── Upload Area ─────────────────────────────────────────────── */
.upload-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  padding: 32px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--duration-normal) ease;
  text-align: center;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-softer);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-softer);
  box-shadow: inset 0 0 0 3px var(--accent-glow);
  transform: scale(1.01);
}

.drop-zone.has-file {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-softer);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  min-height: unset;
  border: none;
  padding: 0;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  transition: all var(--duration-normal) ease;
}

.drop-zone:hover .drop-icon {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

.drop-icon svg {
  width: 24px;
  height: 24px;
}

.drop-text strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 4px;
}

.drop-text span {
  color: var(--soft);
  font-size: 13px;
}

.selected-file {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 600;
}

.selected-file svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Progress Bar */
.progress-wrap {
  display: none;
}

.progress-wrap.visible {
  display: grid;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--surface-strong);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.3s ease;
  animation: progressPulse 1.5s ease infinite;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Upload success */
.upload-success {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
  font-size: 14px;
  animation: fadeInUp 0.4s var(--ease-out);
}

.upload-success svg {
  width: 22px;
  height: 22px;
  animation: checkPop 0.4s var(--ease-spring);
  flex-shrink: 0;
}

/* ── Notice (legacy fallback) ────────────────────────────────── */
.notice {
  display: none;
  min-height: 24px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--primary-softer);
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
}

.notice:not(:empty) {
  display: block;
}

.notice.error {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ── Welcome Banner ──────────────────────────────────────────── */
.welcome-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 32px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #1a1c4e 0%, #2B2D6E 50%, #3a3d8a 80%, #E8692A 160%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: linear-gradient(120deg, #000 0%, transparent 65%);
  -webkit-mask-image: linear-gradient(120deg, #000 0%, transparent 65%);
  pointer-events: none;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  top: -60%;
  right: -5%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 105, 42, 0.2), transparent 70%);
  pointer-events: none;
}

.welcome-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.25);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
}

.welcome-info {
  flex: 1;
  position: relative;
}

.welcome-info h1 {
  font-size: clamp(20px, 2.5vw, 28px);
  margin-bottom: 5px;
  color: #fff;
}

.welcome-info p {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}

.welcome-badge svg {
  color: #86efac;
}

/* ── Student Panel Layout ─────────────────────────────────────── */
.student-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.student-sidebar {
  display: grid;
  gap: 20px;
}

.materials-section {
  min-height: 260px;
}

/* ── Drive Info Note ─────────────────────────────────────────── */
.drive-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: var(--primary-softer);
  border: 1px solid var(--primary-soft);
  color: var(--primary);
  font-size: 12.5px;
  line-height: 1.5;
}

.drive-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 40px 32px;
    min-height: auto;
  }

  .login-brand h1 {
    font-size: 28px;
  }

  .login-features {
    display: none;
  }

  .login-panel .brand {
    display: inline-flex;
  }
}

@media (max-width: 860px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .topline {
    flex-direction: column;
    gap: 8px;
  }

  .topline h1 {
    border-left: none;
    padding-left: 0;
  }

  .stats,
  .grid,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

  .span-2 {
    grid-column: auto;
  }

  .table-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .welcome-banner {
    flex-wrap: wrap;
    gap: 14px;
  }

  .welcome-badge {
    order: 3;
  }

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

@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  main {
    margin: 20px auto 40px;
    width: calc(100vw - 24px);
  }

  .section {
    padding: 18px;
  }

  .stat {
    padding: 16px;
  }

  .stat-body strong {
    font-size: 26px;
  }

  .modal {
    border-radius: var(--radius-lg);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 18px;
    padding-right: 18px;
  }
}
