:root {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --ink: #172033;
    --muted: #68748a;
    --line: #e2e8f0;
    --primary: #1264e5;
    --primary-dark: #0b49aa;
    --sidebar: #101a2e;
    --success: #087d55;
    --success-bg: #e8f7f0;
    --danger: #b63545;
    --danger-bg: #fff0f1;
    --warning: #875a08;
    --warning-bg: #fff7df;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(22, 36, 61, .06);
}
* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
body { margin: 0; min-height: 100vh; font-size: 14px; line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -.7px; }
h2 { margin-bottom: 5px; font-size: 18px; line-height: 1.3; }
h3 { font-size: 15px; }
p { color: var(--muted); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; width: 252px; padding: 26px 18px 20px; flex-direction: column; color: #dbe5f6; background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark { display: inline-flex; width: 47px; height: 42px; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 11px; color: #fff; background: var(--primary); font-size: 13px; font-weight: 850; letter-spacing: .5px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 1px; color: #8fa0ba; font-size: 11px; }
.sidebar > .brand { padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.08); }
.main-nav { display: grid; gap: 5px; margin-top: 26px; }
.main-nav a { padding: 11px 13px; border-radius: 9px; color: #aebbd0; font-weight: 550; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.main-nav a.active { color: #fff; background: rgba(40, 118, 232, .23); box-shadow: inset 3px 0 #4d93f5; }
.sidebar-footer { display: flex; margin-top: auto; padding: 20px 9px 0; flex-direction: column; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer strong { margin-top: 10px; font-size: 13px; }
.sidebar-footer small { overflow: hidden; margin-bottom: 12px; color: #8fa0ba; font-size: 11px; text-overflow: ellipsis; }
.sidebar-footer a, .link-button { padding: 3px 0; color: #b8c7dd; background: none; border: 0; text-align: left; font-size: 12px; cursor: pointer; }
.sidebar-footer a:hover, .link-button:hover { color: #fff; }
.role-badge { align-self: flex-start; padding: 3px 8px; border: 1px solid rgba(255,255,255,.14); border-radius: 5px; color: #afc7eb; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
.main-content { max-width: 1640px; min-height: 100vh; margin-left: 252px; padding: 42px 42px 60px; }
.mobile-header, .mobile-nav { display: none; }
.page-header { display: flex; margin-bottom: 28px; align-items: center; justify-content: space-between; gap: 24px; }
.page-header p { margin-bottom: 0; }
.eyebrow { margin-bottom: 8px; color: var(--primary); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 1.3px; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.button { display: inline-flex; min-height: 40px; padding: 9px 16px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; font-weight: 650; font-size: 13px; line-height: 1.3; cursor: pointer; white-space: nowrap; }
.button.primary { color: #fff; background: var(--primary); border-color: var(--primary); box-shadow: 0 4px 12px rgba(18,100,229,.16); }
.button.primary:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
.button.secondary { color: var(--primary); background: #edf4ff; border-color: #d9e8ff; }
.button.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.full { width: 100%; min-height: 46px; }
.panel { margin-bottom: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { display: flex; padding: 22px 24px; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header p { margin-bottom: 0; }
.panel-header p { font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 28px; }
.metric-card { display: flex; min-height: 154px; padding: 22px; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric-card > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-card > strong { margin: 10px 0 7px; font-size: 32px; line-height: 1; }
.metric-card > strong.metric-text { font-size: 25px; }
.metric-card > small { margin-top: auto; color: #8a95a8; font-size: 11px; }
.metric-dot::before { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; content: ""; }
.online-dot::before { background: var(--success); }
.offline-dot::before { background: var(--danger); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 12px 16px; color: #758198; background: #f9fbfd; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .65px; white-space: nowrap; }
td { padding: 15px 16px; border-bottom: 1px solid #edf1f5; color: #354057; font-size: 12px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
td strong { color: var(--ink); font-weight: 650; }
.cell-secondary { display: block; margin-top: 3px; color: #8994a7; font-size: 10px; }
.table-action { color: var(--primary); font-size: 12px; font-weight: 650; white-space: nowrap; }
.empty-state { padding: 44px 20px; color: var(--muted); text-align: center; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; letter-spacing: -.2px; }
.break-text { overflow-wrap: anywhere; }
.wide-cell { min-width: 260px; }
.muted { color: var(--muted); }
.status { display: inline-flex; padding: 4px 8px; align-items: center; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status::before { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; content: ""; }
.status.online { color: var(--success); background: var(--success-bg); }
.status.online::before { background: var(--success); }
.status.offline { color: var(--danger); background: var(--danger-bg); }
.status.offline::before { background: var(--danger); }
.status.unknown { color: #6d7480; background: #eff1f4; }
.status.unknown::before { background: #959ca7; }
.filters { display: flex; padding: 20px 22px; align-items: end; gap: 12px; border-bottom: 1px solid var(--line); }
.filters label { display: block; margin-bottom: 5px; color: #5c687c; font-size: 11px; font-weight: 650; }
.filter-search { flex: 1; }
.form-control { width: 100%; min-height: 41px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #ccd5e1; border-radius: 8px; outline: none; transition: border-color .15s, box-shadow .15s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,100,229,.11); }
textarea.form-control { resize: vertical; }
select.form-control { min-width: 145px; }
.form-group { margin-bottom: 18px; }
.form-group > label { display: block; margin-bottom: 6px; color: #48546a; font-size: 12px; font-weight: 650; }
.help-text { display: block; margin-top: 6px; color: #7e899c; font-size: 11px; }
.field-error, .errorlist { color: var(--danger); }
.errorlist { margin: 5px 0 0; padding-left: 18px; font-size: 12px; }
.form-errors { margin-bottom: 20px; }
.form-errors .errorlist { padding: 12px 14px 12px 30px; border-radius: 8px; background: var(--danger-bg); }
.checkbox-group label { display: flex; align-items: center; gap: 9px; }
.checkbox-group input { width: 17px; height: 17px; }
.stack-form { display: flex; flex-direction: column; }
.form-actions { display: flex; margin-top: 8px; gap: 10px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.form-panel { padding: 26px; }
.form-panel.narrow { max-width: 650px; }
.info-card { padding: 24px; border: 1px solid #d8e5f7; border-radius: var(--radius); background: #edf4fc; }
.info-card h2 { margin-bottom: 14px; }
.info-card p { color: #5e6f86; font-size: 12px; }
.info-card p:last-child { margin-bottom: 0; }
.info-card a { font-size: 12px; font-weight: 650; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-panel { margin-bottom: 0; }
.data-list { margin: 0; padding: 8px 24px 18px; }
.data-list > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid #edf1f5; }
.data-list > div:last-child { border-bottom: 0; }
.data-list dt { color: var(--muted); font-size: 12px; }
.data-list dd { margin: 0; color: var(--ink); font-size: 12px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.data-list.compact { padding: 0; }
.data-list.compact > div { padding: 8px 0; grid-template-columns: 1fr 1fr; }
.contract-box { margin: 6px 24px 22px; padding: 17px; border-radius: 10px; background: #f3f7fd; }
.contract-box h3 { margin-bottom: 8px; color: var(--primary-dark); }
.secondary-contract { background: #f6f3fc; }
.secondary-contract h3 { color: #604894; }
.timeline { padding: 10px 24px 20px; }
.timeline-item { padding: 16px 0 16px 20px; border-left: 2px solid #dbe6f5; }
.timeline-item > div { display: flex; justify-content: space-between; gap: 15px; }
.timeline-item span, .timeline-item small { color: var(--muted); font-size: 11px; }
.timeline-item p { margin: 7px 0 3px; color: #46536a; font-size: 12px; }
.timeline-item small { display: block; }
.integration-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; margin-bottom: 24px; }
.integration-grid .detail-panel { padding-bottom: 18px; }
.integration-grid .alert { margin: 0 24px 16px; }
.integration-grid > .panel > .help-text { margin: 0 24px; }
.messages { margin-bottom: 22px; }
.alert { padding: 13px 16px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; }
.alert-success { color: var(--success); background: var(--success-bg); border-color: #ccebdd; }
.alert-error { color: var(--danger); background: var(--danger-bg); border-color: #f4d4d8; }
.alert-warning, .alert-info { color: var(--warning); background: var(--warning-bg); border-color: #f1e2b9; }
.pagination { display: flex; padding: 18px 22px; align-items: center; justify-content: flex-end; gap: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination a { font-weight: 650; }
.result-card { max-width: 650px; padding: 32px; }
.guest-page { background: #fff; }
.guest-content { min-height: 100vh; }
.guest-content > .messages { position: fixed; top: 20px; right: 20px; z-index: 5; max-width: 420px; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); }
.login-intro { display: flex; padding: 50px clamp(40px, 7vw, 100px); flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 70% 30%, #1a4577 0, transparent 45%), linear-gradient(140deg, #101a2e, #142b49); }
.login-intro > div { max-width: 560px; }
.login-intro h1 { margin-bottom: 22px; font-size: clamp(36px, 5vw, 58px); letter-spacing: -1.8px; }
.login-intro p:not(.eyebrow) { max-width: 490px; color: #b6c6db; font-size: 16px; }
.login-intro > small { color: #7f94b0; }
.login-intro .brand small { color: #94a9c3; }
.login-card { display: flex; width: 100%; max-width: 470px; margin: auto; padding: 45px; flex-direction: column; justify-content: center; gap: 30px; }
.login-card h2 { margin-bottom: 8px; font-size: 29px; }
.login-card .muted { font-size: 13px; }
.login-security { color: #8a94a5; font-size: 10px; text-align: center; }
@media (max-width: 1150px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-panel { margin-bottom: 0; }
}
@media (max-width: 850px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 24px 20px 40px; }
    .mobile-header { display: block; margin-bottom: 14px; }
    .mobile-header .brand { color: var(--ink); }
    .mobile-nav { display: flex; margin: 0 -20px 26px; padding: 0 20px 12px; gap: 18px; overflow-x: auto; border-bottom: 1px solid var(--line); }
    .mobile-nav a, .mobile-nav button { padding: 0; color: var(--muted); background: none; border: 0; font-size: 12px; white-space: nowrap; cursor: pointer; }
    .mobile-nav form { margin-left: auto; }
    .form-layout, .integration-grid { grid-template-columns: 1fr; }
    .info-card { order: -1; }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { min-height: 250px; padding: 30px; gap: 50px; }
    .login-intro h1 { font-size: 36px; }
    .login-intro > small { display: none; }
    .login-card { padding: 40px 30px; }
}
@media (max-width: 600px) {
    .page-header { align-items: flex-start; flex-direction: column; gap: 16px; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .metric-card { min-height: 135px; padding: 16px; }
    .metric-card > strong { font-size: 27px; }
    .filters { align-items: stretch; flex-direction: column; }
    .filters .button { width: 100%; }
    .panel-header { padding: 18px; align-items: flex-start; }
    .panel-header .button { padding: 8px; }
    .data-list { padding: 8px 18px 18px; }
    .data-list > div { grid-template-columns: 115px minmax(0, 1fr); }
    .contract-box { margin: 6px 18px 18px; }
    .form-panel { padding: 20px; }
    .timeline-item > div { flex-direction: column; gap: 3px; }
    .login-intro { min-height: 210px; padding: 25px; gap: 35px; }
    .login-intro > div p:not(.eyebrow) { display: none; }
    .login-intro h1 { margin: 0; font-size: 31px; }
    .login-card { padding: 35px 24px; }
}

.selection-input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.selection-footer { display: flex; padding: 18px 22px; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.search-message { margin: 20px 22px 0; }
.search-intro { padding: 42px 24px; }
@media (max-width: 600px) { .selection-footer { align-items: stretch; flex-direction: column; } }
