/* ===========================================================================
   3DARCO — dashboard
   =========================================================================== */

:root {
  --bg:        #08080a;
  --panel:     #0e0e12;
  --panel-2:   #131318;
  --line:      rgba(255,255,255,.085);
  --line-2:    rgba(255,255,255,.16);
  --ink:       #f5f5f7;
  --ink-2:     #c3c3c9;
  --ink-3:     #86868b;
  --ink-4:     #5a5a60;
  --accent:    #a61d2e;   /* brand crimson            */
  --accent-2:  #d93a4c;   /* bright crimson           */
  --accent-3:  #f2707e;   /* soft rose, text on dark  */
  --deep:      #7a1728;
  --ember:     #ff7a45;   /* warm tertiary            */
  --green:     #30d158;
  --amber:     #ff9f0a;
  --red:       #ff5a4e;
  --sidebar:   250px;
  --r:         14px;
  --r-lg:      20px;
  --font:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-fa:   "Vazirmatn", var(--font);
  --mono:      ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease:      cubic-bezier(.22,1,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body { font-family: var(--font-fa); line-height: 1.8; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* --accent-2: brand crimson alone is 2.84:1 on the dark shell, under the 3:1
   WCAG minimum for focus indicators. */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #26262c; border-radius: 99px; border: 2px solid var(--bg); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

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

/* Place the two real regions explicitly. Without this, any additional child of
   .shell (the mobile scrim, a debug banner, stray markup) auto-places into
   column 2 and pushes .main onto row 2 — where it inherits the 250px sidebar
   column and the content area appears empty. */
.side { grid-column: 1; grid-row: 1; }
.main { grid-column: 2; grid-row: 1; }

/* The scrim only exists for the mobile drawer. It must not occupy a grid cell
   on desktop, so it is display:none until the drawer breakpoint. */
.scrim { display: none; }

.side {
  background: var(--panel);
  border-inline-end: 1px solid var(--line);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side__brand { display: flex; align-items: center; padding: 6px 10px 22px; }
.side__brand img {
  height: 28px; width: auto;
  transition: filter .3s var(--ease);
}
.side__brand:hover img { filter: drop-shadow(0 0 14px rgba(217,58,76,.5)); }

.side__label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-4); padding: 16px 12px 8px;
}
html[dir="rtl"] .side__label { letter-spacing: 0; text-transform: none; font-size: 12px; }

.side__link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-3);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.side__link:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.side__link.is-active {
  background: linear-gradient(90deg, rgba(166,29,46,.34), rgba(166,29,46,.06));
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--accent);
}
html[dir="rtl"] .side__link.is-active { box-shadow: inset -2px 0 0 var(--accent); }
.side__link .ico { flex-shrink: 0; opacity: .9; }
.side__count {
  margin-inline-start: auto; font-size: 11.5px; font-weight: 600;
  background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 99px;
}
.side__count--hot { background: rgba(217,58,76,.28); color: #f2707e; }
.side__foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(8,8,10,.78); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 14px clamp(16px, 2.6vw, 32px);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.topbar h1 {
  font-size: 20px; font-weight: 620; letter-spacing: -.03em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 560px) {
  .topbar { padding-block: 11px; gap: 10px; }
  .topbar h1 { font-size: 17px; }
}
.topbar__right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: clamp(18px, 2.6vw, 32px); flex: 1; }

@media (max-width: 940px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50;
    width: var(--sidebar); transform: translateX(-110%);
    transition: transform .35s var(--ease);
  }
  html[dir="rtl"] .side { transform: translateX(110%); }
  .side.is-open { transform: none !important; }
  .side-toggle { display: inline-flex !important; }
  /* Single column here, so .main must come back to column 1. */
  .main { grid-column: 1; grid-row: 1; }
  .scrim {
    display: block;
    position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.6);
    opacity: 0; visibility: hidden; transition: .3s;
  }
  .scrim.is-open { opacity: 1; visibility: visible; }
}
.side-toggle { display: none; }

