:root {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f2f5; --line: #e1e4ea; --text: #171a21; --muted: #626b7a;
  --accent: #2f5bea; --accent-soft: #e8edfd; --ok: #14804a; --ok-soft: #e3f4ea; --warn: #9a6200; --warn-soft: #fdf1d8;
  --bad: #c0352b; --bad-soft: #fde8e6; --idea: #6b7280; --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  --ig: #c13584; --fb: #1877f2; --tt: #111;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318; --surface: #1a1d24; --surface-2: #232730; --line: #2e333d; --text: #eceef2; --muted: #9aa3b2;
    --accent: #7c9bff; --accent-soft: #232c4a; --ok: #5fd197; --ok-soft: #173326; --warn: #f0b84a; --warn-soft: #3a2d10;
    --bad: #ff8a80; --bad-soft: #40201d; --idea: #9aa3b2; --shadow: none; --tt: #e5e5e5;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent); }
.boot { padding: 40px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { margin-left: auto; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 12px; }
.hide { display: none !important; }

/* Kontrollet */
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 7px 12px; min-height: 36px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { button.primary { color: #0d1020; } }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { button.ok { color: #0c1a12; } }
button.danger { color: var(--bad); }
button.ghost { border-color: transparent; background: transparent; }
button.mini { white-space: nowrap; min-height: 28px; padding: 2px 8px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; width: 100%; min-height: 38px; }
textarea { resize: vertical; min-height: 76px; field-sizing: content; max-height: 360px; }
input[type=checkbox] { width: auto; min-height: 0; }
label.f { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
label.f span.hint { font-weight: 400; color: var(--muted); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* Struktura */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 700; font-size: 16px; padding: 4px 8px 14px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav .ico { width: 18px; text-align: center; }
.main { min-width: 0; }
.top { display: flex; gap: 10px; align-items: center; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top select { width: auto; max-width: 260px; font-weight: 600; }
.page { padding: 20px 24px 60px; max-width: 1200px; display: grid; gap: 16px; }
.head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card > h2 { margin-bottom: 10px; }
.banner { border-radius: var(--radius); padding: 10px 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.banner.info { background: var(--accent-soft); color: var(--accent); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }

/* Etiketat */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.s-idea { background: var(--surface-2); color: var(--idea); }
.tag.s-in_progress { background: var(--accent-soft); color: var(--accent); }
.tag.s-pending { background: var(--warn-soft); color: var(--warn); }
.tag.s-approved, .tag.p-published { background: var(--ok-soft); color: var(--ok); }
.tag.p-scheduled, .tag.p-publishing { background: var(--accent-soft); color: var(--accent); }
.tag.p-failed { background: var(--bad-soft); color: var(--bad); }
.tag.sample { background: var(--warn-soft); color: var(--warn); }
.pl { display: inline-grid; place-items: center; width: 24px; height: 20px; border-radius: 5px; font-size: 10px; font-weight: 700; color: #fff; flex: none; }
.pl.instagram { background: var(--ig); } .pl.facebook { background: var(--fb); } .pl.tiktok { background: #111; }

/* Paneli */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.list { display: grid; }
.item { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0; border-radius: 0; background: none; min-height: 0; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--surface-2); }
.item .t { min-width: 0; flex: 1; }
.item .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t span { font-size: 13px; color: var(--muted); }
.cols2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
.irow { display: flex; gap: 8px; align-items: baseline; }
.box button, .auth button { justify-content: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.on { background: var(--ok); } .dot.off { background: var(--line); } .dot.part { background: var(--warn); }

/* Kalendari */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal .dow { background: var(--surface-2); padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal .day { background: var(--surface); min-height: 104px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.cal .day.out { background: var(--bg); }
.cal .day .n { font-size: 12px; color: var(--muted); padding: 0 4px; display: flex; justify-content: space-between; align-items: center; }
.cal .day.today .n b { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; }
.cal .day .add { visibility: hidden; min-height: 0; padding: 0 5px; font-size: 13px; line-height: 18px; }
.cal .day:hover .add, .cal .day:focus-within .add { visibility: visible; }
.chip { display: flex; gap: 5px; align-items: center; font-size: 12px; padding: 3px 5px; border-radius: 6px; border: 0; border-left: 3px solid var(--idea); background: var(--surface-2); text-align: left; width: 100%; min-height: 0; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.s-in_progress { border-left-color: var(--accent); } .chip.s-pending { border-left-color: var(--warn); }
.chip.s-approved { border-left-color: var(--ok); } .chip.p-failed { border-left-color: var(--bad); background: var(--bad-soft); }
.chip.p-published { opacity: .7; }
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.board .col { background: var(--surface-2); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; }
.board .pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: left; display: grid; gap: 6px; width: 100%; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; min-height: 34px; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.filters select { width: auto; }

/* Editori */
#modal:empty, #dialog:empty { display: none; }
#modal, #dialog { position: fixed; inset: 0; background: rgba(10, 14, 24, .5); z-index: 20; display: flex; justify-content: flex-end; }
#dialog { z-index: 30; align-items: center; justify-content: center; padding: 16px; }
.sheet { background: var(--bg); width: min(1080px, 100%); height: 100%; display: flex; flex-direction: column; }
.sheet > header { display: flex; gap: 10px; align-items: center; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sheet > .body { overflow: auto; padding: 16px 18px 40px; display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 16px; align-items: start; }
.sheet > footer { display: flex; gap: 8px; padding: 10px 18px; background: var(--surface); border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.fl { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps button { font-size: 12px; padding: 4px; justify-content: center; min-height: 34px; }
.steps button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.steps button.on.approved { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.preview { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.preview .ph { display: flex; gap: 8px; align-items: center; padding: 10px; font-weight: 600; font-size: 14px; }
.preview .av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; overflow: hidden; }
.preview .av img { width: 100%; height: 100%; object-fit: cover; }
.preview .media { background: var(--surface-2); aspect-ratio: 4 / 5; max-height: 340px; width: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 14px; overflow: hidden; }
.preview .media.has { padding: 0; }
.preview .media img, .preview .media video { width: 100%; height: 100%; object-fit: cover; }
.preview .cap { padding: 10px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview .cap .tags { color: var(--accent); }
.assets { display: grid; gap: 6px; }
.asset { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.asset img { width: 36px; height: 36px; object-fit: cover; border-radius: 5px; flex: none; }
.asset .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checks { display: grid; gap: 4px; font-size: 13px; }
.checks .bad { color: var(--bad); } .checks .warn { color: var(--warn); } .checks .good { color: var(--ok); }
.out { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 8px; padding: 12px; font-size: 14px; max-height: 520px; overflow: auto; }
.box { background: var(--surface); border-radius: 12px; padding: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; display: grid; gap: 14px; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -4px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.metric { background: var(--surface-2); border-radius: 8px; padding: 10px; }
.metric b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.metric span { font-size: 12px; color: var(--muted); }
.metric.na b { font-size: 14px; color: var(--muted); font-weight: 500; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; overflow-wrap: anywhere; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(520px, calc(100% - 32px)); }
.toast { background: #1b1f2a; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast.bad { background: #a52a22; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* Telefoni */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; padding: 4px; border-right: 0; border-top: 1px solid var(--line); z-index: 10; }
  .brand, .side .foot { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 0; font-size: 10px; padding: 6px 4px; flex: 1; text-align: center; }
  .nav .ico { font-size: 17px; }
  .top { padding: 10px 16px; }
  .top select { max-width: 100%; flex: 1; }
  .page { padding: 16px 16px 96px; }
  .cols2, .sheet > .body, .grid3 { grid-template-columns: 1fr; }
  .sheet > .body { padding: 12px 12px 30px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .board { grid-template-columns: repeat(4, 78vw); }
}
