/* METROPARK cabinet — production look (loaded last, overrides earlier layers) */
:root {
  --core-bg: #f3f5f9;
  --core-text: #0f1b2d;
  --core-text-muted: #5d6b82;
  --core-border: #e4e8ef;
  --core-blue: #1f5eff;
  --core-blue-hover: #1748d0;
  --core-blue-soft: #edf2ff;
  --core-radius: 14px;
  --core-radius-sm: 10px;
  --core-shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 4px 16px rgba(15, 27, 45, .04);
  --core-sidebar: 240px;
  --core-topbar: 64px;
  --nav-bg: #0b1730;
  --nav-bg-2: #102142;
  --nav-text: #a9b6cc;
  --nav-text-strong: #ffffff;
  --nav-active: rgba(255, 255, 255, .09);
  --nav-line: rgba(255, 255, 255, .08);
  --accent-gradient: linear-gradient(135deg, #1f5eff 0%, #3b7bff 55%, #5b8fff 100%);
  --bg: var(--core-bg); --text: var(--core-text); --muted: var(--core-text-muted); --line: var(--core-border);
  --brand: var(--core-blue); --brand-2: var(--core-blue-hover); --brand-soft: var(--core-blue-soft);
  --radius: var(--core-radius); --radius-sm: var(--core-radius-sm);
  --shadow: var(--core-shadow); --shadow-sm: var(--core-shadow);
}
html[data-theme="dark"] {
  --core-bg: #0a1220;
  --core-surface: #111b2c;
  --core-surface-muted: #0e1726;
  --core-text: #eef3fb;
  --core-text-muted: #95a3b8;
  --core-border: #1f2c40;
  --core-blue: #6f9bff;
  --core-blue-hover: #94b4ff;
  --core-blue-soft: #17284a;
  --nav-bg: #070e1b;
  --nav-bg-2: #0b1527;
  --core-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --bg: var(--core-bg); --surface: var(--core-surface); --surface-2: var(--core-surface-muted); --text: var(--core-text);
  --muted: var(--core-text-muted); --line: var(--core-border); --brand: var(--core-blue); --brand-2: var(--core-blue-hover);
  --brand-soft: var(--core-blue-soft); --shadow: var(--core-shadow); --shadow-sm: var(--core-shadow);
}

body { font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1; }
body, button, input, select { font-size: 14px; }
.ui-icon { display: block; flex: 0 0 auto; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }

/* header */
.app-header { height: var(--core-topbar); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); }
.app-brand { gap: 11px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-gradient); color: #fff; box-shadow: 0 6px 16px rgba(31, 94, 255, .28); }
.app-brand strong { font-size: 15px; font-weight: 800; letter-spacing: .14em; }
.app-brand small { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: none; color: var(--muted); }
.org-switcher { border-left: 1px solid var(--line); }
.org-switcher .eyebrow { display: none; }
.org-switcher strong { font-size: 14px; font-weight: 700; }
.context-control, .preference-form select { height: 36px; border-radius: 9px; font-size: 12.5px; font-weight: 600; }
.shell-system-state { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.user-menu { gap: 10px; }
.avatar { width: 34px; height: 34px; background: var(--accent-gradient); color: #fff; font-weight: 700; }
.user-copy strong { font-size: 13px; font-weight: 700; }
.icon-button { border-radius: 9px; }

/* sidebar */
.app-sidebar { background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%); border-right: 0; padding: 18px 12px; color: var(--nav-text); }
.side-nav { gap: 2px; }
.nav-link { gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--nav-text); font-size: 13.5px; font-weight: 600; }
.nav-link .nav-icon { width: 20px; color: currentColor; opacity: .9; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: var(--nav-text-strong); }
.nav-link.active { background: var(--nav-active); color: var(--nav-text-strong); box-shadow: inset 3px 0 0 #5b8fff; }
.nav-link.active .nav-icon { color: #8fb0ff; }
.nav-link-admin { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--nav-line); border-radius: 0 0 10px 10px; }
.sidebar-status { border-top: 1px solid var(--nav-line); color: var(--nav-text); }
.sidebar-status .eyebrow { color: #7d8ba3; }
.sidebar-status .status-line strong { color: var(--nav-text-strong); font-weight: 600; font-size: 12.5px; }
.logout-button { width: 100%; justify-content: flex-start; gap: 10px; background: transparent; border: 1px solid var(--nav-line); color: var(--nav-text); font-weight: 600; }
.logout-button:hover { background: rgba(255, 255, 255, .06); color: #fff; transform: none; box-shadow: none; }
.sidebar-context { border-bottom-color: var(--nav-line); }
.sidebar-context label { color: #7d8ba3; }

/* page */
.app-main > .layout { max-width: none; }
.page-heading { margin-bottom: 22px; align-items: flex-end; }
.page-heading h1 { font-size: 28px; font-weight: 750; letter-spacing: -.025em; }
.page-subtitle { font-size: 14px; }
.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.heading-status { padding: 8px 13px; font-size: 12.5px; font-weight: 600; }
.surface-card, .kpi-card, .panel, .metric, .ops-panel, .ops-kpi { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.surface-card { padding: 22px 24px; }
.card-heading { margin-bottom: 16px; }
.card-heading h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.kpi-card strong { font-weight: 750; letter-spacing: -.02em; }
.btn { border-radius: 10px; font-weight: 650; padding: 10px 16px; }
.btn-primary { background: var(--brand); box-shadow: 0 6px 16px rgba(31, 94, 255, .22); }
.btn-primary:hover { background: var(--brand-2); }
.badge { font-weight: 650; font-size: 11.5px; }
th { font-size: 11px; font-weight: 650; letter-spacing: .04em; }
td { font-size: 13.5px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }

/* overview */
.home-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.home-kpi { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.home-kpi-top { display: flex; align-items: center; gap: 10px; }
.home-kpi-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.home-kpi-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.home-kpi strong { font-size: 32px; font-weight: 750; line-height: 1.05; letter-spacing: -.03em; }
.home-kpi strong small { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.home-kpi-foot { color: var(--muted); font-size: 12.5px; }
.home-kpi-accent { background: var(--accent-gradient); border-color: transparent; color: #fff; box-shadow: 0 12px 28px rgba(31, 94, 255, .25); }
.home-kpi-accent .home-kpi-icon { background: rgba(255, 255, 255, .18); color: #fff; }
.home-kpi-accent .home-kpi-label, .home-kpi-accent .home-kpi-foot, .home-kpi-accent strong small { color: rgba(255, 255, 255, .82); }
.home-warn { color: var(--warning); font-weight: 650; }
.home-meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.home-meter span { display: block; height: 100%; border-radius: inherit; background: var(--accent-gradient); }
.home-meter-sm { height: 5px; margin-top: 6px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.home-grid-bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.home-chart-total { text-align: right; }
.home-chart-total strong { display: block; font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.home-chart-total span { font-size: 12.5px; font-weight: 650; }
.home-delta-up { color: var(--success); }
.home-delta-down { color: var(--danger); }
.home-chart { min-height: 230px; }
.home-chart-skeleton { height: 220px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: home-shimmer 1.4s infinite; }
@keyframes home-shimmer { to { background-position: -200% 0; } }
.home-chart-empty { display: grid; place-items: center; height: 220px; margin: 0; color: var(--muted); }
.home-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 14px; height: 230px; align-items: end; }
.home-bar { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; }
.home-bar-value { font-size: 11.5px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.home-bar-track { position: relative; flex: 1; width: 100%; max-width: 54px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.home-bar-track span { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 10px; background: var(--accent-gradient); transition: height .5s ease; }
.home-bar:last-child .home-bar-track span { background: linear-gradient(135deg, #0f9f6e, #2fc48d); }
.home-bar:hover .home-bar-value { color: var(--text); }
.home-bar-label { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 11.5px; text-transform: capitalize; }
.home-bar-label b { color: var(--text); font-size: 13px; }

.home-facts { display: grid; margin: 0; }
.home-facts > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.home-facts > div:last-child { border-bottom: 0; }
.home-facts dt { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.home-facts dt .ui-icon { color: var(--brand); }
.home-facts dd { margin: 0; font-size: 16px; font-weight: 700; }
.home-more { margin-top: 10px; }

.home-parkings { margin-bottom: 16px; }
.home-parking-list { display: grid; }
.home-parking { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.home-parking-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.home-parking-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
.home-parking-name strong { display: block; font-size: 15px; font-weight: 700; }
.home-parking-name > div > span { display: flex; align-items: center; gap: 7px; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.home-parking-name .status-dot { width: 7px; height: 7px; flex-basis: 7px; box-shadow: none; }
.home-parking-cell span { display: block; color: var(--muted); font-size: 12px; }
.home-parking-cell b { display: block; margin-top: 2px; font-size: 15px; font-weight: 700; }
.home-parking-empty { grid-column: span 3; color: var(--muted); }

.home-alerts { display: grid; gap: 8px; }
.home-alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-size: 13px; font-weight: 600; }
.home-alert-ok { background: var(--success-soft); color: var(--success); }
.home-alert-offline, .home-alert-critical { background: var(--danger-soft); color: var(--danger); }
.home-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.home-shortcuts a { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; text-decoration: none; font-weight: 650; font-size: 13.5px; transition: border-color .15s, background .15s; }
.home-shortcuts a .ui-icon { color: var(--brand); }
.home-shortcuts a:hover { border-color: var(--brand); background: var(--brand-soft); }

/* login / register */
.public-story { background: radial-gradient(1200px 600px at -10% 110%, rgba(59, 123, 255, .35), transparent 60%), linear-gradient(160deg, #0b1730 0%, #102a5c 100%); }
.public-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.public-brand strong { display: block; font-size: 15px; letter-spacing: .14em; }
.public-brand small { display: block; color: rgba(255, 255, 255, .65); font-size: 11px; }
.public-points { display: grid; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.public-points li { position: relative; padding-left: 30px; color: rgba(255, 255, 255, .85); font-size: 14.5px; line-height: 1.45; }
.public-points li::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; background: rgba(91, 143, 255, .25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8c2ff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.public-trust { color: rgba(255, 255, 255, .5); letter-spacing: .08em; }

@media (max-width: 1180px) {
  .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid, .home-grid-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  .app-sidebar { background: var(--nav-bg); }
}
@media (max-width: 767px) {
  .home-kpis { gap: 10px; }
  .home-kpi { padding: 16px; }
  .home-kpi strong { font-size: 25px; }
  .home-parking { grid-template-columns: 1fr 1fr; }
  .home-parking-name { grid-column: 1 / -1; }
  .home-parking-empty { grid-column: 1 / -1; }
  .home-bars { gap: 6px; }
  .home-bar-value { font-size: 10px; }
  .home-shortcuts { grid-template-columns: 1fr; }
  .page-heading h1 { font-size: 24px; }
}
@media (max-width: 430px) {
  .home-kpis { grid-template-columns: 1fr; }
}

/* menu button only on narrow screens */
.icon-button.mobile-only { display: none; }
@media (max-width: 1023px) { .icon-button.mobile-only { display: inline-grid; } }

/* platform admin */
.topbar { min-height: 64px; padding: 10px 28px; background: linear-gradient(90deg, #0b1730, #102142); border-bottom: 0; color: #fff; }
.topbar .brand { margin: 0; }
.topbar .brand h2 { font-size: 14px; letter-spacing: .1em; color: #fff; }
.topbar .brand span { color: #a9b6cc; font-size: 12px; }
.topbar .nav a { color: #a9b6cc; font-weight: 600; font-size: 13px; }
.topbar .nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topbar .nav .btn { background: rgba(255, 255, 255, .1); color: #fff; }
.hero h1 { font-size: 28px; letter-spacing: -.02em; }
.metric strong { font-size: 26px; font-weight: 750; }
.panel h2 { font-size: 17px; }

/* Header shortcut to «Обновления» with the pending-updates counter. */
.header-actions .header-updates{position:relative;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border-radius:10px}
.header-actions .header-updates [data-uc-badge]{position:absolute;top:2px;right:2px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:var(--danger,#e5484d);color:#fff;font-size:10px;line-height:16px;text-align:center;font-weight:700}
