:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --surface-soft: #f8faf9;
    --text: #17201d;
    --muted: #66736e;
    --line: #dfe7e3;
    --primary: #087f6d;
    --primary-dark: #056554;
    --ok: #16996f;
    --warning: #d58b16;
    --critical: #d34545;
    --suspended: #7c8792;
    --sidebar: #12231e;
    --shadow: 0 12px 36px rgba(24, 52, 44, .07);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; color: #e7f0ed; background: var(--sidebar); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 1px; color: #95aaa3; font-size: 11px; }
.brand-mark { width: 52px; height: 46px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; padding: 9px; border-radius: 13px; background: var(--primary); }
.brand-mark span { display: block; width: 7px; border-radius: 7px; background: #fff; }
.brand-mark span:nth-child(1) { height: 12px; opacity: .7; }
.brand-mark span:nth-child(2) { height: 23px; }
.brand-mark span:nth-child(3) { height: 17px; opacity: .84; }
.brand-mark.small { width: 38px; height: 38px; padding: 8px; gap: 3px; border-radius: 10px; }
.brand-mark.small span { width: 5px; }
.brand-mark.small span:nth-child(1) { height: 9px; }
.brand-mark.small span:nth-child(2) { height: 19px; }
.brand-mark.small span:nth-child(3) { height: 14px; }
.nav-list { display: grid; gap: 6px; margin-top: 42px; }
.nav-heading { margin: 0 13px 4px; color: #687f77; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-heading-spaced { margin-top: 20px; }
.nav-list a { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 13px; border-radius: 10px; color: #aebfba; font-weight: 600; transition: .18s ease; }
.nav-list a:hover, .nav-list a.active { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-list a.active { box-shadow: inset 3px 0 var(--primary); }
.nav-list span { width: 20px; text-align: center; color: #72c7b5; }
.sidebar-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.09); }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-chip > span { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; background: #27423a; color: #bce9dc; font-weight: 800; }
.user-chip div { min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: 12px; }
.user-chip small { color: #829991; font-size: 10px; }
.link-button { margin: 14px 0 0; padding: 0; color: #9eb0aa; background: none; border: 0; cursor: pointer; font-size: 12px; }
.link-button:hover { color: #fff; }

.main-area { min-width: 0; }
.content-area { width: min(1520px, 100%); margin: 0 auto; padding: 36px clamp(20px, 3vw, 52px) 64px; }
.mobile-header { display: none; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.heading-actions { display: flex; gap: 9px; }
.page-heading h1 { margin: 2px 0 5px; font-size: clamp(27px, 3vw, 38px); line-height: 1.15; letter-spacing: -.045em; }
.eyebrow { margin: 0 0 4px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.muted { margin: 0; color: var(--muted); }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.back-link:hover { color: var(--primary); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 750; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 16px rgba(8,127,109,.2); }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { border-color: #b8c8c2; }
.button-danger { color: #a12828; background: #fff; border-color: #e8bcbc; }
.button-danger:hover { color: #fff; background: var(--critical); border-color: var(--critical); }
.button-wide { width: 100%; }

.setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 18px 20px; border: 1px solid #bce1d7; border-radius: var(--radius); background: #ecf8f5; }
.setup-banner strong { font-size: 15px; }
.setup-banner p { margin: 3px 0 0; color: #4d6961; }
.setup-banner.danger { border-color: #f0c4c4; background: #fff0f0; }
.sync-strip { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 22px; padding: 15px 18px; border: 1px solid #a9d8cc; border-radius: 13px; background: #e9f7f3; }
.sync-strip.is-pending { border-color: #d9dfe3; background: #f4f6f7; }
.sync-strip.has-error { border-color: #edb7b7; background: #fdf0f0; }
.sync-strip-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--primary); font-size: 19px; font-weight: 850; }
.sync-strip strong { display: block; font-size: 13px; }
.sync-strip p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.sync-strip > a { color: var(--primary); font-size: 12px; font-weight: 800; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { min-width: 0; min-height: 105px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: flex; align-items: center; gap: 13px; }
.stat-card small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-card strong { display: block; margin-top: 4px; font-size: 28px; line-height: 1; letter-spacing: -.04em; }
.stat-card .textual-stat { font-size: 17px; letter-spacing: -.02em; }
.stat-dot { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: var(--suspended); box-shadow: 0 0 0 6px rgba(124,135,146,.1); }
.stat-dot.ok { background: var(--ok); box-shadow: 0 0 0 6px rgba(22,153,111,.1); }
.stat-dot.warning { background: var(--warning); box-shadow: 0 0 0 6px rgba(213,139,22,.1); }
.stat-dot.critical, .stat-dot.error, .stat-dot.down { background: var(--critical); box-shadow: 0 0 0 6px rgba(211,69,69,.1); }
.stat-dot.suspended, .stat-dot.neutral, .stat-dot.pending { background: var(--suspended); }

.panel { margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.counter-badge { min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 8px; border-radius: 14px; color: #fff; background: var(--critical); font-size: 12px; font-weight: 800; }
.filters { display: flex; align-items: center; gap: 9px; }
.filters select, .search-field input { height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); outline: none; }
.filters select { padding: 0 34px 0 11px; }
.search-field span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.search-field input { width: 220px; padding: 0 12px; }
.filters input:focus, .filters select:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(8,127,109,.1); }

.incident-list { display: grid; }
.incident-row { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 64px; padding: 10px 22px; border-bottom: 1px solid var(--line); }
.incident-row:last-child { border-bottom: 0; }
.incident-row:hover { background: var(--surface-soft); }
.incident-row strong, .incident-row small { display: block; }
.incident-row small { margin-top: 2px; color: var(--muted); }
.incident-row time { color: var(--muted); font-size: 11px; }
.severity-bar { height: 34px; border-radius: 3px; background: var(--warning); }
.severity-bar.critical { background: var(--critical); }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; min-width: 940px; border-collapse: collapse; }
.data-table.simple-table { min-width: 820px; }
.data-table.monitoring-table { min-width: 1220px; }
.data-table.sync-table { min-width: 760px; }
.data-table th { padding: 11px 14px; color: #718079; background: #f8faf9; font-size: 10px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-top: 1px solid var(--line); color: #3e4c47; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfc; }
.domain-cell { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.domain-cell strong, .domain-cell small { display: block; }
.domain-cell strong { color: var(--text); font-size: 13px; }
.domain-cell small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.favicon-placeholder { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: #e7f5f1; font-weight: 850; }
.table-secondary { font-size: 12px; }
.row-link { color: var(--primary); font-size: 12px; font-weight: 800; }
.ssl-value.due { color: var(--critical); font-weight: 700; }
.hosting-state { display: block; color: #58665f; font-size: 11px; font-weight: 800; }
.hosting-active { color: var(--ok); }
.hosting-suspended, .hosting-missing { color: var(--critical); }
.cell-note { display: block; max-width: 130px; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.disk-cell { min-width: 125px; }
.disk-cell > div { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.disk-cell span { color: var(--text); font-size: 11px; font-weight: 800; }
.disk-cell small { color: var(--muted); font-size: 8px; }
.disk-cell progress { width: 100%; height: 5px; margin-top: 5px; overflow: hidden; border: 0; border-radius: 6px; background: #e6ece9; accent-color: var(--ok); }
.disk-cell progress.warning { accent-color: var(--warning); }
.disk-cell progress.critical { accent-color: var(--critical); }
.status-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 0 9px; border-radius: 14px; color: #59655f; background: #edf0ef; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.status-ok { color: #087b58; background: #e5f6ef; }
.status-pill.status-warning { color: #a36503; background: #fff3dc; }
.status-pill.status-error, .status-pill.status-down { color: #b12c2c; background: #fdeaea; }
.status-pill.status-suspended, .status-pill.status-paused, .status-pill.status-pending { color: #66727d; background: #edf0f2; }
.table-empty { padding: 28px; color: var(--muted); text-align: center; }
.empty-list { padding: 52px 22px; color: var(--muted); text-align: center; }
.empty-list strong { display: block; color: var(--text); font-size: 16px; }
.empty-list p { margin: 5px 0 18px; }
.error-detail { max-width: 320px; color: var(--muted); font-size: 11px; }

.alert { margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 10px; }
.alert-success { color: #16634f; border-color: #a8dacb; background: #e9f8f3; }
.alert-error { color: #932d2d; border-color: #edb7b7; background: #fdf0f0; }
.settings-card { padding-bottom: 22px; }
.form-panel-narrow { max-width: 760px; }
.settings-form { padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label, .form-stack label { display: grid; gap: 7px; color: #43514c; font-size: 12px; font-weight: 750; }
.form-grid label small { color: var(--muted); font-weight: 500; }
.form-grid input, .form-stack input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #fff; outline: none; }
.form-grid .file-input { height: auto; min-height: 46px; padding: 10px 12px; }
.import-note { margin-top: 20px; padding: 17px 18px; border: 1px solid #cfe4dd; border-radius: 11px; background: #f0f8f5; }
.import-note strong { display: block; margin-bottom: 7px; font-size: 13px; }
.import-note p { margin: 5px 0; color: #536a63; font-size: 12px; }
.span-2 { grid-column: span 2; }
.check-field { display: flex; align-items: center; gap: 9px; margin: 18px 0 0; color: #40504a; font-weight: 650; }
.check-field input { width: 17px; height: 17px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.inline-test-form { margin: -64px 22px 0; width: max-content; }
.danger-zone { margin: 4px 22px 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.danger-zone strong { font-size: 12px; }
.danger-zone p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.info-card { max-width: 780px; padding: 20px 22px; border-left: 4px solid var(--primary); background: #eaf5f2; }
.info-card h2 { margin: 0 0 7px; font-size: 15px; }
.info-card p { margin: 0; color: #536a63; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 22px; align-items: start; }
.sync-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sync-card { padding: 23px; }
.sync-card h2 { margin: 10px 0 18px; font-size: 18px; }
.sync-status-row { display: flex; justify-content: flex-end; }
.details-list { margin: 0; }
.details-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.details-list dt { color: var(--muted); font-size: 11px; }
.details-list dd { margin: 0; font-size: 11px; font-weight: 750; text-align: right; }
.sync-guide ol { margin: 15px 0 18px; padding-left: 20px; }
.sync-guide li { margin: 9px 0; color: #485750; }
.sync-guide code { padding: 2px 5px; border-radius: 5px; background: #edf2f0; font-size: 11px; }
.alert-status-card { margin-bottom: 18px; padding: 21px 23px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; border: 1px solid #b9ddd4; border-radius: var(--radius); background: #eff9f6; box-shadow: var(--shadow); }
.alert-status-card.is-disabled { border-color: var(--line); background: var(--surface); }
.alert-status-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 13px; color: var(--primary); background: #daf1ea; font-size: 22px; }
.alert-status-card h2 { margin: 9px 0 2px; font-size: 18px; letter-spacing: -.025em; }
.alert-status-card p { margin: 0; color: var(--muted); font-size: 11px; }
.alert-status-card aside { padding-left: 28px; border-left: 1px solid #cfe4dd; text-align: right; }
.alert-status-card aside small, .alert-status-card aside strong, .alert-status-card aside span { display: block; }
.alert-status-card aside small { color: var(--muted); font-size: 9px; }
.alert-status-card aside strong { margin: 4px 0 2px; font-size: 14px; }
.alert-status-card aside span { color: #5f746d; font-size: 9px; }
.alert-stat-grid { grid-template-columns: repeat(3, 1fr); }
.alert-rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.alert-rule-card { padding: 23px; }
.alert-rule-card h2 { margin: 3px 0 18px; font-size: 18px; }
.alert-flow-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.alert-flow-row > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: #e7f5f1; font-size: 11px; font-weight: 850; }
.alert-flow-row strong, .alert-flow-row small { display: block; }
.alert-flow-row strong { font-size: 12px; }
.alert-flow-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.alert-details { margin-top: 4px; }
.alert-config-note { margin: 15px 0 0; padding: 11px 12px; border-radius: 8px; color: #536a63; background: #f0f8f5; font-size: 10px; }
.alert-config-note code { font-size: 10px; font-weight: 750; }
.data-table.alert-table { min-width: 840px; }
.small-text { font-size: 11px; }
.site-stats { grid-template-columns: repeat(4, 1fr); }
.timeline { padding: 8px 22px 18px; }
.timeline article { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.timeline article:last-child { border-bottom: 0; }
.timeline strong, .timeline small { display: block; }
.timeline strong { font-size: 12px; }
.timeline small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.timeline-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--warning); }
.timeline-dot.critical { background: var(--critical); }

.auth-page { min-height: 100vh; background: radial-gradient(circle at 25% 10%, #e6f4ef 0, transparent 34%), #f5f8f7; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 26px 70px rgba(21,55,45,.12); }
.login-card .brand-mark { margin-bottom: 27px; }
.login-card h1 { margin: 3px 0 8px; font-size: 31px; letter-spacing: -.045em; }
.login-card .muted { margin-bottom: 26px; }
.form-stack { display: grid; gap: 17px; }
.form-stack .button { margin-top: 5px; }
.auth-link { display: block; margin-top: 20px; color: var(--primary); font-size: 12px; font-weight: 750; text-align: center; }
.auth-link:hover { color: var(--primary-dark); text-decoration: underline; }
.empty-state { max-width: 600px; margin: 12vh auto; padding: 34px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.empty-state h1 { margin: 8px 0; }
.empty-state p:not(.eyebrow) { margin: 0 0 22px; color: var(--muted); }

@media (max-width: 1180px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .two-column { grid-template-columns: 1fr; }
    .sync-overview { grid-template-columns: 1fr; }
    .alert-rules-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: 270px; transition: transform .22s ease; box-shadow: 18px 0 50px rgba(0,0,0,.2); }
    body.menu-open .sidebar { transform: translateX(0); }
    .mobile-header { height: 62px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: var(--sidebar); }
    .mobile-header .brand { color: #fff; }
    .menu-button { height: 35px; padding: 0 12px; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(255,255,255,.06); }
    .content-area { padding: 25px 16px 48px; }
    .page-heading { align-items: stretch; }
    .panel-heading-responsive { align-items: stretch; flex-direction: column; }
    .filters { width: 100%; }
    .search-field { flex: 1; }
    .search-field input { width: 100%; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .site-stats { grid-template-columns: repeat(2, 1fr); }
    .alert-status-card { grid-template-columns: 46px minmax(0, 1fr); }
    .alert-status-card aside { grid-column: 1 / -1; padding: 13px 0 0; border-left: 0; border-top: 1px solid #cfe4dd; text-align: left; }
}

@media (max-width: 560px) {
    .page-heading { flex-direction: column; }
    .heading-actions { width: 100%; flex-direction: column-reverse; }
    .heading-actions .button { width: 100%; }
    .sync-strip { grid-template-columns: 38px minmax(0, 1fr); }
    .sync-strip > a { grid-column: 2; }
    .page-heading form .button { width: 100%; }
    .setup-banner { align-items: stretch; flex-direction: column; }
    .setup-banner .button { width: 100%; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .alert-stat-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 90px; padding: 15px; }
    .stat-card strong { font-size: 24px; }
    .stat-card .textual-stat { font-size: 15px; }
    .panel { border-radius: 13px; }
    .panel-heading { padding: 17px; }
    .filters { align-items: stretch; flex-direction: column; }
    .filters select { width: 100%; }
    .incident-row { padding: 10px 16px; }
    .incident-row time { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .settings-form { padding: 17px; }
    .form-actions { justify-content: stretch; }
    .form-actions .button { width: 100%; }
    .inline-test-form { margin: 0 17px; width: auto; }
    .inline-test-form .button { width: 100%; }
    .danger-zone { margin: 5px 17px 0; align-items: stretch; flex-direction: column; }
    .danger-zone .button { width: 100%; }
    .login-card { padding: 28px 22px; }
}
