/* ==========================================================================
   Villora Panel UI Kit — shared by owner (/panel) and admin (/admin).
   Class contract: docs/DEV_GUIDE.md › "Panel UI kiti". Zero dependencies.
   Sections: 1 Tokens · 2 Base · 3 Shell · 4 Components · 5 Forms · 6 Data
             7 Media · 8 Overlays · 9 Auth · 10 Utilities · 11+ Page specific
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;
  --font: "Inter", "InterVariable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --brand: #0f5e63;
  --brand-600: #0c4f53;
  --brand-50: #e8f3f3;
  --brand-100: #cfe6e6;
  --sand: #e9a56b;
  --sand-50: #fcf2e9;

  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f1f3f5;
  --border: #e4e7eb;
  --border-strong: #d1d6dc;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --ring: rgba(15, 94, 99, .28);

  --green: #15803d; --green-bg: #e8f6ed;
  --amber: #a15c07; --amber-bg: #fdf4e3;
  --red: #c0262d;   --red-bg: #fdecec;
  --blue: #1d5fbf;  --blue-bg: #e8f0fc;
  --purple: #6d3fc0; --purple-bg: #f1ebfc;
  --gray-bg: #eef0f3;

  /* Chart series (validated categorical order) */
  --c1: #008f94; --c2: #d9733a; --c3: #2a78d6; --c4: #d55181; --c5: #6250d6; --c6: #7d8f12;
  --grid: #edf0f2;

  --side-bg: #0d2b2e;
  --side-text: #b9cfd0;
  --side-active: #ffffff;
  --side-hover: rgba(255, 255, 255, .06);

  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-2: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --sh-3: 0 12px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --side-w: 248px;
  --top-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #2bb3b1; --brand-600: #3cc4c1; --brand-50: #10292b; --brand-100: #16393b; --sand: #efb07c; --sand-50: #2b2219;
    --bg: #0e1215; --surface: #151a1e; --surface-2: #181e23; --surface-3: #1e252b; --border: #252d34; --border-strong: #334049;
    --text: #e8ecef; --text-2: #aeb7bf; --text-3: #85909a; --ring: rgba(43, 179, 177, .35);
    --green: #4ade80; --green-bg: #12291c; --amber: #f5b454; --amber-bg: #2c2312; --red: #f87171; --red-bg: #2e1517;
    --blue: #7aa7f5; --blue-bg: #14213a; --purple: #b294f5; --purple-bg: #231a38; --gray-bg: #20272d;
    --c1: #1ba3aa; --c2: #d26a32; --c3: #3987e5; --c4: #d55181; --c5: #9085e9; --c6: #8a9c1f; --grid: #222a30;
    --side-bg: #0a0e10; --side-text: #93a4a8;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 1px 3px rgba(0, 0, 0, .5); --sh-3: 0 16px 40px -8px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #2bb3b1; --brand-600: #3cc4c1; --brand-50: #10292b; --brand-100: #16393b; --sand: #efb07c; --sand-50: #2b2219;
  --bg: #0e1215; --surface: #151a1e; --surface-2: #181e23; --surface-3: #1e252b; --border: #252d34; --border-strong: #334049;
  --text: #e8ecef; --text-2: #aeb7bf; --text-3: #85909a; --ring: rgba(43, 179, 177, .35);
  --green: #4ade80; --green-bg: #12291c; --amber: #f5b454; --amber-bg: #2c2312; --red: #f87171; --red-bg: #2e1517;
  --blue: #7aa7f5; --blue-bg: #14213a; --purple: #b294f5; --purple-bg: #231a38; --gray-bg: #20272d;
  --c1: #1ba3aa; --c2: #d26a32; --c3: #3987e5; --c4: #d55181; --c5: #9085e9; --c6: #8a9c1f; --grid: #222a30;
  --side-bg: #0a0e10; --side-text: #93a4a8;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 1px 3px rgba(0, 0, 0, .5); --sh-3: 0 16px 40px -8px rgba(0, 0, 0, .7);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; font-weight: 650; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 var(--s3); }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s4) 0; }
