/* =====================================================================
   NOORANIYAH — CORE DESIGN SYSTEM
   Obsidian canvas · luminous mint & violet · editorial display type
   Author: Nooraniyah Design System v1.0
   ===================================================================== */

@import url('../fonts/fonts.css');

/* ---------------------------------------------------------------- TOKENS */
:root {
  /* Ink scale */
  --ink-950: #04050a;
  --ink-900: #070810;
  --ink-850: #0a0c15;
  --ink-800: #0e111c;
  --ink-750: #131725;
  --ink-700: #1a1f30;
  --ink-600: #252b3f;

  /* Text */
  --text-100: #f4f7fb;
  --text-200: #d9e0ec;
  --text-300: #aeb8cc;
  --text-400: #8b95ab;
  --text-500: #6b7488;
  --text-600: #4b5364;

  /* Accents */
  --mint-400: #3ef0b6;
  --mint-500: #12e2a3;
  --mint-600: #06b884;
  --violet-400: #9b82ff;
  --violet-500: #7c5cff;
  --violet-600: #5f3ff0;
  --gold-400: #ffd479;
  --gold-500: #f5c469;
  --sky-500: #38bdf8;
  --rose-500: #fb7185;

  --accent: var(--mint-500);
  --accent-soft: rgba(18, 226, 163, 0.14);
  --accent-line: rgba(18, 226, 163, 0.32);
  --on-accent: #05060c;

  /* Surfaces */
  --surface-1: rgb(var(--tint-rgb) / 0.028);
  --surface-2: rgb(var(--tint-rgb) / 0.05);
  --surface-3: rgb(var(--tint-rgb) / 0.075);
  --hairline: rgb(var(--tint-rgb) / 0.08);
  --hairline-strong: rgb(var(--tint-rgb) / 0.14);
  --overlay: rgba(4, 5, 10, 0.78);

  /* Type */
  --font-display: 'Sora', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Amiri', 'Noto Naskh Arabic', serif;
  --font-glyphs: 'Amiri Glyphs', 'Amiri', 'Noto Naskh Arabic', 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', monospace;

  /* Radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-2xl: 44px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 18px 45px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
  --glow-mint: 0 0 0 1px rgba(18, 226, 163, 0.28), 0 18px 60px -22px rgba(18, 226, 163, 0.55);
  --glow-violet: 0 0 0 1px rgba(124, 92, 255, 0.3), 0 18px 60px -22px rgba(124, 92, 255, 0.5);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 620ms;

  /* Layout */
  --container: 1240px;
  --container-wide: 1440px;
  --gutter: clamp(18px, 4vw, 48px);
  --header-h: 78px;

  /* Theme-aware layer — every "white tint" surface reads from --tint-rgb so a
     single switch flips the whole UI between the obsidian and paper themes. */
  --tint-rgb: 255 255 255;
  --page-gradient: linear-gradient(180deg, #05060c 0%, #06070f 46%, #04050a 100%);
  --header-bg: rgba(5, 6, 12, 0.82);
  --header-bg-solid: rgba(5, 6, 12, 0.96);
  --overlay-strong: rgba(4, 5, 10, 0.92);
  --card-deep-1: #11152a;
  --card-deep-2: #080a13;
  --aside-deep-1: #0d1020;
  --aside-deep-2: #080a12;
  --sheen: rgb(var(--tint-rgb) / 0.06);
  --field-bg: rgb(var(--tint-rgb) / 0.04);

  color-scheme: dark;
}

/* ------------------------------------------------------------ LIGHT THEME */
[data-theme="light"] {
  --ink-950: #f7f8fc;
  --ink-900: #ffffff;
  --ink-850: #f3f5fa;
  --ink-800: #eef1f8;
  --ink-750: #e7ebf3;
  --ink-700: #dde2ed;
  --ink-600: #cbd2e0;

  --text-100: #0b1220;
  --text-200: #1d2637;
  --text-300: #364152;
  --text-400: #4f5b74;
  --text-500: #5a6680;
  --text-600: #6b7891;

  --mint-400: #04795a;
  --mint-500: #066349;
  --mint-600: #064e39;
  --violet-400: #5b3ce0;
  --violet-500: #4a2fc4;
  --violet-600: #38209e;
  --gold-400: #8a5c00;
  --gold-500: #7a5200;
  --sky-500: #0a6ba3;
  --rose-500: #b62b46;

  --accent: #04795a;
  --accent-soft: rgba(4, 121, 90, 0.12);
  --accent-line: rgba(4, 121, 90, 0.3);

  --on-accent: #ffffff;

  --tint-rgb: 15 23 42;
  --surface-1: rgb(var(--tint-rgb) / 0.03);
  --surface-2: rgb(var(--tint-rgb) / 0.045);
  --surface-3: rgb(var(--tint-rgb) / 0.07);
  --hairline: rgb(var(--tint-rgb) / 0.1);
  --hairline-strong: rgb(var(--tint-rgb) / 0.17);
  --overlay: rgba(15, 23, 42, 0.45);

  --page-gradient: linear-gradient(180deg, #fbfcff 0%, #f5f7fd 46%, #eef2fa 100%);
  --header-bg: rgba(255, 255, 255, 0.86);
  --header-bg-solid: rgba(255, 255, 255, 0.97);
  --overlay-strong: rgba(248, 250, 255, 0.94);
  --card-deep-1: #ffffff;
  --card-deep-2: #f2f5fb;
  --aside-deep-1: #eef2fb;
  --aside-deep-2: #e6ecf7;
  --field-bg: rgba(255, 255, 255, 0.9);

  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 16px 40px -20px rgba(15, 23, 42, 0.22);
  --shadow-lg: 0 36px 80px -40px rgba(15, 23, 42, 0.3);
  --glow-mint: 0 0 0 1px rgba(6, 156, 109, 0.22), 0 16px 50px -24px rgba(6, 156, 109, 0.4);
  --glow-violet: 0 0 0 1px rgba(91, 60, 224, 0.2), 0 16px 50px -24px rgba(91, 60, 224, 0.35);

  color-scheme: light;
}

/* ---------------------------------------------------------------- RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

html.is-locked,
body.is-locked {
  overflow: hidden;
}

body {
  min-height: 100vh;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
  background: var(--ink-950);
  color: var(--text-200);
  font-family: var(--font-body), var(--font-glyphs);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--mint-400);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: rgba(18, 226, 163, 0.28);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--ink-900);
}
::-webkit-scrollbar-thumb {
  background: #232a3d;
  border-radius: 999px;
  border: 2px solid var(--ink-900);
}
::-webkit-scrollbar-thumb:hover {
  background: #313b55;
}

/* ---------------------------------------------------------- TYPOGRAPHY */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text-100);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 700;
}
h2 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
}
h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  letter-spacing: -0.02em;
}
h4 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
h5 {
  font-size: 0.98rem;
}

