@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
}

/* ── M3 Dark color tokens ── */
:root {
  --md-bg:              #0f0f13;
  --md-surface:         #16161b;
  --md-surface-1:       #1e1e26; /* elevation 1 */
  --md-surface-2:       #232330; /* elevation 2 */
  --md-surface-3:       #282838; /* elevation 3 */
  --md-outline:         #44444f;
  --md-outline-variant: #2a2a35;

  /* Primary — indigo tonal */
  --md-primary:         #c5c0ff;
  --md-on-primary:      #1a1760;
  --md-primary-container: #302d7a;
  --md-on-primary-container: #e3dfff;

  /* Secondary — tonal muted */
  --md-secondary:       #c9c4db;
  --md-secondary-container: #3a384b;
  --md-on-secondary-container: #e6e1f9;

  /* Error */
  --md-error:           #ffb4ab;
  --md-error-container: #93000a;
  --md-on-error-container: #ffdad6;

  /* Tertiary — teal accent */
  --md-tertiary:        #6ddccc;
  --md-tertiary-container: #004f47;
  --md-on-tertiary-container: #9df5e5;

  /* Text */
  --md-on-bg:           #e5e1f0;
  --md-on-surface:      #e5e1f0;
  --md-on-surface-var:  #c8c4d4;
  --md-on-surface-muted: #7a7688;

  --sidebar-w: 88px; /* M3 Navigation Rail width */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-full: 9999px;
  --ease-std: cubic-bezier(.2, 0, 0, 1);
  --dur: 0.25s;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--md-bg);
  color: var(--md-on-surface);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
}

/* ───────────────────────────────────────────
   LOGIN SCREEN
─────────────────────────────────────────── */
#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--md-bg);
  z-index: 100;
  transition: opacity var(--dur) var(--ease-std),
              visibility var(--dur) var(--ease-std);
}
#login-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.login-card {
  background: var(--md-surface-1);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 360px;
  animation: fadeUp .4s var(--ease-std);
}

.login-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.login-brand-icon {
  width: 40px; height: 40px;
  background: var(--md-primary-container);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--md-on-primary-container);
}
.login-brand h1 {
  font-size: 18px; font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.3px;
  color: var(--md-on-surface);
  line-height: 1.2;
}
.login-brand h1 span { display: block; font-size: 12px; font-weight: 400; color: var(--md-on-surface-muted); margin-top: 1px; letter-spacing: 0; }

/* ───────────────────────────────────────────
   NAVIGATION RAIL (M3)
─────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--md-surface);
  display: flex; flex-direction: column; align-items: center;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 10;
  padding: 16px 0;
  gap: 4px;
}

.rail-logo {
  width: 40px; height: 40px;
  background: var(--md-primary-container);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--md-on-primary-container);
  margin-bottom: 16px;
}

nav { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; width: 100%; padding: 0 12px; }

nav a {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  width: 100%;
  padding: 12px 0 10px;
  color: var(--md-on-surface-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  position: relative;
  transition: color var(--dur) var(--ease-std);
  font-size: 11px;
  letter-spacing: 0.3px;
}

/* M3 indicator pill */
nav a .indicator {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 32px;
  border-radius: var(--radius-full);
  background: transparent;
  transition: background var(--dur) var(--ease-std),
              width var(--dur) var(--ease-std);
}
nav a .icon {
  width: 20px; height: 20px;
  position: relative; z-index: 1;
  margin-top: 4px;
}
nav a .nav-label { position: relative; z-index: 1; }

nav a:hover .indicator { background: rgba(255,255,255,.08); }
nav a.active .indicator { background: var(--md-secondary-container); width: 64px; }
nav a.active { color: var(--md-on-secondary-container); }
nav a.active .icon { color: var(--md-primary); }

.rail-footer { padding: 0 12px 8px; width: 100%; }
.rail-logout {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; width: 100%;
  padding: 12px 0 10px;
  border-radius: var(--radius-md);
  background: transparent; border: none;
  color: var(--md-on-surface-muted);
  cursor: pointer; font-size: 11px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  transition: background var(--dur) var(--ease-std), color var(--dur);
}
.rail-logout:hover { background: rgba(255, 180, 171, .1); color: var(--md-error); }
.rail-logout svg { width: 20px; height: 20px; }

