/* =========================================================
   SHCS Jalalabad — Admin panel
   Dark glass on deep navy, school gold as the main accent.
   Light mode: html[data-theme="light"].
   Performance: backdrop-filter is used ONLY on .glass panels (never on rows/cards);
   the background spheres animate only transform and opacity.
   ========================================================= */

:root {
  --bg-1: #040b18;
  --bg-2: #071a36;
  --glass: rgba(255, 255, 255, .04);
  --glass-strong: rgba(255, 255, 255, .07);
  --glass-border: rgba(255, 255, 255, .08);
  --glass-border-hover: rgba(255, 255, 255, .16);
  --glass-hi: rgba(255, 255, 255, .10);
  --row: rgba(255, 255, 255, .025);
  --row-hover: rgba(255, 255, 255, .05);
  --input: rgba(255, 255, 255, .05);

  --gold: #d4a53c;
  --gold-2: #e0b44c;
  --gold-ink: #1a1203;
  --gold-soft: rgba(224, 180, 76, .16);
  --gold-glow: 0 0 0 1px rgba(224, 180, 76, .35), 0 6px 24px -6px rgba(224, 180, 76, .55);

  --navy-1: #1b3f7d;
  --navy-2: #3a6ea5;
  --link: #7fa8d6;

  --ok: #5fb894;
  --warn: #e3a35d;
  --danger: #e07474;
  --muted-pill: #9aa6b8;

  --text: #ffffff;
  --text-2: rgba(255, 255, 255, .7);
  --text-3: rgba(255, 255, 255, .45);

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sidebar-w: 256px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg-1: #f6efe0;
  --bg-2: #efe5cf;
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-border: rgba(11, 35, 71, .09);
  --glass-border-hover: rgba(11, 35, 71, .18);
  --glass-hi: rgba(255, 255, 255, .9);
  --row: rgba(11, 35, 71, .025);
  --row-hover: rgba(11, 35, 71, .05);
  --input: rgba(255, 255, 255, .75);
  --gold: #c39229;
  --gold-2: #d4a53c;
  --gold-soft: rgba(212, 165, 60, .18);
  --link: #1b3f7d;
  --ok: #2f8f68;
  --warn: #b8742b;
  --danger: #c04a4a;
  --muted-pill: #6b7789;
  --text: #0b2347;
  --text-2: rgba(11, 35, 71, .72);
  --text-3: rgba(11, 35, 71, .48);
  --shadow: 0 20px 50px -24px rgba(11, 35, 71, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 400 14px/1.5 var(--sans);
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 100%) fixed;
  background-color: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .2px; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------- Background spheres (behind everything) ---------- */
.spheres { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sphere-pos { position: absolute; left: 0; top: 0; will-change: transform; }
.sphere-par, .sphere-float { width: 100%; height: 100%; will-change: transform; }
.sphere { width: 100%; height: 100%; border-radius: 50%; }
.sphere--gold {
  background: radial-gradient(circle at 34% 28%, #ffeab0 0%, #f0c25e 18%, #d79a2c 46%, #8f5c12 78%, #4a2e06 100%);
  box-shadow: 0 0 120px 10px rgba(224, 160, 60, .28);
  filter: blur(1px);
}
.sphere--navy {
  background: radial-gradient(circle at 62% 30%, #6d9ad6 0%, #2f5fa8 26%, #163a78 58%, #0a1f48 100%);
  box-shadow: 0 0 140px 20px rgba(40, 90, 170, .25);
  filter: blur(2px);
}
.sphere--cream {
  background: radial-gradient(circle at 38% 30%, #ffffff 0%, #ece4d4 28%, #b9b2a5 64%, #6e6a63 100%);
  opacity: .55;
  filter: blur(10px);
}
.sphere--teal {
  background: radial-gradient(circle at 40% 32%, #b9f2e0 0%, #4cc6a4 32%, #1d7f6c 70%, #0b3c35 100%);
  opacity: .55;
  filter: blur(14px);
}
html[data-theme="light"] .sphere--navy { opacity: .55; }
html[data-theme="light"] .sphere--gold { opacity: .85; }
html[data-theme="light"] .sphere--cream { opacity: .9; }

/* ---------- Glass panel ---------- */
.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi);
}
.glass::before { /* soft highlight along the top edge */
  content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--glass-hi), transparent);
}
.panel { padding: 20px 22px; transition: transform .25s ease, border-color .25s ease; }
.panel:hover { transform: translateY(-2px); border-color: var(--glass-border-hover); }
.panel--flat:hover { transform: none; }
.panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel__title { font: 600 15px var(--sans); margin: 0; }
.panel__sub { color: var(--text-3); font-size: 12px; margin: 2px 0 0; }

/* ---------- App shell ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 18px; min-height: 100vh; padding: 16px; }
.sidebar { position: sticky; top: 16px; height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 16px 14px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }
.brand__logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, var(--gold-2), #9a6c17); color: var(--gold-ink); font: 700 13px var(--sans); overflow: hidden; flex: none; }
.brand__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand__text strong { display: block; font: 600 15px var(--sans); }
.brand__text small { color: var(--text-3); font-size: 11px; }

.side-search { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--input); color: var(--text-3); cursor: pointer; text-align: left; }
.side-search span { flex: 1; }
.kbd { font: 500 10px var(--sans); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--glass-border); color: var(--text-3); }

.nav { position: relative; flex: 1; overflow-y: auto; margin: 10px -4px 0; padding: 0 4px; scrollbar-width: thin; }
.nav__group { font: 600 10px var(--sans); letter-spacing: 1.4px; color: var(--text-3); text-transform: uppercase; padding: 14px 10px 6px; }
.nav__list { list-style: none; margin: 0; padding: 0; position: relative; }
.nav__item { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; color: var(--text-2); cursor: pointer; text-decoration: none !important; transition: color .2s; }
.nav__item:hover { color: var(--text); }
.nav__item.is-active { color: var(--gold-ink); font-weight: 500; }
.nav__item .badge { margin-left: auto; }
.nav__item.is-active .badge { background: rgba(26, 18, 3, .18); color: var(--gold-ink); }
.nav-pill { position: absolute; left: 4px; right: 4px; top: 0; height: 40px; border-radius: 12px; z-index: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 8px 22px -8px rgba(224, 180, 76, .7); }
.badge { min-width: 20px; padding: 1px 7px; border-radius: 20px; background: var(--glass-strong); color: var(--text-2); font: 600 10.5px/18px var(--sans); text-align: center; }

.side-foot { border-top: 1px solid var(--glass-border); padding-top: 10px; margin-top: 8px; }
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; color: var(--text-2); font-size: 13px; }
.toggle-row span { flex: 1; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 20px; border: 0; padding: 0; cursor: pointer; background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--glass-border); transition: background .25s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.switch[aria-checked="true"] { background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 600 12px var(--sans); color: #fff; background: linear-gradient(145deg, var(--navy-2), var(--navy-1)); }
.me__text { flex: 1; min-width: 0; }
.me__text strong { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__text small { display: block; color: var(--text-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Main + top bar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 4px 4px 0; }
.topbar__hello { flex: 1; min-width: 0; }
.topbar__hello h1 { font: 500 19px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__meta { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; flex-wrap: wrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(95, 184, 148, .2); display: inline-block; }
.crumb-sep { opacity: .6; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); transition: border-color .2s, box-shadow .2s; }
.icon-btn:hover { border-color: var(--glass-border-hover); box-shadow: var(--gold-glow); }
.icon-btn .count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--gold-2); color: var(--gold-ink); font: 700 10px/18px var(--sans); text-align: center; padding: 0 4px; }
.menu-btn { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); font: 500 13px var(--sans); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: box-shadow .2s, border-color .2s, transform .15s, background .2s; }
.btn:hover { border-color: var(--glass-border-hover); box-shadow: 0 0 0 1px rgba(224, 180, 76, .2), 0 6px 18px -8px rgba(224, 180, 76, .5); }
.btn:active { transform: scale(.97); }
.btn--gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-color: transparent; color: var(--gold-ink); font-weight: 600; }
.btn--gold:hover { box-shadow: var(--gold-glow); border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--icon { width: 32px; height: 32px; padding: 0; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- Views ---------- */
#view:focus { outline: none; }
.view { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 40px; line-height: 1.05; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.dash__bottom { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dash__side { display: flex; flex-direction: column; gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi__label { color: var(--text-3); font-size: 12px; }
.kpi__num { font: 600 30px/1.15 var(--sans); letter-spacing: -.5px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.kpi__row { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font: 500 11px var(--sans); background: var(--glass-strong); color: var(--text-2); }
.chip--up { background: rgba(95, 184, 148, .14); color: var(--ok); }
.spark { width: 70px; height: 24px; }
.spark path { fill: none; stroke: var(--navy-2); stroke-width: 1.6; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--input); border: 1px solid var(--glass-border); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 11px; border-radius: 999px; font: 500 11.5px var(--sans); color: var(--text-3); cursor: pointer; }
.seg button[aria-pressed="true"] { background: linear-gradient(135deg, var(--navy-2), var(--navy-1)); color: #fff; }
.legend { display: flex; gap: 14px; color: var(--text-3); font-size: 11.5px; align-items: center; }
.legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--navy-2); vertical-align: middle; margin-right: 5px; }
.legend i.dash { border-top-style: dashed; border-color: var(--text-3); }

.chart { position: relative; height: 260px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: var(--glass-border); }
.chart .axis text { fill: var(--text-3); font: 10.5px var(--sans); }
.chart .line { fill: none; stroke: url(#lineGrad); stroke-width: 2.4; stroke-linecap: round; }
.chart .prev { fill: none; stroke: var(--text-3); stroke-width: 1.4; stroke-dasharray: 4 5; }
.chart .hover-line { stroke: var(--glass-border-hover); }
.chart .hover-dot { opacity: 0; fill: var(--gold-2); stroke: var(--bg-1); stroke-width: 2; }
.tooltip { position: absolute; pointer-events: none; padding: 8px 11px; border-radius: 10px; font-size: 12px; white-space: nowrap; background: rgba(6, 16, 34, .92); color: #fff; border: 1px solid rgba(255, 255, 255, .12); transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .15s; }
.tooltip b { color: var(--gold-2); }
.tooltip small { display: block; color: rgba(255, 255, 255, .55); }

.ring { display: flex; align-items: center; gap: 18px; }
.ring svg { width: 120px; height: 120px; flex: none; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--glass-strong); stroke-width: 10; }
.ring .bar { fill: none; stroke: url(#goldGrad); stroke-width: 10; stroke-linecap: round; }
.ring__center { position: relative; }
.ring__label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 600 22px/1.1 var(--sans); }
.ring__label small { display: block; font: 400 11px var(--sans); color: var(--text-3); }
.kv { list-style: none; margin: 0; padding: 0; flex: 1; font-size: 12.5px; }
.kv li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; color: var(--text-2); }
.kv b { color: var(--text); font-weight: 500; text-align: right; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--glass-border); }
.list li:first-child { border-top: 0; }
.list__text { flex: 1; min-width: 0; }
.list__text strong { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list__text small { color: var(--text-3); font-size: 11.5px; }
.empty { color: var(--text-3); font-size: 13px; text-align: center; padding: 22px 10px; border: 1px dashed var(--glass-border); border-radius: var(--radius-sm); }

.stack { display: flex; height: 12px; border-radius: 8px; overflow: hidden; gap: 3px; margin: 6px 0 16px; }
.stack span { display: block; height: 100%; border-radius: 4px; transform-origin: left; }
.cat-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 12.5px; }
.cat-legend li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.cat-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.cat-legend b { margin-left: auto; color: var(--text); font-weight: 500; }

/* thumbnails: cover photo over a designed tile */
.thumb { position: relative; width: 38px; height: 38px; border-radius: 9px; flex: none; overflow: hidden; display: grid; place-items: center; font: 700 10px var(--sans); color: #fff; letter-spacing: .3px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb--lg { width: 100%; height: 92px; border-radius: 12px; font-size: 13px; }

/* ---------- Tabs ---------- */
.tabs { position: relative; display: flex; gap: 22px; border-bottom: 1px solid var(--glass-border); }
.tab { position: relative; border: 0; background: none; padding: 10px 0 12px; cursor: pointer; color: var(--text-3); font: 500 13.5px var(--sans); display: flex; align-items: center; gap: 7px; text-decoration: none !important; }
.tab[aria-selected="true"] { color: var(--text); }
.tab-line { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; border-radius: 2px; background: linear-gradient(90deg, var(--navy-2), var(--gold-2)); }
.tab-panel { min-width: 0; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--input); color: var(--text-3); }
.field input { border: 0; background: transparent; outline: 0; color: var(--text); width: 100%; min-width: 0; }
.field--grow { flex: 1; min-width: 200px; }
select.select { height: 38px; padding: 0 34px 0 12px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--input) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b4c6' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>") right 10px center / 14px no-repeat; appearance: none; cursor: pointer; }
select.select option { background: #0b1d3a; color: #fff; }
html[data-theme="light"] select.select option { background: #fff; color: #0b2347; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchip { border: 1px solid var(--glass-border); background: var(--input); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font: 500 12px var(--sans); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: background .2s, color .2s; }
.fchip b { font-weight: 600; color: var(--text-3); }
.fchip[aria-pressed="true"] { background: linear-gradient(135deg, var(--navy-2), var(--navy-1)); color: #fff; border-color: transparent; }
.fchip[aria-pressed="true"] b { color: rgba(255, 255, 255, .75); }

/* ---------- Table ---------- */
.table-wrap { padding: 8px 8px 4px; }
.table-meta { padding: 10px 12px 6px; color: var(--text-3); font-size: 12px; }
.table-scroll { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; }
.table th { text-align: left; font: 500 11.5px var(--sans); color: var(--text-3); padding: 8px 10px; white-space: nowrap; }
.table td { padding: 8px 10px; background: var(--row); white-space: nowrap; }
.table tr td:first-child { border-radius: 12px 0 0 12px; }
.table tr td:last-child { border-radius: 0 12px 12px 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover td { background: var(--row-hover); }
.table tbody tr.is-selected td { background: var(--gold-soft); }
.table .title-cell { white-space: normal; min-width: 200px; font-weight: 500; }
.table .title-cell small { display: block; color: var(--text-3); font-weight: 400; }
.code { font: 600 12px var(--sans); color: var(--text-2); letter-spacing: .3px; }
.check { width: 16px; height: 16px; accent-color: var(--gold-2); cursor: pointer; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 500 11.5px var(--sans); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--draft { color: var(--muted-pill); background: rgba(154, 166, 184, .13); }
.pill--review { color: var(--warn); background: rgba(227, 163, 93, .14); }
.pill--published { color: var(--ok); background: rgba(95, 184, 148, .14); }
.pill--archived { color: var(--link); background: rgba(58, 110, 165, .16); }
.catchip { display: inline-block; padding: 2px 8px; border-radius: 6px; font: 500 11px var(--sans); background: var(--glass-strong); color: var(--text-2); }

.bulkbar { position: fixed; left: 50%; bottom: 22px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: 999px; transform: translate(-50%, 140%); opacity: 0; }
.bulkbar strong { font-weight: 500; margin-right: 6px; white-space: nowrap; }

/* ---------- Board (kanban) ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col { display: flex; flex-direction: column; min-height: 420px; padding: 14px 12px; transition: box-shadow .25s, border-color .25s; }
.col:hover { transform: none; }
.col.is-target { border-color: rgba(224, 180, 76, .55); box-shadow: var(--shadow), 0 0 0 1px rgba(224, 180, 76, .35), 0 0 40px -8px rgba(224, 180, 76, .5), inset 0 0 40px -20px rgba(224, 180, 76, .45); }
.col__head { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.col__head h3 { font: 600 13.5px var(--sans); }
.col__head .pill::before { display: none; }
.col__desc { color: var(--text-3); font-size: 11.5px; padding: 2px 4px 10px; }
.col__list { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.col__empty { flex: 1; display: grid; place-items: center; color: var(--text-3); font-size: 12px; border: 1px dashed var(--glass-border); border-radius: 14px; min-height: 120px; }
.card { position: relative; padding: 10px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-border); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: border-color .2s; }
.card:hover { border-color: var(--glass-border-hover); }
.card__top { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 2px; }
.card__title { font-weight: 500; font-size: 13px; line-height: 1.3; }
.card__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--text-3); font-size: 11.5px; }
.card__menu { position: absolute; top: 14px; right: 14px; }
.card__menu .btn { background: rgba(4, 11, 24, .55); color: #fff; border-color: rgba(255, 255, 255, .15); }
.card.is-placeholder { opacity: .25; }
.ghost { position: fixed; z-index: 100; pointer-events: none; margin: 0; box-shadow: 0 30px 60px -15px rgba(0, 0, 0, .6), 0 0 0 1px rgba(224, 180, 76, .4); cursor: grabbing; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }

/* ---------- Popover menu ---------- */
.menu { position: fixed; z-index: 90; min-width: 190px; padding: 6px; border-radius: 14px; background: rgba(8, 20, 42, .96); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .6); color: #fff; }
html[data-theme="light"] .menu { background: rgba(255, 255, 255, .98); color: var(--text); border-color: var(--glass-border); }
.menu__label { font: 600 10px var(--sans); letter-spacing: 1.2px; text-transform: uppercase; opacity: .5; padding: 6px 10px 4px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; font-size: 13px; }
.menu button:hover, .menu button:focus-visible { background: rgba(224, 180, 76, .16); outline: 0; }
.menu button[disabled] { opacity: .4; cursor: default; background: none; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 999px; min-width: 280px; max-width: calc(100vw - 32px);
  background: #f6efe0; color: #0b2347; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .55); font-size: 13px; }
.toast span { flex: 1; }
.toast--error { background: #3a1416; color: #ffd9d9; }
.toast .btn { background: #0b2347; color: #fff; border: 0; }
.toast__bar { position: absolute; left: 18px; right: 18px; bottom: 4px; height: 2px; border-radius: 2px; background: rgba(11, 35, 71, .25); transform-origin: left; }

/* ---------- Command search ---------- */
.cmdk { position: fixed; inset: 0; z-index: 110; display: grid; place-items: start center; padding-top: 12vh; background: rgba(2, 6, 14, .55); }
.cmdk__box { width: min(620px, calc(100vw - 32px)); padding: 10px; background: rgba(8, 20, 42, .92); }
html[data-theme="light"] .cmdk__box { background: rgba(255, 255, 255, .95); }
.cmdk__input { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--glass-border); }
.cmdk__input input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; color: var(--text); }
.cmdk__list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.cmdk__list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--text-2); }
.cmdk__list li small { margin-left: auto; color: var(--text-3); }
.cmdk__list li.is-active { background: var(--gold-soft); color: var(--text); }

/* ---------- Forms / editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.editor__main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.editor__side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.inp { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--input); color: var(--text); outline: 0; transition: border-color .2s, box-shadow .2s; }
.inp:focus { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(224, 180, 76, .18); }
textarea.inp { resize: vertical; min-height: 84px; }
.inp.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(224, 116, 116, .18); }
.hint { color: var(--text-3); font-size: 11.5px; }
.err { color: var(--danger); font-size: 11.5px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="color"] { width: 42px; height: 40px; border: 1px solid var(--glass-border); border-radius: 10px; background: none; padding: 3px; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }

.dropzone { display: grid; place-items: center; gap: 6px; text-align: center; padding: 26px; border: 1.5px dashed var(--glass-border-hover); border-radius: 16px; color: var(--text-3); cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone.is-over { border-color: var(--gold-2); background: var(--gold-soft); color: var(--text); }
.dropzone .icon { width: 28px; height: 28px; color: var(--gold-2); }
.sortable { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sortable li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--row); border: 1px solid var(--glass-border); }
.sortable li.is-sorting { position: relative; z-index: 5; background: var(--glass-strong); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5); border-color: rgba(224, 180, 76, .45); }
.handle { cursor: grab; color: var(--text-3); touch-action: none; display: grid; place-items: center; padding: 4px; border: 0; background: none; }
.sortable .inp { padding: 7px 10px; }
.progress { height: 4px; border-radius: 4px; background: var(--glass-strong); overflow: hidden; flex: 1; min-width: 60px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy-2), var(--gold-2)); }
.upload-state { font-size: 11.5px; color: var(--text-3); width: 70px; text-align: right; }

/* live preview: spine + cover, like the public shelf */
.preview { display: flex; gap: 12px; align-items: stretch; justify-content: center; padding: 6px 0; }
.pv-spine { width: 46px; height: 230px; border-radius: 6px 3px 3px 6px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 12px 0; box-shadow: inset -6px 0 10px rgba(0, 0, 0, .25), inset 3px 0 4px rgba(255, 255, 255, .15); }
.pv-spine__title { writing-mode: vertical-rl; transform: rotate(180deg); font: 600 13px var(--serif); letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 150px; }
.pv-spine small { font: 600 9px var(--sans); letter-spacing: 1px; opacity: .8; }
.pv-cover { position: relative; width: 210px; height: 230px; border-radius: 4px 10px 10px 4px; overflow: hidden; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .7), inset 8px 0 12px -6px rgba(0, 0, 0, .35); }
.pv-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-cover__ring { position: absolute; top: 18px; right: 18px; width: 54px; height: 54px; border-radius: 50%; border: 1px solid currentColor; opacity: .35; }
.pv-cover small { font: 600 10px var(--sans); letter-spacing: 1.4px; text-transform: uppercase; opacity: .75; position: relative; }
.pv-cover strong { font: 600 24px/1.1 var(--serif); position: relative; margin-top: 4px; }
.pv-cover span { font-size: 11px; opacity: .8; position: relative; margin-top: 6px; }

/* ---------- Misc views ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--glass-border); }
.timeline li:first-child { border-top: 0; }
.timeline .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--glass-strong); color: var(--gold-2); flex: none; }
.timeline time { color: var(--text-3); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.range { width: 100%; accent-color: var(--gold-2); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(58, 110, 165, .14); color: var(--text-2); font-size: 12.5px; }
.notice .icon { color: var(--link); margin-top: 1px; }

/* ---------- Login ---------- */
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login__card { width: min(420px, 100%); padding: 34px 32px 28px; }
.login__card h1 { font-size: 34px; margin: 18px 0 4px; }
.login__card p { color: var(--text-2); margin: 0 0 22px; }
.login__card form { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .dash { grid-template-columns: 1fr; }
  .dash__side { display: grid; grid-template-columns: 1fr 1fr; }
  .editor { grid-template-columns: 1fr; }
  .editor__side { position: static; }
}
@media (max-width: 1100px) { /* tablet: sidebar collapses to icons */
  :root { --sidebar-w: 76px; }
  .sidebar { padding: 14px 10px; align-items: center; }
  .brand__text, .side-search span, .side-search .kbd, .nav__group, .nav__item span, .nav__item .badge, .toggle-row span, .me__text { display: none; }
  .side-search { width: 44px; justify-content: center; padding: 10px; }
  .nav { margin: 6px 0 0; width: 100%; }
  .nav__group { display: block; font-size: 0; padding: 8px 0 4px; border-top: 1px solid var(--glass-border); margin-top: 6px; }
  .nav__item { justify-content: center; padding: 10px; }
  .toggle-row { justify-content: center; padding: 6px 0; }
  .me { flex-direction: column; padding: 8px 0 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash__bottom { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) { /* mobile: slide-in menu */
  :root { --sidebar-w: 270px; }
  .app { grid-template-columns: 1fr; padding: 12px; }
  .sidebar { position: fixed; left: 12px; top: 12px; height: calc(100vh - 24px); width: var(--sidebar-w); align-items: stretch; transform: translateX(-110%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); background: rgba(6, 16, 34, .9); }
  html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .95); }
  body.menu-open .sidebar { transform: none; }
  .brand__text, .side-search span, .side-search .kbd, .nav__item span, .nav__item .badge, .toggle-row span, .me__text { display: initial; }
  .nav__group { display: block; font-size: 10px; border: 0; margin: 0; padding: 14px 10px 6px; }
  .nav__item { justify-content: flex-start; padding: 9px 12px; }
  .toggle-row { justify-content: flex-start; padding: 7px 10px; }
  .me { flex-direction: row; padding: 10px 8px 2px; }
  .side-search { width: 100%; justify-content: flex-start; }
  .menu-btn { display: grid; }
  .scrim { position: fixed; inset: 0; z-index: 15; background: rgba(2, 6, 14, .5); }
  .topbar .btn--gold .label, .topbar__date { display: none; }
  .page-head h2 { font-size: 32px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi__num { font-size: 24px; }
  .dash__side, .dash__bottom, .form-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, minmax(240px, 82vw)); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .ring svg { width: 96px; height: 96px; }
  .bulkbar { flex-wrap: wrap; border-radius: 20px; justify-content: center; width: calc(100vw - 24px); }
  .pv-cover { width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* =========================================================
   Photo manager (views/photos.js): upload queue + grid for large albums
   ========================================================= */
.pm { display: grid; gap: 14px; }
.pm-opts { font-size: 12.5px; color: var(--text-3); }
.pm-opts label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pm-opts .select { width: auto; height: 34px; padding-block: 0; }

/* upload queue */
.uq { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--glass-border); background: var(--glass); }
.uq__head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.uq__count { font-variant-numeric: tabular-nums; }
.uq__sub { color: var(--text-3); font-size: 12px; }
.uq__actions { margin-left: auto; display: flex; gap: 6px; }
.uq__bar { height: 6px; }
.uq.is-running .uq__bar span { transition: width .3s; }
.uq__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; overscroll-behavior: contain; }
.uq__row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 110px auto; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 8px; font-size: 12px; background: var(--row); }
.uq__row .progress { min-width: 0; }
.uq__name { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq__name .icon { flex: none; width: 14px; height: 14px; color: var(--text-3); }
.uq__state { color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq__row.is-done { opacity: .6; }
.uq__row.is-done .uq__state { color: var(--ok); }
.uq__row.is-failed, .uq__row.is-skipped { background: rgba(214, 87, 87, .12); }
.uq__row.is-failed .uq__state, .uq__row.is-skipped .uq__state { color: var(--danger); }
.uq__row.is-cancelled { opacity: .45; }
.uq__skipped { grid-column: 1 / -1; color: var(--text-2); }
.uq__skipped summary { cursor: pointer; color: var(--warn); }
.uq__skipped ul { margin: 6px 0 0; padding-left: 18px; max-height: 140px; overflow: auto; }

/* toolbar + bulk bar */
.pm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pm-count { font-size: 14px; margin-right: auto; font-variant-numeric: tabular-nums; }
.pm-search { width: min(260px, 100%); height: 34px; }
.pm-bulk { position: sticky; top: 76px; z-index: 5; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-radius: 14px;
  background: var(--glass-strong); border: 1px solid var(--gold-2); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pm-bulk[hidden] { display: none; }
.pm-bulk__n { margin-right: 6px; font-size: 13px; color: var(--gold-2); }
.pm-bulk__cap { display: inline-flex; gap: 6px; }
.pm-bulk__cap .inp { height: 30px; width: 220px; padding-block: 0; font-size: 12px; }
.pm-hint { margin: -4px 0 0; font-size: 11.5px; color: var(--text-3); }

/* grid */
.pm-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.pm-tile { position: relative; display: grid; gap: 6px; padding: 6px; border-radius: 12px; border: 1px solid transparent; background: var(--row); cursor: grab; user-select: none; touch-action: pan-y; transition: border-color .15s, background .15s, opacity .15s; }
.pm-tile:hover { background: var(--row-hover); }
.pm-tile:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.pm-tile.is-sel { border-color: var(--gold-2); background: var(--gold-soft); }
.pm-tile.is-dragging { opacity: .25; }
.pm-tile__img { position: relative; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--glass-strong); }
.pm-tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.pm-tile__img img.is-broken { opacity: 0; }
.pm-tile__n { position: absolute; left: 6px; top: 6px; min-width: 22px; padding: 1px 6px; border-radius: 10px; font-size: 10.5px; text-align: center; background: rgba(7, 26, 54, .72); color: #fff; font-variant-numeric: tabular-nums; }
.pm-tile__cover { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 10px; font-size: 10.5px; background: var(--gold); color: var(--gold-ink); }
.pm-tile__cover .icon { width: 11px; height: 11px; }
.pm-tile__check { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .85); background: rgba(7, 26, 54, .35); color: transparent; }
.pm-tile__check .icon { width: 13px; height: 13px; }
.pm-tile.is-sel .pm-tile__check { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.pm-tile__cap { width: 100%; min-width: 0; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--glass-border); background: var(--input); color: var(--text); font: inherit; font-size: 11.5px; cursor: text; }
.pm-tile__cap:focus { outline: 0; border-color: var(--gold-2); }
.pm-tile__cap.is-saved { border-color: var(--ok); }
.pm-grid.is-dragging .pm-tile { cursor: grabbing; }
.pm-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; margin: 0; border-color: var(--gold-2); background: var(--glass-strong); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); list-style: none; }
@media (max-width: 640px) {
  .uq__row { grid-template-columns: minmax(0, 1fr) 70px auto; }
  .uq__row .progress { display: none; }
  .pm-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .pm-bulk__cap .inp { width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .pm-tile, .uq.is-running .uq__bar span { transition: none; } }

/* =========================================================
   Website editing: Pages list (views/pages.js), page editor (views/page-editor.js),
   block forms and media picker (views/fields.js)
   ========================================================= */
.ta-r { text-align: right; }
.chip--warn { background: rgba(227, 163, 93, .16); color: var(--warn); }
.pg-group { padding: 6px 8px 6px; }
.pg-group__head { display: flex; align-items: baseline; gap: 10px; padding: 12px 12px 2px; }
.pg-group__head h3 { font: 600 22px/1.1 var(--serif); }
.pg-group__head small { color: var(--text-3); font-size: 12px; }
.pg-status { display: flex; gap: 6px; align-items: center; }
.table td small { display: block; color: var(--text-3); font-size: 11.5px; }

/* ---------- editor layout: forms left, live preview right ---------- */
.pe-head h2 { font-size: 34px; }
.pe-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0 0; color: var(--text-3); font-size: 12px; }
.pe-sub > span:first-child { display: inline-flex; gap: 6px; align-items: center; }
.pe-sub .code { color: var(--link); }
.pe-saved { color: var(--text-3); }
.pe { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 18px; align-items: start; }
.pe-left { padding: 0; overflow: hidden; }
.pe-right { position: sticky; top: 16px; padding: 10px; display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 32px); min-height: 520px; }
.pe-tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--glass-border); }
.pe-tabs button { flex: 1; padding: 10px 8px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3); font: 500 12.5px var(--sans); cursor: pointer; }
.pe-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--gold-2); }
.pe-pane { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pe-pane[hidden] { display: none; }
.pe-hint { margin: 0; }
.pe-path { display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.pe-path .inp { flex: 1; }
.pe-og { margin-top: 4px; }

/* blocks */
.pe-blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pe-block { border-radius: 14px; border: 1px solid var(--glass-border); background: var(--row); transition: border-color .2s, background .2s; }
.pe-block.is-open { border-color: rgba(224, 180, 76, .4); background: var(--glass); }
.pe-block.is-hidden .pe-block__title, .pe-block.is-hidden .pe-block__icon { opacity: .45; }
.pe-block.is-hidden [data-hide] { color: var(--gold-2); }
.pe-block.is-sorting { position: relative; z-index: 5; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5); border-color: rgba(224, 180, 76, .45); }
.pe-block__head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.pe-block__icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--gold-soft); color: var(--gold-2); }
.pe-block__title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 4px 6px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.pe-block__title b { font-weight: 500; font-size: 13px; }
.pe-block__title small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 11.5px; }
.pe-block__chev { display: grid; place-items: center; color: var(--text-3); transition: transform .2s; cursor: pointer; }
.pe-block.is-open .pe-block__chev { transform: rotate(180deg); }
.pe-block__body:empty { display: none; }
.pe-block__body { padding: 4px 14px 16px; border-top: 1px solid var(--glass-border); }
.pe-note { margin: 12px 0 0; background: rgba(227, 163, 93, .12); }
.pe-fields { margin-top: 12px; }
.pe-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border: 1px dashed var(--glass-border-hover); border-radius: 14px; background: none; color: var(--text-2); font: 500 13px var(--sans); cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.pe-add:hover { border-color: var(--gold-2); color: var(--gold-2); background: var(--gold-soft); }

