:root {
    --bg-body: #0c1222;
    --bg-sidebar: #121a2e;
    --bg-main: #0f1629;
    --bg-card: #151d35;
    --bg-card-hover: #1a2440;
    --bg-input: #111a2f;
    --bg-header: #121a2e;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --accent: #00e5ff;
    --accent-dim: rgba(0,229,255,0.12);
    --violet: #7c4dff;
    --violet-dim: rgba(124,77,255,0.12);
    --green: #00e676;
    --green-dim: rgba(0,230,118,0.1);
    --yellow: #ffab00;
    --yellow-dim: rgba(255,171,0,0.1);
    --red: #ff5252;
    --red-dim: rgba(255,82,82,0.1);
    --blue: #448aff;
    --blue-dim: rgba(68,138,255,0.1);
    --gray: #64748b;
    --text: #e2e8f0;
    --text-secondary: #8892a8;
    --text-muted: #4a5568;
    --font: 'Inter', -apple-system, system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--bg-body); color: var(--text); overflow: hidden; height: 100vh; -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::selection { background: var(--accent-dim); }
a { color: var(--accent); text-decoration: none; }

/* Layout */
#app { display: flex; height: 100vh; }
.sidebar { width: 220px; min-width: 220px; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 100; position: relative; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.sidebar-brand svg { width: 26px; height: 26px; color: var(--accent); }
.sidebar-brand span { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-brand .accent { color: var(--accent); }
.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; position: relative; text-decoration: none; }
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: var(--violet-dim); color: var(--violet); }
.nav-item.active::before { content:''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; background: var(--violet); border-radius: 0 3px 3px 0; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 14px; }
.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; position: relative; z-index: 1; }
.header { height: 52px; background: var(--bg-header); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; }
.header-search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px; max-width: 400px; }
.header-search input { background: none; border: none; color: var(--text); font-family: var(--font); font-size: 13px; flex: 1; outline: none; }
.header-search input::placeholder { color: var(--text-muted); }
.header-search svg { width: 16px; height: 16px; color: var(--text-muted); }
.header-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.header-status { display: flex; align-items: center; gap: 6px; background: var(--green-dim); padding: 5px 12px; border-radius: 20px; font-size: 12px; color: var(--green); font-weight: 600; }
.header-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.header-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: var(--radius-sm); }
.header-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.header-btn svg { width: 18px; height: 18px; }
.header-user { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.header-user .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--violet); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; }
.header-user .name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.header-user .role { font-size: 11px; color: var(--text-muted); }

/* Content */
.content { flex: 1; overflow-y: auto; padding: 24px; background: var(--bg-main); }
.page-title { font-size: 22px; font-weight: 700; color: #fff; font-family: var(--mono); letter-spacing: -0.5px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.page-header-right { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Stat Cards Row */
.stats-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 14px; transition: all 0.15s; }
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-1px); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: var(--blue-dim); color: var(--blue); }
.stat-icon.green { background: var(--green-dim); color: var(--green); }
.stat-icon.gray { background: rgba(100,116,139,0.1); color: var(--gray); }
.stat-icon.yellow { background: var(--yellow-dim); color: var(--yellow); }
.stat-icon.red { background: var(--red-dim); color: var(--red); }
.stat-icon.violet { background: var(--violet-dim); color: var(--violet); }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-top: 2px; }

/* Secondary stats row */
.stats-row-2 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat2-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.stat2-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat2-icon svg { width: 18px; height: 18px; }
.stat2-value { font-size: 22px; font-weight: 700; }
.stat2-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Cards Grid */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.cards-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 16px; }