/* ───────────────────────────────────────────
   MAIN CONTENT
─────────────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
  max-width: 1100px;
}

.page { display: none; }
.page.active {
  display: block;
  animation: fadeIn .3s var(--ease-std);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* M3 Display / Title typography */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 22px; font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.4px;
  color: var(--md-on-surface);
}
.page-header p { font-size: 13px; color: var(--md-on-surface-muted); margin-top: 2px; }

/* ───────────────────────────────────────────
   M3 CARDS — tonal surface elevation
─────────────────────────────────────────── */
.card {
  background: var(--md-surface-1);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.card-elevated {
  background: var(--md-surface-2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

/* ───────────────────────────────────────────
   FORM — M3 Outlined TextField style
─────────────────────────────────────────── */
.field { margin-bottom: 20px; position: relative; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--md-on-surface-muted);
  margin-bottom: 8px;
}

input[type=text], input[type=password], input[type=number],
input[type=datetime-local], input[type=date], input[type=time],
input[type=email], input[type=search], input[type=url], input[type=tel],
select, textarea {
  width: 100%;
  background: var(--md-surface-2);
  border: 1.5px solid var(--md-outline-variant);
  color: var(--md-on-surface);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  outline: none;
  transition: border-color var(--dur) var(--ease-std),
              background var(--dur) var(--ease-std);
  color-scheme: dark; /* tells the browser to render native widgets (calendar, time, scrollbars) in dark mode */
}
input:hover, select:hover, textarea:hover { border-color: var(--md-outline); }
input:focus, select:focus, textarea:focus {
  border-color: var(--md-primary);
  background: var(--md-surface-3);
}
::placeholder { color: var(--md-on-surface-muted); opacity: 1; }

/* ───────────────────────────────────────────
   M3 BUTTONS
─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 600;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  letter-spacing: 0.2px;
  transition: all var(--dur) var(--ease-std);
  position: relative; overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: currentColor;
  transition: opacity var(--dur);
}
.btn:hover::after { opacity: .08; }
.btn:active::after { opacity: .12; }

/* Filled */
.btn-primary {
  background: var(--md-primary);
  color: var(--md-on-primary);
}
/* Tonal */
.btn-tonal {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
}
/* Error tonal */
.btn-danger {
  background: var(--md-error-container);
  color: var(--md-on-error-container);
}
/* Tertiary tonal */
.btn-success {
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
}
/* Text button */
.btn-text {
  background: transparent;
  color: var(--md-primary);
  padding: 10px 16px;
}
.btn:disabled { opacity: .38; pointer-events: none; }

/* ───────────────────────────────────────────
   STATS GRID
─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--md-surface-1);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--md-primary-container);
  opacity: .25;
}
.stat-card .label {
  color: var(--md-on-surface-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 10px;
}
.stat-card .value {
  font-size: 28px; font-weight: 700;
  color: var(--md-primary);
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.8px;
  line-height: 1;
}

/* ───────────────────────────────────────────
   INFO TABLE
─────────────────────────────────────────── */
.info-table { width: 100%; border-collapse: collapse; }
.info-table tr {
  border-bottom: 1px solid var(--md-outline-variant);
  transition: background var(--dur);
}
.info-table tr:last-child { border-bottom: none; }
.info-table tr:hover { background: rgba(255,255,255,.03); }
.info-table td { padding: 11px 6px; }
.info-table td:first-child {
  color: var(--md-on-surface-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  width: 150px;
}
.info-table td:last-child { font-family: 'Space Grotesk', monospace; font-size: 13px; word-break: break-all; }

/* ───────────────────────────────────────────
   BADGES — M3 Assist chip style
─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
  letter-spacing: .3px;
}
.badge-banned {
  background: var(--md-error-container);
  color: var(--md-on-error-container);
}
.badge-ok {
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
}

/* ───────────────────────────────────────────
   MODAL — M3 Dialog
─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease-std),
              visibility var(--dur) var(--ease-std);
  backdrop-filter: blur(4px);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--md-surface-3);
  border-radius: var(--radius-lg);
  padding: 24px 28px 20px;
  width: 420px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeUp .3s var(--ease-std);
}
.modal h3 {
  margin-bottom: 20px;
  font-size: 18px; font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.3px;
  color: var(--md-on-surface);
}
.modal-actions {
  display: flex; gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ───────────────────────────────────────────
   MESSAGES
─────────────────────────────────────────── */
.msg {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}
.msg-error {
  background: var(--md-error-container);
  color: var(--md-on-error-container);
}
.msg-success {
  background: var(--md-tertiary-container);
  color: var(--md-on-tertiary-container);
}

/* ───────────────────────────────────────────
   SCROLLBAR
─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--md-outline-variant); border-radius: var(--radius-full); }

/* ───────────────────────────────────────────
   LOADING
─────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 0;
}
.loading-dots {
  display: flex;
  gap: 4px;
}
.loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--md-primary);
  animation: loading-bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes loading-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .4; }
  40%           { transform: scale(1);   opacity: 1;  }
}

/* ───────────────────────────────────────────
   TOASTS
─────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 40px);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px 13px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: #fff;
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.3);
  pointer-events: auto;
  cursor: default;
  max-width: 420px;
  min-width: 220px;
  width: max-content;
  animation: toast-in .3s cubic-bezier(.34,1.4,.64,1) forwards;
  word-break: break-word;
}
.toast.toast-out {
  animation: toast-out .2s ease-in forwards;
}
.toast-success { background: #1b5e20; border-left: 3px solid #4caf50; }
.toast-error   { background: #7f0000; border-left: 3px solid #ef5350; }
.toast-info    { background: #0d2b5e; border-left: 3px solid #5c8eff; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; opacity: .75; margin-bottom: 2px; }
.toast-msg { font-size: 13px; }
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 16px;
  margin-left: 4px;
  transition: color .15s;
  align-self: flex-start;
}
.toast-close:hover { color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px) scale(.94); }
  to   { opacity: 1; transform: translateY(0)      scale(1);  }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0)      scale(1);   }
  to   { opacity: 0; transform: translateY(-10px)  scale(.96); }
}

/* ───────────────────────────────────────────
   OFFER TYPE DROPDOWN
─────────────────────────────────────────── */
.ot-wrap {
  position: relative;
  user-select: none;
}
.ot-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--md-surface-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  transition: background var(--dur);
  min-height: 38px;
}
.ot-selected:hover { background: var(--md-surface-3); }
.ot-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}
.ot-icon-placeholder {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
}
.ot-list {
  display: none;
  position: fixed;
  background: var(--md-surface-3);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 9000;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}
.ot-wrap.ot-open .ot-list { display: block; }
.ot-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: background var(--dur);
}
.ot-option:hover { background: rgba(255,255,255,.07); }
.ot-option.ot-active { background: rgba(197,192,255,.12); color: var(--md-primary); }
#of-items-list { overflow: visible; }

