/* ============ هبّة ============
   Brand: coral #FF5A36 · charcoal #16120F · cream #FFF4E8.
   Bright, calm workspace: white sidebar with icons, soft tinted KPI cards, bold numbers, coral for action and "you are here". */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #1a1714;
  --ink-2: #3a342f;
  --muted: #6e6862;
  --line: #ebe7e1;
  --accent: #d2401f;
  --accent-ink: #ffffff;
  --accent-soft: #fff0ea;
  --coral: #ff5a36;
  --sel: #e8492a;
  --sel-ink: #ffffff;
  --ok: #2c7a52;
  --ok-soft: #eaf5ee;
  --warn: #a8661a;
  --warn-soft: #fcf2e2;
  --bad: #c0352a;
  --bad-soft: #fdecea;
  --info: #3657c9;
  --info-soft: #edf1fc;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(26, 23, 20, .04);
  --display: "IBM Plex Sans Arabic", system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1, h2, h3 { margin: 0; line-height: 1.35; font-family: var(--display); }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 276px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 18px 16px;
  background: var(--surface); border-inline-start: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; text-decoration: none; }
.brand-logo { width: 40px; height: 40px; display: block; flex: none; }
.brand-word { height: 38px; width: auto; display: block; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav a {
  display: flex; align-items: center; gap: 12px; color: var(--ink-2); text-decoration: none;
  padding: 8px 14px; border-radius: 13px; font-weight: 500; font-size: 15px; transition: background .15s, color .15s;
}
nav a .ic { color: var(--muted); }
nav a:hover { background: var(--surface-2); }
nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
nav a.active .ic { color: var(--accent); }
nav a .badge { margin-inline-start: auto; }
.ic { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.view { padding: 40px clamp(16px, 3.5vw, 48px) 88px; max-width: 1280px; width: 100%; min-width: 0; }
.view .card { min-width: 0; overflow-x: auto; }

.side-foot { display: grid; gap: 10px; }
.side-foot .btn { padding: 11px 16px; border-radius: 14px; font-size: 15px; }
.side-foot .btn .ic { width: 19px; height: 19px; }
.who-am-i { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 4px; border-radius: 14px; background: var(--surface-2); }
.me-av { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.me-txt { display: grid; line-height: 1.3; min-width: 0; flex: 1; }
.me-txt b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { color: var(--muted); font-size: 12.5px; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface); color: var(--ink); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* ---------- cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
/* one ledger strip, cells divided by hairlines */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.stats > * {
  background: transparent; border: 0 !important; border-radius: 0 !important; margin: 0 !important;
  box-shadow: 0 0 0 .5px var(--line) !important;
}
.stat { padding: 18px 22px 16px; }
.stat .n { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 13px; }

.step { display: flex; gap: 14px; }
.step-num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sel); color: var(--sel-ink); font-family: var(--display);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-top: 2px;
}
.step-body { flex: 1; min-width: 0; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 84px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 3px; flex: none; }
.check.disabled { opacity: .5; cursor: not-allowed; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.switch .track::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(-18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 9px 18px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--sel); color: var(--sel-ink); border-color: var(--sel); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- accounts ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acc { display: flex; flex-direction: column; gap: 12px; }
.acc-top { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.acc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-meta { font-size: 12px; color: var(--muted); direction: ltr; text-align: end; }
.err, .acc .err { font-size: 12px; color: var(--bad); background: var(--bad-soft); padding: 6px 10px; border-radius: 8px; word-break: break-word; }

.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 340px; overflow: auto; padding: 4px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface-2); }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick input { accent-color: var(--accent); width: 17px; height: 17px; }
.pick .acc-name { font-size: 14px; }

/* ---------- videos ---------- */
.drop {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: border-color .15s, background .15s;
}
.drop.over, .drop:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.vid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.vid { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); font-size: 12px; }
.vid video { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; background: #000; }
.vid .meta { padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 4px; background: var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
td .err { color: var(--bad); font-size: 12px; margin-top: 4px; word-break: break-word; }
.num { font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.cap-cell textarea { min-height: 96px; font-size: 14px; }
.counter { font-size: 11px; color: var(--muted); direction: ltr; text-align: left; font-variant-numeric: tabular-nums; unicode-bidi: isolate; }
.counter.over { color: var(--bad); }

.notice { overflow-wrap: anywhere; border-radius: 14px; padding: 13px 16px; font-size: 14px; margin-bottom: 16px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--info-soft); color: var(--info); }
.notice code { direction: ltr; unicode-bidi: embed; background: rgba(0,0,0,.06); padding: 1px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; display: flex; border: 1px solid var(--line); min-width: 120px; }
.bar i { display: block; height: 100%; }
.bar .p { background: var(--ok); } .bar .f { background: var(--bad); } .bar .q { background: var(--info); opacity: .5; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(90% 60% at 50% 0%, #fff0ea, var(--bg) 70%); }
.login-card { width: min(410px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 38px 34px 28px; box-shadow: 0 30px 60px -40px rgba(26,23,20,.35); text-align: center; box-shadow: var(--shadow); }
.login-card h1 { margin-bottom: 4px; }
.login-card .field { text-align: start; margin-top: 14px; }
.login-card .field input { margin: 0; }
.error-text { color: var(--bad); min-height: 1.6em; margin: 10px 0 0; font-size: 14px; }

.toast {
  position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 12px; font-weight: 500;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(50%) translateY(0); }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px;
    overflow-x: auto;
  }
  .brand-word { display: none; }
  .brand-logo { width: 32px; height: 32px; }
  .side-foot { display: none; }
  .sidebar { border-inline-start: 0; border-bottom: 1px solid var(--line); }
  nav a { gap: 6px; } nav a .ic { width: 18px; height: 18px; }
  nav { flex-direction: row; flex: 1; }
  nav a { padding: 7px 10px; font-size: 14px; white-space: nowrap; }
  #logout { display: none; }
  .view { padding: 20px 16px 60px; }
  h1 { font-size: 22px; }
}
.acc-grid > .card, .stats > .card { margin-top: 0; }

/* ---------- groups ---------- */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gchip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; font: inherit; font-size: 13px;
  font-weight: 500; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; text-decoration: none;
}
.gchip a { color: inherit; text-decoration: none; }
.gchip.on { background: var(--sel); color: var(--sel-ink); border-color: var(--sel); }
.gchip.small { padding: 2px 10px; font-size: 12px; }
.gchip .x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; opacity: .6; }
.gchip .x:hover { opacity: 1; }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg a { padding: 8px 14px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; border-inline-start: 1px solid var(--line); }
.seg a:first-child { border-inline-start: 0; }
.seg a:hover { background: var(--surface-2); }
.seg a.on { background: var(--sel); color: var(--sel-ink); }

.tpl-bar { padding: 14px 20px; margin-bottom: 16px; }
.tpl-bar + .card { margin-top: 0; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-top: 16px; }
.two-col > .card { margin-top: 0; }
.clamp2, .clamp3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp2 { -webkit-line-clamp: 2; } .clamp3 { -webkit-line-clamp: 3; }
.best-line { margin-bottom: 14px; }

/* ---------- charts ---------- */
.chart-wrap { width: 100%; overflow: hidden; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; opacity: .6; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .bar-mark { fill: var(--coral); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: var(--ink); opacity: .04; }

.hbar { position: relative; display: flex; align-items: center; gap: 8px; }
.hbar i { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; flex: none; max-width: calc(100% - 52px); }
[dir=rtl] .hbar i { border-radius: 4px 0 0 4px; }

.tip {
  position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; white-space: nowrap;
}
.tip.show { opacity: 1; }
.tip-main { font-weight: 600; font-variant-numeric: tabular-nums; }
.tip-sub { opacity: .75; font-size: 12px; }

/* heatmap: one hue, light -> dark */
.heat-scroll { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 64px repeat(24, minmax(18px, 1fr)); gap: 2px; min-width: 620px; }
.heat-hr { font-size: 10px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.heat-day { font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.heat-cell { height: 22px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); display: inline-block; min-width: 18px; }
.heat-cell.l1 { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); border-color: transparent; }
.heat-cell.l2 { background: color-mix(in srgb, var(--accent) 36%, var(--surface)); border-color: transparent; }
.heat-cell.l3 { background: color-mix(in srgb, var(--accent) 56%, var(--surface)); border-color: transparent; }
.heat-cell.l4 { background: color-mix(in srgb, var(--accent) 78%, var(--surface)); border-color: transparent; }
.heat-cell.l5 { background: var(--accent); border-color: transparent; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.heat-legend .heat-cell { width: 18px; height: 14px; }

/* ---------- calendar ---------- */
.cal-scroll { overflow-x: auto; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-width: 780px; }
.cal-wd { background: var(--surface-2); padding: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.cal-day { background: var(--surface); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-day.out { background: var(--surface-2); }
.cal-day.out .cal-num { opacity: .45; }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); }
.cal-day.drop-on { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); }
.cal-num { font-size: 12px; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.cal-chip {
  display: flex; gap: 6px; align-items: center; width: 100%; font: inherit; font-size: 12px; text-align: start; cursor: pointer;
  border: 0; border-inline-start: 3px solid var(--muted); background: var(--surface-2); color: var(--ink); padding: 3px 6px; border-radius: 6px;
}
.cal-chip:hover { filter: brightness(.97); }
.cal-chip[draggable=true] { cursor: grab; }
.cal-chip.dragging { opacity: .4; }
.cal-chip.st-scheduled { border-color: var(--info); background: var(--info-soft); }
.cal-chip.st-uploading, .cal-chip.st-processing { border-color: var(--warn); background: var(--warn-soft); }
.cal-chip.st-published { border-color: var(--ok); background: var(--ok-soft); }
.cal-chip.st-failed { border-color: var(--bad); background: var(--bad-soft); }
.cal-time { color: var(--muted); flex: none; }
.cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { font: inherit; font-size: 12px; border: 0; background: none; color: var(--accent); cursor: pointer; text-align: start; padding: 2px 6px; }
.cal-legend { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 10px; }
.day-list { display: flex; flex-direction: column; gap: 4px; }

/* ---------- dialog ---------- */
.dlg { border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: min(560px, calc(100% - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(20,19,18,.45); }
.dlg-x { position: absolute; top: 12px; inset-inline-end: 12px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.dlg .who { padding-inline-end: 28px; }
.dlg .who .chip { margin-inline-start: auto; }

@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
  nav a { padding: 7px 8px; }
}

/* ---------- profiles ---------- */
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "◂"; color: var(--muted); font-size: 12px; transition: transform .15s; }
details.card[open] > summary::before { transform: rotate(-90deg); }
.how { margin-bottom: 16px; }
.how ol { margin: 6px 0; padding-inline-start: 22px; }
.how li { margin: 4px 0; }
.how + .card, .pf-progress + .card { margin-top: 0; }
.pf-progress { margin-bottom: 16px; }
.pf-progress-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pf-big { font-family: var(--display); font-size: 28px; font-weight: 700; }
.pf-bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-top: 14px; }
.pf-bar i { display: block; height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s; }
.bulk { margin-bottom: 16px; }
.bulk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.bulk-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface-2); }
.bulk-box h3 { margin-bottom: 12px; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.pf-grid > .card { margin-top: 0; }
.pf { display: flex; flex-direction: column; gap: 12px; border-inline-start: 4px solid var(--line); }
.pf.pf-pending { border-inline-start-color: var(--warn); }
.pf.pf-done { border-inline-start-color: var(--ok); }
.pf-row { display: grid; grid-template-columns: 74px 1fr; gap: 4px 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.pf-label { grid-row: span 2; font-weight: 600; font-size: 14px; display: flex; align-items: flex-start; gap: 6px; }
.pf-now { font-size: 13px; word-break: break-word; }
.pf-edit { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: start; }
.pf-edit input, .pf-edit textarea { grid-column: 1; }
.pf-edit textarea { min-height: 62px; }
.pf-edit .counter { grid-column: 1; grid-row: 2; }
.pf-edit .btn { grid-column: 2; grid-row: 1; }
.pf-mark { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.pf-mark.ok { background: var(--ok-soft); color: var(--ok); }
.pf-mark.bad { background: var(--warn-soft); color: var(--warn); }
.pf-mark.none { background: var(--surface-2); color: var(--muted); }
.pf-photos { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pf-photos figure { margin: 0; text-align: center; }
.pf-photos figcaption { font-size: 11px; color: var(--muted); margin-top: 4px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.add { border: 2px dashed var(--line); background: var(--surface-2); color: var(--muted); font-size: 26px; cursor: pointer; font-family: inherit; }
.avatar.add:hover { border-color: var(--accent); color: var(--accent); }
.pf-foot { padding-top: 12px; border-top: 1px solid var(--line); }
.verified { color: var(--info); }
.sugg-list { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow: auto; padding: 2px; }
.sugg { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.dlg.wide { width: min(720px, calc(100% - 32px)); }
@media (max-width: 820px) { .pf-grid { grid-template-columns: 1fr; } }

/* ---------- login extras ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-inline-end: 44px; }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: var(--surface-2); }
[dir=rtl] .pw-wrap input[dir=ltr] { padding-inline-end: 12px; padding-left: 44px; }
[dir=rtl] .pw-eye { inset-inline-end: auto; left: 6px; }
.warn-text { color: var(--warn); font-size: 13px; min-height: 0; margin: 8px 0 12px; text-align: start; }
.warn-text:empty { margin: 0 0 12px; }

/* ---------- nav extras ---------- */
.nav-sep { height: 1px; background: var(--line); margin: 6px 12px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; margin-inline-start: 6px; }

.notice.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- segmented ---------- */
.seg-wrap { display: grid; gap: 12px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.seg button { font: inherit; border: 0; background: transparent; color: var(--ink); padding: 8px 12px; border-radius: 9px; cursor: pointer; text-align: center; display: grid; gap: 2px; }
.seg button span { font-size: 12px; color: var(--muted); }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); outline: 2px solid var(--accent); outline-offset: -2px; }
.seg button:focus-visible { outline: 2px solid var(--accent); }

/* ---------- compose: video cover + photos ---------- */
.vid { position: relative; }
.x-btn { position: absolute; top: 6px; inset-inline-start: 6px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.cover-box { padding: 0 8px 8px; }
.cover-box input[type=range] { width: 100%; accent-color: var(--accent); padding: 0; }
.cover-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted); }
.linkish { font: inherit; font-size: 12px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.photo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.photo.cover { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.photo .progress { position: absolute; bottom: 34px; inset-inline: 0; }
.photo-n { position: absolute; top: 6px; inset-inline-start: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; min-width: 22px; height: 22px; display: grid; place-items: center; }
.photo-cover-tag { position: absolute; top: 6px; inset-inline-end: 6px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.photo-tools { display: flex; justify-content: space-between; padding: 4px; gap: 2px; }
.photo-tools button { flex: 1; font: inherit; border: 0; background: transparent; color: var(--ink); border-radius: 6px; cursor: pointer; padding: 3px 0; }
.photo-tools button:hover:not(:disabled) { background: var(--surface); }
.photo-tools button:disabled { opacity: .3; cursor: default; }

/* ---------- compose: overlay + subtitles ---------- */
.ov-grid { display: grid; grid-template-columns: 1fr 260px; gap: 20px; align-items: start; }
.ov-preview { aspect-ratio: 9/16; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; overflow: hidden; text-align: center; padding: 8px; }
.ov-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.subs-ed { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--surface-2); }
.subs-ed details { margin-top: 8px; } .subs-ed summary { cursor: pointer; color: var(--accent); }
.subs-ed textarea { margin-top: 6px; }
.seg-list { display: grid; gap: 6px; max-height: 280px; overflow: auto; margin-top: 6px; }
.seg-row { display: grid; grid-template-columns: 76px 1fr; gap: 8px; align-items: center; }
.seg-time { font-size: 12px; color: var(--muted); direction: ltr; text-align: center; }

/* ---------- library ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; }
.lib-item { font: inherit; border: 2px solid transparent; border-radius: 12px; background: var(--surface-2); padding: 0; overflow: hidden; cursor: pointer; text-align: start; color: var(--ink); }
.lib-item.on { border-color: var(--accent); }
.thumb { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; background: #000; }
.lib-title { font-size: 12px; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.lib-card { margin: 0 !important; display: flex; flex-direction: column; gap: 8px; position: relative; padding: 10px; }
.lib-card.on { outline: 2px solid var(--accent); }
.lib-card .thumb { border-radius: 10px; }
.lib-check { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; background: var(--surface); border-radius: 6px; padding: 2px 4px; line-height: 0; }
.lib-check input { width: 18px; height: 18px; margin: 0; }
.lib-name { font-weight: 500; }

/* ---------- offers ---------- */
.offer-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.offer-grid > .card { margin: 0; }
.offer-preview { position: sticky; top: 20px; }
.offer-canvas { width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); display: block; }
.offer-grid hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- report / settings ---------- */
.delta { font-size: 12px; font-weight: 700; } .delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.tips { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin: 0 0 16px; }
.steps-list { margin: 0 0 16px; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 14px; }
.steps-list code { direction: ltr; unicode-bidi: embed; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.caps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

@media (max-width: 820px) {
  .ov-grid, .offer-grid, .grid-2 { grid-template-columns: 1fr; }
  .offer-preview { position: static; max-width: 320px; margin: 0 auto; }
  .seg { grid-auto-flow: row; }
  .nav-sep { display: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- dashboard ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; padding: 6px 14px; border-radius: 999px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { border-radius: var(--radius); padding: 20px 22px 18px; border: 1px solid transparent; display: flex; flex-direction: column; gap: 6px; min-height: 148px; }
.kpi-l { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.kpi-l::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .9; }
.kpi-n { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; margin-top: 6px; }
.kpi-s { font-size: 13px; color: var(--muted); margin-top: auto; }
.kpi.ok { background: var(--ok-soft); } .kpi.ok .kpi-l::before, .kpi.ok .kpi-n { color: var(--ok); }
.kpi.warn { background: var(--warn-soft); } .kpi.warn .kpi-l::before { color: #d08a2c; } .kpi.warn .kpi-n { color: var(--ink); }
.kpi.info { background: var(--info-soft); } .kpi.info .kpi-l::before, .kpi.info .kpi-n { color: var(--info); }
.kpi.plain { background: var(--surface); border-color: var(--line); }
.kpi.plain .kpi-l::before { color: var(--coral); }
.kpi.good .kpi-n { color: var(--ok); } .kpi.bad .kpi-n { color: var(--bad); }
.kpi.good .kpi-l::before { color: var(--ok); } .kpi.bad .kpi-l::before { color: var(--bad); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.dash-grid > .card { margin: 0; }
.range { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.range a { min-width: 46px; text-align: center; padding: 6px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.range a:hover { color: var(--ink); }
.range a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(26, 23, 20, .08); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.legend b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 11px; height: 11px; border-radius: 3px; background: currentColor; }
.lg.pub::before { background: var(--coral); }
.lg.inbox::before { background: var(--ink); opacity: .75; }
.lg.fail::before { background: #8f2318; }
.lg.sched::before { background: transparent; border: 1.5px dashed var(--coral); }
.act-chart .b-pub { fill: var(--coral); }
.act-chart .b-inbox { fill: var(--ink); opacity: .75; }
.act-chart .b-fail { fill: #8f2318; }
.act-chart .b-sched { fill: color-mix(in srgb, var(--coral) 12%, transparent); stroke: var(--coral); stroke-width: 1.5; stroke-dasharray: 3 2.5; }
.act-chart .today { fill: var(--accent); font-weight: 700; }
.act-chart .today-line { stroke: var(--coral); stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.act-chart { direction: ltr; }
.act-chart .tick { font-size: 13px; }
.chart .grid { stroke: var(--line); opacity: 1; }

.count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 700; display: inline-grid; place-items: center; font-size: 13.5px; }
.att-list { display: grid; gap: 8px; }
.att-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--ink); text-decoration: none; transition: background .15s; }
.att-item:hover { background: var(--accent-soft); }
.att-n { min-width: 34px; height: 30px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.att-n.bad { background: var(--bad-soft); color: var(--bad); } .att-n.warn { background: var(--warn-soft); color: var(--warn); } .att-n.info { background: var(--info-soft); color: var(--info); }
.att-t { flex: 1; min-width: 0; font-weight: 500; }
.att-t b { font-weight: 700; }
.att-err { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; font-weight: 400; }
.chev { color: var(--muted); font-size: 22px; line-height: 1; flex: none; }
.small-empty { padding: 26px 10px; }
.hours { display: flex; flex-wrap: wrap; gap: 8px; }
.hour { font-family: var(--display); font-size: 19px; font-weight: 700; padding: 8px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; }
.sub-h { margin: 20px 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.top-acc { display: grid; gap: 10px; }
.top-row { display: grid; grid-template-columns: auto minmax(70px, 1fr) 2fr auto; gap: 10px; align-items: center; font-size: 14px; }
.top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar { height: 7px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.top-bar i { display: block; height: 100%; background: var(--coral); border-radius: 999px; }
.top-n { color: var(--muted); font-size: 13px; min-width: 42px; text-align: end; }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { color: var(--accent); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .kpis { gap: 10px; } .kpi { min-height: 0; padding: 16px; } .kpi-n { font-size: 26px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.login-links { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.login-links a { color: var(--muted); }
.login-links a:hover { color: var(--accent); }
