/* AIM Outreach: nova tabla (09.11.2026). Svaka boja je token; tema svetla/tamna preko prefers-color-scheme + data-theme. */
:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --surface-3: #e9ebf2;
  --border: #e4e6ee;
  --border-strong: #cfd3df;
  --row-hover: #f8f9fc;
  --text: #171a2b;
  --text-2: #4a4f66;
  --text-3: #7b8099;
  --accent: #3b5bdb;
  --accent-hover: #2f4bc0;
  --accent-soft: #e8edfc;
  --accent-text: #ffffff;
  --ok: #178a4c;
  --ok-soft: #dff5e8;
  --warn: #b26a05;
  --warn-soft: #fcefd3;
  --err: #c6383a;
  --err-soft: #fde3e3;
  --info: #2b63c9;
  --info-soft: #e3ecfb;
  --muted: #5e6378;
  --muted-soft: #eceef4;
  --out-bubble: #e8edfc;
  --in-bubble: #ffffff;
  --scrim: rgba(23, 26, 43, 0.35);
  --menu-shadow: 0 10px 30px rgba(23, 26, 43, 0.14);
  --focus: 0 0 0 3px rgba(59, 91, 219, 0.28);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 224px;
  --topbar: 54px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "SF Mono", Menlo, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c;
    --surface: #1a1e27;
    --surface-2: #212633;
    --surface-3: #2b3140;
    --border: #2d3341;
    --border-strong: #434a5c;
    --row-hover: #1f2430;
    --text: #e8eaf0;
    --text-2: #adb3c2;
    --text-3: #8a90a3;
    --accent: #7b93ff;
    --accent-hover: #93a7ff;
    --accent-soft: #263055;
    --accent-text: #0e1322;
    --ok: #4cc47f;
    --ok-soft: #173426;
    --warn: #e6a73e;
    --warn-soft: #3d2d12;
    --err: #f0696e;
    --err-soft: #46202a;
    --info: #6f99ff;
    --info-soft: #223052;
    --muted: #aeb4c2;
    --muted-soft: #2a303d;
    --out-bubble: #263055;
    --in-bubble: #1a1e27;
    --scrim: rgba(0, 0, 0, 0.55);
    --menu-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --focus: 0 0 0 3px rgba(123, 147, 255, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151c;
  --surface: #1a1e27;
  --surface-2: #212633;
  --surface-3: #2b3140;
  --border: #2d3341;
  --border-strong: #434a5c;
  --row-hover: #1f2430;
  --text: #e8eaf0;
  --text-2: #adb3c2;
  --text-3: #8a90a3;
  --accent: #7b93ff;
  --accent-hover: #93a7ff;
  --accent-soft: #263055;
  --accent-text: #0e1322;
  --ok: #4cc47f;
  --ok-soft: #173426;
  --warn: #e6a73e;
  --warn-soft: #3d2d12;
  --err: #f0696e;
  --err-soft: #46202a;
  --info: #6f99ff;
  --info-soft: #223052;
  --muted: #aeb4c2;
  --muted-soft: #2a303d;
  --out-bubble: #263055;
  --in-bubble: #1a1e27;
  --scrim: rgba(0, 0, 0, 0.55);
  --menu-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --focus: 0 0 0 3px rgba(123, 147, 255, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; line-height: 1.25; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
pre { margin: 0; font: inherit; white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { word-break: break-word; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: none; box-shadow: var(--focus); }
svg.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ---------- okvir ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar); background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 45; padding: 14px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 0; margin-bottom: 16px; color: var(--text); min-width: 0; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 32px; }
.brand b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .small { display: block; font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.nav a { position: relative; height: 36px; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--text-2); font-weight: 500; font-size: 13.5px; text-decoration: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .lbl { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .badge { flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.nav .badge.warn { background: var(--warn); color: #fff; }
.side-foot { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 6px; }
.side-foot a { color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 44; display: none; }
.scrim.show { display: block; }

.main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; padding: 0 16px; min-width: 0;
}
.topbar .grow { flex: 1 1 auto; min-width: 0; }
.menu-btn { display: none; }
.switcher { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: auto; scrollbar-width: none; min-width: 0; }
.switcher::-webkit-scrollbar { display: none; }
.cpill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.cpill:hover { background: var(--surface-2); color: var(--text); }
.cpill.on { border-color: var(--client, var(--accent)); background: var(--accent-soft); color: var(--text); }
.cpill .st { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.cpill.on .st { color: var(--text-2); }
.cdot { width: 8px; height: 8px; border-radius: 50%; background: var(--client, var(--border-strong)); display: inline-block; flex: 0 0 8px; }
.switch-select { display: none; }
.search { position: relative; display: flex; align-items: center; flex: 0 1 260px; min-width: 120px; }
.search input { width: 100%; padding-left: 32px; }
.search svg { position: absolute; left: 9px; color: var(--text-3); pointer-events: none; }
.mode { white-space: nowrap; }
.iconbtn { position: relative; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font: inherit; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn .cnt { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--err); color: #fff; font-size: 10px; line-height: 16px; font-weight: 700; text-align: center; }
.iconbtn .cnt.warn { background: var(--warn); }
.menu-anchor { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); width: min(380px, calc(100vw - 32px)); max-height: 440px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--menu-shadow); z-index: 60; padding: 6px; }
.menu .mh { padding: 8px 10px 6px; font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.alert-row { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); font-size: 12.5px; align-items: flex-start; }
.alert-row .t { color: var(--text-3); white-space: nowrap; }
.alert-row .x { flex: 1 1 auto; min-width: 0; word-break: break-word; }
.legacy-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12.5px; padding: 6px 8px; border-radius: 8px; white-space: nowrap; }
.legacy-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }

.page { padding: 20px max(20px, env(safe-area-inset-right, 0px)) 56px max(20px, env(safe-area-inset-left, 0px)); max-width: 1480px; width: 100%; margin: 0 auto; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-3); font-size: 13px; margin-top: 3px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title { font-size: 15px; font-weight: 600; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-title .muted { font-weight: 400; font-size: 12.5px; }
.banner { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--border); padding: 7px 16px; font-size: 13px; text-align: center; }

/* ---------- dugmad, polja ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--err); border-color: var(--err); }
.btn.danger:hover { background: var(--err-soft); }
.btn.ok { color: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: var(--ok-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn.armed { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.btn svg.ic { width: 15px; height: 15px; }
.linkbtn { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
input, select, textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 10px; height: 32px; min-width: 0; max-width: 100%; }
textarea { height: auto; min-height: 90px; line-height: 1.5; resize: vertical; width: 100%; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; height: 16px; accent-color: var(--accent); vertical-align: -3px; margin: 0 5px 0 0; padding: 0; }
input::placeholder { color: var(--text-3); }
label.chk { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.field > span { font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 12px; }
.form-grid .full { grid-column: 1 / -1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar select, .toolbar input { width: auto; }
.toolbar input[type="search"], .toolbar input[type="text"] { min-width: 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip .n { color: var(--text-3); font-weight: 500; }
.chip.on .n { color: var(--accent); }
.chips .lbl { font-size: 12px; color: var(--text-3); margin-right: 2px; }

/* ---------- kartice, KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card.tight { padding: 10px 12px; }
.card + .card { margin-top: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.cards .card + .card { margin-top: 0; }
.client-card { border-left: 3px solid var(--client, var(--border-strong)); }
.client-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.client-head b { font-size: 14.5px; }
.client-head .goal { color: var(--text-3); font-size: 12px; flex-basis: 100%; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.kpi { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; min-width: 0; display: block; color: inherit; text-decoration: none; }
a.kpi:hover { background: var(--accent-soft); text-decoration: none; }
.kpi .label { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-size: 20px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.kpi .value small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.kpi .sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.hot .value { color: var(--warn); }
.kpi.bad .value { color: var(--err); }
.kpi.good .value { color: var(--ok); }
.totals { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.totals b { color: var(--text); }
.empty { color: var(--text-3); padding: 28px 16px; text-align: center; font-size: 13.5px; }
.na { border-style: dashed; color: var(--text-2); }
.na b { display: block; margin-bottom: 4px; color: var(--text); }
.errbox { background: var(--err-soft); color: var(--err); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; }
.okbox { background: var(--ok-soft); color: var(--ok); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; }
.hint { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12.5px; color: var(--text-2); }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.progress.warn > i { background: var(--warn); }
.progress.err > i { background: var(--err); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-3); white-space: nowrap; }
.kv dd { margin: 0; word-break: break-word; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.grid-2 .card + .card { margin-top: 0; }
.list { display: flex; flex-direction: column; }
.list > .row { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; align-items: flex-start; }
.list > .row:first-child { border-top: none; }
.list > .row .t { flex: 0 0 auto; color: var(--text-3); white-space: nowrap; font-size: 12px; padding-top: 2px; }
.list > .row .x { flex: 1 1 auto; min-width: 0; word-break: break-word; }

/* ---------- pilule ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 20px; white-space: nowrap; background: var(--muted-soft); color: var(--muted); vertical-align: middle; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.err { background: var(--err-soft); color: var(--err); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.xs { height: 17px; line-height: 17px; font-size: 10.5px; padding: 0 6px; }
.pill.strong.ok { background: var(--ok); color: #fff; }
.pill.strong.err { background: var(--err); color: #fff; }
.pill.strong.warn { background: var(--warn); color: #fff; }
.grade { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; background: var(--muted-soft); color: var(--muted); }
.grade.A { background: var(--ok-soft); color: var(--ok); }
.grade.B { background: var(--info-soft); color: var(--info); }
.grade.C { background: var(--warn-soft); color: var(--warn); }
.dns { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* ---------- tabele ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-width: 100%; max-height: calc(100vh - 150px); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--text); }
thead th .arr { font-size: 10px; margin-left: 3px; color: var(--accent); }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; max-width: 320px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--row-hover); }
tr.clickable { cursor: pointer; }
tr.selected td { background: var(--accent-soft); }
td .l1 { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
td .l2 { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
td.num, th.num { text-align: right; }
td.check, th.check { width: 32px; padding-right: 0; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.cols-menu { right: auto; left: 0; width: 240px; padding: 8px 10px; }
.cols-menu label { display: flex; align-items: center; gap: 4px; padding: 3px 0; font-size: 13px; cursor: pointer; }

/* ---------- drawer ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--menu-shadow); z-index: 70; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.18s ease; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-head .who { flex: 1 1 auto; min-width: 0; }
.drawer-head .who b { font-size: 15px; display: block; }
.drawer-head .who .l2 { font-size: 12.5px; color: var(--text-3); word-break: break-word; }
.drawer-body { flex: 1 1 auto; overflow: auto; padding: 14px 18px 40px; }
.drawer .section-title { margin-top: 18px; }
.drawer .section-title:first-child { margin-top: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border); font-size: 13px; background: var(--in-bubble); white-space: pre-wrap; word-break: break-word; }
.bubble.out { margin-left: auto; background: var(--out-bubble); }
.bubble.auto, .bubble.bounce { border-style: dashed; }
.bubble .meta { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; white-space: normal; }
.bubble .subj { font-weight: 600; margin-bottom: 4px; }
.draft { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; background: var(--surface-2); }
.draft .dh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 12.5px; }
.draft .subj { font-weight: 600; margin-bottom: 4px; }
.draft pre { font-size: 13px; }
.draft .qc { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.draft textarea { font-size: 13px; }
.draft input { width: 100%; margin-bottom: 6px; }

/* ---------- odobrenja ---------- */
.apr-group { margin-bottom: 12px; }
.apr-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.apr-head .who { flex: 1 1 200px; min-width: 0; }
.apr-head .who b { display: block; }
.apr-head .who .l2 { font-size: 12.5px; color: var(--text-3); word-break: break-word; }

/* ---------- odgovori ---------- */
.split { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 12px; align-items: start; }
.split .card + .card { margin-top: 0; }
.rlist { display: flex; flex-direction: column; max-height: calc(100vh - 190px); overflow: auto; }
.rrow { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border); padding: 10px 10px; font: inherit; color: var(--text); cursor: pointer; }
.rrow:hover { background: var(--row-hover); }
.rrow.on { background: var(--accent-soft); }
.rrow .l1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; }
.rrow .l1 .t { color: var(--text-3); font-size: 12px; font-weight: 400; white-space: nowrap; }
.rrow .l2 { font-size: 12.5px; color: var(--text-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reply-box textarea { min-height: 110px; }

/* ---------- inboxi ---------- */
.acc-card .l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-card .l1 b { font-size: 14px; word-break: break-all; }
.acc-card .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 10px 0; font-size: 12.5px; }
.acc-card .stats div { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; }
.acc-card .stats .label { color: var(--text-3); font-size: 11px; display: block; }
.acc-card .err { color: var(--err); font-size: 12.5px; word-break: break-word; }

/* ---------- kalendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-nav b { min-width: 150px; text-align: center; font-size: 15px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-size: 11.5px; color: var(--text-3); text-align: center; padding: 2px 0; }
.cal-cell { min-height: 84px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 5px 6px; background: var(--surface); font-size: 11.5px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.sel { box-shadow: inset 0 0 0 1px var(--accent); border-color: var(--accent); }
.cal-cell.off { background: var(--surface-2); color: var(--text-3); }
.cal-cell .n { font-weight: 600; font-size: 12px; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; }
.cal-cell.today .n { background: var(--accent); color: var(--accent-text); }
.cal-cell .b { display: flex; flex-wrap: wrap; gap: 0 6px; line-height: 1.35; }
.cb.sent { color: var(--accent); }
.cb.fu { color: var(--text-2); }
.cb.rep { color: var(--ok); font-weight: 600; }
.cb.int { color: var(--ok); font-weight: 700; }
.cb.bnc { color: var(--err); }
.cb.call { color: var(--warn); font-weight: 600; }
.cb.plan { color: var(--text-3); }

/* ---------- rucna traka ---------- */
.mcard .mh { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.mcard .mail { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.mcard .mail .subj { font-weight: 600; margin-bottom: 6px; }

/* ---------- scraper ---------- */
.counts { display: flex; flex-wrap: wrap; gap: 4px; }
.jobs .row { align-items: center; }

/* ---------- log ---------- */
.logline { font-family: var(--mono); font-size: 12px; }

/* ---------- analitika ---------- */
.anbars { display: flex; align-items: flex-end; gap: 2px; height: 170px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.anb { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 1px; border-radius: 3px 3px 0 0; }
.anb:hover { background: var(--row-hover); }
.anb span { display: block; flex: 1 1 0; max-width: 16px; border-radius: 2px 2px 0 0; }
.anb .sent, .anlegend i.sent { background: var(--accent); opacity: 0.55; }
.anb .rep, .anlegend i.rep { background: var(--ok); }
.anbars-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.anlegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 6px; }
.anlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.anfun { display: flex; flex-direction: column; gap: 7px; }
.anfun-row { display: grid; grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) 44px 48px; gap: 8px; align-items: center; font-size: 13px; }
.anfun-row .lbl { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anfun-row .bar { height: 14px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.anfun-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.anfun-row b { text-align: right; }
.anfun-row .pct { font-size: 12px; color: var(--text-3); text-align: right; }
.an-table { max-height: 440px; }
.an-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.an-kpis { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.an-kpis .kpi .sub { white-space: normal; }

/* ---------- login, toast ---------- */
.login-wrap { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 380px; max-width: 100%; }
.login h2 { margin: 10px 0 4px; }
.login .brand { margin-bottom: 6px; padding: 0; }
.login .field { margin: 12px 0; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; z-index: 200; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; transition: opacity 0.15s; }
#toast.show { opacity: 1; }
#toast.ok { background: var(--ok); color: #fff; }
#toast.err { background: var(--err); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .sidebar { width: 196px; flex-basis: 196px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.18s ease; width: 248px; flex-basis: 248px; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--menu-shadow); }
  .menu-btn { display: inline-flex; }
  .page { padding: 14px 16px 48px; }
  .split { grid-template-columns: 1fr; }
  .split .rlist { max-height: 46vh; }
  .split.thread-open .rlist-card { display: none; }
  .back-btn { display: inline-flex !important; }
  .legacy-link span { display: none; }
}
@media (max-width: 640px) {
  .switcher { display: none; }
  .switch-select { display: inline-block; max-width: 124px; padding: 6px 6px; }
  .search { flex: 1 1 70px; min-width: 70px; }
  .search input { padding-left: 28px; }
  .mode span.txt { display: none; }
  .mode .pill { padding: 0 5px; }
  .iconbtn { width: 32px; height: 32px; }
  .legacy-link { padding: 6px 4px; }
  .topbar { gap: 4px; padding: 0 8px; }
  .topbar .grow { display: none; }
  .page { padding: 12px 12px 48px; }
  .page-head h1 { font-size: 18px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards, .cards.wide { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cal-cell { min-height: 60px; padding: 3px 4px; }
  .cal-cell .b { display: none; }
  .cal-cell .b.first { display: flex; }
  .drawer { width: 100vw; }
  td .l1, td .l2 { max-width: 180px; }
}
@media (max-width: 480px) {
  .switch-select { max-width: 104px; }
  .legacy-link { display: none; }   /* link ostaje u podnozju menija */
  td .l1, td .l2 { max-width: 150px; }
}
.back-btn { display: none; }
@media (max-width: 640px) {
  .anfun-row { grid-template-columns: minmax(84px, 120px) minmax(0, 1fr) 36px 44px; }
  .anbars { height: 130px; }
  .anb span { max-width: 10px; }
}