/* ── Event cards ── */
.ev-card { margin-bottom: 0; }
.ev-header { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.ev-slot { font-size:13px; font-weight:600; color:var(--md-primary); background:rgba(197,192,255,.12); padding:3px 10px; border-radius:20px; }
.ev-modes { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.chip { font-size:11px; padding:3px 10px; border-radius:20px; background:rgba(255,255,255,.08); color:var(--on-surface-variant); }
.chip-accent { background:rgba(197,192,255,.18); color:var(--md-primary); }
.ev-row { display:flex; justify-content:space-between; font-size:12px; padding:4px 0; border-top:1px solid rgba(255,255,255,.05); color:var(--on-surface-variant); }
.ev-row span:last-child { color:var(--md-on-surface); text-align:right; }

/* ───────────────────────────────────────────
   M3 CHECKBOX
─────────────────────────────────────────── */
input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid var(--md-outline);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  position: relative;
  transition: border-color var(--dur) var(--ease-std),
              background var(--dur) var(--ease-std),
              box-shadow var(--dur) var(--ease-std);
  vertical-align: middle;
}
input[type=checkbox]:hover {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 8px rgba(197, 192, 255, .08);
}
input[type=checkbox]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(197, 192, 255, .25);
}
input[type=checkbox]:checked {
  background: var(--md-primary);
  border-color: var(--md-primary);
}
input[type=checkbox]:checked::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--md-on-primary);
  /* checkmark drawn via clip-path so it scales cleanly with the box */
  clip-path: polygon(14% 47%, 0 60%, 38% 100%, 100% 22%, 87% 11%, 38% 75%);
}
input[type=checkbox]:disabled {
  opacity: .38;
  cursor: not-allowed;
}

