/* Radar — design tokens follow devKit (App-Tube/devkit) and its uxpeak field guide:
   one font family, slate neutrals that pass WCAG AA, 4-pt spacing, soft tinted shadows,
   controls 8–10 px radius, containers 14–24 px, tap targets ≥ 44 px. White page by request. */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/instrument-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/instrument-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Neutrals (devKit light) — every text colour passes 4.5:1 on white and on --tint. */
  --page: #ffffff;
  --surface: #ffffff;
  --tint: #f5f6f8;          /* quiet areas: segmented controls, stat cards, photo placeholders */
  --tint-2: #eef0f3;
  --border: #e3e6eb;
  --border-strong: #cdd2da;
  --control: #7c8595;       /* icons and control outlines, 3:1 */
  --text: #11151c;
  --text-muted: #4b5363;    /* 8.0:1 */
  --text-subtle: #5f6776;   /* 5.9:1 — the lightest text we use */

  /* Brand: one accent, used for primary actions and the active state only. */
  --accent: #2f5bea;        /* 5.4:1 on white */
  --accent-hover: #2349c9;
  --accent-soft: #edf1fd;
  --accent-text: #2449c4;

  --good: #0a7a53;   --good-soft: #e6f4ed;
  --warn: #8f5500;   --warn-soft: #fdf2df;
  --bad: #b42a2a;    --bad-soft: #fceceb;

  /* Type: one family; headings tight (110–130 %), body loose (150–160 %). */
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* 4-pt spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;

  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px; --r-xxl: 24px; --r-pill: 999px;

  /* Soft, slate-tinted shadows (never pure black, never harsh) */
  --shadow-sm: 0 1px 2px rgba(27, 36, 51, 0.06), 0 2px 8px rgba(27, 36, 51, 0.04);
  --shadow-md: 0 1px 4px rgba(27, 36, 51, 0.06), 0 8px 24px -6px rgba(27, 36, 51, 0.10);
  --shadow-lg: 0 2px 8px rgba(27, 36, 51, 0.08), 0 24px 48px -12px rgba(27, 36, 51, 0.18);
  --glow: 0 6px 18px -6px rgba(47, 91, 234, 0.45);

  /* Colours that used to be written inline */
  --on-accent: #ffffff;                 /* text on accent / green buttons */
  --good-btn: #0a7a53;  --good-btn-hover: #086b49;
  --top-bg: rgba(255, 255, 255, 0.86);
  --called-border: #bfe3cf;
  --toast-bg: #11151c;  --toast-text: #ffffff;  --toast-link: #9db4ff;
  --input-bg: #ffffff;
  --warn-dot: #d08700;
  --seg-on: #ffffff;                    /* selected button in a segmented switch */

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --tap: 44px;
  color-scheme: light;
}

/* Dark theme: follows the phone/computer setting, or the choice in the account menu
   (data-theme on <html>, set by theme.js before the page paints). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0e1117; --surface: #161a22; --tint: #1d222c; --tint-2: #262c37;
    --border: #2a303b; --border-strong: #3b4250; --control: #8a93a3;
    --text: #e8ebf0; --text-muted: #bac2cd; --text-subtle: #9aa3b1;
    --accent: #3d68ee; --accent-hover: #5079f2; --accent-soft: #1a2442; --accent-text: #93afff;
    --good: #4cd39b; --good-soft: #13291f; --warn: #f2b65e; --warn-soft: #2d2313; --bad: #ff8f86; --bad-soft: #391c1c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.45), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.5), 0 24px 48px -12px rgba(0, 0, 0, 0.7); --glow: 0 6px 18px -6px rgba(61, 104, 238, 0.55);
    --good-btn: #13805a; --good-btn-hover: #179468; --top-bg: rgba(14, 17, 23, 0.86); --called-border: #1f5a40;
    --toast-bg: #2b313d; --toast-text: #f2f4f7; --toast-link: #a9c0ff; --input-bg: #11151c; --warn-dot: #f2b65e; --seg-on: #343b49;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0e1117; --surface: #161a22; --tint: #1d222c; --tint-2: #262c37;
  --border: #2a303b; --border-strong: #3b4250; --control: #8a93a3;
  --text: #e8ebf0; --text-muted: #bac2cd; --text-subtle: #9aa3b1;
  --accent: #3d68ee; --accent-hover: #5079f2; --accent-soft: #1a2442; --accent-text: #93afff;
  --good: #4cd39b; --good-soft: #13291f; --warn: #f2b65e; --warn-soft: #2d2313; --bad: #ff8f86; --bad-soft: #391c1c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.45), 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.5), 0 24px 48px -12px rgba(0, 0, 0, 0.7); --glow: 0 6px 18px -6px rgba(61, 104, 238, 0.55);
  --good-btn: #13805a; --good-btn-hover: #179468; --top-bg: rgba(14, 17, 23, 0.86); --called-border: #1f5a40;
  --toast-bg: #2b313d; --toast-text: #f2f4f7; --toast-link: #a9c0ff; --input-bg: #11151c; --warn-dot: #f2b65e; --seg-on: #343b49;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Icons: one family, outline, currentColor */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 22px; height: 22px; }

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--s6); }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--top-bg); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); box-shadow: 0 1px 0 var(--border); }
.top-inner { display: flex; align-items: center; gap: var(--s4); height: 64px; }
.brand { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; }
.brand-company { font-size: 13px; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }

