:root {
    --bg: #eef1f8;
    --bg-mesh: radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.07), transparent 50%),
               radial-gradient(800px 400px at 100% 0%, rgba(59, 130, 246, 0.05), transparent 45%);
    --surface: #ffffff;
    --surface2: #f4f6fb;
    --border: #e2e6ef;
    --accent: #6d28d9;
    --accent-hover: #5b21b6;
    --accent-bg: #f3eeff;
    --ok: #15803d;
    --ok-bg: #ecfdf5;
    --warn: #c2410c;
    --warn-bg: #fff7ed;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --text: #12151f;
    --muted: #64748b;
    --mono: 'IBM Plex Mono', monospace;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-slot: 48px;
}

html.theme-dark {
    --bg: #0c1017;
    --bg-mesh: radial-gradient(1000px 500px at 8% -8%, rgba(139, 92, 246, 0.14), transparent 50%),
               radial-gradient(700px 380px at 100% 0%, rgba(59, 130, 246, 0.09), transparent 45%);
    --surface: #151b26;
    --surface2: #1e2533;
    --border: #2a3344;
    --accent: #a78bfa;
    --accent-hover: #c4b5fd;
    --accent-bg: rgba(139, 92, 246, 0.15);
    --ok: #4ade80;
    --ok-bg: rgba(34, 197, 94, 0.12);
    --warn: #fb923c;
    --warn-bg: rgba(251, 146, 60, 0.12);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.12);
    --text: #e8eaed;
    --muted: #94a3b8;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 22px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    background-image: var(--bg-mesh);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.sidebar {
    width: 76px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 16px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}
.sidebar-spacer { flex: 1; min-height: 12px; }
.sidebar-logo-wrap { width: var(--sidebar-slot); height: var(--sidebar-slot); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-bottom: 16px; }
.sidebar .js-brand-img { width: var(--sidebar-slot); height: var(--sidebar-slot); object-fit: contain; border-radius: 10px; }

.brand-fallback {
    width: var(--sidebar-slot);
    height: var(--sidebar-slot);
    border-radius: 10px;
    background: linear-gradient(145deg, var(--accent) 0%, #8b5cf6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(109, 40, 217, 0.25);
}
.brand-fallback[hidden] { display: none !important; }

.sidebar-footer { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 12px; border-top: 1px solid var(--border); width: 100%; }
.sidebar-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: center; }