/* Progress bars */
.metric-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.metric-row:last-child { margin-bottom: 0; }
.metric-label { font-size: 13px; color: var(--text-secondary); min-width: 100px; }
.metric-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.04); border-radius: 4px; overflow: hidden; }
.metric-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.metric-fill.green { background: linear-gradient(90deg, #00c853, #00e676); }
.metric-fill.yellow { background: linear-gradient(90deg, #ff8f00, #ffab00); }
.metric-fill.red { background: linear-gradient(90deg, #d50000, #ff5252); }
.metric-fill.blue { background: linear-gradient(90deg, #2962ff, #448aff); }
.metric-fill.cyan { background: linear-gradient(90deg, #00b8d4, #00e5ff); }
.metric-val { font-size: 13px; font-weight: 600; min-width: 45px; text-align: right; font-family: var(--mono); }
.metric-info { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.metric-info:last-child { border-bottom: none; }

/* Security status */
.security-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.security-item:last-child { border-bottom: none; }
.security-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.security-icon.ok { background: var(--green-dim); color: var(--green); }
.security-icon.warn { background: var(--yellow-dim); color: var(--yellow); }
.security-icon.bad { background: var(--red-dim); color: var(--red); }
.security-icon svg { width: 14px; height: 14px; }
.security-label { flex: 1; font-size: 13px; }
.security-value { font-size: 13px; font-weight: 600; font-family: var(--mono); }

/* OS Distribution */
.os-item { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.os-item:last-child { border-bottom: none; }
.os-name { color: var(--text-secondary); }
.os-count { font-weight: 600; color: var(--accent); font-family: var(--mono); }

/* Customer health */
.customer-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.customer-item:last-child { border-bottom: none; }
.customer-name { flex: 1; font-size: 13px; font-weight: 500; }
.customer-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.customer-badge.red { background: var(--red-dim); color: var(--red); }
.customer-badge.yellow { background: var(--yellow-dim); color: var(--yellow); }
.customer-badge.green { background: var(--green-dim); color: var(--green); }
.customer-bar { width: 100px; height: 6px; background: rgba(255,255,255,0.04); border-radius: 3px; overflow: hidden; }
.customer-bar-fill { height: 100%; border-radius: 3px; background: var(--green); }
.customer-ratio { font-size: 12px; color: var(--text-muted); font-family: var(--mono); min-width: 30px; text-align: right; }

/* Alerts list */
.alert-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: none; }
.alert-severity { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.alert-severity.critical { background: var(--red-dim); color: var(--red); }
.alert-severity.warning { background: var(--yellow-dim); color: var(--yellow); }
.alert-severity.info { background: var(--blue-dim); color: var(--blue); }
.alert-text { flex: 1; }
.alert-title { font-size: 13px; font-weight: 500; }
.alert-device { font-size: 11px; color: var(--text-muted); }
.alert-time { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }

/* Activity list */
.activity-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.activity-icon.green { background: var(--green); }
.activity-icon.blue { background: var(--blue); }
.activity-icon.red { background: var(--red); }
.activity-text { flex: 1; font-size: 13px; }
.activity-user { font-size: 11px; color: var(--text-muted); }
.activity-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.activity-badge.active { background: var(--green-dim); color: var(--green); }
.activity-badge.ended { background: rgba(255,255,255,0.04); color: var(--text-muted); }

/* Card header with link */
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-link { font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 500; }
.card-link:hover { text-decoration: underline; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-online { background: var(--green-dim); color: var(--green); }
.badge-offline { background: rgba(100,116,139,0.1); color: var(--gray); }
.badge-warning { background: var(--yellow-dim); color: var(--yellow); }
.badge-critical { background: var(--red-dim); color: var(--red); }
.badge-maintenance { background: var(--blue-dim); color: var(--blue); }

/* Table */
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
tbody td { padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; font-family: var(--font); cursor: pointer; border: none; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: var(--bg-body); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Input */
.input { background: var(--bg-input); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; font-family: var(--font); width: 100%; outline: none; }
.input:focus { border-color: var(--accent); }
.select { background: var(--bg-input); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100vh; background: var(--bg-body); }
.login-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 44px; width: 400px; max-width: 92vw; box-shadow: var(--shadow); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo svg { width: 40px; height: 40px; color: var(--accent); margin-bottom: 12px; }
.login-logo h1 { font-size: 22px; font-weight: 700; }
.login-logo h1 .accent { color: var(--accent); }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.login-error { color: var(--red); font-size: 13px; margin-bottom: 12px; display: none; text-align: center; }
.login-btn { width: 100%; padding: 10px; font-size: 14px; font-weight: 600; }

/* Toast */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow); min-width: 280px; animation: slideIn 0.3s ease; }
.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--yellow); }
@keyframes slideIn { from { opacity:0; transform: translateX(30px); } to { opacity:1; transform: none; } }

/* Responsive */
@media (max-width: 1200px) { .stats-row { grid-template-columns: repeat(3, 1fr); } .cards-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) { .sidebar { display: none; } .stats-row { grid-template-columns: repeat(2, 1fr); } .stats-row-2 { grid-template-columns: repeat(2, 1fr); } .cards-grid { grid-template-columns: 1fr; } .cards-grid-2 { grid-template-columns: 1fr; } }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; cursor: pointer; }
.toggle-track { width: 36px; height: 20px; border-radius: 10px; background: rgba(255,255,255,0.08); position: relative; transition: background 0.2s; }
.toggle-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: all 0.2s; }
.toggle.on .toggle-track { background: var(--green-dim); }
.toggle.on .toggle-track::after { left: 18px; background: var(--green); }

/* Role cards */
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.role-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; align-items: center; gap: 14px; }
.role-card-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.role-card-icon svg { width: 20px; height: 20px; }
.role-card-icon.admin { background: var(--violet-dim); color: var(--violet); }
.role-card-icon.tech { background: var(--blue-dim); color: var(--blue); }
.role-card-icon.readonly { background: rgba(100,116,139,0.12); color: var(--gray); }
.role-card-value { font-size: 24px; font-weight: 800; line-height: 1; }
.role-card-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; margin-top: 2px; }

/* Customer cards */
.customer-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.customer-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.customer-card-name { font-size: 15px; font-weight: 600; }
.customer-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.customer-card-stats { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); }
.customer-card-stats strong { color: var(--accent); font-family: var(--mono); }
.site-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px; align-items: center; padding: 12px 20px 12px 36px; border-bottom: 1px solid var(--border); font-size: 13px; }
.site-row:last-child { border-bottom: none; }
.site-row:hover { background: rgba(255,255,255,0.02); }
.site-name { font-weight: 500; }
.site-location { color: var(--text-muted); font-size: 12px; }

/* Release cards */
.release-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.release-card:hover { border-color: var(--border-hover); }
.release-version { font-size: 16px; font-weight: 700; font-family: var(--mono); }
.release-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.release-badges { display: flex; gap: 6px; align-items: center; }

/* Token cards */
.token-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; }
.token-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.token-name { font-weight: 600; font-size: 14px; }
.token-prefix { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-top: 4px; }
.token-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* Settings form */
.settings-section { margin-bottom: 24px; }
.settings-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 14px; }
.settings-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row-label { font-size: 13px; }
.settings-row-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.settings-form-row { margin-bottom: 14px; }
.settings-form-row label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { padding: 10px 0; }
.info-item-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.info-item-value { font-size: 14px; font-weight: 600; margin-top: 4px; font-family: var(--mono); }

/* Search bar */
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; margin-bottom: 16px; max-width: 400px; }
.search-bar svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input { background: none; border: none; color: var(--text); font-family: var(--font); font-size: 13px; flex: 1; outline: none; }

/* Policy list */
.policy-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.policy-item:last-child { border-bottom: none; }
.policy-name { font-size: 13px; font-weight: 500; }
.policy-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Action icons in table */
.action-btns { display: flex; gap: 6px; }
.action-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; }
.action-btn:hover { color: var(--accent); background: rgba(255,255,255,0.04); }
.action-btn svg { width: 16px; height: 16px; display: block; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 13px; }

