/* Maila Salon admin: corporate theme using the brand espresso as accent */
:root {
  color-scheme: light;
  --bg: #f5f5f4;
  --surface: #ffffff;
  --surface-alt: #fafaf9;
  --text: #1c1917;
  --text-soft: #44403c;
  --muted: #78716c;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;
  --accent: #733526;
  --accent-hover: #5c2a1e;
  --accent-soft: #f7efeb;
  --accent-ring: rgba(115, 53, 38, .16);
  --sidebar: #1f1714;
  --sidebar-text: #d9cfc9;
  --sidebar-muted: #8f817a;
  --sidebar-hover: rgba(255, 255, 255, .06);
  --sidebar-active: rgba(248, 230, 191, .1);
  --gold: #e8c77d;
  --success: #067647;
  --success-soft: #ecfdf3;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, .05);
  --shadow: 0 1px 3px rgba(28, 25, 23, .06), 0 8px 24px -12px rgba(28, 25, 23, .12);
  --sidebar-width: 252px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--text); font: 14.5px/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--text); font-weight: 600; letter-spacing: -.015em; }
code { padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .05); font-size: .9em; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }

/* ---------- Forms ---------- */
.auth-form, .admin-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
label { display: grid; gap: 6px; color: var(--text-soft); font-size: .86rem; font-weight: 600; }
input, textarea, select { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; outline: none; background: var(--surface); color: var(--text); font-weight: 400; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease; }
input:hover, textarea:hover, select:hover { border-color: #a8a29e; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
input[readonly] { background: var(--surface-alt); color: var(--muted); }
textarea { min-height: 112px; resize: vertical; }
.field-hint { color: var(--muted); font-size: .78rem; font-weight: 400; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.check-label { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-weight: 500; }
.check-label input[type="checkbox"] { width: 18px; min-height: 18px; margin: 0; box-shadow: none; accent-color: var(--accent); }

/* ---------- Rich text editor ---------- */
.field { display: grid; gap: 6px; }
.field-label { color: var(--text-soft); font-size: .86rem; font-weight: 600; }
.wysiwyg { overflow: hidden; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.wysiwyg:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.wysiwyg.is-over { border-color: var(--danger); }
.wysiwyg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-alt); }
.wysiwyg-toolbar[hidden] { display: none; }
.wysiwyg-btn { min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-soft); font-size: .82rem; font-weight: 500; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.wysiwyg-btn:hover:not(:disabled) { background: #ebe9e7; color: var(--text); }
.wysiwyg-btn.is-active { border-color: #dcc3ba; background: var(--accent-soft); color: var(--accent); }
.wysiwyg-btn:disabled { opacity: .4; cursor: not-allowed; }
.wysiwyg-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.wysiwyg-btn-source { margin-left: auto; font-family: Consolas, "Courier New", monospace; }
.wysiwyg-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--border-strong); }
.wysiwyg-editor { min-height: 150px; max-height: 420px; padding: 12px 14px; overflow-y: auto; outline: none; color: var(--text); line-height: 1.6; }
.wysiwyg-editor[hidden] { display: none; }
.wysiwyg-editor p { margin: 0 0 .75em; }
.wysiwyg-editor p:last-child { margin-bottom: 0; }
.wysiwyg-editor ul, .wysiwyg-editor ol { margin: 0 0 .75em; padding-left: 1.4em; }
.wysiwyg-editor a { color: var(--accent); text-decoration: underline; }
/* Font Awesome icons inside the editor (Font Awesome is loaded in the admin) */
.wysiwyg-editor i[class^="fa-"] { margin-right: .35em; color: #ee3a4b; user-select: all; }
.wysiwyg .wysiwyg-source { min-height: 150px; border: 0; border-radius: 0; box-shadow: none; font-family: Consolas, "Courier New", monospace; font-size: .84rem; }
.wysiwyg .wysiwyg-source:focus { box-shadow: none; }
.wysiwyg .wysiwyg-source[hidden] { display: none; }
.wysiwyg-count { float: right; font-variant-numeric: tabular-nums; }
.wysiwyg.is-over + .field-hint .wysiwyg-count { color: var(--danger); font-weight: 600; }

/* ---------- Site settings ---------- */
.settings-form .admin-panel { margin-bottom: 20px; }
.settings-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; margin: 0 -16px; padding: 14px 16px; border-top: 1px solid var(--border); background: rgba(245, 245, 244, .92); backdrop-filter: blur(6px); }
.image-field { display: flex; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 1px dashed var(--border); }
.image-field:last-child { padding-bottom: 0; border-bottom: 0; }
.image-preview { display: grid; width: 150px; height: 84px; flex: 0 0 auto; place-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: repeating-conic-gradient(#f5f5f4 0% 25%, #fff 0% 50%) 50% / 16px 16px; color: var(--muted); font-size: .8rem; }
.image-preview.is-dark { border-color: #2a1d19; background: #733526; }
.image-preview.is-icon { width: 84px; }
.image-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.image-field-body { display: grid; min-width: 0; flex: 1; gap: 6px; }
.image-field-body input[type="file"] { min-height: 0; padding: 7px; box-shadow: none; font-size: .85rem; }
.image-field-body .check-label { font-size: .84rem; }
.hours-rows { display: grid; gap: 8px; }
.hours-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.hours-row .button-ghost { min-height: 42px; color: var(--danger); }
@media (max-width: 560px) {
  .image-field { flex-direction: column; }
  .hours-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hours-row input:nth-child(2) { grid-column: 1; }
  .hours-row .hours-remove { grid-row: 1 / span 2; grid-column: 2; }
}
@media (min-width: 900px) {
  .settings-actions { margin: 0 -32px; padding: 14px 32px; }
}

/* ---------- Hero slider manager ---------- */
#hero-slider { scroll-margin-top: 80px; }
#hero-slider .panel-heading { align-items: center; }
.slide-add { margin-bottom: 18px; box-shadow: none; }
.slide-grid { display: grid; gap: 16px; }
.slide-card { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .2s ease, box-shadow .2s ease; }
.slide-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.slide-card.has-error { border-color: var(--danger); }
.slide-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #ebe9e7; }
.slide-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.slide-card.is-muted .slide-thumb img { filter: grayscale(.85); opacity: .55; }
.slide-position { position: absolute; top: 10px; left: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(28, 25, 23, .72); color: #fff; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.slide-thumb .status-badge { position: absolute; top: 10px; right: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.slide-thumb .status-badge.is-hidden { background: #fff; }
.slide-form { gap: 12px; padding: 14px; }
.slide-form textarea { min-height: 64px; font-size: .88rem; }
.slide-form-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.slide-form-row label:first-child { width: 96px; }
.slide-form-row .switch { padding-bottom: 10px; }
.slide-replace input[type="file"] { min-height: 0; padding: 6px; box-shadow: none; font-size: .8rem; }
.slide-form .form-actions { padding-top: 12px; }
@media (min-width: 700px) { .slide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .slide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Services manager ---------- */
.admin-form .form-row { align-items: start; }
#categories { scroll-margin-top: 80px; }
.icon-field { display: flex; align-items: center; gap: 8px; }
.icon-field input { flex: 1; min-width: 0; font-family: Consolas, "Courier New", monospace; font-size: .86rem; }
.icon-preview { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border: 1px solid #ecd9d2; border-radius: 10px; background: linear-gradient(135deg, #fff7e6, #f8e6bf); color: #ee3a4b; font-size: 1.05rem; }
.icon-preview.is-invalid { border-color: var(--danger); color: var(--muted); }
.service-icon i { font-size: 1rem; }
.acc-item .service-icon { background: linear-gradient(135deg, #fff7e6, #f8e6bf); color: #ee3a4b; }
.acc-item.is-muted .service-icon { background: #f0efee; color: var(--muted); }
.filter-tab i { color: inherit; font-size: .85em; opacity: .8; }
.filter-tabs { max-width: 100%; }

.category-list { display: grid; gap: 10px; }
.category-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.category-row.is-muted { background: var(--surface-alt); }
.category-row.is-muted .icon-preview { filter: grayscale(1); opacity: .6; }
.category-row.has-error { border-color: var(--danger); }
.category-row-new { border-style: dashed; background: var(--surface-alt); }
.category-row .icon-preview { grid-row: span 2; }
.category-row input[name="icon"] { font-family: Consolas, "Courier New", monospace; font-size: .84rem; }
.sr-label { gap: 0; font-size: 0; }   /* visually hidden label text, inputs keep full size */
.sr-label input { font-size: .9rem; }
.category-row .switch { font-size: .84rem; }
.category-count { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.category-actions { display: flex; justify-content: flex-end; gap: 6px; }
.category-actions .button-danger { margin-right: 0; }
.category-actions .button:disabled { opacity: .35; }
@media (min-width: 1000px) {
  .category-row { grid-template-columns: 42px minmax(140px, 1.2fr) minmax(140px, 1fr) 80px auto auto auto; }
  .category-row .icon-preview { grid-row: auto; }
  .category-row-new { grid-template-columns: 42px minmax(140px, 1.2fr) minmax(140px, 1fr) 80px auto; }
}

/* Login bot trap: off-screen, never seen by people */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Section on/off card (Services) ---------- */
.section-toggle { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.section-toggle-icon { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border-radius: 10px; background: var(--success-soft); color: var(--success); }
.section-toggle-icon .icon { width: 20px; height: 20px; }
.section-toggle-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.section-toggle-text strong { color: var(--text); font-size: .95rem; }
.section-toggle-text span { color: var(--muted); font-size: .84rem; }
.section-toggle.is-off { border-color: #f4d4a8; background: #fffaf0; }
.section-toggle.is-off .section-toggle-icon { background: #fff1d6; color: #b45309; }
.section-toggle .switch-button { flex: none; font-size: .9rem; font-weight: 600; }

/* ---------- Core values ---------- */
#core-values { scroll-margin-top: 80px; }
.value-rows { display: grid; gap: 12px; }
.value-row { padding: 12px 14px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt); }
.value-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.value-row-number { color: var(--accent); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.value-row-tools { display: flex; gap: 4px; }
.value-row-tools .button { min-height: 32px; padding: 4px 10px; }
.value-row-tools .button:disabled { opacity: .35; }
.value-remove { color: var(--danger); }
.value-row-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.value-row-fields textarea { min-height: 64px; }
@media (min-width: 900px) {
  .value-row-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .value-text { grid-column: 1 / -1; }
}
.value-rows-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }

/* ---------- Popups ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.popup-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.popup-live-note { max-width: 640px; margin: 0; font-size: .86rem; }
.popup-live-note strong { color: var(--text); }
.popup-empty h2 { margin: 0 0 4px; font-size: 1.05rem; }
.popup-cards { display: grid; gap: 12px; }
.popup-card { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px 16px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.popup-card.is-muted { background: var(--surface-alt); }
.popup-card.is-muted .popup-card-thumb { filter: grayscale(.8); opacity: .7; }
.popup-card-thumb { display: grid; width: 84px; height: 64px; overflow: hidden; place-items: center; border-radius: 10px; background: #f3ece6; }
.popup-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popup-card-thumb .tpl-thumb { width: 100%; height: 100%; border-radius: 0; }
.popup-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.popup-card h2 { margin: 0; font-size: 1rem; }
.popup-card h2 a { color: var(--text); text-decoration: none; }
.popup-card h2 a:hover { color: var(--accent); }
.popup-card-title { margin: 3px 0 0; color: var(--text-soft); font-size: .88rem; }
.popup-card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; color: var(--muted); font-size: .78rem; }
.popup-card-actions { display: flex; flex-wrap: wrap; grid-column: 1 / -1; align-items: center; justify-content: flex-end; gap: 6px; }
.popup-card-actions form { margin: 0; }
.status-badge.is-scheduled { background: #eff6ff; color: #1d4ed8; }
.status-badge.is-expired { background: #fff7ed; color: #b45309; }
.status-badge.is-off { background: #f0efee; color: var(--muted); }
.status-badge.is-waiting { background: #fefce8; color: #a16207; }
.switch-button { padding: 4px 6px; border: 0; background: none; font: inherit; font-size: .84rem; }
.switch-button.is-on .switch-track { background: var(--success); }
.switch-button.is-on .switch-track::after { transform: translateX(18px); }
.switch-button:focus-visible .switch-track { box-shadow: 0 0 0 4px var(--accent-ring); }
.switch-text { min-width: 22px; }
@media (min-width: 760px) {
  .popup-card { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .popup-card-thumb { width: 96px; height: 72px; }
  .popup-card-actions { grid-column: auto; flex-wrap: nowrap; }
}

/* Template picker */
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .template-grid-links { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.template-card { position: relative; display: grid; gap: 2px; padding: 8px 8px 10px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.template-card:hover { border-color: #c9b5ad; transform: translateY(-1px); }
.template-card input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; }
.template-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.template-card:has(input:checked)::after { position: absolute; top: 12px; right: 12px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; content: "\2713"; font-size: .72rem; }
.template-card:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--accent-ring); }
.template-name { margin-top: 6px; font-size: .84rem; }
.template-hint { color: var(--muted); font-size: .74rem; font-weight: 400; }

/* Mini layout drawings */
.tpl-thumb { position: relative; display: flex; height: 78px; overflow: hidden; align-items: center; justify-content: center; border-radius: 8px; background: linear-gradient(135deg, #efe7e1, #e2d6cf); }
.tpl-box { display: flex; width: 52%; flex-direction: column; align-items: center; gap: 3px; padding: 0 0 6px; overflow: hidden; border-radius: 5px; background: #fff7e6; box-shadow: 0 4px 10px -4px rgba(31, 23, 20, .35); }
.tpl-img { width: 100%; height: 22px; margin-bottom: 2px; background: linear-gradient(135deg, #c98b6b, #733526); }
.tpl-line { width: 70%; height: 4px; border-radius: 2px; background: #3b2822; opacity: .7; }
.tpl-line.short { width: 48%; opacity: .35; }
.tpl-btn { width: 36%; height: 6px; margin-top: 2px; border-radius: 3px; background: #ee3a4b; }
.tpl-split-left .tpl-box, .tpl-split-right .tpl-box { width: 70%; height: 46px; flex-direction: row; flex-wrap: wrap; align-content: center; justify-content: flex-start; padding: 0 6px 0 0; background: #fff; }
.tpl-split-right .tpl-box { flex-direction: row-reverse; padding: 0 0 0 6px; background: #f8e6bf; }
.tpl-split-left .tpl-img, .tpl-split-right .tpl-img { width: 42%; height: 100%; margin: 0 6px 0 0; }
.tpl-split-right .tpl-img { margin: 0 0 0 6px; }
.tpl-split-left .tpl-line, .tpl-split-right .tpl-line { width: 44%; }
.tpl-split-left .tpl-line.short, .tpl-split-right .tpl-line.short { width: 30%; }
.tpl-split-left .tpl-btn, .tpl-split-right .tpl-btn { width: 24%; }
.tpl-split-left .tpl-box > :not(.tpl-img), .tpl-split-right .tpl-box > :not(.tpl-img) { flex: none; }
.tpl-split-left .tpl-box { display: grid; grid-template-columns: 42% 1fr; grid-template-rows: repeat(3, auto); align-content: center; column-gap: 6px; row-gap: 3px; }
.tpl-split-right .tpl-box { display: grid; grid-template-columns: 1fr 42%; grid-template-rows: repeat(3, auto); align-content: center; column-gap: 6px; row-gap: 3px; padding: 0 0 0 6px; }
.tpl-split-left .tpl-img { grid-row: 1 / 4; width: auto; margin: 0; height: 46px; }
.tpl-split-right .tpl-img { grid-column: 2; grid-row: 1 / 4; width: auto; margin: 0; height: 46px; }
.tpl-split-right .tpl-line, .tpl-split-right .tpl-btn { grid-column: 1; }
.tpl-split-left .tpl-line, .tpl-split-left .tpl-btn, .tpl-split-right .tpl-line, .tpl-split-right .tpl-btn { width: 80%; }
.tpl-split-left .tpl-line.short, .tpl-split-right .tpl-line.short { width: 55%; }
.tpl-split-left .tpl-btn, .tpl-split-right .tpl-btn { width: 45%; }
.tpl-poster .tpl-box { position: relative; width: 44%; height: 64px; justify-content: flex-end; background: linear-gradient(to top, #1f1714 30%, transparent), linear-gradient(135deg, #c98b6b, #733526); }
.tpl-poster .tpl-img { display: none; }
.tpl-poster .tpl-line { background: #fff; }
.tpl-minimal .tpl-box { width: 50%; padding: 8px 6px; align-items: flex-start; border: 1px solid #e7e5e4; background: #fff; }
.tpl-minimal .tpl-img { display: none; }
.tpl-minimal .tpl-btn { border-radius: 2px; background: #733526; }
.tpl-offer .tpl-box { width: 50%; padding: 8px 0; border: 1.5px dashed #ee3a4b; }
.tpl-offer .tpl-img { display: none; }
.tpl-offer .tpl-line.short { width: 50%; height: 9px; border: 1px dashed #ee3a4b; background: transparent; opacity: 1; }
.tpl-festive .tpl-box { width: 50%; padding: 6px 0 8px; border: 3px double #e8c77d; background: #733526; }
.tpl-festive .tpl-img { width: 18px; height: 18px; border: 1.5px solid #e8c77d; border-radius: 50%; }
.tpl-festive .tpl-line { background: #fff7e6; }
.tpl-festive .tpl-btn { background: #e8c77d; }
.tpl-fullscreen .tpl-box { width: 100%; height: 100%; flex-direction: row; flex-wrap: wrap; align-content: center; border-radius: 0; background: #1f1714; display: grid; grid-template-columns: 50% 1fr; grid-template-rows: repeat(3, auto); justify-items: center; row-gap: 4px; padding: 0; }
.tpl-fullscreen .tpl-img { grid-row: 1 / 4; width: 100%; height: 78px; margin: 0; }
.tpl-fullscreen .tpl-line { background: #fff7e6; }
.tpl-banner { align-items: flex-end; }
.tpl-banner .tpl-box { display: grid; width: 100%; grid-template-columns: 14px 1fr 22%; grid-template-rows: auto auto; align-items: center; gap: 2px 6px; padding: 5px 6px; border-radius: 0; background: #733526; }
.tpl-banner .tpl-img { grid-row: 1 / 3; width: 14px; height: 14px; margin: 0; border-radius: 3px; }
.tpl-banner .tpl-line { width: 70%; background: #fff; }
.tpl-banner .tpl-btn { grid-column: 3; grid-row: 1 / 3; width: 100%; margin: 0; background: #e8c77d; }
.tpl-corner { align-items: flex-end; justify-content: flex-end; padding: 6px; }
.tpl-corner .tpl-box { width: 40%; align-items: flex-start; padding-bottom: 5px; background: #fff; }
.tpl-corner .tpl-img { height: 14px; }
.tpl-corner .tpl-line, .tpl-corner .tpl-btn { margin-left: 5px; }

/* Editor layout */
.admin-main:has(.popup-editor) { max-width: 1440px; }
.editor-back { margin: -6px 0 14px; }
.editor-back a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .86rem; font-weight: 600; text-decoration: none; }
.editor-back a:hover { color: var(--accent); }
.editor-back .icon { width: 16px; height: 16px; transform: rotate(180deg); }
.popup-editor { display: grid; gap: 20px; align-items: start; }
.popup-editor-form { min-width: 0; }
.popup-editor-preview { display: grid; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
@media (min-width: 1180px) {
  .popup-editor { grid-template-columns: minmax(0, 1fr) minmax(400px, 0.95fr); }
  .popup-editor-preview { position: sticky; top: 76px; order: 2; }
}
@media (max-width: 1179px) {
  .popup-editor-preview { order: -1; }
}
.preview-head { display: flex; align-items: center; gap: 10px; }
.preview-head strong { margin-right: auto; font-size: .92rem; }
.preview-devices { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--surface-alt); border: 1px solid var(--border); }
.preview-devices button { padding: 5px 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.preview-devices button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
/* The preview renders at real screen size (1280×800 desktop, 390×780 phone) and is scaled down by admin.js */
.preview-stage { position: relative; width: 100%; height: 400px; margin: 0 auto; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fff7e6; }
.preview-stage.is-mobile { box-sizing: content-box; border: 6px solid #1f1714; border-radius: 22px; }
.preview-viewport { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; overflow: hidden; transform-origin: 0 0; }
.preview-stage.is-mobile .preview-viewport { width: 390px; height: 780px; }
.preview-page { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 18px; padding: 0 0 32px; }
.pp-nav { height: 72px; flex: none; background: #fff; box-shadow: 0 1px 0 #f0e2d6; }
.pp-hero { height: 44%; flex: none; margin: 0 40px; border-radius: 24px; background: linear-gradient(rgba(31, 23, 20, .1), rgba(31, 23, 20, .1)), url("../images/salon-reception.jpg") center / cover; }
.pp-line { width: 50%; height: 22px; flex: none; margin: 6px 40px 0; border-radius: 11px; background: #e8d6c4; }
.pp-line.short { width: 32%; }
.pp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 6px 40px 0; flex: 1; }
.preview-stage.is-mobile .pp-hero, .preview-stage.is-mobile .pp-line, .preview-stage.is-mobile .pp-cards { margin-left: 16px; margin-right: 16px; }
.preview-stage.is-mobile .pp-cards { grid-template-columns: 1fr; }
.pp-cards span { border-radius: 10px; background: #fff; box-shadow: 0 1px 0 #f0e2d6; }

/* Fields */
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.style-grid-border { align-items: end; }
.color-inputs { display: flex; align-items: center; gap: 8px; }
.color-inputs input[type="color"] { width: 46px; height: 42px; min-height: 0; flex: none; padding: 3px; cursor: pointer; }
.color-inputs input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-inputs input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.color-inputs input[data-color-hex] { min-width: 0; font-family: Consolas, "Courier New", monospace; font-size: .86rem; text-transform: uppercase; }
.range-inputs { display: flex; align-items: center; gap: 12px; }
.range-inputs input[type="range"] { min-height: 0; padding: 0; border: 0; box-shadow: none; accent-color: var(--accent); background: none; }
.range-inputs output { min-width: 46px; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix input { max-width: 110px; }
.input-suffix span { color: var(--muted); font-weight: 500; }
.trigger-options { display: grid; gap: 10px; }
@media (min-width: 700px) { .trigger-options { grid-template-columns: 1fr 1fr; } }
.trigger-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 500; cursor: pointer; }
.trigger-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.trigger-option input { width: 16px; height: 16px; min-height: 0; margin: 2px 0 0; padding: 0; flex: none; box-shadow: none; accent-color: var(--accent); }
.trigger-option > span { display: grid; gap: 3px; }
.trigger-option strong { color: var(--text); font-size: .88rem; }
.toggle-list { display: grid; gap: 14px; }
.toggle-list .switch { align-items: flex-start; width: auto; }
.toggle-list .switch > span:last-child { display: grid; gap: 2px; }
.toggle-list .switch strong { color: var(--text); font-size: .9rem; }
.narrow-field { max-width: 240px; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 500; }
.checkbox-inline input { width: auto; min-height: 0; box-shadow: none; accent-color: var(--danger); }
.popup-image-field { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; }
.popup-image-field > div { display: grid; flex: 1; gap: 6px; min-width: 220px; }
.popup-image-thumb { width: 120px; height: 90px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); }
.popup-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popup-image-field input[type="file"] { padding: 8px; }
.popup-save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }

/* ---------- Buttons ---------- */
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border: 1px solid transparent; border-radius: 8px; font-size: .9rem; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
.button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button .icon { width: 16px; height: 16px; }
.button-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.button-primary:hover { background: var(--accent-hover); }
.button-secondary, .button-outline { border-color: var(--border-strong); background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow-sm); }
.button-secondary:hover, .button-outline:hover { background: var(--surface-alt); border-color: #a8a29e; }
.button-ghost { background: transparent; color: var(--muted); }
.button-ghost:hover { background: #f0efee; color: var(--text); }
.button-light { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; }
.button-light:hover { background: rgba(255, 255, 255, .18); }
.button-danger { margin-right: auto; border-color: #fecdca; background: var(--surface); color: var(--danger); }
.button-danger:hover { background: var(--danger-soft); border-color: #fda29b; }
.button-full { width: 100%; min-height: 44px; margin-top: 4px; }
.button-small { min-height: 34px; padding: 6px 12px; font-size: .84rem; }

/* ---------- Notices ---------- */
.notice { margin: 0 0 18px; padding: 12px 14px; border: 1px solid #d6dfea; border-left-width: 4px; border-radius: 8px; background: #f6f9fc; color: #27415f; font-size: .9rem; overflow-wrap: anywhere; }
.notice-success { border-color: #abefc6; border-left-color: var(--success); background: var(--success-soft); color: #05603a; }
.notice-error { border-color: #fecdca; border-left-color: var(--danger); background: var(--danger-soft); color: #912018; }
.notice a { color: inherit; font-weight: 600; }

/* ---------- Login & setup ---------- */
.auth-body { display: grid; min-height: 100vh; place-items: center; padding: 24px 16px; background: var(--bg); background-image: radial-gradient(circle at 15% 10%, rgba(115, 53, 38, .07), transparent 40%), radial-gradient(circle at 85% 90%, rgba(232, 199, 125, .12), transparent 40%); }
.auth-shell { display: grid; width: min(100%, 440px); overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 24px 60px -28px rgba(28, 25, 23, .35); }
.auth-aside { display: none; }
.auth-card { padding: 32px 28px; }
.auth-brand { display: block; width: 136px; margin: 0 0 26px; }
.auth-brand img { display: block; width: 100%; height: auto; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.auth-card h1 { margin-bottom: 0; font-size: 1.7rem; line-height: 1.2; }
.auth-intro { margin: 8px 0 24px; color: var(--muted); }
.back-link { display: inline-block; margin-top: 22px; color: var(--muted); font-size: .86rem; font-weight: 500; text-decoration: none; }
.back-link:hover { color: var(--accent); }

/* ---------- Admin shell ---------- */
.admin-body { min-height: 100vh; background: var(--bg); }
/* Menu, mobile first: a drawer that slides in from the left (☰ in the top bar opens it).
   From 900px wide it becomes the fixed sidebar (see "Larger screens"). */
body.menu-open { overflow: hidden; }
.admin-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  display: flex; width: min(86vw, 300px); flex-direction: column;
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--sidebar); color: var(--sidebar-text);
  transform: translateX(-100%); visibility: hidden;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .26s;
}
.menu-open .admin-sidebar { transform: none; visibility: visible; box-shadow: 18px 0 40px -12px rgba(0, 0, 0, .45); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.admin-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(24, 16, 13, .52); opacity: 0; visibility: hidden; transition: opacity .26s ease, visibility 0s linear .26s; }
.menu-open .admin-backdrop { opacity: 1; visibility: visible; transition: opacity .26s ease; }
.admin-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 22px; }
.admin-brand { display: block; width: 118px; flex: 0 0 auto; }
.admin-brand img { display: block; width: 100%; height: auto; }
.admin-menu-close { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .06); color: var(--sidebar-text); cursor: pointer; }
.admin-menu-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-menu-close .icon, .admin-menu-toggle .icon { width: 22px; height: 22px; }
.admin-sidebar-label { margin: 0 12px 8px; color: var(--sidebar-muted); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-link { display: flex; min-height: 46px; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--sidebar-text); font-size: .95rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.admin-nav-link .icon { color: var(--sidebar-muted); transition: color .15s ease; }
.admin-nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.admin-nav-link:hover .icon { color: #fff; }
.admin-nav-link.is-active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.admin-nav-link.is-active .icon { color: var(--gold); }
.admin-sidebar-foot { display: grid; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.admin-sidebar-footer { display: flex; min-height: 44px; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--sidebar-muted); font-size: .88rem; text-decoration: none; white-space: nowrap; }
.admin-sidebar-footer:hover { background: var(--sidebar-hover); color: #fff; }
.admin-drawer-user { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 6px 12px; }
.admin-drawer-meta { min-width: 0; line-height: 1.3; }
.admin-drawer-meta strong { display: block; color: #fff; font-size: .88rem; font-weight: 600; }
.admin-drawer-meta > span { display: block; overflow: hidden; color: var(--sidebar-muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-drawer-logout { margin: 0; padding: 0 12px; }
.admin-drawer-logout .button { width: 100%; min-height: 44px; justify-content: center; border-color: rgba(255, 255, 255, .16); background: transparent; color: var(--sidebar-text); }
.admin-drawer-logout .button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.admin-menu-toggle { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; margin-left: -4px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.admin-menu-toggle:hover { background: var(--surface-alt); }
.admin-menu-toggle:focus-visible, .admin-menu-close:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.admin-topbar-logout { display: none; }
.admin-breadcrumb-home, .admin-breadcrumb-sep { display: none; }

.admin-shell { display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 10; display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px); }
.admin-breadcrumb { display: flex; min-width: 0; flex: 1; align-items: center; gap: 8px; color: var(--muted); font-size: .95rem; }
.admin-breadcrumb strong { overflow: hidden; color: var(--text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.admin-user form { margin: 0; }
.admin-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700; }
.admin-user-meta { display: none; line-height: 1.25; }
.admin-user-meta strong { display: block; font-size: .84rem; font-weight: 600; }
.admin-user-meta span { display: block; max-width: 220px; overflow: hidden; color: var(--muted); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }

.admin-main { width: 100%; max-width: 1080px; flex: 1; padding: 24px 16px 40px; }
.page-header { margin-bottom: 22px; }
.page-header h1 { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.25; }
.page-lead { max-width: 720px; margin: 0; color: var(--muted); }
.admin-footer { padding: 18px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; }

/* ---------- Panels ---------- */
.admin-panel { margin: 0 0 20px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: -22px -22px 22px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.panel-heading h2 { margin: 0; font-size: 1.02rem; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.section-heading { margin: 0; font-size: 1.05rem; }
.list-header { display: flex; align-items: center; gap: 10px; margin: 32px 0 14px; }
.count-pill { padding: 1px 9px; border-radius: 999px; background: #ebe9e7; color: var(--text-soft); font-size: .78rem; font-weight: 600; }
.empty-state { padding: 28px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--muted); text-align: center; }

/* ---------- Dashboard ---------- */
.dashboard-welcome { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 20px; padding: 26px; border-radius: var(--radius-lg); background: linear-gradient(135deg, #2a1d19 0%, var(--accent) 100%); color: #f3e9e4; box-shadow: var(--shadow); }
.dashboard-welcome .kicker { margin: 0 0 4px; color: var(--gold); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.dashboard-welcome h2 { margin: 0; color: #fff; font-size: 1.4rem; }
.dashboard-welcome p:last-child { margin: 4px 0 0; color: rgba(243, 233, 228, .82); }
.metrics-grid { display: grid; gap: 14px; margin-bottom: 32px; }
.metric-card { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.metric-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.metric-icon .icon { width: 20px; height: 20px; }
.metric-icon-success { background: var(--success-soft); color: var(--success); }
.metric-icon-muted { background: #f0efee; color: var(--muted); }
.metric-label { display: block; color: var(--muted); font-size: .82rem; font-weight: 500; }
.metric-card strong { display: block; color: var(--text); font-size: 1.6rem; font-weight: 650; line-height: 1.15; }
.dashboard-grid { display: grid; gap: 14px; margin-top: 14px; }
.dashboard-card { display: grid; align-content: start; gap: 6px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--muted); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s ease, box-shadow .15s ease; }
.dashboard-card:hover { border-color: #d4b5aa; box-shadow: 0 1px 3px rgba(28, 25, 23, .06), 0 16px 32px -16px rgba(115, 53, 38, .28); }
.dashboard-card-icon { display: grid; width: 40px; height: 40px; margin-bottom: 8px; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.dashboard-card strong { color: var(--text); font-size: 1rem; font-weight: 600; }
.card-action { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--accent); font-size: .88rem; font-weight: 600; }
.card-action .icon { width: 16px; height: 16px; transition: transform .15s ease; }
.dashboard-card:hover .card-action .icon { transform: translateX(3px); }

/* ---------- Testimonials ---------- */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.list-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.list-stats strong { color: var(--text); font-weight: 600; }
.dot-sep { color: var(--border-strong); }

/* Collapsible "add" panel */
.add-panel { padding: 0; overflow: hidden; }
.add-panel-summary { display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; list-style: none; }
.add-panel-summary::-webkit-details-marker { display: none; }
.add-panel-summary:hover { background: var(--surface-alt); }
.add-panel-summary > span:nth-child(2) { flex: 1; min-width: 0; }
.add-panel-summary strong { display: block; font-size: .95rem; font-weight: 600; }
.add-panel-summary strong + span { display: block; color: var(--muted); font-size: .84rem; }
.add-panel-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--accent); color: #fff; }
.add-panel[open] > .add-panel-summary { border-bottom: 1px solid var(--border); }
.add-panel-body { padding: 20px; }

/* Round chevron button shared by collapsible headers */
.acc-chevron { position: relative; display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); transition: background .2s ease, border-color .2s ease, transform .25s ease; }
.acc-chevron::before { width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); content: ""; transition: border-color .2s ease; }
details[open] > summary .acc-chevron { border-color: var(--accent); background: var(--accent); transform: rotate(180deg); }
details[open] > summary .acc-chevron::before { border-color: #fff; }

/* Filter tabs */
.filter-tabs { display: flex; gap: 4px; margin: 4px 0 16px; padding: 4px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #efedeb; }
.filter-tab { display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border-radius: 9px; color: var(--muted); font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.filter-tab:hover { color: var(--text); }
.filter-tab.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm), 0 2px 6px -2px rgba(28, 25, 23, .12); }
.filter-count { min-width: 22px; padding: 0 7px; border-radius: 999px; background: rgba(0, 0, 0, .06); color: inherit; font-size: .75rem; line-height: 20px; text-align: center; }
.filter-tab.is-active .filter-count { background: var(--accent-soft); }

/* Accordion */
.accordion { display: grid; gap: 10px; }
.acc-item { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .2s ease, box-shadow .2s ease; }
.acc-item::before { position: absolute; inset: 0 auto 0 0; z-index: 1; width: 3px; background: var(--accent); content: ""; opacity: 0; transition: opacity .2s ease; }
.acc-item:hover { border-color: var(--border-strong); }
.acc-item[open] { border-color: #dcc3ba; box-shadow: 0 1px 3px rgba(28, 25, 23, .06), 0 14px 32px -18px rgba(115, 53, 38, .35); }
.acc-item[open]::before { opacity: 1; }
.acc-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; user-select: none; }
.acc-head::-webkit-details-marker { display: none; }
.acc-head:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--accent-ring); }
.acc-item[open] > .acc-head { background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.acc-index { display: none; color: #b8b2ad; font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #2a1d19, var(--accent)); color: #fff; font-size: .88rem; font-weight: 700; }
.acc-item.is-muted .acc-avatar { background: #d6d3d1; }
.acc-avatar-icon { background: var(--accent-soft); color: var(--accent); }
.acc-avatar-icon .icon { width: 20px; height: 20px; }
.acc-item.is-muted .acc-avatar-icon { background: #f0efee; color: var(--muted); }
.acc-title { display: grid; min-width: 0; flex: 1; }
.acc-name { overflow: hidden; font-size: .94rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.acc-snippet { overflow: hidden; color: var(--muted); font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.acc-item[open] .acc-snippet { visibility: hidden; }
.acc-meta { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 4px; }
.acc-body { padding: 20px 16px; border-top: 1px solid var(--border); }
.form-row-tight { gap: 12px; }

/* Smooth open/close where supported (Chrome/Edge 131+); other browsers just open instantly */
@supports (interpolate-size: allow-keywords) {
  .accordion, .add-panel { interpolate-size: allow-keywords; }
  .acc-item::details-content, .add-panel::details-content { height: 0; overflow: hidden; transition: height .3s ease, content-visibility .3s allow-discrete; }
  .acc-item[open]::details-content, .add-panel[open]::details-content { height: auto; }
}

/* Toggle switch */
.switch { position: relative; display: inline-flex; width: max-content; max-width: 100%; align-items: center; gap: 10px; color: var(--text-soft); font-weight: 500; cursor: pointer; }
.switch input[type="checkbox"] { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; }
.switch-track { position: relative; width: 40px; height: 22px; flex: 0 0 auto; border-radius: 999px; background: #d6d3d1; transition: background .2s ease; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); content: ""; transition: transform .2s ease; }
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 4px var(--accent-ring); }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pagination-info { color: var(--muted); font-size: .84rem; }
.pagination-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.page-link { display: inline-grid; min-width: 36px; height: 36px; padding: 0 10px; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-soft); font-size: .86rem; font-weight: 500; text-decoration: none; }
a.page-link:hover { border-color: var(--border-strong); background: var(--surface-alt); }
.page-link.is-current { border-color: var(--accent); background: var(--accent); color: #fff; }
.page-link.is-disabled { color: #c4bfbb; cursor: default; }
.page-gap { padding: 0 4px; color: var(--muted); }

.rating { color: #d99a1e; font-size: .85rem; letter-spacing: 1px; white-space: nowrap; }
.rating-empty { color: #d6d3d1; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.status-badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-badge.is-live { background: var(--success-soft); color: var(--success); }
.status-badge.is-hidden { background: #f0efee; color: var(--muted); }
.delete-form { display: none; }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .admin-user-meta { display: block; }
  .admin-breadcrumb { font-size: .86rem; }
  .admin-breadcrumb-home, .admin-breadcrumb-sep { display: inline; }
  .acc-head { gap: 16px; padding: 14px 20px; }
  .acc-index { display: block; min-width: 18px; }
  .acc-meta { flex-direction: row; align-items: center; gap: 14px; }
  .acc-body { padding: 22px 24px 22px 108px; }
  .filter-tabs { display: inline-flex; }
  .filter-tab { flex: 0 0 auto; }
}

@media (min-width: 900px) {
  .admin-body { padding-left: var(--sidebar-width); }
  /* The drawer becomes a fixed sidebar that is always shown */
  .admin-sidebar { z-index: 20; width: var(--sidebar-width); padding: 24px 16px; border-right: 1px solid rgba(255, 255, 255, .04); transform: none; visibility: visible; transition: none; box-shadow: none; }
  .menu-open .admin-sidebar { box-shadow: none; }
  .admin-sidebar-head { margin: 4px 8px 32px; }
  .admin-brand { width: 150px; }
  .admin-nav-link { min-height: 0; padding: 9px 12px; border-radius: 8px; font-size: .9rem; }
  .admin-sidebar-foot { padding-top: 12px; }
  .admin-menu-toggle, .admin-menu-close, .admin-backdrop, .admin-drawer-user, .admin-drawer-logout { display: none; }
  .admin-topbar-logout { display: block; }
  body.menu-open { overflow: visible; }
  .admin-topbar { padding: 10px 32px; }
  .admin-main { padding: 32px 32px 48px; }
  .admin-footer { padding: 18px 32px; }
  .page-header h1 { font-size: 1.75rem; }

  .auth-shell { width: min(100%, 940px); grid-template-columns: 1fr 1fr; }
  .auth-aside { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 40px; background: linear-gradient(160deg, #2a1d19 0%, var(--accent) 100%); color: rgba(243, 233, 228, .85); }
  .auth-aside img { width: 170px; height: auto; }
  .auth-aside h2 { margin: 0 0 10px; color: #fff; font-size: 1.6rem; line-height: 1.25; }
  .auth-aside p { margin: 0; }
  .auth-aside-foot { color: var(--gold); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .auth-card { padding: 48px 44px; }
  .auth-brand { display: none; }
}

/* ---------- Social media rows (Site settings) ---------- */
#social { scroll-margin-top: 80px; }
.social-rows { display: grid; gap: 8px; }
.social-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: box-shadow .15s ease, border-color .15s ease, opacity .15s ease; }
.social-row:not(.is-filled) { background: var(--surface-alt); }
.social-row:not(.is-filled) .social-icon { opacity: .45; filter: grayscale(1); }
.social-row.is-dragging { position: relative; z-index: 2; border-color: var(--accent); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .35); }
.social-rows.is-sorting { cursor: grabbing; user-select: none; }
.social-rows.is-sorting .social-row:not(.is-dragging) { opacity: .75; }
.drag-handle { display: grid; width: 32px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: grab; touch-action: none; }
.drag-handle:hover { background: var(--surface-alt); color: var(--text); }
.drag-handle:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; }
.drag-hint-icon { font-weight: 700; }
.social-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: #fff; font-size: 1.05rem; }
.social-instagram { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.social-facebook { background: #1877f2; }
.social-youtube { background: #ff0000; }
.social-linkedin { background: #0a66c2; }
.social-x, .social-threads, .social-tiktok { background: #111; }
.social-pinterest { background: #e60023; }
.social-google { background: #fff; color: #4285f4; box-shadow: inset 0 0 0 1px var(--border); }
.social-whatsapp { background: #25d366; }
.social-field { display: grid; gap: 4px; min-width: 0; font-size: .85rem; font-weight: 600; }
.social-field .check-label { font-weight: 400; }
.social-state { min-width: 58px; padding: 3px 10px; border-radius: 999px; background: var(--surface-alt); color: var(--muted); font-size: .75rem; font-weight: 700; text-align: center; }
.social-row.is-filled .social-state { background: var(--success-soft); color: var(--success); }
@media (max-width: 560px) {
  .social-row { grid-template-columns: auto auto minmax(0, 1fr); }
  .social-state { display: none; }
}

/* ---------- Users & permissions ---------- */
.admin-user-meta .role-chip { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; vertical-align: 1px; }
.list-summary { margin: 18px 0 10px; color: var(--muted); font-size: .85rem; }
.user-item .acc-title { gap: 4px; }
.acc-avatar.is-owner { background: linear-gradient(135deg, #733526, #ba4932); color: #fff; }
.you-chip { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: .7rem; font-weight: 700; vertical-align: 2px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-chip { padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-alt); color: var(--text); font-size: .72rem; font-weight: 600; }
.perm-chip.is-all { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.perm-chip.is-none { border-style: dashed; color: var(--muted); }
.role-badge { padding: 3px 10px; border-radius: 999px; background: #f0efee; color: var(--muted); font-size: .76rem; font-weight: 700; }
.role-badge.is-owner { background: var(--accent-soft); color: var(--accent); }

.role-picker { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.role-picker legend { margin-bottom: 6px; padding: 0; }
@media (min-width: 700px) { .role-picker { grid-template-columns: 1fr 1fr; } .role-picker legend { grid-column: 1 / -1; } }
.role-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.role-option:hover { border-color: var(--border-strong); }
.role-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.role-option.is-locked { cursor: not-allowed; opacity: .6; }
.role-option input { margin-top: 3px; accent-color: var(--accent); }
.role-option-body { display: grid; gap: 2px; }
.role-option-body strong { display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.role-option-body strong .icon { width: 16px; height: 16px; color: var(--accent); }
.role-option-body span { color: var(--muted); font-size: .8rem; font-weight: 400; }

.perm-block { display: grid; gap: 8px; }
.perm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.perm-tools { display: flex; gap: 12px; }
.perm-owner-note { display: none; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: .85rem; }
.perm-block.is-owner .perm-owner-note { display: block; }
.perm-block.is-owner .perm-grid, .perm-block.is-owner .perm-tools { display: none; }
.perm-grid { display: grid; gap: 8px; }
@media (min-width: 700px) { .perm-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .perm-grid { grid-template-columns: 1fr 1fr 1fr; } }
.perm-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 400; transition: border-color .15s ease, background .15s ease; }
.perm-option:hover { border-color: var(--border-strong); }
.perm-option:has(input:checked) { border-color: var(--success); background: var(--success-soft); }
.perm-option input { margin-top: 9px; accent-color: var(--success); }
.perm-icon { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 8px; background: var(--surface-alt); color: var(--accent); }
.perm-icon .icon { width: 17px; height: 17px; }
.perm-text { display: grid; gap: 1px; min-width: 0; }
.perm-text strong { font-size: .88rem; }
.perm-text span { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.link-button { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: .8rem; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-button:hover { color: var(--text); }
.switch.is-locked { opacity: .7; }
.role-option input[type="radio"], .perm-option input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; flex: none; margin: 2px 0 0; padding: 0; box-shadow: none; }
.perm-option input[type="checkbox"] { margin-top: 7px; }

/* Homepage content: tabs (Hero / About / Core values) */
.homepage-tabs { margin-bottom: 8px; }
.tab-intro { margin: 0 0 18px; color: var(--muted); font-size: .9rem; }
.admin-panel[id], form.admin-panel[id] { scroll-margin-top: 90px; }

/* Mobile: form rows and fields may always shrink to the screen width
   (a text box otherwise keeps the browser's built-in ~20-character minimum width) */
.admin-form > *, .value-row-fields > *, .form-row > *, .field, .icon-field > * { min-width: 0; }
.icon-field input { flex: 1 1 auto; width: auto; min-width: 0; }
.switch > .switch-track { flex: 0 0 auto; }   /* long switch labels wrap; the switch itself never squeezes */
/* Panel headings: on narrow screens a button (e.g. "Find icons") moves under the text instead of squeezing it */
.panel-heading { flex-wrap: wrap; }
.panel-heading > div:first-child { flex: 1 1 260px; min-width: 0; }

/* Studio & Team cards (Homepage content → Studio & Team) */
.studio-card-list { display: grid; gap: 16px; margin-top: 16px; }
.studio-card-edit { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.studio-card-edit.has-error { border-color: var(--danger, #c0392b); }
.studio-card-thumb { position: relative; overflow: hidden; border-radius: 10px; background: var(--surface-alt); aspect-ratio: 16 / 9; }
.studio-card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.studio-card-thumb .slide-position { position: absolute; top: 10px; left: 10px; }
.chip-rows { display: grid; gap: 8px; margin-top: 6px; }
.chip-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.studio-card-edit .form-actions { flex-wrap: wrap; }
@media (min-width: 640px) { .chip-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 1000px) {
  .studio-card-edit { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
}
