@import url("https://fonts.bunny.net/css?family=inter:400,500,600,700,800&display=swap");

:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --border: #e5e8f0;
  --border-strong: #d5dae6;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-50: #eef2ff;
  --gold: #f5a524;
  --blue: #3b82f6;  --blue-50: #eff6ff;
  --amber: #d97706; --amber-50: #fffbeb;
  --violet: #7c3aed; --violet-50: #f5f3ff;
  --cyan: #0891b2;  --cyan-50: #ecfeff;
  --green: #059669; --green-50: #ecfdf5;
  --red: #dc2626;   --red-50: #fef2f2;
  --gray: #64748b;  --gray-50: #f1f5f9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 22px; height: 22px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 22px 14px;
  background: radial-gradient(120% 60% at 0% 0%, #1e1b4b 0%, #0b1020 55%) , #0b1020;
  color: #cbd5e1;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; color: #fff; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #fbbf24, #f59e0b 55%, #d97706);
  color: #1e1b4b; box-shadow: 0 6px 20px rgba(245, 165, 36, .35);
}
.brand-logo .icon { stroke-width: 2.2; }
.brand b { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.brand span { display: block; font-size: 11.5px; color: #94a3b8; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: #cbd5e1; font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav .count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; text-align: center;
  font-size: 11.5px; font-weight: 700; background: var(--gold); color: #1e1b4b;
}
.nav .count.red { background: #ef4444; color: #fff; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 6px; }
.worker {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .05); font-size: 12.5px;
}
.worker b { color: #fff; font-weight: 600; display: block; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); animation: pulse 2s infinite; }
.dot.off { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .18); }
.dot.busy { background: var(--gold); box-shadow: 0 0 0 4px rgba(245, 165, 36, .2); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
.logout { display: flex; align-items: center; gap: 10px; color: #94a3b8; padding: 8px 6px; font-size: 13px; background: none; border: 0; cursor: pointer; font: inherit; }
.logout:hover { color: #fff; }

.main { min-width: 0; padding: 28px 32px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.container { max-width: 1440px; margin: 0 auto; }

/* ---------- elements ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head a { font-size: 13px; font-weight: 500; }
.card-body { padding: 16px 20px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); align-items: start; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-2); font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; transition: all .15s;
}
.btn:hover { border-color: var(--faint); color: var(--text); background: #fafbff; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .25); }
.btn.primary:hover { background: var(--primary-600); }
.btn.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); border-color: #f59e0b; color: #1e1b4b; }
.btn.danger { color: var(--red); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-50); color: var(--gray);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.blue { background: var(--blue-50); color: var(--blue); }
.pill.amber { background: var(--amber-50); color: var(--amber); }
.pill.violet { background: var(--violet-50); color: var(--violet); }
.pill.cyan { background: var(--cyan-50); color: var(--cyan); }
.pill.green { background: var(--green-50); color: var(--green); }
.pill.red { background: var(--red-50); color: var(--red); }
.pill.gray { background: var(--gray-50); color: var(--gray); }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--gray-50); color: var(--text-2); }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--border-strong); border-radius: 10px;
  height: 38px; padding: 0 12px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 13.5px; color: var(--text); margin: 0; cursor: pointer; }
.check input { margin-top: 1px; }
.check small { display: block; color: var(--muted); font-weight: 400; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); background: #fafbfd; }
td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--faint); }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 280px; max-width: 420px;
  padding: 13px 16px; border-radius: 12px; background: #0f172a; color: #fff; box-shadow: var(--shadow-lg);
  font-weight: 500; animation: slidein .25s ease-out; transition: opacity .3s, transform .3s;
}
.toast.success .icon { color: #4ade80; }
.toast.error .icon, .toast.warning .icon { color: #fbbf24; }
.toast.hide { opacity: 0; transform: translateY(-8px); }
@keyframes slidein { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.stat .chip { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.stat .value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.chip.blue { background: var(--blue-50); color: var(--blue); }
.chip.gold { background: #fff7e6; color: #d97706; }
.chip.violet { background: var(--violet-50); color: var(--violet); }
.chip.green { background: var(--green-50); color: var(--green); }
.chip.cyan { background: var(--cyan-50); color: var(--cyan); }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding: 8px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, #818cf8, #4f46e5); min-height: 4px; position: relative; transition: filter .15s; }
.bar.zero { background: var(--gray-50); }
.bar:hover { filter: brightness(1.1); }
.bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.bar-col small { font-size: 11px; color: var(--faint); }

.source { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: #fcfcfe; }
.source-top { display: flex; align-items: center; gap: 10px; }
.source-top b { font-weight: 650; }
.source-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.source-meta div { font-size: 12px; color: var(--muted); }
.source-meta strong { display: block; font-size: 15px; color: var(--text); font-weight: 700; }
.progress { height: 8px; border-radius: 99px; background: var(--gray-50); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #818cf8, #4f46e5); transition: width .5s; }
.progress.indeterminate > i { width: 35% !important; animation: indet 1.3s infinite ease-in-out; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); color: inherit; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: #fafbff; color: inherit; }
.list-row img, .list-row .ph { width: 64px; height: 48px; border-radius: 9px; object-fit: cover; flex: none; background: var(--gray-50); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .price { font-weight: 700; white-space: nowrap; }

/* ---------- filters ---------- */
.filters { padding: 14px; margin-bottom: 18px; }
.filters-row { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(4, minmax(130px, 1fr)) auto; gap: 10px; }
.filters-more { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--border); }
.filters-more[hidden] { display: none; }
.filters-checks { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; padding-top: 4px; }
.search { position: relative; }
.search .icon { position: absolute; left: 12px; top: 10px; color: var(--faint); }
.search input { padding-left: 38px; }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 14px; flex-wrap: wrap; }
.result-bar select { width: auto; height: 34px; }

/* ---------- offer cards ---------- */
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.offer { display: flex; flex-direction: column; overflow: hidden; color: inherit; transition: transform .18s, box-shadow .18s, border-color .18s; }
.offer:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); color: inherit; }
.offer-img { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #e0e7ff, #f1f5f9); overflow: hidden; }
.offer-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.offer:hover .offer-img img { transform: scale(1.04); }
.offer-img .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #a5b4fc; }
.overlay { position: absolute; display: flex; gap: 6px; }
.overlay.tl { top: 10px; left: 10px; }
.overlay.tr { top: 10px; right: 10px; }
.overlay.br { bottom: 10px; right: 10px; }
.glass { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 650; color: #fff; background: rgba(15, 23, 42, .62); backdrop-filter: blur(6px); }
.badge-new { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #1e1b4b; background: linear-gradient(135deg, #fde047, #f59e0b); box-shadow: 0 4px 12px rgba(245, 158, 11, .4); }
.badge-warn { background: rgba(220, 38, 38, .85); }
.offer-body { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.offer-price { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.offer-price b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.offer-price span { font-size: 12px; color: var(--muted); font-weight: 500; }
.offer-title { font-weight: 600; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.facts { display: flex; gap: 6px; flex-wrap: wrap; }
.place { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 26px; }
.pagination a, .pagination span { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text-2); font-weight: 600; }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- detail ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.gallery { overflow: hidden; }
.gallery-main { position: relative; aspect-ratio: 16 / 10; background: #0f172a; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); color: var(--text); }
.gallery-nav.prev { left: 14px; } .gallery-nav.next { right: 14px; }
.gallery-count { position: absolute; bottom: 14px; right: 14px; }
.thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; scrollbar-width: thin; }
.thumbs img { width: 92px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .55; flex: none; border: 2px solid transparent; transition: opacity .15s; }
.thumbs img:hover { opacity: .85; }
.thumbs img.on { opacity: 1; border-color: var(--primary); }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(2, 6, 23, .94); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lightbox .gallery-nav { background: rgba(255, 255, 255, .15); color: #fff; }
.lightbox .close { position: absolute; top: 18px; right: 18px; }
.lightbox .counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #cbd5e1; font-weight: 600; }

.hero { padding: 22px 24px; }
.hero-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.hero h1 { font-size: 22px; margin: 8px 0 6px; }
.hero .big-price { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; }
.keyfact { padding: 12px 14px; border-radius: 12px; background: #f8f9fc; border: 1px solid var(--border); }
.keyfact small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.keyfact b { font-size: 16px; font-weight: 700; }
.params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.param-group { margin-bottom: 18px; break-inside: avoid; }
.param-group h3 { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.param { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.param span { color: var(--muted); }
.param b { font-weight: 600; text-align: right; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.feature { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: #f8f9fc; }
.feature .icon { color: var(--primary); margin-top: 2px; }
.feature b { display: block; font-weight: 600; }
.feature span { color: var(--muted); font-size: 13px; }
.description { white-space: pre-line; color: var(--text-2); line-height: 1.7; font-size: 14.5px; }
.description.clamp { max-height: 320px; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.map { width: 100%; height: 300px; border: 0; display: block; border-radius: 0 0 var(--radius) var(--radius); }
.crm { position: sticky; top: 20px; }
.crm .card-body > * + * { margin-top: 0; }
.status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 16px; }
.status-opt input { display: none; }
.status-opt span { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); font-weight: 600; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.status-opt span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-opt input:checked + span { border-color: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 15%, transparent); background: color-mix(in srgb, currentColor 7%, #fff); }
.st-blue { color: var(--blue); } .st-amber { color: var(--amber); } .st-violet { color: var(--violet); }
.st-cyan { color: var(--cyan); } .st-green { color: var(--green); } .st-gray { color: var(--gray); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary-50); color: var(--primary); }
.tl-item.system .tl-dot { background: var(--gray-50); color: var(--muted); }
.tl-text { white-space: pre-line; }
.tl-item.system .tl-text { color: var(--muted); font-size: 13px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; }
.alert.warn { background: var(--amber-50); color: #92400e; border: 1px solid #fde68a; }
.alert.err { background: var(--red-50); color: #991b1b; border: 1px solid #fecaca; }
.alert.info { background: var(--primary-50); color: #3730a3; border: 1px solid #c7d2fe; }
.link-out { display: flex; align-items: center; gap: 8px; }

/* ---------- logs ---------- */
.lvl { display: inline-block; min-width: 64px; text-align: center; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.lvl.INFO { background: var(--blue-50); color: var(--blue); }
.lvl.WARNING { background: var(--amber-50); color: var(--amber); }
.lvl.ERROR { background: var(--red-50); color: var(--red); }
details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
details pre { margin: 8px 0 0; padding: 12px; border-radius: 10px; background: #0f172a; color: #e2e8f0; overflow-x: auto; font-size: 12px; max-height: 360px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #e9ecf4; }
.tabs a { padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs a.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(80% 60% at 20% 10%, #312e81 0%, transparent 60%), radial-gradient(60% 50% at 90% 90%, #78350f 0%, transparent 60%), #0b1020; }
.login-card { width: 100%; max-width: 400px; padding: 34px; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.login-card .brand { color: var(--text); padding: 0 0 26px; }
.login-card .brand span { color: var(--muted); }
.errorlist { list-style: none; padding: 0; margin: 0 0 12px; color: var(--red); font-size: 13px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-row { grid-template-columns: 1fr 1fr 1fr; }
  .filters-more { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .g-main, .g-2, .g-3 { grid-template-columns: 1fr; }
  .crm { position: static; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 50; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 8px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .brand div { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 8px 10px; }
  .nav a span.label, .logout .label { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; padding: 0; }
  .worker { padding: 8px; }
  .worker div { display: none; }
  .main { padding: 18px 14px 50px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .params, .features { grid-template-columns: 1fr; }
  .filters-row, .filters-more { grid-template-columns: 1fr 1fr; }
  .filters-row .search { grid-column: 1 / -1; }
  h1 { font-size: 20px; }
}
