* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: #f2f2f2;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06), transparent 30%),
        repeating-linear-gradient(
            180deg,
            #1f1f1f 0,
            #1f1f1f 3px,
            #171717 3px,
            #171717 7px
        );
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card,
.panel-shell {
    width: min(1600px, calc(100vw - 32px));
    border: 1px solid #3e3e3e;
    border-radius: 18px;
    background: rgba(31, 31, 31, 0.92);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.login-card {
    max-width: 420px;
    padding: 28px;
}

.login-card h1,
.panel-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    letter-spacing: 0.03em;
}

.login-card p,
.panel-header p,
.muted {
    margin: 0;
    color: #b8b8b8;
}

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

input[type=password],
input[type=number] {
    width: 100%;
    padding: 10px 12px;
    color: #f2f2f2;
    border: 1px solid #565656;
    border-radius: 8px;
    background: #2a2a2a;
}

button,
.ghost-button {
    appearance: none;
    border: 1px solid #6b6b6b;
    border-radius: 8px;
    background: linear-gradient(180deg, #676767, #4d4d4d);
    color: #f4f4f4;
    padding: 10px 14px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
}

button:hover,
.ghost-button:hover {
    filter: brightness(1.08);
}

.panel-shell {
    margin: 24px auto;
    padding: 20px;
}

.panel-header,
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.toolbar {
    margin-top: 18px;
    flex-wrap: wrap;
}

.header-status,
.action-group,
.tab-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-running {
    background: #184c2a;
    color: #9ef0b5;
}

.status-stopped {
    background: #4d1f1f;
    color: #ffb4b4;
}

.flash {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(80, 80, 80, 0.7);
}

.flash-error {
    background: rgba(120, 25, 25, 0.8);
}

.tab-panel {
    display: none;
    margin-top: 18px;
}

.tab-panel.is-active {
    display: block;
}

.tab-link.is-active {
    background: linear-gradient(180deg, #8b8b8b, #646464);
}

.table-wrap {
    overflow: auto;
    border: 1px solid #444;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
}

th,
td {
    border: 1px solid #3f3f3f;
    padding: 10px 8px;
    vertical-align: middle;
    background: rgba(84, 84, 84, 0.88);
}

th {
    background: linear-gradient(180deg, #585858, #3f3f3f);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 12px;
}

.inline-form {
    display: inline;
}

.inline-danger button {
    background: linear-gradient(180deg, #7c4444, #5b2f2f);
}

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

.log-box {
    min-height: 520px;
    margin: 0;
    padding: 16px;
    border: 1px solid #444;
    border-radius: 12px;
    background: rgba(84, 84, 84, 0.88);
    overflow: auto;
    white-space: pre-wrap;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .panel-header,
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .action-group,
    .tab-links,
    .header-status {
        width: 100%;
    }

    button,
    .ghost-button {
        width: 100%;
        text-align: center;
    }
}