p {
  text-wrap: pretty;
}

.lead {
  font-size: clamp(1.02rem, 1.6vw, 1.19rem);
  line-height: 1.72;
  color: var(--text-300);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mint-400);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mint-400));
}

.eyebrow--violet {
  color: var(--violet-400);
}
.eyebrow--violet::before {
  background: linear-gradient(90deg, transparent, var(--violet-400));
}

.gradient-text {
  background: linear-gradient(105deg, #ffffff 8%, var(--mint-400) 45%, var(--violet-400) 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted {
  color: var(--text-400);
}
.tiny {
  font-size: 0.78rem;
}
.small {
  font-size: 0.875rem;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.arabic {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 1.9rem;
  line-height: 1.9;
  color: var(--gold-400);
}

/* ------------------------------------------------------------- LAYOUT */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  position: relative;
  padding-block: clamp(58px, 7.2vw, 112px);
}

.section__head {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin-bottom: clamp(34px, 5vw, 62px);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.stack {
  display: grid;
  gap: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  gap: 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 999;
  padding: 12px 20px;
  background: var(--mint-500);
  color: var(--on-accent);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top var(--dur) var(--ease-out);
}
.skip-link:focus {
  top: 16px;
}

/* ------------------------------------------------------------ SURFACES */
.glass {
  background: linear-gradient(160deg, rgb(var(--tint-rgb) / 0.055), rgb(var(--tint-rgb) / 0.018));
  border: 1px solid var(--hairline);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.card {
  position: relative;
  padding: clamp(20px, 2.4vw, 30px);
  background: linear-gradient(165deg, rgb(var(--tint-rgb) / 0.045), rgb(var(--tint-rgb) / 0.012));
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}

.card--hover:hover {
  transform: translateY(-4px);
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(18, 226, 163, 0.16);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text-100);
  letter-spacing: -0.01em;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-strong), transparent);
  border: 0;
}

