html, body {
    width: 100%;
    min-height: 100%;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #080d16;
    color: #e5e7eb;
    color-scheme: dark;
}

body {
    margin: 0;
}

#app {
    min-height: 100vh;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.content:has(.login-page) {
    padding-top: 0;
}

.login-page {
    display: grid;
    width: 100%;
    box-sizing: border-box;
    place-items: start center;
    padding: .75rem 1rem 2rem;
}

.login-card {
    width: min(100%, 30rem);
    box-sizing: border-box;
    margin: 0 auto;
    padding: 2.25rem;
    border: 1px solid #263449;
    border-radius: 16px;
    background: #111a2a;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
}

.login-heading { margin-bottom: 1.75rem; text-align: center; }
.login-heading h1 { margin: 0; color: #f8fafc; font-size: 2rem; font-weight: 750; letter-spacing: -.04em; }
.login-heading p:not(.login-eyebrow) { margin: .6rem 0 0; color: #a8b3c2; }
.login-eyebrow { margin: 0 0 .55rem; color: #60a5fa; font-size: .72rem; font-weight: 750; letter-spacing: .14em; }
.login-form, .magic-link-form { display: grid; gap: 1rem; }
.login-field, .magic-link-form { color: #cbd5e1; font-size: .875rem; }
.login-field label, .magic-link-form label { display: block; margin-bottom: .4rem; font-weight: 650; }
.login-field input, .magic-link-form input {
    width: 100%;
    min-height: 2.75rem;
    padding: .65rem .75rem;
    border: 1px solid #34445d;
    border-radius: 8px;
    background: #0c1422;
    color: #f8fafc;
}
.login-field input:focus, .magic-link-form input:focus { border-color: #60a5fa; outline: 2px solid rgba(96, 165, 250, .25); }
.login-field .validation-message, .magic-link-form .validation-message { display: block; margin-top: .3rem; color: #fda4af; }
.login-check { display: flex; align-items: center; gap: .55rem; color: #a8b3c2; font-size: .85rem; }
.login-check input { width: 1rem; height: 1rem; accent-color: #3b82f6; }
.login-submit, .magic-link-form button { min-height: 2.75rem; border: 1px solid #2563eb; border-radius: 8px; background: #2563eb; color: white; font-weight: 700; cursor: pointer; }
.login-submit:hover, .magic-link-form button:hover { background: #1d4ed8; }
.login-submit:disabled, .magic-link-form button:disabled, .login-providers button:disabled { cursor: not-allowed; opacity: .6; }
.login-divider { display: flex; align-items: center; gap: .75rem; margin: 1.5rem 0 1rem; color: #718096; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.login-divider::before, .login-divider::after { flex: 1; height: 1px; background: #263449; content: ""; }
.login-providers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.login-providers button { min-height: 2.5rem; border: 1px solid #34445d; border-radius: 8px; background: #172235; color: #dbeafe; cursor: pointer; }
.login-providers button:hover { border-color: #60a5fa; background: #1e2d45; }
.login-providers button.provider-disabled { cursor: not-allowed; opacity: .5; }
.magic-link-form { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #263449; }
.magic-link-form button { background: transparent; border-color: #3b82f6; color: #93c5fd; }
.magic-link-message { margin: .75rem 0 0; color: #86efac; font-size: .85rem; }
.login-error { margin-bottom: 1.25rem; padding: .75rem 1rem; border: 1px solid #7f1d1d; border-radius: 8px; background: #3f1118; color: #fecdd3; }
.login-error ul { margin: 0; padding-left: 1.1rem; }
.login-footer { margin: 1.5rem 0 0; color: #718096; font-size: .78rem; text-align: center; }
.access-card { text-align: center; }
.access-card-link { display: block; box-sizing: border-box; padding: .7rem 1rem; text-decoration: none; text-align: center; }

@media (max-width: 520px) {
    .login-page { padding: .5rem .25rem 1.5rem; }
    .login-card { padding: 1.5rem; }
    .login-providers { grid-template-columns: 1fr; }
}

@media (min-width: 641px) {
    .content:has(.login-page) {
        padding-bottom: 0;
    }

    .login-page {
        padding-top: 0;
    }
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9OWM0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTcuNzc4IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Monitoring dashboard */
.monitor-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    color: #e5e7eb;
}

.monitor-header, .section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.monitor-header { margin-bottom: 1.75rem; }
.monitor-header h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 750; letter-spacing: -0.04em; }
.eyebrow, .reading-label { margin: 0 0 .45rem; color: #94a3b8; font-size: .72rem; font-weight: 750; letter-spacing: .12em; }
.subtitle, .section-heading p { margin: .4rem 0 0; color: #a8b3c2; }

.monitor-card {
    border: 1px solid #263449;
    border-radius: 14px;
    background: #111a2a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}

.setup-card { padding: 1.5rem; }
.setup-card h2, .section-heading h2 { margin: 0; color: #f8fafc; font-size: 1.15rem; font-weight: 700; }
.setup-card label { display: block; margin: 1.2rem 0 .45rem; font-size: .875rem; font-weight: 650; }
.setup-card .form-control, .setup-card .form-select, .target-input {
    border-color: #34445d;
    background-color: #0c1422;
    color: #f8fafc;
}
.setup-card .form-control::placeholder { color: #718096; }
.stream-controls { display: flex; gap: .75rem; }
.stream-controls input { min-width: 0; }
.stream-controls button { flex: 0 0 auto; min-width: 145px; }
.btn-danger { color: #fff; background: #c4322b; border-color: #b52b25; }
.session-id { margin: .85rem 0 0; color: #94a3b8; font-size: .8rem; }
.session-id code { color: #cbd5e1; }
.monitor-error { margin: 1rem 0 0; color: #fda4af; }
.saved-streams-card { margin: 1rem 0; padding: 1.5rem; }
.saved-stream-editor { display: grid; grid-template-columns: minmax(8rem, .7fr) minmax(14rem, 1.5fr) minmax(7rem, .55fr) auto; align-items: end; gap: .75rem; margin-top: 1.2rem; }
.saved-stream-editor label { display: block; margin-bottom: .45rem; color: #cbd5e1; font-size: .8rem; font-weight: 650; }
.saved-stream-editor .form-control { border-color: #34445d; background: #0c1422; color: #f8fafc; }
.saved-stream-actions { display: flex; gap: .5rem; }
.saved-stream-list { display: grid; gap: .65rem; margin-top: 1.2rem; }
.saved-stream-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border: 1px solid #263449; border-radius: 10px; background: #0c1422; }
.saved-stream-item.selected { border-color: #3785d8; box-shadow: 0 0 0 1px rgba(55, 133, 216, .25); }
.saved-stream-item strong, .saved-stream-item span, .saved-stream-item small { display: block; }
.saved-stream-item span { margin-top: .2rem; overflow: hidden; color: #a8b3c2; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.saved-stream-item small { margin-top: .35rem; color: #94a3b8; font-size: .75rem; }
.saved-stream-item-actions { display: flex; flex: 0 0 auto; gap: .45rem; }
.btn-secondary { color: #dbeafe; background: #273449; border-color: #34445d; }
.btn-sm { padding: .35rem .65rem; font-size: .78rem; }

.connection-pill { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .75rem; border: 1px solid #34445d; border-radius: 999px; color: #cbd5e1; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.connection-dot { width: .55rem; height: .55rem; border-radius: 50%; background: #64748b; }
.connection-pill.connected { border-color: #166534; background: #052e1b; color: #86efac; }
.connection-pill.connected .connection-dot { background: #22c55e; }

.readings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.reading-card { min-height: 150px; padding: 1.25rem; }
.reading-value { margin: .9rem 0 .2rem; font-size: clamp(1.55rem, 4vw, 2.15rem); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -.04em; }
.reading-description { margin: 0; color: #a8b3c2; font-size: .83rem; }
.update-value { font-size: 1.8rem; }
.meter-card { padding: 1.5rem; }
.meter-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 4.5rem; align-items: start; gap: .75rem; margin-top: 1.25rem; }
.meter-row > span { padding-top: .2rem; color: #cbd5e1; font-size: .8rem; font-weight: 700; }
.meter-value { padding-top: .2rem; color: #f8fafc; text-align: right; }
.meter-value strong { display: block; font-size: .8rem; font-variant-numeric: tabular-nums; }
.meter-target-status { display: block; margin-top: .2rem; color: #a8b3c2; font-size: .65rem; white-space: nowrap; }
.recent-card { padding: 1.5rem; }
.reading-count { color: #a8b3c2; font-size: .8rem; }
.empty-readings { margin-top: 1.2rem; padding: 2rem 1rem; border: 1px dashed #34445d; border-radius: 10px; color: #a8b3c2; text-align: center; }
.readings-table-wrap { overflow-x: auto; margin-top: 1.2rem; }
.readings-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.readings-table th { color: #94a3b8; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.readings-table th, .readings-table td { padding: .75rem .6rem; border-bottom: 1px solid #263449; white-space: nowrap; }
.readings-table td { font-variant-numeric: tabular-nums; }
.audio-tag, .silence-tag { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 650; }
.audio-tag { background: #052e1b; color: #86efac; }
.silence-tag { background: #273449; color: #cbd5e1; }

/* Stream management content */
.streams-management-page { max-width: 1360px; }
.streams-management-page .dashboard-heading { align-items: flex-end; }
.streams-management-page .dashboard-subtitle { max-width: 720px; }
.streams-dashboard-link { flex: 0 0 auto; text-decoration: none; }
.streams-management-grid { display: grid; grid-template-columns: minmax(17rem, .8fr) minmax(0, 1.5fr); gap: 1rem; align-items: start; }
.streams-management-grid .setup-card, .streams-management-grid .saved-streams-card { margin: 0; }
.streams-management-form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.streams-management-form label { display: block; margin-bottom: .45rem; color: #cbd5e1; font-size: .8rem; font-weight: 650; }
.streams-management-form .form-control { min-height: 42px; border-color: #34445d; background: #0c1422; color: #f8fafc; }
.streams-management-form .form-control::placeholder { color: #718096; }
.stream-field-hint { margin: .4rem 0 0; color: #718096; font-size: .75rem; }
.streams-save-button { width: 100%; margin-top: .25rem; }
.streams-management-list { margin-top: 1.25rem; }
.streams-management-item { align-items: flex-start; }
.streams-management-details { min-width: 0; }
.streams-management-details a { display: block; margin-top: .2rem; overflow: hidden; color: #93c5fd; font-size: .78rem; text-overflow: ellipsis; text-decoration: none; white-space: nowrap; }
.streams-management-details a:hover { color: #bfdbfe; text-decoration: underline; }
.streams-management-details small { display: block; margin-top: .35rem; color: #94a3b8; font-size: .75rem; }
.streams-management-page .empty-readings strong { color: #cbd5e1; }
.streams-management-page .empty-readings p { margin: .45rem 0 0; }

@media (max-width: 900px) {
    .streams-management-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .streams-management-page { padding-right: 16px; padding-left: 8px; }
    .streams-management-page .dashboard-heading { align-items: flex-start; flex-direction: column; }
    .streams-dashboard-link { width: 100%; text-align: center; }
    .streams-management-item { flex-direction: column; }
    .streams-management-item .saved-stream-item-actions { width: 100%; flex-wrap: wrap; }
}

/* Dashboard content area */
.dashboard-page {
    max-width: 1360px;
    margin: 0 auto;
    margin-top: 1rem;
    padding: 0 28px 48px 16px;
    color: #f1f5f9;
}

.dashboard-heading, .streams-panel-heading, .details-heading, .stream-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-heading { margin: 0 0 1.25rem; }
.dashboard-heading > .connection-pill { margin-left: auto; }
.dashboard-heading h1 { margin: 0; color: #f8fafc; font-size: clamp(2rem, 4vw, 2.65rem); font-weight: 750; letter-spacing: -.055em; }
.dashboard-eyebrow { margin: 0 0 .35rem; color: #94a3b8; font-size: .68rem; font-weight: 750; letter-spacing: .15em; }
.dashboard-subtitle { margin: .35rem 0 0; color: #a8b3c2; font-size: .92rem; }
.dashboard-error { margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid rgba(239, 68, 68, .4); border-radius: 12px; background: rgba(127, 29, 29, .2); color: #fecaca; }

.dashboard-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.15rem; }
.dashboard-kpi { display: flex; min-height: 114px; align-items: center; gap: 1.15rem; padding: 1.1rem 1.25rem; border: 1px solid rgba(148, 163, 184, .2); border-radius: 15px; background: linear-gradient(135deg, rgba(20, 28, 37, .94), rgba(10, 15, 21, .92)); box-shadow: 0 12px 32px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .035); }
.kpi-icon { display: grid; width: 62px; height: 62px; flex: 0 0 62px; place-items: center; border: 1px solid; border-radius: 12px; }
.kpi-icon svg { width: 31px; height: 31px; }
.signal-icon { border-color: rgba(239, 35, 48, .35); background: rgba(127, 29, 29, .2); color: #ef3340; box-shadow: 0 0 24px rgba(220, 38, 38, .08); }
.alert-icon { border-color: rgba(239, 35, 48, .35); background: rgba(127, 29, 29, .16); color: #ef3340; }
.kpi-copy p { margin: 0; color: #cbd5e1; font-size: .85rem; }
.kpi-copy strong { display: block; margin: .04rem 0; color: #f8fafc; font-size: 2rem; font-variant-numeric: tabular-nums; font-weight: 750; line-height: 1.15; }
.kpi-status { font-size: .82rem; font-weight: 700; }
.status-live { color: #22c55e; }
.status-alert { color: #ef4444; }
.status-idle { color: #94a3b8; }

.dashboard-streams-panel, .dashboard-details { padding: 1.1rem 1.15rem 1.2rem; border: 1px solid rgba(148, 163, 184, .19); border-radius: 15px; background: linear-gradient(145deg, rgba(17, 24, 32, .92), rgba(9, 14, 19, .96)); box-shadow: 0 14px 36px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .025); }
.streams-panel-heading { margin: 0 0 .8rem; padding: 0 .1rem .85rem; border-bottom: 1px solid rgba(148, 163, 184, .15); }
.streams-panel-heading h2, .details-heading h2, .stream-dialog-heading h2 { margin: 0; color: #f8fafc; font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; }
.streams-panel-heading p { margin: .24rem 0 0; color: #8290a0; font-size: .78rem; }
.add-stream-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: .5rem; padding: .55rem .9rem; border: 0; border-radius: 9px; background-color: #b9101c; background-image: linear-gradient(180deg, #ff6974 0%, #ff2a3b 26%, #e11626 54%, #b9101c 80%, #8d0b15 100%); color: #fff; font-size: .84rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; box-shadow: none; }
.add-stream-button svg { width: 17px; height: 17px; }
.add-stream-button:hover:not(:disabled) { transform: translateY(-1px); background-color: #c81220; background-image: linear-gradient(180deg, #ff8790 0%, #ff3f4d 26%, #ed1d2e 54%, #c81220 80%, #9f0d18 100%); box-shadow: none; }
.add-stream-button:focus-visible, .stream-row-main:focus-visible, .stream-action-button:focus-visible, .stream-dialog button:focus-visible { outline: 2px solid #fb7185; outline-offset: 3px; }
.add-stream-button:disabled { cursor: not-allowed; opacity: .55; }
.dashboard-stream-list { display: grid; gap: .48rem; }
.dashboard-stream-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; overflow: hidden; border: 1px solid rgba(148, 163, 184, .18); border-radius: 11px; background: rgba(5, 10, 15, .56); transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.dashboard-stream-row:hover, .dashboard-stream-row:focus-within { border-color: rgba(148, 163, 184, .38); background: rgba(24, 33, 42, .82); box-shadow: 0 4px 15px rgba(0, 0, 0, .16); }
.dashboard-stream-row.stream-selected { border-color: rgba(34, 197, 94, .42); background: rgba(10, 32, 23, .36); }
.stream-row-main { display: grid; min-width: 0; grid-template-columns: minmax(9rem, 1.1fr) 6rem minmax(9rem, 1.4fr); align-items: center; gap: 1rem; padding: .72rem .8rem; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.stream-row-main:disabled { cursor: default; }
.stream-identity { display: grid; min-width: 0; gap: .2rem; }
.stream-identity strong { overflow: hidden; color: #f1f5f9; font-size: .9rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.stream-identity small { overflow: hidden; color: #8290a0; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.stream-status { display: inline-flex; width: fit-content; min-width: 61px; align-items: center; justify-content: center; gap: .35rem; padding: .24rem .48rem; border: 1px solid; border-radius: 999px; font-size: .65rem; font-weight: 750; letter-spacing: .02em; }
.stream-status > span { width: 6px; height: 6px; border-radius: 50%; }
.stream-status-live { border-color: rgba(34, 197, 94, .62); background: rgba(20, 83, 45, .3); color: #4ade80; }
.stream-status-live > span { background: #22c55e; box-shadow: 0 0 7px rgba(34, 197, 94, .65); }
.stream-status-offline { border-color: rgba(100, 116, 139, .38); background: rgba(51, 65, 85, .22); color: #94a3b8; }
.stream-status-offline > span { background: #64748b; }
.stream-meter-column { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .65rem; }
.stream-meter { display: block; height: 16px; overflow: hidden; border: 1px solid rgba(148, 163, 184, .08); border-radius: 2px; background: repeating-linear-gradient(90deg, rgba(100, 116, 139, .18) 0 6px, transparent 6px 9px); }
.stream-meter-fill { position: relative; display: block; height: 100%; overflow: hidden; background: linear-gradient(90deg, #16a34a 0%, #22c55e 40%, #eab308 62%, #f97316 82%, #ef4444 100%); transition: width .25s ease-out; }
.stream-meter-fill::after { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(7, 12, 16, .58) 6px 9px); content: ""; }
.stream-level { min-width: 4.5rem; color: #dbe2ea; font-size: .72rem; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.stream-chevron { width: 19px; height: 19px; color: #cbd5e1; transition: transform .18s ease, color .18s ease; }
.dashboard-stream-row:hover .stream-chevron { transform: translateX(2px); color: #fff; }
.stream-row-actions { display: flex; align-items: center; gap: .25rem; padding: 0 .65rem 0 0; }
.stream-action-button, .stream-dialog-close { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #94a3b8; font-size: 1.05rem; cursor: pointer; transition: background .16s ease, color .16s ease; }
.stream-action-button:hover:not(:disabled) { background: rgba(148, 163, 184, .12); color: #f8fafc; }
.stream-details-button { color: #cbd5e1; font-size: 1.55rem; line-height: 1; }
.stream-delete-button:hover:not(:disabled) { background: rgba(239, 68, 68, .13); color: #fca5a5; }
.stream-action-button:disabled { cursor: not-allowed; opacity: .4; }
.dashboard-empty-state { padding: 2rem 1rem 1.6rem; color: #f1f5f9; text-align: center; }
.dashboard-empty-state > span { font-size: 1rem; font-weight: 700; }
.dashboard-empty-state p { margin: .35rem 0 1rem; color: #94a3b8; font-size: .84rem; }

.dashboard-details { display: grid; gap: 1rem; margin-top: 1.15rem; }
.details-heading { padding: .15rem .1rem; }
.details-heading h2 { font-size: 1.35rem; }
.stop-monitoring-button, .stream-dialog-cancel { min-height: 38px; padding: .5rem .8rem; border: 1px solid rgba(148, 163, 184, .3); border-radius: 8px; background: rgba(30, 41, 59, .6); color: #e2e8f0; font-size: .8rem; font-weight: 650; cursor: pointer; }
.stop-monitoring-button:hover:not(:disabled), .stream-dialog-cancel:hover:not(:disabled) { background: rgba(51, 65, 85, .8); }
.stop-monitoring-button:disabled { cursor: not-allowed; opacity: .6; }

.stream-dialog-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 1rem; background: rgba(2, 6, 10, .76); backdrop-filter: blur(7px); }
.stream-dialog { width: min(100%, 29rem); padding: 1.35rem; border: 1px solid rgba(148, 163, 184, .25); border-radius: 16px; background: linear-gradient(145deg, #151d27, #0a0f15); box-shadow: 0 24px 80px rgba(0, 0, 0, .55); }
.stream-dialog-heading { align-items: flex-start; margin-bottom: 1.2rem; }
.stream-dialog-close { border-color: rgba(148, 163, 184, .15); color: #cbd5e1; font-size: 1.4rem; }
.stream-dialog-close:hover { background: rgba(148, 163, 184, .12); color: #fff; }
.stream-dialog-fields { display: grid; gap: .45rem; }
.stream-dialog-fields label { margin-top: .5rem; color: #cbd5e1; font-size: .8rem; font-weight: 650; }
.stream-dialog-fields .form-control { min-height: 42px; border-color: #34445d; background: #0c1422; color: #f8fafc; }
.stream-dialog-fields .form-control:focus { border-color: #ef4444; box-shadow: 0 0 0 .18rem rgba(239, 68, 68, .18); }
.stream-default-icon-picker { display: grid; gap: .45rem; margin-top: .35rem; }
.stream-default-icon-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.stream-default-icon-option { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: .35rem; border: 1px solid #34445d; border-radius: .45rem; background: #0c1422; cursor: pointer; }
.stream-default-icon-option:hover, .stream-default-icon-option.selected { border-color: #ef4444; box-shadow: 0 0 0 .12rem rgba(239, 68, 68, .18); }
.stream-default-icon-option:disabled { cursor: not-allowed; opacity: .6; }
.stream-dialog-hint { margin: .8rem 0 0; color: #94a3b8; font-size: .75rem; }
.stream-icon-status { margin: .65rem 0 0; font-size: .75rem; }
.stream-icon-success { color: #86efac; }
.stream-icon-error { color: #fca5a5; }
.stream-dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }

.stream-details-page { display: grid; gap: 1rem; animation: stream-details-enter .3s cubic-bezier(.2, .7, .2, 1) both; }
.dashboard-page.dashboard-exiting { animation: dashboard-content-exit .3s cubic-bezier(.2, .7, .2, 1) both; pointer-events: none; }
.stream-details-page.details-exiting { animation: stream-details-exit .3s cubic-bezier(.2, .7, .2, 1) both; pointer-events: none; }
.stream-details-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: .2rem .1rem .25rem; }
.stream-details-title-group { display: grid; justify-items: start; gap: .45rem; }
.details-back-button { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .55rem; border: 1px solid rgba(148, 163, 184, .2); border-radius: 8px; background: rgba(15, 23, 32, .72); color: #cbd5e1; font-size: .8rem; font-weight: 650; cursor: pointer; transition: background .18s ease, color .18s ease; }
.details-back-button:hover { background: rgba(51, 65, 85, .72); color: #fff; }
.details-back-button:focus-visible { outline: 2px solid #fb7185; outline-offset: 3px; }
.stream-details-title-group h1 { margin: -.15rem 0 0; color: #f8fafc; font-size: clamp(1.8rem, 3.6vw, 2.45rem); font-weight: 750; letter-spacing: -.045em; }
.stream-details-actions { display: flex; align-items: center; gap: .7rem; padding-bottom: .1rem; }
.stream-details-page .readings-grid { margin: 0; }
.stream-details-page .meter-card, .stream-details-page .alerts-card, .stream-details-page .recent-card, .stream-history-card, .stream-configuration-card { min-width: 0; padding: 1.1rem 1.15rem 1.2rem; border: 1px solid rgba(148, 163, 184, .19); border-radius: 15px; background: linear-gradient(145deg, rgba(17, 24, 32, .92), rgba(9, 14, 19, .96)); box-shadow: 0 14px 36px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .025); }
.stream-details-page .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.stream-details-page .section-heading h2 { color: #f1f5f9; }
.stream-details-page .alerts-card { min-height: 9rem; }
.stream-details-page .alert-list { max-height: 15rem; overflow-y: auto; }
.stream-details-page .readings-table-scroll { max-height: 28rem; overflow-y: auto; overscroll-behavior: contain; }
.stream-details-page .readings-table-scroll thead th { position: sticky; z-index: 1; top: 0; background: #111a25; }
.stream-history-list { position: relative; display: grid; gap: 0; margin: 1.25rem 0 0; padding: 0 0 0 .35rem; list-style: none; }
.stream-history-list::before { position: absolute; top: .45rem; bottom: .55rem; left: .69rem; width: 1px; background: linear-gradient(rgba(239, 68, 68, .65), rgba(100, 116, 139, .18)); content: ""; }
.stream-history-item { position: relative; display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: .8rem; padding: .1rem 0 1.25rem; }
.stream-history-item:last-child { padding-bottom: .1rem; }
.stream-history-marker { z-index: 1; width: .7rem; height: .7rem; margin-top: .23rem; border: 2px solid #fb7185; border-radius: 50%; background: #111820; box-shadow: 0 0 12px rgba(239, 68, 68, .2); }
.stream-history-item strong { color: #e2e8f0; font-size: .88rem; font-weight: 700; }
.stream-history-item p { margin: .2rem 0 .25rem; color: #a8b3c2; font-size: .8rem; }
.stream-history-item time { color: #8290a0; font-size: .72rem; font-variant-numeric: tabular-nums; }
.stream-configuration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1.25rem; margin: 1.2rem 0 0; }
.stream-configuration-grid > div { min-width: 0; padding: .85rem .9rem; border: 1px solid rgba(148, 163, 184, .12); border-radius: 10px; background: rgba(5, 10, 15, .42); }
.stream-configuration-grid dt { margin-bottom: .3rem; color: #8290a0; font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.stream-configuration-grid dd { overflow-wrap: anywhere; margin: 0; color: #e2e8f0; font-size: .86rem; }
.stream-configuration-grid a { color: #93c5fd; text-decoration: none; }
.stream-configuration-grid a:hover { color: #bfdbfe; text-decoration: underline; }
.stream-configuration-grid .configuration-url { grid-column: 1 / -1; }
.dashboard-heading, .dashboard-kpis, .dashboard-streams-panel, .dashboard-details { animation: dashboard-content-enter .3s cubic-bezier(.2, .7, .2, 1) both; }

@keyframes stream-details-enter {
    from { opacity: .65; transform: translateX(2rem); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes dashboard-content-enter {
    from { opacity: .65; transform: translateX(-2rem); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes dashboard-content-exit {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: .6; transform: translateX(-2rem); }
}

@keyframes stream-details-exit {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: .6; transform: translateX(2rem); }
}

@media (max-width: 900px) {
    .dashboard-page { padding-right: 20px; padding-left: 12px; }
    .stream-row-main { grid-template-columns: minmax(8rem, 1fr) 5.5rem minmax(8rem, 1.3fr); gap: .65rem; }
    .stream-meter-column { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
    .stream-level { min-width: 0; text-align: left; }
}

@media (max-width: 700px) {
    .dashboard-page { padding: 0 12px 32px 4px; }
    .dashboard-heading { align-items: flex-start; }
    .dashboard-kpis { grid-template-columns: 1fr; gap: .7rem; }
    .dashboard-kpi { min-height: 96px; padding: .9rem 1rem; }
    .dashboard-streams-panel, .dashboard-details { padding: .85rem; }
    .stream-row-main { position: relative; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; padding: .75rem; }
    .stream-identity { grid-column: 1; }
    .stream-status { grid-column: 1; grid-row: 2; }
    .stream-meter-column { grid-column: 1 / -1; grid-row: 3; grid-template-columns: minmax(0, 1fr) auto; margin-top: .12rem; }
    .stream-level { min-width: 4.4rem; text-align: right; }
    .stream-row-actions { flex-direction: column; justify-content: center; padding: 0 .35rem; border-left: 1px solid rgba(148, 163, 184, .1); }
    .stream-action-button { width: 32px; height: 32px; }
    .stream-details-heading { align-items: flex-start; flex-direction: column; }
    .stream-details-actions { width: 100%; justify-content: space-between; }
    .stream-details-page .meter-card, .stream-details-page .alerts-card, .stream-details-page .recent-card, .stream-history-card, .stream-configuration-card { padding: .85rem; }
    .stream-configuration-grid { grid-template-columns: 1fr; }
    .stream-configuration-grid .configuration-url { grid-column: auto; }
}

@media (max-width: 420px) {
    .dashboard-page { padding-right: 8px; }
    .dashboard-heading { align-items: flex-start; flex-direction: column; gap: .7rem; }
    .streams-panel-heading { align-items: center; }
    .streams-panel-heading h2 { font-size: 1.05rem; }
    .streams-panel-heading p { font-size: .7rem; }
    .add-stream-button { min-height: 38px; padding: .45rem .65rem; font-size: .76rem; }
    .dashboard-streams-panel { padding: .7rem; }
    .stream-identity strong { font-size: .82rem; }
    .stream-identity small { font-size: .66rem; }
}