@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/843e59e4.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: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/8f90dc37.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;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/843e59e4.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: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/8f90dc37.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;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/1969f6ff.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/e2661bcc.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;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/93cfae71.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/0bc96cd0.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;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/632855d1.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: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/868a235a.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;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/632855d1.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: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/868a235a.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;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/632855d1.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: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/868a235a.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;
}

/* ---------------------------------------------------------------------
   Tokens
   Grounded in the subject: this project scrapes Czech cadastral/listing
   data, so the palette leans cool-paper/ledger rather than warm-cream —
   deliberately not the cream+terracotta or near-black+neon-pop defaults.
   Sale and rent are recurring categories throughout the dashboard, so
   each gets its own hue (accent / --rent) distinct from the semantic
   run-status triad (--ok / --warn / --fail).
--------------------------------------------------------------------- */
:root {
  --bg: #F1F4F3;
  --surface: #FFFFFF;
  --surface-sunken: #E7ECEA;
  --border: #D3DCD9;
  --text: #16211F;
  --text-muted: #5B6B67;

  --accent: #2C6E68;
  --accent-soft: #DCEAE7;
  --rent: #B8791A;
  --rent-soft: #F3E6D1;

  --ok: #2E7D46;
  --ok-soft: #DFF0E4;
  --warn: #C08A2E;
  --warn-soft: #F5E9D4;
  --fail: #B3402E;
  --fail-soft: #F6DFDA;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(22, 33, 31, 0.06), 0 1px 8px rgba(22, 33, 31, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10201C;
    --surface: #16302A;
    --surface-sunken: #0D1917;
    --border: #294842;
    --text: #E7EEEC;
    --text-muted: #8FA39D;

    --accent: #5FA79F;
    --accent-soft: #1E3B37;
    --rent: #D6A75B;
    --rent-soft: #3A2E1A;

    --ok: #5FB57A;
    --ok-soft: #1B3324;
    --warn: #D6A75B;
    --warn-soft: #3A2E1A;
    --fail: #E08174;
    --fail-soft: #3B211D;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 8px rgba(0, 0, 0, 0.2);
  }
}

/* ---------------------------------------------------------------------
   Reset + base
--------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }

p { margin: 0; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

.mono, td.num, .stat-tile .value, .pill .count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Shell layout: slim sidebar + main content.
   Sidebar collapses to a horizontal scroll strip on phones — this is
   meant to be read on a phone browser first.
--------------------------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.sidebar .brand .sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar nav a {
  color: var(--text);
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.sidebar nav a:hover {
  background: var(--surface-sunken);
  text-decoration: none;
}

.sidebar nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar .built-at {
  margin-top: auto;
  font-size: 0.7rem;
  color: var(--text-muted);
}

main {
  padding: 1.75rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-width: 0;
}

main > header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

main > header p {
  color: var(--text-muted);
  max-width: 65ch;
}

/* ---------------------------------------------------------------------
   Stat tiles — the summary that comes before every page's detail
--------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-tile .value {
  font-size: 1.6rem;
  font-weight: 500;
}

.stat-tile .label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Cards + tables
--------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card > header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.card > header .hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  font-size: 0.88rem;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td.wrap {
  white-space: normal;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--surface-sunken);
}

.data-table td.num,
.data-table th.num {
  text-align: right;
}

/* ---------------------------------------------------------------------
   Charts — server-rendered inline SVG (webui/charts.py), no JS/library.
   Colors are passed in as var(--accent)/var(--rent) by the caller so a
   single chart works in both themes for free.
--------------------------------------------------------------------- */
.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card > .chart-row {
  padding: 1rem 1.1rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1.1rem 0.7rem;
}

.chart-card h3 {
  margin-bottom: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chart-card .empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  fill: var(--text-muted);
}

.chart-area {
  opacity: 0.16;
}

/* ---------------------------------------------------------------------
   Pills — status/category encoded as shape+color, not just text
--------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill--ok    { background: var(--ok-soft);   color: var(--ok); }
.pill--warn  { background: var(--warn-soft); color: var(--warn); }
.pill--fail  { background: var(--fail-soft); color: var(--fail); }
.pill--sale  { background: var(--accent-soft); color: var(--accent); }
.pill--rent  { background: var(--rent-soft);   color: var(--rent); }
.pill--muted { background: var(--surface-sunken); color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Shortlist page: filter controls + client-side filtered table
--------------------------------------------------------------------- */
.toolbar {
  display: flex;
  padding: 0.9rem 1.1rem 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.filter-bar input,
.filter-bar select {
  font: inherit;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
  min-width: 8rem;
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tabs button {
  font: inherit;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text-muted);
  border: none;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.tabs button + button { border-left: 1px solid var(--border); }
.tabs button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.match-count {
  padding: 0.6rem 1.1rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Responsive: phone-first. Sidebar becomes a horizontal nav strip.
--------------------------------------------------------------------- */
@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    overflow-x: auto;
  }

  .sidebar .brand { flex: none; white-space: nowrap; }
  .sidebar nav { flex-direction: row; }
  .sidebar nav a { white-space: nowrap; }
  .sidebar .built-at { display: none; }

  main {
    padding: 1.25rem 1rem 2.5rem;
  }

  .filter-bar input,
  .filter-bar select {
    min-width: 0;
    flex: 1 1 7rem;
  }
}

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