.status-pill { display: inline-flex; align-items: center; gap: var(--s2); height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--tint); color: var(--text-muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; box-shadow: 0 0 0 3px rgba(10, 122, 83, 0.15); }
.dot.busy { background: var(--accent); box-shadow: 0 0 0 3px rgba(47, 91, 234, 0.18); animation: pulse 1.1s ease-in-out infinite; }
.dot.warn { background: var(--warn-dot); box-shadow: 0 0 0 3px rgba(208, 135, 0, 0.18); }
@keyframes pulse { 50% { opacity: 0.35; } }
.relay-warn { color: var(--warn); font-weight: 600; }

.nav { display: flex; align-items: center; gap: var(--s1); }
.nav-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--s3); border-radius: var(--r-md); font-size: 14px; font-weight: 500; color: var(--text-muted); transition: background .15s var(--ease), color .15s var(--ease); }
.nav-link:hover { background: var(--tint); color: var(--text); }
.nav-link.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }

/* Account menu */
.menu { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--accent-text); background: var(--accent-soft); border: 0; cursor: pointer; letter-spacing: 0.02em; }
.avatar:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--s2); z-index: 30; }
.menu-head { padding: var(--s2) var(--s3) var(--s3); border-bottom: 1px solid var(--border); margin-bottom: var(--s1); }
.menu-head strong { display: block; font-size: 14px; }
.menu-head span { font-size: 13px; color: var(--text-subtle); word-break: break-all; }
.menu-item { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: var(--tap); padding: 0 var(--s3); border: 0; background: none; border-radius: var(--r-md); font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--tint); }
.menu-theme { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s3); font-size: 14px; color: var(--text); }
.menu-theme > span { display: inline-flex; align-items: center; gap: var(--s3); }
.theme-seg button { height: 30px; padding: 0 10px; font-size: 13px; }
.menu-item .i { color: var(--control); }
.menu-only { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 40px; padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease); }
.btn:hover { background: var(--tint); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn .i { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: var(--glow); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn.quiet:hover { background: var(--tint); color: var(--text); }
.btn.soft { border-color: transparent; background: var(--tint); color: var(--text); }
.btn.soft:hover { background: var(--tint-2); }
.btn.danger { border-color: transparent; background: transparent; color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { height: 36px; padding: 0 var(--s3); font-size: 13.5px; }
.btn.wide { width: 100%; height: 44px; }
.icon-btn { width: 40px; padding: 0; color: var(--text-muted); border-color: transparent; background: transparent; }
.icon-btn:hover { background: var(--tint); color: var(--text); }
.icon-btn.on { color: var(--accent-text); background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Page header + stats ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); padding: var(--s8) 0 var(--s5); }
.page-title { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
.page-sub { margin: var(--s1) 0 0; color: var(--text-subtle); font-size: 15px; line-height: 1.6; max-width: 640px; }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s6); }
.stat { background: var(--tint); border-radius: var(--r-lg); padding: var(--s4) var(--s5); }
.stat-value { font-size: 28px; line-height: 1.1; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 15px; font-weight: 500; color: var(--text-subtle); letter-spacing: 0; margin-left: 2px; }
.stat-label { margin-top: var(--s1); font-size: 13px; color: var(--text-subtle); }
.stat.accent { background: var(--accent-soft); }
.stat.accent .stat-value { color: var(--accent-text); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--s6); border-bottom: 1px solid var(--border); margin-bottom: var(--s4); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: var(--s2); height: 44px; padding: 0; border: 0; background: none; color: var(--text-subtle); font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 650; }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--tint); color: var(--text-muted); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.tab.active .count { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.seg { display: inline-flex; background: var(--tint); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 var(--s3); border: 0; background: none; border-radius: 7px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--seg-on); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg.city button.on { color: var(--accent-text); }
.filters-end { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.switch { display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--text-muted); user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--border-strong); position: relative; transition: background .15s var(--ease); flex: none; }
.knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(17, 21, 28, 0.25); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track .knob { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--control); pointer-events: none; }
.search input { height: 40px; width: 260px; max-width: 100%; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 0 var(--s3) 0 38px; background: var(--surface); font-size: 14px; }
.search input::placeholder { color: var(--text-subtle); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.head-search input { width: 300px; }
.filter-toggle { display: none; }
.filter-toggle .i { transition: transform .2s var(--ease); }
.hint { color: var(--text-subtle); font-size: 13.5px; margin: 0 0 var(--s4); min-height: 20px; display: flex; align-items: center; gap: var(--s2); }

/* ---------- Listing cards ---------- */
.list { list-style: none; margin: 0 0 var(--s16, 64px); padding: 0; display: grid; gap: var(--s4); }
.card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-md); border: 1px solid var(--border); overflow: hidden; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.card-main { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: var(--s5); padding: var(--s3); }
.card[data-status="called"] { border-color: var(--called-border); }
.card[data-status="skipped"] .card-main { opacity: 0.75; }
.card:hover { box-shadow: var(--shadow-lg); }
.card.leaving { opacity: 0.35; transform: scale(0.99); }

