:root {
  color-scheme: dark;
  --bg: #090b10;
  --surface: #11151d;
  --surface-soft: #161b25;
  --surface-blue: #111c2c;
  --text: #f2f4f8;
  --muted: #9ba6ba;
  --border: #252c38;
  --border-strong: #353e4d;
  --accent: #ff2828;
  --accent-hover: #e92020;
  --success: #35e49a;
  --success-bg: #102d24;
  --warning: #ffb224;
  --warning-bg: #322712;
  --danger: #ff5158;
  --danger-bg: #35171b;
  --unknown: #a7b2c6;
  --unknown-bg: #252c38;
  --radius-sm: 6px;
  --radius: 10px;
  --shadow: 0 18px 50px rgb(0 0 0 / 35%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgb(255 40 40 / 25%); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-header { height: 64px; padding: 0 28px; display: grid; grid-template-columns: minmax(330px, 1fr) auto minmax(340px, 1fr); align-items: stretch; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; background: rgb(9 11 16 / 96%); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.brand-logo { display: block; width: 43px; height: 30px; object-fit: contain; }
.brand b { color: var(--muted); font-weight: 500; }
.main-nav { display: flex; gap: 10px; height: 100%; }
.nav-item { position: relative; border: 0; background: transparent; padding: 0 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.nav-item::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: transparent; }
.nav-item:hover { color: var(--text); }.nav-item.is-active { color: var(--accent); }.nav-item.is-active::after { background: var(--accent); }
.nav-count { margin-left: 4px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 9px; color: var(--danger); background: var(--danger-bg); font-size: 11px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.sync-state { color: var(--muted); font-size: 12px; margin-right: 4px; }
.button { min-height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650; cursor: pointer; background: var(--surface); transition: border-color .15s ease, background .15s ease, color .15s ease; }
.button:disabled { opacity: .55; cursor: wait; }.button-secondary:hover { border-color: #596577; background: var(--surface-soft); }
.button-primary { color: #fff; background: var(--accent); border-color: var(--accent); }.button-primary:hover { background: var(--accent-hover); }

.app-main { width: min(1540px, 100%); margin: 0 auto; padding: 24px 28px 40px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
h1, h2, p { margin-top: 0; } h1 { margin-bottom: 4px; font-size: clamp(25px, 2.4vw, 34px); line-height: 1.15; letter-spacing: -.035em; } h2 { margin-bottom: 0; font-size: 16px; letter-spacing: -.01em; }
.summary-line { margin-bottom: 0; color: var(--muted); font-size: 15px; }.summary-line strong { color: var(--danger); font-weight: 650; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.search-field { min-width: 290px; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); background: var(--surface); }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(255 40 40 / 12%); }.search-field input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; }
.filters { display: flex; gap: 8px; }.filter-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 650; cursor: pointer; }.filter-button:hover { background: var(--surface-soft); }.filter-button.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }

.table-shell { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / 22%); background: var(--surface); }
.table-scroll { overflow-x: auto; } table { width: 100%; border-collapse: collapse; min-width: 1100px; } th { height: 48px; padding: 0 16px; text-align: left; color: #c3cada; background: var(--surface-soft); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .025em; } td { min-height: 64px; padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; } tbody tr:last-child td { border-bottom: 0; } tbody tr { transition: background .12s ease; } tbody tr:hover { background: #151a23; } tbody tr.has-customer { background: var(--surface-blue); }
th:first-child, td:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface); }
th:first-child { z-index: 3; background: var(--surface-soft); }
tbody tr:hover td:first-child { background: #151a23; }
tbody tr.has-customer td:first-child { background: var(--surface-blue); }
.pc-name { font-weight: 750; white-space: nowrap; }.pc-meta { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.connection { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 600; }.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }.connection.attention { color: var(--danger); }.connection.attention .connection-dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }.connection.offline { color: var(--muted); }.connection.offline .connection-dot { background: #8993a6; box-shadow: 0 0 0 3px var(--unknown-bg); }
.device-cell { min-width: 170px; }.device-main { display: flex; align-items: center; gap: 8px; min-width: 0; }.device-icon { width: 22px; color: #d1d6e1; flex: 0 0 auto; text-align: center; font-size: 17px; }.device-copy { min-width: 0; }.device-model { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }.device-label { color: var(--muted); font-size: 11px; margin-left: 4px; }
.placement { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--unknown); font-size: 12px; white-space: nowrap; }.placement-mark { width: 15px; height: 15px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; background: var(--unknown); font-size: 10px; font-weight: 800; }.placement.assigned { color: var(--success); }.placement.assigned .placement-mark { background: var(--success); }.placement.foreign { color: var(--warning); }.placement.foreign .placement-mark { background: var(--warning); }.placement.customer { color: var(--accent); }.placement.customer .placement-mark { background: var(--accent); }.placement.missing { color: var(--danger); }.placement.missing .placement-mark { background: var(--danger); }
.time-cell { color: #c8cfdd; white-space: nowrap; }.time-cell small { display: block; color: var(--muted); }.row-action { white-space: nowrap; text-align: right; }.edit-button { min-height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); padding: 0 10px; cursor: pointer; font-weight: 650; }.edit-button:hover { border-color: var(--accent); color: var(--accent); }
.empty-state { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }.empty-state strong { color: var(--text); }.empty-icon { font-size: 26px; }

.secondary-grid { display: grid; grid-template-columns: 1.35fr .8fr .95fr; gap: 16px; margin-top: 16px; }.support-panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px 14px; background: var(--surface); }.panel-heading { min-height: 49px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }.text-button { border: 0; background: none; color: var(--accent); cursor: pointer; font-weight: 650; padding: 6px 0; }
.incident-item { min-height: 57px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); }.incident-item:last-child { border-bottom: 0; }.incident-symbol { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }.incident-symbol.warning { background: #d58a00; }.incident-copy { min-width: 0; }.incident-copy strong, .incident-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.incident-copy span, .incident-time { color: var(--muted); font-size: 12px; }
.detail-list { margin: 0; }.detail-row { min-height: 43px; display: flex; justify-content: space-between; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); }.detail-row:last-child { border: 0; }.detail-row dt { color: var(--muted); }.detail-row dd { margin: 0; text-align: right; font-weight: 600; }.detail-row small { display: block; color: var(--muted); font-weight: 400; }
.report-empty { padding: 18px 0 4px; color: var(--muted); }.report-link { margin-top: 10px; }

.subpage-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }.subpage-heading p { margin: 6px 0 0; color: var(--muted); }.page-list, .report-page { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }.page-incident { display: grid; grid-template-columns: 10px minmax(180px, .8fr) 1.6fr auto; gap: 16px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }.page-incident:last-child { border: 0; }.page-incident p { margin: 2px 0 0; color: var(--muted); }.page-incident time { color: var(--muted); white-space: nowrap; }.page-empty { padding: 56px 24px; color: var(--muted); text-align: center; }
.report-sheet { padding: 22px; }.report-sheet-header { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }.report-sheet-header p { color: var(--muted); margin: 5px 0 0; }.report-summary { font-weight: 650; color: var(--accent); }.report-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; border: 1px solid var(--border); }.report-stat { padding: 18px; border-right: 1px solid var(--border); }.report-stat:last-child { border: 0; }.report-stat strong { display: block; font-size: 25px; letter-spacing: -.03em; }.report-stat span { color: var(--muted); font-size: 12px; }

