/* ==========================================================================
   Nocturne Dashboard UI Kit — style.css
   Vanilla CSS, zero dependency. Dark-first + light theme.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* palette — dark (default) */
  --bg: #0a0e12;
  --bg-soft: #0d1217;
  --surface: #11161d;
  --surface-2: #161d26;
  --surface-3: #1b242f;
  --border: #1f2933;
  --border-strong: #2b3846;

  --text: #e8eef4;
  --text-2: #a7b4c2;
  --muted: #78879a;

  --accent: #7fe0a3;
  --accent-strong: #57cd8a;
  --accent-soft: rgba(127, 224, 163, 0.12);
  --accent-2: #9d8df1;
  --accent-2-soft: rgba(157, 141, 241, 0.14);

  --success: #7fe0a3;
  --warning: #f5c46b;
  --danger: #ff7b7b;
  --info: #7cc7ff;

  --chart-1: #7fe0a3;
  --chart-2: #9d8df1;
  --chart-3: #7cc7ff;
  --chart-4: #f5c46b;
  --chart-5: #ff7b7b;

  --grid-line: rgba(255, 255, 255, 0.06);

  /* typography */
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas,
    monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  /* spacing & shape */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);

  /* layout */
  --sidebar-w: 250px;
  --header-h: 64px;
}

[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-soft: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --border: #e3e8ef;
  --border-strong: #cfd8e3;

  --text: #0e1620;
  --text-2: #46566a;
  --muted: #6b7c90;

  --accent: #149e60;
  --accent-strong: #0f8551;
  --accent-soft: rgba(20, 158, 96, 0.1);
  --accent-2: #6c5ce7;
  --accent-2-soft: rgba(108, 92, 231, 0.1);

  --success: #149e60;
  --warning: #b7791f;
  --danger: #d64545;
  --info: #2b7fd4;

  --chart-1: #149e60;
  --chart-2: #6c5ce7;
  --chart-3: #2b7fd4;
  --chart-4: #d99a1a;
  --chart-5: #d64545;

  --grid-line: rgba(14, 22, 32, 0.08);

  --shadow-sm: 0 1px 2px rgba(15, 30, 50, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 30, 50, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 30, 50, 0.12);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

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

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

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

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

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.015em;
}

h1 {
  font-size: var(--fs-2xl);
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}

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

::selection {
  background: var(--accent);
  color: #06120c;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--accent);
  color: #06120c;
  padding: 10px 16px;
  border-radius: 0 0 var(--r-md) 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

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

/* --------------------------------------------------------------------------
   3. Layout shell
   -------------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  grid-row: 1 / -1;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  color: #06120c;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

[data-theme="light"] .brand__mark {
  color: #fff;
}

.brand__name {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1rem;
}

.brand__tag {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  padding: 1px 6px;
  margin-left: auto;
}

.nav {
  padding: var(--sp-4) var(--sp-3);
  flex: 1;
}

.nav__label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: var(--sp-3) var(--sp-3) var(--sp-2);
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav__item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav__item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav__item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke-width: 1.7;
}

.nav__badge {
  margin-left: auto;
  font-size: 0.6875rem;
  background: var(--surface-3);
  color: var(--text-2);
  border-radius: var(--r-full);
  padding: 1px 7px;
  font-weight: 600;
}

.nav__item.is-active .nav__badge {
  background: var(--accent);
  color: #06120c;
}

.sidebar__foot {
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
}

.upgrade {
  background: linear-gradient(
    150deg,
    var(--accent-2-soft),
    var(--accent-soft)
  );
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}

.upgrade__title {
  font-size: var(--fs-sm);
  font-weight: 650;
}

.upgrade__text {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 4px 0 12px;
}

/* main column */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-5);
}

.topbar__title {
  font-size: var(--fs-md);
  font-weight: 650;
}

