:root {
    --eoc-bg: #06111f;
    --eoc-surface: #0d1b2d;
    --eoc-surface-strong: #12243a;
    --eoc-line: rgba(255, 255, 255, 0.08);
    --eoc-text: #edf4fb;
    --eoc-muted: #8ba0b5;
    --eoc-blue: #3aa7ff;
    --eoc-green: #2fbd73;
    --eoc-yellow: #f4c74b;
    --eoc-orange: #ff8a3d;
    --eoc-red: #f15656;
    --eoc-gray: #718295;
    --eoc-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.eoc-shell {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top right, rgba(58, 167, 255, 0.18), transparent 26%),
        radial-gradient(circle at left center, rgba(241, 86, 86, 0.14), transparent 24%),
        linear-gradient(180deg, #081321 0%, #06111f 100%);
    color: var(--eoc-text);
    min-height: 100vh;
}

[hidden] {
    display: none !important;
}

.eoc-topbar,
.hero-command,
.zone-card,
.login-card,
.modal-card,
.stat-panel {
    backdrop-filter: blur(18px);
}

.eoc-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(7, 20, 33, 0.82);
    border-bottom: 1px solid var(--eoc-line);
}

.eoc-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    color: inherit;
    text-decoration: none;
}

.eoc-brand strong,
.zone-head h2,
.hero-command h1,
.login-card h1 {
    font-family: 'Sora', sans-serif;
}

.eoc-brand-mark {
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #2a7dff, #0f315c);
    box-shadow: 0 10px 30px rgba(58, 167, 255, 0.28);
}

.eoc-brand small {
    display: block;
    color: var(--eoc-muted);
}

.eoc-nav-links {
    display: inline-flex;
    gap: 1rem;
}

.eoc-nav-links a,
.ghost-btn {
    color: var(--eoc-muted);
    text-decoration: none;
}

.eoc-main {
    padding: 1.5rem;
}

.login-view,
.dashboard-view {
    max-width: 1480px;
    margin: 0 auto;
}

.login-view {
    min-height: calc(100vh - 100px);
    display: grid;
    place-items: center;
}

.login-card,
.modal-card,
.zone-card,
.stat-panel {
    background: rgba(13, 27, 45, 0.88);
    border: 1px solid var(--eoc-line);
    border-radius: 1.4rem;
    box-shadow: var(--eoc-shadow);
}

.login-card {
    width: min(100%, 540px);
    padding: 2rem;
}

.login-kicker,
.zone-kicker,
.hero-kicker {
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #66b8ff;
    margin-bottom: 0.45rem;
}

.login-form,
.field-form,
.activation-form {
    display: grid;
    gap: 1rem;
}

.field-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-form label:first-child,
.field-form label:nth-child(2),
.activation-form label,
.field-form button {
    grid-column: span 3;
}

label {
    display: grid;
    gap: 0.4rem;
    font-size: 0.92rem;
    color: var(--eoc-muted);
}

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

input,
textarea,
select {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(4, 13, 23, 0.6);
    color: var(--eoc-text);
}

button {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    padding: 0.9rem 1.25rem;
}

.primary-btn {
    color: #06111f;
    background: linear-gradient(135deg, #f4c74b, #ff8a3d);
    font-weight: 800;
}

.secondary-btn {
    color: white;
    background: linear-gradient(135deg, #3aa7ff, #1c5fb5);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--eoc-line);
}

.primary-btn-block {
    width: 100%;
}

.inline-error {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.8rem;
    background: rgba(241, 86, 86, 0.12);
    color: #ffb3b3;
}

.ops-pill,
.meta-chip,
.state-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
}

.ops-pill-blue,
.state-badge-blue {
    background: rgba(58, 167, 255, 0.14);
    color: #80c6ff;
}

.state-badge-green { background: rgba(47, 189, 115, 0.14); color: #93efbc; }
.state-badge-yellow { background: rgba(244, 199, 75, 0.14); color: #f7db89; }
.state-badge-orange { background: rgba(255, 138, 61, 0.14); color: #ffb47e; }
.state-badge-red { background: rgba(241, 86, 86, 0.14); color: #ffb5b5; }
.state-badge-gray { background: rgba(113, 130, 149, 0.14); color: #b1bfcc; }

.hero-command,
.zone-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.hero-command {
    margin-bottom: 1.4rem;
    padding: 1.5rem 1.7rem;
    border-radius: 1.4rem;
    border: 1px solid var(--eoc-line);
    background: linear-gradient(135deg, rgba(18, 36, 58, 0.96), rgba(11, 22, 37, 0.92));
}

.hero-copy {
    max-width: 60ch;
    color: var(--eoc-muted);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.8rem;
}

.stats-grid,
.dashboard-grid,
.section-board-grid {
    display: grid;
    gap: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.stat-panel {
    padding: 1.1rem 1.2rem;
}

.stat-panel span {
    display: block;
    color: var(--eoc-muted);
    margin-bottom: 0.5rem;
}

.stat-panel strong {
    font-size: 2rem;
}

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

.zone-card {
    padding: 1rem 1rem 1.1rem;
    min-height: 220px;
    grid-column: span 4;
}

.zone-card-wide {
    grid-column: span 8;
}

.zone-head {
    margin-bottom: 1rem;
}

.stack-list,
.table-list {
    display: grid;
    gap: 0.75rem;
}

.stack-item,
.table-row,
.section-board {
    padding: 0.9rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.section-board h3,
.stack-item strong,
.table-row strong {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.section-board p,
.stack-item p,
.table-row p,
.stack-item small,
.table-row small {
    margin: 0;
    color: var(--eoc-muted);
}

.section-task-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.task-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-radius: 0.85rem;
    background: rgba(4, 13, 23, 0.5);
}

.task-actions {
    display: inline-flex;
    gap: 0.4rem;
}

.task-actions button {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
}

.map-shell {
    height: 360px;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 9, 17, 0.72);
}

.modal-card {
    width: min(900px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
}

.toast-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    gap: 0.65rem;
    z-index: 50;
}

.toast {
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    color: white;
    background: rgba(7, 20, 33, 0.92);
    border: 1px solid var(--eoc-line);
    box-shadow: var(--eoc-shadow);
}

@media (max-width: 1180px) {
    .stats-grid,
    .section-board-grid,
    .field-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .zone-card,
    .zone-card-wide,
    .field-form label:first-child,
    .field-form label:nth-child(2),
    .field-form button {
        grid-column: span 2;
    }
}

@media (max-width: 820px) {
    .eoc-topbar,
    .hero-command,
    .zone-head,
    .modal-actions {
        flex-direction: column;
    }

    .stats-grid,
    .dashboard-grid,
    .section-board-grid,
    .field-form {
        grid-template-columns: 1fr;
    }

    .zone-card,
    .zone-card-wide,
    .field-form label:first-child,
    .field-form label:nth-child(2),
    .field-form button {
        grid-column: span 1;
    }

    .eoc-nav-links {
        display: none;
    }
}
