@font-face {
    font-family: "Madefor";
    src: url("/static/wix-madefor-text-latin.woff2") format("woff2");
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #0e1116;
    --sidebar: #12171e;
    --panel: #161b22;
    --panel-2: #1c232d;
    --panel-3: #202834;
    --line: #2a313c;
    --line-strong: #3a4452;
    --text: #e6edf3;
    --muted: #8b97a7;
    --subtle: #697585;
    --accent: #7355b9;
    --accent-hover: #8467c7;
    --accent-soft: #211a31;
    --focus: #bda9ef;
    --success: #65c985;
    --success-soft: #16291f;
    --error: #ff8f98;
    --error-soft: #321c21;
    --warning: #e8bd69;
    --warning-soft: #302719;
    --info: #73b8d0;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 18px 55px rgb(0 0 0 / 35%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); color: var(--text); font-family: Madefor, Inter, system-ui, sans-serif; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--text); color: var(--bg); }
.skip-link:focus { top: 12px; }
.muted { margin: .25rem 0; color: var(--muted); }
.eyebrow { margin: 0 0 .38rem; color: #b5a5da; font-size: .69rem; font-weight: 750; letter-spacing: .15em; }
.mobile-only { display: none !important; }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 40; display: flex; flex-direction: column; height: 100vh; padding: 24px 17px 20px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #151922 0%, var(--sidebar) 65%); }
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 24px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #493968; border-radius: 11px; background: linear-gradient(145deg, #2b2140, #191522); color: #bba8e8; box-shadow: inset 0 1px rgb(255 255 255 / 8%); }
.brand-mark svg { width: 25px; height: 25px; }
.brand-mark svg path:first-child { fill: currentColor; stroke: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.07rem; letter-spacing: -.01em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .72rem; }

.connection-card { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgb(22 27 34 / 84%); }
.connection-card div { min-width: 0; }
.connection-card strong, .connection-card span { display: block; }
.connection-card strong { font-size: .82rem; }
.connection-card span:last-child { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgb(101 201 133 / 12%); }
.status-dot.is-loading { background: var(--muted); box-shadow: 0 0 0 3px rgb(139 151 167 / 12%); }
.status-dot.is-error { background: var(--error); box-shadow: 0 0 0 3px rgb(255 143 152 / 12%); }

.nav-list { margin-top: 24px; }
.nav-label { margin: 0 9px 8px; color: var(--subtle); font-size: .67rem; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; width: 100%; min-height: 43px; gap: 11px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #abb5c1; font-size: .82rem; font-weight: 650; text-align: left; }
.nav-item + .nav-item { margin-top: 3px; }
.nav-item svg { color: #7f8997; }
.nav-item:hover { background: rgb(255 255 255 / 3%); color: var(--text); }
.nav-item.active { border-color: #3e3158; background: var(--accent-soft); color: #d3c5f1; }
.nav-item.active svg { color: #c3afea; }
.nav-count { margin-left: auto; padding: 2px 7px; border-radius: 999px; background: rgb(255 255 255 / 7%); color: var(--muted); font-size: .67rem; }

.sidebar-bottom { display: grid; gap: 12px; margin-top: auto; }
.refresh-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #111720; }
.refresh-note span { color: var(--muted); font-size: .68rem; }
.refresh-note strong { font-size: .69rem; }
.version-row { display: flex; justify-content: space-between; padding: 0 4px; color: var(--subtle); font-size: .68rem; }
.live-pill { display: inline-flex; align-items: center; gap: 5px; color: var(--success); }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.workspace { width: 100%; max-width: 1750px; min-width: 0; margin: 0 auto; padding: 34px clamp(24px, 4vw, 62px) 60px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.topbar-title { display: flex; align-items: flex-start; gap: 12px; }
.topbar-title > div { min-width: 0; }
.topbar h1 { margin: .08rem 0; font-size: clamp(1.8rem, 3vw, 2.55rem); letter-spacing: -.035em; }
.topbar .muted { max-width: 650px; font-size: .88rem; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.last-update { color: var(--subtle); font-size: .72rem; white-space: nowrap; }

.button, .icon-button { border: 1px solid var(--line); background: var(--panel-2); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; gap: 8px; padding: 9px 15px; border-radius: 9px; font-size: .8rem; font-weight: 700; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { border-color: #586273; background: #222a35; }
.button:active { transform: translateY(1px); }
.button.is-loading svg { animation: spin .9s linear infinite; }
.button.primary { border-color: #8266c5; background: var(--accent); color: #fff; }
.button.primary:hover { border-color: #9579d8; background: var(--accent-hover); }
.button.full { width: 100%; }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 9px; font-size: 1.15rem; }

.login-page { position: relative; isolation: isolate; }
.login-page::before, .login-page::after { position: fixed; z-index: -1; content: ""; pointer-events: none; }
.login-page::before { inset: 0; background: radial-gradient(circle at 18% 12%, rgb(115 85 185 / 26%), transparent 34%), radial-gradient(circle at 82% 88%, rgb(74 119 138 / 16%), transparent 31%), linear-gradient(145deg, #0b0e13, #11151c 58%, #0c1016); }
.login-page::after { inset: 0; opacity: .12; background-image: linear-gradient(rgb(255 255 255 / 7%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 7%) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent 82%); }
.login-view { display: grid; min-height: 100vh; place-items: center; padding: 32px 20px; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid rgb(74 84 99 / 78%); border-radius: 20px; background: rgb(22 27 34 / 94%); box-shadow: 0 26px 80px rgb(0 0 0 / 48%); backdrop-filter: blur(14px); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { font-size: 1.08rem; }
.login-brand small { margin-top: 1px; color: var(--muted); font-size: .72rem; }
.login-heading h1 { margin: .15rem 0 .55rem; font-size: clamp(1.8rem, 7vw, 2.1rem); letter-spacing: -.035em; }
.login-heading .muted { max-width: 35rem; font-size: .86rem; line-height: 1.55; }
.login-form { display: grid; gap: 17px; margin-top: 27px; }
.auth-field { gap: 8px; font-size: .79rem; }
.auth-field > span:first-child { color: #cbd3dd; font-weight: 700; }
.auth-field input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #10151c; caret-color: var(--focus); }
.auth-field input:hover { border-color: #46515f; }
.auth-field input:focus { border-color: #8065bd; box-shadow: 0 0 0 3px rgb(115 85 185 / 18%); outline: 0; }
.auth-field input:disabled { opacity: .7; }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 82px; }
.password-toggle { position: absolute; top: 50%; right: 7px; min-width: 68px; min-height: 34px; padding: 5px 8px; transform: translateY(-50%); border: 0; border-radius: 7px; background: transparent; color: #baa9df; font-size: .71rem; font-weight: 750; }
.password-toggle:hover { background: var(--accent-soft); }
.login-submit { width: 100%; min-height: 46px; margin-top: 2px; }
.login-submit.is-loading { cursor: wait; }
.form-error { margin: 0; padding: 11px 13px; border: 1px solid #74363c; border-radius: 9px; background: var(--error-soft); color: #ffc4c8; font-size: .76rem; line-height: 1.45; }
.login-security-note { display: flex; align-items: center; gap: 9px; margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--subtle); font-size: .69rem; line-height: 1.4; }

.global-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 29px 0 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.toolbar-label, .toolbar-context span { display: block; margin-bottom: 8px; color: var(--muted); font-size: .7rem; font-weight: 650; }
.toolbar-context { text-align: right; }
.toolbar-context strong { font-size: .75rem; }
.segmented-control { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #10151c; }
.period-btn { min-height: 34px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .74rem; font-weight: 700; }
.period-btn:hover { color: var(--text); }
.period-btn.active { background: var(--accent); color: #fff; box-shadow: 0 3px 12px rgb(0 0 0 / 25%); }

.view { animation: fade-in .18s ease-out; }
.health-banner { display: flex; align-items: center; gap: 16px; padding: 21px 23px; border: 1px solid #284737; border-radius: var(--radius); background: linear-gradient(110deg, #17251d, #171b22 70%); }
.health-banner.is-warning { border-color: #594724; background: linear-gradient(110deg, #2a2317, #171b22 70%); }
.health-banner.is-error { border-color: #66343a; background: linear-gradient(110deg, #2d1b20, #171b22 70%); }
.health-banner.is-loading { border-color: var(--line); background: var(--panel); }
.health-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--success-soft); color: var(--success); font-size: 1.25rem; font-weight: 800; }
.health-banner.is-warning .health-icon { background: var(--warning-soft); color: var(--warning); }
.health-banner.is-error .health-icon { background: var(--error-soft); color: var(--error); }
.health-banner.is-loading .health-icon { background: var(--panel-2); color: var(--muted); }
.health-copy { min-width: 0; }
.health-copy h2 { margin: 0; font-size: 1.12rem; }
.health-copy p:last-child { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.health-score { margin-left: auto; padding-left: 24px; border-left: 1px solid rgb(255 255 255 / 8%); text-align: right; }
.health-score span, .health-score strong { display: block; }
.health-score span { color: var(--muted); font-size: .7rem; }
.health-score strong { margin-top: 4px; font-size: 1.45rem; }
.widget-status { margin: -7px 0 13px; padding: 7px 9px; border: 1px solid #594724; border-radius: 7px; background: var(--warning-soft); color: #f0cf8e; font-size: .69rem; line-height: 1.4; }
.health-copy .widget-status { margin: 8px 0 0; }
.widget-status.standalone { margin: 12px 0 0; }
[data-widget].is-stale { border-color: #594724; }

.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 11px; margin: 17px 0; }
.metric-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.metric-card > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .72rem; }
.metric-card strong { display: block; margin-top: 9px; overflow: hidden; font-size: 1.38rem; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { display: block; min-height: 1em; margin-top: 5px; overflow: hidden; color: var(--subtle); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.primary-metric { border-color: #3e3158; background: linear-gradient(145deg, #1c1827, var(--panel)); }
.metric-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.metric-dot.success { color: var(--success); }
.metric-dot.error { color: var(--error); }
.metric-dot.warning { color: var(--warning); }
.metric-dot.info { color: var(--info); }

.alerts-section { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin: 17px 0; padding: 17px 19px; border: 1px solid #594724; border-radius: 12px; background: #211d16; }
.alerts-section h2 { margin: 0; font-size: 1rem; }
.alerts-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.alert-chip { padding: 7px 10px; border: 1px solid #5c4928; border-radius: 8px; background: #2c2418; color: #e5c98c; font-size: .72rem; }

.dashboard-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.panel { position: relative; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.panel-heading h2 { margin: 0; font-size: .98rem; }
.panel-hint { color: var(--subtle); font-size: .68rem; }
.chart-main { grid-column: span 1; }
.chart-wrap { position: relative; height: 270px; }
.chart-wrap.compact { height: 225px; }
.chart-empty { position: absolute; inset: 68px 20px 20px; display: grid; place-items: center; border-radius: 10px; background: var(--panel); color: var(--muted); font-size: .78rem; }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.workflow-action { min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: #bcc6d2; font-size: .69rem; }
.workflow-action:hover { border-color: #58456f; background: var(--accent-soft); color: #d8caf4; }

.source-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border: 1px solid #332b45; border-radius: var(--radius); background: linear-gradient(110deg, var(--panel), #1a1526); }
.source-summary h2 { margin: 0; font-size: 1.25rem; }
.source-summary .muted { font-size: .78rem; }
.source-health { display: flex; align-items: center; gap: 9px; color: #b9c2ce; font-size: .78rem; }
.infrastructure-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.table-panel { margin-top: 14px; }
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #131820; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { max-width: 380px; padding: 11px 13px; overflow: hidden; border-bottom: 1px solid var(--line); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); color: #aeb8c4; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgb(115 85 185 / 6%); }
.container-name { color: #d7dee7; font-weight: 700; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--muted); font-size: .67rem; font-weight: 700; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.success { border-color: #31543d; background: var(--success-soft); color: var(--success); }
.status-badge.error { border-color: #67343b; background: var(--error-soft); color: var(--error); }
.status-badge.warning { border-color: #594724; background: var(--warning-soft); color: var(--warning); }
.meter-cell { display: flex; align-items: center; min-width: 130px; gap: 9px; }
.meter { width: 66px; height: 5px; overflow: hidden; border-radius: 99px; background: var(--panel-3); }
.meter > span { display: block; width: var(--value); max-width: 100%; height: 100%; border-radius: inherit; background: var(--accent); }
.empty-row { padding: 28px; color: var(--muted); text-align: center; }

.filter-toolbar { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(110px, .55fr) auto; align-items: end; gap: 11px; margin-top: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
label { display: grid; gap: 7px; color: #cbd3dd; font-size: .74rem; font-weight: 650; }
select { width: 100%; min-height: 42px; padding: 9px 35px 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #10151c; }
.result-status { min-height: 24px; margin: 12px 0; color: var(--muted); font-size: .76rem; }
.executions-table-panel { margin-top: 0; padding: 0; }
.executions-table-panel .table-wrap { border: 0; }
.execution-id { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .69rem; }

dialog { width: min(900px, calc(100% - 32px)); max-height: min(80vh, 740px); padding: 0; overflow: visible; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(2 5 9 / 76%); backdrop-filter: blur(4px); }
.dialog-card { max-height: min(80vh, 740px); padding: 23px; overflow: auto; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 0; font-size: 1.12rem; }
.dialog-card .table-wrap { max-height: 52vh; }

.toast-region { position: fixed; top: 18px; right: 18px; z-index: 120; display: grid; width: min(380px, calc(100% - 36px)); gap: 8px; }
.toast { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-2); box-shadow: var(--shadow); font-size: .77rem; }
.toast.error { border-color: #67343b; background: var(--error-soft); color: #ffd0d4; }

.backdrop { position: fixed; inset: 0; z-index: 35; border: 0; background: rgb(0 0 0 / 58%); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
    .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .mobile-only { display: grid !important; }
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(300px, 86vw); box-shadow: var(--shadow); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .workspace { padding: 24px 20px 48px; }
    .topbar-title { width: 100%; }
    .topbar { align-items: flex-start; }
    .last-update { display: none; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .filter-toolbar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
    .login-view { align-items: start; padding: 18px 12px; }
    .login-card { padding: 28px 22px; border-radius: 16px; }
    .login-brand { margin-bottom: 26px; }
    .workspace { padding-inline: 14px; }
    .topbar { display: block; }
    .top-actions { margin: 16px 0 0 54px; }
    .global-toolbar { display: block; padding: 14px; }
    .toolbar-context { display: none; }
    .segmented-control { width: 100%; overflow-x: auto; }
    .period-btn { flex: 1 0 auto; padding-inline: 10px; }
    .health-banner { align-items: flex-start; flex-wrap: wrap; padding: 17px; }
    .health-score { width: 100%; margin: 2px 0 0 62px; padding: 0; border: 0; text-align: left; }
    .health-score span, .health-score strong { display: inline; }
    .health-score strong { margin-left: 5px; font-size: .9rem; }
    .metrics, .infrastructure-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card { padding: 14px; }
    .metric-card small { white-space: normal; }
    .alerts-section { display: block; }
    .alerts-list { justify-content: flex-start; margin-top: 12px; }
    .source-summary { align-items: flex-start; flex-direction: column; }
    .filter-toolbar { grid-template-columns: 1fr; }
    .panel { padding: 16px; }
    .chart-wrap { height: 235px; }
}

@media (max-width: 390px) {
    .metrics, .infrastructure-metrics { grid-template-columns: 1fr; }
}

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

@media (forced-colors: active) {
    .status-dot, .metric-dot, .live-pill i { border: 1px solid CanvasText; }
    .period-btn.active, .nav-item.active, .login-card, .auth-field input { border: 1px solid CanvasText; }
}