/* ───────────────────────────────────────────
   M3 RADIO
─────────────────────────────────────────── */
input[type=radio] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  border: 2px solid var(--md-outline);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: border-color var(--dur) var(--ease-std),
              box-shadow var(--dur) var(--ease-std);
  vertical-align: middle;
}
input[type=radio]:hover {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 8px rgba(197, 192, 255, .08);
}
input[type=radio]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(197, 192, 255, .25);
}
input[type=radio]:checked {
  border-color: var(--md-primary);
}
input[type=radio]:checked::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--md-primary);
}

/* ───────────────────────────────────────────
   M3 SWITCH (opt-in via .switch wrapper)
─────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: var(--md-surface-3);
  border: 2px solid var(--md-outline);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur) var(--ease-std), border-color var(--dur) var(--ease-std);
}
.switch .track::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: var(--md-outline);
  border-radius: 50%;
  transition: transform var(--dur) var(--ease-std), background var(--dur) var(--ease-std), width var(--dur), height var(--dur);
}
.switch input:checked + .track {
  background: var(--md-primary);
  border-color: var(--md-primary);
}
.switch input:checked + .track::before {
  transform: translate(20px, 0);
  background: var(--md-on-primary);
  width: 16px; height: 16px;
  left: 2px; top: 2px;
}

/* ───────────────────────────────────────────
   NATIVE DATE / TIME / DATETIME PICKER
   (color-scheme: dark on the input itself; here we recolor the calendar icon)
─────────────────────────────────────────── */
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator,
input[type=week]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(.8) sepia(.3) hue-rotate(220deg) saturate(.7);
  cursor: pointer;
  opacity: .7;
  transition: opacity var(--dur);
}
input[type=date]::-webkit-calendar-picker-indicator:hover,
input[type=time]::-webkit-calendar-picker-indicator:hover,
input[type=datetime-local]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
input[type=datetime-local]::-webkit-datetime-edit,
input[type=date]::-webkit-datetime-edit,
input[type=time]::-webkit-datetime-edit { color: var(--md-on-surface); }
input[type=datetime-local]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type=datetime-local]::-webkit-datetime-edit-text { color: var(--md-on-surface-muted); padding: 0 4px; }

/* ───────────────────────────────────────────
   SELECT — custom dropdown arrow
─────────────────────────────────────────── */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c8c4d4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}
select option {
  background: var(--md-surface-2);
  color: var(--md-on-surface);
}

/* ───────────────────────────────────────────
   NUMBER SPINNER — keep but match dark theme
   (visible spinners are useful for slot/duration inputs)
─────────────────────────────────────────── */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  opacity: 1;
  filter: invert(.7) hue-rotate(180deg) brightness(1.1);
  cursor: pointer;
  margin-left: 4px;
}
input[type=number]:hover::-webkit-inner-spin-button,
input[type=number]:focus::-webkit-inner-spin-button {
  filter: invert(.85) hue-rotate(180deg) brightness(1.2);
}

/* ───────────────────────────────────────────
   SCROLLBARS — match dark surface
─────────────────────────────────────────── */
* { scrollbar-color: var(--md-outline) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--md-outline-variant);
  border-radius: 6px;
  border: 2px solid var(--md-bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--md-outline); }

/* ───────────────────────────────────────────
   FILE INPUT
─────────────────────────────────────────── */
input[type=file] {
  color: var(--md-on-surface);
  font-family: 'Space Grotesk', system-ui, sans-serif;
}
input[type=file]::file-selector-button {
  background: var(--md-secondary-container);
  color: var(--md-on-secondary-container);
  border: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  margin-right: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  transition: background var(--dur);
}
input[type=file]::file-selector-button:hover { background: var(--md-primary-container); color: var(--md-on-primary-container); }

/* ───────────────────────────────────────────
   TEXT SELECTION
─────────────────────────────────────────── */
::selection { background: var(--md-primary-container); color: var(--md-on-primary-container); }
