* {
    box-sizing: border-box;
}

:root {
    --bg: #0b1020;
    --bg-soft: #121931;
    --panel: #121a2f;
    --panel-2: #18223f;
    --text: #edf2ff;
    --muted: #9fb0d1;
    --primary: #6ea8ff;
    --primary-strong: #4b8cff;
    --success: #19b36b;
    --warning: #f0a84f;
    --danger: #e35353;
    --info: #5fc8ff;
    --border: rgba(255,255,255,.08);
    --shadow: 0 18px 40px rgba(0,0,0,.28);
    --radius: 18px;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(82, 122, 255, .18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(0, 191, 166, .14), transparent 25%),
        var(--bg);
    color: var(--text);
}

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

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-shell {
    width: 100%;
    max-width: 460px;
}

.auth-card,
.panel,
.stat-card,
.sidebar,
.topbar {
    backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.auth-card {
    padding: 28px;
}

.brand,
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #7e72ff);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
}

.brand-subtitle,
.small,
.muted {
    color: var(--muted);
}

.stack,
.grid-form,
.split-grid,
.actions-inline {
    display: grid;
    gap: 16px;
}

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

.field-full {
    grid-column: 1 / -1;
}

.field {
    display: grid;
    gap: 8px;
}

.field label {
    font-size: .92rem;
    color: #d8e2ff;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.04);
    color: var(--text);
    padding: 12px 14px;
    outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: rgba(110, 168, 255, .6);
    box-shadow: 0 0 0 4px rgba(110, 168, 255, .12);
}

.checkbox-field {
    display: flex;
    align-items: center;
}

.checkbox-field label {
    display: flex;
    gap: 8px;
    align-items: center;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: white;
    cursor: pointer;
    font-weight: 700;
}

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

.button-secondary {
    background: rgba(255,255,255,.06);
}

.button-danger {
    background: linear-gradient(135deg, #ef6565, #d43f3f);
}

.button-small {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: .9rem;
}

.full {
    width: 100%;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    padding: 24px;
}

.sidebar {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid transparent;
}

.nav a:hover,
.nav a.is-active {
    background: rgba(255,255,255,.08);
    border-color: var(--border);
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.main {
    display: grid;
    gap: 18px;
    align-content: start;
}

.topbar {
    padding: 22px 24px;
}

.topbar h1,
.panel h2 {
    margin: 0 0 8px;
}

.panel {
    padding: 22px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 18px;
}

.toolbar {
    display: flex;
    justify-content: flex-end;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.cards-grid-six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.stat-card {
    padding: 20px;
}

.stat-label {
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
}

.compact-table th,
.compact-table td {
    padding: 10px 8px;
}

.alert {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.alert-success {
    background: rgba(25, 179, 107, .12);
    color: #bdf5d8;
}

.alert-error {
    background: rgba(227, 83, 83, .12);
    color: #ffd1d1;
}

.badge,
code {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .85rem;
}

code {
    background: rgba(255,255,255,.06);
}

.badge {
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.06);
}

.badge-success { background: rgba(25, 179, 107, .12); color: #bdf5d8; }
.badge-danger { background: rgba(227, 83, 83, .12); color: #ffd1d1; }
.badge-warning { background: rgba(240, 168, 79, .14); color: #ffe2bb; }
.badge-info { background: rgba(95, 200, 255, .12); color: #d2efff; }
.badge-neutral { background: rgba(255,255,255,.06); color: #ebf0ff; }

.actions-inline {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
    justify-content: start;
}

.form-panel {
    max-width: 1100px;
}

@media (max-width: 1400px) {
    .cards-grid-six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .grid-form,
    .cards-grid,
    .cards-grid-six {
        grid-template-columns: 1fr;
    }

    .actions-inline {
        grid-auto-flow: row;
        grid-auto-columns: 1fr;
    }
}
