:root {
    color-scheme: dark;
    --bg: #050a11;
    --panel: rgba(10, 20, 34, .88);
    --panel2: rgba(15, 29, 49, .88);
    --line: rgba(87, 178, 255, .18);
    --blue: #13adff;
    --blue2: #0875e1;
    --text: #f4f8fc;
    --muted: #8fa2b7;
    --good: #3ee59c;
    --bad: #ff647c;
    --warning: #ffc857;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

button,
input,
select,
textarea {
    font: inherit;
}

.background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% -20%, rgba(0, 169, 255, .25), transparent 45%),
        linear-gradient(135deg, #05090f 0%, #08131f 50%, #05080d 100%);
}

.shell {
    position: relative;
    min-height: 100vh;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 26px;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.login-card {
    width: min(430px, 100%);
    margin: 7vh auto 0;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(14, 28, 47, .95), rgba(6, 13, 23, .96));
    box-shadow: 0 30px 100px rgba(0, 0, 0, .45), 0 0 60px rgba(0, 157, 255, .08);
    backdrop-filter: blur(20px);
}

.logo {
    display: block;
    width: 150px;
    max-width: 45%;
    margin: 0 auto 24px;
    border-radius: 28px;
    box-shadow: 0 14px 48px rgba(0, 143, 255, .2);
}

.eyebrow {
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
}

h1 {
    margin: 7px 0 4px;
    font-size: 35px;
}

h2 {
    margin: 7px 0 7px;
}

.subtitle {
    color: var(--muted);
    margin: 0 0 28px;
}

label {
    display: block;
    margin: 15px 0 7px;
    color: #c6d2df;
    font-size: 13px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #203a54;
    border-radius: 12px;
    outline: none;
    background: #07111c;
    color: white;
    transition: .2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(19, 173, 255, .12);
}

textarea {
    resize: vertical;
}

button {
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    color: white;
    font-weight: 750;
    background: linear-gradient(135deg, var(--blue), var(--blue2));
    box-shadow: 0 10px 30px rgba(0, 142, 255, .2);
    padding: 12px 17px;
}

button:hover {
    filter: brightness(1.08);
}

.login-card button[type="submit"] {
    width: 100%;
    margin-top: 22px;
    padding: 14px 18px;
}

button.secondary {
    background: #122235;
    box-shadow: none;
    border: 1px solid #28445f;
}

.error {
    min-height: 20px;
    margin-top: 14px;
    color: var(--bad);
    font-size: 13px;
}

.app {
    flex: 1;
}

.topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: rgba(7, 16, 28, .85);
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-button {
    padding: 0;
    background: transparent;
    box-shadow: none;
    justify-self: start;
    text-align: left;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.nav {
    display: flex;
    gap: 5px;
    padding: 4px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 13px;
}

.nav-button {
    padding: 9px 12px;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
}

.nav-button.active {
    background: #12283c;
    color: white;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
}

.hero,
.module-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    padding: 52px 6px 30px;
}

.hero h2,
.module-hero h2 {
    font-size: clamp(36px, 6vw, 64px);
    line-height: 1;
}

.hero p,
.module-hero p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
}

.status-pill {
    white-space: nowrap;
    padding: 10px 14px;
    border: 1px solid #314861;
    border-radius: 999px;
    color: var(--muted);
    background: #0c1724;
}

.status-pill.good {
    color: var(--good);
    border-color: rgba(62, 229, 156, .3);
    background: rgba(62, 229, 156, .07);
}

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

.card {
    min-height: 178px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, var(--panel2), var(--panel));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
    text-align: left;
}

.card.future {
    opacity: .64;
}

.card-button {
    color: var(--text);
}

.card-button:hover {
    transform: translateY(-2px);
    border-color: rgba(19, 173, 255, .45);
    box-shadow: 0 16px 40px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.04);
}

.card-label {
    color: var(--blue);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .17em;
}

.card h3 {
    margin: 13px 0 24px;
    font-size: 18px;
}