.photo { position: relative; display: block; min-height: 180px; border-radius: var(--r-lg); overflow: hidden; background: var(--tint); align-self: stretch; }
.photo img { position: absolute; inset: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.card:hover .photo img { transform: scale(1.03); }
.photo-empty { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: var(--s1); color: var(--control); font-size: 12.5px; }
.photo-empty .i { width: 28px; height: 28px; stroke-width: 1.5; }
.badge-new { position: absolute; top: var(--s2); left: var(--s2); height: 24px; padding: 0 var(--s2); display: inline-flex; align-items: center; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; box-shadow: 0 0 0 2px var(--surface); }
.badge-new.renewed { background: var(--warn-dot); color: #1b1203; }
.unseen-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; position: relative; top: -1px; }
.badge-photos { position: absolute; bottom: var(--s2); right: var(--s2); height: 24px; padding: 0 var(--s2); display: inline-flex; align-items: center; gap: 4px; border-radius: var(--r-pill); background: rgba(17, 21, 28, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; font-size: 12px; font-weight: 600; }
.badge-photos .i { width: 13px; height: 13px; }

.body { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: var(--s1) 0; }
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2); }
.price { font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price small { font-size: 14px; font-weight: 500; color: var(--text-subtle); letter-spacing: 0; }
.price.missing { font-size: 18px; color: var(--text-muted); }
.was { font-size: 14px; color: var(--text-subtle); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.drop { height: 22px; padding: 0 var(--s2); border-radius: var(--r-pill); background: var(--good-soft); color: var(--good); font-size: 12.5px; font-weight: 650; display: inline-flex; align-items: center; }
.title { font-size: 16px; line-height: 1.35; font-weight: 600; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.title:hover { color: var(--accent-text); }
.loc { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 14px; min-width: 0; }
.loc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc .i { width: 16px; height: 16px; color: var(--control); }
.specs { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-top: 2px; }
.spec { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.spec b { color: var(--text); font-weight: 600; }
.spec .i { width: 16px; height: 16px; color: var(--control); }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s1); }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: var(--r-pill); background: var(--tint); color: var(--text-muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent-text); }
.desc { color: var(--text-subtle); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
/* Icons on the card each get their own colour, so the facts are quick to find */
:root { --c-blue: #2563eb; --c-violet: #7c3aed; --c-teal: #0d9488; --c-green: #15803d; --c-amber: #b45309; --c-rose: #e11d48; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-blue: #60a5fa; --c-violet: #a78bfa; --c-teal: #2dd4bf; --c-green: #4ade80; --c-amber: #fbbf24; --c-rose: #fb7185; } }
:root[data-theme="dark"] { --c-blue: #60a5fa; --c-violet: #a78bfa; --c-teal: #2dd4bf; --c-green: #4ade80; --c-amber: #fbbf24; --c-rose: #fb7185; }
.spec .i, .loc .i { box-sizing: content-box; padding: 4px; border-radius: 7px; color: var(--c, var(--control)); background: color-mix(in srgb, var(--c, var(--control)) 14%, transparent); }
.spec-area { --c: var(--c-blue); }
.spec-bed { --c: var(--c-violet); }
.spec-layers { --c: var(--c-teal); }
.spec-euro { --c: var(--c-green); }
.spec-eye { --c: var(--c-amber); }
.loc { --c: var(--c-rose); }

/* The site an ad is on: a coloured mark and the host name */
.site-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 3px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--site) 12%, transparent); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; }
a.site-tag:hover { background: color-mix(in srgb, var(--site) 22%, transparent); }
.site-mark { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 50%; background: var(--site); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: 0.02em; }
.site-kp { --site: #1d4ed8; }
.site-4zida { --site: #15803d; }
.site-oglasi { --site: #c2410c; }
.site-halo { --site: #b91c1c; }
.site-nekretnine { --site: #0e7490; }

/* "Takođe na": a count that opens the list of sites */
.also { font-size: 13.5px; color: var(--text-muted); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.also-toggle { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.also-toggle:hover { background: var(--tint); }
.also-toggle .i { width: 15px; height: 15px; color: var(--control); }
.also-toggle .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 12px; display: inline-grid; place-items: center; }
.also-toggle .chev { transition: transform .15s var(--ease); }
.also-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.also-list { display: flex; flex-wrap: wrap; gap: 6px; }
.meta { margin-top: auto; padding-top: var(--s2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s4); font-size: 13px; color: var(--text-subtle); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .i { width: 14px; height: 14px; }
.note-btn { border: 0; background: none; padding: 0; color: var(--text-subtle); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; min-height: 24px; }
.note-btn:hover { color: var(--accent-text); }
.note-btn .i { width: 14px; height: 14px; }
.note-btn.has-note { color: var(--text-muted); font-weight: 500; max-width: 100%; }
.note-btn.has-note span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.note { width: 100%; height: 36px; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 0 var(--s3); font-size: 14px; background: var(--surface); }
.note:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Priority badge, on the price line */
.prio { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 var(--s3); border-radius: var(--r-pill); font-size: 13px; font-weight: 600; background: var(--tint); color: var(--text-muted); white-space: nowrap; }
.prio b { font-size: 14px; font-variant-numeric: tabular-nums; }
.prio.hot { background: var(--good-soft); color: var(--good); }
.prio.good { background: var(--accent-soft); color: var(--accent-text); }
.prio.mid { background: var(--warn-soft); color: var(--warn); }

/* Action bar: its own tinted strip, contact in green, the call result in blue */
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); background: var(--tint); border-top: 1px solid var(--border); }
.card-actions .btn { height: 40px; }
.btn.call { background: var(--good-btn); border-color: var(--good-btn); color: var(--on-accent); font-variant-numeric: tabular-nums; }
.btn.call:hover { background: var(--good-btn-hover); border-color: var(--good-btn-hover); }
.card-actions .btn.soft { background: var(--surface); border-color: var(--border-strong); }
.card-actions .btn.soft:hover { background: var(--tint-2); }
.no-phone { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-subtle); padding: 0 var(--s2) 0 var(--s1); }
.card-actions .open-link { margin-left: auto; padding: 0 var(--s3); height: 40px; }
.card[data-status="called"] .card-actions { background: var(--good-soft); }

/* Notes: a short history under the card */
.card-notes { padding: var(--s3) var(--s4); border-top: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: var(--s2); }
.notes-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.link-btn { border: 0; background: none; padding: 0 0 0 var(--s2); color: var(--accent-text); font-size: 13px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.note-item { border-left: 3px solid var(--accent-soft); padding: 2px 0 2px var(--s3); }
.note-head { display: flex; align-items: center; gap: 2px; font-size: 12.5px; color: var(--text-subtle); }
.note-head b { color: var(--text); font-weight: 600; }
.note-item p { margin: 2px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-del { margin-left: auto; border: 0; background: none; color: var(--control); width: 32px; height: 28px; display: grid; place-items: center; border-radius: var(--r-sm); cursor: pointer; }
.note-del:hover { color: var(--bad); background: var(--bad-soft); }
.note-form { display: flex; gap: var(--s2); align-items: center; }
.note-form .note { flex: 1; height: 40px; }
.i-xs { width: 14px; height: 14px; }
.chip .i { margin-right: 4px; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.desc.long { cursor: pointer; -webkit-line-clamp: 2; }
.desc.long.open { -webkit-line-clamp: unset; display: block; white-space: pre-wrap; }
.open-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; font-size: 13.5px; font-weight: 600; color: var(--accent-text); border-radius: var(--r-md); }
.open-link:hover { background: var(--accent-soft); }
.open-link .i { width: 15px; height: 15px; }
.done-chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 var(--s3); border-radius: var(--r-md); font-size: 13.5px; font-weight: 600; background: var(--good-soft); color: var(--good); }
.done-chip.skipped { background: var(--tint); color: var(--text-muted); }
.done-chip .i { width: 15px; height: 15px; }

/* Skeleton while loading */
.skeleton .photo, .sk { background: linear-gradient(90deg, var(--tint) 0%, var(--tint-2) 50%, var(--tint) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk { border-radius: 6px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Empty state = a small onboarding moment */
.empty { text-align: center; padding: var(--s12) var(--s6); max-width: 460px; margin: var(--s4) auto var(--s16, 64px); }
.empty-icon { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto var(--s4); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.empty-icon .i { width: 28px; height: 28px; }
.empty-title { font-size: 19px; line-height: 1.3; font-weight: 650; margin: 0 0 var(--s2); }
.empty-sub { margin: 0 0 var(--s5); color: var(--text-subtle); font-size: 15px; line-height: 1.6; }

.banner { display: flex; align-items: center; justify-content: center; gap: var(--s2); background: var(--bad-soft); color: var(--bad); font-size: 14px; font-weight: 600; padding: var(--s2) var(--s4); text-align: center; }
.banner.soft { background: var(--warn-soft); color: var(--warn); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: var(--s6); transform: translate(-50%, 20px); opacity: 0; background: var(--toast-bg); color: var(--toast-text); border-radius: var(--r-lg); padding: var(--s3) var(--s4); font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: var(--s3); box-shadow: var(--shadow-lg); transition: opacity .2s var(--ease), transform .2s var(--ease); z-index: 50; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: none; color: var(--toast-link); font-weight: 650; cursor: pointer; padding: 4px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: var(--s4); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text); }
.field-hint { font-size: 13px; font-weight: 400; color: var(--text-subtle); }
.input { height: 44px; border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 0 var(--s3); background: var(--surface); font-size: 15px; color: var(--text); width: 100%; min-width: 0; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.input::placeholder { color: var(--text-subtle); }
/* Our own arrow, with room for it: the browser's arrow sat on the right border. */
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237c8595' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
select.input.sm { padding-right: 30px; background-position: right 10px center; }
select.input::-ms-expand { display: none; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.password { position: relative; }
.password .input { padding-right: 48px; }
.password button { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: var(--control); cursor: pointer; display: grid; place-items: center; border-radius: var(--r-sm); }
.password button:hover { color: var(--text); }
.form-error { display: flex; align-items: center; gap: var(--s2); color: var(--bad); background: var(--bad-soft); border-radius: var(--r-md); padding: var(--s2) var(--s3); font-size: 14px; margin: 0; }
.form-error:empty { display: none; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); }
.inline-form .field { flex: 1 1 200px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: end; gap: var(--s4); }
.check { display: inline-flex; align-items: center; gap: var(--s2); font-size: 13.5px; color: var(--text-muted); cursor: pointer; white-space: nowrap; min-height: var(--tap); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.row { display: flex; gap: var(--s2); }

/* ---------- Sign-in pages ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: var(--s6) var(--s4); background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--page); }
.auth-card { width: 100%; max-width: 400px; border-radius: var(--r-xxl); padding: var(--s8); background: var(--surface); box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s8); }
.auth-title { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 var(--s2); }
.auth-sub { color: var(--text-subtle); font-size: 15px; line-height: 1.6; margin: 0 0 var(--s6); }
.auth-help { color: var(--text-subtle); font-size: 14px; line-height: 1.6; margin: var(--s5) 0 0; text-align: center; }
.auth-foot { margin-top: var(--s6); text-align: center; font-size: 13px; color: var(--text-subtle); }

/* ---------- Team & admin ---------- */
.page { padding-bottom: var(--s16, 64px); }
.panel { background: var(--surface); border-radius: var(--r-xl); padding: var(--s6); margin-bottom: var(--s5); box-shadow: var(--shadow-md); }
.panel-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s5); }
.panel-head .btn:last-child { margin-left: auto; }
.panel-title { font-size: 19px; line-height: 1.3; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.panel-sub { font-size: 14px; color: var(--text-subtle); margin: -12px 0 var(--s5); }
.sub-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-subtle); margin: var(--s6) 0 var(--s2); font-weight: 650; }
.people { display: flex; flex-direction: column; }
.person { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--border); }
.people .person:first-child { border-top: 0; }
.person-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 650; flex: none; }
.person-main { flex: 1 1 240px; min-width: 0; }
.person-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.person-meta { color: var(--text-subtle); font-size: 13.5px; }
.person-actions { display: flex; align-items: center; gap: var(--s1) var(--s2); flex-wrap: wrap; }
.link-box { flex-basis: 100%; background: var(--accent-soft); border-radius: var(--r-lg); padding: var(--s4); margin-top: var(--s3); }
.link-box p { margin: 0 0 var(--s3); font-size: 14px; color: var(--text); display: flex; align-items: center; gap: var(--s2); }
.link-box .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--input-bg); }
.company-meta { display: flex; flex-wrap: wrap; gap: var(--s2); }

/* ---------- Phone ---------- */
@media (max-width: 860px) {
  .card-main { grid-template-columns: 180px minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:last-child { grid-column: span 2; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 var(--s4); }
  .top-inner { height: 60px; }
  .nav, .status-pill .status-text { display: none; }
  .menu-only { display: flex; }
  .status-pill { padding: 0 10px; }
  .page-head { padding: var(--s6) 0 var(--s4); }
  .page-title { font-size: 24px; }
  .stats { gap: var(--s2); }
  .stat { padding: var(--s3) var(--s4); }
  .stat-value { font-size: 24px; }
  /* Phone: city + a "Filteri" button; the rest opens below it. */
  .filters { gap: var(--s2); }
  .filters .seg:not(.city):not(.deal), .filters .filters-end { display: none; }
  .filters.open .seg:not(.city), .filters.open .filters-end { display: inline-flex; }
  /* Rent / sale is the first thing agents switch, so it stays visible on phones, full width. */
  .filters .seg.deal { display: flex; flex-basis: 100%; }
  .filters .seg.deal button { flex: 1; }
  .filters-end { margin-left: 0; }
  .filter-toggle { display: inline-flex; margin-left: auto; }
  .filters.open .filter-toggle .i { transform: rotate(180deg); }
  .search-row { margin-bottom: var(--s3); }
  .search input { width: 100%; }
  .card-main { grid-template-columns: 1fr; padding: var(--s2); gap: var(--s3); }
  .photo { aspect-ratio: 16 / 10; min-height: 0; }
  .body { padding: 0 var(--s2); }
  .card-actions { padding: var(--s3); }
  .card-actions .btn { flex: 1 1 auto; }
  .card-actions .btn.call { flex-basis: 100%; }
  .card-actions .open-link { margin-left: 0; flex-basis: 100%; justify-content: center; }
  .card-notes { padding: var(--s3); }
  .price { font-size: 22px; }
  .panel { padding: var(--s5) var(--s4); }
  .auth-card { padding: var(--s6) var(--s5); }
}
@media (min-width: 641px) { .search-row { display: none; } }
@media (max-width: 640px) { .head-search { display: none; } }
.sk-price { width: 40%; height: 22px; }
.sk-short { width: 60%; }
.sk-block { height: 72px; border-radius: var(--r-lg); }
.card.skeleton .card-actions { min-height: 64px; }
.skeleton .body { gap: var(--s3); padding-top: var(--s2); }
.panel-head .person-avatar { width: 40px; height: 40px; background: var(--accent-soft); color: var(--accent-text); }
.panel-head .person-avatar .i { width: 20px; height: 20px; }
.panel-head .btn.danger { margin-left: auto; }
.person .chip { height: 22px; font-size: 12px; }
.field-hint { order: 3; }
.grid-form { align-items: start; }
.grid-form .form-end { padding-top: 27px; }
.add-person { background: var(--tint); border-radius: var(--r-lg); padding: var(--s4); margin-top: var(--s3); }
.add-person .input { background: var(--input-bg); }
.add-title { flex-basis: 100%; font-size: 14px; font-weight: 600; margin: 0 0 calc(-1 * var(--s1)); }

/* ---------- Halo button page ---------- */
.steps { margin: var(--s4) 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: var(--s4); font-size: 15px; line-height: 1.6; }
.steps .bookmarklet { margin-left: var(--s2); cursor: grab; }

/* Day headers in the list, and the "Na vrh" button */
.day-sep { list-style: none; display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0 calc(-1 * var(--s1)); font-size: 13px; font-weight: 650; color: var(--text-muted); text-transform: capitalize; }
.day-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.list > .day-sep:first-child { margin-top: 0; }
/* "Prikaži još" under the list; also loads by itself when it scrolls into view */
.list:has(+ .more:not([hidden])) { margin-bottom: var(--s5); }
.more { display: flex; flex-direction: column; align-items: center; gap: var(--s2); margin: 0 0 var(--s16, 64px); }
.more-text { font-size: 13px; color: var(--text-muted); }
.to-top { position: fixed; right: var(--s5); bottom: var(--s5); z-index: 40; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); display: grid; place-items: center; cursor: pointer; }
.to-top .i { width: 22px; height: 22px; transform: rotate(180deg); }
.to-top:hover { background: var(--tint); }
.to-top[hidden] { display: none; }
.status-pill, .prio { cursor: pointer; }
.toast { width: max-content; max-width: min(560px, calc(100vw - 32px)); line-height: 1.45; }
@media (max-width: 640px) { .to-top { right: var(--s4); bottom: var(--s4); } }

/* ---------- Admin: usage ---------- */
/* Small grey second line in tables and rows; a row of chips */
.u-sub { display: block; font-size: 13px; color: var(--text-subtle); font-weight: 400; }
.u-totals { display: flex; flex-wrap: wrap; gap: 6px; }

/* Admin: companies as short rows that open for details */
.admin-bar { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.admin-bar .search-companies { flex: 1; max-width: 360px; }
.admin-bar .btn { margin-left: auto; }
.co-list { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s16, 64px); }
.co { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.co[open] { box-shadow: var(--shadow-md); }
.co-sum { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); cursor: pointer; list-style: none; min-height: 60px; }
.co-sum::-webkit-details-marker { display: none; }
.co-sum:hover { background: var(--tint); border-radius: var(--r-lg); }
.co[open] .co-sum { border-bottom: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.co-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.co-avatar .i { width: 18px; height: 18px; }
.co-name { flex: 1; min-width: 0; }
.co-name b { font-weight: 650; }
.co-name .u-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-chev { flex: none; color: var(--control); transition: transform .15s var(--ease); }
.co[open] .co-chev { transform: rotate(180deg); }
.co-body { padding: var(--s5) var(--s4) var(--s4); }
.co-body > .check { margin-top: var(--s3); white-space: normal; }
.co-danger { display: flex; justify-content: flex-end; margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .co-sum { flex-wrap: wrap; }
  .co-name { flex-basis: calc(100% - 80px); }
  .co-sum .chip { order: 3; }
}

/* Admin usage: one number at a time, all companies together */
.u-tabs { gap: var(--s5); }
.u-tabs .tab { font-size: 14px; height: 40px; }
.u-hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2) var(--s8); margin: var(--s2) 0 var(--s5); }
.u-hero div { display: flex; flex-direction: column; }
.u-hero b { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.u-hero div span { font-size: 13px; color: var(--text-subtle); }
.u-trend { flex-basis: 100%; margin: 0; font-size: 13.5px; color: var(--text-muted); }
.u-plot { position: relative; padding-left: 36px; }
.u-grid { position: absolute; left: 0; top: 0; bottom: 26px; width: 100%; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.u-grid span { font-size: 11.5px; color: var(--text-subtle); font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--border); line-height: 1; padding-bottom: 2px; }
.u-bars { display: flex; align-items: stretch; gap: 2px; height: 180px; padding-top: 14px; }
.u-col { flex: 1; display: flex; align-items: flex-end; cursor: default; }
.u-col span { display: block; width: 100%; max-width: 28px; margin: 0 auto; border-radius: 4px 4px 0 0; background: var(--accent); }
.u-col:hover span { background: var(--accent-text); }
.u-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--toast-bg); color: var(--toast-text); border-radius: var(--r-sm); padding: 6px 10px; font-size: 12.5px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-md); z-index: 5; }
.u-tip b { font-variant-numeric: tabular-nums; }
.u-tip span { display: block; opacity: .75; font-size: 11.5px; }
.u-plot .u-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-subtle); margin: 6px 0 var(--s2); }
.u-table-wrap { overflow-x: auto; }
.u-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.u-table th { text-align: left; font-weight: 600; color: var(--text-subtle); font-size: 12.5px; padding: 6px 10px 6px 0; white-space: nowrap; border-bottom: 1px solid var(--border); }
.u-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; color: var(--text); }
.u-table td b { font-weight: 600; }
.u-table tr.u-idle td { color: var(--text-subtle); }
#usage .panel-head .seg { margin-left: auto; }

