:root {
    --bg: #07121f;
    --panel: #0d1f35;
    --panel-2: #102844;
    --border: #1d4265;
    --text: #e3edf8;
    --muted: #92a7bc;
    --accent: #00d4ff;
    --green: #4caf50;
    --red: #f44336;
    --orange: #ff9800;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(0, 212, 255, 0.12), transparent 24%),
        linear-gradient(180deg, #081527 0%, #06111d 100%);
    color: var(--text);
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.shell__sidebar {
    border-right: 1px solid var(--border);
    background: rgba(10, 22, 40, 0.96);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.shell__content {
    padding: 1.5rem;
    overflow: auto;
}

.brand h1,
.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.brand p,
.page-header p,
.section-panel__header p,
.status-card__subtitle {
    color: var(--muted);
}

.brand--login p {
    margin-top: 0.5rem;
}

.shell__nav {
    display: grid;
    gap: 0.5rem;
}

.shell__nav .active,
.shell__nav a:hover {
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent);
    border-color: rgba(0, 212, 255, 0.35);
}

.shell__nav a {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: var(--muted);
    transition: 0.2s ease;
}

.glass-panel,
.status-card {
    background: linear-gradient(180deg, rgba(16, 40, 68, 0.94), rgba(11, 29, 49, 0.96));
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

.page-header,
.status-grid,
.content-grid,
.section-panel,
.board-group,
.login-panel {
    margin-bottom: 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.toolbar,
.button-row,
.inline-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

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

.status-card {
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    min-height: 120px;
}

.status-card__label {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.status-card__value {
    margin-top: 0.8rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.status-card__icon {
    color: rgba(0, 212, 255, 0.2);
    font-size: 2rem;
    align-self: center;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1rem;
}

.section-panel {
    padding: 1.25rem;
}

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

.section-panel__header h2,
.board-group h3 {
    margin: 0;
}

.table-wrap {
    overflow: auto;
}

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

.monitor-table th,
.monitor-table td {
    text-align: left;
    padding: 0.85rem;
    border-bottom: 1px solid rgba(29, 66, 101, 0.7);
    vertical-align: top;
}

.monitor-table th {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.monitor-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.pill {
    display: inline-flex;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.25);
    color: var(--accent);
}

.button,
.input,
.select {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(7, 18, 31, 0.8);
    color: var(--text);
    padding: 0.7rem 0.9rem;
}

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

.input--small {
    width: 84px;
    min-width: 84px;
}

.button {
    cursor: pointer;
    transition: 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 212, 255, 0.4);
}

.button--primary {
    background: linear-gradient(135deg, #0f8fb1, #00d4ff);
    color: #04111d;
    border-color: transparent;
    font-weight: 700;
}

.button--danger {
    background: rgba(244, 67, 54, 0.12);
    color: #ffb7b0;
}

.button--ghost {
    width: 100%;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 0.75rem;
}

.board-cell {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem 0.7rem;
    background: rgba(16, 40, 68, 0.7);
    display: grid;
    gap: 0.4rem;
    justify-items: center;
}

.board-cell--active {
    border-color: rgba(76, 175, 80, 0.45);
    background: rgba(76, 175, 80, 0.12);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

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

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

.login-form label {
    display: grid;
    gap: 0.5rem;
}

.alert {
    padding: 0.9rem 1rem;
    border: 1px solid rgba(244, 67, 54, 0.35);
    background: rgba(244, 67, 54, 0.12);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.logout-form {
    margin-top: auto;
}

@media (max-width: 1100px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .status-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

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