/* Page toolbar */
.page-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.page-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; width: 440px; max-width: 95vw; box-shadow: var(--shadow); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; max-height: 60vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.secret-box { display: flex; gap: 8px; align-items: stretch; }
.secret-input { flex: 1; font-family: var(--mono); font-size: 12px; user-select: all; cursor: text; }

/* Remote tools */
.remote-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; flex-wrap: wrap; }
.remote-select { min-width: 220px; flex: 1; max-width: 320px; }
.remote-viewport { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); min-height: calc(100vh - 220px); overflow: hidden; display: flex; flex-direction: column; }
.remote-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; color: var(--text-muted); }
.remote-empty svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.35; }
.remote-empty h3 { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.remote-empty p { font-size: 13px; max-width: 360px; }
.remote-session-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-input); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.remote-viewport-inner { display: flex; flex-direction: column; height: 100%; min-height: 420px; }
.rdp-canvas { flex: 1; display: flex; align-items: center; justify-content: center; background: #0a0a12; min-height: 400px; overflow: auto; padding: 8px; }
.rdp-canvas canvas { max-width: 100%; max-height: calc(100vh - 220px); width: auto; height: auto; cursor: crosshair; display: block; }
.rdp-canvas:fullscreen canvas { max-width: 100vw; max-height: 100vh; }
.remote-secure { font-size: 11px; color: var(--green); font-weight: 600; white-space: nowrap; }
.remote-mode-badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: rgba(0,229,255,0.12); color: var(--cyan); }
.remote-resolution { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.remote-banner { padding: 8px 14px; font-size: 12px; text-align: center; }
.remote-banner.view-only { background: rgba(255,171,0,0.12); color: var(--yellow); }
.remote-banner.clipboard-off { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.rdp-preconnect { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.rdp-session-bar { flex-wrap: wrap; }

.terminal-wrap { flex: 1; display: flex; flex-direction: column; min-height: calc(100vh - 220px); }
.terminal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--bg-input); border-bottom: 1px solid var(--border); }
.terminal-output { flex: 1; background: #0c0c0c; color: #ccc; font-family: var(--mono); font-size: 13px; padding: 14px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; min-height: 300px; }
.terminal-input-row { display: flex; background: #0c0c0c; border-top: 1px solid #333; }
.terminal-prompt { padding: 10px 4px 10px 14px; color: var(--accent); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.terminal-input { flex: 1; background: transparent; border: none; color: #ccc; font-family: var(--mono); font-size: 13px; padding: 10px 14px 10px 0; outline: none; }

.file-explorer { display: grid; grid-template-columns: 240px 1fr; flex: 1; min-height: calc(100vh - 220px); }
.file-sidebar { background: var(--bg-input); border-right: 1px solid var(--border); padding: 8px; overflow-y: auto; }
.file-main { display: flex; flex-direction: column; min-width: 0; }
.file-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--bg-input); border-bottom: 1px solid var(--border); }
.file-path { padding: 8px 14px; background: var(--bg-body); border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12px; color: var(--text-secondary); }
.file-list { flex: 1; overflow-y: auto; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 13px; transition: background 0.1s; }
.file-item:hover { background: rgba(255,255,255,0.03); }
.file-item.selected { background: rgba(0,229,255,0.08); border-left: 2px solid var(--accent); }
.file-name { flex: 1; }
.file-size { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.file-toolbar-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.file-transfer-bar { height: 28px; background: var(--bg-input); border-bottom: 1px solid var(--border); position: relative; display: flex; align-items: center; padding: 0 12px; font-size: 12px; color: var(--text-muted); }
.file-transfer-bar.hidden { display: none; }
.file-transfer-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,229,255,0.15); transition: width 0.2s; z-index: 0; }
.file-transfer-bar span { position: relative; z-index: 1; }
.rdp-session-bar { flex-wrap: wrap; }
.remote-tech { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.remote-timer { font-size: 12px; font-family: var(--mono); color: var(--text-muted); margin-left: auto; }
.remote-bar-actions { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.remote-banner.view-only { padding: 8px 14px; background: var(--yellow-dim); color: var(--yellow); font-size: 12px; text-align: center; }
.remote-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.select-sm { padding: 4px 8px; font-size: 12px; min-width: auto; }
.term-stderr { color: #f87171; }

/* Devices list */
.devices-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.devices-search { flex: 1; min-width: 220px; max-width: 420px; }
.devices-table-card { padding: 0; overflow: hidden; }
.devices-table tbody tr:hover { background: rgba(0,229,255,0.03); }
.device-name-cell .device-hostname { font-weight: 700; font-size: 14px; }
.device-name-cell .device-model { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.customer-cell .cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.row-chevron { color: var(--text-muted); font-size: 18px; text-align: right; width: 32px; }
.mono { font-family: var(--mono); font-size: 12px; }
.text-muted { color: var(--text-muted); }
.empty-devices { text-align: center; padding: 40px; color: var(--text-muted); }

/* Status badges with dot */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-online { background: var(--green-dim); color: var(--green); }
.status-offline { background: rgba(100,116,139,0.12); color: var(--gray); }
.status-warning { background: var(--yellow-dim); color: var(--yellow); }
.status-critical { background: var(--red-dim); color: var(--red); }
.status-maintenance { background: var(--blue-dim); color: var(--blue); }

/* Resource bars in table */
.resource-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.resource-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.resource-fill { height: 100%; border-radius: 3px; }
.resource-fill.green { background: var(--green); }
.resource-fill.yellow { background: var(--yellow); }
.resource-fill.red { background: var(--red); }
.resource-pct { font-size: 12px; font-family: var(--mono); min-width: 34px; text-align: right; }

/* Device detail */
.device-detail-back { margin-bottom: 12px; }
.link-back { color: var(--accent); font-size: 13px; cursor: pointer; text-decoration: none; }
.device-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.device-detail-title { font-size: 28px; font-weight: 800; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.device-detail-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.device-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.device-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 18px; padding-bottom: 0; }
.device-tab { background: none; border: none; color: var(--text-muted); padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-family: var(--font); }
.device-tab:hover { color: var(--text); }
.device-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.device-overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { text-align: right; font-weight: 500; }
.security-status.ok { color: var(--green); }
.security-status.warn { color: var(--yellow); }
.security-status.bad { color: var(--red); }

.session-launcher { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); min-height: 420px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.session-launcher-inner { text-align: center; max-width: 420px; }
.session-launcher-icon { width: 72px; height: 72px; margin: 0 auto 20px; color: var(--violet); opacity: 0.9; }
.session-launcher h3 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.session-launcher p { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin-bottom: 24px; }
.session-launcher .btn-start { padding: 12px 28px; font-size: 15px; font-weight: 600; gap: 8px; }
.device-tab-content-viewport { min-height: 420px; }
@media (max-width: 768px) { .device-overview-grid { grid-template-columns: 1fr; } .devices-toolbar { flex-direction: column; } }