.theme-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.theme-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.theme-switch-slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: background 0.2s ease; }
.theme-switch-slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: var(--surface); border-radius: 50%; transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: var(--shadow-sm); }
.theme-switch input:checked + .theme-switch-slider { background: var(--accent); }
.theme-switch input:checked + .theme-switch-slider::before { transform: translateX(18px); }
.theme-switch input:focus-visible + .theme-switch-slider { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-sidebar { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; font-size: 15px; }
.btn-sidebar:hover { color: var(--accent); background: var(--accent-bg); border-color: rgba(109, 40, 217, 0.3); }
.btn-sidebar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-sidebar.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.btn-sidebar.danger:hover { color: var(--error); background: var(--error-bg); border-color: rgba(220, 38, 38, 0.25); }

.sidebar-tool { width: var(--sidebar-slot); height: var(--sidebar-slot); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); text-decoration: none; font-size: 18px; transition: all 0.2s ease; cursor: pointer; }
.sidebar-tool:hover { color: var(--accent); background: var(--accent-bg); border-color: rgba(109, 40, 217, 0.35); transform: translateY(-1px); }
.sidebar-nav.active { color: var(--accent); background: var(--accent-bg); border-color: var(--accent); box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.15); }
.sidebar-tool + .sidebar-tool { margin-top: 10px; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { min-height: 64px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; box-shadow: var(--shadow-sm); z-index: 5; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-brand { display: flex; align-items: center; min-width: 0; }
.topbar-title { font-weight: 700; font-size: 16px; letter-spacing: 0.04em; color: var(--accent); }
.topbar-title span { color: var(--muted); font-weight: 500; letter-spacing: 0.02em; margin-left: 8px; font-size: 14px; }

.topbar-status { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); transition: all 0.2s ease; }
.topbar-status:hover { color: var(--accent); background: var(--accent-bg); border-color: rgba(109, 40, 217, 0.25); }

.last-refresh { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.btn-icon-toolbar { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface2); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.btn-icon-toolbar:hover { color: var(--accent); background: var(--accent-bg); border-color: rgba(109, 40, 217, 0.25); }
.btn-icon-toolbar.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.btn-icon-toolbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-logout { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s ease; }
.btn-logout:hover { color: var(--error); background: var(--error-bg); border-color: rgba(220, 38, 38, 0.25); }
.btn-logout:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-refresh { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-bg); border: 1px solid rgba(109, 40, 217, 0.2); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s ease; }
.btn-refresh:hover:not(:disabled) { background: #ebe4ff; border-color: rgba(109, 40, 217, 0.35); }
html.theme-dark .btn-refresh:hover:not(:disabled) { background: rgba(139, 92, 246, 0.25); }
.btn-refresh:disabled { opacity: 0.65; cursor: not-allowed; }

.content { padding: 24px; overflow-y: auto; flex: 1; max-width: 1600px; width: 100%; margin: 0 auto; }

body.layout-compact .content { padding: 14px 16px; }
body.layout-compact .topbar { padding: 6px 16px; min-height: 54px; }
body.layout-compact td, body.layout-compact th { padding: 10px 16px; font-size: 13px; }
body.layout-compact th { font-size: 10px; }
body.layout-compact .badge { padding: 3px 10px; font-size: 11px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 24px; }
.status-panel { margin-top: 4px; }
.status-embed-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%); }
.status-embed-head span { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0.06em; }
.status-embed-head a { font-size: 13px; color: var(--accent); font-weight: 600; text-decoration: none; }
.status-embed-head a:hover { text-decoration: underline; }
.status-embed-wrap { position: relative; width: 100%; height: min(500px, 45vh); min-height: 320px; background: var(--surface2); }
.status-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 16px 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); background: var(--surface2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 3; }
td { padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tbody tr { transition: background 0.15s ease; }
tbody tr:last-child td { border-bottom: none; }

tbody tr.pc-row:nth-child(even) td { background: rgba(124, 58, 237, 0.02); }
html.theme-dark tbody tr.pc-row:nth-child(even) td { background: rgba(139, 92, 246, 0.03); }

tbody tr.pc-row:hover td { background: var(--accent-bg) !important; cursor: pointer; }
html.theme-dark tbody tr:hover td { background: rgba(139, 92, 246, 0.12) !important; }

tbody tr.pc-row:focus-visible { outline: none; }
tbody tr.pc-row:focus-visible td:first-child { box-shadow: inset 4px 0 0 var(--accent); }

td.col-seen { font-variant-numeric: tabular-nums; font-family: var(--mono); color: var(--muted); }
td.col-status .badge { min-width: 110px; justify-content: flex-start; }

.table-empty { text-align: center; padding: 48px 24px !important; color: var(--muted); }
.table-empty strong { color: var(--text); display: block; margin-bottom: 8px; font-size: 16px; }

.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.01em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-error { background: var(--error-bg); color: var(--error); }
.b-info { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); padding: 5px 13px; }
html.theme-dark .badge .dot { box-shadow: 0 0 0 2px rgba(21, 27, 38, 0.5); }

.btn-icon { width: 36px; height: 36px; border: none; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s ease; }
.btn-icon:hover { color: var(--error); background: var(--error-bg); }

.input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 14px; transition: all 0.15s ease; background: var(--surface); color: var(--text); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15); }