/* ------------------------------------------------------------- BUTTONS */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text-100);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border: 1px solid var(--hairline);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--hairline-strong);
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform var(--dur) var(--ease-spring);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--primary {
  --btn-bg: linear-gradient(112deg, var(--mint-500), #35e8c0 55%, var(--mint-400));
  --btn-fg: #04140f;
  border-color: transparent;
  box-shadow: 0 14px 34px -16px rgba(18, 226, 163, 0.85);
}

.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(112deg, #54ffbe, #12e2a3 60%, #9b82ff);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}

.btn--primary:hover {
  box-shadow: 0 20px 46px -18px rgba(18, 226, 163, 0.95);
}

.btn--primary:hover::after {
  opacity: 1;
}

.btn--violet {
  --btn-bg: linear-gradient(112deg, var(--violet-500), #a08bff);
  --btn-fg: #f7f5ff;
  border-color: transparent;
  box-shadow: 0 14px 34px -16px rgba(124, 92, 255, 0.8);
}

.btn--ghost {
  --btn-bg: rgb(var(--tint-rgb) / 0.02);
  --btn-fg: var(--text-200);
}

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--text-100);
  border-color: var(--hairline-strong);
}

.btn--outline:hover {
  background: var(--surface-2);
}

.btn--sm {
  padding: 9px 16px;
  font-size: 0.82rem;
}
.btn--lg {
  padding: 17px 34px;
  font-size: 1rem;
}
.btn--block {
  width: 100%;
}
.btn--icon {
  padding: 11px;
  border-radius: 50%;
}
.btn--icon svg {
  width: 19px;
  height: 19px;
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Shine sweep used on premium CTAs */
.btn--shine::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 55%;
  left: -70%;
  background: linear-gradient(100deg, transparent, rgb(var(--tint-rgb) / 0.5), transparent);
  transform: skewX(-18deg);
  z-index: 1;
}

.btn--shine:hover::before {
  animation: shine 900ms var(--ease-out);
}

@keyframes shine {
  to {
    left: 130%;
  }
}

/* --------------------------------------------------------- BADGES/PILLS */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge--success {
  color: #4ef2b8;
  background: rgba(18, 226, 163, 0.12);
  border-color: rgba(18, 226, 163, 0.24);
}
.badge--warning {
  color: #ffd479;
  background: rgba(245, 196, 105, 0.12);
  border-color: rgba(245, 196, 105, 0.26);
}
.badge--danger {
  color: #ff9aab;
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.26);
}
.badge--info {
  color: #8fc6ff;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.26);
}
.badge--neutral {
  color: var(--text-300);
  background: rgb(var(--tint-rgb) / 0.06);
  border-color: var(--hairline);
}
.badge--violet {
  color: #c2b4ff;
  background: rgba(124, 92, 255, 0.14);
  border-color: rgba(124, 92, 255, 0.3);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  font-size: 0.8rem;
  color: var(--text-300);
}

