:root {
  color-scheme: light;
  --ics-bg: #f4f6f8;
  --ics-surface: #ffffff;
  --ics-surface-soft: #f9fafb;
  --ics-sidebar: #1f252d;
  --ics-sidebar-dark: #151a20;
  --ics-sidebar-muted: #8a94a3;
  --ics-primary: #f2b705;
  --ics-primary-hover: #d99f00;
  --ics-primary-soft: #fff4c2;
  --ics-blue: #1f6feb;
  --ics-blue-soft: #e8f1ff;
  --ics-green: #23a55a;
  --ics-green-soft: #e7f7ee;
  --ics-red: #d92d20;
  --ics-red-soft: #fdeceb;
  --ics-orange: #f79009;
  --ics-orange-soft: #fff3e0;
  --ics-text: #1f2933;
  --ics-text-soft: #374151;
  --ics-muted: #6b7280;
  --ics-border: #d9dee7;
  --ics-radius-sm: 8px;
  --ics-radius-md: 12px;
  --ics-radius-lg: 18px;
  --ics-radius-xl: 24px;
  --ics-shadow-card: 0 12px 30px rgba(15, 23, 42, 0.08);
  --ics-shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);
  --ics-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: var(--ics-bg);
  --surface: var(--ics-surface);
  --surface-2: var(--ics-surface-soft);
  --surface-3: #eef3f8;
  --text: var(--ics-text);
  --text-strong: var(--ics-text);
  --muted: var(--ics-muted);
  --line: var(--ics-border);
  --accent: var(--ics-blue);
  --accent-2: var(--ics-blue);
  --accent-weak: var(--ics-blue-soft);
  --instec-graphite: var(--ics-sidebar);
  --instec-graphite-2: var(--ics-sidebar-dark);
  --instec-yellow: var(--ics-primary);
  --instec-yellow-2: var(--ics-primary-hover);
  --danger: #b42318;
  --danger-weak: #fff2f1;
  --ok: #087443;
  --ok-weak: #dcfae6;
  --warn: #a15c07;
  --warn-weak: #fef0c7;
  --info: #2458a7;
  --info-weak: #dbeafe;
  --radius-sm: 6px;
  --radius-md: var(--ics-radius-sm);
  --radius-lg: var(--ics-radius-md);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --shadow: var(--ics-shadow-card);
  --shadow-soft: var(--ics-shadow-soft);
  --focus-ring: 0 0 0 3px rgba(246, 195, 67, 0.32);
}