/* live preview */
.pe-prev__bar { display: flex; align-items: center; gap: 10px; }
.pe-prev__state { flex: 1; color: var(--text-3); font-size: 12px; }
.pe-prev__stage { position: relative; flex: 1; overflow: hidden; border-radius: 12px; background: #fff; }
.pe-prev__stage iframe { position: absolute; left: 0; top: 0; border: 0; background: #fff; transform-origin: 0 0; }

/* Google preview */
.gp { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 12px; background: #fff; font-family: Arial, sans-serif; }
.gp__url { color: #202124; font-size: 12px; }
.gp__title { color: #1a0dab; font-size: 18px; line-height: 1.3; }
.gp__desc { color: #4d5156; font-size: 13px; line-height: 1.45; }
.hint.is-over { color: var(--warn); }

/* ---------- block forms (fields.js) ---------- */
.fe-grid { display: flex; flex-direction: column; gap: 12px; }
.fe-field[hidden] { display: none; }
.fe-adv { margin-top: 12px; }
.fe-adv summary { color: var(--text-3); font-size: 12px; cursor: pointer; }
.fe-adv > .fe-grid { margin-top: 10px; }
.fe-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.fe-check input { width: 16px; height: 16px; accent-color: var(--gold); }
.fe-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fe-chip { position: relative; cursor: pointer; }
.fe-chip input { position: absolute; opacity: 0; pointer-events: none; }
.fe-chip span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--input); color: var(--text-2); font-size: 12px; transition: background .2s, border-color .2s, color .2s; }
.fe-chip input:checked + span { background: var(--gold-soft); border-color: rgba(224, 180, 76, .55); color: var(--text); }
.fe-chip input:focus-visible + span { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.fe-inline { display: flex; align-items: center; gap: 6px; }
.fe-inline .inp { color-scheme: dark; }
html[data-theme="light"] .fe-inline .inp { color-scheme: light; }
.fe-rich { border-radius: 12px; overflow: hidden; border: 1px solid var(--glass-border); background: var(--input); margin-top: 6px; }
.fe-rich .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--glass-border); }
.fe-rich .ql-container.ql-snow { border: 0; font: 13.5px/1.6 var(--sans); color: var(--text); }
.fe-rich .ql-editor { min-height: 110px; }
.fe-rich .ql-snow .ql-stroke { stroke: var(--text-2); }
.fe-rich .ql-snow .ql-fill { fill: var(--text-2); }
.fe-rich .ql-snow .ql-picker { color: var(--text-2); }
.fe-rich .ql-snow .ql-picker-options { background: var(--bg-2); }
.fe-image { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--input); }
.fe-image__thumb { display: grid; place-items: center; flex: none; width: 56px; height: 42px; overflow: hidden; border-radius: 8px; background: var(--glass-strong); color: var(--text-3); }
.fe-image__thumb img { width: 100%; height: 100%; object-fit: cover; }
.fe-image__thumb.is-missing { border: 1px dashed var(--warn); color: var(--warn); }
.fe-image__text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; }
.fe-image__text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-image__text small { color: var(--text-3); }
.fe-object { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--glass-border); border-radius: 12px; }
.fe-object legend { padding: 0 6px; color: var(--text-2); font-size: 12px; }
.fe-list__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fe-list__head small { color: var(--text-3); }
.fe-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fe-item { border-radius: 12px; border: 1px solid var(--glass-border); background: var(--row); }
.fe-item.is-open { background: var(--glass); }
.fe-item.is-sorting { position: relative; z-index: 5; box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .5); }
.fe-item__head { display: flex; align-items: center; gap: 4px; padding: 4px 6px; }
.fe-item__title { flex: 1; min-width: 0; padding: 6px; border: 0; background: none; color: var(--text); text-align: left; font-size: 12.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-item__body:empty { display: none; }
.fe-item__body { padding: 4px 12px 12px; border-top: 1px solid var(--glass-border); }
.fe-item__body > .fe-grid { margin-top: 10px; }
.fe-table { margin-top: 6px; overflow-x: auto; }
.fe-table table { border-collapse: separate; border-spacing: 4px; }
.fe-table th, .fe-table td { padding: 0; min-width: 110px; }
.fe-table .inp { padding: 7px 9px; font-size: 12.5px; }
.fe-table th .inp { font-weight: 600; }
.fe-table .fe-table__x { min-width: 0; width: 34px; }
.fe-table__tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fe-yt { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.fe-yt:empty { display: none; }
.fe-yt img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.fe-yt .hint { display: inline-flex; align-items: center; gap: 5px; }
.fe-albums { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.fe-albums__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fe-albums__list li:not(.hint) { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 10px; border: 1px solid var(--glass-border); background: var(--row); }
.fe-albums__list li > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12.5px; }
.fe-albums__list b { font-weight: 500; }
.fe-albums__list small { color: var(--text-3); }
.fe-albums__dot { flex: none; width: 12px; height: 16px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.fe-albums .is-over { color: var(--warn); }

/* ---------- dialogs: media picker, add block, new page, history ---------- */
.mp-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 14, .6); }
.mp { display: flex; flex-direction: column; gap: 12px; width: min(900px, 100%); max-height: calc(100vh - 32px); padding: 18px; background: rgba(8, 20, 42, .96); overflow: auto; }
html[data-theme="light"] .mp { background: rgba(255, 255, 255, .98); }
.mp--small { width: min(480px, 100%); }
.mp--wide { width: min(1000px, 100%); }
.mp__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mp__head h3 { font: 600 26px/1.1 var(--serif); }
.mp__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mp__search { flex: 1; min-width: 220px; }
.mp__missing { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.mp__upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border: 1px dashed var(--glass-border-hover); border-radius: 12px; }
.mp__upload .inp { flex: 1; min-width: 180px; }
.mp__upload input[type=file] { max-width: 220px; font-size: 12px; color: var(--text-2); }
.mp__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; min-height: 120px; }
.mp__grid > .empty { grid-column: 1 / -1; }
.mp__item { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--row); color: var(--text); text-align: left; cursor: pointer; transition: border-color .2s, transform .15s; }
.mp__item:hover, .mp__item:focus-visible { border-color: var(--gold-2); transform: translateY(-2px); outline: 0; }
.mp__item small { color: var(--text-3); font-size: 11px; }
.mp__img { display: grid; place-items: center; align-content: center; gap: 4px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--glass-strong); color: var(--text-3); }
.mp__img img { width: 100%; height: 100%; object-fit: cover; }
.mp__item.is-missing .mp__img { border: 1px dashed var(--warn); color: var(--warn); }
.mp__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.mp__count { margin: 0; color: var(--text-3); font-size: 12px; }
.mp__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.ab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ab-item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--row); color: var(--text); text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.ab-item .icon { color: var(--gold-2); font-size: 18px; }
.ab-item b { font-weight: 500; font-size: 12.5px; }
.ab-item:hover, .ab-item:focus-visible { border-color: var(--gold-2); background: var(--gold-soft); outline: 0; }
.hi { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; min-height: 300px; }
.hi__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.hi__list button { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: var(--row); color: var(--text); text-align: left; cursor: pointer; }
.hi__list button[aria-pressed="true"] { border-color: rgba(224, 180, 76, .5); background: var(--gold-soft); }
.hi__list b { font-weight: 500; font-size: 12.5px; }
.hi__list small { color: var(--text-3); font-size: 11px; }
.hi__cmp { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hi__rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; font-size: 12.5px; }
.hi__rows li { padding: 6px 10px; border-radius: 8px; background: var(--row); border-left: 3px solid var(--glass-border-hover); }
.hi__rows .hi__added { border-left-color: var(--ok); }
.hi__rows .hi__removed { border-left-color: var(--danger); }
.hi__rows .hi__changed { border-left-color: var(--warn); }
.hi__rows .hi__same { color: var(--text-3); }