/* ------------------------------------------------------------- AVATARS */
.avatar {
  --size: 40px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: calc(var(--size) * 0.36);
  font-weight: 600;
  color: var(--on-accent);
  letter-spacing: -0.02em;
  flex: none;
  box-shadow: inset 0 0 0 1px rgb(var(--tint-rgb) / 0.22);
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--sm {
  --size: 30px;
}
.avatar--lg {
  --size: 56px;
}
.avatar--xl {
  --size: 84px;
}

.avatar-stack {
  display: flex;
}
.avatar-stack .avatar {
  margin-left: -10px;
  border: 2px solid var(--ink-900);
}
.avatar-stack .avatar:first-child {
  margin-left: 0;
}

/* --------------------------------------------------------------- FORMS */
.field {
  display: grid;
  gap: 7px;
}

.label {
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-300);
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex-wrap: wrap;
}

.label .req {
  color: var(--mint-400);
}

.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  background: rgba(9, 11, 18, 0.72);
  border: 1px solid var(--hairline);
  color: var(--text-100);
  font-size: 0.92rem;
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out),
    background var(--dur) var(--ease-out);
}

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

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--hairline-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px rgba(18, 226, 163, 0.1);
  background: rgba(9, 11, 18, 0.95);
}

.textarea {
  min-height: 112px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b95ab' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea {
  border-color: rgba(251, 113, 133, 0.6);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.08);
}

.field__error {
  font-size: 0.76rem;
  color: #ff9aab;
}

.field__hint {
  font-size: 0.76rem;
  color: var(--text-500);
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  align-items: start;
}

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

@media (max-width: 620px) {
  .form-grid .span-2 {
    grid-column: span 1;
  }
}

/* Checkbox / radio pills */
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill {
  position: relative;
  display: inline-flex;
}

.check-pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.check-pill span {
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  font-size: 0.83rem;
  color: var(--text-300);
  transition: all var(--dur) var(--ease-out);
  cursor: pointer;
}

.check-pill input:checked + span {
  background: rgba(18, 226, 163, 0.14);
  border-color: var(--accent-line);
  color: #c6ffe9;
  box-shadow: 0 0 0 1px rgba(18, 226, 163, 0.2);
}

.check-pill input:focus-visible + span {
  outline: 2px solid var(--mint-400);
  outline-offset: 2px;
}

/* Toggle */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-300);
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch__track {
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: var(--ink-700);
  border: 1px solid var(--hairline);
  position: relative;
  transition: background var(--dur) var(--ease-out);
}

.switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--text-300);
  transition: transform var(--dur) var(--ease-spring), background var(--dur) var(--ease-out);
}

.switch input:checked + .switch__track {
  background: rgba(18, 226, 163, 0.32);
  border-color: var(--accent-line);
}

.switch input:checked + .switch__track::after {
  transform: translateX(19px);
  background: var(--mint-400);
}

/* --------------------------------------------------------------- TABLE */
.table-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: rgb(var(--tint-rgb) / 0.018);
}

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 640px;
}

table.data th {
  text-align: left;
  padding: 13px 18px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-500);
  background: rgb(var(--tint-rgb) / 0.025);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  z-index: 2;
}

table.data td {
  padding: 14px 18px;
  border-bottom: 1px solid rgb(var(--tint-rgb) / 0.05);
  color: var(--text-200);
  vertical-align: middle;
}

table.data tbody tr {
  transition: background var(--dur-fast) var(--ease-out);
}

table.data tbody tr:hover {
  background: rgb(var(--tint-rgb) / 0.032);
}

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

table.data .cell-user {
  display: flex;
  align-items: center;
  gap: 11px;
}

table.data .cell-user strong {
  display: block;
  font-weight: 600;
  color: var(--text-100);
  font-size: 0.885rem;
}

table.data .cell-user span {
  font-size: 0.76rem;
  color: var(--text-500);
}

.table-empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-500);
  display: grid;
  gap: 10px;
  justify-items: center;
}

