:root {
  --bg: #F8F6F1;
  --paper: #FFFFFF;
  --paper-alt: #F2EDE4;
  --ink: #1C1917;
  --ink-muted: #57534E;
  --ink-dim: #A8A29E;
  --rule: #E7E1D8;
  --sun: #D9A530;
  --sun-light: #F7EEDB;
  --sun-dark: #A67C1A;
  --alert: #C0392B;
  --alert-light: #FCEAE8;
  --ok: #27774A;
  --ok-light: #E6F4EC;
  --serif: 'Newsreader', 'Georgia', serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
.header { background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 14px 32px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-text { font-family: var(--serif); font-size: 20px; font-weight: 800; letter-spacing: -0.04em; }
.search-bar { flex: 1; max-width: 400px; position: relative; }
.search-bar input { width: 100%; padding: 8px 14px; border: 1.5px solid var(--rule); border-radius: 8px; font-family: var(--sans); font-size: 13px; background: var(--bg); outline: none; transition: border-color 0.2s; }
.search-bar input:focus { border-color: var(--sun); }
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; margin-top: 4px; display: none; box-shadow: 0 8px 24px rgba(0,0,0,0.08); max-height: 300px; overflow-y: auto; z-index: 200; }
.search-results.open { display: block; }
.search-result-item { padding: 10px 14px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--rule); transition: background 0.15s; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--sun-light); }
.search-result-item .brand { font-size: 11px; color: var(--ink-dim); }
.header-meta { font-size: 11px; color: var(--ink-dim); flex-shrink: 0; }
.main { max-width: 1100px; margin: 0 auto; padding: 24px 32px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--rule); border-radius: 12px; overflow: hidden; border: 1px solid var(--rule); margin-bottom: 24px; }
.stat-card { background: var(--paper); padding: 20px; text-align: center; }
.stat-value { font-family: var(--serif); font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.stat-value.stat-alert { color: var(--alert); }
.stat-label { font-size: 12px; font-weight: 500; color: var(--ink-muted); margin-top: 4px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card { background: var(--paper); border-radius: 12px; border: 1px solid var(--rule); overflow: hidden; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; }
.card-header h2 { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--ink-dim); }
.card-filters { display: flex; gap: 4px; }
.filter-btn { padding: 4px 10px; border: 1px solid var(--rule); border-radius: 6px; background: transparent; font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--ink-dim); cursor: pointer; transition: all 0.2s; }
.filter-btn:hover { border-color: var(--sun); color: var(--sun); }
.filter-btn.active { background: var(--sun-light); border-color: var(--sun); color: var(--sun-dark); }
.alerts-list { max-height: 500px; overflow-y: auto; }
.alert-item { padding: 14px 20px; border-bottom: 1px solid var(--rule); cursor: pointer; transition: background 0.15s; }
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--bg); }
.alert-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.alert-badges { display: flex; gap: 6px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.badge-high { background: var(--alert-light); color: var(--alert); }
.badge-medium { background: var(--sun-light); color: var(--sun-dark); }
.badge-low { background: var(--ok-light); color: var(--ok); }
.badge-critical { background: var(--alert); color: white; }
.badge-type { background: var(--paper-alt); color: var(--ink-dim); }
.alert-date { font-size: 11px; color: var(--ink-dim); }
.alert-title { font-family: var(--serif); font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.alert-desc { font-size: 12px; color: var(--ink-muted); line-height: 1.5; }
.increases-list { max-height: 500px; overflow-y: auto; }
.increase-item { padding: 12px 20px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; cursor: pointer; transition: background 0.15s; }
.increase-item:last-child { border-bottom: none; }
.increase-item:hover { background: var(--bg); }
.increase-left { display: flex; align-items: center; gap: 10px; }
.increase-rank { width: 24px; height: 24px; border-radius: 6px; background: var(--alert-light); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--alert); }
.increase-name { font-size: 13px; font-weight: 600; }
.increase-brand { font-size: 11px; color: var(--ink-dim); }
.increase-right { display: flex; align-items: center; gap: 12px; text-align: right; }
.increase-prices { font-size: 11px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.increase-pct { padding: 2px 8px; border-radius: 4px; background: var(--alert-light); color: var(--alert); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.loading { padding: 24px; text-align: center; font-size: 13px; color: var(--ink-dim); }
.empty-state { padding: 40px 24px; text-align: center; color: var(--ink-dim); }
.empty-state .emoji { font-size: 32px; margin-bottom: 8px; }
.empty-state p { font-size: 13px; line-height: 1.6; }
.footer { max-width: 1100px; margin: 0 auto; padding: 20px 32px; display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-dim); border-top: 1px solid var(--rule); margin-top: 40px; }
@media (max-width: 768px) {
  .header-inner { padding: 12px 16px; }
  .main { padding: 16px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2col { grid-template-columns: 1fr; }
  .card-filters { display: none; }
  .footer { flex-direction: column; gap: 4px; padding: 16px; }
}

.products-list { max-height: 600px; overflow-y: auto; }
.product-item { padding: 14px 20px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 14px; cursor: pointer; transition: background 0.15s; }
.product-item:last-child { border-bottom: none; }
.product-item:hover { background: var(--bg); }
.product-img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; border: 1px solid var(--rule); flex-shrink: 0; }
.product-img-placeholder { width: 48px; height: 48px; border-radius: 6px; background: var(--paper-alt); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.product-info { flex: 1; min-width: 0; }
.product-name { font-family: var(--serif); font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-brand { font-size: 11px; color: var(--ink-dim); }
.product-prices { display: flex; gap: 6px; flex-wrap: wrap; }
.price-tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-tag.cheapest { background: var(--ok-light); color: var(--ok); }
.price-tag.other { background: var(--paper-alt); color: var(--ink-muted); }