code, kbd { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 6px; border-radius: 4px; }
::selection { background: var(--brand-100); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.i { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 1.75; }
.i-sm { width: 14px; height: 14px; vertical-align: -2px; }
.i-lg { width: 24px; height: 24px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 3. Shell ---------- */
.p-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.p-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; padding: var(--s4) var(--s3); z-index: 40; scrollbar-width: thin;
}
.p-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.p-brand:hover { text-decoration: none; }
.p-brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #1b8a8f, #0f5e63 55%, #e9a56b 160%); color: #fff; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.p-brand small { display: block; font-size: 11px; font-weight: 500; color: var(--side-text); letter-spacing: 0; }
.p-nav { display: flex; flex-direction: column; gap: 2px; }
.p-nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(185, 207, 208, .55); padding: 14px 10px 6px; font-weight: 600; }
.p-nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-text);
  font-weight: 500; font-size: 13.5px; transition: background .12s, color .12s; position: relative;
}
.p-nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.p-nav a.active { background: rgba(43, 179, 177, .16); color: var(--side-active); }
.p-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sand); }
.p-nav a .i { opacity: .85; }
.p-nav a.sub { padding-left: 38px; font-size: 13px; }
.p-nav .count { margin-left: auto; background: var(--sand); color: #3a230f; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.p-side-foot { margin-top: auto; padding: 14px 10px 4px; font-size: 12px; color: rgba(185, 207, 208, .6); }
.p-side-foot a { color: var(--side-text); }

.p-main { min-width: 0; display: flex; flex-direction: column; }
.p-top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s5); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(10px);
  -webkit-backdrop-filter: saturate(1.6) blur(10px); border-bottom: 1px solid var(--border);
}
.p-top-title { font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.p-burger { display: none; }
.p-content { padding: var(--s5); width: 100%; max-width: 1400px; margin: 0 auto; flex: 1; }
.p-footer { padding: var(--s4) var(--s5); color: var(--text-3); font-size: 12px; text-align: center; }
.p-overlay { display: none; }

.p-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3) var(--s4); margin-bottom: var(--s5); }
.p-head > :first-child { flex: 1 1 280px; min-width: 0; }
.p-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-sub { color: var(--text-3); margin-top: 4px; font-size: 13.5px; }
.p-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.p-crumbs { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.p-crumbs a { color: var(--text-3); }

/* Top bar widgets */
.p-icon-btn { position: relative; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; color: var(--text-2); background: transparent; border: 1px solid transparent; cursor: pointer; }
.p-icon-btn:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.p-icon-btn .dot { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; border: 2px solid var(--surface); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-trigger { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 10px; }
.menu-trigger:hover { background: var(--surface-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--brand), #1b8a8f); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-who { line-height: 1.2; text-align: left; }
.menu-who b { display: block; font-size: 13px; font-weight: 600; }
.menu-who small { color: var(--text-3); font-size: 11.5px; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh-3); padding: 6px; z-index: 60; animation: pop .14s ease-out;
}
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-3); text-decoration: none; }
.menu-pop .sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu-pop .menu-row { display: flex; gap: 4px; padding: 4px 6px; }
.menu-pop .menu-row button { justify-content: center; padding: 6px; border: 1px solid var(--border); font-size: 12px; font-weight: 600; }
.menu-pop .menu-row button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.menu-pop .menu-head { padding: 8px 10px; font-size: 12px; color: var(--text-3); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- 4. Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.card-h { display: flex; align-items: center; gap: var(--s3); padding: 14px var(--s5); border-bottom: 1px solid var(--border); min-height: 54px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h .p-sub { margin: 0; }
.card-h > .p-actions, .card-h > .card-tools { margin-left: auto; }
.card-b { padding: var(--s5); }
.card-b.flush { padding: 0; }
.card-f { padding: 12px var(--s5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.card.accent { border-top: 3px solid var(--brand); }
.card.soft { background: var(--surface-2); box-shadow: none; }

.grid { display: grid; gap: var(--s4); }
.grid.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid .span-2 { grid-column: span 2; }
.grid .span-all { grid-column: 1 / -1; }
.grid.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s2); }
.row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* KPI */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4) var(--s5); box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 4px; min-width: 0; position: relative; overflow: hidden; }
.stat-label { color: var(--text-3); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat-label .i { width: 16px; height: 16px; color: var(--brand); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--text-3); }
.stat-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 650; padding: 1px 7px; border-radius: 99px; background: var(--gray-bg); color: var(--text-2); width: fit-content; }
.stat-delta.up { background: var(--green-bg); color: var(--green); }
.stat-delta.down { background: var(--red-bg); color: var(--red); }
.stat-delta.up::before { content: "▲"; font-size: 8px; margin-right: 2px; }
.stat-delta.down::before { content: "▼"; font-size: 8px; margin-right: 2px; }
.stat-foot { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stat .spark { position: absolute; right: 12px; bottom: 10px; width: 90px; height: 30px; opacity: .9; }

/* Buttons */
.btn {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd); font: 600 13.5px/1 var(--font); cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; box-shadow: var(--sh-1); user-select: none;
}
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn .i { width: 16px; height: 16px; }
.btn-primary { --b-bg: var(--brand); --b-fg: #fff; --b-bd: var(--brand); }
.btn-primary:hover { background: var(--brand-600); }
:root[data-theme="dark"] .btn-primary { --b-fg: #062325; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { --b-fg: #062325; } }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { --b-bg: var(--surface); --b-fg: var(--red); --b-bd: color-mix(in srgb, var(--red) 35%, var(--border)); }
.btn-danger:hover { background: var(--red-bg); }
.btn-danger.solid { --b-bg: var(--red); --b-fg: #fff; --b-bd: var(--red); }
.btn-success { --b-bg: var(--green); --b-fg: #fff; --b-bd: var(--green); }
.btn-success:hover { background: color-mix(in srgb, var(--green) 88%, #000); }
.btn-sand { --b-bg: var(--sand); --b-fg: #3a230f; --b-bd: var(--sand); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--b-fg) transparent var(--b-fg) transparent; animation: spin .7s linear infinite; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }
.btn-group .btn.on { background: var(--brand-50); color: var(--brand); border-color: var(--brand); z-index: 1; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand); animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--gray-bg); color: var(--text-2); line-height: 1; letter-spacing: .01em; }
.badge .i { width: 12px; height: 12px; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-green { background: var(--green-bg); color: var(--green); }
.b-amber { background: var(--amber-bg); color: var(--amber); }
.b-red { background: var(--red-bg); color: var(--red); }
.b-gray { background: var(--gray-bg); color: var(--text-2); }
.b-blue { background: var(--blue-bg); color: var(--blue); }
.b-purple { background: var(--purple-bg); color: var(--purple); }
.b-brand { background: var(--brand-50); color: var(--brand); }
.b-sand { background: var(--sand-50); color: #9a5a22; }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid; font-size: 13.5px; margin-bottom: var(--s4); transition: opacity .3s, transform .3s; }
.alert > .i { margin-top: 1px; }
.alert-body { flex: 1; min-width: 0; }
.alert-body ul { margin: 6px 0 0; padding-left: 18px; }
.alert .alert-x { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0 2px; font-size: 18px; line-height: 1; }
.alert-success { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 25%, transparent); color: var(--green); }
.alert-error { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 25%, transparent); color: var(--red); }
.alert-info { background: var(--blue-bg); border-color: color-mix(in srgb, var(--blue) 25%, transparent); color: var(--blue); }
.alert-warn { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 25%, transparent); color: var(--amber); }
.alert.hide { opacity: 0; transform: translateY(-4px); }

/* Empty state */
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty > .i, .empty-ico { width: 52px; height: 52px; padding: 13px; border-radius: 16px; background: var(--brand-50); color: var(--brand); margin-bottom: 8px; }
.empty h3 { color: var(--text); font-size: 16px; }
.empty p { max-width: 420px; margin: 0 0 10px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: var(--s5); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { appearance: none; background: none; border: 0; padding: 10px 14px; font: 600 13.5px var(--font); color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .badge { height: 18px; font-size: 10.5px; padding: 0 6px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.lang-tabs { border: 0; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 10px; display: inline-flex; max-width: 100%; margin-bottom: var(--s4); }
.lang-tabs .tab { border: 0; margin: 0; border-radius: 7px; padding: 6px 12px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.lang-tabs .tab.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-2); }
.lang-tabs .tab .flag-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.lang-tabs .tab .flag-dot.ok { background: var(--green); }
.lang-tabs .tab .flag-dot.auto { background: var(--sand); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 9px; }
.seg a, .seg button { padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: none; border: 0; cursor: pointer; font-family: inherit; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg .on, .seg .active { background: var(--surface); color: var(--text); box-shadow: var(--sh-2); }

/* Toolbar / filters */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.toolbar .input, .toolbar .select { width: auto; min-width: 140px; height: 36px; }
.toolbar .search { position: relative; flex: 1 1 220px; max-width: 340px; }
.toolbar .search .input { width: 100%; padding-left: 34px; }
.toolbar .search .i { position: absolute; left: 10px; top: 9px; color: var(--text-3); }
.toolbar .spacer { flex: 1; }

/* Pagination */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: var(--s5); }
.pagination a, .pagination span { min-width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13px; }
.pagination a:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .gap { border: 0; background: none; }
.pagination .disabled { opacity: .45; }
.pagination-info { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 8px; }

/* Progress / meter */
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .4s; }
.progress.warn > span { background: var(--sand); }
.progress.bad > span { background: var(--red); }
.progress.lg { height: 10px; }

/* Lists & key-value */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: var(--s3); padding: 12px var(--s5); border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { font-size: 12px; color: var(--text-3); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 2px solid var(--border-strong); margin-top: 1px; }
.checklist li.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.checklist li.done .tick::after { content: "✓"; font-size: 11px; font-weight: 800; }
.checklist li.done .txt { color: var(--text-3); text-decoration: line-through; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 26px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.timeline li.done::after { background: var(--green); border-color: var(--green); }
.timeline li.current::after { background: var(--sand); border-color: var(--sand); box-shadow: 0 0 0 4px var(--sand-50); }
.timeline li.fail::after { background: var(--red); border-color: var(--red); }
.timeline b { display: block; font-size: 13.5px; }
.timeline small { color: var(--text-3); }

/* ---------- 5. Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); }
.form-grid.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { padding-bottom: var(--s5); margin-bottom: var(--s5); border-bottom: 1px dashed var(--border); }
.form-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.form-section > h3 { margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.form-section > .p-sub { margin: 0 0 var(--s4); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.field > label .req { color: var(--red); }
.field > label .opt { font-weight: 400; color: var(--text-3); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: 14px/1.4 var(--font); transition: border-color .12s, box-shadow .12s; box-shadow: var(--sh-1); min-width: 0;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.select[multiple] { height: auto; min-height: 120px; padding: 6px; background-image: none; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .8; }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] { background: var(--surface-3); color: var(--text-2); }
.input.sm, .select.sm { height: 32px; font-size: 13px; padding: 0 10px; }
.select.sm { padding-right: 28px; background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px; }
input[type="color"].input { padding: 3px; width: 56px; }
input[type="file"].input { padding: 6px; height: auto; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea, .input.is-invalid { border-color: var(--red); }
.help { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.err { font-size: 12px; color: var(--red); font-weight: 550; }
.counter { font-size: 11.5px; color: var(--text-3); text-align: right; margin-top: -2px; font-variant-numeric: tabular-nums; }
.counter.warn { color: var(--amber); }
.counter.over { color: var(--red); font-weight: 650; }
[dir="rtl"].input, [dir="rtl"].textarea, .input[dir="rtl"], .textarea[dir="rtl"] { text-align: right; }

.input-group { display: flex; align-items: stretch; min-width: 0; }
.input-group > .input, .input-group > .select { border-radius: 0; flex: 1; }
.input-group > :first-child { border-top-left-radius: 9px; border-bottom-left-radius: 9px; }
.input-group > :last-child { border-top-right-radius: 9px; border-bottom-right-radius: 9px; }
.input-group > * + * { margin-left: -1px; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 12px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.input-group .btn { border-radius: 0; height: auto; }
.input-group > .btn:last-child { border-radius: 0 9px 9px 0; }

.check { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13.5px; line-height: 1.4; user-select: none; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--brand); flex: none; cursor: pointer; }
.check small { display: block; color: var(--text-3); font-size: 12px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 16px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; cursor: pointer; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 550; color: var(--text-2); transition: all .12s; }
.chip span:hover { border-color: var(--brand); color: var(--text); }
.chip input:checked + span { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.chip input:checked + span::before { content: "✓"; font-weight: 800; font-size: 11px; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--ring); }
.chip input:disabled + span { opacity: .6; cursor: not-allowed; }
.chip.static span { cursor: default; }

.form-actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; z-index: 20; margin: var(--s5) calc(-1 * var(--s5)) calc(-1 * var(--s5)); padding: 12px var(--s5); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--border); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.repeater-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: var(--s2); align-items: end; padding: 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); margin-bottom: 8px; }

/* ---------- 6. Data ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: inherit; }
.card > .table-wrap:last-child table tr:last-child td { border-bottom: 0; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 650; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .actions > * + * { margin-left: 4px; }
.table .actions form { display: inline; }
.table .muted { color: var(--text-3); }
.table .thumb { width: 52px; height: 40px; border-radius: 7px; object-fit: cover; background: var(--surface-3); }
.table .cell-main { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.table .cell-main b { display: block; font-weight: 600; }
.table .cell-main small { color: var(--text-3); }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.table.compact td { padding: 7px 12px; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--sand); }

/* Charts (panel.js renders SVG) */
.chart { position: relative; width: 100%; min-height: 220px; color: var(--text-3); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { font: 11px var(--font); fill: var(--text-3); }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .bl { stroke: var(--border-strong); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { opacity: .14; }
.chart .guide { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .pt { stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .bar { transition: opacity .12s; }
.chart .bar:hover, .chart .seg:hover { opacity: .82; }
.chart .seg { stroke: var(--surface); stroke-width: 2; transition: opacity .12s; cursor: default; }
.chart .dl { font: 600 11px var(--font); fill: var(--text-2); }
.chart .center-v { font: 700 22px var(--font); fill: var(--text); }
.chart .center-l { font: 500 11px var(--font); fill: var(--text-3); }
.chart .s1 { fill: var(--c1); stroke: var(--c1); } .chart .s2 { fill: var(--c2); stroke: var(--c2); } .chart .s3 { fill: var(--c3); stroke: var(--c3); }
.chart .s4 { fill: var(--c4); stroke: var(--c4); } .chart .s5 { fill: var(--c5); stroke: var(--c5); } .chart .s6 { fill: var(--c6); stroke: var(--c6); }
.chart .ln.s1, .chart .ln.s2, .chart .ln.s3, .chart .ln.s4, .chart .ln.s5, .chart .ln.s6 { fill: none; }
.chart .seg.s1, .chart .seg.s2, .chart .seg.s3, .chart .seg.s4, .chart .seg.s5, .chart .seg.s6 { stroke: var(--surface); }
.chart .pt.s1, .chart .pt.s2, .chart .pt.s3, .chart .pt.s4, .chart .pt.s5, .chart .pt.s6 { stroke: var(--surface); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-legend b { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--sh-3); padding: 8px 10px; font-size: 12px; min-width: 120px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; transition: opacity .08s; }
.chart-tip b { display: block; margin-bottom: 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.chart-tip div { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.chart-tip div span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.chart-tip div em { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 12px; }
.chart-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-donut { display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap; }
.chart-donut svg { width: 180px; flex: none; }
.chart-donut .chart-legend { flex-direction: column; flex: 1; min-width: 150px; margin: 0; gap: 8px; }
.chart-empty { display: grid; place-items: center; min-height: 180px; color: var(--text-3); font-size: 13px; border: 1px dashed var(--border); border-radius: var(--r); }
.ci-1 { background: var(--c1); } .ci-2 { background: var(--c2); } .ci-3 { background: var(--c3); } .ci-4 { background: var(--c4); } .ci-5 { background: var(--c5); } .ci-6 { background: var(--c6); }

/* ---------- 7. Media ---------- */
.dropzone { position: relative; border: 2px dashed var(--border-strong); border-radius: var(--r-lg); padding: var(--s6) var(--s5); text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); }
.dropzone .dz-ico { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--surface); color: var(--brand); box-shadow: var(--sh-2); margin: 0 auto 10px; display: block; }
.dropzone h4 { font-size: 14px; margin-bottom: 4px; }
.dropzone p { color: var(--text-3); font-size: 12.5px; margin: 0; }
.dropzone input[type="file"] { display: none; }
.dropzone .dz-extra { margin-top: 12px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; cursor: default; }
.dz-queue { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; text-align: left; }
.dz-item { display: grid; grid-template-columns: minmax(0, 1fr) 120px 40px; gap: 10px; align-items: center; font-size: 12.5px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.dz-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-item .pct { text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dz-item.ok .pct { color: var(--green); }
.dz-item.fail .pct { color: var(--red); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); }
.photo { position: relative; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1); touch-action: pan-y; transition: box-shadow .15s, transform .15s; }
.photo .ph-img { aspect-ratio: 4 / 3; background: var(--surface-3) center / cover no-repeat; position: relative; cursor: grab; }
.photo .ph-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.photo .ph-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.photo .ph-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.photo:hover .ph-tools, .photo:focus-within .ph-tools { opacity: 1; }
.photo .ph-tools .btn { height: 28px; width: 28px; padding: 0; background: rgba(0,0,0,.55); border: 0; color: #fff; box-shadow: none; }
.photo .ph-cover { position: absolute; left: 6px; top: 6px; display: none; }
.photo-grid .photo:first-child .ph-cover { display: inline-flex; }
.photo .ph-handle { position: absolute; left: 6px; bottom: 6px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: rgba(0,0,0,.5); color: #fff; cursor: grab; touch-action: none; }
.photo.dragging { opacity: .35; }
.photo.ghost { position: fixed; z-index: 100; pointer-events: none; box-shadow: var(--sh-3); transform: rotate(2deg) scale(1.03); opacity: .95; }
.photo-grid.sorting .photo:not(.dragging) { transition: transform .12s; }
@media (hover: none) { .photo .ph-tools { opacity: 1; } }

/* ---------- 8. Overlays ---------- */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--sh-3); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; }
dialog.modal.lg { width: min(860px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(8, 16, 20, .5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .16s ease-out; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px var(--s5); border-bottom: 1px solid var(--border); }
.modal-h h2, .modal-h h3 { font-size: 16px; flex: 1; }
.modal-b { padding: var(--s5); }
.modal-f { padding: 14px var(--s5); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--s2); background: var(--surface-2); }
.modal-x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 4px 8px; border-radius: 7px; }
.modal-x:hover { background: var(--surface-3); color: var(--text); }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); box-shadow: var(--sh-3); z-index: 80; transform: translateX(105%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.drawer.open { transform: none; }
.drawer-h { padding: 16px var(--s5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.drawer-h h3 { flex: 1; }
.drawer-b { padding: var(--s5); overflow-y: auto; flex: 1; }
.drawer-f { padding: 14px var(--s5); border-top: 1px solid var(--border); display: flex; gap: var(--s2); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 11px; background: #111a1d; color: #fff; box-shadow: var(--sh-3); font-size: 13.5px; animation: toastIn .2s ease-out; border-left: 4px solid var(--brand); }
.toast.success { border-left-color: #22c55e; }
.toast.error { border-left-color: #ef4444; }
.toast.warn { border-left-color: #f59e0b; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.tip { position: relative; display: inline-flex; color: var(--text-3); cursor: help; }
.tip[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #111a1d; color: #fff; padding: 6px 9px; border-radius: 7px; font-size: 12px; font-weight: 500; white-space: normal; width: max-content; max-width: 260px; z-index: 50; line-height: 1.4; }

/* ---------- 9. Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--surface); }
.auth-form { display: flex; flex-direction: column; padding: var(--s6) clamp(20px, 6vw, 80px); }
.auth-form .p-brand { color: var(--text); padding: 0; }
.auth-form .p-brand small { color: var(--text-3); }
.auth-box { width: 100%; max-width: 400px; margin: auto; padding: var(--s6) 0; }
.auth-box h1 { font-size: 28px; letter-spacing: -.025em; margin-bottom: 6px; }
.auth-box .p-sub { margin-bottom: var(--s5); font-size: 14.5px; }
.auth-box form { display: flex; flex-direction: column; gap: var(--s4); }
.auth-foot { font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.auth-art { position: relative; overflow: hidden; background: #0d2b2e; color: #fff; }
.auth-art .slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.4s ease; transform: scale(1.04); }
.auth-art .slide.on { opacity: 1; animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { to { transform: scale(1.12); } }
.auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 30, 32, .15) 30%, rgba(6, 30, 32, .85)); }
.auth-quote { position: absolute; left: clamp(24px, 5vw, 56px); right: clamp(24px, 5vw, 56px); bottom: clamp(24px, 5vw, 56px); z-index: 2; }
.auth-quote h2 { font-size: clamp(22px, 2.4vw, 32px); letter-spacing: -.02em; line-height: 1.2; margin-bottom: 10px; font-weight: 700; }
.auth-quote p { color: rgba(255, 255, 255, .8); max-width: 480px; }
.auth-quote .pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.auth-quote .pills span { padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); font-size: 12.5px; font-weight: 600; border: 1px solid rgba(255,255,255,.18); }
.pw-field { position: relative; }
.pw-field .input { padding-right: 42px; }
.pw-field .pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: 30px; width: 34px; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: 7px; }
.pw-field .pw-toggle:hover { background: var(--surface-3); color: var(--text); }

/* ---------- 10. Utilities ---------- */
.muted { color: var(--text-3); } .text-2 { color: var(--text-2); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.strong { font-weight: 650; } .mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-right { text-align: right; } .text-center { text-align: center; }
.tnum { font-variant-numeric: tabular-nums; }
.c-green { color: var(--green); } .c-red { color: var(--red); } .c-amber { color: var(--amber); } .c-brand { color: var(--brand); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: var(--s1); } .mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); } .mt-5 { margin-top: var(--s5); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--s2); } .mb-3 { margin-bottom: var(--s3); } .mb-4 { margin-bottom: var(--s4); } .mb-5 { margin-bottom: var(--s5); }
.ml-auto { margin-left: auto; }
.gap-1 { gap: var(--s1); } .gap-3 { gap: var(--s3); } .gap-4 { gap: var(--s4); }
.flex { display: flex; } .items-center { align-items: center; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hide { display: none !important; }
.divider { height: 1px; background: var(--border); margin: var(--s4) 0; }
.villa-no { font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--sand-50); color: #9a5a22; border: 1px solid color-mix(in srgb, var(--sand) 45%, transparent); white-space: nowrap; }
.dot-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot-status.green { background: var(--green); } .dot-status.amber { background: var(--amber); } .dot-status.red { background: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .p-shell { grid-template-columns: minmax(0, 1fr); }
  .p-side { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--sh-3); }
  body.nav-open .p-side { transform: none; }
  body.nav-open .p-overlay { display: block; position: fixed; inset: 0; background: rgba(8, 16, 20, .45); z-index: 35; }
  .p-burger { display: inline-grid; }
  .grid.g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
}
@media (max-width: 720px) {
  .p-content { padding: var(--s4); }
  .p-top { padding: 0 var(--s4); }
  .grid.g-2, .grid.g-3, .form-grid, .form-grid.g-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid .span-2 { grid-column: auto; }
  .card-b { padding: var(--s4); }
  .card-h { padding: 12px var(--s4); }
  .card-f { padding: 12px var(--s4); }
  .list > li { padding: 12px var(--s4); }
  .menu-who { display: none; }
  .p-head { margin-bottom: var(--s4); }
  .p-head .p-actions { width: 100%; }
  .stat-value { font-size: 22px; }
  .sticky-actions { margin: var(--s4) calc(-1 * var(--s4)) calc(-1 * var(--s4)); padding: 10px var(--s4); }
  .repeater-row { grid-template-columns: 1fr 1fr; }
  .toolbar .input, .toolbar .select { flex: 1 1 140px; }
  .hide-sm { display: none !important; }
  .chart-donut svg { width: 150px; }
}
@media (max-width: 420px) {
  .grid.g-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid.g-4 { grid-template-columns: minmax(0, 1fr); }
  .p-top-title { display: none; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 19px; }
}
@media print {
  .p-side, .p-top, .p-actions, .toolbar, .pagination { display: none !important; }
  .p-shell { display: block; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ==========================================================================
   11+. Page-specific sections (append below)
   ========================================================================== */

/* ===== merged: villas ===== */
/* ---------- 11. Owner › Villas (list + editor) ---------- */
.villa-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--s4); }
.villa-card { display: flex; flex-direction: column; overflow: hidden; }
.vc-cover { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.vc-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.villa-card:hover .vc-cover img { transform: scale(1.04); }
.vc-nophoto { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--text-3); background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface-3) 10px 20px); }
.vc-status { position: absolute; left: 10px; top: 10px; box-shadow: var(--sh-2); }
.vc-no { position: absolute; right: 10px; top: 10px; background: rgba(255, 255, 255, .92); color: #7a4515; }
.vc-body { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: var(--s4); }
.vc-body h3 { font-size: 15.5px; }
.vc-body h3 a { color: var(--text); }
.vc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 4px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.vc-metrics div { display: flex; flex-direction: column; min-width: 0; }
.vc-metrics b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-metrics small { color: var(--text-3); font-size: 11.5px; }
.vc-complete { display: flex; flex-direction: column; gap: 5px; margin-top: auto; padding-top: 6px; }
.vc-actions { gap: 6px; }
.vc-actions .btn-ghost:last-child { margin-left: auto; }

.created-banner { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); background: linear-gradient(90deg, var(--green-bg), var(--surface) 70%); }
.created-banner h2 { font-size: 16px; margin-bottom: 2px; }
.created-banner .cb-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: #fff; flex: none; }
.created-banner .cb-no { text-align: center; }
.created-banner .cb-no small { display: block; color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.created-banner .cb-no button { font: 800 22px var(--mono); letter-spacing: .06em; color: #9a5a22; background: var(--sand-50); border: 1px dashed var(--sand); border-radius: 10px; padding: 6px 14px; cursor: copy; }
button.villa-no { cursor: copy; font-family: var(--mono); }

.complete-strip .cs-meter { width: min(260px, 100%); display: flex; flex-direction: column; gap: 6px; }
.complete-strip .badge { margin: 2px 0; }
.complete-strip .grow { flex: 1 1 240px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }

.combo { position: relative; }
.combo-list { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-3); }
.combo-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.combo-list li small { color: var(--text-3); white-space: nowrap; }
.combo-list li:hover, .combo-list li.hl { background: var(--brand-50); color: var(--brand); }
.combo-list .combo-empty { cursor: default; color: var(--text-3); }
.combo-list .combo-empty:hover { background: none; color: var(--text-3); }

.mp-view { position: relative; height: 320px; overflow: hidden; border-radius: var(--r); border: 1px solid var(--border-strong); background: #dfe7ea; cursor: crosshair; touch-action: none; user-select: none; }
.mp-view.dragging { cursor: grabbing; }
.mp-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.mp-marker { position: absolute; width: 28px; height: 28px; margin: -28px 0 0 -14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--sand); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); pointer-events: none; z-index: 2; }
.mp-marker::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.mp-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; z-index: 3; }
.mp-zoom .btn { font-size: 16px; font-weight: 700; }
.mp-attr { position: absolute; right: 0; bottom: 0; font-size: 10px; padding: 1px 6px; background: rgba(255, 255, 255, .8); color: #333; z-index: 3; border-top-left-radius: 6px; }
[data-gmaps].disabled { opacity: .45; pointer-events: none; }

.switch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 20px; }
.switch-grid .switch { align-items: flex-start; }
.switch-grid .switch input { margin-top: 1px; }

.seo-box { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); }
.seo-box summary { cursor: pointer; font-weight: 600; font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.translate-box .btn { white-space: nowrap; }

.feat-item { display: flex; flex-direction: column; gap: 6px; }
.feat-item .check span { display: inline-flex; align-items: center; gap: 6px; }
.feat-item .check .i { color: var(--text-3); }
.feat-item .feat-note { display: none; }
.feat-item:has(input[type=checkbox]:checked) .feat-note { display: block; }
.feat-item:has(input[type=checkbox]:checked) .check .i { color: var(--brand); }

.villa-editor .tab-pane .card + .card { margin-top: 0; }
.photos-empty { padding: var(--s5); }
.dz-extra .select { min-width: 150px; }

@media (max-width: 720px) {
  .villa-cards { grid-template-columns: minmax(0, 1fr); }
  .mp-view { height: 260px; }
  .created-banner .card-b { flex-direction: column; align-items: flex-start; }
  .vc-actions .btn-ghost:last-child { margin-left: 0; }
}

/* ===== merged: calendar ===== */
/* ---------- 11. Owner calendar & pricing (owner-calendar.js) ---------- */
:root {
  --st-available: #f2faf6; --st-booked: #f6c9c6; --st-option: #fbe3b5; --st-closed: #dde1e6; --st-past: #f3f4f6;
  --st-fg-booked: #8f1d1d; --st-fg-option: #7a4a06; --st-fg-closed: #4b5563;
  --sz0: #0f8b8d; --sz1: #e07b39; --sz2: #2a78d6; --sz3: #c2457a; --sz4: #6250d6; --sz5: #7d8f12; --sz6: #b8860b; --sz7: #4b8f5a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --st-available: #14231d; --st-booked: #4a1f22; --st-option: #45360f; --st-closed: #2a3138; --st-past: #181d21; --st-fg-booked: #ffc9c4; --st-fg-option: #ffe0a3; --st-fg-closed: #b6c0c8; }
}
:root[data-theme="dark"] { --st-available: #14231d; --st-booked: #4a1f22; --st-option: #45360f; --st-closed: #2a3138; --st-past: #181d21; --st-fg-booked: #ffc9c4; --st-fg-option: #ffe0a3; --st-fg-closed: #b6c0c8; }

.cal-layout { align-items: start; }
.cal-nav { display: flex; gap: 4px; margin-left: auto; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; align-items: center; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .lg { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); display: inline-block; }
.lg-available { background: var(--st-available); } .lg-booked { background: var(--st-booked); } .lg-option { background: var(--st-option); } .lg-closed { background: var(--st-closed); }
.lg-change { background: linear-gradient(135deg, var(--st-booked) 50%, var(--st-available) 50%); }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sand); display: inline-block; box-shadow: 0 0 0 2px var(--surface); }
.cal-hint { margin: 0 0 12px; }
.cal-hint.on { color: var(--brand); font-weight: 650; }

.cal-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px 18px; max-height: 1180px; overflow-y: auto; padding: 2px 4px 4px 2px; user-select: none; -webkit-user-select: none; transition: opacity .15s; }
.cal-months.is-loading { opacity: .5; pointer-events: none; }
.cal-loading { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: var(--text-3); padding: 40px 0; justify-content: center; }
.cal-month h4 { font-size: 13.5px; text-transform: capitalize; margin: 0 0 6px; font-weight: 650; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd span { font-size: 10.5px; color: var(--text-3); text-align: center; text-transform: uppercase; letter-spacing: .03em; padding-bottom: 2px; }
.cd {
  position: relative; aspect-ratio: 1 / 1.04; border-radius: 7px; min-width: 0; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, var(--a, var(--st-available)) 50%, var(--b, var(--st-available)) 50%);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; transition: box-shadow .1s, transform .1s;
  touch-action: manipulation;
}
.cd:not(.split) { background: var(--b, var(--st-available)); }
.cd.blank { background: none; border: 0; cursor: default; }
.cd b { font-size: 12.5px; font-weight: 650; }
.cd em { font-style: normal; font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; margin-top: 1px; max-width: 100%; overflow: hidden; white-space: nowrap; }
.cd.st-booked:not(.split) b, .cd.st-booked:not(.split) em { color: var(--st-fg-booked); }
.cd.st-option:not(.split) b, .cd.st-option:not(.split) em { color: var(--st-fg-option); }
.cd.st-closed:not(.split) b, .cd.st-closed:not(.split) em { color: var(--st-fg-closed); }
.cd.st-booked:not(.split) em, .cd.st-closed:not(.split) em { opacity: .7; }
.cd:hover:not(.blank):not(.past) { box-shadow: 0 0 0 2px var(--brand) inset; }
.cd .sz { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.sz0 { background: var(--sz0); } .sz1 { background: var(--sz1); } .sz2 { background: var(--sz2); } .sz3 { background: var(--sz3); }
.sz4 { background: var(--sz4); } .sz5 { background: var(--sz5); } .sz6 { background: var(--sz6); } .sz7 { background: var(--sz7); }
.cd.ov::after { content: ""; position: absolute; bottom: 6px; left: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--sand); box-shadow: 0 0 0 1.5px var(--surface); }
.cd .nt { position: absolute; top: 3px; left: 3px; width: 0; height: 0; border-top: 7px solid var(--brand); border-right: 7px solid transparent; }
.cd .mn { position: absolute; top: 2px; right: 3px; line-height: 1; font-size: 8.5px; font-weight: 700; color: var(--text-3); }
.cd.no-ci b { text-decoration: underline dotted; text-underline-offset: 2px; }
.cd.past { opacity: .42; cursor: not-allowed; filter: grayscale(.4); }
.cd.today { box-shadow: 0 0 0 2px var(--sand) inset; }
.cd.sel { box-shadow: 0 0 0 2px var(--brand) inset; transform: scale(.94); }
.cd.sel::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--brand) 22%, transparent); }
.cd.sel-s, .cd.sel-e { box-shadow: 0 0 0 3px var(--brand) inset; transform: none; }

/* Drawer content */
.sel-summary { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.sel-dates { font-weight: 700; font-size: 15px; }
.sel-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.sel-status { display: flex; flex-wrap: wrap; gap: 4px; }
.st-badge.st-available { background: var(--green-bg); color: var(--green); }
.st-badge.st-booked { background: var(--st-booked); color: var(--st-fg-booked); }
.st-badge.st-option { background: var(--st-option); color: var(--st-fg-option); }
.st-badge.st-closed { background: var(--st-closed); color: var(--st-fg-closed); }
.st-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.st-opt { position: relative; cursor: pointer; }
.st-opt input { position: absolute; opacity: 0; pointer-events: none; }
.st-opt span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--border-strong); font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface); text-align: center; }
.st-opt span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--surface-3); flex: none; }
.st-available span::before { background: var(--st-available); } .st-booked span::before { background: var(--st-booked); }
.st-option span::before { background: var(--st-option); } .st-closed span::before { background: var(--st-closed); }
.st-keep span::before { display: none; }
.st-opt input:checked + span { border-color: var(--brand); color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--ring); }
.st-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Price preview */
.quote-out .spinner { margin: 12px auto; display: block; }
.q-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.q-table td { padding: 6px 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
.q-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 10px; }
.q-table .q-sub td { font-weight: 600; }
.q-table .q-disc td { color: var(--green); }
.q-table .q-total td { font-size: 16px; font-weight: 750; border-bottom: 0; padding-top: 10px; }
.q-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.q-note { font-size: 11.5px; color: var(--text-3); margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.q-alts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; align-items: flex-start; }
.cal-how { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }

/* Season timeline */
.tl { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; margin-bottom: 14px; }
.tl-year { font-weight: 700; font-size: 13px; color: var(--text-2); }
.tl-track { position: relative; height: 40px; border-radius: 8px; background: var(--surface-3); margin-top: 14px; }
.tl-month { position: absolute; top: -16px; font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; transform: translateX(2px); }
.tl-month::before { content: ""; position: absolute; left: -2px; top: 14px; height: 42px; width: 1px; background: var(--border); }
.tl-seg { position: absolute; top: 5px; bottom: 5px; border: 0; border-radius: 6px; color: #fff; font: 600 11px var(--font); padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; display: flex; align-items: center; min-width: 4px; box-shadow: 0 0 0 1.5px var(--surface); opacity: .92; }
.tl-seg:hover { opacity: 1; z-index: 2; box-shadow: 0 0 0 2px var(--text); }
.tl-seg span { overflow: hidden; text-overflow: ellipsis; }
.tl-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--red); border-radius: 2px; z-index: 3; }
.sz-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.table tr.is-past td { opacity: .6; }
.tpl-table input { text-align: right; }
.divider-or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

@media (max-width: 720px) {
  .cal-months { grid-template-columns: minmax(0, 1fr); max-height: none; overflow: visible; }
  .cd b { font-size: 13px; }
  .cd em { font-size: 10.5px; }
  .tl { grid-template-columns: 1fr; gap: 2px; }
  .tl-month:nth-child(even) { display: none; }
  .cal-nav { margin-left: 0; width: 100%; }
}
.cd b, .cd em { position: relative; z-index: 1; }

/* ===== merged: promo ===== */
/* ---------- 11. Campaigns ---------- */
.camp-list { display: flex; flex-direction: column; gap: var(--s3); }
.camp-card { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--s5); }
.camp-card.state-expired, .camp-card.state-paused { opacity: .78; }
.camp-card-badge { --badge: var(--sand); flex: none; width: 92px; min-height: 64px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; color: #fff; background: var(--badge); text-align: center; font-weight: 800; font-size: 15px; letter-spacing: -.01em; line-height: 1.15; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.camp-card-badge span { overflow-wrap: anywhere; }
.camp-card-badge .i { opacity: .9; }
.camp-card-main { flex: 1; min-width: 0; }
.camp-card-main h3 { font-size: 15px; max-width: 100%; }
.camp-sentence { color: var(--text-2); margin: 4px 0 6px; font-size: 13.5px; }
.camp-sentence.lg { font-size: 15px; color: var(--text); line-height: 1.5; min-height: 2.6em; }
.camp-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-3); }
.camp-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.camp-card-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.camp-card-actions form { display: inline-flex; }
.camp-types-help { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.camp-type-mini { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 10px; color: var(--text); border: 1px solid var(--border); background: var(--surface); }
.camp-type-mini:hover { text-decoration: none; border-color: var(--brand); }
.camp-type-mini .i { color: var(--brand); margin-top: 2px; }
.camp-type-mini b { display: block; font-size: 13px; }
.camp-type-mini small { color: var(--text-3); font-size: 12px; line-height: 1.35; display: block; }

.camp-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.camp-type { position: relative; cursor: pointer; }
.camp-type input { position: absolute; opacity: 0; pointer-events: none; }
.camp-type-box { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 12px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); transition: border-color .12s, box-shadow .12s, background .12s; }
.camp-type-box b { font-size: 13.5px; }
.camp-type-box small { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.camp-type-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); margin-bottom: 4px; }
.camp-type:hover .camp-type-box { border-color: var(--border-strong); }
.camp-type input:checked + .camp-type-box { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--ring); }
.camp-type input:checked + .camp-type-box .camp-type-ico { background: var(--brand); color: #fff; }
.camp-type input:focus-visible + .camp-type-box { outline: 2px solid var(--brand); outline-offset: 2px; }

.camp-side { position: sticky; top: calc(var(--top-h) + 16px); align-self: start; }
.camp-badge-preview { padding: 18px; border-radius: 12px; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); margin-bottom: 12px; min-height: 76px; display: flex; align-items: flex-start; }
.camp-badge-preview .badge-pill { display: inline-block; color: #fff; font-weight: 800; font-size: 13px; padding: 5px 11px; border-radius: 8px; box-shadow: var(--sh-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .15s; }
.color-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.color-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.color-dot:hover { transform: scale(1.1); }
.camp-sim-out { padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.camp-sim-out.good { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); background: var(--green-bg); }
.camp-sim-out.bad { border-color: color-mix(in srgb, var(--red) 35%, var(--border)); background: var(--red-bg); color: var(--red); }
.camp-sim-out p { margin-bottom: 8px; }
.camp-sim-out .kv { grid-template-columns: 1fr max-content; }
.camp-sim-out .kv dd { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 12. Ads ---------- */
.ad-credit { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; background: var(--sand-50); border: 1px solid color-mix(in srgb, var(--sand) 40%, transparent); color: #9a5a22; }
.ad-credit small { display: block; font-size: 11.5px; color: var(--text-3); }
.ad-credit b { font-size: 15px; color: var(--text); }
.ad-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.ad-product { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); transition: box-shadow .15s, transform .15s, border-color .15s; }
.ad-product:hover { box-shadow: var(--sh-3); transform: translateY(-2px); border-color: var(--border-strong); }
.ad-product .ad-art { border-radius: 0; border-width: 0 0 1px; }
.ad-product-b { padding: 14px 16px 6px; flex: 1; }
.ad-product-b h3 { font-size: 15px; }
.ad-product-b p { margin: 6px 0 8px; }
.ad-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.ad-facts li { display: flex; gap: 6px; align-items: center; }
.ad-product-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.ad-price b { font-size: 18px; letter-spacing: -.02em; }
.ad-price small { color: var(--text-3); margin-left: 3px; }

/* Placement schematic */
.ad-art { --hl: var(--sand); background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; display: flex; flex-direction: column; }
.ad-art-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.ad-art-bar i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.ad-art-bar span { flex: 1; height: 8px; margin-left: 8px; border-radius: 4px; background: var(--surface-3); }
.ad-art-body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.ad-art i, .ad-art b, .ad-art span, .ad-art em { display: block; font-style: normal; }
.ad-art .ad-c { flex: 1; min-height: 22px; border-radius: 4px; background: var(--surface); box-shadow: inset 0 -8px 0 var(--border); position: relative; }
.ad-art .ad-row { display: flex; gap: 5px; flex: 1; }
.ad-art .ad-hero { flex: 2.2; border-radius: 5px; background: linear-gradient(135deg, #8fb9bb, #cbb39b); position: relative; }
.ad-art .ad-hero.sm { flex: 1.2; opacity: .55; }
.ad-art .ad-hero b { position: absolute; left: 10%; bottom: 18%; width: 40%; height: 10%; border-radius: 3px; background: rgba(255,255,255,.85); }
.ad-art .ad-spot { flex: 1.6; display: flex; gap: 6px; padding: 5px; border-radius: 5px; background: var(--surface); }
.ad-art .ad-spot i { flex: 1.3; border-radius: 4px; background: linear-gradient(135deg, #8fb9bb, #cbb39b); }
.ad-art .ad-spot span { flex: 1; border-radius: 3px; background: repeating-linear-gradient(180deg, var(--border) 0 4px, transparent 4px 9px); }
.ad-art .ad-title { display: flex; align-items: center; gap: 6px; height: 14px; }
.ad-art .ad-title b { width: 45%; height: 8px; border-radius: 3px; background: var(--border-strong); }
.ad-art .ad-chip { width: 16px; height: 16px; display: grid !important; place-items: center; border-radius: 4px; background: var(--brand); color: #fff; }
.ad-art .ad-chip .i { width: 10px; height: 10px; }
.ad-art .ad-filter { height: 10px; border-radius: 3px; background: var(--surface); width: 70%; }
.ad-art .ad-grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.ad-art .ad-grid .wide { grid-column: span 2; grid-row: span 2; }
.ad-art .with-badge em { position: absolute; top: 3px; left: 3px; width: 46%; height: 8px; border-radius: 3px; }
.ad-art .ad-map { flex: 1; position: relative; border-radius: 5px; background: linear-gradient(160deg, #cfe3e4 0%, #e9e3d4 55%, #d7e6d0 100%); }
.ad-art .ad-map i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.ad-art .ad-map b { position: absolute; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff; }
.ad-art .ad-gallery { flex: 1.6; display: grid; grid-template-columns: 2fr 1fr; gap: 4px; }
.ad-art .ad-gallery i { border-radius: 4px; background: linear-gradient(135deg, #8fb9bb, #cbb39b); opacity: .6; }
.ad-art .ad-lines { display: flex; flex-direction: column; gap: 3px; }
.ad-art .ad-lines span { height: 5px; border-radius: 3px; background: var(--border-strong); width: 80%; }
.ad-art .ad-lines span + span { width: 55%; }
.ad-art .ad-list { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ad-art .ad-list span { flex: 1; border-radius: 4px; background: var(--surface); position: relative; }
.ad-art .ad-list em { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: #fff; font-weight: 800; font-size: 11px; }
.ad-art .hl { background: var(--hl) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--hl) 45%, transparent), 0 0 14px color-mix(in srgb, var(--hl) 60%, transparent); animation: adPulse 2.4s ease-in-out infinite; }
.ad-art .ad-hero.hl { background: linear-gradient(135deg, var(--hl), #f3c99f) !important; }
@keyframes adPulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--hl) 25%, transparent), 0 0 20px color-mix(in srgb, var(--hl) 45%, transparent); } }

/* Buy page */
.ad-summary { position: sticky; top: calc(var(--top-h) + 16px); overflow: hidden; }
.ad-summary .ad-art { border-radius: 0; border-width: 0 0 1px; }
.ad-total { padding-top: 10px; border-top: 1px dashed var(--border); font-size: 15px; }
.ad-total b { font-size: 22px; letter-spacing: -.02em; }
.ad-status { min-height: 22px; font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); }
.ad-status:empty { display: none; }
.ad-status.good { background: var(--green-bg); color: var(--green); }
.ad-status.bad { background: var(--red-bg); color: var(--red); }
.ad-status.warn { background: var(--amber-bg); color: var(--amber); }
.occ-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 3px; min-height: 40px; }
.occ-day { position: relative; height: 34px; border-radius: 6px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; font-size: 10.5px; font-weight: 600; color: var(--text-2); background: var(--green-bg); border: 1px solid transparent; }
.occ-day em { position: absolute; top: 2px; left: 3px; font-size: 8.5px; font-style: normal; text-transform: uppercase; color: var(--text-3); letter-spacing: .02em; }
.occ-day.some { background: var(--amber-bg); }
.occ-day.full { background: var(--red-bg); color: var(--red); text-decoration: line-through; }
.occ-day.sel { border-color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); color: var(--text); }
.occ-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-left: 8px; }
.occ-key.free { background: var(--green-bg); box-shadow: inset 0 0 0 1px var(--green); }
.occ-key.some { background: var(--amber-bg); box-shadow: inset 0 0 0 1px var(--amber); }
.occ-key.full { background: var(--red-bg); box-shadow: inset 0 0 0 1px var(--red); }
.ad-badge-chip.b-deal { --c: #d9433a; } .ad-badge-chip.b-new { --c: #2a78d6; } .ad-badge-chip.b-popular { --c: #e9a56b; }
.ad-badge-chip.b-luxury { --c: #6d3fc0; } .ad-badge-chip.b-last_minute { --c: #c0262d; } .ad-badge-chip.b-family { --c: #15803d; }
.chip input:checked + .ad-badge-chip { background: var(--c); border-color: var(--c); color: #fff; }

/* Order page */
.pay-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s3); }
.pay-opt { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.pay-opt h3 { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.pay-opt form { margin-top: auto; }
.pay-opt.test { border-style: dashed; border-color: color-mix(in srgb, var(--sand) 60%, var(--border)); background: var(--sand-50); }
.pay-opt .kv { grid-template-columns: max-content 1fr; gap: 4px 12px; }

@media (max-width: 720px) {
  .camp-card { flex-wrap: wrap; padding: var(--s4); }
  .camp-card-badge { width: 72px; min-height: 56px; font-size: 13px; }
  .camp-card-actions { width: 100%; justify-content: flex-end; }
  .camp-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .camp-side, .ad-summary { position: static; }
}

/* ===== merged: stats ===== */
/* ---------- 11. Dashboard & Stats (owner) ---------- */
.dash-plan { font-size: 18px; letter-spacing: -.01em; }
.dash-checklist { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; }
.dash-checklist .tick { width: 16px; height: 16px; }
.dash-checklist li.done .tick::after { font-size: 9px; }
.dash-check { align-items: flex-start; }

.stats-filters { padding: 10px 12px; position: sticky; top: calc(var(--top-h) + 8px); z-index: 25; box-shadow: var(--sh-2); }
.stats-filters .seg button { white-space: nowrap; }
.stats-custom { gap: 6px; }
.stats-custom .input { width: 150px; min-width: 0; }
.stats-villas > summary { list-style: none; }
.stats-villas > summary::-webkit-details-marker { display: none; }
.stats-villa-pop { left: 0; right: auto; min-width: 260px; max-height: 340px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.stats-villa-pop .check small { color: var(--text-3); font-family: var(--mono); font-size: 11px; margin-left: 4px; display: inline; }
.chart.chart-sm { min-height: 120px; }

/* Funnel */
.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.funnel-step { display: flex; flex-direction: column; align-items: center; }
.funnel-bar {
  width: var(--w); min-width: 150px; max-width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 600;
  background: color-mix(in srgb, var(--brand) calc(var(--o) * 100%), var(--sand));
  transition: width .4s ease;
}
.funnel-bar b { font-size: 15px; }
.funnel-rate { font-size: 11.5px; color: var(--text-3); padding: 2px 0 0; font-weight: 600; }
.funnel-rate::before { content: "↓ "; }

/* Hours heatmap: single-hue sequential ramp from surface → brand */
.heatmap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.hm-cell { aspect-ratio: 1 / 1; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10.5px; line-height: 1.15; color: var(--text-2); cursor: default; min-width: 0; }
.hm-cell span { opacity: .75; }
.hm-cell b { font-size: 11px; }
.hm-0 { background: var(--surface-3); }
.hm-1 { background: color-mix(in srgb, var(--brand) 15%, var(--surface)); }
.hm-2 { background: color-mix(in srgb, var(--brand) 32%, var(--surface)); }
.hm-3 { background: color-mix(in srgb, var(--brand) 52%, var(--surface)); }
.hm-4 { background: color-mix(in srgb, var(--brand) 74%, var(--surface)); color: #fff; }
.hm-5 { background: var(--brand); color: #fff; }
:root[data-theme="dark"] .hm-4, :root[data-theme="dark"] .hm-5 { color: #06201f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hm-4, :root:not([data-theme="light"]) .hm-5 { color: #06201f; } }
.hm-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 10px; font-size: 11px; color: var(--text-3); }
.hm-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.hm-legend span { margin: 0 4px; }

@media (max-width: 1024px) { .stats-filters { position: static; } }
@media (max-width: 720px) {
  .heatmap { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stats-custom { width: 100%; }
  .stats-custom .input { flex: 1; width: auto; }
  .stats-filters .switch { margin-left: 0; }
  .funnel-bar { min-width: 100%; }
}

/* ===== merged: account ===== */
/* ---------- 11.x Account pages: inquiries, membership, profile, notifications ---------- */
.inq-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.inq-facts > div { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inq-facts span { font-size: 12px; color: var(--text-3); }
.inq-facts b { font-size: 16px; font-variant-numeric: tabular-nums; }
.inq-facts small { font-size: 12px; color: var(--text-3); }
.inq-message { white-space: normal; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.65; padding: 14px 16px; border-left: 3px solid var(--sand); background: var(--surface-2); border-radius: 0 var(--r) var(--r) 0; }
.inq-status-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.inq-status-opts .chip input[type="radio"] + span::before { content: none; }

.mem-current .stat-value { font-size: 22px; }
.pay-box { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s4); background: var(--surface-2); scroll-margin-top: 80px; }
.pay-box.focus, .pay-box:target { border-color: var(--sand); box-shadow: 0 0 0 3px var(--sand-50); }
.pay-box-h { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s3); flex-wrap: wrap; }
.pay-amount { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.pay-opts { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--s3); }
.pay-opt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--s4); min-width: 0; }
.pay-opt h4 { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 14px; }
.pay-opt.test { border-style: dashed; border-color: color-mix(in srgb, var(--sand) 60%, var(--border)); background: var(--sand-50); }
.pay-opt .kv dd { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pay-opt .kv .btn-icon { height: 24px; width: 24px; font-size: 13px; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.plan { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sh-1); overflow: hidden; }
.plan.hl { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--sh-2); }
.plan.current { background: linear-gradient(180deg, var(--brand-50), var(--surface) 55%); }
.plan h3 { font-size: 17px; }
.plan-ribbon { position: absolute; top: 14px; right: -34px; transform: rotate(45deg); background: var(--sand); color: #3a230f; font-size: 11px; font-weight: 700; padding: 3px 40px; text-transform: uppercase; letter-spacing: .05em; }
.plan-price b { font-size: 28px; letter-spacing: -.03em; }
.plan-price span { color: var(--text-3); font-size: 13px; margin-left: 4px; }
.plan-feats { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; flex: 1; }
.plan-feats li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats .i { color: var(--brand); margin-top: 2px; }

.logo-preview { width: 120px; height: 120px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-ph { font-size: 44px; font-weight: 800; color: var(--brand); }

.notif-list > li { align-items: flex-start; }
.notif-list > li.unread { background: color-mix(in srgb, var(--sand-50) 70%, transparent); }
.notif-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.notif-ico.t-inquiry { background: var(--blue-bg); color: var(--blue); }
.notif-ico.t-ad { background: var(--purple-bg); color: var(--purple); }
.notif-ico.t-membership, .notif-ico.t-payment { background: var(--sand-50); color: #9a5a22; }
.notif-ico.t-villa { background: var(--brand-50); color: var(--brand); }
.notif-title { font-weight: 600; color: var(--text); display: block; }
.notif-list .unread .notif-title { font-weight: 700; }
.notif-list .dot-status { margin-top: 8px; }

@media (max-width: 720px) {
  .inq-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-opts { grid-template-columns: minmax(0, 1fr); }
}

/* ===== Impersonation bar (admin viewing an owner account) ===== */
.p-impersonate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px var(--s5); background: var(--amber-bg); color: var(--amber); border-bottom: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); font-size: 13px; font-weight: 600; }
.p-impersonate a { margin-left: auto; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Donut legend rows */
.chart-donut .chart-legend .lg-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.chart-donut .chart-legend .lg-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.chart-donut .chart-legend b small { font-weight: 500; margin-left: 4px; }