.btn-primary { width: 100%; background: linear-gradient(180deg, #7c3aed 0%, var(--accent) 100%); color: white; border: none; padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 14px; box-shadow: 0 4px 14px rgba(109, 40, 217, 0.3); transition: all 0.15s ease; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(109, 40, 217, 0.4); }

.dashboard-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 13px; font-weight: 600; }
.dashboard-stats[hidden] { display: none !important; }
.stat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); }
.stat-pill .stat-n { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.stat-online .stat-n { color: var(--ok); }
.stat-standby .stat-n { color: var(--warn); }
.stat-offline .stat-n { color: var(--error); }
.stat-attention .stat-n { color: var(--warn); }
.stat-sep { color: var(--border); font-size: 18px; user-select: none; }

.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; opacity: 0; visibility: hidden; pointer-events: none; transition: all 0.25s ease; }
.modal-bg.open { opacity: 1; visibility: visible; pointer-events: auto; }

.modal { background: var(--surface); border-radius: 18px; padding: 0; width: min(820px, 95%); max-height: min(90vh, 850px); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); transform: translateY(20px) scale(0.98); opacity: 0; transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); }
#audit-modal-body-wrap.modal { width: min(680px, 100%); }
.modal-bg.open .modal { transform: none; opacity: 1; }

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%); }
.modal-head h2 { margin: 0; font-size: 1.4rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.modal-close { width: 36px; height: 36px; border: none; border-radius: 8px; background: var(--surface2); color: var(--muted); cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; transition: all 0.15s ease; }
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body-inner { padding: 24px; overflow-y: auto; flex: 1; }

.modal-grid-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
.card-tile { background: var(--surface2); padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; }
.card-tile--wide { grid-column: span 2; }
.card-tile small { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.card-tile strong { font-size: 14px; line-height: 1.4; color: var(--text); word-break: break-word; }

.field-copy-row { display: flex; flex-direction: column; gap: 6px; background: var(--surface2); padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 14px; position: relative; }
.field-copy-row--mb20 { margin-bottom: 20px; }
.field-copy-label { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.field-copy-value { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); padding-right: 44px; word-break: break-all; }
.field-copy-row .btn-copy { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s ease; }
.field-copy-row .btn-copy:hover { color: var(--accent); background: var(--accent-bg); border-color: rgba(109, 40, 217, 0.3); }

.modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--accent); }
html.theme-dark .modal-card { background: rgba(22, 28, 40, 0.4); }
.modal-section-title { margin: 0 0 16px 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.modal-section-rule { border: none; height: 1px; background: linear-gradient(90deg, transparent, var(--border) 15%, var(--border) 85%, transparent); margin: 24px 0; }

.notes-list-inner { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 16px; margin-bottom: 14px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.02); }
.note-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.note-row:last-child { border-bottom: none; }
.note-row-time { font-size: 11px; font-weight: 600; color: var(--muted); font-family: var(--mono); margin-bottom: 4px; }
.note-row-text { font-size: 13px; line-height: 1.5; }
.note-delete-btn { cursor: pointer; color: var(--muted); padding: 4px; flex-shrink: 0; background: none; border: none; font-size: 14px; transition: color 0.15s ease; }
.note-delete-btn:hover { color: var(--error); }
.no-notes-text { color: var(--muted); font-size: 13px; margin: 10px 0; }
.note-author-label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.05em; }
.select-author { margin-bottom: 12px; cursor: pointer; }
.note-actions-row { display: flex; gap: 10px; margin-bottom: 0; }
.input-flex { margin-bottom: 0; flex: 1; }
.btn-note-add { width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface2); border-radius: var(--radius-sm); }

