* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: #0a111d;
    color: #c9d6e4;
}

.app-footer {
    color: #8fa6bd;
    font-size: 0.82rem;
    padding: 18px 24px 22px;
    text-align: center;
}

.footer-branding {
    color: #5f7388;
    line-height: 1.4;
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.panel {
    width: min(560px, 100%);
    background: #101b2b;
    border: 1px solid #24344a;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.login-logo {
    display: block;
    width: min(198px, 58%);
    height: auto;
    margin: 0 auto 18px;
}

h1 {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.2;
}

p {
    margin: 0 0 20px;
    line-height: 1.5;
}

.actions {
    display: flex;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 6px;
    background: #2f5f8f;
    color: #f1f5f9;
    text-decoration: none;
    font-weight: 700;
}

.button:hover {
    background: #386b9f;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button.secondary {
    background: #263445;
}

.button.secondary:hover {
    background: #304256;
}

.form {
    display: grid;
    gap: 16px;
}

.form-section {
    display: grid;
    gap: 14px;
    padding-top: 4px;
}

.form-section h2 {
    margin: 0;
    font-size: 18px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.field-hint {
    color: #8ea1b6;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

.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;
}

.keyword-found {
    color: #63d471;
    font-weight: 700;
}

.keyword-missing {
    color: #f87171;
    font-weight: 700;
}

.conditional-field[hidden] {
    display: none;
}

[hidden] {
    display: none !important;
}

.checkbox {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
}

.checkbox input {
    width: auto;
    min-height: auto;
}

.compact-checkbox {
    display: inline-flex;
    font-weight: 400;
}

input {
    width: 100%;
    min-height: 40px;
    border: 1px solid #2b4058;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    background: #0c1725;
    color: #c9d6e4;
}

select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #2b4058;
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
    background: #0c1725;
    color: #c9d6e4;
}

.message {
    border-radius: 6px;
    padding: 10px 12px;
}

.message.error {
    background: #3a1d23;
    color: #f0b7bd;
}

button.button {
    border: 0;
    cursor: pointer;
    justify-content: center;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
    padding: 8px 24px;
    border-bottom: 1px solid #1e3148;
    background: #0b1522;
    color: #d6e1ed;
}

.brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    color: #d6e1ed;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 135px;
    height: auto;
}

.brand:hover {
    color: #f1f5f9;
}

.topbar strong {
    flex: 0 0 auto;
    letter-spacing: 0;
}

.topnav {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.topnav-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #b8c9db;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
}

.topnav-link:hover {
    border-color: #2b4058;
    background: #101b2b;
    color: #f1f5f9;
}

.topnav-link.active {
    border-color: #3f668f;
    background: #17304a;
    color: #f1f5f9;
}

.topnav-logout {
    color: #f0b7bd;
}

.topnav-logout:hover {
    border-color: #6e3038;
    background: #331821;
    color: #ffd9de;
}

.content {
    width: min(1560px, 100%);
    margin: 0 auto;
    padding: 28px 24px;
}

.status-page {
    width: min(1320px, 100%);
    font-size: 14px;
}

.status-category-tools {
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr;
    gap: 12px;
    align-items: end;
    margin: 10px 0 16px;
}

.status-category-tools label {
    gap: 5px;
}

.status-category-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status-category-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #24344a;
    border-radius: 6px;
    background: #0c1725;
    color: #c9d6e4;
    text-decoration: none;
}

.status-category-links a:hover,
.status-category-links a.active {
    background: #2f5f8f;
    color: #f1f5f9;
}

.status-category {
    margin-top: 14px;
    background: #101b2b;
    border: 1px solid #24344a;
    border-radius: 8px;
    overflow: hidden;
}

