:root {
    --ink: #0e1a22;
    --panel: rgba(9, 27, 35, 0.78);
    --panel-strong: rgba(8, 23, 30, 0.92);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4efe6;
    --muted: #9fb0b8;
    --teal: #6fe0c2;
    --amber: #ffbf69;
    --coral: #ff7a59;
    --blue: #8dd0ff;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Space Grotesk", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(111, 224, 194, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(255, 191, 105, 0.18), transparent 24%),
        linear-gradient(160deg, #071015 0%, #0f1d25 48%, #15252d 100%);
    display: flex;
    flex-direction: column;
}

.ambient {
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(40px);
    opacity: 0.65;
    pointer-events: none;
}

.ambient-one {
    width: 280px;
    height: 280px;
    background: rgba(111, 224, 194, 0.14);
    top: 5rem;
    right: 4rem;
}

.ambient-two {
    width: 220px;
    height: 220px;
    background: rgba(255, 122, 89, 0.12);
    bottom: 4rem;
    left: 4rem;
}

.signin-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1.5rem;
}

.signin-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
}

.signin-panel,
.signin-aside,
.hero-card,
.table-card,
.detail-card,
.metric-card,
.summary-card {
    background: var(--panel);
    border: 1px solid var(--line);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.signin-panel,
.signin-aside,
.hero-card,
.table-card,
.detail-card {
    border-radius: 28px;
}

.signin-panel {
    padding: 3rem;
}

.signin-aside {
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    align-content: center;
}

.metric-card,
.summary-card {
    border-radius: 22px;
    padding: 1.1rem 1.2rem;
}

.metric-card span,
.summary-card span,
.eyebrow,
.subtle {
    color: var(--muted);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    margin: 0 0 0.6rem;
}

.lead {
    max-width: 52ch;
    line-height: 1.6;
    color: #dbe2e5;
}

.signin-form,
.detail-form {
    display: grid;
    gap: 0.8rem;
}

label {
    font-size: 0.88rem;
    color: var(--muted);
}

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

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(111, 224, 194, 0.35);
    border-color: rgba(111, 224, 194, 0.55);
}

.primary-button,
.ghost-button {
    border-radius: 999px;
    padding: 0.9rem 1.3rem;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.primary-button {
    border: 0;
    color: #09151b;
    font-weight: 700;
    background: linear-gradient(135deg, var(--amber), var(--teal));
}

.ghost-button {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    color: var(--text);
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.error-banner {
    border-radius: 16px;
    padding: 0.9rem 1rem;
    color: #fff3ef;
    background: rgba(255, 122, 89, 0.18);
    border: 1px solid rgba(255, 122, 89, 0.25);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 2rem 2rem 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-pill,
.state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.page-grid {
    display: grid;
    gap: 1.4rem;
    padding: 1.5rem 2rem 2rem;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
    grid-template-areas:
        "hero hero"
        "summary detail"
        "table detail";
    flex: 1 0 auto;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 2rem 1.5rem;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.hero-card {
    grid-area: hero;
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.6rem;
}

.hero-actions {
    display: grid;
    align-content: center;
    justify-items: end;
    gap: 0.8rem;
}

.summary-grid {
    grid-area: summary;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.summary-card strong,
.metric-card strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.15rem;
    line-height: 1.4;
}

.table-card {
    grid-area: table;
    padding: 1.2rem;
}

.detail-card {
    grid-area: detail;
    padding: 1.2rem;
    align-self: start;
    position: sticky;
    top: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
    min-width: 180px;
}

.toggle {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.toggle input {
    width: auto;
}

.table-shell {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

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

th,
td {
    padding: 0.9rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

thead th {
    position: sticky;
    top: 0;
    background: var(--panel-strong);
    z-index: 1;
}

tbody tr {
    cursor: pointer;
    transition: background 0.18s ease;
}

tbody tr:hover,
tbody tr.active {
    background: rgba(255, 255, 255, 0.05);
}

.mono {
    font-family: "IBM Plex Mono", monospace;
}

.state-pill {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.state-in_use {
    background: rgba(255, 122, 89, 0.18);
    color: #ffd5cc;
}

.state-reserved,
.state-planned {
    background: rgba(255, 191, 105, 0.18);
    color: #ffdfa8;
}

.state-available {
    background: rgba(111, 224, 194, 0.18);
    color: #c8fff2;
}

.state-firewall_open {
    background: rgba(141, 208, 255, 0.18);
    color: #dbf2ff;
}

.state-closed,
.state-retired {
    background: rgba(255, 255, 255, 0.09);
    color: #d7e0e3;
}

.detail-meta {
    border-radius: 16px;
    padding: 0.95rem 1rem;
    margin-bottom: 0.5rem;
    color: #dce7ea;
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 1080px) {
    .page-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "hero"
            "summary"
            "detail"
            "table";
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-card {
        position: static;
    }
}

@media (max-width: 760px) {
    .signin-shell,
    .topbar,
    .hero-card {
        grid-template-columns: 1fr;
        display: grid;
    }

    .topbar,
    .page-grid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .app-footer {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 1rem;
        flex-direction: column;
    }

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

    .toolbar {
        width: 100%;
    }

    .toolbar input,
    .toolbar select {
        min-width: 100%;
    }
}
