/* Genius Lab - shared visual system */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #40108f;
  --primary-dark: #2c086a;
  --primary-soft: #f1ebfb;
  --accent: #04bec5;
  --accent-dark: #009da7;
  --accent-soft: #e7fbfb;
  --success: #16845b;
  --danger: #c33d55;
  --warning: #b46a13;
  --text: #19172a;
  --text-muted: #696579;
  --border: #e7e3ed;
  --bg: #f7f6f9;
  --card-bg: #ffffff;
  --radius: 12px;
  --shadow-sm: 0 8px 24px rgba(38, 16, 72, .06);
}

html { min-height: 100%; }
body {
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-page {
  display: flex;
  flex-direction: column;
}

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

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.navbar-inner {
  display: flex;
  align-items: center;
  width: min(1240px, 100%);
  min-height: 78px;
  margin: 0 auto;
  padding: 0 30px;
  gap: 28px;
}
.navbar-brand { display: flex; align-items: center; flex: 0 0 auto; text-decoration: none; }
.navbar-logo { display: block; width: 172px; height: auto; }
.nav-links { display: flex; align-self: stretch; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .18s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform .18s ease;
}
.nav-link:hover, .nav-link.active { color: var(--primary); text-decoration: none; }
.nav-link.active::after { transform: scaleX(1); }
.nav-user { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.nav-user-name { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.btn-logout {
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  background: #fff;
}
.btn-logout:hover { border-color: var(--accent); color: var(--primary); text-decoration: none; }

.main-content {
  flex: 1 0 auto;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 48px 30px 80px;
}
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-header h1 { font-size: clamp(28px, 3vw, 36px); line-height: 1.15; letter-spacing: -.03em; }
.eyebrow { margin-bottom: 8px; color: var(--accent-dark); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.card {
  margin-bottom: 18px;
  padding: 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stats-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 22px 18px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.stat-card .stat-number { font-size: 30px; line-height: 1; font-weight: 750; color: var(--primary); letter-spacing: -.04em; }
.stat-card .stat-label { margin-top: 9px; font-size: 11px; font-weight: 650; color: var(--text-muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; background: var(--card-bg); }
th {
  padding: 14px 16px;
  background: #faf9fb;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
td { padding: 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fcfbfd; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; color: #373246; font-size: 12px; font-weight: 700; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d8d3e1;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color .18s, box-shadow .18s;
}
.form-group input::placeholder { color: #a19baa; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(4, 190, 197, .12); }
.form-group textarea { min-height: 90px; resize: vertical; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s, border-color .18s, background .18s;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: linear-gradient(115deg, var(--primary), #6230b3); color: #fff; box-shadow: 0 8px 18px rgba(64, 16, 143, .18); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 24px rgba(64, 16, 143, .24); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { color: var(--primary); border-color: #cfc2e7; background: var(--primary-soft); }
.btn-sm { min-height: 34px; padding: 7px 12px; font-size: 12px; }
.button-mark { font-size: 18px; font-weight: 400; line-height: 0; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 750; }
.badge-active { background: #e2f5ed; color: #0d6543; }
.badge-inactive { background: #fbe8eb; color: #912b40; }
.badge-draft { background: #eeecf0; color: #5a5662; }
.badge-published { background: var(--accent-soft); color: #08717a; }
.badge-student { background: var(--primary-soft); color: var(--primary); }
.badge-teacher { background: #e7f8f8; color: #08717a; }
.badge-admin, .badge-super_admin { background: #eee7f8; color: #54208e; }
.progress-bar-wrap { min-width: 80px; height: 7px; overflow: hidden; border-radius: 20px; background: #ebe8ef; }
.progress-bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .4s; }
.site-footer {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.62);
  color: var(--text-muted);
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, 100%);
  min-height: 74px;
  margin: 0 auto;
  padding: 18px 30px;
  font-size: 12px;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }
.d-flex { display: flex; } .gap-2 { gap: 8px; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }

/* Login */
.login-page { overflow-x: hidden; background: #fff; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr); min-height: 100vh; }
.login-showcase {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(48px, 8vw, 112px);
  color: var(--text);
  background:
    radial-gradient(circle at 78% 18%, rgba(4, 190, 197, .18), transparent 27%),
    radial-gradient(circle at 13% 88%, rgba(64, 16, 143, .11), transparent 30%),
    linear-gradient(145deg, #fbfbfd 0%, #f4f0fa 54%, #edfafa 100%);
}
.login-showcase::after {
  content: "";
  position: absolute;
  inset: auto -10% -28% 15%;
  height: 62%;
  border-radius: 50%;
  border: 1px solid rgba(64, 16, 143, .09);
  transform: rotate(-12deg);
}
.showcase-content { position: relative; z-index: 2; width: min(570px, 100%); }
.login-logo { display: block; height: auto; }
.animated-logo {
  position: relative;
  width: min(300px, 66%);
  margin-bottom: clamp(54px, 9vh, 90px);
}
.login-logo-light {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: 0;
  filter: none;
}
.logo-bubbles {
  position: absolute;
  z-index: 3;
  left: 14.8%;
  top: 16%;
  width: 8%;
  height: 10%;
  pointer-events: none;
}
.logo-bubble {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 11px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(145deg, #57e2e5, var(--accent-dark));
  box-shadow: 0 0 14px rgba(4, 190, 197, .42);
  opacity: 0;
  animation: logo-bubble-rise 3.8s ease-in infinite;
}
.bubble-one { width: 8px; animation-delay: 0s; --bubble-x: -6px; --bubble-drift: 4px; }
.bubble-two { width: 12px; animation-delay: .75s; --bubble-x: 5px; --bubble-drift: -7px; }
.bubble-three { width: 7px; animation-delay: 1.45s; --bubble-x: -2px; --bubble-drift: 8px; }
.bubble-four { width: 10px; animation-delay: 2.15s; --bubble-x: 7px; --bubble-drift: -3px; }
.bubble-five { width: 6px; animation-delay: 2.8s; --bubble-x: -7px; --bubble-drift: 5px; }
@keyframes logo-bubble-rise {
  0% {
    opacity: 0;
    transform: translate3d(var(--bubble-x), 8px, 0) scale(.45);
  }
  16% { opacity: .95; }
  72% { opacity: .8; }
  100% {
    opacity: 0;
    transform: translate3d(var(--bubble-drift), -72px, 0) scale(1.18);
  }
}
.showcase-kicker { margin-bottom: 18px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.showcase-content h1 { max-width: 560px; margin-bottom: 22px; font-size: clamp(38px, 4.5vw, 68px); line-height: 1.02; letter-spacing: -.045em; }
.showcase-copy { max-width: 510px; color: var(--text-muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.7; }
.showcase-line { display: flex; align-items: center; gap: 16px; margin-top: 42px; color: var(--primary); font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.showcase-line span { width: 54px; height: 1px; background: var(--accent); }
.motion-field { position: absolute; inset: 0; pointer-events: none; }
.orbit { position: absolute; border: 1px solid rgba(64, 16, 143, .11); border-radius: 50%; animation: orbit-drift 12s ease-in-out infinite alternate; }
.orbit-one { width: 290px; height: 290px; right: -70px; top: 16%; }
.orbit-two { width: 160px; height: 160px; right: 18%; bottom: 8%; animation-delay: -4s; }
.orbit-three { width: 70px; height: 70px; left: 9%; top: 12%; animation-delay: -7s; }
.particle { position: absolute; display: block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 34px rgba(4, 190, 197, .48); animation: float-particle 7s ease-in-out infinite; }
.particle-one { width: 13px; height: 13px; right: 17%; top: 26%; }
.particle-two { width: 7px; height: 7px; right: 8%; bottom: 28%; animation-delay: -2.4s; }
.particle-three { width: 10px; height: 10px; left: 18%; bottom: 12%; animation-delay: -4.6s; }
@keyframes float-particle {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: .55; }
  50% { transform: translate3d(16px, -28px, 0); opacity: 1; }
}
@keyframes orbit-drift {
  from { transform: translate3d(0, 0, 0) rotate(0); }
  to { transform: translate3d(-22px, 18px, 0) rotate(8deg); }
}
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px clamp(32px, 7vw, 96px); background: linear-gradient(145deg, #fff 35%, #faf8fc); }
.login-card { width: min(420px, 100%); }
.animated-logo-mobile { display: none; width: 210px; margin-bottom: 48px; }
.login-logo-mobile { width: 100%; margin: 0; }
.login-card h2 { margin-bottom: 10px; font-size: clamp(28px, 3vw, 38px); line-height: 1.15; letter-spacing: -.035em; }
.login-intro { margin-bottom: 34px; color: var(--text-muted); font-size: 14px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; }
.label-row a { font-size: 11px; font-weight: 700; }
.login-card .form-group input { padding: 13px 14px; }
.btn-login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(115deg, var(--primary), #5c26aa);
  box-shadow: 0 12px 28px rgba(64, 16, 143, .22);
  color: #fff;
  font: inherit;
  font-weight: 750;
  transition: transform .18s, box-shadow .18s;
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 15px 32px rgba(64, 16, 143, .28); }
.btn-login span { font-size: 19px; font-weight: 400; }
.login-support { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 11px; text-align: center; }
.error-msg { margin-bottom: 20px; padding: 11px 13px; border: 1px solid #efb4bf; border-radius: 8px; background: #fff4f5; color: #8d2438; font-size: 12px; }

@media (max-width: 1000px) {
  .navbar-inner { padding: 0 22px; gap: 14px; }
  .nav-link { padding: 0 8px; font-size: 12px; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .login-shell { grid-template-columns: 1fr 460px; }
  .login-showcase { padding: 56px; }
}
@media (max-width: 780px) {
  .navbar-inner { flex-wrap: wrap; height: auto; padding: 14px 18px 0; }
  .navbar-logo { width: 134px; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; }
  .nav-link { min-height: 42px; white-space: nowrap; }
  .nav-user { margin-left: auto; }
  .nav-user-name { display: none; }
  .main-content { padding: 32px 18px 56px; }
  .site-footer-inner { padding: 18px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .login-shell { display: block; }
  .login-showcase { display: none; }
  .login-panel { min-height: 100vh; padding: 40px 24px; }
  .animated-logo-mobile { display: block; }
}
@media (max-width: 520px) {
  .page-header { align-items: flex-start; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 18px 14px; }
  .form-row { display: block; }
  .site-footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 3px; }
  .filter-input, .filter-select, .filter-bar .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Flash messages */
.flash-success { margin-bottom: 20px; padding: 11px 13px; border: 1px solid #a8dfc5; border-radius: 8px; background: #edfaf3; color: #0d6543; font-size: 12px; }
.flash-error { margin-bottom: 20px; padding: 11px 13px; border: 1px solid #efb4bf; border-radius: 8px; background: #fff4f5; color: #8d2438; font-size: 12px; }
.flash-info { margin-bottom: 20px; padding: 11px 13px; border: 1px solid #b8d8f8; border-radius: 8px; background: #edf5ff; color: #1a4f8a; font-size: 12px; }

/* Form helpers */
.required { color: var(--danger); }
.field-hint { display: block; margin-top: 5px; font-size: 11px; color: var(--text-muted); }

/* Filter bar */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12px; color: var(--text); background: #fff; outline: none; transition: border-color .18s, box-shadow .18s; min-width: 200px; }
.filter-input:focus { border-color: var(--accent-dark); box-shadow: 0 0 0 3px rgba(4,190,197,.12); }
.filter-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12px; color: var(--text); background: #fff; outline: none; cursor: pointer; transition: border-color .18s; }
.filter-select:focus { border-color: var(--accent-dark); }

/* ============================================================
   CONTROL DESIGN CONTRACT
   Every visible form control must inherit this system. New
   inputs and pickers should never rely on browser default chrome.
   ============================================================ */
button,
input,
select,
textarea {
  font: inherit;
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
select,
textarea {
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #d8d3e1;
  border-radius: 9px;
  outline: none;
  background-color: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(38, 16, 72, .025);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):hover,
select:hover,
textarea:hover {
  border-color: #beb5ca;
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus,
select:focus,
textarea:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(4, 190, 197, .13);
}

input::placeholder,
textarea::placeholder {
  color: #9b94a6;
  opacity: 1;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--primary) 50%),
    linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

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

textarea {
  min-height: 110px;
  line-height: 1.55;
  resize: vertical;
}

input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
  filter: sepia(1) saturate(5) hue-rotate(225deg);
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  color-scheme: light;
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  padding: 5px;
  border-radius: 5px;
  cursor: pointer;
  opacity: .7;
  filter: sepia(1) saturate(5) hue-rotate(225deg);
}

input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 18px;
  border: 1.5px solid #c5bdcf;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s, background-color .16s, box-shadow .16s;
}

input[type="checkbox"] { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }

input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform .13s ease;
}

input[type="radio"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform .13s ease;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  border-color: var(--primary);
  background: linear-gradient(145deg, var(--primary), #6530b3);
}

input[type="checkbox"]:checked::before,
input[type="radio"]:checked::before {
  transform: rotate(-45deg) scale(1);
}

input[type="radio"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible,
input[type="range"]:focus-visible,
input[type="color"]:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(4, 190, 197, .24);
  outline-offset: 2px;
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 10px;
  background: #ddd6e8;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(64, 16, 143, .28);
}

input[type="color"] {
  width: 46px;
  height: 42px;
  padding: 4px;
  border: 1px solid #d8d3e1;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin: -6px 12px -6px -9px;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .62;
  background-color: #f1eff4;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(195, 61, 85, .1);
}

.filter-input,
.filter-select {
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 14px;
}

.filter-input { min-width: 280px; }

.form-group select,
.filter-select {
  padding-right: 40px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(22, 14, 42, .55);
  backdrop-filter: blur(4px);
}
.modal-box {
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 28px 72px rgba(22,14,42,.22);
  padding: 28px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-header h2 { font-size: 17px; font-weight: 750; }
.modal-close { width: 30px; height: 30px; border: none; border-radius: 6px; background: var(--bg); color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

/* Branded confirmation dialog replaces browser confirm boxes. */
.confirm-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 1px solid rgba(64, 16, 143, .12);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(22, 14, 42, .25);
}
.confirm-dialog::backdrop {
  background: rgba(22, 14, 42, .56);
  backdrop-filter: blur(4px);
}
.confirm-dialog form { padding: 28px; }
.confirm-dialog-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--primary-soft), var(--accent-soft));
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
}
.confirm-dialog h2 { margin-bottom: 8px; font-size: 18px; }
.confirm-dialog p { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }

/* Misc helpers */
.gap-3 { gap: 12px; } .gap-4 { gap: 18px; }
.w-100 { width: 100%; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--text-muted); }
.empty-state p { margin-bottom: 16px; }