/* ---------- Admin: reservations from the Komšinica site ---------- */
.res-programs { margin-bottom: var(--s3); }
.u-table td.res-needs { white-space: normal; min-width: 180px; }
.u-table a { color: var(--accent-text); }

/* ---------- Board of leads (/tabla) ---------- */
.wrap.wide { max-width: 1680px; }
.tab-link { text-decoration: none; }
.tab .i-sm { color: var(--control); }
.count.due-count { background: var(--warn-soft); color: var(--warn); margin-left: 2px; }
.nav-link .count { min-width: 20px; height: 20px; font-size: 11.5px; }
.input.sm { height: 36px; font-size: 13.5px; border-radius: var(--r-sm); }

.board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s4); }
.bar-field { display: inline-flex; align-items: center; gap: var(--s2); color: var(--control); }
.bar-field .input { width: auto; min-width: 180px; color: var(--text); }
.stage-pick { display: none; }

.board { display: flex; gap: var(--s3); overflow-x: auto; align-items: flex-start; padding-bottom: var(--s4); margin-bottom: var(--s8); scroll-snap-type: x proximity; }
.board > .col { flex: 1 0 264px; max-width: 360px; }
/* Empty stages take little room, so the columns with cards fit on screen. They still take drops. */
.board > .col.empty { flex: 0 0 136px; min-height: 120px; }
.board > .col.empty[data-stage='novo'] { flex-basis: 220px; }
.col.empty .col-empty { padding: var(--s3) var(--s2); font-size: 12px; }
.col { background: var(--tint); border-radius: var(--r-lg); padding: var(--s2); min-height: 180px; display: flex; flex-direction: column; scroll-snap-align: start; transition: box-shadow 0.15s var(--ease); }
.col.drop { box-shadow: inset 0 0 0 2px var(--accent); }
.col-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s2) var(--s2); }
.col-head h2 { margin: 0; font-size: 14px; font-weight: 650; line-height: 1.3; }
.col-head .count { margin-left: auto; background: var(--surface); }
.col-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--control); }
.col-dot.st-novo { background: var(--accent); }
.col-dot.st-zainteresovan, .col-dot.st-dokumenta { background: var(--warn-dot); }
.col-dot.st-oglasen, .col-dot.st-kupac, .col-dot.st-ugovor, .col-dot.st-zavrseno { background: var(--good); }
.col-dot.st-odustao { background: var(--border-strong); }
.col-list { display: flex; flex-direction: column; gap: var(--s2); }
.col-empty { margin: 0; padding: var(--s4) var(--s3); border: 1px dashed var(--border-strong); border-radius: var(--r-md); color: var(--text-subtle); font-size: 13px; line-height: 1.5; text-align: center; }
.col-more { align-self: center; }