.updates-box { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface2); max-height: 200px; overflow-y: auto; padding: 4px 14px; }
.updates-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.updates-row:last-child { border-bottom: none; }
.updates-id { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.updates-row-actions { display: flex; gap: 8px; align-items: center; }
.btn-sm-accent { padding: 6px 12px; font-size: 11px; background: var(--accent); color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; transition: background 0.15s; }
.btn-sm-accent:hover { background: var(--accent-hover); }
.btn-sm-muted { padding: 6px 12px; font-size: 11px; font-weight: 600; background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: all 0.15s ease; }
.btn-sm-muted:hover { color: var(--text); background: var(--surface2); border-color: var(--muted); }

.updates-ignored-details summary { cursor: pointer; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 14px; background: var(--surface2); border: 1px dashed var(--border); border-radius: var(--radius-sm); list-style: none; transition: all 0.15s ease; text-align: center; }
.updates-ignored-details summary:hover { color: var(--accent); background: var(--accent-bg); border-color: var(--accent); }
.updates-ignored-ul { margin: 12px 0 0 0; padding-left: 20px; font-size: 13px; }
.ignored-row { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ignored-id { font-family: var(--mono); font-size: 11px; word-break: break-all; }

.badge--mt { margin-top: 6px; font-weight: 600; }
.badge--mt4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.fw6-muted { color: var(--muted); font-weight: 600; }
.fw6-warn { color: var(--warn); font-weight: 600; }
.fw6-ok { color: var(--ok); font-weight: 600; }
.text-muted-sm { color: var(--muted); font-weight: 500; font-size: 12px; }
.security-detail { margin: 8px 0 0 0; font-size: 12px; color: var(--warn); line-height: 1.35; }
.disk-secondary { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }

.rustdesk-hint { margin: 0 0 14px 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.rustdesk-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: stretch; }
.rustdesk-input { margin-bottom: 0; flex: 1; font-family: var(--mono); }
.btn-rustdesk-copy { width: 44px; min-height: 44px; flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface2); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s ease; }
.btn-rustdesk-copy:hover { color: var(--accent); background: var(--accent-bg); border-color: rgba(109, 40, 217, 0.3); }
.btn-rustdesk-save { padding: 0 18px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; white-space: nowrap; font-size: 13px; transition: all 0.15s ease; }
.btn-rustdesk-save:hover { background: var(--accent-bg); border-color: rgba(109, 40, 217, 0.3); color: var(--accent); }

#login-screen { position: fixed; inset: 0; background: var(--bg); background-image: var(--bg-mesh); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
.login-card { background: var(--surface); padding: 40px 36px; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; text-align: center; border: 1px solid var(--border); position: relative; overflow: hidden; }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--accent), #a78bfa); }
.login-brand { display: flex; justify-content: center; margin-bottom: 24px; height: 64px; align-items: center; }
.login-brand .brand-fallback { width: 64px; height: 64px; border-radius: 14px; font-size: 24px; }
.login-card h2 { color: var(--text); margin: 0 0 8px 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.login-sub { margin: 0 0 24px 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
#login-error { display: none; color: var(--error); font-size: 13px; margin-bottom: 16px; text-align: left; padding: 12px; background: var(--error-bg); border-radius: var(--radius-sm); border: 1px solid rgba(220, 38, 38, 0.15); line-height: 1.4; }

.btn-block { display: block; width: 100%; text-align: center; text-decoration: none; padding: 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; transition: all 0.2s ease; }
.btn-block-accent { background: linear-gradient(180deg, #7c3aed 0%, var(--accent) 100%); color: white; box-shadow: 0 4px 14px rgba(109, 40, 217, 0.25); }
.btn-block-accent:hover { filter: brightness(1.08); transform: translateY(-1px); }

#toast-host { position: fixed; bottom: 24px; right: 24px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; padding: 14px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text); animation: toast-in 0.25s cubic-bezier(0, 0, 0.2, 1); }
.toast.toast-ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(34, 197, 94, 0.2); }
.toast.toast-err { background: var(--error-bg); color: var(--error); border-color: rgba(220, 38, 38, 0.15); }
.toast.toast-warn { background: var(--warn-bg); color: var(--warn); border-color: rgba(251, 146, 60, 0.2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.skeleton-row td { pointer-events: none; }
.skeleton-bar { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface2) 0%, var(--border) 45%, var(--surface2) 90%); background-size: 220% 100%; animation: sk-shimmer 1.3s ease-in-out infinite; }
.skeleton-bar.short { width: 35%; }
.skeleton-bar.med { width: 60%; }
@keyframes sk-shimmer { 0% { background-position: 120% 0; } 100% { background-position: -20% 0; } }

.audit-list { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.audit-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.audit-list li:last-child { border-bottom: none; }
.audit-list time { display: block; font-size: 11px; font-weight: 600; color: var(--muted); font-family: var(--mono); margin-bottom: 4px; }
.audit-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

@media (max-width: 768px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; flex-direction: row; padding: 10px 16px; border-right: none; border-bottom: 1px solid var(--border); height: auto; justify-content: space-between; gap: 8px; }
    .sidebar-logo-wrap { margin-bottom: 0; }
    .sidebar-spacer { display: none; }
    .sidebar-footer { flex-direction: row; width: auto; border-top: none; padding-top: 0; gap: 12px; }
    .sidebar-label { display: none; }
    .sidebar-tool + .sidebar-tool { margin-top: 0; }
    .main { flex: 1; }
    #network-view { flex: 1; }
    .topbar { padding: 10px 16px; }
    .btn-logout-text { display: none; }
    .last-refresh { display: none; }
    .modal-grid-info { grid-template-columns: 1fr; }
}

@media print {
    body { background: #fff !important; background-image: none !important; overflow: visible !important; height: auto !important; display: block !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sidebar, .status-panel, #toast-host, .btn-icon-toolbar, .btn-refresh, .btn-logout, .modal-bg, #login-screen { display: none !important; }
    .main { display: block !important; width: 100% !important; }
    .topbar { border-bottom: 2px solid #222 !important; box-shadow: none !important; }
    .topbar-right, .topbar-status { display: none !important; }
    .content { padding: 0 !important; overflow: visible !important; }
    .panel { box-shadow: none !important; border: 1px solid #888 !important; page-break-inside: avoid; }
    th { background: #f0f0f0 !important; color: #000 !important; position: static !important; }
    .print-only { display: block !important; font-size: 12px; color: #333; margin-bottom: 14px; }

    body.print-audit-history > * { display: none !important; }
    body.print-audit-history #audit-modal-bg { display: flex !important; position: static !important; background: transparent !important; backdrop-filter: none !important; padding: 0 !important; opacity: 1 !important; visibility: visible !important; }
    body.print-audit-history #audit-modal-body-wrap { display: block !important; width: 100% !important; max-height: none !important; box-shadow: none !important; border: none !important; }
    body.print-audit-history #audit-modal-body { overflow: visible !important; max-height: none !important; padding: 0 !important; }
    body.print-audit-history #audit-modal-bg .modal-head { background: transparent !important; border-bottom: 2px solid #000 !important; padding: 0 0 8px 0 !important; margin-bottom: 16px !important; }
    body.print-audit-history #audit-modal-bg .modal-head-actions { display: none !important; }
    body.print-audit-history #audit-print-stand { display: block !important; font-size: 12px; margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* === v2: Health-Score Ring === */
.health-ring {
    width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; font-family: var(--mono); position: relative;
    background: var(--surface2); border: 1px solid var(--border);
}
.health-ring::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: conic-gradient(var(--ring-color, var(--ok)) calc(var(--ring-pct, 0) * 1%), var(--surface2) 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
}
.health-ring[data-score-color="green"] { --ring-color: var(--ok); }
.health-ring[data-score-color="yellow"] { --ring-color: var(--warn); }
.health-ring[data-score-color="red"] { --ring-color: var(--error); }
td.col-health { text-align: center; }

/* === v2: Tabs === */
.modal-tabs {
    display: flex; gap: 0; border-bottom: 1px solid var(--border); background: var(--surface2);
    padding: 0 24px; position: relative; overflow-x: auto;
}
.modal-tab-btn {
    padding: 14px 20px; font-size: 13px; font-weight: 600; color: var(--muted);
    background: none; border: none; cursor: pointer; position: relative;
    transition: color 0.2s ease; white-space: nowrap;
}
.modal-tab-btn:hover { color: var(--text); }
.modal-tab-btn.active { color: var(--accent); }
.modal-tab-btn.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px;
    background: var(--accent); border-radius: 3px 3px 0 0;
    animation: tab-slide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes tab-slide { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* === v2: Monitoring Tab Components === */
.metric-bar-group { margin-bottom: 16px; }
.metric-bar-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; margin-bottom: 6px; display: flex; justify-content: space-between; }
.metric-bar-label .metric-value { font-family: var(--mono); color: var(--text); font-size: 13px; }
.metric-bar { height: 8px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--border); overflow: hidden; }
.metric-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.metric-bar-fill.bar-green { background: var(--ok); }
.metric-bar-fill.bar-yellow { background: var(--warn); }
.metric-bar-fill.bar-red { background: var(--error); }

.services-list { list-style: none; padding: 0; margin: 0; }
.services-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.services-list li:last-child { border-bottom: none; }
.svc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.svc-dot.svc-ok { background: var(--ok); }
.svc-dot.svc-stopped { background: var(--error); }

.metric-inline { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.metric-inline:last-child { border-bottom: none; }
.metric-inline-label { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 130px; }
.metric-inline-value { font-family: var(--mono); font-size: 13px; font-weight: 600; }

.eventlog-list { margin: 0; padding: 0; list-style: none; max-height: 200px; overflow-y: auto; }
.eventlog-item { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.eventlog-item:last-child { border-bottom: none; }
.eventlog-time { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.eventlog-source { font-weight: 700; color: var(--text); margin: 2px 0; }
.eventlog-msg { color: var(--muted); line-height: 1.4; word-break: break-word; }

.hotfix-list { margin: 0; padding: 0; list-style: none; }
.hotfix-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.hotfix-item:last-child { border-bottom: none; }
.hotfix-kb { font-family: var(--mono); font-weight: 600; }
.hotfix-date { color: var(--muted); font-family: var(--mono); font-size: 12px; }

.client-version-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); margin-top: 12px; }

/* === v2: Stat pill - Kritisch === */
.stat-critical .stat-n { color: var(--error); }

/* === v2: Design Polish === */

/* Pulsating online dot */
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}
.b-ok .dot { animation: pulse-dot 2.5s ease-in-out infinite; }

/* Status accent line on rows */
tr.pc-row[data-status="online"] td:first-child { border-left: 4px solid var(--ok); }
tr.pc-row[data-status="standby"] td:first-child { border-left: 4px solid var(--warn); }
tr.pc-row[data-status="offline"] td:first-child { border-left: 4px solid var(--error); }

/* Glassmorphism sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
}
html.theme-dark .sidebar {
    background: rgba(21, 27, 38, 0.7);
}

/* Hover lift */
tbody tr.pc-row {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.15s ease;
}
tbody tr.pc-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
html.theme-dark tbody tr.pc-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Gradient topbar */
.topbar {
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface2) 100%);
}

/* Smoother modal transition */
.modal {
    transform: translateY(24px) scale(0.96);
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-bg.open .modal {
    transform: none;
}

/* Typography improvements */
.topbar-title { font-size: 18px; letter-spacing: 0.06em; }
th { font-size: 12px; }
.content { padding: 28px; }
.modal-body-inner { padding: 28px; }

/* Stat pills with icon space */
.stat-pill i { font-size: 10px; opacity: 0.8; }

/* Empty state illustration */
.empty-illustration { width: 80px; height: 80px; margin-bottom: 16px; opacity: 0.6; }
.table-empty { display: flex; flex-direction: column; align-items: center; }

/* sec-bitlocker-line */
.sec-bitlocker-line { margin: 6px 0 0 0; font-size: 12px; color: var(--muted); line-height: 1.35; }

/* Monitoring section spacing */
/* === Network Legend === */
.net-legend {
    display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 20px;
    background: var(--surface); border-top: 1px solid var(--border);
    font-size: 11px; font-weight: 600; color: var(--muted);
}
.net-legend span { display: inline-flex; align-items: center; gap: 5px; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.leg-box { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }

.monitoring-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.monitoring-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.monitoring-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; margin-bottom: 10px; }
