:root {
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
    color: #233d50;
    background: #f7f5ee;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --ink: #19394b;
    --muted: #647a84;
    --blue: #204e67;
    --border: #e4e6df;
    --surface: #fffefa;
}

* { box-sizing: border-box; }
html, body, #app { min-height: 100%; margin: 0; }
body { background: #f7f5ee; font-size: 14px; }
html body { height: auto; overflow-x: hidden; overflow-y: auto; }
a { color: #285d78; text-decoration: none; }
a:hover { color: #163d53; }
button, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #4285a0; outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.brand { align-items: center; display: flex; flex-shrink: 0; gap: 10px; padding: 0 3px; }
.brand:hover { text-decoration: none; }
.brand-mark { align-items: center; background: #244e62; border-radius: 12px; color: #f5e4ad; display: flex; flex: 0 0 42px; height: 42px; justify-content: center; }
.brand-mark svg { height: 28px; width: 28px; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { color: #19394b; font-size: 15px; letter-spacing: -.05em; line-height: 1.15; white-space: nowrap; }
.brand-copy strong span { color: #7993a0; font-weight: 400; }
.brand-copy small { color: #7d8f91; font-size: 9px; font-weight: 700; letter-spacing: .13em; margin-top: 5px; }
.main-shell { min-width: 0; }
.top-bar { align-items: center; background: rgb(255 254 250 / 74%); border-bottom: 1px solid #e9e9df; display: flex; gap: 16px; justify-content: space-between; min-height: 76px; padding: 14px clamp(24px, 4vw, 64px); }
.top-left { align-items: center; display: flex; gap: 28px; min-width: 0; }
.top-context { align-items: center; color: #778b8d; display: flex; font-size: 12px; gap: 11px; white-space: nowrap; }
.top-context::before { background: #e3e7df; content: ""; height: 28px; margin-right: 15px; width: 1px; }
.top-context strong { color: #425e69; font-weight: 600; }
.context-dot { background: #c8a75d; border-radius: 50%; height: 8px; width: 8px; }
.context-divider { color: #c8ceca; }
.account-chip, .sign-in-link { align-items: center; color: #526c74; display: inline-flex; font-size: 12px; gap: 9px; min-width: 0; }
.account-chip { justify-content: flex-end; max-width: 40%; }
.account-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip strong { color: #264c5d; font-weight: 600; overflow-wrap: anywhere; }
.account-avatar { align-items: center; background: #e3edef; border: 1px solid #d5e4e6; border-radius: 50%; color: #6d99a3; display: inline-flex; flex: 0 0 30px; font-size: 10px; height: 30px; justify-content: center; width: 30px; }
.sign-in-link { color: #275b70; font-weight: 600; }
.sign-in-link:hover { text-decoration: underline; }
.content-shell { margin: 0 auto; max-width: 1500px; padding: 48px clamp(24px, 4vw, 64px) 72px; }
.page-heading { align-items: end; display: flex; gap: 24px; justify-content: space-between; margin-bottom: 32px; }
.heading-copy { min-width: 0; }
.eyebrow, .section-kicker { color: #81928d; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.eyebrow { align-items: center; display: flex; gap: 9px; }
.eyebrow-line { background: #cbb77e; height: 2px; width: 23px; }
h1 { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 3.3vw, 48px); font-weight: 400; letter-spacing: -.04em; line-height: 1.1; margin: 15px 0 10px; }
h2 { color: var(--ink); font-size: 17px; font-weight: 650; letter-spacing: -.025em; margin: 0; }
.panel-heading h2 { overflow-wrap: anywhere; }
h3 { color: var(--ink); font-size: 16px; margin: 12px 0 6px; }
.page-intro { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.button { align-items: center; border: 1px solid transparent; border-radius: 9px; display: inline-flex; font-size: 12px; font-weight: 650; gap: 8px; justify-content: center; min-height: 43px; padding: 0 16px; transition: background .15s, border-color .15s; white-space: nowrap; }
.button-primary { background: #244f64; color: #fff; }
.button-primary:hover:not(:disabled) { background: #173c50; }
.button-secondary { background: #fffefa; border-color: #dce2dd; color: #35586a; }
.button-secondary:hover:not(:disabled) { background: #f1f5f2; border-color: #b7c9c7; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-icon { font-size: 19px; font-weight: 400; line-height: 1; }

.summary-row { display: grid; gap: 15px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 32px; }
.summary-card { border: 1px solid #e4e5dc; border-radius: 14px; display: flex; flex-direction: column; min-height: 166px; padding: 21px 23px; }
.summary-card-primary { background: #244e62; border-color: #244e62; color: #fff; }
.summary-card-blue { background: #e4eff0; border-color: #d9e8e8; }
.summary-card-sand { background: #f4edda; border-color: #eee5cd; }
.summary-top { align-items: start; display: flex; justify-content: space-between; }
.summary-label { color: #6c8285; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.summary-card-primary .summary-label { color: #c0d3d6; }
.metric-icon { align-items: center; background: rgb(255 255 255 / 54%); border-radius: 10px; color: #5d8a95; display: flex; font-size: 18px; height: 34px; justify-content: center; width: 34px; }
.summary-card-primary .metric-icon { background: rgb(255 255 255 / 11%); color: #e8d49d; }
.summary-card-sand .metric-icon { color: #aa915d; }
.metric-value { color: #244957; font-family: Georgia, "Times New Roman", serif; font-size: 42px; letter-spacing: -.05em; line-height: 1; margin-top: 11px; }
.summary-card-primary .metric-value { color: #fff; }
.metric-value span { color: #7c9192; font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; font-size: 12px; font-weight: 500; letter-spacing: 0; margin-left: 6px; }
.summary-card-primary .metric-value span { color: #c3d6d7; }
.summary-caption { color: #788c8a; font-size: 11px; margin-top: auto; padding-top: 14px; }
.summary-card-primary .summary-caption { color: #b8cfd1; }

.panel { background: var(--surface); border: 1px solid #e6e8df; border-radius: 14px; box-shadow: 0 12px 35px rgb(46 64 55 / 4%); overflow: hidden; }
.panel-heading { align-items: center; border-bottom: 1px solid #edf0e9; display: flex; gap: 20px; justify-content: space-between; padding: 23px 26px; }
.panel-title-group { align-items: center; display: flex; gap: 14px; min-width: 0; }
.panel-title-group > div { min-width: 0; }
.section-icon { align-items: center; background: #e7f0ef; border-radius: 11px; color: #56828a; display: flex; flex: 0 0 42px; font-size: 21px; height: 42px; justify-content: center; width: 42px; }
.section-kicker { display: block; font-size: 9px; letter-spacing: .12em; margin-bottom: 5px; }
.panel-heading p { color: #839392; font-size: 12px; line-height: 1.5; margin: 4px 0 0; }
.panel-link { color: #315f70; font-size: 12px; font-weight: 650; white-space: nowrap; }
.panel-link:hover, .action-link:hover { text-decoration: underline; }
.panel-link span, .action-link span { color: #8da7a6; margin-left: 3px; }
.snapshot-tag { align-items: center; background: #f4f4eb; border: 1px solid #eceee3; border-radius: 20px; color: #77877e; display: inline-flex; font-size: 11px; gap: 7px; padding: 7px 10px; white-space: nowrap; }
.snapshot-dot, .status-dot { border-radius: 50%; display: inline-block; flex: 0 0 7px; height: 7px; width: 7px; }
.snapshot-dot { background: #b6a36d; }
.status-dot { background: #6a9681; }
.table-scroll { overflow-x: auto; }
.data-table { border-collapse: collapse; min-width: 850px; text-align: left; width: 100%; }
.data-table th { background: #fbfcf8; color: #87958f; font-size: 10px; font-weight: 700; letter-spacing: .09em; padding: 14px 18px; text-transform: uppercase; }
.data-table th:first-child, .data-table td:first-child { padding-left: 26px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 26px; }
.data-table td { border-top: 1px solid #f0f2ec; color: #58717a; font-size: 12px; padding: 17px 18px; vertical-align: middle; white-space: nowrap; }
.data-table tbody tr:hover { background: #fbfcf8; }
.data-table td strong { color: #284958; font-size: 13px; font-weight: 650; }
.app-cell { align-items: flex-start; display: flex; gap: 11px; }
.app-icon { align-items: center; background: #edf3ee; border-radius: 9px; color: #648e88; display: inline-flex; flex: 0 0 34px; font-size: 18px; height: 34px; justify-content: center; width: 34px; }
.resource-id { color: #91a09c; font-size: 10px; margin-top: 4px; white-space: normal; }
.resource-id summary { cursor: pointer; width: fit-content; }
.resource-id code { color: #748a8a; display: block; font-size: 10px; max-width: 230px; overflow-wrap: anywhere; padding-top: 5px; }
.replica-number { color: #294d5c; font-weight: 700; }
.state-chip { align-items: center; border-radius: 20px; display: inline-flex; font-size: 11px; font-weight: 600; gap: 7px; padding: 6px 10px; }
.state-running { background: #e8f3ec; color: #3e765b; }
.state-running .status-dot { background: #6da384; }
.state-idle { background: #f1f1ea; color: #78847c; }
.state-idle .status-dot { background: #a7afa5; }
.row-actions { text-align: right; }
.action-link { border: 1px solid #e1e9e3; border-radius: 7px; color: #315f70; display: inline-flex; font-size: 12px; font-weight: 650; margin-left: 7px; padding: 8px 10px; }
.breadcrumb { align-items: center; color: #8b9b96; display: flex; font-size: 12px; gap: 10px; margin-bottom: 24px; }
.breadcrumb a { color: #537783; }
.breadcrumb a:hover { text-decoration: underline; }
.empty-state { color: #81918d; padding: 64px 24px; text-align: center; }
.empty-state p { font-size: 12px; line-height: 1.6; margin: 0; }
.empty-icon { align-items: center; background: #edf3ef; border-radius: 50%; color: #719895; display: inline-flex; font-size: 22px; height: 48px; justify-content: center; width: 48px; }
.loading-skeleton { display: grid; gap: 12px; padding: 26px; }
.loading-skeleton div { animation: pulse 1.2s ease-in-out infinite alternate; background: #eef2ed; border-radius: 8px; height: 44px; }
@keyframes pulse { to { opacity: .45; } }
.inline-error { align-items: flex-start; background: #fdf2ed; border: 1px solid #f2ded2; border-radius: 10px; color: #874b3d; display: flex; flex-direction: column; gap: 7px; margin: 22px; padding: 18px; }
.inline-error span { color: #826a60; font-size: 12px; }
.text-button { background: none; border: 0; color: #315f70; cursor: pointer; font-size: 12px; font-weight: 700; padding: 3px 0; }
.text-button:hover { text-decoration: underline; }

.log-selection { background: #fafbf7; display: flex; flex-wrap: wrap; gap: 16px; padding: 20px 26px; }
.log-selection label { color: #71847f; display: grid; font-size: 10px; font-weight: 700; gap: 7px; letter-spacing: .06em; max-width: 100%; min-width: 160px; text-transform: uppercase; }
.log-selection select { background: #fffefa; border: 1px solid #dce5df; border-radius: 8px; color: #365764; font-size: 12px; font-weight: 500; letter-spacing: 0; max-width: 100%; min-height: 39px; padding: 7px 30px 7px 10px; text-transform: none; }
.log-toolbar { align-items: center; border-top: 1px solid #edf0e9; color: #91a19b; display: flex; font-size: 10px; font-weight: 700; justify-content: space-between; letter-spacing: .08em; padding: 16px 27px 5px; }
.log-toolbar > span:first-child { align-items: center; display: flex; gap: 7px; }
.log-toolbar > span:last-child { font-weight: 400; letter-spacing: 0; }
.log-list { max-height: 60vh; overflow: auto; padding: 3px 26px; }
.log-entry { border-bottom: 1px solid #eff2eb; min-width: max-content; padding: 15px 1px; }
.log-entry:last-child { border-bottom: 0; }
.log-meta { align-items: center; color: #92a19c; display: flex; flex-wrap: wrap; font-size: 10px; gap: 11px; }
.log-meta time { color: #4a727e; font-weight: 700; }
.log-entry p { color: #385461; font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.6; margin: 8px 0 0; white-space: pre; }
.snapshot-note { border-top: 1px solid #edf0e9; color: #92a19c; font-size: 10px; margin: 0; padding: 14px 27px; }
#blazor-error-ui { background: #fff3cd; bottom: 0; box-shadow: 0 -1px 5px rgb(0 0 0 / 15%); display: none; left: 0; padding: 12px 24px; position: fixed; right: 0; z-index: 1000; }
#blazor-error-ui .reload { color: var(--blue); margin-left: 8px; }

@media (max-width: 760px) {
    .brand-mark { flex-basis: 38px; height: 38px; }
    .top-bar { min-height: 64px; padding: 12px 20px; }
    .top-context { display: none; }
    .content-shell { padding: 34px 20px 56px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .summary-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .summary-card { min-height: 138px; padding: 14px 11px; }
    .summary-label { font-size: 9px; }
    .metric-icon { display: none; }
    .metric-value { font-size: 33px; margin-top: 15px; }
    .metric-value span { display: block; font-size: 10px; margin: 4px 0 0; }
    .summary-caption { font-size: 10px; line-height: 1.4; padding-top: 10px; }
    .panel-heading { align-items: flex-start; padding: 20px; }
    .data-table { display: block; min-width: 0; }
    .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
    .data-table tbody { display: grid; gap: 10px; padding: 16px 20px 20px; }
    .data-table tbody tr { background: #fffefa; border: 1px solid #edf0e9; border-radius: 10px; display: grid; gap: 15px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
    .data-table td, .data-table td:first-child, .data-table td:last-child { border: 0; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; padding: 0; white-space: normal; }
    .data-table td[data-label]::before { color: #8a9a94; content: attr(data-label); font-size: 10px; font-weight: 700; letter-spacing: .06em; margin-bottom: 5px; text-transform: uppercase; }
    .data-table td.app-column, .data-table td.replica-column, .data-table td.row-actions { grid-column: 1 / -1; }
    .data-table td.row-actions { border-top: 1px solid #edf0e9; display: flex; flex-direction: row; gap: 8px; padding-top: 13px; text-align: left; }
    .data-table .action-link { justify-content: center; margin: 0; }
    .app-cell, .app-cell > div { min-width: 0; }
    .resource-id code { max-width: 100%; }
    .log-selection { padding: 18px 20px; }
    .log-list { padding: 3px 20px; }
    .log-toolbar { padding-left: 21px; padding-right: 21px; }
}
@media (max-width: 440px) {
    .brand-copy small { display: none; }
    .account-chip, .sign-in-link { font-size: 11px; }
    .sign-in-link .account-avatar { display: none; }
    .panel-heading { flex-wrap: wrap; }
    .panel-link { margin-left: 56px; }
    .log-selection label { flex: 1 1 100%; }
}
@media (max-width: 360px) {
    .brand-copy { display: none; }
    .account-chip { max-width: 75%; }
}
@media (prefers-reduced-motion: reduce) {
    .loading-skeleton div { animation: none; }
    .button { transition: none; }
}