/* ------------------------------------------------------------ PAGER */
.pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 22px 0 0;
  flex-wrap: wrap;
}

.pager__btn {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  color: var(--text-300);
  font-size: 0.84rem;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
}

.pager__btn:hover {
  border-color: var(--hairline-strong);
  color: var(--text-100);
  background: var(--surface-2);
}

.pager__btn.is-active {
  background: var(--mint-500);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 700;
}

.pager__btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ----------------------------------------------------------- MODAL/UI */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out), visibility var(--dur);
}

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

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal__panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 980px);
  overflow-y: auto;
  background: linear-gradient(170deg, var(--aside-deep-1), var(--aside-deep-2) 70%);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(18, 226, 163, 0.08);
  transform: translateY(26px) scale(0.975);
  opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out), opacity var(--dur) var(--ease-out);
  scrollbar-width: thin;
}

.modal.is-open .modal__panel {
  transform: none;
  opacity: 1;
}

.modal__panel--wide {
  width: min(980px, 100%);
}

.modal__head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(20px, 3vw, 34px) 18px;
  background: linear-gradient(180deg, rgba(13, 16, 32, 0.98) 60%, rgba(13, 16, 32, 0));
  backdrop-filter: blur(8px);
}

.modal__body {
  padding: 0 clamp(20px, 3vw, 34px) 30px;
}

.modal__close {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  color: var(--text-300);
  background: var(--surface-1);
  transition: all var(--dur) var(--ease-out);
}

.modal__close:hover {
  background: var(--surface-3);
  color: var(--text-100);
  transform: rotate(90deg);
}

/* Drawer from right */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 220;
  pointer-events: none;
}

.drawer.is-open {
  pointer-events: auto;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}

.drawer.is-open .drawer__backdrop {
  opacity: 1;
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100%);
  background: linear-gradient(200deg, var(--aside-deep-1), var(--aside-deep-2));
  border-left: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer.is-open .drawer__panel {
  transform: none;
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 320;
  display: grid;
  gap: 10px;
  width: min(370px, calc(100vw - 28px));
}

.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-strong);
  background: rgba(13, 16, 28, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  color: var(--text-200);
  animation: toastIn var(--dur-slow) var(--ease-out);
}

.toast--success {
  border-color: rgba(18, 226, 163, 0.4);
}
.toast--error {
  border-color: rgba(251, 113, 133, 0.42);
}
.toast--info {
  border-color: rgba(56, 189, 248, 0.4);
}
.toast--warning {
  border-color: rgba(245, 196, 105, 0.42);
}

.toast__icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

/* Alerts */
.alert {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  font-size: 0.87rem;
  align-items: flex-start;
}

.alert--success {
  border-color: rgba(18, 226, 163, 0.32);
  background: rgba(18, 226, 163, 0.08);
  color: #b7ffe6;
}
.alert--error {
  border-color: rgba(251, 113, 133, 0.34);
  background: rgba(251, 113, 133, 0.08);
  color: #ffc2cc;
}
.alert--warning {
  border-color: rgba(245, 196, 105, 0.34);
  background: rgba(245, 196, 105, 0.08);
  color: #ffe6b8;
}
.alert--info {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.07);
  color: #c5e9ff;
}

/* Tabs */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  flex-wrap: wrap;
}

.tab {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-400);
  transition: all var(--dur) var(--ease-out);
}

.tab:hover {
  color: var(--text-100);
}

.tab.is-active {
  background: var(--surface-3);
  color: var(--text-100);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
}

