/* Bar 7 admin. Calm, clear and friendly; light by default with automatic dark mode. */

:root {
  --bg: #f5f4f9;
  --surface: #ffffff;
  --surface-2: #f8f7fc;
  --line: #e7e4ef;
  --line-strong: #d6d1e3;
  --text: #1b1726;
  --muted: #6c6680;
  --brand: #e11d74;
  --brand-2: #7c3aed;
  --brand-soft: #fde7f1;
  --ok: #059669;
  --ok-soft: #d1fae5;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --focus: rgba(225, 29, 116, .25);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 16, 40, .04), 0 4px 16px rgba(20, 16, 40, .05);
  --grad: linear-gradient(135deg, var(--brand), var(--brand-2));
  --sidebar: #15111f;
  --sidebar-text: #c9c3da;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0d16;
    --surface: #181522;
    --surface-2: #1e1a2a;
    --line: #2a2538;
    --line-strong: #3a3350;
    --text: #f1eef9;
    --muted: #a39cb8;
    --brand-soft: rgba(225, 29, 116, .16);
    --ok-soft: rgba(5, 150, 105, .18);
    --warn-soft: rgba(245, 158, 11, .16);
    --danger-soft: rgba(220, 38, 38, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --sidebar: #0b0910;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
img { max-width: 100%; display: block; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.text-ok { color: var(--ok); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- Layout -------------------------------------------------------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 256px; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 18px 14px; z-index: 40; overflow-y: auto;
}
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; text-decoration: none; color: #fff; }
.sidebar__brand small { display: block; color: var(--sidebar-text); font-size: .78rem; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; box-shadow: 0 6px 18px -6px var(--brand); }
.brand-logo { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; flex: none; }
.brand-logo--lg { width: 72px; height: 72px; border-radius: 20px; }
.brand-mark--lg { width: 60px; height: 60px; border-radius: 18px; font-size: 2rem; }
.sidebar__group { margin: 18px 10px 6px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #7d7591; font-weight: 700; }
.sidebar__nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none;
  color: var(--sidebar-text); font-weight: 500; transition: background .15s, color .15s;
}
.sidebar__nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar__nav a.is-active { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar__nav a.is-active .icon { color: #ff5ca8; }
.sidebar__nav .badge { margin-left: auto; font-style: normal; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.sidebar__site { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; font-weight: 600; justify-content: center; }
.sidebar__site:hover { background: rgba(255, 255, 255, .06); }
.sidebar-backdrop { display: none; }

.main { margin-left: 256px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar__title { min-width: 0; }
.topbar__title h1 { font-size: 1.35rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 500; }
.back .icon { width: 15px; height: 15px; }
.back:hover { color: var(--text); }
.topbar__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar__menu { display: none; }
.content { padding: 28px 32px 64px; width: 100%; max-width: 1280px; }

@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.is-open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .sidebar.is-open + .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 8, 18, .5); z-index: 35; }
  .main { margin-left: 0; }
  .topbar { padding: 12px 16px; }
  .topbar__menu { display: inline-flex; }
  .content { padding: 20px 16px 48px; }
}
@media (max-width: 600px) {
  .topbar__end > .btn { padding: 9px 12px; font-size: 0; gap: 0; }
  .topbar__end > .btn .icon { width: 20px; height: 20px; }
}

/* ---- User menu ----------------------------------------------------------- */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .88rem; flex: none; }
.avatar--sm { width: 34px; height: 34px; font-size: .82rem; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; border-radius: 50%; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + 8px); width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(20, 16, 40, .16); padding: 6px; z-index: 50; }
.usermenu__who { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.usermenu__who small { display: block; color: var(--muted); }
.usermenu__panel a, .usermenu__panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; border: 0; background: none; color: var(--text); text-decoration: none; font: inherit; cursor: pointer; text-align: left; }
.usermenu__panel a:hover, .usermenu__panel button:hover { background: var(--surface-2); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 .92rem/1.2 var(--font);
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px var(--brand); }
.btn--primary:hover { background: var(--grad); filter: brightness(1.07); border-color: transparent; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost-danger { background: transparent; border-color: transparent; color: var(--danger); }
.btn--ghost-danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn--dashed { border-style: dashed; background: transparent; color: var(--muted); }
.btn--dashed:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.btn--sm { padding: 7px 12px; font-size: .84rem; }
.btn--lg { padding: 13px 20px; font-size: 1rem; }
.btn--block { width: 100%; }
.btn-stack { display: grid; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.icon-btn--danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn--light { background: rgba(255, 255, 255, .92); color: #333; }
.icon-btn--light:hover { background: #fff; color: #000; }
.push-right { margin-left: auto; }

/* ---- Pills, tabs ---------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .76rem; font-weight: 600; color: var(--muted); font-style: normal; white-space: nowrap; }
.pill--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill--draft { background: var(--warn-soft); color: #b45309; border-color: transparent; }
.pill--brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
@media (prefers-color-scheme: dark) { .pill--draft { color: #fbbf24; } .pill--ok { color: #34d399; } .pill--brand { color: #ff7ab8; } }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { background: var(--text); color: var(--surface); }
.tabs a em { font-style: normal; font-size: .75rem; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tabs a.is-active em { background: rgba(255, 255, 255, .2); color: inherit; }
.tabs--settings { margin-bottom: 18px; }

.search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.search-box input { border: 0; background: none; padding: 10px 0; font: inherit; color: var(--text); outline: none; width: 200px; }
.search-box .icon { color: var(--muted); }

/* ---- Panels -------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel--flush { padding: 0; overflow: hidden; }
.panel--muted { background: var(--surface-2); box-shadow: none; }
.panel--sticky { position: sticky; top: 86px; }
.panel__title { display: flex; align-items: center; gap: 9px; font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.panel__title .icon { color: var(--brand); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel__head h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.panel__head h3 .icon { color: var(--brand); }
.panel__head a { font-size: .86rem; font-weight: 600; text-decoration: none; }
.panel__empty { padding: 28px; text-align: center; color: var(--muted); margin: 0; }
.panel--details summary { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 700; list-style: none; }
.panel--details summary::-webkit-details-marker { display: none; }
.panel--details[open] summary { margin-bottom: 16px; }

.help-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius); background: var(--brand-soft); margin-bottom: 18px; }
.help-banner .icon { color: var(--brand); margin-top: 2px; }
.help-banner p { margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.grid-2 .panel { margin: 0; }

/* ---- Forms --------------------------------------------------------------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; min-width: 0; align-content: start; }
.field:last-child { margin-bottom: 0; }
.field-row > .field { margin-bottom: 16px; }
.ql-editor p, .ql-editor ul, .ql-editor ol, .ql-editor blockquote { margin-bottom: .8em; }
.field__label { font-weight: 600; font-size: .88rem; }
.field__help { color: var(--muted); font-size: .82rem; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font: 400 .95rem/1.4 var(--font); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; }
.input--xl { font-size: 1.35rem !important; font-weight: 700 !important; padding: 12px 14px !important; }
.input--lg { font-size: 1.08rem !important; font-weight: 600 !important; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row--album { grid-template-columns: 2fr 1fr auto; align-items: end; }
@media (max-width: 700px) { .field-row, .field-row--3, .field-row--album { grid-template-columns: 1fr; } }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.input-prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
.input-prefix > span { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); color: var(--muted); font-weight: 600; border-right: 1px solid var(--line); }
.input-prefix input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.input-prefix--sm > span { padding: 0 8px; }
.input-icon { display: flex; align-items: center; gap: 10px; }
.input-icon .icon { color: var(--muted); }
.password-field { display: flex; gap: 8px; }
.color-field { display: flex; align-items: center; gap: 12px; }
.color-field input { width: 52px; height: 42px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; background: var(--surface); cursor: pointer; }

.checks { display: grid; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; margin-bottom: 10px; }
.checks .check { margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.check .icon { width: 16px; height: 16px; color: #f59e0b; vertical-align: -3px; }
.check--sm { font-size: .82rem; margin: 0; gap: 6px; white-space: nowrap; }
.check--sm input { width: 16px; height: 16px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--muted); transition: background .15s, color .15s; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); }
.segmented--wide { max-width: 420px; }

.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:disabled + span { opacity: .5; }
.switch input:focus-visible + span { outline: 3px solid var(--focus); }
.switch-label { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 150px; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.form-actions form { display: contents; }
.form-actions--sticky { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.narrow-form { max-width: 860px; }

/* ---- Editor layout ------------------------------------------------------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.editor-side .panel--sticky { z-index: 2; }
@media (max-width: 1100px) { .editor-layout { grid-template-columns: 1fr; } .panel--sticky { position: static; } }

.editor { background: var(--surface); }
.ql-toolbar.ql-snow { border: 1px solid var(--line-strong); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface-2); font-family: var(--font); padding: 8px; position: sticky; top: 70px; z-index: 3; }
.ql-container.ql-snow { border: 1px solid var(--line-strong); border-top: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); font: 400 1rem/1.65 var(--font); }
.ql-editor { min-height: 220px; padding: 16px 18px; color: var(--text); }
.ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.ql-editor img { border-radius: 8px; }
.ql-snow .ql-stroke { stroke: var(--muted); }
.ql-snow .ql-fill { fill: var(--muted); }
.ql-snow .ql-picker { color: var(--muted); }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--brand); }
.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--brand); }
.ql-snow .ql-picker-options { background: var(--surface); border-color: var(--line) !important; }
.ql-snow .ql-tooltip { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .15); border-radius: 10px; z-index: 5; }
.ql-snow .ql-tooltip input[type=text] { width: 220px !important; padding: 6px 10px !important; }

/* ---- Image field --------------------------------------------------------- */
.image-field__preview { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px dashed var(--line-strong); display: grid; place-items: center; }
.image-field__preview img { width: 100%; height: 100%; object-fit: cover; }
.image-field__placeholder { display: none; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.image-field__preview.is-empty .image-field__placeholder { display: flex; }
.image-field__actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Tables & lists ------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.is-dim { opacity: .55; }
.table tr.sortable-ghost { opacity: .4; background: var(--brand-soft); }
.w-handle { width: 36px; padding-right: 0 !important; }
.w-actions { width: 1%; white-space: nowrap; text-align: right; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.handle { display: inline-grid; place-items: center; width: 28px; height: 32px; color: var(--muted); cursor: grab; border-radius: 6px; flex: none; touch-action: none; }
.handle:hover { background: var(--surface-2); color: var(--text); }
.cell-title { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.cell-title small { display: block; }
.cell-title:hover b { color: var(--brand); }
.type-dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); flex: none; }
@media (max-width: 800px) { .hide-md { display: none; } }
@media (max-width: 600px) { .hide-sm { display: none; } .table td, .table th { padding: 10px; } }

.list { list-style: none; margin: 0; padding: 0; }
.list__row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; text-decoration: none; color: var(--text); }
.list__row:hover { background: var(--surface-2); }
.list__main { flex: 1; min-width: 0; }
.list__main b, .list__main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__main small { color: var(--muted); }
.list__row.is-unread b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 8px; vertical-align: 2px; }
.list--messages .list__row { padding: 14px 18px; border-radius: 0; border-bottom: 1px solid var(--line); }
.list--messages li:last-child .list__row { border-bottom: 0; }
.list--messages .list__main b { white-space: normal; }

.datebox { width: 50px; flex: none; text-align: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); padding: 6px 0; line-height: 1.1; }
.datebox small { display: block; font-size: .66rem; text-transform: uppercase; font-weight: 700; letter-spacing: .06em; }
.datebox b { font-size: 1.15rem; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.timeline li { padding-left: 16px; position: relative; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--text); background: var(--surface); font-weight: 600; }
.pager a.is-active { background: var(--text); color: var(--surface); }

/* ---- Dashboard ----------------------------------------------------------- */
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.welcome h2 { font-size: 1.6rem; margin-bottom: 4px; }
.welcome p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.stat__icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--grad); color: #fff; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat small { color: var(--muted); }
.h-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 12px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 28px; }
.quick__item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .15s, background .15s; }
.quick__item:hover { border-color: var(--brand); background: var(--brand-soft); }
.quick__item small { display: block; color: var(--muted); font-size: .82rem; }
.quick__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.quick__arrow { margin-left: auto; color: var(--muted); }

/* ---- Website stats ------------------------------------------------------- */
.live { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.live.is-on { color: var(--text); }
.live.is-on i { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.stats--report { margin-bottom: 18px; }
.stats--report .stat { align-items: flex-start; }
.stats--report .stat:hover { transform: none; border-color: var(--line); }
.trend { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: .78rem; font-style: normal; font-weight: 600; color: var(--muted); }
.trend .icon { width: 15px; height: 15px; }
.trend--up { color: var(--ok); }
.trend--down { color: var(--danger); }
.tabs--sm { padding: 3px; }
.tabs--sm a { padding: 5px 11px; font-size: .82rem; }
@media (max-width: 600px) { .panel__head:has(.tabs--sm) { flex-wrap: wrap; } }

.chart { position: relative; height: 260px; margin: 8px 0 4px; }
.chart__grid { position: absolute; inset: 0 0 26px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart__grid span { position: relative; height: 0; border-top: 1px solid var(--line); }
.chart__grid span:last-child { border-top-color: var(--line-strong); }
.chart__grid em { position: absolute; left: 0; top: -9px; width: 34px; text-align: right; font-size: .72rem; font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart__bars { position: absolute; inset: 0 0 26px 42px; display: flex; }
.chart__col { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; }
.chart__col[data-tip] { cursor: crosshair; }
.chart__col.is-hover { background: var(--surface-2); }
.chart__col i { display: block; width: 100%; max-width: 44px; min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; }
.chart__col.is-hover i { background: var(--brand-2); }
.chart__col small { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font-size: .72rem; color: var(--muted); white-space: nowrap; }
.chart__tip { position: absolute; top: -6px; z-index: 5; display: grid; gap: 2px; padding: 9px 12px; background: var(--text); color: var(--surface); border-radius: 10px; font-size: .8rem; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.chart__tip span { opacity: .75; }
.chart__tip span.is-key { opacity: 1; font-weight: 600; }
.chart-table { margin-top: 18px; }
.chart-table summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--muted); }
.chart-table .table { margin-top: 10px; font-size: .88rem; }
@media (max-width: 600px) { .chart { height: 200px; } .chart__col small { font-size: .66rem; } }

.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rank li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 9px; isolation: isolate; }
.rank li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--brand-soft); border-radius: 9px; z-index: -1; }
.rank__main { min-width: 0; display: grid; }
.rank__main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__main b .icon { width: 16px; height: 16px; color: var(--muted); vertical-align: -3px; margin-right: 4px; }
.rank__main a, .rank__main small { color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.rank__main a:hover { color: var(--brand); }
.rank__n { font-weight: 700; font-variant-numeric: tabular-nums; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.plain-list code { font-size: .82rem; background: var(--surface); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); }

/* ---- Page type chooser --------------------------------------------------- */
.intro { margin-bottom: 22px; }
.intro h2 { font-size: 1.4rem; margin-bottom: 4px; }
.intro p { margin: 0; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.type-card { display: grid; gap: 8px; align-content: start; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.type-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: 0 14px 30px -16px var(--brand); }
.type-card b { font-size: 1.08rem; }
.type-card__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; margin-bottom: 6px; }
.type-card__icon .icon { width: 24px; height: 24px; }

/* ---- Tiles (price lists, roles) ----------------------------------------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tile { display: grid; gap: 6px; align-content: start; justify-items: start; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--brand); transform: translateY(-2px); }
.tile b { font-size: 1.05rem; }
.tile__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.tile__icon--brand { background: var(--grad); color: #fff; }
.tile__meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ---- Events list --------------------------------------------------------- */
.cards-list { display: grid; gap: 10px; }
.event-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .15s; }
.event-row:hover { border-color: var(--brand); }
.event-row__thumb { width: 72px; height: 52px; border-radius: 10px; overflow: hidden; flex: none; background: linear-gradient(135deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 60) 75% 50%)); }
.event-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.event-row__main { flex: 1; min-width: 0; }
.event-row__main b { display: flex; align-items: center; gap: 6px; }
.event-row__main small { display: block; color: var(--muted); }
.event-row__meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.star .icon { width: 15px; height: 15px; color: #f59e0b; fill: #f59e0b; }
@media (max-width: 640px) { .event-row__thumb, .event-row__meta { display: none; } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 36px 0 14px; flex-wrap: wrap; }
.section-head .h-section { margin-bottom: 4px; }
.section-head p { margin: 0; max-width: 70ch; }
.event-row.is-dim { opacity: .55; }
.day-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.day-picker input { position: absolute; opacity: 0; pointer-events: none; }
.day-picker span { display: inline-grid; place-items: center; min-width: 56px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong); font-weight: 600; cursor: pointer; color: var(--muted); background: var(--surface); }
.day-picker input:checked + span { background: var(--grad); color: #fff; border-color: transparent; }
.day-picker input:focus-visible + span { outline: 3px solid var(--focus); }

/* ---- Price builder ------------------------------------------------------- */
.price-builder__section { padding: 18px; }
.price-builder__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.price-builder__meta { margin-bottom: 8px; }
.price-builder__items { display: grid; gap: 6px; margin-bottom: 10px; }
.price-builder__item { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.price-builder__item.sortable-ghost, .price-builder__section.sortable-ghost { opacity: .4; }
.price-builder__fields {
  flex: 1; display: grid; gap: 6px; align-items: center; min-width: 0;
  grid-template-columns: minmax(0, 1fr) 96px 96px 110px auto;
  grid-template-areas: "name p1 p2 tag stock" "desc desc desc desc desc";
}
.price-builder__fields input { padding: 8px 10px !important; font-size: .9rem !important; }
.price-builder__fields .pb-name { grid-area: name; font-weight: 600 !important; }
.price-builder__fields .pb-desc { grid-area: desc; font-size: .84rem !important; color: var(--muted); }
.price-builder__fields .pb-tag { grid-area: tag; }
.price-builder__fields > .input-prefix:nth-of-type(1) { grid-area: p1; }
.price-builder__fields > [data-col2] { grid-area: p2; }
.price-builder__fields > .check { grid-area: stock; }
.price-builder__item.no-col2 [data-col2] { visibility: hidden; }
@media (max-width: 700px) {
  .price-builder__fields { grid-template-columns: 1fr 1fr; grid-template-areas: "name name" "desc desc" "p1 p2" "tag stock"; }
}

/* ---- Albums & photos ----------------------------------------------------- */
.album-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.album-tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.album-tile:hover { transform: translateY(-3px); border-color: var(--brand); }
.album-tile__img { display: grid; place-items: center; aspect-ratio: 4 / 3; background: linear-gradient(135deg, hsl(var(--h) 70% 60%), hsl(calc(var(--h) + 50) 70% 45%)); color: #fff; }
.album-tile__img .icon { width: 36px; height: 36px; opacity: .8; }
.album-tile__img img { width: 100%; height: 100%; object-fit: cover; }
.album-tile__body { display: block; padding: 12px 14px; }
.album-tile__body b, .album-tile__body small { display: block; }
.album-tile__pill { position: absolute; top: 10px; right: 10px; }
.album-form { margin-bottom: 18px; }
.album-form .segmented { margin-bottom: 0; }

.dropzone { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 34px 20px; border: 2px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 16px; background: var(--surface); }
.dropzone .icon { width: 32px; height: 32px; color: var(--brand); }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone--compact { padding: 22px; }
.upload-progress { margin: -6px 0 16px; }
.upload-progress__bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.upload-progress__bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s; }
.upload-progress small { color: var(--muted); }

.photo-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 12px; }
.photo-admin { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 2px solid transparent; cursor: grab; }
.photo-admin.is-cover { border-color: #f59e0b; }
.photo-admin img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-admin__tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.photo-admin:hover .photo-admin__tools, .photo-admin.is-cover .photo-admin__tools { opacity: 1; }
.photo-admin.is-cover [data-photo-cover] { background: #f59e0b; color: #fff; }
.photo-admin__caption { border: 0 !important; border-radius: 0 !important; border-top: 1px solid var(--line) !important; font-size: .82rem !important; padding: 7px 9px !important; }
.photo-admin.sortable-ghost { opacity: .35; }
@media (hover: none) { .photo-admin__tools { opacity: 1; } }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-item { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.media-item figcaption { padding: 8px; display: grid; gap: 4px; }
.media-item input { font-size: .82rem !important; padding: 6px 8px !important; }
.media-item__tools { display: flex; justify-content: flex-end; gap: 2px; }

/* Media picker modal */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(10, 8, 18, .55); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal__box { width: min(920px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 1.1rem; }
.modal__body { padding: 18px 20px; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal__box--sm { width: min(440px, 100%); }
.modal__head h2 { display: flex; align-items: center; gap: 8px; }
.modal__box .form-actions { margin-top: 16px; }
.field-error { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: .88rem; font-weight: 600; }
.field-error[hidden] { display: none; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.picker-grid button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface-2); }
.picker-grid button:hover { border-color: var(--brand); }
.picker-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
@keyframes fade { from { opacity: 0; } }

/* ---- Roles --------------------------------------------------------------- */
.perm-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 18px; }
.perm-group__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.perm-group__head h3 { font-size: 1rem; }
.perm { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.perm.is-disabled { opacity: .55; cursor: not-allowed; }
.role-options { display: grid; gap: 10px; }
.role-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s; }
.role-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.role-option input { margin-top: 3px; accent-color: var(--brand); width: 18px; height: 18px; }
.role-option small { display: block; }

/* ---- Settings: opening hours -------------------------------------------- */
.hours-editor { display: grid; gap: 6px; margin: 16px 0 20px; }
.hours-editor__row { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.hours-editor__times { display: flex; align-items: center; gap: 10px; }
.hours-editor__times input { width: 130px !important; }
.hours-editor__closed { display: none; }
.hours-editor__row.is-closed .hours-editor__times { display: none; }
.hours-editor__row.is-closed .hours-editor__closed { display: inline; }

/* ---- Messages ------------------------------------------------------------ */
.message { max-width: 820px; }
.message__head { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.message__body { font-size: 1.02rem; line-height: 1.7; margin-bottom: 22px; white-space: normal; word-break: break-word; }

/* ---- Empty states, toasts ----------------------------------------------- */
.empty-state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 64px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-state > .icon { width: 44px; height: 44px; color: var(--brand); }
.empty-state h2 { font-size: 1.25rem; }
.empty-state p { color: var(--muted); max-width: 46ch; margin: 0 0 8px; }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: grid; gap: 10px; width: min(400px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 14px 16px; border-radius: 12px; background: var(--text); color: var(--surface); box-shadow: 0 16px 40px rgba(0, 0, 0, .25); animation: slideIn .25s ease; font-weight: 500; }
.toast span { flex: 1; }
.toast--success .icon:first-child { color: #34d399; }
.toast--error { background: var(--danger); color: #fff; }
.toast button { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0; }
.toast.is-leaving { opacity: 0; transform: translateX(20px); transition: all .3s; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } }

/* ---- User invite --------------------------------------------------------- */
.info-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.info-row > .icon { color: var(--brand); }
.info-row p { flex: 1; min-width: 220px; margin: 0; }
.panel--notice { border-color: var(--brand); background: var(--brand-soft); }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: ui-monospace, monospace; font-size: .82rem !important; }
.role-option { align-items: center; }
.role-option__body { flex: 1; }
.role-option input { margin-top: 0; }

/* ---- Password fields ----------------------------------------------------- */
.pw-wrap { position: relative; display: block; flex: 1; min-width: 0; }
.pw-wrap input { padding-right: 48px !important; }
.pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.pw-meter { margin-top: 8px; }
.pw-meter__bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pw-meter__bars i { height: 6px; border-radius: 99px; background: var(--line); transition: background .2s; }
.pw-meter[data-level="1"] .pw-meter__bars i:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-level="2"] .pw-meter__bars i:nth-child(-n+2) { background: #f59e0b; }
.pw-meter[data-level="3"] .pw-meter__bars i:nth-child(-n+3) { background: #22c55e; }
.pw-meter[data-level="4"] .pw-meter__bars i { background: var(--ok); }
.pw-meter__label { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.pw-meter[data-level="1"] [data-label] { color: var(--danger); }
.pw-meter[data-level="2"] [data-label] { color: #d97706; }
.pw-meter[data-level="3"] [data-label], .pw-meter[data-level="4"] [data-label] { color: var(--ok); }
.pw-meter__count { font-weight: 500; }
.pw-meter__checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; font-size: .8rem; color: var(--muted); }
.pw-meter__checks li::before { content: "○"; display: inline-block; width: 1.2em; }
.pw-meter__checks li.is-ok { color: var(--ok); }
.pw-meter__checks li.is-ok::before { content: "✓"; font-weight: 700; }
.pw-match { display: block; margin-top: 6px; font-size: .84rem; font-weight: 600; }
.pw-match.is-ok { color: var(--ok); }
.pw-match.is-bad { color: var(--danger); }
.password-field { align-items: flex-start; }

/* ---- Login --------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #0f0d16; position: relative; overflow: hidden; color-scheme: dark; }
.login__glow { position: absolute; inset: -20%; background: radial-gradient(circle at 25% 30%, rgba(225, 29, 116, .45), transparent 40%), radial-gradient(circle at 75% 70%, rgba(124, 58, 237, .45), transparent 40%); filter: blur(40px); }
.login__card { position: relative; width: min(420px, 100%); background: var(--surface); color: var(--text); border-radius: 22px; padding: 36px 32px 28px; box-shadow: 0 40px 100px rgba(0, 0, 0, .5); }
.login__brand { display: flex; justify-content: center; margin-bottom: 18px; }
.login h1 { text-align: center; font-size: 1.6rem; }
.login__card > p { text-align: center; margin: 6px 0 22px; }
.login .field input { padding: 12px 14px; font-size: 1rem; }
.login .btn { margin-top: 6px; }
.login__foot { text-align: center; margin: 18px 0 6px; }
.login__back { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-decoration: none; }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; font-size: .92rem; }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--success { background: var(--ok-soft); color: var(--ok); }