.status-category h2 {
    margin: 0;
    padding: 9px 12px;
    border-bottom: 1px solid #24344a;
    font-size: 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.tile {
    background: #101b2b;
    border: 1px solid #24344a;
    border-radius: 8px;
    padding: 18px;
}

.tile h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.alert-target {
    display: grid;
    gap: 12px;
}

.alert-tabs {
    display: grid;
    gap: 14px;
}

.alert-target-overview {
    margin-bottom: 14px;
}

.alert-target.active {
    border-color: #3f668f;
}

.alert-target-panel {
    display: grid;
    gap: 14px;
}

.config-example {
    margin-top: 18px;
}

.config-example pre {
    overflow-x: auto;
    margin: 0;
    padding: 12px;
    border: 1px solid #24344a;
    border-radius: 8px;
    background: #0c1725;
}

.split {
    display: grid;
    grid-template-columns: minmax(260px, 360px) 1fr;
    gap: 18px;
    align-items: start;
}

.inline-panel {
    width: auto;
    box-shadow: none;
}

.inline-panel h2 {
    margin-top: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border-bottom: 1px solid #24344a;
    padding: 10px 8px;
    text-align: left;
}

.table th {
    font-size: 13px;
    text-transform: uppercase;
    color: #9fb5cc;
}

.status-table th,
.status-table td {
    font-size: 12.5px;
    padding: 7px 9px;
    vertical-align: middle;
}

.status-table th {
    font-size: 12px;
}

.status-table {
    table-layout: fixed;
}

.status-table th:nth-child(1),
.status-table td:nth-child(1) {
    width: 38%;
}

.status-table th:nth-child(2),
.status-table td:nth-child(2) {
    width: 32%;
}

.status-table th:nth-child(3),
.status-table td:nth-child(3) {
    width: 10%;
}

.status-table th:nth-child(4),
.status-table td:nth-child(4) {
    width: 8%;
}

.status-table th:nth-child(5),
.status-table td:nth-child(5) {
    width: 12%;
}

.status-table tbody tr {
    transition: background 120ms ease, outline-color 120ms ease;
}

.status-row {
    cursor: pointer;
}

.status-row:hover {
    background: #132235;
}

.status-table tr:last-child td {
    border-bottom: 0;
}

.service-cell {
    overflow-wrap: anywhere;
}

.status-cell {
    overflow: hidden;
}

.response-cell {
    white-space: nowrap;
}

.ssl-cell {
    white-space: nowrap;
}

.check-time-cell {
    white-space: nowrap;
}

.status-combo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 230px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.page-heading h1 {
    margin-bottom: 6px;
}

.muted {
    color: #8ea1b6;
    font-size: 13px;
}

.status-page .muted {
    font-size: 12px;
}

.status-page .status-pill {
    font-size: 12px;
}

.live-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
}

.live-heading h1 {
    margin-bottom: 0;
}

.live-refresh-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: #3fb950;
    box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.12);
    animation: live-pulse 2.4s ease-out infinite;
}

.live-heading.refresh-error .live-refresh-dot {
    background: #f85149;
    box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.12);
    animation: none;
}

.refresh-spinner {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    color: #63a7df;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
}

.live-heading.is-refreshing .refresh-spinner {
    opacity: 1;
    animation: refresh-spin 0.8s linear infinite;
}

.footer-live {
    margin-bottom: 11px;
    color: #b9c9d9;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.footer-live[hidden] {
    display: none;
}

.status-row.live-updated > td,
.dashboard-card.live-updated {
    animation: live-updated 1.4s ease-out;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.28);
    }
    70%,
    100% {
        box-shadow: 0 0 0 6px rgba(63, 185, 80, 0);
    }
}

@keyframes refresh-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes live-updated {
    0% {
        background-color: rgba(72, 139, 197, 0.28);
        box-shadow: inset 3px 0 #63a7df;
    }
    100% {
        background-color: transparent;
        box-shadow: inset 0 0 transparent;
    }
}

.mini-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-top: 4px;
    padding: 0 7px;
    border: 1px solid #2b4058;
    border-radius: 999px;
    background: #0c1725;
    color: #c9d6e4;
    font-size: 12px;
    font-weight: 700;
}

.service-link {
    color: #d4dee9;
    font-weight: 700;
    text-decoration: none;
}