/* Dashboard workspace */
#dashboard-view { gap: 18px; }
#dashboard-view.active { display: grid; }
.dashboard-kpis { grid-template-columns: repeat(12,minmax(0,1fr)); gap: 12px; }
.dashboard-kpis > article { position: relative; grid-column: span 3; min-height: 142px; overflow: hidden; border-radius: 13px; padding: 17px; box-shadow: 0 2px 9px rgba(15,23,42,.04); }
.dashboard-kpis > article::after { position: absolute; right: -22px; bottom: -35px; width: 92px; height: 92px; border-radius: 50%; background: #f5f7f9; content: ""; }
.dashboard-kpis .metric-header { position: relative; z-index: 1; margin-bottom: 10px; }
.dashboard-kpis .metric-header > span:last-child { color: #6d7887; font-size: 11px; letter-spacing: .055em; }
.dashboard-kpis .metric-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 9px; background: #f2f4f7; color: #5f6b79; }
.dashboard-kpis > article > strong { position: relative; z-index: 1; justify-content: flex-start; padding-left: 43px; font-size: 31px; }
.dashboard-kpis > article > small { position: relative; z-index: 1; padding-left: 43px; font-size: 11px; }
.dashboard-kpis > article:nth-child(2) { border-color: #ccebdc; background: linear-gradient(145deg,#fff,#f6fcf9); }
.dashboard-kpis > article:nth-child(2) .metric-icon { background: #e5f7ed; color: #159258; }
.dashboard-kpis > article:nth-child(2) > strong { color: #15804f; }
.dashboard-kpis > article:nth-child(3) .metric-icon { background: #fff0e8; color: #d06d2f; }
.dashboard-kpis .metric-detail { grid-column: span 6; min-height: 128px; border: 0; color: #fff; }
.dashboard-kpis .metric-detail::after { right: -35px; bottom: -75px; width: 190px; height: 190px; background: rgba(255,255,255,.07); }
.dashboard-kpis .metric-accent { background: linear-gradient(135deg,#202b37,#2d3c49); }
.dashboard-kpis .metric-accent-alt { background: linear-gradient(135deg,#173f39,#24695e); }
.dashboard-kpis .metric-detail .metric-header > span:last-child,
.dashboard-kpis .metric-detail .metric-detail-line { color: #fff; }
.dashboard-kpis .metric-detail .metric-header > span:last-child { opacity: .68; }
.dashboard-kpis .metric-detail .metric-icon { background: rgba(255,255,255,.1); color: #f8c515; }
.dashboard-kpis .metric-detail-lines { position: relative; z-index: 1; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: center; justify-items: start; gap: 24px; padding-left: 43px; }
.dashboard-kpis .metric-detail-line { font-size: clamp(19px,1.45vw,25px); }
.dashboard-workspace { grid-template-columns: minmax(0,1fr) minmax(360px,.82fr); gap: 14px; }
.dashboard-workspace .panel { border-radius: 13px; box-shadow: 0 3px 12px rgba(15,23,42,.045); }
.dashboard-workspace .panel-header { min-height: 76px; padding: 16px 19px; }
.dashboard-workspace .panel-header h2 { font-size: 15px; }
.dashboard-workspace .panel-subtitle { margin-top: 5px; font-size: 11px; }
.dashboard-status-row { grid-template-columns: 9px minmax(0,1fr) auto; min-height: 70px; padding: 13px 18px; }
.dashboard-row-indicator { width: 8px; height: 8px; border-radius: 50%; background: #83a1c7; box-shadow: 0 0 0 4px #edf3fa; }
.dashboard-status-ok .dashboard-row-indicator { background: #23a666; box-shadow: 0 0 0 4px #e5f6ed; }
.dashboard-status-warn .dashboard-row-indicator { background: #eea62c; box-shadow: 0 0 0 4px #fff3da; }
.dashboard-status-danger .dashboard-row-indicator { background: #df6259; box-shadow: 0 0 0 4px #fdeceb; }
.dashboard-row-copy { min-width: 0; }
.dashboard-status-row strong { font-size: 13px; }
.dashboard-status-row .muted { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-object-distribution { display: grid; gap: 12px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg,#f8fbfa,#fff); padding: 17px 18px; }
.dashboard-distribution-copy { display: flex; align-items: baseline; gap: 7px; }
.dashboard-distribution-copy strong { color: #178552; font-size: 22px; }
.dashboard-distribution-copy span { color: #707b89; font-size: 11px; }
.dashboard-distribution-bar { display: flex; height: 7px; overflow: hidden; border-radius: 99px; background: #edf0f3; }
.dashboard-distribution-bar i { display: block; height: 100%; }
.dashboard-distribution-bar .online { background: #24aa68; }
.dashboard-distribution-bar .offline { background: #e6ad43; }
.dashboard-distribution-bar .disabled { background: #e3655d; }
.dashboard-event-row { position: relative; grid-template-columns: minmax(0,1fr) minmax(190px,auto); min-height: 72px; padding-left: 25px; }
.dashboard-event-row::before { position: absolute; top: 31px; left: 13px; width: 5px; height: 5px; border-radius: 50%; background: #f2b705; content: ""; }
.dashboard-event-row > div:first-child strong { font-size: 13px; }
.dashboard-event-row .muted { margin-top: 4px; font-size: 11px; }
.dashboard-event-row .activity-meta-inline { align-content: center; }
@media (max-width:1380px) { .dashboard-kpis > article { grid-column: span 3; } .dashboard-kpis .metric-detail { grid-column: span 6; } }
@media (max-width:1180px) { .dashboard-kpis > article { grid-column: span 6; } .dashboard-workspace { grid-template-columns: 1fr; } }
@media (max-width:620px) { .dashboard-kpis { grid-template-columns: 1fr; } .dashboard-kpis > article,.dashboard-kpis .metric-detail { grid-column: auto; } .dashboard-kpis .metric-detail-lines { grid-template-columns: 1fr; gap: 7px; } .dashboard-event-row { grid-template-columns: 1fr; } }

/* Organizations workspace */
#organizations-view { display: none; gap: 18px; }
#organizations-view.active { display: grid; }
.organizations-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.organizations-summary-card { display: flex; align-items: center; gap: 13px; min-height: 86px; border: 1px solid var(--ics-border); border-radius: 12px; background: #fff; padding: 15px 17px; box-shadow: 0 2px 8px rgba(15,23,42,.035); }
.organizations-summary-card div { display: grid; gap: 2px; }
.organizations-summary-card strong { color: #17202b; font-size: 24px; line-height: 1; }
.organizations-summary-card span:last-child { color: var(--ics-muted); font-size: 12px; }
.organizations-summary-primary { border-color: #efd676; background: linear-gradient(135deg,#fffdf5,#fff9dc); }
.organizations-summary-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 10px; background: var(--ics-primary); color: #222a32 !important; }
.organizations-summary-icon svg { width: 21px; height: 21px; }
.organizations-summary-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: #aab4c0; box-shadow: 0 0 0 6px #f0f2f5; }
.organizations-summary-dot.online { background: #19a15f; box-shadow: 0 0 0 6px #e5f6ed; }
.organizations-summary-dot.route { background: #3578d4; box-shadow: 0 0 0 6px #eaf1fb; }
.organizations-panel { border-radius: 12px; }
.organizations-panel-header { min-height: 76px; padding: 16px 20px; }
.organizations-panel-header h2 { font-size: 17px; }
.organizations-search { position: relative; display: block; width: min(280px,100%); }
.organizations-search svg { position: absolute; top: 50%; left: 12px; width: 17px; height: 17px; color: #8994a2; pointer-events: none; transform: translateY(-50%); }
.organizations-search > .material-symbols-rounded { position: absolute; top: 50%; left: 11px; color: #8994a2; font-size: 19px; pointer-events: none; transform: translateY(-50%); }
.organizations-search input { width: 100%; padding-left: 38px; background: #f8fafc; }
#organizations-view .relationship-grid { grid-template-columns: repeat(3,minmax(250px,1fr)); align-items: start; gap: 14px; padding: 18px; background: #f7f8fa; }
#organizations-view .relationship-card { gap: 17px; min-height: 0; border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(15,23,42,.04); transition: border-color .18s ease,box-shadow .18s ease,transform .18s ease; }
#organizations-view .relationship-card:hover { border-color: #c9d1dc; box-shadow: 0 10px 24px rgba(15,23,42,.075); transform: translateY(-2px); }
.organization-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.organization-identity > div { min-width: 0; }
.organization-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; background: #202a35; color: #fff; font-size: 14px; font-weight: 600; }
#organizations-view .relationship-card-head strong { display: block; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
#organizations-view .relationship-card-head p { overflow: hidden; max-width: 180px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.organization-access { display: flex; max-width: 150px; align-items: center; gap: 5px; border-radius: 999px; background: #f1f4f7; color: #657181; padding: 5px 8px; font-size: 10px; line-height: 1.25; }
.organization-access svg { width: 13px; height: 13px; flex: 0 0 13px; }
.organization-access .material-symbols-rounded { flex: 0 0 14px; font-size: 14px; }
#organizations-view .relationship-metrics { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; border: 1px solid #e6eaf0; border-radius: 10px; overflow: hidden; }
#organizations-view .relationship-metrics span { gap: 5px; border: 0; border-right: 1px solid #e6eaf0; border-radius: 0; background: #fafbfc; padding: 11px 8px; text-align: center; }
#organizations-view .relationship-metrics span:last-child { border-right: 0; }
#organizations-view .relationship-metrics strong { font-size: 18px; }
#organizations-view .relationship-metrics strong.metric-online { color: #13824d; }
#organizations-view .relationship-metrics small { color: #7a8593; font-size: 10px; font-weight: 500; }
.organization-availability { display: grid; gap: 7px; }
.organization-availability-copy { display: flex; justify-content: space-between; color: #778290; font-size: 11px; }
.organization-availability-copy strong { color: #424d59; font-size: 11px; }
.organization-progress { height: 5px; overflow: hidden; border-radius: 99px; background: #edf0f3; }
.organization-progress span { display: block; height: 100%; border-radius: inherit; background: #25a866; }
.organization-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #edf0f3; padding-top: 14px; }
.organization-status { display: inline-flex; align-items: center; gap: 7px; color: #238157; font-size: 11px; font-weight: 500; }
.organization-status i { width: 7px; height: 7px; border-radius: 50%; background: #25a866; }
.organization-status.warning { color: #a15c07; }
.organization-status.warning i { background: #f79009; }
.organization-link { display: inline-flex; align-items: center; gap: 3px; color: #637080; font-size: 11px; }
.organization-link svg { width: 14px; height: 14px; }
.organization-link .material-symbols-rounded { font-size: 15px; }
.organizations-empty { grid-column: 1/-1; display: grid; justify-items: center; gap: 6px; padding: 70px 20px; }
@media (max-width:1320px) { #organizations-view .relationship-grid { grid-template-columns: repeat(2,minmax(250px,1fr)); } }
@media (max-width:760px) { .organizations-overview { grid-template-columns: repeat(2,minmax(0,1fr)); } .organizations-panel-header { align-items: stretch; flex-direction: column; } .organizations-search { width: 100%; } #organizations-view .relationship-grid { grid-template-columns: 1fr; padding: 12px; } }
@media (max-width:460px) { .organizations-overview { grid-template-columns: 1fr; } #organizations-view .relationship-metrics { grid-template-columns: repeat(2,1fr); } #organizations-view .relationship-metrics span:nth-child(2) { border-right: 0; } #organizations-view .relationship-metrics span:nth-child(-n+2) { border-bottom: 1px solid #e6eaf0; } }

/* Equipment list and settings drawer. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.equipment-open { overflow: hidden; }
.equipment-result-count { display: inline-block; margin-left: 10px; color: var(--muted); font-size: 12px; font-weight: 400; }
#objects-view .panel-header { gap: 20px; flex-wrap: wrap; }
#objects-view .filters { flex-wrap: wrap; }
#objects-view .filters input { min-width: 220px; }
.material-symbols-rounded { font-family: "Material Symbols Rounded" !important; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; letter-spacing: normal !important; text-transform: none !important; display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr; -webkit-font-feature-settings: "liga" !important; -webkit-font-smoothing: antialiased; font-feature-settings: "liga" !important; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20; }
.equipment-table { min-width: 1070px; }
.equipment-table th, .equipment-table td { padding-left: 11px; padding-right: 11px; }
.equipment-table td { padding-top: 18px; padding-bottom: 18px; vertical-align: middle; }
.equipment-table th { white-space: nowrap; font-size: 11px; letter-spacing: .025em; }
.equipment-table td:first-child { width: 42px; }
.equipment-table td:nth-child(2) { min-width: 180px; max-width: 300px; }
.equipment-name { display: block; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.equipment-name:hover { color: var(--ics-blue); }
.equipment-row-note { display: block; margin-top: 5px; font-size: 11px; }
.network-address, .network-chip { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.network-chips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 240px; }
.network-chip { padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.network-more { padding: 2px 4px; border: 0; background: transparent; font-size: 11px; color: var(--ics-blue); cursor: pointer; }
.pill.neutral { color: #576170; border-color: #dce1e8; background: #f2f4f7; }
.equipment-row-actions { display: flex; gap: 5px; align-items: center; }
.equipment-row-actions .material-symbols-rounded, .lan-network-row .material-symbols-rounded { font-size: 18px; }
.equipment-traffic, .equipment-last-seen { white-space: nowrap; font-variant-numeric: tabular-nums; }
.equipment-traffic strong, .equipment-traffic span, .equipment-last-seen strong, .equipment-last-seen span { display: block; }
.equipment-traffic strong { color: var(--text); font-size: 13px; }
.equipment-traffic span, .equipment-last-seen span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.equipment-last-seen strong { font-size: 12px; font-weight: 550; }
.sort-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.sort-control select { min-width: 170px; }
.sort-direction { display: inline-flex; align-items: center; justify-content: center; }
.sort-direction .material-symbols-rounded { font-size: 19px; }
.equipment-menu > summary { display: flex; list-style: none; cursor: pointer; }
.equipment-menu > summary::-webkit-details-marker { display: none; }
.equipment-menu-items { position: fixed; z-index: 35; width: 232px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 8px 28px #18243426; }
.equipment-menu-items button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; background: transparent; border: 0; border-radius: 6px; font-size: 12px; color: var(--text); text-align: left; cursor: pointer; }
.equipment-menu-items button:hover { background: var(--surface-2); }
.equipment-menu-items .danger-text { color: var(--danger); border-top: 1px solid var(--line); border-radius: 0; margin-top: 3px; }
.equipment-empty { text-align: center; padding: 55px 20px !important; }
.equipment-empty strong, .equipment-empty span { display: block; }
.equipment-empty span { margin-top: 8px; color: var(--muted); }
.modal.equipment-overlay { justify-items: end; padding: 0; overflow: hidden; background: #18202b66; backdrop-filter: blur(2px); }
.equipment-drawer { display: flex; flex-direction: column; width: min(620px, 100%); height: 100dvh; min-height: 0; background: white; box-shadow: -12px 0 60px #11182726; }
.equipment-drawer-header { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 26px 28px 12px; }
.equipment-drawer-header h2 { margin: 7px 0 0; font-size: 23px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.equipment-drawer-header .eyebrow { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.equipment-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 28px 20px; font-size: 12px; }
.equipment-tabs { display: flex; flex: 0 0 auto; gap: 20px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.equipment-tabs button { padding: 12px 0; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.equipment-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--ics-primary); font-weight: 650; }
.equipment-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 26px 28px; }
.equipment-tab-panel { display: grid; gap: 20px; }
.equipment-tab-panel h3 { margin: 0; font-size: 14px; font-weight: 650; }
.section-intro p, .equipment-section-heading p { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.equipment-tab-panel label { display: grid; gap: 8px; font-size: 12px; font-weight: 550; color: var(--text-soft); }
.equipment-tab-panel input:not([type="checkbox"]), .equipment-tab-panel select, .equipment-tab-panel textarea { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--text); font: inherit; font-size: 13px; font-weight: 400; }
.equipment-tab-panel textarea { resize: vertical; min-height: 80px; }
.equipment-tab-panel input:focus, .equipment-tab-panel textarea:focus, .equipment-tab-panel select:focus { outline: 2px solid #f2b70588; outline-offset: 2px; border-color: #b98905; }
.equipment-drawer button:focus-visible, .equipment-name:focus-visible, .equipment-menu summary:focus-visible { outline: 2px solid var(--ics-blue); outline-offset: 3px; }
.equipment-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.equipment-drawer .field-hint { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.equipment-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 22px; }
.equipment-section-heading .pill { font-size: 10px; }
.lan-network-list { display: grid; gap: 12px; }
.lan-network-list:empty::before { content: "Внутренние сети ещё не добавлены"; padding: 22px 15px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; font-size: 12px; }
.lan-network-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.lan-network-field { flex: 1; min-width: 0; display: grid; gap: 7px; }
.lan-network-field label { font-size: 11px; color: var(--muted); }
.lan-network-row > button { margin-top: 24px; flex-shrink: 0; }
.equipment-tab-panel .lan-network-input { font-family: ui-monospace, Consolas, monospace; }
.equipment-tab-panel [aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { display: block; margin: 0; color: var(--danger); font-size: 11px; line-height: 1.5; }
.add-network-button { justify-self: start; }
.equipment-notice { padding: 14px 16px; background: #f5f7fa; border: 1px solid #e4e8ee; border-radius: 8px; color: #4a5565; font-size: 12px; line-height: 1.7; }
.equipment-help { font-size: 12px; line-height: 1.7; color: var(--muted); }
.equipment-help summary { color: var(--text-soft); cursor: pointer; font-weight: 500; }
.equipment-help p { margin: 9px 0; }
.equipment-telemetry { border-top: 1px solid var(--line); padding-top: 22px; }
.equipment-telemetry:empty { display: none; }
.equipment-telemetry dl { margin: 12px 0 0; display: grid; gap: 0; }
.equipment-telemetry dl > div { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 11px 0; border-bottom: 1px solid #f0f2f5; font-size: 12px; }
.equipment-telemetry dt { color: var(--muted); }
.equipment-telemetry dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.equipment-tab-panel .equipment-toggle { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; }
.equipment-toggle strong, .equipment-toggle small { display: block; }
.equipment-toggle small { margin-top: 5px; color: var(--muted); line-height: 1.6; font-size: 11px; font-weight: 400; }
.equipment-toggle input { width: 18px; height: 18px; flex-shrink: 0; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 20px; }
.danger-zone summary { color: var(--danger); }
.equipment-drawer-footer { flex: 0 0 auto; display: grid; gap: 10px; padding: 16px 28px 22px; border-top: 1px solid var(--line); background: white; }
.equipment-footer-actions { display: flex; justify-content: flex-end; gap: 10px; }
.equipment-footer-actions .primary-button { background: var(--ics-primary); border-color: var(--ics-primary); color: #252b32; min-width: 130px; }
.equipment-footer-actions .primary-button:hover { background: var(--ics-primary-hover); }
.equipment-save-status { padding: 11px 13px; border-radius: 7px; background: #f3f5f8; color: #536174; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.equipment-save-status[data-kind="error"] { color: #97261c; background: #fff0ed; }
.equipment-save-status[data-kind="success"] { color: #14613c; background: #eaf7ef; }
.equipment-drawer [disabled] { opacity: .55; cursor: wait; }
@media (max-width: 640px) {
  .equipment-drawer-header { padding: 20px 18px 12px; }
  .equipment-drawer-header h2 { font-size: 20px; }
  .equipment-summary { padding: 0 18px 15px; }
  .equipment-tabs { padding: 0 18px; gap: 22px; }
  .equipment-drawer-body { padding: 20px 18px; }
  .equipment-drawer-footer { padding: 14px 18px max(16px, env(safe-area-inset-bottom)); }
  .equipment-section-heading { align-items: flex-start; flex-direction: column; }
  .equipment-field-grid { grid-template-columns: 1fr; }
  #objects-view .filters { width: 100%; }
  #objects-view .filters input { width: 100%; min-width: 0; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ics-bg);
  color: var(--text);
  font-family: var(--ics-font);
  font-weight: 400;
  line-height: 1.45;
}

.login-layout {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(500px, 0.92fr);
  min-height: 100dvh;
  background: var(--ics-surface);
  color: #111827;
  font-family: var(--ics-font);
}

.login-layout.hidden {
  display: none;
}

.login-brand-panel {
  position: relative;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.76) 38%, rgba(255, 255, 255, 0.2) 100%), url("/static/images/fon-aut.png");
  background-position: center bottom;
  background-size: cover;
  color: #111827;
  padding: 72px clamp(44px, 5.5vw, 82px);
}

.login-brand-logo,
.login-brand-copy {
  position: relative;
  z-index: 1;
}

.login-brand-logo,
.login-mobile-brand {
  display: flex;
  align-items: center;
}

.login-brand-logo img {
  display: block;
  width: 100%;
  max-width: 230px;
  height: auto;
}

.login-mobile-brand {
  display: none;
}

.login-mobile-brand img {
  display: block;
  width: 138px;
  height: auto;
}

.login-brand-copy {
  max-width: 500px;
  margin-top: 80px;
}

.login-brand-copy p {
  margin: 0 0 16px;
  color: #f5b800;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-brand-copy h1 {
  margin: 0 0 24px;
  color: #111827;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.18;
}

.login-brand-copy span {
  display: block;
  color: #6b7280;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
}

.login-form-panel {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr auto;
  padding: 36px clamp(36px, 5vw, 76px) 24px;
}

.login-form-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: transparent;
  padding: 3px;
}

.language-switcher button {
  height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ics-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 0 7px;
}

.language-switcher button.is-active {
  background: var(--ics-primary);
  color: var(--ics-sidebar-dark);
}

.login-form {
  display: grid;
  width: 100%;
  max-width: 520px;
  align-self: center;
  gap: 22px;
  margin: 0 auto 8vh;
}

.login-form header {
  margin-bottom: 8px;
}

.login-kicker {
  display: inline-block;
  margin: 0 0 24px;
  border-bottom: 3px solid #f5b800;
  color: #c99500;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding-bottom: 8px;
}

.login-form h2 {
  margin: 0 0 11px;
  color: #111827;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.login-form header > span {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.55;
}

.login-field {
  display: grid;
  gap: 8px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.login-field input {
  height: 54px;
  border: 1px solid #d7dde7;
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  font-weight: 400;
  padding: 0 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-field input:focus {
  border-color: #cba044;
  box-shadow: 0 0 0 3px rgba(245, 184, 0, 0.14);
}

.login-field input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.login-remember input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #f5b800;
}

.login-forgot {
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 0;
  text-decoration: none;
}

.login-forgot:hover {
  color: #111827;
  text-decoration: underline;
}

.login-submit {
  width: 100%;
  height: 56px;
  margin-top: 8px;
  border: 1px solid #f5b800;
  border-radius: 8px;
  background: #f5b800;
  color: #111827;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.login-submit:hover {
  background: #eaae00;
  box-shadow: 0 8px 22px rgba(245, 184, 0, 0.2);
  transform: translateY(-1px);
}

.login-submit:disabled,
.login-submit.is-loading {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.login-error {
  display: grid;
  gap: 3px;
  border: 1px solid #f6c5c1;
  border-radius: 10px;
  background: var(--ics-red-soft);
  color: var(--ics-red);
  font-size: 12px;
  padding: 12px 14px;
}

.login-error[hidden] {
  display: none;
}

.login-footer {
  align-self: end;
  color: var(--ics-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

button,
input,
select,
textarea {
  font: inherit;
}

.instec-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.instec-kit {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

.instec-kit-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.instec-kit-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.instec-kit-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--instec-graphite);
  color: var(--instec-yellow);
  font-weight: 600;
}

.instec-kit-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.instec-kit-title {
  margin-top: 3px;
  color: var(--text-strong);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 600;
}

.instec-kit-subtitle {
  max-width: 560px;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.instec-section {
  margin-top: 22px;
}

.instec-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: 12px;
}

.instec-section-header h2 {
  color: var(--text-strong);
  font-size: 18px;
}

.instec-section-header p {
  max-width: 560px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.instec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.instec-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.instec-swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.instec-swatch {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.instec-swatch-color {
  height: 42px;
  background: var(--swatch);
}

.instec-swatch-body {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.instec-swatch-body strong {
  color: var(--text-strong);
  font-size: 13px;
}

.instec-swatch-body span {
  color: var(--muted);
  font-size: 12px;
}

.instec-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.instec-card-header,
.instec-card-body,
.instec-card-footer {
  padding: 16px;
}

.instec-card-header {
  border-bottom: 1px solid var(--line);
}

.instec-card-header h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
}

.instec-card-header p,
.instec-card-body p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.instec-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.instec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.instec-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.instec-button:focus-visible,
.instec-input:focus,
.instec-select:focus,
.instec-textarea:focus {
  outline: 0;
  box-shadow: var(--focus-ring);
}

.instec-button-primary {
  background: var(--instec-yellow);
  color: #111827;
}

.instec-button-primary:hover {
  background: var(--instec-yellow-2);
}

.instec-button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text-strong);
}

.instec-button-secondary:hover {
  background: var(--surface-2);
}

.instec-button-graphite {
  background: var(--instec-graphite);
  color: #ffffff;
}

.instec-button-danger {
  border-color: #f4b4ae;
  background: var(--danger-weak);
  color: var(--danger);
}

.instec-button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.instec-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.instec-field {
  display: grid;
  gap: 7px;
}

.instec-label {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
}

.instec-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.instec-input,
.instec-select,
.instec-textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

.instec-textarea {
  min-height: 94px;
  padding: 10px 12px;
  resize: vertical;
}

.instec-input[aria-invalid="true"] {
  border-color: #f4b4ae;
  background: var(--danger-weak);
}

.instec-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.instec-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.instec-table th,
.instec-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

.instec-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.instec-table tr:last-child td {
  border-bottom: 0;
}

.instec-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.instec-badge-ok {
  background: var(--ok-weak);
  color: var(--ok);
}

.instec-badge-warn {
  background: var(--warn-weak);
  color: var(--warn);
}

.instec-badge-danger {
  background: var(--danger-weak);
  color: var(--danger);
}

.instec-badge-info {
  background: var(--info-weak);
  color: var(--info);
}

.instec-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.instec-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 3px rgba(102, 112, 133, 0.14);
}

.instec-status-ok::before {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(8, 116, 67, 0.15);
}

.instec-status-warn::before {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(161, 92, 7, 0.17);
}

.instec-status-danger::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15);
}

.instec-status-idle::before {
  background: #98a2b3;
}

@media (max-width: 920px) {
  .instec-kit {
    padding: 18px;
  }

  .instec-kit-header,
  .instec-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .instec-grid,
  .instec-grid-2,
  .instec-form-grid {
    grid-template-columns: 1fr;
  }

  .instec-swatch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .instec-kit-title {
    font-size: 24px;
  }

  .instec-kit-brand {
    align-items: flex-start;
  }

  .instec-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .instec-button {
    width: 100%;
  }

  .instec-swatch-grid {
    grid-template-columns: 1fr;
  }
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.03), transparent 280px),
    var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(246, 195, 67, 0.08), transparent 210px),
    var(--instec-graphite);
  color: #ffffff;
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(246, 195, 67, 0.35);
  border-radius: var(--radius-md);
  background: rgba(246, 195, 67, 0.12);
  color: var(--instec-yellow);
  font-weight: 600;
}

.brand strong {
  letter-spacing: 0.01em;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: #aab3c2;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 6px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  display: grid;
  gap: 8px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: #d8dee7;
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  padding: 0 12px;
}

.nav-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-label {
  line-height: 1.2;
}

.nav-button.active,
.nav-button:hover {
  border-color: rgba(246, 195, 67, 0.24);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--instec-yellow);
}

.sidebar-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  padding: 0 12px;
}

.sidebar-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.commercial-footer-button {
  justify-content: flex-start;
}

main {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 24px clamp(18px, 2.4vw, 34px) 34px;
  overflow: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  margin: -24px calc(clamp(18px, 2.4vw, 34px) * -1) 0;
  border-bottom: 1px solid rgba(216, 222, 231, 0.88);
  background: rgba(248, 250, 252, 0.92);
  padding: 16px clamp(18px, 2.4vw, 34px);
  backdrop-filter: blur(14px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--text-strong);
  font-size: 26px;
  line-height: 1.2;
  font-weight: 500;
}

h2 {
  font-size: 17px;
}

.topbar p {
  margin-top: 5px;
  color: var(--muted);
}

.actions,
.group-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button {
  min-height: 38px;
  border-radius: var(--radius-md);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
}

.language-select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-strong);
  padding: 0 10px;
  font-weight: 600;
}

.primary-button {
  border: 0;
  background: var(--instec-yellow);
  color: #111827;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-strong);
}

.primary-button:hover {
  background: var(--instec-yellow-2);
}

.secondary-button:hover {
  background: var(--surface-2);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.dashboard-clients-inline .bulkbar {
  padding: 12px 0;
  border-bottom: 0;
  background: transparent;
}

.dashboard-clients-inline .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 0;
}

.metrics article,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.metrics article {
  display: flex;
  flex-direction: column;
  min-height: 132px;
  padding: 16px 16px 14px;
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.metric-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--instec-graphite);
}

.metric-icon svg {
  width: 18px;
  height: 18px;
}

.metrics article > span,
.metric-header span {
  align-self: flex-start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-transform: uppercase;
}

.metrics strong {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(26px, 1.8vw, 32px);
  line-height: 1.05;
  letter-spacing: 0;
  text-align: center;
}

.metrics small {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
}

.metric-detail {
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
}

.metric-detail > span {
  margin-bottom: 0;
}

.metric-accent .metric-icon,
.metric-accent-alt .metric-icon {
  background: var(--surface-2);
}

.metric-accent .metric-icon {
  color: #b77900;
}

.metric-accent-alt .metric-icon {
  color: #167a72;
}

.metric-detail-lines {
  display: grid;
  flex: 1;
  align-content: center;
  justify-items: center;
  gap: 6px;
  width: 100%;
}

.metric-detail-line {
  font-size: clamp(20px, 1.4vw, 24px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--text-strong);
}

.metric-accent {
  border-color: rgba(246, 195, 67, 0.48);
  background: var(--surface);
}

.metric-accent-alt {
  border-color: rgba(22, 122, 114, 0.38);
  background: var(--surface);
}

.metric-accent span,
.metric-accent-alt span {
  color: var(--muted);
}

.metric-accent strong,
.metric-accent-alt strong,
.metric-accent .metric-detail-line,
.metric-accent-alt .metric-detail-line {
  color: var(--text-strong);
}

@media (max-width: 1380px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 66px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

input,
select,
textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  box-shadow: var(--focus-ring);
}

textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  width: 100%;
}

.panel-header .filters {
  flex: 1;
  width: auto;
}

.bulkbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.bulkbar select {
  min-width: 180px;
}

.route-warning {
  flex: 1;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.78fr);
  gap: 18px;
  align-items: start;
}

.dashboard-health-panel,
.dashboard-events-panel {
  grid-column: span 1;
}

.dashboard-agents-panel,
.dashboard-servers-panel {
  grid-column: span 1;
}

.dashboard-status-list {
  display: grid;
}

.dashboard-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 74px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.dashboard-status-row:last-child {
  border-bottom: 0;
}

.dashboard-status-row:hover {
  background: #fbfcfe;
}

.dashboard-status-row strong {
  color: var(--text-strong);
  font-size: 14px;
}

.dashboard-status-row .muted {
  margin-top: 4px;
  line-height: 1.35;
}

.dashboard-event-row {
  min-height: 76px;
}

.panel-subheader {
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

tbody tr {
  transition: background-color 140ms ease;
}

tbody tr:hover td {
  background: #fbfcfe;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.pill.ok {
  background: #dcfae6;
  color: var(--ok);
}

.pill.warn {
  background: #fef0c7;
  color: var(--warn);
}

.pill.danger {
  background: #fee4e2;
  color: var(--danger);
}

.pill.system {
  background: #dbeafe;
  color: #1d4ed8;
}

.activity-list,
.groups-list,
.policy-list {
  display: grid;
}

.activity-row,
.group-row,
.policy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.activity-row:hover,
.group-row:hover,
.policy-row:hover {
  background: #fbfcfe;
}

.activity-traffic-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.commercial-admin-row {
  align-items: center;
}

.commercial-admin-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.commercial-admin-summary strong {
  white-space: nowrap;
}

.traffic-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.traffic-meta strong {
  font-size: 14px;
  line-height: 1.3;
}

.traffic-meta span {
  line-height: 1.35;
}

.activity-meta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-align: right;
}

.client-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, var(--surface-2));
}

.client-list-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.clients-list {
  display: grid;
  gap: 10px;
  padding: 18px;
  background: var(--surface-2);
}

.client-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.client-row.is-online {
  border-color: rgba(8, 116, 67, 0.28);
  box-shadow: 0 10px 24px rgba(8, 116, 67, 0.08);
}

.client-row-select {
  padding-top: 4px;
}

.client-row-main {
  display: grid;
  gap: 12px;
}

.client-row-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.client-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.client-row-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.client-stat {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid rgba(36, 88, 167, 0.08);
}

.client-stat-live {
  background: var(--accent-weak);
}

.client-stat span,
.client-stat small {
  color: var(--muted);
}

.client-stat strong {
  font-size: 20px;
  line-height: 1.15;
}

.client-row-actions {
  display: flex;
  justify-content: flex-end;
}

.group-main {
  display: grid;
  gap: 8px;
}

.group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.group-meta,
.group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.group-users-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.group-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.group-user-name {
  display: grid;
  gap: 2px;
}

.group-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.activity-row:last-child,
.group-row:last-child,
.policy-row:last-child,
tbody tr:last-child td {
  border-bottom: 0;
}

.network-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

body[data-app-mode="commercial"] #commercial-clients-view .network-layout,
body[data-app-mode="commercial"] #commercial-admins-view .network-layout,
body[data-app-mode="commercial"] #commercial-payments-view .network-layout {
  grid-template-columns: minmax(0, 1fr);
}

.compact-actions {
  gap: 8px;
}

.panel-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
}

.policy-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px 14px;
}

.policy-summary article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 12px 14px;
}

.policy-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.policy-summary strong {
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
}

.relationship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 18px;
  background: var(--surface-2);
}

.relationship-card {
  display: grid;
  gap: 14px;
  min-height: 176px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.relationship-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.relationship-card-head strong {
  color: var(--text-strong);
  font-size: 16px;
}

.relationship-card-head p {
  margin-top: 5px;
  line-height: 1.4;
}

.relationship-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.relationship-metrics span {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(36, 88, 167, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.relationship-metrics strong {
  color: var(--text-strong);
  font-size: 21px;
  line-height: 1;
}

.relationship-chain {
  border-left: 3px solid var(--instec-yellow);
  padding-left: 10px;
  font-size: 13px;
  font-weight: 600;
}

.telegram-integration-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  padding: 18px;
  background: var(--surface-2);
}

.telegram-section {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.telegram-status-card,
.telegram-events-card,
.telegram-cloud-card {
  grid-column: 1 / -1;
}

.telegram-section-head,
.telegram-cloud-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.telegram-section h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
}

.telegram-list {
  display: grid;
  gap: 10px;
}

.telegram-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(36, 88, 167, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 12px;
}

.telegram-row strong,
.telegram-row span {
  display: block;
}

.telegram-row .muted {
  margin-top: 4px;
  line-height: 1.4;
}

.telegram-bot-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(36, 88, 167, 0.1);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 14px;
}

.telegram-bot-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.telegram-bot-card-head strong,
.telegram-bot-card-head span {
  display: block;
}

.telegram-bot-card-head .muted {
  margin-top: 5px;
  line-height: 1.4;
}

.telegram-bot-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.telegram-bot-fields span {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(36, 88, 167, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.telegram-bot-fields strong {
  color: var(--text-strong);
  font-size: 12px;
  text-transform: uppercase;
}

.telegram-binding-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.telegram-binding-grid span {
  min-height: 38px;
  border: 1px solid rgba(36, 88, 167, 0.08);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 10px 12px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
}

.policy-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.proxy-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.form-hint {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.preview-box {
  min-height: 360px;
  margin: 0;
  overflow: auto;
  padding: 16px 18px;
  background: var(--instec-graphite);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
}

.policy-meta {
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: pre-wrap;
}

.muted {
  color: var(--muted);
}

.link-button {
  color: var(--info);
  text-decoration: none;
  font-weight: 600;
}

.proxy-url {
  display: inline-block;
  margin-top: 6px;
  word-break: break-all;
}

.inline-link {
  border: 0;
  background: transparent;
  color: var(--info);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.danger-button {
  min-height: 38px;
  border-radius: var(--radius-md);
  padding: 0 14px;
  cursor: pointer;
  border: 1px solid #f4b4ae;
  background: var(--danger-weak);
  color: var(--danger);
  font-weight: 600;
}

.icon-actions {
  display: flex;
  gap: 6px;
}

.icon-action {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--info);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}

.icon-action:hover {
  border-color: var(--accent-2);
  background: #eef4ff;
}

.icon-action.danger {
  color: var(--danger);
}

.icon-action.danger:hover {
  border-color: #f4b4ae;
  background: #fff2f1;
}

.icon-action.payment-action {
  color: var(--accent);
}

.icon-action.payment-action:hover {
  border-color: rgba(22, 122, 114, 0.3);
  background: rgba(20, 184, 166, 0.08);
}

.icon-action.neutral-action {
  color: #475467;
  background: #f8fafc;
}

.icon-action.neutral-action:hover {
  border-color: #cbd5e1;
  background: #eef2f7;
}

.icon-action.send-action {
  color: #2458a7;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
}

.icon-action.send-action:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: rgba(37, 99, 235, 0.14);
}

.icon-action.receipt-action {
  color: #8a5a00;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.22);
}

.icon-action.receipt-action:hover {
  border-color: rgba(217, 119, 6, 0.34);
  background: rgba(245, 158, 11, 0.18);
}

.icon-action.confirm-action {
  color: #087443;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.22);
}

.icon-action.confirm-action:hover {
  border-color: rgba(5, 150, 105, 0.36);
  background: rgba(16, 185, 129, 0.18);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.62);
  backdrop-filter: blur(5px);
}

.modal[hidden] {
  display: none;
}

[hidden] {
  display: none !important;
}

.modal-panel {
  display: grid;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  gap: 14px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.commercial-client-modal-panel {
  width: min(1200px, calc(100vw - 32px));
  max-height: calc(100vh - 24px);
  gap: 18px;
  padding: 24px 28px;
}

.commercial-payments-modal-panel {
  width: min(900px, calc(100vw - 32px));
}

.commercial-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.commercial-modal-section {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.commercial-modal-section-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.commercial-modal-section-head.compact {
  gap: 12px;
}

.commercial-modal-section h3 {
  margin: 0;
  font-size: 18px;
}

.commercial-modal-section-head p {
  margin: 4px 0 0;
}

.commercial-modal-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(36, 88, 167, 0.14);
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 18px;
}

.commercial-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.commercial-form-span-2 {
  grid-column: 1 / -1;
}

.commercial-network-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(36, 88, 167, 0.18);
  background: rgba(248, 250, 252, 0.8);
}

.payments-log {
  overflow: auto;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.payments-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px 14px;
}

.payments-filter {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

#commercial-payments-view .panel {
  overflow: hidden;
}

#commercial-payments-view table {
  min-width: 920px;
  table-layout: fixed;
}

#commercial-payments-view th:nth-child(1),
#commercial-payments-view td:nth-child(1) {
  width: 21%;
}

#commercial-payments-view th:nth-child(2),
#commercial-payments-view td:nth-child(2) {
  width: 16%;
}

#commercial-payments-view th:nth-child(3),
#commercial-payments-view td:nth-child(3) {
  width: 24%;
}

#commercial-payments-view th:nth-child(4),
#commercial-payments-view td:nth-child(4) {
  width: 25%;
}

#commercial-payments-view th:nth-child(5),
#commercial-payments-view td:nth-child(5) {
  width: 14%;
}

.commercial-payment-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.commercial-payment-title,
.commercial-payment-secondary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commercial-payment-title {
  line-height: 1.35;
  -webkit-line-clamp: 2;
}

.commercial-payment-secondary {
  line-height: 1.3;
  -webkit-line-clamp: 2;
}

.commercial-payment-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.commercial-payment-kind-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f7;
  color: #475467;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.commercial-payment-row td {
  height: 88px;
  vertical-align: middle;
}

.commercial-payment-row {
  transition: background-color 140ms ease;
}

.commercial-payment-row:hover td {
  background: #fbfcfe;
}

.commercial-payment-row.attention-pending td {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.10), rgba(255, 255, 255, 0.98) 28%);
}

.commercial-payment-row.attention-critical td {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.12), rgba(255, 255, 255, 0.98) 28%);
}

.commercial-payment-row.attention-pending:hover td {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(248, 250, 252, 0.98) 28%);
}

.commercial-payment-row.attention-critical:hover td {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(248, 250, 252, 0.98) 28%);
}

.commercial-payment-row.request-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, 0.34);
}

.commercial-payment-row.payment-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(16, 185, 129, 0.30);
}

.commercial-payment-row.attention-pending td:first-child {
  box-shadow: inset 4px 0 0 rgba(245, 158, 11, 0.72);
}

.commercial-payment-row.attention-critical td:first-child {
  box-shadow: inset 4px 0 0 rgba(16, 185, 129, 0.78);
}

.commercial-payment-actions-cell {
  white-space: nowrap;
}

.commercial-payment-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.commercial-payment-action-row .icon-action {
  width: 34px;
  height: 34px;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.commercial-payment-action-row .icon-action:hover {
  transform: translateY(-1px);
}

.commercial-payment-action-row .icon-action svg {
  width: 16px;
  height: 16px;
}

.commercial-payment-details-modal-panel {
  width: min(760px, calc(100vw - 32px));
}

.commercial-payment-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.commercial-payment-detail-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.commercial-payment-detail-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.commercial-payment-detail-item strong {
  line-height: 1.45;
  word-break: break-word;
}

.commercial-receipt-modal-panel {
  width: min(960px, calc(100vw - 32px));
}

.commercial-receipt-preview {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  overflow: hidden;
}

.commercial-receipt-image,
.commercial-receipt-frame {
  width: 100%;
  height: min(72vh, 760px);
  border: 0;
  object-fit: contain;
  background: #fff;
}

.commercial-receipt-empty {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.payment-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.payment-row {
  align-items: center;
}

.payment-row-meta {
  white-space: nowrap;
}

.payments-form-grid {
  align-items: start;
}

.modal-panel label {
  display: grid;
  gap: 7px;
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 600;
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  justify-content: flex-end;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.check-row {
  display: flex !important;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
}

.check-row input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.apply-note {
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  border-radius: var(--radius-md);
  background: var(--instec-graphite);
  color: #ffffff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .login-layout {
    display: block;
    min-height: 100vh;
    overflow-y: auto;
  }

  .login-brand-panel {
    min-height: 240px;
    padding: 24px 22px;
    background-position: center 62%;
  }

  .login-brand-logo {
    display: none;
  }

  .login-brand-copy {
    max-width: 520px;
    margin-top: 28px;
  }

  .login-brand-copy h1 {
    font-size: 36px;
  }

  .login-brand-copy span {
    font-size: 16px;
  }

  .login-form-panel {
    min-height: auto;
    padding: 26px 22px 34px;
  }

  .login-mobile-brand {
    display: flex;
  }

  .login-form {
    max-width: 480px;
    margin-top: 22px;
    padding: 0;
  }

  .login-form header h2 {
    font-size: 30px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .brand {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-button {
    flex: 0 0 auto;
    min-width: 132px;
  }

  .sidebar-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
    padding-top: 12px;
  }

  main {
    gap: 16px;
    padding: 18px;
  }

  .topbar {
    position: static;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 16px;
  }

  .topbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .payments-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .payments-filter select {
    width: 100%;
  }

  .commercial-payment-details-grid {
    grid-template-columns: 1fr;
  }

  .commercial-payment-row td {
    height: auto;
  }

  .commercial-payment-action-row {
    justify-content: flex-start;
  }

  .commercial-client-modal-panel {
    width: min(100vw - 16px, 1200px);
    max-height: calc(100vh - 16px);
    padding: 18px;
  }

  .commercial-modal-layout,
  .commercial-form-grid {
    grid-template-columns: 1fr;
  }

  .commercial-form-span-2 {
    grid-column: auto;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-workspace,
  .group-form {
    grid-template-columns: 1fr;
  }

  .group-form {
    flex-direction: column;
    align-items: stretch;
  }

  .network-layout,
  .policy-form,
  .proxy-form,
  .network-widget,
  .telegram-integration-layout,
  .telegram-binding-grid,
  .client-row-stats {
    grid-template-columns: 1fr;
  }

  .telegram-status-card,
  .telegram-events-card,
  .telegram-cloud-card {
    grid-column: auto;
  }

  .telegram-section-head,
  .telegram-cloud-card,
  .telegram-row,
  .telegram-bot-card-head,
  .telegram-bot-fields {
    grid-template-columns: 1fr;
  }

  .policy-summary {
    grid-template-columns: 1fr;
  }

  .filters {
    justify-content: stretch;
  }

  .filters input,
  .filters select,
  .bulkbar select,
  .bulkbar button {
    width: 100%;
  }

  .bulkbar {
    align-items: stretch;
    flex-direction: column;
  }

  .client-row {
    grid-template-columns: 1fr;
  }

  .client-list-header,
  .client-row-header {
    flex-direction: column;
    align-items: stretch;
  }

.client-row-badges,
.client-row-actions,
.traffic-meta {
  justify-content: flex-start;
  justify-items: start;
  text-align: left;
}
}

.shell {
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--ics-bg);
}

.sidebar {
  gap: 0;
  border-right: 0;
  background: linear-gradient(180deg, var(--ics-sidebar-dark), #101820);
  padding: 22px 14px;
}

.brand {
  gap: 11px;
  margin-bottom: 18px;
  border-bottom: 0;
  padding: 4px 8px 24px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--ics-primary);
  color: var(--ics-sidebar-dark);
  font-size: 13px;
  font-weight: 600;
}

.brand strong {
  display: block;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.brand span {
  color: var(--ics-sidebar-muted);
  font-size: 12px;
}

nav {
  gap: 22px;
}

.sidebar nav {
  display: grid;
  gap: 4px;
}

.sidebar-section-label {
  color: #7f8b98;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 14px 11px 7px;
  text-transform: uppercase;
}

.sidebar-section-label:first-child {
  padding-top: 0;
}

.nav-button,
.sidebar-button {
  position: relative;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  color: #bac3cd;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 11px;
}

.nav-button::before,
.sidebar-button::before {
  position: absolute;
  left: -14px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  content: "";
}

.nav-icon {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
  color: #98a5b3;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
}

.nav-button.active,
.nav-button:hover,
.sidebar-button:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-button.active {
  box-shadow: none;
}

.nav-button.active::before {
  background: var(--ics-primary);
}

.nav-button.active .nav-icon,
.nav-button:hover .nav-icon,
.sidebar-button:hover .nav-icon {
  color: var(--ics-primary);
}

main {
  gap: 0;
  padding: 0;
  background: var(--ics-bg);
}

.topbar {
  min-height: 92px;
  margin: 0;
  border-bottom: 1px solid var(--ics-border);
  background: rgba(255, 255, 255, 0.94);
  padding: 16px 28px;
  backdrop-filter: none;
}

.topbar + section,
.view {
  margin: 0;
}

main > .view,
main > .toast {
  margin: 28px 30px 40px;
}

h1 {
  font-size: 22px;
  font-weight: 600;
}

h2 {
  font-size: 16px;
  font-weight: 600;
}

strong,
.metric strong,
.relationship-metrics strong,
.summary-card strong,
.policy-summary strong,
.commercial-payment-title {
  font-weight: 600;
}

.topbar p,
.panel-subtitle,
.muted {
  color: var(--ics-muted);
  font-weight: 400;
}

.primary-button,
.secondary-button,
.danger-button,
.language-select,
.pill,
.badge,
label,
th {
  font-weight: 500;
}

.primary-button {
  background: var(--ics-primary);
  color: var(--ics-sidebar-dark);
}

.primary-button:hover {
  background: var(--ics-primary-hover);
}

.secondary-button,
.language-select,
.panel,
.relationship-card,
.metric-card,
.network-widget {
  border-color: var(--ics-border);
}

.panel,
.relationship-card,
.metric-card,
.network-widget {
  box-shadow: var(--ics-shadow-soft);
}

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .sidebar-footer {
    grid-template-columns: 1fr;
  }

  .actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions button,
  .modal-actions button,
  .primary-button,
  .secondary-button,
  .danger-button {
    width: 100%;
  }

  .dashboard-status-row,
  .activity-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .brand {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .sidebar-section-label {
    display: none;
  }

  .nav-button {
    flex: 0 0 auto;
    min-width: 132px;
  }

  .nav-button::before,
  .sidebar-button::before {
    display: none;
  }

  .sidebar-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
    padding-top: 12px;
  }

  main {
    gap: 16px;
    padding: 18px;
  }

  .topbar {
    position: static;
    margin: 0;
    border: 1px solid var(--ics-border);
    border-radius: var(--ics-radius-sm);
    padding: 16px;
  }

  main > .view,
  main > .toast {
    margin: 0;
  }
}

/* Keep the dashboard layout above legacy responsive declarations. */
#dashboard-view.active { display: grid; gap: 18px; }
#dashboard-view .dashboard-kpis { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 12px; }
#dashboard-view .dashboard-kpis > article { grid-column: span 3; }
#dashboard-view .dashboard-kpis > .metric-detail { grid-column: span 6; }
#dashboard-view .dashboard-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,.82fr); gap: 14px; }
#dashboard-view .dashboard-status-row { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 14px; }
#dashboard-view .dashboard-status-row > .pill { width: auto; min-width: 0; justify-self: end; }
@media (max-width:1180px) {
  #dashboard-view .dashboard-kpis > article { grid-column: span 6; }
  #dashboard-view .dashboard-workspace { grid-template-columns: 1fr; }
}
@media (max-width:620px) {
  #dashboard-view .dashboard-kpis { grid-template-columns: 1fr; }
  #dashboard-view .dashboard-kpis > article,
  #dashboard-view .dashboard-kpis > .metric-detail { grid-column: auto; }
}

.metric-live-footer { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-left: 43px; color: rgba(255,255,255,.67); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.metric-live-footer > span { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.metric-live-footer > span i { width: 6px; height: 6px; border-radius: 50%; background: #42da8c; box-shadow: 0 0 0 4px rgba(66,218,140,.15); animation: dashboard-live-pulse 1.8s ease-out infinite; }
.traffic-live-meter,.traffic-total-split { display: flex; width: 100%; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.12); }
.traffic-live-meter b { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#f2b705,#ffdc62); box-shadow: 0 0 12px rgba(242,183,5,.42); transition: width .7s ease; }
.traffic-total-split b,.traffic-total-split i { display: block; height: 100%; transition: width .7s ease; }
.traffic-total-split b { background: #61d7bd; }
.traffic-total-split i { background: #f5c842; }
.dashboard-livebar { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 14px; margin-top: -6px; border: 1px solid #e1e6eb; border-radius: 9px; background: rgba(255,255,255,.72); padding: 7px 11px; color: #7a8592; font-size: 10px; }
.dashboard-live-state { display: inline-flex; align-items: center; gap: 7px; }
.dashboard-live-state i { width: 7px; height: 7px; border-radius: 50%; background: #21a863; box-shadow: 0 0 0 4px #e4f6ec; animation: dashboard-live-pulse 1.8s ease-out infinite; }
#dashboard-live-time { font-variant-numeric: tabular-nums; }
@keyframes dashboard-live-pulse { 0% { box-shadow: 0 0 0 0 rgba(43,190,112,.35); } 70%,100% { box-shadow: 0 0 0 6px rgba(43,190,112,0); } }
@media (prefers-reduced-motion:reduce) { .metric-live-footer > span i,.dashboard-live-state i { animation: none; } .traffic-live-meter b,.traffic-total-split b,.traffic-total-split i { transition: none; } }
@media (max-width:620px) { .metric-live-footer { padding-left: 0; } .dashboard-livebar { align-items: flex-start; flex-direction: column; } }

/* Material Symbols alignment */
.nav-icon > .material-symbols-rounded {
  display: grid;
  width: 23px;
  height: 23px;
  overflow: hidden;
  place-items: center;
  font-size: 20px !important;
  line-height: 23px !important;
}

.dashboard-kpis .metric-icon.material-symbols-rounded {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  padding: 0;
  font-size: 19px !important;
  line-height: 32px !important;
}

.organizations-summary-icon.material-symbols-rounded {
  display: grid;
  place-items: center;
  font-size: 21px !important;
  line-height: 40px !important;
}

.organization-access .material-symbols-rounded,
.organization-link .material-symbols-rounded {
  display: inline-grid;
  place-items: center;
  line-height: 1 !important;
}

/* Connect Servers workspace */
#wireguard-servers-view .network-layout { grid-template-columns: 1fr; gap: 14px; }
#wireguard-servers-view .server-summary-panel { grid-row: 1; }
#wireguard-servers-view .server-list-panel { grid-row: 2; }
#wireguard-servers-view .panel { border-radius: 13px; }
#wireguard-servers-view .panel-header { min-height: 76px; padding: 16px 19px; }
#wireguard-server-summary { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 16px 18px 18px; }
#wireguard-server-summary article { position: relative; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 12px; min-height: 78px; align-items: center; border-radius: 11px; background: #fff; padding: 13px 15px; }
#wireguard-server-summary article > .material-symbols-rounded { grid-row: 1/3; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; background: #f1f4f7; color: #617081; font-size: 20px !important; }
#wireguard-server-summary article:last-child > .material-symbols-rounded { background: #e4f6ec; color: #19965a; }
#wireguard-server-summary strong { align-self: end; font-size: 22px; line-height: 1; }
#wireguard-server-summary small { align-self: start; color: #788391; font-size: 10px; }
#wireguard-servers-list { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 14px; background: #f7f8fa; }
.server-card { display: grid; gap: 14px; min-width: 0; border: 1px solid var(--ics-border); border-radius: 12px; background: #fff; padding: 17px; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.server-card.is-featured { border-color: #badfce; box-shadow: 0 8px 22px rgba(21,128,79,.08); }
.server-card-head { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 10px; }
.server-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.server-identity > div { min-width: 0; }
.server-identity strong { display: block; overflow: hidden; color: #1c2632; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.server-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; background: #222e3a; color: #fff; font-size: 20px !important; }
.is-featured .server-icon { background: #198e58; }
.server-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.server-tags span { border-radius: 99px; background: #f1f4f7; color: #687584; padding: 3px 7px; font-size: 9px; }
.server-endpoint { display: flex; min-width: 0; align-items: center; gap: 7px; border-radius: 8px; background: #f7f9fb; color: #536171; padding: 9px 10px; font-family: ui-monospace,"Cascadia Code",Consolas,monospace; font-size: 11px; }
.server-endpoint .material-symbols-rounded { flex: 0 0 16px; font-size: 16px !important; }
.server-endpoint span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: hidden; border: 1px solid #e6eaf0; border-radius: 9px; }
.server-metrics span { display: grid; gap: 4px; border-right: 1px solid #e6eaf0; background: #fbfcfd; padding: 10px 8px; text-align: center; }
.server-metrics span:last-child { border-right: 0; }
.server-metrics strong { overflow: hidden; color: #202a35; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.server-metrics small { color: #7a8592; font-size: 9px; }
.server-details { display: grid; gap: 0; border-top: 1px solid #edf0f3; }
.server-details > div { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid #edf0f3; }
.server-details span { color: #89939f; font-size: 10px; }
.server-details strong,.server-details p { overflow: hidden; margin: 0; color: #4d5967; font-size: 10px; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.server-card-footer { display: flex; min-height: 28px; align-items: center; flex-wrap: wrap; gap: 7px; }
.server-card-footer > span { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; background: #e8f5ee; color: #247b52; padding: 5px 8px; font-size: 9px; }
.server-card-footer .material-symbols-rounded { font-size: 13px !important; }
.server-card-footer .server-no-runtime { background: #f2f4f7; color: #75808d; }
@media (max-width:1250px) { #wireguard-servers-list { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { #wireguard-server-summary { grid-template-columns: repeat(2,minmax(0,1fr)); } #wireguard-servers-list { grid-template-columns: 1fr; padding: 12px; } }
@media (max-width:440px) { #wireguard-server-summary { grid-template-columns: 1fr; } }

/* Normalize Google icon boxes on the servers page. */
#wireguard-servers-view .material-symbols-rounded {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1 !important;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
  transform: none;
}

#wireguard-server-summary article > .material-symbols-rounded {
  display: inline-flex !important;
  width: 38px;
  height: 38px;
  align-self: center;
  justify-self: center;
  font-size: 20px !important;
}

.server-icon.material-symbols-rounded {
  display: inline-flex !important;
  width: 38px;
  height: 38px;
  align-self: center;
  font-size: 20px !important;
}

.server-endpoint > .material-symbols-rounded {
  width: 16px;
  height: 16px;
  font-size: 16px !important;
}

.server-card-footer .material-symbols-rounded {
  width: 14px;
  height: 14px;
  font-size: 14px !important;
}

/* Routes workspace */
#routes-view .network-layout { grid-template-columns: minmax(0,1.55fr) minmax(300px,.65fr); gap: 14px; }
#routes-view .panel { border-radius: 13px; }
#routes-view .panel-header { min-height: 76px; padding: 16px 19px; }
#routes-view .proxy-form { display: block; padding: 18px; background: #fff; }
.route-form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.route-form-grid label { display: grid; gap: 7px; color: #606c79; font-size: 10px; font-weight: 600; }
.route-form-grid input,.route-form-grid select { width: 100%; min-width: 0; background: #f9fafb; }
.route-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; border-top: 1px solid #edf0f3; padding-top: 15px; }
.route-form-actions > div { display: flex; gap: 8px; }
.route-form-actions .primary-button { display: inline-flex; align-items: center; gap: 7px; }
.route-form-actions .material-symbols-rounded { font-size: 17px !important; }
.route-toggle { display: inline-flex; align-items: center; gap: 9px; color: #4d5967; font-size: 11px; }
.route-toggle input { width: 17px; height: 17px; min-height: 0; accent-color: #1f9a60; }
.route-list-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: #f8fafb; padding: 14px 18px; }
.route-list-head h3 { margin: 0; color: #25303b; font-size: 13px; }
.route-list-head p { margin-top: 3px; font-size: 10px; }
#proxy-routes-list { display: grid; gap: 10px; background: #f7f8fa; padding: 14px; }
.route-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; border: 1px solid #dfe4ea; border-radius: 11px; background: #fff; padding: 15px; box-shadow: 0 2px 7px rgba(15,23,42,.035); }
.route-card.is-enabled { border-left: 3px solid #26a869; }
.route-card.is-disabled { opacity: .72; }
.route-card-main { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }
.route-card-icon { display: inline-flex !important; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center; border-radius: 10px; background: #e8f6ef; color: #188c55; font-size: 20px !important; }
.is-disabled .route-card-icon { background: #f1f3f5; color: #818b97; }
.route-card-copy { min-width: 0; }
.route-card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.route-card-title strong { color: #202b36; font-size: 14px; }
.route-public-url { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; margin-top: 7px; overflow: hidden; color: #1769c2; font-size: 12px; font-weight: 600; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.route-public-url .material-symbols-rounded { font-size: 14px !important; }
.route-path { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; color: #697684; font-family: ui-monospace,"Cascadia Code",Consolas,monospace; font-size: 10px; }
.route-path .material-symbols-rounded { color: #9aa4af; font-size: 13px !important; }
.route-card-actions { display: flex; gap: 6px; }
.route-icon-button { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid #dfe4ea; border-radius: 8px; background: #fff; color: #647181; cursor: pointer; }
.route-icon-button:hover { border-color: #b8c4d0; background: #f5f7f9; color: #25303b; }
.route-icon-button.danger:hover { border-color: #f0c5c1; background: #fff2f1; color: var(--danger); }
.route-icon-button .material-symbols-rounded { font-size: 17px !important; }
.routes-empty { display: grid; justify-items: center; gap: 6px; padding: 48px 20px; color: #7b8794; text-align: center; }
.routes-empty > .material-symbols-rounded { font-size: 28px !important; }
.routes-empty small { font-size: 10px; }
.routes-help-panel { position: sticky; top: 110px; }
.route-flow { display: grid; justify-items: center; gap: 8px; padding: 20px; }
.route-flow > div { display: grid; width: 100%; justify-items: center; gap: 4px; border: 1px solid #e2e7ec; border-radius: 11px; background: #fafbfc; padding: 14px; text-align: center; }
.route-flow > div > .material-symbols-rounded { display: inline-flex !important; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 9px; background: #eef3f8; color: #526474; font-size: 19px !important; }
.route-flow strong { color: #26313c; font-size: 12px; }
.route-flow small { color: #7b8693; font-size: 9px; }
.route-flow > i { color: #efb60b; font-size: 18px !important; }
.route-example { display: grid; gap: 5px; margin: 0 18px 18px; border-radius: 10px; background: #202c38; padding: 14px; }
.route-example span { color: #9eabb8; font-size: 9px; text-transform: uppercase; }
.route-example strong { overflow: hidden; color: #fff; font-family: ui-monospace,"Cascadia Code",Consolas,monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.route-example small { color: #f4c321; font-size: 9px; }
@media (max-width:1180px) { #routes-view .network-layout { grid-template-columns: 1fr; } .routes-help-panel { position: static; } .route-flow { grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; } .route-flow > i { transform: rotate(-90deg); } }
@media (max-width:760px) { .route-form-grid { grid-template-columns: 1fr; } .route-form-actions { align-items: stretch; flex-direction: column; } .route-form-actions > div { flex-direction: column; } .route-card { grid-template-columns: 1fr; } .route-card-actions { justify-content: flex-end; } .route-flow { grid-template-columns: 1fr; } .route-flow > i { transform: none; } }

/* Connections workspace */
#connections-view.active { display: grid; gap: 14px; }
.connections-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.connections-overview article { display: flex; min-height: 82px; align-items: center; gap: 13px; border: 1px solid var(--ics-border); border-radius: 12px; background: #fff; padding: 14px 16px; box-shadow: 0 2px 8px rgba(15,23,42,.035); }
.connections-overview article > .material-symbols-rounded { display: inline-flex !important; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center; border-radius: 10px; background: #f0f3f6; color: #627181; font-size: 20px !important; }
.connections-overview article.is-online { border-color: #c9ead8; background: linear-gradient(135deg,#fff,#f6fcf9); }
.connections-overview article.is-online > .material-symbols-rounded { background: #e3f6eb; color: #17945a; }
.connections-overview article.is-offline > .material-symbols-rounded { background: #fff1dc; color: #d58a16; }
.connections-overview article div { display: grid; gap: 3px; }
.connections-overview strong { color: #1f2a35; font-size: 23px; line-height: 1; }
.connections-overview small { color: #7b8693; font-size: 10px; }
.connections-panel { border-radius: 13px; }
.connections-panel-header { min-height: 82px; flex-wrap: wrap; padding: 16px 19px; }
.connections-filters { display: flex; align-items: center; gap: 8px; }
.connections-filters label { position: relative; display: block; }
.connections-filters label .material-symbols-rounded { position: absolute; top: 50%; left: 11px; color: #8a95a2; font-size: 17px !important; pointer-events: none; transform: translateY(-50%); }
.connections-filters input { min-width: 230px; padding-left: 36px; background: #f8fafb; }
.connections-filters select { min-width: 130px; background: #f8fafb; }
.connections-table { min-width: 1100px; }
.connections-table th { height: 44px; background: #f7f9fb; color: #7b8694; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.connections-table td { height: 70px; padding-top: 12px; padding-bottom: 12px; vertical-align: middle; }
.connections-table tr { transition: background .15s ease; }
.connections-table tbody tr:hover td { background: #fafcfd; }
.connections-table .connection-row.is-online td:first-child { box-shadow: inset 3px 0 0 #28a969; }
.connections-table .connection-row.is-disabled { opacity: .68; }
.connection-name { display: flex; align-items: center; gap: 10px; }
.connection-name > .material-symbols-rounded { display: inline-flex !important; width: 30px; height: 30px; flex: 0 0 30px; align-items: center; justify-content: center; border-radius: 8px; background: #edf2f7; color: #617182; font-size: 16px !important; }
.is-online .connection-name > .material-symbols-rounded { background: #e4f6ec; color: #19965b; }
.connection-name strong { font-size: 12px; }
.connections-table .muted { margin-top: 4px; font-size: 10px; }
.connection-group { display: inline-flex; border-radius: 99px; background: #edf2f7; color: #596878; padding: 5px 8px; font-size: 10px; font-weight: 600; }
.connection-endpoint { display: block; max-width: 190px; overflow: hidden; font-family: ui-monospace,"Cascadia Code",Consolas,monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.connection-handshake { color: #4f5c69; font-size: 11px; white-space: nowrap; }
.connections-empty { display: grid; justify-items: center; gap: 6px; padding: 48px 20px; color: #7b8794; }
.connections-empty .material-symbols-rounded { font-size: 27px !important; }
.connections-empty small { font-size: 10px; }
@media (max-width:1100px) { .connections-overview { grid-template-columns: repeat(2,minmax(0,1fr)); } .connections-filters { width: 100%; flex-wrap: wrap; } .connections-filters label { flex: 1 1 220px; } .connections-filters input { width: 100%; min-width: 0; } }
@media (max-width:560px) { .connections-overview { grid-template-columns: 1fr; } .connections-filters { align-items: stretch; flex-direction: column; } .connections-filters label,.connections-filters select { width: 100%; } }

/* Access groups workspace */
#groups-view.active { display: grid; gap: 14px; }
.groups-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.groups-overview article { display: flex; min-height: 82px; align-items: center; gap: 13px; border: 1px solid var(--ics-border); border-radius: 12px; background: #fff; padding: 14px 16px; box-shadow: 0 2px 8px rgba(15,23,42,.035); }
.groups-overview article > .material-symbols-rounded { display: inline-flex !important; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center; border-radius: 10px; background: #eef2f6; color: #607080; font-size: 20px !important; }
.groups-overview article.is-online { border-color: #c9ead8; background: linear-gradient(135deg,#fff,#f6fcf9); }
.groups-overview article.is-online > .material-symbols-rounded { background: #e3f6eb; color: #17945a; }
.groups-overview article div { display: grid; gap: 3px; }
.groups-overview strong { color: #1f2a35; font-size: 23px; line-height: 1; }
.groups-overview small { color: #7b8693; font-size: 10px; }
.groups-panel { overflow: hidden; border-radius: 13px; }
.groups-panel-header { min-height: 86px; flex-wrap: wrap; padding: 16px 19px; }
.groups-panel-header h2 { margin: 0; }
.groups-panel-header p { margin-top: 4px; font-size: 10px; }
.group-form { display: grid; grid-template-columns: minmax(160px,1fr) minmax(180px,1.2fr) minmax(170px,1fr) auto; gap: 8px; }
.group-form label { position: relative; display: block; }
.group-form label > .material-symbols-rounded { position: absolute; top: 50%; left: 10px; color: #8b96a2; font-size: 17px !important; pointer-events: none; transform: translateY(-50%); }
.group-form label input { width: 100%; padding-left: 35px; }
.group-form input,.group-form select { min-width: 0; background: #f8fafb; }
.group-form .primary-button { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.group-form .primary-button .material-symbols-rounded { font-size: 17px !important; }
#groups-list.groups-list { display: grid; gap: 10px; background: #f6f8fa; padding: 14px; }
.access-group-card { overflow: hidden; border: 1px solid #dfe5eb; border-radius: 11px; background: #fff; box-shadow: 0 2px 7px rgba(15,23,42,.03); transition: border-color .16s ease,box-shadow .16s ease; }
.access-group-card.is-open { border-color: #cad7e2; box-shadow: 0 8px 20px rgba(15,23,42,.06); }
.access-group-summary { display: grid; width: 100%; grid-template-columns: auto minmax(200px,1fr) 72px 72px minmax(165px,.65fr) auto; gap: 14px; align-items: center; border: 0; background: #fff; padding: 15px 17px; color: inherit; text-align: left; cursor: pointer; }
.access-group-summary:hover { background: #fbfcfd; }
.access-group-icon { display: inline-flex !important; width: 38px; height: 38px; flex: 0 0 38px; align-items: center; justify-content: center; border-radius: 10px; background: #edf2f7; color: #596b7c; font-size: 20px !important; }
.access-group-card.is-open .access-group-icon { background: #e3f6eb; color: #178f57; }
.access-group-identity { display: grid; min-width: 0; gap: 4px; }
.access-group-title { display: flex; align-items: center; gap: 7px; }
.access-group-title strong { overflow: hidden; color: #202b36; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.access-group-identity > .muted { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.access-group-stat { display: grid; gap: 3px; padding-left: 13px; border-left: 1px solid #e7ebef; }
.access-group-stat strong { color: #26323e; font-size: 17px; }
.access-group-stat small { color: #8994a0; font-size: 9px; }
.access-group-stat.is-online strong { color: #16965b; }
.access-group-access { display: inline-flex; align-items: center; gap: 6px; color: #637180; font-size: 10px; font-weight: 600; }
.access-group-access .material-symbols-rounded { color: #8a96a2; font-size: 15px !important; }
.access-group-chevron { color: #7e8a96; font-size: 20px !important; transition: transform .18s ease; }
.access-group-card.is-open .access-group-chevron { transform: rotate(180deg); }
.access-group-body { border-top: 1px solid #e4e9ee; background: #fafbfc; }
.access-group-toolbar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 15px; }
.access-group-toolbar > span { display: inline-flex; align-items: center; gap: 6px; color: #73808d; font-size: 10px; }
.access-group-toolbar > span .material-symbols-rounded { font-size: 15px !important; }
.access-group-body .group-users-list { display: grid; gap: 7px; margin: 0; padding: 0 15px 15px; list-style: none; }
.access-group-body .group-user-row { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(145px,auto); gap: 14px; align-items: center; border: 1px solid #e1e6eb; border-radius: 9px; background: #fff; padding: 11px 13px; }
.access-group-body .group-user-name { display: grid; gap: 3px; }
.access-group-body .group-user-name strong { color: #283440; font-size: 12px; }
.access-group-body .group-user-name .muted,.access-group-body .group-user-row > .muted { font-size: 10px; }
.groups-empty { display: grid; justify-items: center; gap: 7px; padding: 48px 20px; color: #7b8794; }
.groups-empty .material-symbols-rounded { font-size: 28px !important; }
@media (max-width:1180px) { .groups-overview { grid-template-columns: repeat(2,minmax(0,1fr)); } .groups-panel-header { align-items: stretch; flex-direction: column; } .group-form { width: 100%; } .access-group-summary { grid-template-columns: auto minmax(170px,1fr) 65px 65px auto; } .access-group-access { display: none; } }
@media (max-width:760px) { .group-form { grid-template-columns: 1fr; } .access-group-summary { grid-template-columns: auto minmax(0,1fr) auto; } .access-group-stat { display: none; } .access-group-body .group-user-row { grid-template-columns: minmax(0,1fr) auto; } .access-group-body .group-user-row > .muted { grid-column: 1/-1; } }
@media (max-width:520px) { .groups-overview { grid-template-columns: 1fr; } }

/* Equipment activity details */
.equipment-client-row { cursor: pointer; }
.equipment-client-row:hover td { background: #fafcfd; }
.equipment-client-row td { transition: background .14s ease; }
.equipment-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.equipment-tabs .material-symbols-rounded { font-size: 17px !important; }
.equipment-drawer-header .icon-button .material-symbols-rounded { font-size: 20px !important; }
.equipment-activity-loading,.equipment-activity-error { display: flex; min-height: 90px; align-items: center; justify-content: center; gap: 9px; border: 1px dashed #dce3e9; border-radius: 11px; background: #fafbfc; color: #778491; font-size: 11px; }
.equipment-activity-loading .material-symbols-rounded { font-size: 20px !important; animation: equipment-spin 1s linear infinite; }
.equipment-activity-error { border-color: #f0d3cf; background: #fff8f7; color: #a34a42; }
@keyframes equipment-spin { to { transform: rotate(360deg); } }
.equipment-activity-head,.equipment-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.equipment-activity-head h3,.equipment-history-head h3 { margin: 0; color: #25313c; font-size: 13px; }
.equipment-activity-head p,.equipment-history-head p { margin: 3px 0 0; color: #87919d; font-size: 9px; }
.equipment-activity-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 11px; }
.equipment-activity-grid article { display: flex; min-height: 80px; align-items: flex-start; gap: 10px; border: 1px solid #e0e6eb; border-radius: 10px; background: #fff; padding: 12px; }
.equipment-activity-grid article > .material-symbols-rounded { display: inline-flex !important; width: 32px; height: 32px; flex: 0 0 32px; align-items: center; justify-content: center; border-radius: 8px; background: #eef2f6; color: #657585; font-size: 17px !important; transition: transform .2s cubic-bezier(.2,.8,.2,1),background-color .2s ease,color .2s ease; transform-origin: center; }
.equipment-activity-grid article:hover > .material-symbols-rounded { transform: scale(1.16); }
.equipment-activity-grid article.is-session > .material-symbols-rounded { background: #e2f6eb; color: #16945a; }
.equipment-activity-grid article div { display: grid; min-width: 0; gap: 3px; }
.equipment-activity-grid small { color: #8a95a1; font-size: 9px; }
.equipment-activity-grid strong { overflow: hidden; color: #26323d; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.equipment-activity-grid em { overflow: hidden; color: #74808c; font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.equipment-history-head { margin-top: 17px; padding-top: 14px; border-top: 1px solid #e4e9ed; }
.equipment-event-list { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.equipment-event { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; align-items: center; border: 1px solid #e2e7eb; border-radius: 9px; background: #fff; padding: 9px 10px; }
.equipment-event > .material-symbols-rounded { display: inline-flex !important; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; font-size: 15px !important; transition: transform .2s cubic-bezier(.2,.8,.2,1); transform-origin: center; }
.equipment-event:hover > .material-symbols-rounded { transform: scale(1.18); }
.equipment-event.is-connected > .material-symbols-rounded { background: #e4f7ec; color: #17955a; }
.equipment-event.is-disconnected > .material-symbols-rounded { background: #fff0dc; color: #cf8416; }
.equipment-event > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.equipment-event strong { color: #34404b; font-size: 10px; }
.equipment-event small { overflow: hidden; color: #86919c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.equipment-event time { color: #687582; font-size: 9px; white-space: nowrap; }
.equipment-events-empty { display: flex; min-height: 62px; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #dce3e9; border-radius: 9px; color: #86919c; font-size: 9px; }
.equipment-events-empty .material-symbols-rounded { font-size: 17px !important; }
@media (max-width:620px) { .equipment-activity-grid { grid-template-columns: 1fr; } .equipment-event { grid-template-columns: auto minmax(0,1fr); } .equipment-event time { grid-column: 2; } }
.equipment-details-dialog { width: min(760px,calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: hidden auto; border: 1px solid #dce3e9; border-radius: 14px; background: #f8fafb; box-shadow: 0 24px 70px rgba(15,23,42,.24); }
#client-details-modal.modal.equipment-overlay { place-items: center; padding: 24px; }
.equipment-client-row .icon-action .material-symbols-rounded { transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.equipment-client-row .icon-action:hover .material-symbols-rounded { transform: scale(1.18); }
@media (prefers-reduced-motion:reduce) { .equipment-activity-grid article > .material-symbols-rounded,.equipment-event > .material-symbols-rounded,.equipment-client-row .icon-action .material-symbols-rounded { transition: none; } }
.equipment-details-dialog .equipment-drawer-header { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid #e1e6eb; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.equipment-details-dialog .equipment-drawer-header p { margin: 5px 0 0; font-size: 10px; }
.equipment-details-content { padding: 18px; }
