/* ============================================================================
   QHRM Super Admin — design tokens & base styles
   Token values are the authoritative map from the handoff README §5 and the
   `var(--…)` inventory used across "QHRM Super Admin.dc.html" (the visual
   source of truth). Dark is the default; `html.theme-light` switches to light.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---- Dark theme (default) ---- */
:root {
  --accent: #7d7bff;
  --accent-2: #9b99ff;
  --accent-on: #0b0d12;
  --accent-soft: rgba(125, 123, 255, .15);

  --bg: #090b10;
  --surface: #13161e;
  --surface-2: #1a1e28;
  --surface-3: #222734;
  --topbar: #0d1016;

  --border: #242a35;
  --border-2: #2f3645;
  --sidebar-border: #1c2029;

  --text: #eef1f6;
  --text-2: #a6aebd;
  --text-3: #6c7484;

  --success: #2ecf8f;
  --success-soft: rgba(46, 207, 143, .14);
  --success-text: #5fe0ab;

  --warning: #f5b740;
  --warning-soft: rgba(245, 183, 64, .14);
  --warning-text: #f7c970;

  --danger: #f3636b;
  --danger-soft: rgba(243, 99, 107, .14);
  --danger-text: #f78a90;

  --info: #5aa7ff;
  --info-soft: rgba(90, 167, 255, .14);
  --info-text: #8cc1ff;

  --overlay: rgba(3, 5, 10, .6);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .65);

  /* radii (README §5) */
  --r-card: 12px;
  --r-control: 8px;
  --r-pill: 9999px;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  color-scheme: dark;
}

/* ---- Light theme ---- */
html.theme-light {
  --accent: #5145e8;
  --accent-2: #4035c9;
  --accent-on: #ffffff;
  --accent-soft: #ecebfd;

  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f2f4f8;
  --surface-3: #e9edf4;
  --topbar: #ffffff;

  --border: #e7e9f0;
  --border-2: #d7dbe6;
  --sidebar-border: #e7e9f0;

  --text: #12151c;
  --text-2: #525a68;
  --text-3: #8a91a0;

  --success: #12a36a;
  --success-soft: #e3f7ee;
  --success-text: #0e7e52;

  --warning: #c98a0e;
  --warning-soft: #fdf2dc;
  --warning-text: #9a6a09;

  --danger: #d83a43;
  --danger-soft: #fde7e8;
  --danger-text: #b22a32;

  --info: #2f74e0;
  --info-soft: #e6effc;
  --info-text: #1f5bbd;

  --overlay: rgba(20, 22, 30, .35);
  --shadow: 0 1px 3px rgba(20, 22, 40, .08);
  --shadow-lg: 0 24px 60px -20px rgba(20, 22, 40, .22);

  color-scheme: light;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

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

h1 { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h1:focus { outline: none; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0; }

code, .mono { font-family: var(--font-mono); }

/* Button reset — ported from the prototype's global <style>. Without this the
   UA default border/background shows on every inline-styled button. */
button {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
}
input, textarea, select { font: inherit; }
input::placeholder, textarea::placeholder { color: var(--text-3); }

/* ---- Reusable control primitives (match prototype's visual language) ---- */
.q-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-on);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.q-btn:hover { background: var(--accent-2); }
.q-btn:disabled { opacity: .5; cursor: default; }

.q-btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.q-btn--ghost:hover { background: var(--surface-2); border-color: var(--border-2); }

.q-btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.q-btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }

.q-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}
.q-icon-btn:hover { background: var(--surface-2); color: var(--text); }

.q-input {
  height: 38px;
  width: 100%;
  padding: 0 12px;
  border-radius: var(--r-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.q-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.q-input::placeholder { color: var(--text-3); }

.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

/* status pills */
.q-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.q-pill--success { background: var(--success-soft); color: var(--success-text); }
.q-pill--warning { background: var(--warning-soft); color: var(--warning-text); }
.q-pill--danger  { background: var(--danger-soft);  color: var(--danger-text); }
.q-pill--info    { background: var(--info-soft);    color: var(--info-text); }
.q-pill--neutral { background: var(--surface-2); color: var(--text-2); }
.q-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.q-muted { color: var(--text-2); }
.q-muted-3 { color: var(--text-3); }