.service-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.row-actions {
    min-width: 122px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.row-actions > .symbol-action {
    vertical-align: middle;
}

.row-action-buttons {
    display: inline-flex;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.row-actions .inline-result {
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.row-actions form {
    margin: 0;
    display: inline-flex;
    align-items: center;
    height: 30px;
    vertical-align: middle;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: #9eb9d2;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.symbol-action {
    appearance: none;
    display: inline-grid;
    place-items: center;
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    border: 1px solid #2b4058;
    border-radius: 6px;
    padding: 0;
    background: #0c1725;
    color: #c9d6e4;
    cursor: pointer;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.symbol-action:hover {
    border-color: #3f668f;
    background: #132235;
    color: #f1f5f9;
}

button.symbol-action:disabled {
    cursor: wait;
    opacity: 0.72;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    color: #f5f7fa;
    font-size: 13px;
    font-weight: 700;
}

.status-online {
    background: #236b47;
}

.status-offline {
    background: #8f3138;
}

.status-warning {
    background: #8a6b22;
}

.status-paused,
.status-unknown {
    background: #586373;
}

.ssl-text {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.ssl-ok {
    color: #62d391;
}

.ssl-warning {
    color: #e3bd57;
}

.ssl-danger {
    color: #f07d84;
}

.ssl-unknown,
.ssl-none {
    color: #91a1b4;
}

.status-bars {
    display: flex;
    align-items: end;
    gap: 2px;
    height: 28px;
    margin-top: 0;
    flex: 0 0 auto;
}

.status-bar {
    display: inline-block;
    width: 5px;
    height: 22px;
    border-radius: 2px;
    background: #384657;
}

.status-bar-online {
    background: #2d8a5b;
}

.status-bar-offline {
    background: #a9464d;
}

.status-bar-warning {
    background: #a9852e;
}

.status-bar-paused {
    background: #6a7483;
}

.inline-result {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.status-message {
    border-left: 4px solid #586373;
}

.status-message-online {
    border-left-color: #2d8a5b;
}

.status-message-offline {
    border-left-color: #a9464d;
}

.status-message-warning {
    border-left-color: #a9852e;
}

.status-message-paused,
.status-message-unknown {
    border-left-color: #6a7483;
}

.wide-form {
    max-width: 920px;
}

.segmented-control {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid #24344a;
    border-radius: 8px;
    background: #0c1725;
}

.segment {
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    padding: 0 10px;
    background: transparent;
    color: #9fb5cc;
    cursor: pointer;
    font: inherit;
}

.segment.active,
.segment:hover {
    background: #2f5f8f;
    color: #f1f5f9;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.dashboard-topline {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 300px);
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
}

.dashboard-summary {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
}

.dashboard-category-filter {
    gap: 5px;
}

.summary-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    min-width: 170px;
    padding: 8px 10px;
    border: 1px solid #24344a;
    border-radius: 8px;
    background: #101b2b;
    color: #c9d6e4;
}

.summary-item .status-dot {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
}

.dashboard-category-group {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid #24344a;
    border-radius: 8px;
    background: #0d1827;
}

.dashboard-category-group h2 {
    margin: 0;
    color: #d4dee9;
    font-size: 15px;
    line-height: 1.25;
}

.dashboard-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.dashboard-card {
    display: grid;
    gap: 10px;
    min-height: 86px;
    border: 1px solid #24344a;
    border-left: 4px solid #586373;
    border-radius: 8px;
    padding: 10px;
    background: #101b2b;
    color: #c9d6e4;
    cursor: pointer;
    text-align: left;
}

.dashboard-card[hidden],
.dashboard-category-group[hidden] {
    display: none;
}

.dashboard-card-grouped {
    width: 100%;
}

.dashboard-card:hover {
    border-color: #3f668f;
    background: #132235;
}

.dashboard-card[data-status="online"] {
    border-left-color: #2d8a5b;
}

.dashboard-card[data-status="offline"] {
    border-left-color: #a9464d;
}

.dashboard-card[data-status="warning"] {
    border-left-color: #a9852e;
}

.dashboard-card[data-status="paused"],
.dashboard-card[data-status="unknown"] {
    border-left-color: #6a7483;
}

.dashboard-card-top,
.dashboard-card-bottom {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-card strong,
.dashboard-card small,
.dashboard-card span {
    min-width: 0;
}

.dashboard-card strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.25;
}

.dashboard-card small {
    display: block;
    margin-top: 2px;
    color: #8ea1b6;
    font-size: 12px;
}

.dashboard-card-bottom {
    color: #aabed2;
    font-size: 12px;
}

.status-dot {
    display: inline-block;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}

.status-dot-online {
    background: #2d8a5b;
}

.status-dot-offline {
    background: #a9464d;
}

.status-dot-warning {
    background: #a9852e;
}

.status-dot-paused,
.status-dot-unknown {
    background: #6a7483;
}

.modal {
    width: min(860px, calc(100% - 32px));
    max-height: min(760px, calc(100% - 32px));
    border: 1px solid #2b4058;
    border-radius: 8px;
    padding: 0;
    background: #101b2b;
    color: #c9d6e4;
}

.modal::backdrop {
    background: rgba(2, 6, 23, 0.76);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #24344a;
}

.modal-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr)) auto auto;
    gap: 10px;
    align-items: end;
    padding: 12px 16px;
    border-bottom: 1px solid #24344a;
}

.modal-filter label {
    font-size: 13px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.modal-body {
    padding: 16px;
    overflow: auto;
}

.detail-heading {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(420px, 640px);
    gap: 18px;
    align-items: end;
    margin-bottom: 18px;
}

.detail-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr)) auto auto;
    gap: 10px;
    align-items: end;
}

