:root {
    color-scheme: light;
    --bg: #0b0f18;
    --bg-2: #111a2b;
    --panel: rgba(255, 255, 255, 0.07);
    --panel-strong: rgba(255, 255, 255, 0.12);
    --text: #f7f8ff;
    --text-strong: #ffffff;
    --muted: rgba(245, 247, 255, 0.65);
    --accent: #45f0b2;
    --accent-2: #ffd166;
    --danger: #ff6b6b;
    --focus: #8ab4ff;
    --shadow: 0 22px 70px rgba(4, 8, 20, 0.5);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: 180ms ease;
    font-family: "Optima", "Candara", "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 12% 10%, rgba(69, 240, 178, 0.25), transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(255, 209, 102, 0.22), transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(63, 120, 255, 0.18), transparent 50%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 8px);
    color: var(--text);
    line-height: 1.5;
}

.bg-orb {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    opacity: 0.24;
    z-index: 0;
    animation: float 14s ease-in-out infinite;
    mix-blend-mode: screen;
}

.bg-orb--one {
    background: radial-gradient(circle, #45f0b2, transparent 70%);
    top: -160px;
    left: -120px;
}

.bg-orb--two {
    background: radial-gradient(circle, #ffd166, transparent 70%);
    bottom: -180px;
    right: -120px;
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(18px);
    }
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(18px);
    background: rgba(8, 10, 18, 0.78);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 8vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 12px 30px rgba(4, 8, 16, 0.35);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand__logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(8, 12, 20, 0.7);
    padding: 4px;
    object-fit: contain;
    box-shadow: 0 10px 28px rgba(4, 8, 20, 0.35);
}

.tm {
    font-size: 0.7em;
    vertical-align: super;
    margin-left: 6px;
    letter-spacing: 0.08em;
}

.brand__mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(140deg, #45f0b2, #335cff);
    box-shadow: var(--shadow);
}

h1 {
    margin: 0;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    color: var(--text-strong);
}

.sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.96rem;
}

.layout {
    position: relative;
    z-index: 1;
    padding: 36px 8vw 80px;
    display: grid;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.panel {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.panel__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
}

.stat {
    background: var(--panel-strong);
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.stat strong {
    font-size: 1.75rem;
}

.controls__row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.input,
.select,
.textarea {
    background: rgba(8, 12, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--text);
    padding: 12px 14px;
    font-size: 0.95rem;
    outline: none;
    transition: border var(--transition), box-shadow var(--transition);
}

.input::placeholder,
.textarea::placeholder {
    color: rgba(245, 247, 255, 0.45);
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(69, 240, 178, 0.2);
}

.table__header,
.table__row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: center;
}

.table__header {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table__row {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background var(--transition);
}

.table__row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table__row:last-child {
    border-bottom: none;
}

.server-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.server-name small {
    color: var(--muted);
    word-break: break-all;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    text-transform: capitalize;
}

.status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 10px rgba(255, 209, 102, 0.7);
}

.status.running::before {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(69, 240, 178, 0.7);
}

.status.stopped::before {
    background: var(--danger);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.7);
}

.btn {
    background: linear-gradient(135deg, #45f0b2, #36a7ff);
    color: #071018;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(58, 178, 255, 0.25);
}

.btn:focus-visible,
.btn--ghost:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn--danger {
    background: linear-gradient(135deg, #ff6b6b, #ff8b5f);
    color: #110708;
}

.action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail {
    display: none;
}

.detail.open {
    display: block;
}

.detail__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.detail__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.detail__actions {
    margin: 14px 0 6px;
    display: grid;
    gap: 8px;
}

.detail__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.detail__split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.detail__stack {
    background: rgba(6, 10, 20, 0.55);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 12px;
}

.detail__item span {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 6px;
}

.icon {
    font-size: 0.95em;
    opacity: 0.85;
}

.stat span .icon,
.detail__card h3 .icon,
.detail__item span .icon,
.panel h2 .icon {
    margin-right: 8px;
}

.detail__item strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.quick-actions__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.quick-actions__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.detail__card {
    background: var(--panel-strong);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail__card h3 {
    margin: 0 0 8px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.detail__card p {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-strong);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.detail__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.metric {
    background: rgba(6, 10, 20, 0.6);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric canvas {
    width: 100%;
    height: auto;
    margin-top: 8px;
}

.detail__raw {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--muted);
    word-break: break-word;
    white-space: pre-wrap;
    font-family: "Cascadia Code", "Consolas", "Courier New", monospace;
}

.activity {
    display: grid;
    gap: 12px;
}

.activity__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    background: rgba(6, 10, 20, 0.55);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.activity__title {
    font-weight: 600;
    color: var(--text-strong);
}

.activity__meta {
    margin-top: 4px;
    font-size: 0.82rem;
    color: var(--muted);
}

.activity__message {
    margin-top: 6px;
    font-size: 0.84rem;
    color: rgba(245, 247, 255, 0.7);
}

.activity__status {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.activity__status--requested {
    border-color: rgba(255, 209, 102, 0.4);
    color: #ffd166;
}

.activity__status--success {
    border-color: rgba(69, 240, 178, 0.4);
    color: #45f0b2;
}

.activity__status--failed {
    border-color: rgba(255, 107, 107, 0.4);
    color: #ff6b6b;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chip {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(15, 20, 34, 0.95);
    padding: 14px 18px;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition), transform var(--transition);
    z-index: 3;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.footer {
    position: relative;
    z-index: 1;
    padding: 24px 8vw 40px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 10, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.login-card {
    max-width: 440px;
    margin: 8vh auto 0;
}

.form {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.form-field span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.85rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.form-row .input {
    min-width: 220px;
}

.form-row .input,
.form-row .select {
    flex: 1 1 220px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.form-error {
    color: var(--danger);
    font-size: 0.9rem;
    margin: 0;
    min-height: 1.2em;
}

.simple-table {
    display: grid;
    gap: 8px;
}

.simple-table__header,
.simple-table__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    align-items: center;
}

.simple-table__header {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.simple-table__row {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.simple-table__row span {
    word-break: break-word;
}

.modal.open {
    display: flex;
}

.modal__card {
    background: #0c101b;
    border-radius: 16px;
    padding: 24px;
    max-width: 520px;
    width: 92%;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.modal__hint {
    color: var(--muted);
    margin-top: 4px;
}

.empty {
    padding: 18px 0;
    color: var(--muted);
}

@media (max-width: 960px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .layout {
        padding: 28px 6vw 60px;
    }

    .table__header {
        display: none;
    }

    .table__row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px 0;
    }

    .detail__header {
        align-items: stretch;
    }

    .detail__actions {
        margin-top: 10px;
    }
}

@media (max-width: 720px) {
    .topbar {
        padding: 14px 6vw;
    }

    .brand {
        align-items: flex-start;
        gap: 12px;
    }

    .brand__logo {
        width: 36px;
        height: 36px;
    }

    h1 {
        font-size: 1.25rem;
    }

    .sub {
        font-size: 0.88rem;
    }

    .topbar__actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .chip {
        width: 100%;
        text-align: left;
    }

    .topbar__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .layout {
        padding: 24px 6vw 60px;
    }

    .panel {
        padding: 18px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .controls__row .input,
    .controls__row .select {
        flex: 1 1 100%;
    }

    .activity__item {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bg-orb,
    .btn,
    .toast {
        animation: none;
        transition: none;
    }
}
