:root {
  --ink: #172033;
  --muted: #697386;
  --faint: #98a2b3;
  --line: #e5e9f0;
  --canvas: #f5f7fa;
  --surface: #ffffff;
  --nav: #111827;
  --nav-hover: #202a3b;
  --accent: #5267df;
  --accent-dark: #4052c5;
  --accent-soft: #eef0ff;
  --green: #15966a;
  --green-soft: #e8f7f1;
  --orange: #d97706;
  --orange-soft: #fff4df;
  --red: #d14343;
  --red-soft: #fdecec;
  --blue: #2583d8;
  --blue-soft: #eaf4fd;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(16, 24, 40, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 750; letter-spacing: .14em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; font-size: 19px; letter-spacing: -.02em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: white; background: linear-gradient(145deg, #7183ef, #4255c9); font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 18px rgba(82,103,223,.25);
}

/* Login */
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 43%) 1fr; background: white; }
.login-visual {
  position: relative; overflow: hidden; min-height: 100vh; padding: 46px 54px;
  color: white; background:
    radial-gradient(circle at 18% 70%, rgba(103, 126, 255, .32), transparent 33%),
    radial-gradient(circle at 78% 24%, rgba(44, 194, 162, .14), transparent 26%),
    linear-gradient(150deg, #121a30 0%, #18264c 54%, #1b2753 100%);
}
.brand-light { position: relative; z-index: 2; }
.login-visual > p { position: absolute; z-index: 2; left: 54px; bottom: 48px; max-width: 350px; color: #b8c3dd; line-height: 1.65; }
.signal-center { position: absolute; z-index: 2; top: 44%; left: 50%; transform: translate(-50%, -50%); width: 290px; text-align: center; }
.signal-center strong { display: block; margin-top: 22px; font-size: clamp(26px, 3vw, 42px); line-height: 1.12; letter-spacing: -.04em; }
.pulse-dot { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: #65e6be; box-shadow: 0 0 0 9px rgba(101,230,190,.1), 0 0 34px #65e6be; animation: pulse 2.2s infinite; }
.signal-orbit { position: absolute; top: 44%; left: 50%; border: 1px solid rgba(149,165,220,.16); border-radius: 50%; transform: translate(-50%, -50%); }
.orbit-one { width: 430px; height: 430px; }
.orbit-two { width: 660px; height: 660px; }
.orbit-one::before, .orbit-two::before { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #7085f0; box-shadow: 0 0 18px #7085f0; }
.orbit-one::before { left: 26px; top: 108px; }
.orbit-two::before { right: 68px; bottom: 105px; }
@keyframes pulse { 50% { transform: scale(.82); opacity: .8; } }

.login-panel { display: grid; place-items: center; padding: 48px; }
.login-card { width: min(100%, 400px); }
.login-card h1 { margin: 13px 0 8px; font-size: 34px; letter-spacing: -.04em; }
.login-card > .muted { margin: 0 0 34px; }
.mobile-brand { display: none; margin-bottom: 36px; }
.login-footnote { margin: 22px 0 0; text-align: center; color: var(--faint); font-size: 12px; }

/* Application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 244px; display: flex; flex-direction: column; padding: 25px 18px 18px; color: #e7ebf4; background: var(--nav); }
.sidebar-brand { padding: 0 10px 28px; color: white; }
.main-nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; color: #aeb7c8; background: transparent; text-align: left; font-weight: 620; }
.nav-item:hover { color: white; background: var(--nav-hover); }
.nav-item.active { color: white; background: #29344a; box-shadow: inset 3px 0 var(--accent); }
.nav-item svg, .icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { margin-left: auto; min-width: 21px; padding: 2px 6px; border-radius: 999px; color: white; background: var(--red); font-size: 11px; text-align: center; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 16px 8px 4px; border-top: 1px solid #273147; }
.user-block { min-width: 0; display: flex; align-items: center; gap: 10px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #dfe4ff; background: #394464; font-size: 13px; font-weight: 700; }
.user-copy { min-width: 0; display: grid; }
.user-copy strong { overflow: hidden; max-width: 115px; color: white; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.user-copy small { margin-top: 2px; color: #8e9ab0; font-size: 11px; text-transform: capitalize; }
.sidebar .icon-button { color: #9ba6ba; }

.workspace { grid-column: 2; min-width: 0; }
.workspace-header { min-height: 102px; display: flex; align-items: center; gap: 16px; padding: 22px 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.workspace-header h1 { margin: 5px 0 0; font-size: 23px; letter-spacing: -.025em; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.live-state { display: flex; align-items: center; gap: 7px; margin-right: 5px; color: var(--green); font-size: 12px; font-weight: 650; }
.live-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.live-state.offline { color: var(--muted); }
.live-state.offline i { background: var(--faint); box-shadow: 0 0 0 4px #eef0f3; }
.main-content { padding: 28px 32px 50px; outline: none; }
.mobile-menu { display: none; }

/* Controls */
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 650; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button.primary { color: white; background: var(--accent); box-shadow: 0 5px 12px rgba(82,103,223,.16); }
.button.primary:hover { background: var(--accent-dark); }
.button.secondary { color: #344054; border-color: #d8dde7; background: white; }
.button.secondary:hover { border-color: #bfc6d4; background: #fafbfc; }
.button.danger { color: var(--red); border-color: #f1caca; background: white; }
.button.small { min-height: 31px; padding: 5px 10px; font-size: 12px; }
.button.wide { width: 100%; min-height: 44px; margin-top: 22px; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--ink); background: rgba(127,137,160,.1); }

input, select, textarea { width: 100%; border: 1px solid #d8dde7; border-radius: 8px; color: var(--ink); background: white; outline: none; transition: border .15s, box-shadow .15s; }
input, select { min-height: 41px; padding: 9px 11px; }
textarea { padding: 10px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #8290e8; box-shadow: 0 0 0 3px rgba(82,103,223,.12); }
.field-label { display: grid; gap: 7px; margin-top: 17px; color: #475467; font-size: 12px; font-weight: 650; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-row.triple { grid-template-columns: .65fr 1fr 1fr; }
.form-error { margin-top: 14px; padding: 10px 12px; border: 1px solid #f4caca; border-radius: 8px; color: #a52a2a; background: var(--red-soft); font-size: 13px; }

/* Dashboard blocks */
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; margin-bottom: 22px; }
.summary-card, .panel, .chart-card { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.summary-card { position: relative; overflow: hidden; padding: 18px 19px; }
.summary-card::after { content: ""; position: absolute; top: 0; right: 0; width: 52px; height: 52px; border-radius: 0 0 0 52px; background: var(--accent-soft); opacity: .65; }
.summary-card.warning::after { background: var(--orange-soft); }
.summary-card.critical::after, .summary-card.offline::after { background: var(--red-soft); }
.summary-card span { color: var(--muted); font-size: 12px; font-weight: 600; }
.summary-card strong { display: block; margin-top: 8px; font-size: 26px; letter-spacing: -.035em; }
.summary-card small { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.search-box { position: relative; flex: 1 1 300px; max-width: 420px; }
.search-box input { padding-left: 37px; }
.search-box svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.toolbar select { width: auto; min-width: 135px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }

.panel { overflow: hidden; }
.panel-header { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 16px; color: #7a8497; background: #fafbfc; font-size: 10px; font-weight: 750; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid #edf0f4; color: #344054; font-size: 13px; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f8f9fc; }
.object-name { display: flex; align-items: center; gap: 11px; }
.object-icon { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.object-icon.rds { color: var(--blue); background: var(--blue-soft); }
.object-icon.aws { color: var(--orange); background: var(--orange-soft); }
.object-name strong { display: block; color: var(--ink); font-size: 13px; }
.object-name small { display: block; margin-top: 3px; color: var(--faint); font-size: 11px; }
.tag { display: inline-block; margin: 2px 3px 2px 0; padding: 3px 7px; border-radius: 999px; color: #576174; background: #f0f2f6; font-size: 10px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-healthy { color: var(--green); background: var(--green-soft); }
.status-warning { color: var(--orange); background: var(--orange-soft); }
.status-critical, .status-offline { color: var(--red); background: var(--red-soft); }
.status-unmonitored, .status-resolved { color: #687386; background: #eef1f4; }
.status-open { color: var(--red); background: var(--red-soft); }
.status-acknowledged { color: var(--orange); background: var(--orange-soft); }
.metric-cell strong { display: block; color: var(--ink); }
.metric-cell small { display: block; margin-top: 3px; color: var(--faint); }
.empty-state { padding: 70px 25px; text-align: center; }
.empty-state .empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.empty-state h3 { margin: 0 0 7px; font-size: 16px; }
.empty-state p { margin: 0 auto 18px; max-width: 410px; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* Object detail */
.object-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.object-heading .object-icon { width: 46px; height: 46px; font-size: 13px; }
.object-heading h2 { margin: 0; font-size: 21px; }
.object-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.object-heading .status-pill { margin-left: 8px; vertical-align: 3px; }
.object-actions { margin-left: auto; display: flex; gap: 8px; }
.detail-stats { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.detail-stat { padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.detail-stat span { color: var(--muted); font-size: 11px; font-weight: 650; }
.detail-stat strong { display: block; margin-top: 7px; font-size: 20px; }
.detail-stat small { display: block; margin-top: 4px; color: var(--faint); font-size: 11px; }
.dashboard-controls { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; }
.dashboard-controls h2 { margin: 0; font-size: 17px; }
.dashboard-controls select { width: 150px; }
.dashboard-control-actions { display: flex; align-items: center; gap: 9px; }
.charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.charts-empty { grid-column: 1 / -1; border: 1px dashed #d8dde7; border-radius: 11px; background: var(--surface); }
.metric-picker-toolbar { display: flex; gap: 8px; margin-top: 18px; }
.metric-picker { display: grid; gap: 12px; margin-top: 12px; }
.metric-picker-group { margin: 0; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 10px; }
.metric-picker-group legend { padding: 0 5px; color: #475467; font-size: 12px; font-weight: 650; }
.metric-picker-group legend small { color: var(--faint); font-weight: 450; }
.metric-picker-option { display: flex; align-items: center; gap: 9px; padding: 5px 2px; color: #344054; font-size: 13px; cursor: pointer; }
.metric-picker-option input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.chart-card { min-width: 0; padding: 16px 17px 13px; }
.chart-card-header { display: flex; justify-content: space-between; gap: 12px; }
.chart-card h3 { margin: 0; font-size: 13px; }
.chart-card small { color: var(--faint); }
.chart-canvas { display: block; width: 100%; height: 220px; margin-top: 12px; cursor: crosshair; }
.chart-tooltip { position: fixed; z-index: 90; min-width: 160px; max-width: 280px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 12px 35px rgba(15,23,42,.16); font-size: 11px; pointer-events: none; }
.chart-tooltip-time { margin-bottom: 6px; color: var(--muted); font-weight: 600; }
.chart-tooltip-row { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.chart-tooltip-row i { flex: none; width: 8px; height: 3px; border-radius: 2px; }
.chart-tooltip-row span { flex: 1; color: var(--muted); }
.chart-tooltip-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; min-height: 18px; margin-top: 5px; }
.chart-legend span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.chart-legend i { width: 8px; height: 3px; border-radius: 2px; }
.detail-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.detail-bottom .panel { box-shadow: var(--shadow); }
.compact-list { margin: 0; padding: 0; list-style: none; }
.compact-list li { display: flex; align-items: center; gap: 11px; padding: 13px 17px; border-top: 1px solid #edf0f4; }
.compact-list li:first-child { border-top: 0; }
.compact-list .list-copy { min-width: 0; flex: 1; }
.compact-list strong { display: block; overflow: hidden; color: var(--ink); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.compact-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.severity-mark { width: 8px; height: 28px; border-radius: 4px; background: var(--orange); }
.severity-mark.critical { background: var(--red); }
.severity-mark.info { background: var(--blue); }
.empty-inline { padding: 28px 17px; color: var(--muted); font-size: 12px; text-align: center; }

/* Custom dashboards */
.widget-full { grid-column: 1 / -1; }
.widget-actions { display: flex; flex-shrink: 0; align-items: flex-start; gap: 2px; }
.widget-actions .icon-button { width: 26px; height: 26px; font-size: 12px; }
.widget-object-link { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.widget-object-link:hover { color: var(--accent); }
.widget-text { margin: 12px 0 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; }

/* Health checks */
.health-panel { margin-bottom: 16px; }
.object-icon.health { color: var(--green); background: var(--green-soft); }
.health-check-icon {
  flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; color: var(--faint); background: #eef1f4;
  font-size: 14px; font-weight: 800; line-height: 1;
}
.health-check-icon.pass { color: white; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.health-check-icon.fail { color: white; background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.health-check-icon.running { background: transparent; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: health-spin .7s linear infinite; }
@keyframes health-spin { to { transform: rotate(360deg); } }
.health-check-outcome { flex: 0 0 auto; max-width: 340px; text-align: right; }
.health-check-outcome strong { display: block; font-size: 12px; }
.health-check-outcome small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.health-pass-text { color: var(--green); }
.health-fail-text { color: var(--red); }
.compact-list li.health-entry-row { display: block; padding: 0 17px 13px 56px; border-top: 0; }
.health-entry-list { display: grid; gap: 7px; margin: 0; padding: 11px 13px; border: 1px dashed var(--line); border-radius: 9px; background: #fafbfc; list-style: none; }
.health-entry-list li { display: flex; align-items: center; gap: 8px; color: #475467; font-size: 11px; }
.health-entry-list small { overflow: hidden; color: var(--faint); text-overflow: ellipsis; white-space: nowrap; }
.health-entry-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.health-entry-dot.pass { background: var(--green); }
.health-entry-dot.warn { background: var(--orange); }
.health-entry-dot.fail { background: var(--red); }
.health-entry-status { flex: 0 0 auto; margin-left: auto; color: var(--muted); font-weight: 650; }
.json-input { font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Alarm pagination */
.table-pagination { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.table-pagination nav { display: flex; align-items: center; gap: 11px; }
.pagination-button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid #d8dde7; border-radius: 8px; color: #475467; background: white; font-size: 20px; line-height: 1; }
.pagination-button:hover:not(:disabled) { border-color: #b9c2d0; background: #f8f9fc; }
.pagination-button:disabled { color: #c2c8d1; background: #f7f8fa; cursor: not-allowed; }

/* Notification settings */
.settings-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 0 0 20px; }
.settings-intro h2 { margin: 6px 0 5px; font-size: 20px; letter-spacing: -.02em; }
.settings-intro p { max-width: 680px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.notification-panel { margin-bottom: 18px; }
.notification-heading { display: flex; align-items: center; gap: 12px; }
.notification-kind-icon { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; font-size: 16px; font-weight: 800; }
.notification-kind-icon.email { color: var(--accent); background: var(--accent-soft); }
.notification-kind-icon.webhook { color: var(--blue); background: var(--blue-soft); }
.smtp-banner { display: flex; align-items: flex-start; gap: 10px; margin: 14px 16px; padding: 12px 14px; border: 1px solid #dcebe5; border-radius: 9px; background: #f6fbf9; }
.smtp-banner.unconfigured { border-color: #f0dfbd; background: #fffaf0; }
.smtp-status-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.smtp-banner.unconfigured .smtp-status-dot { background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.smtp-banner strong, .smtp-banner small { display: block; }
.smtp-banner strong { color: #344054; font-size: 12px; }
.smtp-banner small { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.destination-cell strong, .destination-cell small { display: block; }
.destination-cell strong { color: var(--ink); }
.destination-cell small { margin-top: 3px; color: var(--faint); font-size: 10px; }
.destination-url { display: block; overflow: hidden; max-width: 520px; color: #475467; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.table-action { width: 1%; text-align: right; white-space: nowrap; }
.notification-empty { display: grid; gap: 5px; padding: 30px 18px; color: var(--muted); text-align: center; }
.notification-empty strong { color: #344054; font-size: 13px; }
.notification-empty span { font-size: 12px; }

/* Modal and toast */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(15,23,42,.48); backdrop-filter: blur(3px); }
.modal { width: min(100%, 570px); max-height: calc(100vh - 40px); overflow-y: auto; padding: 23px 25px; border-radius: 14px; background: white; box-shadow: 0 28px 80px rgba(15,23,42,.25); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin: 5px 0 0; font-size: 20px; }
.modal-header .icon-button { font-size: 26px; line-height: 1; }
.modal-description { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal-fields { margin-top: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.code-block { overflow-x: auto; margin: 17px 0 0; padding: 16px; border: 1px solid #2a3650; border-radius: 9px; color: #d7e0ef; background: #131c2e; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.notification-modal { width: min(100%, 620px); }
.destination-picker { margin: 20px 0 0; padding: 0; border: 0; }
.destination-picker legend { margin-bottom: 8px; color: #475467; font-size: 12px; font-weight: 650; }
.destination-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.destination-option { position: relative; cursor: pointer; }
.destination-option > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.destination-option-body { min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #d8dde7; border-radius: 10px; background: white; transition: border .15s, box-shadow .15s, background .15s; }
.destination-option-body strong, .destination-option-body small { display: block; }
.destination-option-body strong { color: #344054; font-size: 13px; }
.destination-option-body small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.destination-option > input:checked + .destination-option-body { border-color: #7183e6; background: #fafaff; box-shadow: 0 0 0 3px rgba(82,103,223,.1); }
.destination-option > input:focus-visible + .destination-option-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.field-hint { color: var(--faint); font-size: 10px; font-weight: 450; line-height: 1.4; }
.notification-field-group { margin-top: 0; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; cursor: pointer; }
.toggle-row > span:first-child strong, .toggle-row > span:first-child small { display: block; }
.toggle-row > span:first-child strong { color: #344054; font-size: 12px; }
.toggle-row > span:first-child small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.toggle-row > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-control { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: #c7cdd6; transition: background .15s; }
.toggle-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(16,24,40,.22); transition: transform .15s; }
.toggle-row > input:checked + .toggle-control { background: var(--accent); }
.toggle-row > input:checked + .toggle-control::after { transform: translateX(16px); }
.toggle-row > input:focus-visible + .toggle-control { outline: 2px solid var(--accent); outline-offset: 2px; }
.toast-region { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { min-width: 280px; max-width: 430px; padding: 12px 15px; border: 1px solid #dfe3ea; border-left: 4px solid var(--green); border-radius: 9px; color: #344054; background: white; box-shadow: 0 12px 35px rgba(15,23,42,.14); font-size: 12px; animation: toast-in .2s ease; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.skeleton { position: relative; overflow: hidden; min-height: 100px; border-radius: 10px; background: #e9edf3; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.loading-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  .login-view { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 30px; }
  .mobile-brand { display: flex; }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 35px rgba(15,23,42,.24); }
  .workspace { width: 100%; }
  .mobile-menu { display: grid; }
  .workspace-header { padding: 18px 20px; }
  .main-content { padding: 22px 20px 40px; }
  .live-state, #refreshButton { display: none; }
  .charts-grid, .detail-bottom { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .result-count { width: 100%; margin-left: 0; }
}

@media (max-width: 600px) {
  .workspace-header { align-items: flex-start; }
  .workspace-header h1 { font-size: 19px; }
  .breadcrumb { display: none; }
  .header-actions { margin-left: auto; }
  #addObjectButton { padding: 8px 10px; font-size: 0; }
  #addObjectButton::after { content: "+ Add"; font-size: 13px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .summary-card { padding: 14px; }
  .summary-card strong { font-size: 22px; }
  .detail-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .object-heading { flex-wrap: wrap; }
  .object-actions { width: 100%; margin-left: 0; }
  .field-row, .field-row.triple { grid-template-columns: 1fr; gap: 0; }
  .toolbar select { flex: 1; min-width: 0; }
  .modal { padding: 20px; }
  .destination-options { grid-template-columns: 1fr; }
  .table-pagination { align-items: flex-start; flex-direction: column; }
}