.detail-filter label {
    font-size: 13px;
}

.detail-panel h2 {
    font-size: 15px;
}

.time-series {
    padding: 14px;
}

.series-scroll,
.detail-table-wrap {
    overflow-x: auto;
}

.series-chart {
    display: block;
    width: 100%;
    min-width: 720px;
    height: 240px;
}

.series-axis {
    stroke: #2b4058;
    stroke-width: 1;
}

.series-line {
    fill: none;
    stroke: #8fb3d9;
    stroke-width: 2;
}

.series-point {
    stroke: #101b2b;
    stroke-width: 2;
}

.series-status,
.series-online {
    fill: #2d8a5b;
}

.series-offline {
    fill: #a9464d;
}

.series-warning {
    fill: #a9852e;
}

.series-paused,
.series-unknown {
    fill: #6a7483;
}

.icon-button {
    width: 34px;
    height: 34px;
    border: 1px solid #2b4058;
    border-radius: 6px;
    background: #0c1725;
    color: #c9d6e4;
    cursor: pointer;
}

.compact-table th,
.compact-table td {
    padding: 8px;
}

.detail-pagination {
    padding: 10px 8px 12px;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-button {
    min-width: 38px;
}

.pagination-button.active {
    background: #3b7db8;
}

.channel-matrix {
    overflow-x: auto;
}

.delivery-summary {
    display: inline-block;
    max-width: 360px;
    overflow-wrap: anywhere;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.span-2 {
    grid-column: span 2;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topnav {
        justify-content: flex-start;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .segmented-control {
        align-self: start;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-topline {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .modal-filter {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 18px 12px;
    }

    .status-category {
        overflow-x: auto;
    }

    .status-category-tools {
        grid-template-columns: 1fr;
    }

    .status-category-links {
        justify-content: flex-start;
    }

    .status-table {
        min-width: 780px;
    }

    .detail-heading,
    .detail-filter {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .split {
        grid-template-columns: 1fr;
    }
}
/* POST logout keeps the existing navigation dimensions. */
.logout-form { margin: 0; display: inline-flex; }
.logout-form button { font-family: inherit; cursor: pointer; background: transparent; }
.logout-form button:hover { background: #331821; }
.archive-chart { display: block; width: 100%; height: 240px; }
