/* ==========================================================================
   Lumenu UI – design system for dashboard, auth and admin
   ========================================================================== */

:root {
  --brand: #f0642a;
  --brand-600: #d94f17;
  --brand-700: #b53f10;
  --brand-50: #fff4ee;
  --brand-100: #ffe4d5;

  --ink: #0d1014;
  --ink-2: #161a21;
  --ink-3: #222833;

  --gray-950: #0f1217;
  --gray-900: #171b22;
  --gray-800: #262c36;
  --gray-700: #3a414d;
  --gray-600: #555d6b;
  --gray-500: #737b89;
  --gray-400: #9aa1ad;
  --gray-300: #c6cbd3;
  --gray-200: #e2e5ea;
  --gray-150: #eceef2;
  --gray-100: #f3f4f7;
  --gray-50: #f8f9fb;
  --white: #fff;

  --green: #16a34a;
  --green-50: #ecfdf3;
  --red: #dc2626;
  --red-50: #fef2f2;
  --amber: #d97706;
  --amber-50: #fffbeb;
  --blue: #2563eb;
  --blue-50: #eff6ff;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 4px 12px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .18);
  --ring: 0 0 0 4px rgba(240, 100, 42, .18);

  --sidebar: 264px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--gray-900);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
img, svg { display: block; max-width: 100%; }
:where(svg[aria-hidden="true"]) { width: 1.15em; height: 1.15em; flex: none; }
:where(.tiny > svg, svg.tiny) { width: 14px; height: 14px; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { margin: 0; color: var(--gray-950); letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--gray-200); margin: 24px 0; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
[hidden] { display: none !important; }
::selection { background: var(--brand-100); }

.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; }
.muted { color: var(--gray-500); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 650; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.d-block { display: block; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Layout helpers ---------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-sm { display: flex; align-items: center; gap: 6px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.pb-0 { padding-bottom: 0; } .pt-0 { padding-top: 0; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

/* Brand logo ------------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.logo:hover { color: inherit; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.logo-word span { color: var(--brand); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  --btn-bg: var(--white); --btn-fg: var(--gray-900); --btn-border: var(--gray-200);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-border);
  box-shadow: var(--shadow-xs); cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--gray-50); color: var(--btn-fg); border-color: var(--gray-300); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-border: var(--brand); box-shadow: 0 1px 2px rgba(217, 79, 23, .3), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-border: var(--ink); }
.btn-dark:hover { background: var(--ink-3); border-color: var(--ink-3); color: #fff; }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--gray-100); border-color: transparent; }
.btn-danger { --btn-bg: var(--white); --btn-fg: var(--red); --btn-border: #f5c2c2; }
.btn-danger:hover { background: var(--red-50); border-color: #f0a3a3; color: var(--red); }
.btn-danger-solid { --btn-bg: var(--red); --btn-fg: #fff; --btn-border: var(--red); }
.btn-danger-solid:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 6px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* Forms ------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-weight: 600; font-size: 13.5px; color: var(--gray-800); }
.label .opt { font-weight: 400; color: var(--gray-400); margin-left: 4px; }
.help { font-size: 12.5px; color: var(--gray-500); }
.error { font-size: 12.5px; color: var(--red); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px;
  font: inherit; font-size: 14.5px; color: var(--gray-950);
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px;
  box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.textarea { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23737b89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input::placeholder, .textarea::placeholder { color: var(--gray-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: #f19999; }
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { flex: 1; }
.input-affix { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; color: var(--gray-500); font-weight: 600; pointer-events: none; }
.input-affix.left { left: 13px; } .input-affix.right { right: 13px; }
.input-group .input.has-left { padding-left: 34px; }
.input-group .input.has-right { padding-right: 48px; }
.input-color { width: 44px; height: 42px; padding: 4px; border-radius: 10px; border: 1px solid var(--gray-200); background: #fff; cursor: pointer; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--gray-800); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); flex: none; cursor: pointer; }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--gray-300); transition: background .2s var(--ease); flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-text { display: flex; flex-direction: column; }
.switch-text strong { font-weight: 600; font-size: 14px; color: var(--gray-900); }
.switch-text span { font-size: 12.5px; color: var(--gray-500); }

/* Choice cards (radio / checkbox as cards) */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px 14px; border: 1.5px solid var(--gray-200); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s, background .15s; }
.choice-body strong { font-size: 14px; font-weight: 650; }
.choice-body span { font-size: 12.5px; color: var(--gray-500); }
.choice:hover .choice-body { border-color: var(--gray-300); }
.choice input:checked + .choice-body { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(240, 100, 42, .12); }
.choice input:focus-visible + .choice-body { box-shadow: var(--ring); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--gray-200); background: #fff; font-size: 13.5px; font-weight: 550; color: var(--gray-700); transition: all .15s; }
.chip:hover span { border-color: var(--gray-300); }
.chip input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
.chip input:focus-visible + span { box-shadow: var(--ring); }

/* Cards ------------------------------------------------------------------- */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--gray-150); }
.card-header p { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.card-body { padding: 22px; }
.card-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--gray-150); background: var(--gray-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-flush .card-body { padding: 0; }
.card-danger { border-color: #f6caca; }
.card-danger .card-header { border-bottom-color: #fbe0e0; }

.section { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-top: 1px solid var(--gray-200); }
.section:first-child { border-top: 0; padding-top: 0; }
.section-intro h2 { font-size: 16px; }
.section-intro p { margin-top: 6px; color: var(--gray-500); font-size: 13.5px; }
@media (max-width: 960px) { .section { grid-template-columns: 1fr; gap: 16px; } }

/* Stats */
.stat { padding: 20px 22px; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; color: var(--gray-500); }
.stat-label svg { width: 16px; height: 16px; }
.stat-value { margin-top: 8px; font-size: 28px; font-weight: 750; letter-spacing: -.03em; color: var(--gray-950); font-variant-numeric: tabular-nums; }
.stat-meta { margin-top: 4px; font-size: 12.5px; color: var(--gray-500); }

/* Badges & pills ------------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--gray-100); color: var(--gray-700); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-50); color: #15803d; }
.badge-red { background: var(--red-50); color: #b91c1c; }
.badge-amber { background: var(--amber-50); color: #b45309; }
.badge-blue { background: var(--blue-50); color: #1d4ed8; }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-dark { background: var(--ink); color: #fff; }

/* Alerts & flash --------------------------------------------------------------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; border: 1px solid; font-size: 14px; }
.alert svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.alert-success { background: var(--green-50); border-color: #bbf0cf; color: #14532d; }
.alert-error { background: var(--red-50); border-color: #fbcfcf; color: #7f1d1d; }
.alert-warning { background: var(--amber-50); border-color: #fde3a7; color: #78350f; }
.alert-info { background: var(--blue-50); border-color: #cfe0ff; color: #1e3a8a; }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in .35s var(--ease); }
.toast svg { width: 19px; height: 19px; flex: none; margin-top: 1px; }
.toast-success svg { color: #4ade80; }
.toast-error svg { color: #f87171; }
.toast-info svg { color: #93c5fd; }
.toast button { margin-left: auto; background: none; border: 0; color: var(--gray-400); cursor: pointer; padding: 0; font-size: 18px; line-height: 1; }
.toast.is-leaving { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* Tables ------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 11px 16px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--gray-150); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--gray-50); }
.table .actions { text-align: right; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand-50); color: var(--brand); margin-bottom: 16px; }
.empty-icon svg { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; }
.empty p { margin-top: 6px; max-width: 400px; color: var(--gray-500); }
.empty .btn { margin-top: 20px; }

/* Tabs (locale switcher inside forms) */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--gray-100); border-radius: 10px; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--gray-600); cursor: pointer; }
.tab:hover { color: var(--gray-900); }
.tab.is-active { background: #fff; color: var(--gray-950); box-shadow: var(--shadow-sm); }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-300); }
.tab .dot.filled { background: var(--green); }
.tab .dot.required { background: var(--red); }
.tab-panel { display: none; }
.tab-panel.is-active { display: flex; }

/* Dialog (native <dialog>) */
dialog.modal { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); color: inherit; }
dialog.modal::backdrop { background: rgba(13, 16, 20, .55); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .25s var(--ease); }
.modal-body { padding: 24px; }
.modal-body h2 { font-size: 18px; }
.modal-body p { margin-top: 8px; color: var(--gray-600); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: var(--gray-50); border-top: 1px solid var(--gray-150); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* Dropdown (details/summary) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow-lg); }
.dropdown-menu.up { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; color: var(--gray-800); text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--gray-100); color: var(--gray-950); }
.dropdown-item svg { width: 16px; height: 16px; color: var(--gray-500); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger svg { color: var(--red); }
.dropdown-sep { height: 1px; margin: 6px 0; background: var(--gray-150); }

/* Avatar */
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #f59e0b); color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }

/* Progress */
.progress { height: 8px; border-radius: 999px; background: var(--gray-150); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #f59e0b); }

/* ==========================================================================
   App shell
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--ink); color: var(--gray-300); border-right: 1px solid #000;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 16px; }
.sidebar .logo { color: #fff; }
.sidebar-tenant { margin: 0 14px 10px; padding: 12px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--ink-3); display: flex; align-items: center; gap: 10px; }
.tenant-logo { width: 36px; height: 36px; border-radius: 9px; background: var(--ink-3); display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 700; flex: none; }
.tenant-logo img { width: 100%; height: 100%; object-fit: cover; }
.tenant-name { color: #fff; font-weight: 650; font-size: 14px; line-height: 1.25; }
.tenant-sub { font-size: 12px; color: var(--gray-500); }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-label { padding: 16px 10px 6px; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-600); }
.nav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 11px; border-radius: 10px; color: var(--gray-400); font-weight: 550; font-size: 14px; transition: background .15s, color .15s; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.is-active { background: var(--ink-3); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.nav a.is-active svg { color: var(--brand); opacity: 1; }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 650; color: var(--gray-500); background: var(--ink-2); padding: 2px 7px; border-radius: 999px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--ink-3); }
.user-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 10px; color: #fff; }
.user-btn:hover { background: var(--ink-2); }
.user-btn .name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.user-btn .mail { font-size: 12px; color: var(--gray-500); max-width: 150px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 32px; background: rgba(248, 249, 251, .85); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--gray-200); }
.topbar .menu-toggle { display: none; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; color: var(--gray-500); }
.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13px; color: var(--gray-500); }
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--gray-900); }

.trial-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.trial-pill.is-ok { background: var(--green-50); color: #15803d; border-color: #c9f0d8; }
.trial-pill.is-bad { background: var(--red-50); color: #b91c1c; border-color: #fbd0d0; }

.banner { display: flex; align-items: center; gap: 14px; padding: 12px 32px; background: linear-gradient(90deg, #2a0f05, #1a0d08); color: #ffd9c7; font-size: 14px; }
.banner strong { color: #fff; }
.banner .btn { margin-left: auto; }

.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--gray-100); }
.lang-switch button { height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: none; font: inherit; font-size: 12px; font-weight: 700; color: var(--gray-500); cursor: pointer; }
.lang-switch button.is-active { background: #fff; color: var(--gray-950); box-shadow: var(--shadow-xs); }
.sidebar .lang-switch { background: var(--ink-2); }
.sidebar .lang-switch button { color: var(--gray-500); }
.sidebar .lang-switch button.is-active { background: var(--ink-3); color: #fff; box-shadow: none; }

.sidebar-backdrop { display: none; }

@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 60; transform: translateX(-100%); transition: transform .25s var(--ease); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .45); }
  .topbar { padding: 0 16px; }
  .topbar .menu-toggle { display: inline-flex; }
  .content { padding: 22px 16px; }
  .banner { padding: 12px 16px; flex-wrap: wrap; }
}

/* ==========================================================================
   Feature components
   ========================================================================== */

/* Onboarding checklist */
.checklist { display: flex; flex-direction: column; }
.checklist a, .checklist div.item { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--gray-150); color: var(--gray-800); font-weight: 550; }
.checklist a:hover { background: var(--gray-50); }
.check-circle { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--gray-300); flex: none; }
.check-circle svg { width: 14px; height: 14px; }
.is-done .check-circle { background: var(--green); border-color: var(--green); color: #fff; }
.is-done .label-text { color: var(--gray-400); text-decoration: line-through; }

/* Sortable lists */
.sortable-item { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--gray-150); background: #fff; }
.sortable-item:first-child { border-top: 0; }
.sortable-item.is-dragging { opacity: .5; background: var(--brand-50); }
.sortable-item.is-over { box-shadow: inset 0 2px 0 var(--brand); }
.drag-handle { display: grid; place-items: center; width: 24px; height: 32px; color: var(--gray-300); cursor: grab; flex: none; border-radius: 6px; }
.drag-handle:hover { color: var(--gray-600); background: var(--gray-100); }
.drag-handle:active { cursor: grabbing; }
.drag-handle svg { width: 16px; height: 16px; }

/* Menu item rows */
.item-thumb { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--gray-100); flex: none; display: grid; place-items: center; color: var(--gray-400); overflow: hidden; }
.item-thumb svg { width: 22px; height: 22px; }
.item-main { flex: 1; min-width: 0; }
.item-title { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--gray-950); flex-wrap: wrap; }
.item-desc { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.item-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--gray-950); }
.item-price del { color: var(--gray-400); font-weight: 500; margin-right: 6px; }
.is-soldout .item-title, .is-soldout .item-thumb { opacity: .55; }

