[hidden] { display: none !important; }
:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --ink: #1c1f1e;
  --muted: #6c716e;
  --faint: #9a9f9c;
  --line: #e6e5e0;
  --hover: #f4f6f4;
  --accent: #1f6f5c;
  --accent-soft: #e5f1ed;
  --ok: #2f7d4a;   --ok-soft: #e6f3ea;
  --warn: #b7791f; --warn-soft: #fbf1df;
  --bad: #c0392b;  --bad-soft: #fbe9e6;
  --her: #7a4bc2;  --her-soft: #f1ebfa;
  --radius: 12px;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2 { letter-spacing: -.01em; }
.muted { color: var(--muted); }
button { font: inherit; }

.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s; }
.btn:hover { border-color: #cfcfc9; background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #195c4c; }
.btn.icon { padding: 9px 12px; font-size: 18px; line-height: 1; }

/* ------------------------------------------------ login */
body.login {
  display: grid; place-items: center; min-height: 100vh; padding: 20px;
  background:
    radial-gradient(1200px 600px at 10% -10%, #d9ecf5 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 110%, #f8e6d2 0%, transparent 60%),
    #fbfaf7;
}
.login-box { background: rgba(255,255,255,.88); backdrop-filter: blur(8px); border: 1px solid #efe9df; border-radius: 26px; padding: 40px 34px 34px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 24px 60px rgba(120, 90, 40, .12); }
.login-box .photo { width: 140px; height: 140px; margin: 0 auto 20px; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 200deg, #e9c46a, #f4a6a0, #8fc9e6, #e9c46a); box-shadow: 0 10px 30px rgba(233, 196, 106, .35); }
.login-box .photo img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid #fff; }
.login-box h1.fancy { font-family: "Playfair Display", Georgia, "Times New Roman", serif; font-style: italic; font-weight: 800; font-size: 34px; line-height: 1.05; margin: 0 0 12px; letter-spacing: -.01em;
  background: linear-gradient(100deg, #b8860b 0%, #d4a437 35%, #e58f8a 70%, #c06c84 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-box h1.fancy span { display: block; font-weight: 600; font-size: 25px; margin-top: 4px; }
.login-box p { color: var(--muted); margin: 0 0 20px; }
.login-box input { width: 100%; padding: 12px 14px; border: 1px solid #e8e2d8; border-radius: 12px; font: inherit; margin-bottom: 12px; background: #fff; text-align: center; }
.login-box input:focus { outline: 3px solid #f6e7c4; border-color: #d4a437; }
.login-box .btn { width: 100%; padding: 12px; border-radius: 12px; background: linear-gradient(100deg, #c9962a, #e0897f); border: 0; }
.login-box .btn:hover { filter: brightness(1.05); background: linear-gradient(100deg, #c9962a, #e0897f); }
.err { color: var(--bad); margin: 12px 0 0 !important; }

/* ------------------------------------------------ app layout */
body.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 24px 10px; background: var(--surface); }
.top h1 { margin: 0; font-size: 20px; }
.top p { margin: 1px 0 0; font-size: 13px; }
.top-actions { display: flex; gap: 8px; position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.1); padding: 8px; min-width: 280px; z-index: 20; }
.menu .check { display: flex; gap: 10px; align-items: center; padding: 8px; cursor: pointer; font-size: 14px; border-radius: 8px; }
.menu .check:hover, .menu-item:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--bad); }

.tabs { display: flex; gap: 4px; padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px 11px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab .n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px; background: var(--bg); color: var(--muted); font-size: 12px; text-align: center; }
.tab.on .n { background: var(--accent-soft); color: var(--accent); }

.split { flex: 1; display: grid; grid-template-columns: minmax(320px, 420px) 1fr; min-height: 0; }
.listpane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.toolbar { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.toolbar input, .toolbar select { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 8px 10px; color: var(--ink); }
.toolbar input { flex: 1; min-width: 0; }

.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.item { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 13px 16px 13px 26px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:hover { background: var(--hover); }
.item.sel { background: var(--accent-soft); }
.item.sel::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.item .dot { position: absolute; left: 11px; top: 20px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.item .t { font-weight: 650; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item.seen .t { font-weight: 550; color: #3c403e; }
.item .m { grid-column: 1; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .r { grid-row: 1 / span 2; grid-column: 2; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.item .chips { grid-column: 1; display: flex; gap: 5px; flex-wrap: wrap; }
.item.dim { opacity: .55; }

.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.soon { background: var(--bad-soft); color: var(--bad); }
.pill.week { background: var(--warn-soft); color: var(--warn); }
.pill.gone { text-decoration: line-through; }
.chip { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.chip.her { background: var(--her-soft); color: var(--her); }
.chip.st-zanima { background: var(--accent-soft); color: var(--accent); }
.chip.st-prijava_poslana, .chip.st-razgovor, .chip.st-ponuda { background: var(--ok-soft); color: var(--ok); }
.chip.st-ne_odgovara, .chip.st-odbijeno { background: var(--bg); color: var(--faint); }
.chip.maybe { background: var(--warn-soft); color: var(--warn); }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ------------------------------------------------ detail */
.detailpane { overflow-y: auto; min-height: 0; padding: 28px 36px 60px; }
.placeholder { height: 100%; display: grid; place-items: center; color: var(--faint); }
.d-wrap { max-width: 760px; }
.d-back { display: none; }
.d-meta { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.d-title { font-size: 24px; line-height: 1.25; margin: 0 0 10px; }
.d-sub { display: flex; flex-wrap: wrap; gap: 6px 18px; color: #3c403e; margin-bottom: 18px; }
.d-sub span::before { margin-right: 6px; opacity: .6; }
.d-sub .emp::before { content: "🏢"; }
.d-sub .loc::before { content: "📍"; }
.d-dead { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.d-dead .big { font-size: 18px; font-weight: 700; }
.d-dead.soon { border-color: #efc5bf; background: var(--bad-soft); }
.d-dead.soon .big { color: var(--bad); }
.d-dead.week .big { color: var(--warn); }
.d-dead small { color: var(--muted); display: block; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 650; color: var(--ink); transition: all .15s; }
.act .i { font-size: 18px; line-height: 1; }
.act:hover { border-color: #c9cbc6; }
.act.on.k-zanima { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.act.on.k-prijava_poslana { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.act.on.k-ne_odgovara { background: #f0f0ee; border-color: #b9bbb7; color: #555; }
.more { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.more button { background: none; border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; cursor: pointer; color: var(--ink); font-size: 13px; }
.more button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.more input[type=date] { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; }
.open { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; text-decoration: none; padding: 13px; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 650; margin-bottom: 22px; }
.open:hover { background: #195c4c; }
.d-sec { margin-bottom: 20px; }
.d-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.d-sec p { margin: 0; }
.d-sec a { color: var(--accent); }
.d-note { width: 100%; min-height: 90px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; resize: vertical; background: var(--surface); }
.d-note:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.saved { font-size: 12px; color: var(--ok); margin-left: 6px; }
.banner-her { background: var(--her-soft); color: var(--her); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* ------------------------------------------------ link dialog */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(20, 22, 21, .35); }
.dlg { padding: 22px; }
.dlg h2 { margin: 0 0 4px; font-size: 19px; }
.dlg p { margin: 0 0 12px; font-size: 14px; }
.dlg textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 10px; resize: vertical; background: var(--bg); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 12px 0 4px; }
.mylinks { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); max-height: 220px; overflow-y: auto; font-size: 13px; }
.mylinks li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; }
.mylinks .u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mylinks .s { flex: none; font-weight: 600; }
.s.pending { color: var(--warn); } .s.done { color: var(--ok); } .s.error { color: var(--bad); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 14px 10px 16px; border-radius: 12px; font-size: 14px; z-index: 50; display: flex; gap: 14px; align-items: center; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.toast button { background: none; border: 0; color: #8fe0c6; font-weight: 700; cursor: pointer; padding: 0; }

/* ------------------------------------------------ phone: list full screen, detail slides over */
@media (max-width: 820px) {
  .top { padding: 12px 14px 8px; }
  .top h1 { font-size: 18px; }
  .tabs { padding: 0 8px; }
  .split { grid-template-columns: 1fr; }
  .listpane { border-right: 0; }
  .detailpane { position: fixed; inset: 0; background: var(--bg); z-index: 30; padding: 14px 16px 40px; transform: translateX(100%); transition: transform .22s ease; }
  body.detail-open .detailpane { transform: none; }
  .d-back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--accent); font-weight: 650; padding: 6px 0 12px; cursor: pointer; font-size: 15px; }
  .d-title { font-size: 21px; }
  .placeholder { display: none; }
  .item { padding: 14px 14px 14px 26px; }
}

/* direct links to the original ad */
.item .r { flex-direction: row; align-items: center; gap: 8px; }
.go { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); color: var(--accent); text-decoration: none; font-weight: 700; font-size: 13px; background: var(--surface); }
.go:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.d-title a { color: inherit; text-decoration: none; }
.d-title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.d-title .ext { color: var(--accent); font-size: .7em; vertical-align: 2px; }