/* ------------------------------------------------------------------ cards */
.k-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; position: relative; overflow: hidden;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.kpi:hover { border-color: var(--line-2); transform: translateY(-2px); }
.kpi__glow {
  position: absolute; width: 160px; height: 160px; border-radius: 50%;
  filter: blur(58px); opacity: .3; top: -80px; inset-inline-end: -50px; background: var(--accent);
}
.kpi__label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-4); display: flex; align-items: center; gap: 7px; margin-bottom: 12px;
}
html[dir="rtl"] .kpi__label { letter-spacing: 0; text-transform: none; font-size: 13px; }
.kpi__value { font-size: 32px; font-weight: 650; letter-spacing: -.04em; line-height: 1; }
.kpi__sub { margin-top: 9px; font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.trend { font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.trend--up { color: var(--green); }
.trend--down { color: var(--red); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden;
}
.card__head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card__head h2 { font-size: 15px; font-weight: 620; letter-spacing: -.02em; }
.card__head .right { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.card__body { padding: 20px; }

.cols { display: grid; gap: 14px; }
.cols--2 { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
@media (max-width: 1080px) { .cols--2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ chart */
.chart { width: 100%; height: 210px; display: block; }
/* X labels live in HTML, not the SVG: the SVG is stretched horizontally
   (preserveAspectRatio="none") which would squash any text inside it. */
.chart-x {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-4);
}
.chart-x span:first-child { text-align: start; }
.chart-x span:last-child  { text-align: end; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-inline-end: 6px; }

.bars { display: grid; gap: 12px; }
.bar__row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; }
.bar__label { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--ember)); }

.donut { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut svg { flex-shrink: 0; }
.donut__legend { display: grid; gap: 9px; font-size: 13.5px; flex: 1; min-width: 140px; }
.donut__legend div { display: flex; align-items: center; gap: 9px; }
.donut__legend i { width: 9px; height: 9px; border-radius: 3px; }
.donut__legend b { margin-inline-start: auto; font-family: var(--mono); }

/* ------------------------------------------------------------------ table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: start; padding: 11px 18px;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-4); border-bottom: 1px solid var(--line); white-space: nowrap;
}
html[dir="rtl"] thead th { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
tbody td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: rgba(255,255,255,.025); }
tbody tr:last-child td { border-bottom: 0; }
td.actions { text-align: end; white-space: nowrap; }
td.actions > * { vertical-align: middle; }
td.actions > * + * { margin-inline-start: 6px; }

.thumb {
  width: 46px; height: 34px; border-radius: 7px; object-fit: cover;
  border: 1px solid var(--line); background: var(--panel-2); flex-shrink: 0;
}
.cell-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-title b { font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; }
.cell-title small { color: var(--ink-4); font-size: 12px; }

/* ------------------------------------------------------------------ bits */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.badge--pub    { background: rgba(48,209,88,.14);  color: #8ef0a8; border-color: rgba(48,209,88,.3); }
.badge--draft  { background: rgba(255,255,255,.07); color: var(--ink-3); border-color: var(--line); }
.badge--new    { background: rgba(217,58,76,.18); color: #f2707e; border-color: rgba(217,58,76,.36); }
.badge--cont   { background: rgba(255,159,10,.14); color: #ffc879; border-color: rgba(255,159,10,.3); }
.badge--qual   { background: rgba(48,209,88,.14); color: #8ef0a8; border-color: rgba(48,209,88,.3); }
.badge--closed { background: rgba(255,255,255,.05); color: var(--ink-4); border-color: var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--ink); color: #000; border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: .22s var(--ease); white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255,255,255,.13); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: rgba(255,255,255,.06); box-shadow: none; }
.btn--accent { background: var(--accent); color: #fff; }
.btn--danger { background: transparent; color: #ff9c92; border-color: rgba(255,90,78,.38); }
.btn--danger:hover { background: rgba(255,90,78,.14); box-shadow: none; }
.btn--sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn--icon { padding: 7px; border-radius: 9px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 7px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--line); color: var(--ink-3); transition: .2s var(--ease);
}
.tab:hover { border-color: var(--line-2); color: var(--ink); }
.tab.is-active { background: var(--ink); color: #000; border-color: var(--ink); font-weight: 620; }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 16px; }
.field > label {
  display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px;
}
html[dir="rtl"] .field > label { letter-spacing: 0; text-transform: none; font-size: 13px; }
.input, .textarea, .select {
  width: 100%; background: rgba(255,255,255,.04);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 14.5px; transition: .2s var(--ease);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2386868b' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-inline-end: 36px; }
html[dir="rtl"] .select { background-position: left 12px center; padding-inline-end: 13px; padding-inline-start: 36px; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--accent-2); background: rgba(166,29,46,.10);
  box-shadow: 0 0 0 3px rgba(166,29,46,.22);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
/* `position: relative` above matters: without it the visually hidden input
   escapes to the nearest positioned ancestor and drags focus with it. */
.switch input { position: absolute; inset-inline-start: 0; top: 0; width: 40px; height: 23px; opacity: 0; margin: 0; cursor: pointer; }
.switch input:focus-visible + i { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.switch i {
  width: 40px; height: 23px; border-radius: 99px; background: rgba(255,255,255,.13);
  position: relative; transition: background .25s var(--ease); flex-shrink: 0;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 17px; height: 17px; border-radius: 99px; background: #fff;
  transition: transform .25s var(--ease);
}
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(17px); }
html[dir="rtl"] .switch input:checked + i::after { transform: translateX(-17px); }

.searchbox { position: relative; display: flex; align-items: center; }
.searchbox .ico { position: absolute; inset-inline-start: 11px; color: var(--ink-4); pointer-events: none; }
.searchbox .input { padding-inline-start: 36px; min-width: 190px; }

/* ------------------------------------------------------------------ misc */
.alert { border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert--success { background: rgba(48,209,88,.1); border-color: rgba(48,209,88,.3); color: #8ef0a8; }
.alert--error   { background: rgba(255,90,78,.12); border-color: rgba(255,90,78,.32); color: #ffab9f; }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }
.empty .ico { margin: 0 auto 14px; color: var(--ink-4); }

.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

.feed { display: grid; gap: 2px; }
.feed li { display: flex; align-items: center; gap: 11px; padding: 9px 0; font-size: 13.5px; }
.feed li + li { border-top: 1px solid var(--line); }
.feed .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--accent); flex-shrink: 0; }
.feed time { margin-inline-start: auto; color: var(--ink-4); font-size: 12px; white-space: nowrap; }

.dropzone {
  border: 1.6px dashed var(--line-2); border-radius: var(--r-lg);
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: .25s var(--ease); color: var(--ink-3);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent-2); background: rgba(166,29,46,.10); color: var(--ink); }
.dropzone .ico { margin: 0 auto 12px; }

.media-upload { display: grid; gap: 10px; }
.media-upload__drop {
  width: 100%; min-height: 132px; padding: 22px;
  border: 1px dashed rgba(255,255,255,.20); border-radius: 14px;
  background: rgba(255,255,255,.025); color: var(--ink-3);
  display: grid; place-items: center; align-content: center; gap: 8px;
  text-align: center; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.media-upload__drop:hover,
.media-upload.is-over .media-upload__drop {
  border-color: var(--accent-2); background: rgba(166,29,46,.10); color: var(--ink);
}
.media-upload__drop:focus-visible {
  outline: 3px solid rgba(217,58,76,.34); outline-offset: 3px; border-color: var(--accent-2);
}
.media-upload.is-uploading .media-upload__drop { cursor: progress; opacity: .72; }
.media-upload__title { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.media-upload__hint { max-width: 52ch; font-size: 12px; line-height: 1.6; }
.media-upload__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.media-upload__status { min-height: 20px; font-size: 12px; color: var(--ink-3); }
.media-upload__status[data-state="error"] { color: #ff9a94; }
.media-upload__status[data-state="success"] { color: #72d6a0; }
.media-upload__preview {
  position: relative; overflow: hidden; min-height: 88px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025);
}
.media-upload__preview img,
.media-upload__preview video {
  display: block; width: 100%; max-height: 220px; object-fit: cover;
}
.media-upload__filename {
  display: block; padding: 8px 10px; overflow: hidden;
  color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  text-overflow: ellipsis; white-space: nowrap;
}
.gallery-editor { display: grid; gap: 10px; }
.gallery-upload {
  min-height: 128px; padding: 20px;
  display: grid; place-items: center; align-content: center; gap: 7px;
  border: 1px dashed rgba(255,255,255,.20); border-radius: 14px;
  background: rgba(255,255,255,.025); color: var(--ink-3);
  text-align: center; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.gallery-upload strong { color: var(--ink); font-size: 13.5px; }
.gallery-upload span { font-size: 12px; }
.gallery-upload:hover,
.gallery-upload.is-over {
  border-color: var(--accent-2); background: rgba(166,29,46,.10); color: var(--ink);
}
.gallery-upload:focus-visible {
  outline: 3px solid rgba(217,58,76,.34); outline-offset: 3px; border-color: var(--accent-2);
}
.gallery-upload.is-uploading { opacity: .7; cursor: progress; }
.gallery-editor__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.gallery-editor__item {
  position: relative; overflow: hidden; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
}
.gallery-editor__item img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery-editor__item span {
  display: block; padding: 7px 9px; overflow: hidden;
  font-size: 11px; color: var(--ink-3); text-overflow: ellipsis; white-space: nowrap;
}
.gallery-editor__item button {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
  background: rgba(0,0,0,.72); color: #fff; cursor: pointer;
}
.cinema-meta-form {
  display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 18px;
  padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2);
}
.cinema-meta-form__preview video {
  display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover;
  border-radius: 10px; background: #000;
}
@media (max-width: 760px) {
  .cinema-meta-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .media-upload__drop { transition: none; }
}

.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mediacard {
  position: relative; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; background: var(--panel-2); aspect-ratio: 4/3;
}
.mediacard img { width: 100%; height: 100%; object-fit: cover; }
.mediacard__ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-4); }
.mediacard__bar {
  position: absolute; inset-inline: 0; bottom: 0; padding: 20px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.88));
  font-size: 11.5px; display: flex; align-items: center; gap: 8px;
}
.mediacard__bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mediacard__del {
  position: absolute; top: 7px; inset-inline-end: 7px;
  width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.55); backdrop-filter: blur(8px);
  display: grid; place-items: center; cursor: pointer; color: #ff8a82;
  opacity: 0; transition: opacity .22s;
}
.mediacard:hover .mediacard__del,
.mediacard__del:focus-visible { opacity: 1; }
/* Touch devices have no hover state, so the control must always be visible. */
@media (hover: none) { .mediacard__del { opacity: 1; } }

/* ---------------------------------------------------- content workspaces */
.collection-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
  margin-bottom: 16px; padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line); border-radius: 22px;
  background: radial-gradient(circle at 85% 0%, rgba(217,58,76,.22), transparent 38%),
              linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.015));
}
.collection-hero > * { position: relative; z-index: 1; }
.collection-hero__eyebrow {
  margin-bottom: 7px; color: #f2707e; font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
html[dir="rtl"] .collection-hero__eyebrow { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.collection-hero h2 { max-width: 760px; font-size: clamp(22px, 3vw, 34px); line-height: 1.16; letter-spacing: -.04em; }
.collection-hero p:last-child { max-width: 690px; margin-top: 10px; color: var(--ink-3); font-size: 14px; line-height: 1.7; }
.collection-hero__cta { min-height: 46px; flex-shrink: 0; }

.collection-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin-bottom: 16px;
}
.collection-metrics > div {
  min-height: 94px; padding: 16px;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  align-items: center; column-gap: 12px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
}
.collection-metrics span {
  grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center;
  color: #f2707e; border: 1px solid rgba(217,58,76,.25);
  border-radius: 11px; background: rgba(217,58,76,.11);
}
.collection-metrics b { align-self: end; font-size: 22px; line-height: 1; letter-spacing: -.03em; }
.collection-metrics small { align-self: start; margin-top: 5px; color: var(--ink-4); font-size: 11.5px; }

.collection-card { border-radius: 18px; }
.collection-card .card__head { padding-block: 14px; }
.collection-card .table-wrap { padding: 14px; overflow: visible; }
.collection-card table,
.collection-card tbody { display: block; }
.collection-card thead { display: none; }
.collection-card tbody {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px;
}
.collection-card tbody tr {
  min-width: 0; overflow: hidden;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start;
  border: 1px solid var(--line); border-radius: 15px; background: var(--panel-2);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.collection-card tbody tr:hover {
  background: var(--panel-2); border-color: rgba(217,58,76,.38);
  transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0,0,0,.24);
}
.collection-card tbody td { min-width: 0; padding: 9px 14px; border: 0; color: var(--ink-3); font-size: 12.5px; }
.collection-card tbody td:first-child { grid-column: 1 / -1; padding: 0; }
.collection-card .cell-title { display: block; }
.collection-card .cell-title .thumb {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 0;
  background: linear-gradient(135deg, rgba(166,29,46,.3), var(--panel));
}
.collection-card .cell-title > span:last-child { display: block; padding: 14px 14px 10px; }
.collection-card .cell-title b { color: var(--ink); font-size: 15px; line-height: 1.4; }
.collection-card tbody td.actions {
  grid-column: 1 / -1; padding: 12px 14px 14px;
  display: flex; align-items: center; border-top: 1px solid var(--line);
}
.collection-card tbody td.actions .btn:first-child { flex: 1; }
.collection-card tbody td.actions .btn { min-height: 38px; }

.editor-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-bottom: 12px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 18px;
  background: radial-gradient(circle at 90% 0%, rgba(217,58,76,.18), transparent 42%), var(--panel);
}
.editor-hero__identity,
.editor-hero__actions { display: flex; align-items: center; gap: 12px; }
.editor-hero__identity { min-width: 0; }
.editor-hero__icon {
  width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center;
  color: #f2707e; border: 1px solid rgba(217,58,76,.28);
  border-radius: 13px; background: rgba(217,58,76,.12);
}
.editor-hero h2 {
  max-width: min(62vw, 760px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: clamp(18px, 2.2vw, 25px); letter-spacing: -.035em;
}
.editor-hero .collection-hero__eyebrow { margin-bottom: 3px; }
.editor-hero__actions .btn { min-height: 42px; }

.editor-nav {
  position: sticky; top: 68px; z-index: 16;
  display: flex; gap: 7px; margin-bottom: 14px; padding: 7px;
  overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(12,12,15,.86); backdrop-filter: blur(18px);
}
.editor-nav::-webkit-scrollbar { display: none; }
.editor-nav a {
  min-height: 38px; padding: 8px 13px; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink-3); border: 1px solid transparent; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; transition: .2s var(--ease);
}
.editor-nav a:hover,
.editor-nav a.is-active { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.06); }
.editor-nav a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.content-editor { align-items: start; gap: 16px; }
.content-editor.cols--2 { grid-template-columns: minmax(0, 1.65fr) minmax(330px, .85fr); }
.content-editor__main,
.content-editor__aside { scroll-margin-top: 130px; }
.content-editor__aside { position: sticky; top: 128px; }
.editor-section {
  scroll-margin-top: 130px; border-radius: 17px;
  box-shadow: 0 12px 34px rgba(0,0,0,.12);
}
.editor-section .card__head { min-height: 56px; }
.editor-section .card__head h2 { font-size: 14px; }
.editor-section .textarea { min-height: 170px; }
.editor-section .textarea[style*="80px"] { min-height: 96px !important; }
.editor-section--settings > .card__body { padding: 18px; }
.editor-section__divider {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 17px; scroll-margin-top: 132px;
  color: var(--ink-2); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
html[dir="rtl"] .editor-section__divider { letter-spacing: 0; text-transform: none; font-size: 13px; }
.editor-section__divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.editor-section fieldset.field { padding: 0; border: 0; }
.editor-section fieldset.field > legend { margin-bottom: 9px; color: var(--ink-3); font-size: 12px; font-weight: 650; }
.editor-section fieldset .tab { min-height: 42px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.editor-section fieldset .tab input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.editor-section fieldset .tab:has(input:focus-visible) { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Page Studio */
.project-editor-shell{display:grid;grid-template-columns:1fr;gap:18px}.project-editor-shell .content-editor__main{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.project-editor-shell .content-editor__aside{position:static;display:grid;grid-template-columns:minmax(0,1fr);gap:16px}.project-editor-shell .editor-section--settings>.card__body{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}.project-editor-shell .editor-section__divider,.project-editor-shell .project-details-editor,.project-editor-shell .gallery-editor,.project-editor-shell [data-cover-choice]{grid-column:1/-1}.project-technologies-card{scroll-margin-top:130px}.platform-flex-card{border-color:rgba(242,112,126,.35);box-shadow:0 18px 46px rgba(166,29,46,.12)}.platform-editor-summary{display:flex;gap:7px;margin-top:9px}.platform-editor-summary span{padding:4px 8px;border-radius:99px;background:rgba(166,29,46,.14);color:#f2707e;font-size:11px}.platform-editor-notice{margin-bottom:14px;padding:12px 14px;border:1px dashed rgba(242,112,126,.4);border-radius:11px;background:rgba(166,29,46,.08);color:var(--ink-2);font-size:13px}@media(max-width:900px){.project-editor-shell .content-editor__main,.project-editor-shell .editor-section--settings>.card__body{grid-template-columns:1fr}.project-editor-shell .editor-section__divider,.project-editor-shell .project-details-editor,.project-editor-shell .gallery-editor,.project-editor-shell [data-cover-choice]{grid-column:auto}}
.project-details-editor{display:grid;gap:12px}.project-detail-row{display:grid;grid-template-columns:auto repeat(2,minmax(120px,1fr)) repeat(2,minmax(150px,1.3fr)) auto;gap:8px;align-items:start;padding:10px;border:1px solid var(--line);border-radius:12px;margin-bottom:9px;background:rgba(255,255,255,.02)}.project-detail-row .textarea{min-height:52px}.project-detail-grip{padding:12px 4px;color:var(--ink-3);cursor:grab;letter-spacing:-4px}.project-detail-row.is-dragging{opacity:.35}.technology-create{display:grid;grid-template-columns:minmax(180px,1fr) 48px auto;gap:8px;margin-bottom:16px}.technology-create input[type=color]{width:48px;height:44px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}@media(max-width:980px){.project-detail-row{grid-template-columns:auto 1fr 1fr}.project-detail-row textarea{grid-column:span 1}}@media(max-width:620px){.project-detail-row{grid-template-columns:auto 1fr}.technology-create{grid-template-columns:1fr 48px}.technology-create button{grid-column:1/-1}}
.platform-editor-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.platform-editor-head p{margin-top:5px;color:var(--ink-3);font-size:13px}
.platform-editor-list{display:grid;gap:14px}
.platform-editor-empty{padding:30px;text-align:center;border:1px dashed var(--line);border-radius:14px;color:var(--ink-3)}
.platform-editor-item{border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.025);overflow:hidden}
.platform-editor-item.is-hidden{opacity:.58}
.platform-editor-item.is-dragging{opacity:.35}
.platform-editor-item__head{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.025)}
.platform-editor-grip{cursor:grab;color:var(--ink-3);font-size:18px;letter-spacing:-4px;padding-inline-end:5px}
.platform-editor-actions{display:flex;gap:6px;flex-wrap:wrap;margin-inline-start:auto}
.platform-editor-actions .platform-delete{color:#ff8a82}
.platform-editor-item__body{padding:15px}
.platform-editor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}
.platform-field{min-width:0}
.platform-media-control{display:grid;gap:9px}
.platform-media-preview{height:150px;border:1px dashed var(--line);border-radius:11px;display:grid;place-items:center;overflow:hidden;color:var(--ink-3);background:#111}
.platform-media-preview img,.platform-media-preview video{width:100%;height:100%;object-fit:cover}
.platform-picker{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.82);backdrop-filter:blur(14px);display:grid;place-items:center;padding:4vmin}
.platform-picker__panel{width:min(900px,100%);max-height:84vh;overflow:auto;background:#111116;border:1px solid var(--line);border-radius:18px;padding:18px}
.platform-picker__panel header{display:flex;align-items:center;margin-bottom:14px}
.platform-picker__panel header button{margin-inline-start:auto;border:0;background:none;color:#aaa;font-size:26px;cursor:pointer}
.platform-picker__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:9px;margin-bottom:14px;min-height:100px}
.platform-picker__grid button{height:96px;border:1px solid var(--line);border-radius:10px;background:#18181f;color:#ddd;overflow:hidden;cursor:pointer;font-size:22px}
.platform-picker__grid img{width:100%;height:100%;object-fit:cover}
@media(max-width:760px){.platform-editor-grid{grid-template-columns:1fr}.platform-editor-item__head{align-items:flex-start}.platform-editor-actions{width:100%;margin-inline-start:0}.platform-editor-item__head{flex-wrap:wrap}}
.page-studio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.page-studio-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
}
.page-studio-card::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  inset-inline-end: -92px;
  top: -94px;
  border-radius: 50%;
  background: rgba(166,29,46,.18);
  filter: blur(16px);
  pointer-events: none;
}
.page-studio-card--featured {
  grid-column: 1 / -1;
  min-height: 250px;
  background: linear-gradient(135deg, rgba(166,29,46,.22), rgba(255,255,255,.025) 58%);
}
.page-studio-card__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242,112,126,.28);
  border-radius: 14px;
  color: var(--accent-2);
  background: rgba(166,29,46,.16);
}
.page-studio-card h2 { margin: 0 0 7px; font-size: 19px; }
.page-studio-card p { max-width: 58ch; margin: 0; color: var(--ink-3); line-height: 1.65; }
.page-studio-card__actions { display: flex; gap: 8px; margin-top: auto; }
.page-editor-form .media-upload { min-height: 100%; }
.page-editor-form .editor-section { scroll-margin-top: 150px; }

@media (max-width: 760px) {
  .page-studio-grid { grid-template-columns: 1fr; }
  .page-studio-card--featured { grid-column: auto; }
}
.content-editor .media-upload__drop,
.content-editor .gallery-upload { min-height: 116px; }
.content-editor .actionbar {
  position: sticky; bottom: 12px; z-index: 12;
  border-color: var(--line-2); box-shadow: 0 16px 42px rgba(0,0,0,.44);
}

@media (max-width: 1120px) {
  .content-editor.cols--2 { grid-template-columns: 1fr; }
  .content-editor__aside { position: static; }
}
@media (max-width: 760px) {
  .collection-hero { align-items: stretch; flex-direction: column; }
  .collection-hero__cta { width: 100%; }
  .collection-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-hero { align-items: stretch; flex-direction: column; }
  .editor-hero__actions { justify-content: space-between; }
  .editor-hero__actions .btn { flex: 1; }
  .editor-hero h2 { max-width: calc(100vw - 126px); }
  .editor-nav { top: 61px; }
}
@media (max-width: 520px) {
  .collection-metrics { grid-template-columns: 1fr; }
  .collection-card tbody { grid-template-columns: 1fr; }
  .collection-card .table-wrap { padding: 10px; }
  .editor-hero { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .collection-card tbody tr,
  .editor-nav a { transition: none; }
  .collection-card tbody tr:hover { transform: none; }
}

/* ------------------------------------------------------------------ login */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
  background-image:
    radial-gradient(900px 620px at 72% -10%, rgba(166,29,46,.32), transparent 62%),
    radial-gradient(700px 520px at 8% 108%, rgba(255,122,69,.14), transparent 62%);
}
.login-card {
  width: 100%; max-width: 420px;
  background: rgba(14,14,18,.82); backdrop-filter: blur(30px);
  border: 1px solid var(--line); border-radius: 22px; padding: 38px;
}
.login-card h1 { font-size: 24px; font-weight: 620; letter-spacing: -.03em; margin: 18px 0 6px; }
.login-card p.sub { color: var(--ink-3); font-size: 14px; margin-bottom: 26px; }
.login-foot { margin-top: 22px; text-align: center; font-size: 13px; color: var(--ink-4); }
.login-foot a { color: var(--accent-3); }

/* animation for content entrance */
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.content > * { animation: riseIn .5s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .content > * { animation: none; } }


/* ------------------------------------------------------- multi-select chip */
/* Replaces a bare checkbox dropped inside a `.tab` pill, which rendered as an
   unstyled OS control with no selected state on the pill itself. */
.pick {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px; border-radius: 99px;
  border: 1px solid var(--line); color: var(--ink-3);
  font-size: 13.5px; font-weight: 500; cursor: pointer; user-select: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
html[dir="rtl"] .pick { padding: 7px 10px 7px 14px; }
.pick:hover { border-color: var(--line-2); color: var(--ink); }
.pick input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; cursor: pointer;
}
.pick__box {
  width: 17px; height: 17px; border-radius: 6px; flex-shrink: 0;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.pick__box svg { width: 12px; height: 12px; opacity: 0; transform: scale(.6); transition: .2s var(--ease); }
.pick input:checked ~ .pick__box { background: var(--accent); border-color: var(--accent); }
.pick input:checked ~ .pick__box svg { opacity: 1; transform: none; }
.pick input:checked ~ .pick__label { color: var(--ink); }
.pick input:focus-visible ~ .pick__box { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ------------------------------------------------------------ sticky actions */
/* The save bar used to sit at the bottom of the right-hand column, which on a
   long edit form meant scrolling past everything to reach it. */
.actionbar {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 4px; padding: 12px 14px;
  background: rgba(8,8,10,.86); backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: var(--r);
}
@supports not (backdrop-filter: blur(1px)) { .actionbar { background: #0e0e12; } }