.dialog { width: min(500px, calc(100% - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 20px 70px rgb(0 0 0 / 55%); }.dialog::backdrop { background: rgb(0 0 0 / 68%); backdrop-filter: blur(2px); }.dialog form { padding: 22px; }.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }.dialog-heading h2 { font-size: 20px; }.dialog-heading p { margin: 5px 0 20px; color: var(--muted); }.icon-button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--surface-soft); color: var(--text); font-size: 22px; cursor: pointer; }.field-label { display: block; margin-bottom: 7px; font-weight: 650; }.field-label span { color: var(--muted); font-weight: 400; }.text-input { width: 100%; height: 42px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 11px; color: var(--text); background: var(--surface-soft); }.text-input:focus { border-color: var(--accent); outline: 3px solid rgb(255 40 40 / 12%); }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }.form-error { color: var(--danger); margin: 8px 0 0; }.device-options { border: 0; padding: 0; margin: 0 0 18px; }.device-option { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--border); cursor: pointer; }.device-option input { width: 18px; height: 18px; accent-color: var(--accent); }.device-option-copy strong, .device-option-copy span { display: block; }.device-option-copy span { color: var(--muted); font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; padding: 12px 15px; border-radius: var(--radius-sm); color: #fff; background: #1c2942; box-shadow: var(--shadow); }

@media (max-width: 1120px) {
  .app-header { grid-template-columns: auto 1fr auto; }.sync-state { display: none; }.page-heading { align-items: start; flex-direction: column; }.toolbar { width: 100%; justify-content: flex-start; }.search-field { flex: 1; }.secondary-grid { grid-template-columns: 1.2fr 1fr; }.secondary-grid > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-header { height: auto; min-height: 60px; padding: 0 16px; grid-template-columns: 1fr auto; }.brand { min-height: 60px; }.brand span:last-child { font-size: 15px; }.header-actions .button { width: 38px; padding: 0; font-size: 0; }.header-actions .button span { font-size: 17px; }.main-nav { grid-column: 1 / -1; order: 3; height: 42px; justify-content: space-around; border-top: 1px solid var(--border); }.nav-item { flex: 1; }.app-main { padding: 20px 16px 32px; }.toolbar { display: grid; }.search-field { min-width: 0; width: 100%; }.filters { overflow-x: auto; padding-bottom: 2px; }.filter-button { flex: 0 0 auto; }.table-shell { border: 0; overflow: visible; box-shadow: none; }.table-scroll { overflow: visible; } table, tbody { min-width: 0; display: block; } thead { display: none; } tbody { display: grid; gap: 12px; } tbody tr { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; } tbody tr:hover { background: var(--surface); } tbody tr.has-customer { background: var(--surface-blue); } td { min-height: auto; padding: 11px 12px; border-bottom: 1px solid var(--border); } td:first-child { position: static; background: transparent; } td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 5px; } td:first-child, td:nth-child(2), td:last-child { grid-column: auto; } td:nth-child(3), td:nth-child(4), td:nth-child(5) { grid-column: 1 / -1; } td:last-child { display: flex; align-items: end; justify-content: flex-end; }.device-model { max-width: 240px; }.secondary-grid { grid-template-columns: 1fr; }.secondary-grid > :last-child { grid-column: auto; }.page-incident { grid-template-columns: 10px 1fr; }.page-incident > :last-child { grid-column: 2; }.report-stats { grid-template-columns: 1fr 1fr; }.report-stat:nth-child(2) { border-right: 0; }.report-stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 390px) { .brand-logo { width: 34px; }.filters { margin-right: -16px; }.device-model { max-width: 210px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

.app-header { grid-template-columns: minmax(330px, 1fr) auto minmax(520px, 1fr); }
.club-switcher { min-width: 178px; display: grid; gap: 1px; color: var(--muted); font-size: 11px; font-weight: 650; }
.club-switcher select { width: 100%; height: 35px; padding: 0 30px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); font-size: 13px; font-weight: 650; cursor: pointer; }
.club-switcher select:focus-visible { outline: 3px solid rgb(255 40 40 / 25%); outline-offset: 2px; }
.club-context { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }

@media (max-width: 1250px) {
  .app-header { height: auto; grid-template-columns: 1fr auto; }
  .brand { min-height: 64px; }
  .header-actions { grid-column: 2; order: 2; }
  .main-nav { grid-column: 1 / -1; order: 3; height: 42px; justify-content: center; border-top: 1px solid var(--border); }
}
@media (max-width: 760px) {
  .brand { grid-column: 1 / -1; order: 1; min-height: 58px; }
  .header-actions { grid-column: 1 / -1; order: 2; width: 100%; justify-content: space-between; padding-bottom: 10px; }
  .club-switcher { min-width: 0; width: min(210px, calc(100vw - 132px)); }
  .main-nav { order: 3; }
}