.metric,
.endpoint {
    margin-bottom: 6px;
    font-size: 24px;
    font-weight: 800;
}

.metric.good {
    color: var(--good);
}

.metric.bad {
    color: var(--bad);
}

.endpoint {
    font-size: 18px;
    word-break: break-all;
}

.card small {
    color: var(--muted);
}

.module-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar {
    display: grid;
    grid-template-columns: 1fr 230px;
    gap: 12px;
    margin-bottom: 16px;
}

.radio-list {
    display: grid;
    gap: 12px;
}

.radio-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(120px, .7fr)) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(15,29,49,.88), rgba(8,17,29,.9));
}

.radio-row.inactive {
    opacity: .62;
}

.radio-primary strong,
.radio-primary span,
.radio-cell strong,
.radio-cell span {
    display: block;
}

.radio-primary strong {
    font-size: 17px;
}

.radio-primary span,
.radio-cell span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.radio-cell strong {
    font-size: 13px;
    font-weight: 650;
}

.radio-actions {
    display: flex;
    gap: 8px;
}

.small-button {
    padding: 8px 11px;
    box-shadow: none;
}

.danger {
    background: rgba(255,100,124,.12);
    border: 1px solid rgba(255,100,124,.3);
    color: #ff9baa;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    background: rgba(62,229,156,.09);
    color: var(--good);
    border: 1px solid rgba(62,229,156,.22);
}

.badge.inactive {
    color: var(--muted);
    border-color: #314861;
    background: #0c1724;
}

.empty-state {
    padding: 60px 25px;
    text-align: center;
    border: 1px dashed #28445f;
    border-radius: 20px;
    background: rgba(8,18,31,.65);
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 24px;
}

.empty-state p {
    margin: 0 0 22px;
    color: var(--muted);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(7px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid #23425f;
    border-radius: 24px;
    padding: 24px;
    background: #08131f;
    box-shadow: 0 30px 100px rgba(0,0,0,.55);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.modal-header h2 {
    margin-top: 5px;
    font-size: 30px;
}

.icon-button {
    width: 42px;
    height: 42px;
    padding: 0;
    background: #102337;
    box-shadow: none;
    font-size: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

.field {
    min-width: 0;
}

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

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.toggle-row input {
    width: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.copyright-footer {
    margin-top: 50px;
    padding: 24px 8px 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    color: #657b90;
    text-align: left;
}

.copyright-logo {
    display: block;
    width: 78px;
    max-height: 48px;
    object-fit: contain;
    opacity: .82;
}

.copyright-footer strong,
.copyright-footer span {
    display: block;
}

.copyright-footer strong {
    color: #91a5b8;
    font-size: 12px;
}

.copyright-footer span {
    margin-top: 3px;
    font-size: 11px;
}

@media (max-width: 1000px) {
    .topbar {
        grid-template-columns: 1fr auto;
    }

    .nav {
        grid-row: 2;
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .nav-button {
        flex: 1;
    }

    .radio-row {
        grid-template-columns: 1fr 1fr;
    }

    .radio-actions {
        grid-column: 1 / -1;
    }
}

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

    .hero,
    .module-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 570px) {
    .shell {
        width: min(100% - 20px, 1280px);
        padding-top: 10px;
    }

    .login-card {
        margin-top: 10px;
        padding: 24px;
    }

    .grid,
    .toolbar,
    .form-grid,
    .radio-row {
        grid-template-columns: 1fr;
    }

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

    .top-actions {
        align-items: flex-end;
    }

    .hero,
    .module-hero {
        padding-top: 35px;
    }

    .module-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .modal {
        padding: 8px;
    }

    .modal-panel {
        max-height: calc(100vh - 16px);
        padding: 18px;
    }

    .copyright-footer {
        flex-direction: column;
        text-align: center;
    }
}

/* EGELUND-PTT-FOOTER-STACK-R18C */

.copyright-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 8px !important;
}

.copyright-footer > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 2px !important;
}

.copyright-logo {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