.lead { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s3); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; cursor: grab; min-width: 0; }
.lead.late { box-shadow: inset 3px 0 0 var(--bad), var(--shadow-sm); }
.lead.dragging { opacity: 0.5; }
.lead-head { display: flex; gap: var(--s2); align-items: center; min-width: 0; }
.lead-photo { width: 56px; height: 56px; flex: none; border-radius: var(--r-sm); object-fit: cover; background: var(--tint); }
.lead-photo.none { display: grid; place-items: center; color: var(--control); }
.lead-head-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lead-src { font-size: 12px; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-top { display: flex; align-items: baseline; gap: var(--s2); }
.lead-price { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.lead-price.big { font-size: 22px; }
.lead-deal { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-subtle); }
.lead-title { border: 0; background: none; padding: 0; text-align: left; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text); cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.lead-title:hover { color: var(--accent-text); text-decoration: underline; }
.lead-loc { display: flex; align-items: flex-start; gap: 4px; font-size: 12.5px; line-height: 1.45; color: var(--text-subtle); }
.lead-loc .i { margin-top: 2px; }
.lead-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.lead-chips:empty { display: none; }
.lead-chips .chip { height: 22px; font-size: 12px; padding: 0 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-foot { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.lead-foot .lead-stage { margin-left: auto; width: auto; max-width: 150px; height: 32px; font-size: 12.5px; padding: 0 28px 0 10px; background-position: right 9px center; }
.lead-call { height: 32px; padding: 0 var(--s2); font-size: 12.5px; min-width: 0; gap: 4px; }
.lead-call span { display: none; }   /* desktop columns are narrow: the number shows on hover and in the opened card */
.lead-avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 650; background: var(--accent-soft); color: var(--accent-text); }
.lead-avatar.none { background: var(--tint-2); color: var(--text-subtle); }

/* Danas */
.due-list { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md); margin-bottom: var(--s5); }
.due { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-top: 1px solid var(--border); }
.due:first-child { border-top: 0; }
.due-when { display: flex; flex-direction: column; line-height: 1.3; }
.due-when b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.due-when span { font-size: 12.5px; color: var(--text-subtle); }
.due.late .due-when b, .late-title { color: var(--bad); }
.due-reason { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.due-main .lead-title { -webkit-line-clamp: 1; }
.due-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }

/* Lead card, opened */
.lead-dlg { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; padding: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.lead-dlg::backdrop { background: rgba(15, 18, 25, 0.5); }
.dlg-body { padding: var(--s6); display: flex; flex-direction: column; gap: var(--s5); }
.dlg-head { display: flex; align-items: flex-start; gap: var(--s3); }
.dlg-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dlg-title { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
.dlg-meta { font-size: 13px; color: var(--text-subtle); }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.dlg-contacts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.dlg-section .sub-title { margin-top: 0; }
.dlg-section { display: flex; flex-direction: column; gap: var(--s2); }
.remind-now { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.remind-now span { flex: 1; color: var(--text); }
.remind-now.late { background: var(--bad-soft); color: var(--bad); }
.remind-form { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: var(--s2); }
.dlg-desc { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-muted); white-space: pre-wrap; max-height: 168px; overflow: auto; overflow-wrap: anywhere; }
.dlg-hint { margin: 0; font-size: 13.5px; color: var(--text-subtle); }
.dlg-notes { display: flex; flex-direction: column; gap: var(--s2); }
.dlg-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); border-top: 1px solid var(--border); padding-top: var(--s4); }
.dlg-foot .btn.danger { margin-left: auto; }

/* Šta tražimo */
.filter-form { background: var(--tint); border-radius: var(--r-lg); padding: var(--s5); margin-bottom: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.filter-form .input { background: var(--input-bg); }
.filter-form .grid-form { align-items: end; }
.range { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); min-width: 0; }
.range legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 6px; }
.area-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.area-chips:empty { display: none; }
.area-chip { padding-right: 2px; }
.area-chip button { border: 0; background: none; color: inherit; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.area-chip button .i { margin: 0; }
/* Each saved filter is its own card: a tinted box with an accent edge while it is on. */
.filter-list { display: flex; flex-direction: column; gap: var(--s3); margin-top: var(--s2); }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); padding: var(--s4) var(--s5); background: var(--tint); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--r-lg); }
.filter-row .chip { background: var(--surface); }
.filter-row.off { background: transparent; border-style: dashed; border-left: 4px solid var(--border-strong); }
.filter-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.filter-name { font-weight: 600; font-size: 15px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-row.off .filter-name, .filter-row.off .chip { color: var(--text-subtle); }

/* List card: where it is on the board */
.stage-chip { height: 40px; padding: 0 var(--s3); border-radius: var(--r-md); font-size: 13px; }

/* Tim: Rad tima */
.stage-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--s4); }
.stage-sum-label { font-size: 13px; color: var(--text-subtle); margin-right: 2px; }
.team-table td.bad-num { color: var(--bad); font-weight: 650; }
#activity .panel-head .seg { margin-left: auto; }

