/* Dottopia prototype 2 — components (Postiz patterns, clean-room) */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 20px; color: var(--text); background: var(--bg-outer); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }

.shell { display: flex; min-height: 100vh; }

/* ---- sidebar: Postiz-style white rail with workspace block ---- */
.rail { width: 248px; flex: 0 0 248px; background: var(--bg-inner); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.rail__ws { padding: 16px 14px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); }
.rail__ws .mark { width: 34px; height: 34px; border-radius: 12px; background: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink); }
.rail__ws .who { min-width: 0; }
.rail__ws .who b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail__ws .who span { font-size: 11px; color: var(--text-sub); }
.rail__nav { flex: 1; padding: 10px; overflow-y: auto; }
.rail__sec { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-dim); padding: 14px 10px 6px; }
.rail__item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--text-sub); font-weight: 500; margin-bottom: 2px; }
.rail__item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.rail__item[aria-current="page"] { background: var(--col); color: var(--text); font-weight: 600; }
.rail__item svg { flex: 0 0 auto; }
.rail__foot { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 1025px) { .main { padding-bottom: 0; } }
@media (max-width: 1024px) { .page { padding: 12px 14px 24px; } .topbar { padding: 8px 12px; min-height: 52px; } }
.topbar { background: var(--bg-inner); border-bottom: 1px solid var(--border); padding: 8px 24px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; height: 54px; }
.topbar h1 { font-size: 17px; line-height: 24px; }
.acct { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.acct select { font: inherit; font-size: 13px; font-weight: 500; height: 36px; padding: 4px 30px 4px 12px; border: 1px solid var(--sep); border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23777b7f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: var(--bg-inner-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-sub); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

.page { padding: 16px 24px 28px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page > .note { margin-bottom: 14px; }
.page > .stat-row { margin-bottom: 16px !important; }
.intro { color: var(--text-sub); max-width: 74ch; margin: 4px 0 20px; font-size: 13px; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 6px 16px; border-radius: var(--r-ctl); border: none; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; background: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: var(--ink); }
.btn--primary:hover { background: var(--brand-hover); }
.btn--primary:active { background: var(--brand-press); }
.btn--ghost { background: var(--bg-inner-2); color: var(--text); }
.btn--ghost:hover { background: var(--hover); }
.btn--danger { background: var(--bad-bg); color: var(--bad-ink); }
.btn--sm { height: 32px; padding: 4px 12px; font-size: 13px; border-radius: var(--r-pill); }
.btn--link { color: var(--text-sub); padding: 6px 10px; }
.btn--link:hover { background: var(--hover); border-radius: var(--r-pill); }

/* ---- cards & strips */
.card { background: var(--bg-inner); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.card__head { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card__head h3 { font-size: 14px; }
.card__body { padding: 16px 18px; }
.card__body--flush { padding: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stack > * + * { margin-top: 16px; }
.grid-8-4 { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.grid-8-4 .stack { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }

/* ---- tables */
.table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
.card__body--flush .table { min-width: 760px; }
.table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); padding: 10px 14px; background: var(--table-header); border-bottom: 1px solid var(--table-border); }
.table th:first-child { border-radius: 10px 0 0 0; } .table th:last-child { border-radius: 0 10px 0 0; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--table-border); vertical-align: top; }
.table code { display: inline-block; max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.table .nowrap { white-space: nowrap; }
.table th { white-space: nowrap; }
.table td .ellip { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- tags */
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag--published { background: var(--ok-bg); color: var(--ok-ink); }
.tag--failed { background: var(--bad-bg); color: var(--bad-ink); }
.tag--unknown { background: var(--warn-bg); color: var(--warn-ink); }
.tag--scheduled { background: var(--sched-bg); color: var(--sched-ink); border: 1px dashed var(--sep); }
.tag--submitted { background: var(--info-bg); color: var(--info-ink); }
.tag--approved { background: var(--ok-bg); color: var(--ok-ink); }
.tag--draft { background: var(--col); color: var(--text-sub); }
.tag--neutral { background: var(--bg-inner-2); color: var(--text-sub); }

/* ---- platform tiles (Postiz per-platform surfaces) */
.plat-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-inner); }
.plat-tile small { color: var(--text-sub); }
.plat-logo { width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto; }
.ig { background: var(--ig); color: var(--ig-ink); } .fb { background: var(--fb); color: var(--fb-ink); }
.li { background: var(--li); color: var(--li-ink); } .tt { background: var(--tt); color: var(--tt-ink); }
.plat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.plat-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--sep); border-radius: var(--r-pill); padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 13px; background: var(--bg-inner); }
.plat-chip input { accent-color: var(--brand); width: 16px; height: 16px; }
.plat-chip:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.plat-chip--off { opacity: .5; cursor: not-allowed; background: var(--bg-inner-2); }

/* ---- notes */
.note { display: flex; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 13px; align-items: flex-start; margin-bottom: 14px; }
.note--spec { background: var(--brand-soft); }
.note--info { background: var(--info-bg); } .note--warn { background: var(--warn-bg); }
.note--err { background: var(--bad-bg); } .note--ok { background: var(--ok-bg); }
.note p strong { font-weight: 600; }

/* ---- stats */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stat { background: var(--bg-inner); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 16px; }
.stat__label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); }
.stat__value { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__value .unit { font-size: 12px; color: var(--text-sub); }
.stat__note { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.stat--alert { border-color: var(--warn-ink); }

/* ---- calendar */
.cal-unscheduled { background: var(--bg-inner); border: 1px solid var(--border); border-radius: var(--r-card); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-inner); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.cal-dow { padding: 8px 10px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); background: var(--table-header); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.cal-cell { min-height: 96px; padding: 7px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-date { font-size: 11px; color: var(--text-sub); font-weight: 600; align-self: flex-end; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-today .cal-date { background: var(--brand); color: var(--ink); font-weight: 700; }
.cal-out { background: var(--bg-inner-2); color: var(--text-dim); }
.post-chip { font-size: 11px; line-height: 16px; padding: 3px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); display: flex; align-items: center; gap: 6px; color: var(--text-sub); background: var(--bg-inner); }
.post--failed { border-color: var(--bad-ink); background: var(--bad-bg); color: var(--bad-ink); }
.post--sched { border-style: dashed; }
.pdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

/* ---- composer / preview */
.phone { width: 300px; border: 1px solid var(--sep); border-radius: 28px; padding: 14px 12px; background: var(--bg-inner); box-shadow: var(--shadow-card); }
.phone-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px 12px; }
.phone-head .av { width: 32px; height: 32px; border-radius: 50%; background: var(--ig-ink); }
.phone-head b { font-size: 13px; display: block; } .phone-head span { font-size: 11px; color: var(--text-sub); }
.phone-img { width: 100%; aspect-ratio: 4/5; border-radius: 10px; background: linear-gradient(135deg, var(--brand-soft), var(--col)); display: flex; align-items: center; justify-content: center; color: var(--text-sub); font-size: 12px; font-weight: 600; }
.phone-cap { padding: 10px 4px; font-size: 12.5px; line-height: 19px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-sub); }
.field .help { font-size: 11px; color: var(--text-dim); }
.input, .textarea, .select { font: inherit; font-size: 14px; border: 1px solid var(--sep); border-radius: var(--r-ctl); padding: 9px 12px; width: 100%; background: var(--bg-inner); }
.textarea { resize: vertical; }
.counter { font-size: 11px; color: var(--text-dim); text-align: right; }
.counter.over { color: var(--bad-ink); font-weight: 700; }

/* ---- feeds & kv */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: none; }
.feed .fav { width: 28px; height: 28px; border-radius: 50%; background: var(--col); display: flex; align-items: center; justify-content: center; color: var(--text-sub); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 12.5px; }
.kv dt { color: var(--text-sub); } .kv dd { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: var(--bg-inner-2); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.hash { font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: var(--bg-inner-2); padding: 2px 7px; border-radius: var(--r-pill); }
.muted { color: var(--text-sub); } .small { font-size: 12.5px; line-height: 18px; } .micro { font-size: 11px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; } .right { margin-left: auto; }
.flex { display: flex; align-items: center; gap: 10px; }

.tabs { display: flex; gap: 6px; background: var(--bg-inner-2); padding: 4px; border-radius: var(--r-pill); width: max-content; }
.tab { border: none; background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-sub); padding: 7px 16px; border-radius: var(--r-pill); display: inline-flex; gap: 7px; align-items: center; }
.tab[aria-selected="true"] { background: var(--bg-inner); color: var(--text); box-shadow: var(--shadow-pop); }