/* ---------------------------------------------------------- SCROLL REVEAL */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 760ms var(--ease-out), transform 760ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal='left'] {
  transform: translateX(-32px);
}
[data-reveal='right'] {
  transform: translateX(32px);
}
[data-reveal='scale'] {
  transform: scale(0.94);
}
[data-reveal='blur'] {
  filter: blur(12px);
  transform: translateY(18px);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

html.js-off [data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Ambient bits */
.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* ---------------------------------------------------------- UTILITIES */
.text-center {
  text-align: center;
}
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* --------------------------------------------------------- SPINNER */
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(4, 20, 15, 0.28);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 720ms linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

.btn--outline .spinner,
.btn--ghost .spinner {
  border-color: rgb(var(--tint-rgb) / 0.25);
  border-top-color: var(--mint-400);
}

/* SVG brand mark variant */
.brand__mark--svg {
  background: linear-gradient(140deg, rgba(18, 226, 163, 0.18), rgba(124, 92, 255, 0.14));
  border: 1px solid rgba(18, 226, 163, 0.28);
  box-shadow: 0 10px 26px -14px rgba(18, 226, 163, 0.7), inset 0 0 0 1px rgb(var(--tint-rgb) / 0.05);
}

.brand__mark--svg .brand-svg {
  width: 62%;
  height: 62%;
}

.brand-svg {
  display: block;
}

/* ======================================================== THEME SWITCH */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.theme-toggle:hover { border-color: var(--hairline-strong); }
.theme-toggle:focus-visible { outline: 2px solid var(--mint-400); outline-offset: 2px; }
.theme-toggle__slot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 26px;
  border-radius: 999px;
  color: var(--text-500);
  transition: color var(--dur) var(--ease-out), background var(--dur) var(--ease-out), transform var(--dur) var(--ease-spring);
}
.theme-toggle__slot svg { width: 15px; height: 15px; }
[data-theme="dark"] .theme-toggle__slot[data-slot="dark"],
[data-theme="light"] .theme-toggle__slot[data-slot="light"] {
  color: var(--text-100);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
  transform: scale(1.04);
}
[data-theme="light"] .theme-toggle__slot[data-slot="light"] { color: var(--gold-500); }
:root:not([data-theme="light"]) .theme-toggle__slot[data-slot="dark"] { color: var(--mint-400); }

/* landing / auth variant keeps the same shape, larger hit area */
.theme-toggle--lg .theme-toggle__slot { width: 34px; height: 30px; }
.theme-toggle--lg .theme-toggle__slot svg { width: 17px; height: 17px; }

/* ====================================================== ACCENT PRESETS */
[data-accent="violet"] {
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-line: rgba(124, 92, 255, 0.32);
  --glow-mint: 0 0 0 1px rgba(124, 92, 255, 0.3), 0 18px 60px -22px rgba(124, 92, 255, 0.5);
}
[data-accent="sky"] {
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --accent-line: rgba(56, 189, 248, 0.32);
  --glow-mint: 0 0 0 1px rgba(56, 189, 248, 0.3), 0 18px 60px -22px rgba(56, 189, 248, 0.5);
}
[data-accent="gold"] {
  --accent: #f5c469;
  --accent-soft: rgba(245, 196, 105, 0.14);
  --accent-line: rgba(245, 196, 105, 0.32);
  --glow-mint: 0 0 0 1px rgba(245, 196, 105, 0.3), 0 18px 60px -22px rgba(245, 196, 105, 0.5);
}
[data-accent="rose"] {
  --accent: #fb7185;
  --accent-soft: rgba(251, 113, 133, 0.14);
  --accent-line: rgba(251, 113, 133, 0.32);
  --glow-mint: 0 0 0 1px rgba(251, 113, 133, 0.3), 0 18px 60px -22px rgba(251, 113, 133, 0.5);
}

/* the primary button follows the accent so admin colour choices carry through */
.btn--primary {
  background-image: linear-gradient(112deg, color-mix(in srgb, var(--accent) 78%, #ffffff), var(--accent) 62%, color-mix(in srgb, var(--accent) 62%, var(--violet-400)));
}

/* Global form sizing: never let a grid or flex parent squeeze controls. */
.field, .form-grid > *, .form-row > *, .phone-field > * { min-width: 0; }
.input, .select, .textarea { max-width: 100%; }