.category-group + .category-group { margin-top: 20px; }
.category-group .card-header h2 { display: flex; align-items: center; gap: 10px; }

/* Avail toggle button */
.avail-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid #c9f0d8; background: var(--green-50); color: #15803d; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; transition: all .15s; }
.avail-btn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.avail-btn.is-off { border-color: #fbd0d0; background: var(--red-50); color: #b91c1c; }

/* Image upload */
.upload { display: flex; gap: 16px; align-items: center; }
.upload-preview { width: 112px; height: 112px; border-radius: 16px; background: var(--gray-100) center/cover no-repeat; border: 1px dashed var(--gray-300); display: grid; place-items: center; color: var(--gray-400); flex: none; overflow: hidden; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview svg { width: 28px; height: 28px; }
.upload-preview.is-wide { width: 200px; height: 90px; }
.upload-preview.is-wide img { object-fit: contain; padding: 8px; }
.file-input { position: relative; overflow: hidden; }
.file-input input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Variant rows */
.variant-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 40px; gap: 10px; align-items: start; }
@media (max-width: 640px) { .variant-row { grid-template-columns: 1fr 110px 40px; } }

/* Screens */
.screen-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.screen-card { overflow: hidden; display: flex; flex-direction: column; }
.screen-preview { position: relative; aspect-ratio: 16 / 9; background: #0b0d10; overflow: hidden; border-bottom: 1px solid var(--gray-200); }
.screen-preview.is-portrait { aspect-ratio: 16 / 9; }
.screen-preview iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
.screen-preview.is-portrait iframe { width: 1080px; height: 1920px; left: 50%; }
.screen-status { position: absolute; top: 12px; left: 12px; z-index: 2; }
.screen-card .card-body { flex: 1; }

.live-preview { position: sticky; top: 88px; }
.live-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0b0d10; box-shadow: 0 0 0 10px #12151a, 0 0 0 11px #2a2f38, var(--shadow-lg); margin: 11px; }
.live-frame.is-portrait { aspect-ratio: 9 / 16; max-width: 340px; margin-left: auto; margin-right: auto; }
.live-frame iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; }
.tv-stand { width: 34%; height: 14px; margin: 0 auto; background: linear-gradient(#1b1f26, #0f1216); border-radius: 0 0 10px 10px; }

.theme-choice .choice-body { padding: 0; overflow: hidden; }
.theme-swatch { height: 74px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 10px 12px; }
.theme-swatch i { display: block; height: 5px; border-radius: 3px; }
.theme-swatch i:nth-child(1) { width: 55%; height: 8px; }
.theme-swatch i:nth-child(2) { width: 80%; opacity: .6; }
.theme-swatch i:nth-child(3) { width: 70%; opacity: .6; }
.theme-choice .meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.swatch-noir { background: radial-gradient(circle at 80% 0%, #2b2116, #0b0b0c 70%); }
.swatch-noir i { background: #d4a24c; }
.swatch-fresh { background: linear-gradient(160deg, #f8faf6, #e7efe3); }
.swatch-fresh i { background: #2f7d4f; }
.swatch-bistro { background: radial-gradient(circle at 50% 40%, #2f3a33, #1b221e); }
.swatch-bistro i { background: #f3efe2; }
.swatch-neon { background: linear-gradient(135deg, #12002b, #1a0636 50%, #00121f); }
.swatch-neon i { background: #ff3ea5; box-shadow: 0 0 10px #ff3ea5; }

.accent-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.accent-swatches label { position: relative; cursor: pointer; }
.accent-swatches input[type=radio] { position: absolute; opacity: 0; }
.accent-swatches span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--gray-300); transition: transform .1s; }
.accent-swatches input:checked + span { box-shadow: 0 0 0 2px var(--gray-950); transform: scale(1.08); }

.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--gray-50); }

.pair-box { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.pair-code { font-family: ui-monospace, Menlo, monospace; font-size: 20px; letter-spacing: .3em; text-transform: uppercase; text-align: center; font-weight: 700; height: 52px; }

/* Billing */
.plan-card { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 100% 0%, #3a1608 0%, var(--ink) 55%); color: #fff; border: 0; }
.plan-card .card-body { padding: 28px; }
.plan-card h2 { color: #fff; }
.plan-price { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.plan-price small { font-size: 15px; font-weight: 500; color: var(--gray-400); letter-spacing: 0; }
.plan-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin-top: 22px; color: var(--gray-300); font-size: 14px; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; }
.plan-features svg { width: 18px; height: 18px; color: var(--brand); flex: none; margin-top: 1px; }
.plan-card ul { list-style: none; padding: 0; margin: 0; }
@media (max-width: 640px) { .plan-features { grid-template-columns: 1fr; } }

.method-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.method { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--gray-200); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.method:hover { border-color: var(--gray-300); box-shadow: var(--shadow); }
.method-head { display: flex; align-items: center; gap: 12px; }
.method-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--gray-100); color: var(--gray-800); flex: none; }
.method-icon svg { width: 22px; height: 22px; }
.method p { font-size: 13px; color: var(--gray-500); flex: 1; }
.method form { display: flex; gap: 8px; }
.method .select { height: 40px; }

.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--gray-500); }
.kv dd { margin: 0; font-weight: 550; color: var(--gray-950); word-break: break-word; }

/* Chart (admin) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar span { display: block; width: 100%; max-width: 38px; min-height: 3px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--brand), #f59e0b); }
.bar small { font-size: 11.5px; color: var(--gray-500); }

/* Pagination */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 18px; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--gray-700); border: 1px solid var(--gray-200); background: #fff; }
.pagination a:hover { background: var(--gray-50); }
.pagination .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .is-disabled { opacity: .45; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input, .filters .select { height: 38px; width: auto; min-width: 200px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--gray-100); border-radius: 10px; }
.segmented a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--gray-600); font-weight: 600; font-size: 13px; }
.segmented a.is-active { background: #fff; color: var(--gray-950); box-shadow: var(--shadow-xs); }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; background: #fff; }
.auth-form { display: flex; flex-direction: column; padding: 32px 48px; }
.auth-form-inner { width: 100%; max-width: 400px; margin: auto; padding: 32px 0; }
.auth-form h1 { font-size: 28px; }
.auth-form .lead { margin-top: 8px; color: var(--gray-500); }
.auth-top { display: flex; align-items: center; justify-content: space-between; }
.auth-foot { font-size: 12.5px; color: var(--gray-400); display: flex; gap: 16px; }
.auth-foot a { color: var(--gray-500); }
.auth-aside {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 56px;
  background: radial-gradient(80% 60% at 70% 20%, rgba(240, 100, 42, .35), transparent 70%), radial-gradient(60% 50% at 10% 90%, rgba(245, 158, 11, .18), transparent 70%), var(--ink);
  color: #fff;
}
.auth-aside::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.auth-aside > * { position: relative; }
.auth-aside blockquote { margin: 0; font-size: 24px; line-height: 1.35; font-weight: 600; letter-spacing: -.02em; max-width: 520px; }
.auth-aside .who { margin-top: 18px; color: var(--gray-400); font-size: 14px; }
.auth-tv { margin-bottom: 44px; max-width: 560px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--gray-400); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 960px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } .auth-form { padding: 24px 20px; } }

/* Mini TV mock used on auth + marketing */
.mock-tv { border-radius: 16px; padding: 10px; background: linear-gradient(#20242b, #0c0e11); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08); }
.mock-screen { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: radial-gradient(circle at 85% 0%, #2b2116, #0b0b0c 65%); padding: 6% 6% 5%; display: grid; grid-template-columns: 1fr 1fr; gap: 6%; color: #f5efe6; font-family: "Playfair Display", Georgia, serif; }
.mock-col h4 { color: #d4a24c; font-size: clamp(10px, 1.4vw, 17px); font-weight: 700; letter-spacing: .02em; margin-bottom: 8%; border-bottom: 1px solid rgba(212, 162, 76, .35); padding-bottom: 3%; }
.mock-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7%; font-size: clamp(8px, 1vw, 12.5px); }
.mock-row b { font-weight: 600; white-space: nowrap; }
.mock-row i { flex: 1; border-bottom: 1px dotted rgba(245, 239, 230, .3); transform: translateY(-3px); }
.mock-row em { font-style: normal; color: #d4a24c; font-family: var(--font); font-weight: 700; }
.mock-stand { width: 26%; height: 10px; margin: 0 auto; border-radius: 0 0 8px 8px; background: #111418; }

/* ==========================================================================
   Invoice (print)
   ========================================================================== */
.invoice-page { background: var(--gray-100); padding: 32px 16px; min-height: 100vh; }
.invoice { max-width: 820px; margin: 0 auto; background: #fff; padding: 56px; border-radius: 6px; box-shadow: var(--shadow); color: #111; font-size: 13.5px; }
.invoice h1 { font-size: 30px; letter-spacing: -.02em; }
.invoice table { width: 100%; border-collapse: collapse; margin-top: 32px; }
.invoice th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #666; border-bottom: 2px solid #111; padding: 8px 0; }
.invoice td { padding: 12px 0; border-bottom: 1px solid #e5e5e5; vertical-align: top; }
.invoice .totals { margin-left: auto; width: 300px; margin-top: 16px; }
.invoice .totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.invoice .totals .grand { border-top: 2px solid #111; margin-top: 6px; padding-top: 10px; font-weight: 800; font-size: 16px; }
.invoice-toolbar { max-width: 820px; margin: 0 auto 16px; display: flex; justify-content: space-between; }
@media print {
  .invoice-page { background: #fff; padding: 0; }
  .invoice { box-shadow: none; padding: 0; max-width: none; }
  .invoice-toolbar { display: none; }
  @page { margin: 18mm; }
}
@media (max-width: 640px) { .invoice { padding: 24px; } }

/* Two-column edit forms (main + sidebar) */
[data-form-grid] { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
[data-form-grid].is-wide-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
[data-narrow] { max-width: 220px; }
@media (max-width: 1100px) { [data-form-grid], [data-form-grid].is-wide-side { grid-template-columns: 1fr; } }
[data-form-grid].is-single { grid-template-columns: minmax(0, 880px); }
.swatch-default { background: #ccc; }
.legal-text { white-space: pre-line; }
[data-error-page] { min-height: 100vh; }
[data-center] { justify-content: center; }
.trial-pill { white-space: nowrap; }
.trial-pill svg { width: 15px; height: 15px; }
.card > [data-sortable] > .sortable-item:last-child, .card > .sortable-item:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.checklist > :last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.checklist svg { width: 16px; height: 16px; }
.user-btn > svg { width: 18px; height: 18px; }
.input-affix svg { width: 16px; height: 16px; }
.breadcrumb svg { width: 14px; height: 14px; }
.badge svg { width: 12px; height: 12px; }
.choice-body .meta strong { color: var(--gray-950); }
.choices:has(> .theme-choice) { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.plan-card ul.plan-features { margin-top: 22px; }
.method form .select { flex: 1; min-width: 0; }