@media (max-width: 1100px) {
  .pe { grid-template-columns: minmax(0, 1fr); }
  .pe-right { position: relative; top: 0; height: 70vh; }
}
@media (max-width: 700px) {
  .hi { grid-template-columns: minmax(0, 1fr); }
  .hi__list { max-height: 30vh; }
}

/* =========================================================
   Events & News (views/events.js, views/post-editor.js)
   ========================================================= */
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font: 500 12px var(--sans); color: var(--text-3); text-decoration: none; }
.seg a .icon { width: 14px; height: 14px; }
.seg a[aria-pressed="true"] { background: linear-gradient(135deg, var(--navy-2), var(--navy-1)); color: #fff; }
.seg button small { opacity: .7; margin-left: 2px; }
.ev-type--event { color: var(--link); background: rgba(58, 110, 165, .16); }
.ev-type--news { color: var(--ok); background: rgba(95, 184, 148, .14); }
.ev-type--holiday { color: var(--gold); background: var(--gold-soft); }
.ev-star { display: inline-flex; margin-left: 6px; color: var(--gold); vertical-align: middle; }
.ev-star .icon { width: 14px; height: 14px; fill: currentColor; }
.ev-when { white-space: nowrap; font-weight: 500; }
.ev-when small, .ev-now { display: block; font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.ev-now { color: var(--gold) !important; font-weight: 600; }
.ev-typesel .inp { min-width: 150px; }
.pe-sub .catchip { margin-right: 6px; }
.fe-event__state:empty { display: none; }

/* calendar view */
.evc { padding: 16px; }
.evc__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.evc__bar h3 { min-width: 170px; text-align: center; font: 600 22px var(--serif); }
.evc__key { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.evc-k { display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 3px; }
.evc-k--event { background: var(--navy-2); } .evc-k--news { background: var(--ok); } .evc-k--holiday { background: var(--gold); }
.evc-k--draft { border: 1px dashed var(--text-3); }
.evc__grid { width: 100%; min-width: 720px; border-collapse: collapse; table-layout: fixed; }
.evc__grid th { padding: 6px; font: 600 10.5px var(--sans); letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-3); text-align: left; }
.evc-day { height: 104px; padding: 5px; vertical-align: top; border: 1px solid var(--glass-border); background: var(--row); }
.evc-day.is-out { opacity: .45; }
.evc-day.is-holiday { background: var(--gold-soft); }
.evc-day.is-today .evc-day__n { background: var(--gold); color: var(--gold-ink); }
.evc-day__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.evc-day__n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 600; }
.evc-add { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--text-3); opacity: 0; transition: opacity .2s, background .2s; }
.evc-add .icon { width: 14px; height: 14px; }
.evc-day:hover .evc-add, .evc-add:focus-visible { opacity: 1; }
.evc-add:hover { background: var(--glass-strong); color: var(--gold); }
.evc-chip { display: block; overflow: hidden; margin-top: 3px; padding: 2px 6px; border-radius: 5px; border-left: 3px solid; font-size: 11px; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; color: var(--text); text-decoration: none; background: var(--glass-strong); }
.evc-chip b { font-weight: 600; }
.evc-chip--event { border-color: var(--navy-2); } .evc-chip--news { border-color: var(--ok); } .evc-chip--holiday { border-color: var(--gold); color: var(--gold); }
.evc-chip.is-draft { border-left-style: dashed; opacity: .7; }
.evc-chip:hover { background: var(--glass-hi); }