@media (max-width: 1024px) { .rail { width: 64px; flex-basis: 64px; } .rail__item span, .rail__sec, .rail__foot .who, .rail__ws .who { display: none; } .grid-8-4, .stat-row, .grid-2 { grid-template-columns: 1fr; } .page, .topbar { padding-left: 14px; padding-right: 14px; } }



/* ------------------------------------------------------------------
   Compatibility layer — classes used by the live app's server-rendered
   pages, mapped into the Postiz-pattern system. Yellow is brand chrome
   only, never a status colour.
   ------------------------------------------------------------------ */
.note--error { background: var(--bad-bg); } .note--error svg { color: var(--bad-ink); }
.note--success { background: var(--ok-bg); } .note--success svg { color: var(--ok-ink); }
.tag--active, .tag--approved, .tag--published { background: var(--ok-bg); color: var(--ok-ink); }
.tag--expiring, .tag--suspended, .tag--reauth, .tag--unknown { background: var(--warn-bg); color: var(--warn-ink); }
.tag--revoked, .tag--failed { background: var(--bad-bg); color: var(--bad-ink); }
.tag--internal, .tag--processing, .tag--submitted { background: var(--info-bg); color: var(--info-ink); }
.tag--client { background: var(--col); color: var(--ink); }
.tag--pending, .tag--draft, .tag--neutral, .tag--closed { background: var(--bg-inner-2); color: var(--text-sub); }
.tag--closed { text-decoration: line-through; }
.topbar__scope { margin-left: 14px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-sub); }
.scope-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: var(--bg-inner-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-sub); }
.scope-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }
.rail__logo { display: block; padding: 16px 14px; border-bottom: 1px solid var(--border); }
.rail__logo img { height: 22px; width: auto; }
.acct-select { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.acct-select label { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.acct-field select { font: inherit; font-size: 13px; font-weight: 500; height: 36px; padding: 4px 30px 4px 12px; border: 1px solid var(--sep); border-radius: 12px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23777b7f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center; }
.acct-field { position: relative; }
.rendition { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-inner); }
.rendition__canvas { aspect-ratio: 4/5; background: linear-gradient(135deg, var(--brand-soft), var(--col)); display: flex; align-items: center; justify-content: center; position: relative; }
.rendition__canvas img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rendition .ratio { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; color: var(--ink); background: var(--brand); border-radius: var(--r-pill); padding: 2px 8px; }
.rendition__caption { padding: 12px; font-size: 13px; line-height: 20px; }
.rendition__canvas strong { opacity: .55; }
.qa { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.qa:last-child { border-bottom: none; }
.qa__body { min-width: 0; }
.qa__head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.qa__who { font-weight: 600; font-size: 13px; }
.qa__time { font-size: 11px; color: var(--text-dim); }
.qa__text { font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.qa--decision { background: var(--ok-bg); border-radius: 12px; padding: 12px 14px; }
.qa--decision.qa--reject { background: var(--bad-bg); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.feed .fav { width: 30px; height: 30px; border-radius: 50%; background: var(--col); display: flex; align-items: center; justify-content: center; color: var(--text-sub); flex: 0 0 auto; }
.feed .fav svg { width: 14px; height: 14px; }
.bar { height: 8px; border-radius: var(--r-pill); background: var(--col); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); }
.bar--blue > span { background: var(--info-ink); }
.bar--green > span { background: var(--ok-ink); }
.unavail { color: var(--text-dim); font-style: italic; }
.media-slot { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; margin-top: 8px; background: var(--bg-inner-2); }
.media-thumb { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, var(--brand-soft), var(--col)); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text-sub); }
.spec-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--ink); background: var(--brand-soft); border: 1px solid var(--sep); border-radius: var(--r-pill); padding: 3px 10px; }
.resolve-form { display: none; position: absolute; z-index: 5; background: var(--bg-inner); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 12px; width: 280px; grid; gap: 6px; }
details[open] .resolve-form { display: grid; }
.resolve-form label { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.resolve-form input[type=radio] { accent-color: var(--brand); }
.err-cell { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 340px; overflow-wrap: anywhere; color: var(--bad-ink); }
.counter { font-size: 11px; color: var(--text-dim); text-align: right; }
.counter.over { color: var(--bad-ink); font-weight: 700; }
.plat-row { display: flex; gap: 10px; flex-wrap: wrap; }
.plat-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--sep); border-radius: var(--r-pill); padding: 8px 14px; cursor: pointer; font-weight: 500; font-size: 13px; background: var(--bg-inner); }
.plat-chip input { accent-color: var(--brand); width: 16px; height: 16px; margin: 0; }
.plat-chip em { font-style: normal; color: var(--text-sub); font-size: 12px; font-weight: 400; }
.plat-chip:hover { border-color: var(--sep); background: var(--hover); }
.plat-chip:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.plat--off, .plat-chip--off { opacity: .55; cursor: not-allowed; background: var(--bg-inner-2); }
.plat-logo { border-radius: 5px; flex: 0 0 auto; }
.mt-6 { margin-top: 20px; } .mb-2 { margin-bottom: 8px; }
.mt-4 { margin-top: 14px; } .mb-4 { margin-bottom: 14px; }
.chip--ig { background: var(--ig-ink); } .chip--li { background: var(--li-ink); }
.pdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