@media (max-width: 640px) {
  /* Phone: pick one stage, see its leads full width. */
  .stage-pick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex-basis: 100%; margin: 0 calc(-1 * var(--s4)); padding: 2px var(--s4); }
  .stage-pick::-webkit-scrollbar { display: none; }
  .stage-pick button { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--s3); border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--text-muted); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
  .stage-pick button.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); font-weight: 650; }
  .stage-pick .count { height: 20px; min-width: 20px; font-size: 11.5px; }
  .board-bar .search-row { flex: 1 1 100%; margin-bottom: 0; }
  .bar-field { flex: 1; }
  .bar-field .input { flex: 1; min-width: 0; }
  .board { display: block; overflow: visible; }
  .board .col { display: none; background: none; padding: 0; }
  .board .col.picked { display: flex; }
  .board .col .col-head { display: none; }
  .board > .col, .board > .col.empty { max-width: none; min-height: 0; }
  .lead { cursor: default; }
  .lead-foot .lead-stage { max-width: 150px; }
  .lead-call span { display: inline; }
  .due { grid-template-columns: 56px minmax(0, 1fr); padding: var(--s3); }
  .due-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .due-actions .btn { flex: 1 1 auto; }
  .lead-dlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .dlg-body { padding: var(--s5) var(--s4); }
  .dlg-grid, .remind-form { grid-template-columns: 1fr; }
  .dlg-contacts .btn { flex: 1 1 auto; }
  .filter-form { padding: var(--s4); }
}

/* ---------- Obaveštenja (bell) ---------- */
.alerts-dlg { width: min(560px, calc(100vw - 32px)); }
.alerts-dlg .switch { white-space: normal; color: var(--text); }
.alerts-cities { display: flex; flex-wrap: wrap; gap: 0 var(--s4); }
.alerts-dlg .seg { align-self: flex-start; flex-wrap: wrap; }
@media (max-width: 640px) { .alerts-dlg { width: 100vw; } }
.grid-form .field-check { grid-column: 1 / -1; white-space: normal; }