/* post editor */
.pe-prev__stage { position: relative; }
.pe-prev__none { position: absolute; inset: 0; z-index: 1; background: var(--bg-2); display: grid; place-content: center; justify-items: center; gap: 12px; padding: 30px; text-align: center; color: var(--text-2); }
.pe-prev__none > .icon { width: 42px; height: 42px; color: var(--gold); }
.pe-prev__none p { max-width: 340px; }
.pe-tabs [hidden] { display: none; }

/* ---------- Settings → Advertisement popup (live preview mimics public/assets/css/style.css .ad-popup) ---------- */
.ad-panel { grid-column: 1 / -1; }
.ad-panel .panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ad-panel__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ad-panel__fields { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ad-panel__fields[disabled] { opacity: .75; }
.ad-panel__check { align-self: flex-start; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.ad-panel__radios { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.ad-panel__radios legend { margin-bottom: 6px; }
.ad-panel__radios .chip { padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.ad-preview { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; }
.ad-preview__stage { display: grid; place-items: center; min-height: 320px; padding: 22px; border-radius: 14px; background: rgba(4, 14, 30, .82); background-image: radial-gradient(circle at 30% 20%, rgba(27, 63, 125, .5), transparent 60%); }
.ad-preview__card { position: relative; width: min(320px, 100%); overflow: hidden; border-top: 4px solid #d4a53c; border-radius: 12px; background: #fff; color: #1d2939; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); transition: opacity .2s; }
.ad-preview__card.is-off { opacity: .55; }
.ad-preview__close { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(7, 26, 54, .78); color: #fff; font-size: 14px; }
.ad-preview__card.is-text .ad-preview__close { background: #fbf8f1; color: #0b2347; }
.ad-preview__media { background: #071a36; }
.ad-preview__media img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.ad-preview__body { padding: 16px 18px 18px; text-align: center; }
.ad-preview__card.is-text .ad-preview__body { padding-top: 38px; }
.ad-preview__title { display: block; font: 700 23px/1.15 var(--serif); color: #0b2347; }
.ad-preview__text { margin: 8px 0 0; color: #5d6b80; font-size: 12.5px; line-height: 1.65; overflow-wrap: anywhere; }
.ad-preview__btn { display: inline-block; margin-top: 14px; padding: 9px 20px; border-radius: 40px; background: linear-gradient(135deg, #e0b44c, #d4a53c); color: #071a36; font: 600 12.5px var(--sans); }
.ad-preview__empty { margin: 0; padding: 40px 20px; text-align: center; color: #5d6b80; font-size: 12.5px; }
@media (max-width: 980px) { .ad-panel__grid { grid-template-columns: 1fr; } .ad-preview { position: static; } }
.ad-panel div.lbl, .ad-panel legend.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-family: var(--sans); }
.ad-panel legend.lbl { padding: 0; }