.topbar__crumb {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.topbar__spacer {
  flex: 1;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: grid;
  place-items: center;
  transition: 0.15s ease;
  position: relative;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-btn__dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

.hamburger {
  display: none;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06120c;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

[data-theme="light"] .avatar {
  color: #fff;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 12px;
  height: 36px;
  min-width: 230px;
  transition: border-color 0.15s ease;
}

.search:focus-within {
  border-color: var(--accent);
}

.search svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex-shrink: 0;
}

.search input {
  background: none;
  border: none;
  outline: none;
  width: 100%;
  font-size: var(--fs-sm);
}

.search input::placeholder {
  color: var(--muted);
}

.search kbd {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 1px 5px;
}

.content {
  padding: var(--sp-5);
  flex: 1;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

.page-head p {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   4. Buttons & badges
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: 0.15s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn--primary {
  background: var(--accent);
  color: #06120c;
}
.btn--primary:hover {
  background: var(--accent-strong);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
.btn--ghost:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}

.btn--soft {
  background: var(--accent-soft);
  color: var(--accent);
}
.btn--soft:hover {
  background: var(--accent);
  color: #06120c;
}

.btn--danger {
  background: rgba(255, 123, 123, 0.12);
  color: var(--danger);
}
.btn--danger:hover {
  background: var(--danger);
  color: #1a0505;
}

.btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: var(--fs-xs);
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-2);
  line-height: 1.4;
}

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

.badge--ok {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge--warn {
  background: rgba(245, 196, 107, 0.14);
  color: var(--warning);
}
.badge--bad {
  background: rgba(255, 123, 123, 0.14);
  color: var(--danger);
}
.badge--info {
  background: rgba(124, 199, 255, 0.14);
  color: var(--info);
}
.badge--plain::before {
  display: none;
}

/* --------------------------------------------------------------------------
   5. Cards, stats, grid
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}

.card__title {
  font-size: var(--fs-md);
  font-weight: 650;
}

.card__sub {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 2px;
}

.card--flush .card__head {
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

/* stat */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  position: relative;
  overflow: hidden;
}

.stat__label {
  font-size: var(--fs-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.stat__value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: 6px;
}

.delta {
  font-size: var(--fs-xs);
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}

.delta--up {
  color: var(--success);
}
.delta--down {
  color: var(--danger);
}

.stat__hint {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.stat__spark {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 110px;
  height: 44px;
  opacity: 0.85;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   6. Charts
   -------------------------------------------------------------------------- */
.chart {
  width: 100%;
}

.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}

.chart-grid line {
  stroke: var(--grid-line);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font);
}

.chart-line {
  fill: none;
  stroke: var(--chart-1);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: url(#areaGrad);
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--chart-1);
  stroke-width: 2.5;
}

.chart-bar {
  fill: var(--chart-2);
  rx: 4;
  transition: opacity 0.15s ease;
}
.chart-bar:hover {
  opacity: 0.75;
}

.chart-tooltip {
  font-size: 11px;
  font-weight: 650;
  fill: var(--text);
}

/* donut */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.donut {
  position: relative;
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.donut__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut__value {
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.donut__label {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.donut-legend {
  flex: 1;
  min-width: 160px;
  display: grid;
  gap: 10px;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.donut-legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex-shrink: 0;
}

.donut-legend b {
  margin-left: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* segmented control */
.segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}

.segmented button {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 7px;
  transition: 0.15s ease;
}

.segmented button:hover {
  color: var(--text-2);
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   7. Table
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 560px;
}

.table th {
  text-align: left;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  padding: 11px var(--sp-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 13px var(--sp-5);
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}

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

.table tbody tr:hover td {
  background: var(--surface-2);
}

.table td:first-child {
  color: var(--text);
  font-weight: 550;
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cell-user .avatar {
  width: 30px;
  height: 30px;
  font-size: 0.6875rem;
}

.cell-user small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   8. Forms
   -------------------------------------------------------------------------- */
.field {
  display: grid;
  gap: 7px;
  margin-bottom: var(--sp-4);
}

.field label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}

.field .req {
  color: var(--danger);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 42px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 13px;
  font-size: var(--fs-sm);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.textarea {
  height: auto;
  padding: 11px 13px;
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input.is-invalid,
.textarea.is-invalid {
  border-color: var(--danger);
}

.field__error {
  font-size: var(--fs-xs);
  color: var(--danger);
  display: none;
}

.field__error.is-visible {
  display: block;
}

.field__hint {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.input-group {
  position: relative;
}

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

.input-group__btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.input-group__btn:hover {
  color: var(--text);
  background: var(--surface-3);
}

.input-group__btn svg {
  width: 16px;
  height: 16px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.link {
  color: var(--accent);
  font-weight: 600;
  font-size: var(--fs-sm);
}

.link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   9. Login page
   -------------------------------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth__aside {
  position: relative;
  overflow: hidden;
  padding: var(--sp-7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(
      1100px 620px at 12% 8%,
      rgba(157, 141, 241, 0.2),
      transparent 62%
    ),
    radial-gradient(
      900px 560px at 88% 92%,
      rgba(127, 224, 163, 0.16),
      transparent 60%
    ),
    var(--bg-soft);
  border-right: 1px solid var(--border);
}

.auth__aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
  pointer-events: none;
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.auth__quote {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.auth__quote h2 {
  font-size: var(--fs-3xl);
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-3);
}

.auth__quote p {
  color: var(--text-2);
  font-size: var(--fs-md);
}

.auth__points {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.auth__points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.auth__points span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.auth__points svg {
  width: 12px;
  height: 12px;
}

.auth__foot {
  position: relative;
  z-index: 1;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.auth__panel {
  display: grid;
  place-items: center;
  padding: var(--sp-6) var(--sp-5);
  background: var(--bg);
}

.auth__box {
  width: 100%;
  max-width: 400px;
}

.auth__box h1 {
  font-size: var(--fs-2xl);
  margin-bottom: 6px;
}

.auth__box > p {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-5);
}

.auth__meta {
  margin-top: var(--sp-5);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.auth__divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-5) 0;
  color: var(--muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth__divider::before,
.auth__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth__social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
  border: 1px solid transparent;
}

.alert svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert--error {
  background: rgba(255, 123, 123, 0.1);
  border-color: rgba(255, 123, 123, 0.3);
  color: var(--danger);
}

.alert--success {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}

.alert--info {
  background: rgba(124, 199, 255, 0.1);
  border-color: rgba(124, 199, 255, 0.3);
  color: var(--info);
}

.alert[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   10. Pricing
   -------------------------------------------------------------------------- */
.pricing-hero {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--sp-6);
}

.pricing-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.035em;
}

.pricing-hero p {
  color: var(--muted);
  margin-top: var(--sp-3);
  font-size: var(--fs-md);
}

.pricing-hero .segmented {
  margin-top: var(--sp-5);
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: var(--sp-4);
  align-items: stretch;
}

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.plan:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.plan--featured {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(
      180deg,
      var(--accent-soft),
      transparent 42%
    ),
    var(--surface);
  box-shadow: var(--shadow-md);
  position: relative;
}

.plan__flag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #06120c;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: var(--r-full);
  white-space: nowrap;
}

.plan__name {
  font-size: var(--fs-md);
  font-weight: 650;
}

.plan__desc {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 4px;
  min-height: 32px;
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: var(--sp-4) 0;
}

.plan__amount {
  font-size: 2.5rem;
  font-weight: 750;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.plan__per {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.plan__note {
  font-size: var(--fs-xs);
  color: var(--accent);
  font-weight: 600;
  min-height: 18px;
}

.plan__features {
  display: grid;
  gap: 11px;
  margin: var(--sp-5) 0;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  flex: 1;
}

.plan__features li {
  display: flex;
  gap: 9px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  align-items: flex-start;
}

.plan__features svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.plan__features li.is-off {
  color: var(--muted);
}

.plan__features li.is-off svg {
  color: var(--muted);
  opacity: 0.55;
}

.faq {
  max-width: 760px;
  margin: var(--sp-7) auto 0;
  display: grid;
  gap: var(--sp-3);
}

.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  color: var(--text);
}

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

.faq__q svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq__item.is-open .faq__q svg {
  transform: rotate(180deg);
}

.faq__a {
  display: none;
  padding: 0 var(--sp-5) var(--sp-4);
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.faq__item.is-open .faq__a {
  display: block;
}

/* --------------------------------------------------------------------------
   11. Component gallery / marketing blocks
   -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: var(--sp-7) var(--sp-5) var(--sp-6);
  max-width: 780px;
  margin: 0 auto;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-xs);
  font-weight: 650;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 5px 13px;
  border-radius: var(--r-full);
  margin-bottom: var(--sp-4);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero p {
  color: var(--text-2);
  font-size: var(--fs-md);
  margin-top: var(--sp-4);
}

.hero__cta {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  margin-top: var(--sp-5);
  flex-wrap: wrap;
}

.section {
  padding: var(--sp-6) var(--sp-5);
  max-width: 1200px;
  margin: 0 auto;
}

.section__head {
  text-align: center;
  margin-bottom: var(--sp-5);
}

.section__head p {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 6px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-3);
}

.swatch {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
}

.swatch__chip {
  height: 74px;
}

.swatch__meta {
  padding: 11px 13px;
  font-size: var(--fs-xs);
}

.swatch__meta b {
  display: block;
  font-size: var(--fs-sm);
  margin-bottom: 2px;
}

.swatch__meta code {
  color: var(--muted);
  font-family: var(--mono);
}

.spec-list {
  display: grid;
  gap: var(--sp-3);
}

.spec-list li {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.spec-list svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.spec-list b {
  display: block;
  font-size: var(--fs-sm);
}

.spec-list span {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* progress */
.progress {
  height: 7px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: var(--r-full);
}

/* activity feed */
.feed {
  display: grid;
  gap: var(--sp-4);
}

.feed li {
  display: flex;
  gap: var(--sp-3);
  position: relative;
}

.feed__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-2);
}

.feed__dot svg {
  width: 15px;
  height: 15px;
}

.feed__body {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.feed__body b {
  color: var(--text);
  font-weight: 600;
}

.feed__time {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 2px;
}

/* footer */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-5);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.footer a {
  color: var(--text-2);
}

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

/* --------------------------------------------------------------------------
   12. Overlay (mobile sidebar)
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
}

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

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .grid--stats {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    width: min(280px, 84vw);
    transform: translateX(-102%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .hamburger {
    display: grid;
  }

  .search {
    display: none;
  }

  .content {
    padding: var(--sp-4);
  }

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

  .auth__aside {
    display: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 0 var(--sp-4);
    gap: var(--sp-2);
  }

  .topbar__crumb {
    display: none;
  }

  .content {
    padding: var(--sp-4) var(--sp-3);
  }

  .card {
    padding: var(--sp-4);
  }

  .card--flush .card__head,
  .table th,
  .table td {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .stat__value {
    font-size: var(--fs-xl);
  }

  .page-head .btn {
    flex: 1;
  }

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

  .donut-wrap {
    justify-content: center;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
