:root {
    --bg: #070b16;
    --panel: #0d1324;
    --panel-soft: #121a2f;
    --border: rgba(148, 163, 184, 0.18);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --primary: #38bdf8;
    --primary-dark: #0284c7;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 18px;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.10), transparent 28rem),
    var(--bg);
}

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

button,
input,
textarea {
    font: inherit;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px;
    background: rgba(7, 11, 22, 0.72);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

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

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #03111f;
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #22c55e);
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.25);
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 2px;
    color: var(--muted);
}

.sidebar-nav {
    display: grid;
    gap: 10px;
}

.nav-link {
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--muted);
    transition: 0.18s ease;
}

.nav-link:hover {
    color: var(--text);
    background: var(--panel-soft);
    border-color: var(--border);
}

.main-panel {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px 36px;
    border-bottom: 1px solid var(--border);
}

.page-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
}

.content {
    padding: 36px;
}

.card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(13, 19, 36, 0.86);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(18, 26, 47, 0.66);
}

.card-header h2 {
    margin: 0;
    font-size: 18px;
}

.card-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.data-table tr:hover td {
    background: rgba(148, 163, 184, 0.05);
}

.text-right {
    text-align: right !important;
}

.actions,
.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.card-actions {
    justify-content: flex-start;
    padding: 22px 24px;
    border-top: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    transition: 0.18s ease;
}

.btn-small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.btn-primary {
    color: #03111f;
    background: linear-gradient(135deg, #38bdf8, #22c55e);
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.10);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.18);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.22);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.22);
}

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

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.16);
}

.badge-muted {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.14);
}

.badge-primary {
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.16);
}

.badge-secondary {
    color: #ddd6fe;
    background: rgba(139, 92, 246, 0.16);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.form-card {
    max-width: 760px;
}

.form-grid {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.form-row {
    display: grid;
    gap: 8px;
}

.form-row label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(7, 11, 22, 0.72);
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
}

.form-control:focus {
    border-color: rgba(56, 189, 248, 0.62);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.10);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 24px;
}

.details-list {
    display: grid;
}

.details-list > div {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.details-list span {
    color: var(--muted);
}

.details-list strong {
    font-weight: 600;
}

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

.alert-success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
}

.alert-danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
}

.empty-state {
    padding: 40px !important;
    color: var(--muted);
    text-align: center;
}

ul {
    margin: 6px 0 0;
    padding-left: 18px;
    color: #fecaca;
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.12), transparent 28rem),
    var(--bg);
}

.auth-card {
    width: min(100%, 440px);
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(13, 19, 36, 0.9);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}

.auth-brand strong,
.auth-brand small {
    display: block;
}

.auth-brand small {
    margin-top: 2px;
    color: var(--muted);
}

.auth-header {
    margin-bottom: 24px;
}

.auth-header h1 {
    margin: 0;
    font-size: 30px;
}

.auth-header p {
    margin: 8px 0 0;
    color: var(--muted);
}

.auth-submit {
    width: 100%;
}

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

    .sidebar {
        position: static;
        height: auto;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

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

@media (max-width: 640px) {
    .content,
    .topbar,
    .sidebar {
        padding: 20px;
    }

    .card-header,
    .card-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .details-list > div {
        grid-template-columns: 1fr;
    }

    .actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.error-page-card {
    width: min(100%, 860px);
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 34px;
    align-items: center;
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(13, 19, 36, 0.94), rgba(18, 26, 47, 0.88)),
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.16), transparent 22rem);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.error-code {
    display: grid;
    place-items: center;
    min-height: 180px;
    border-radius: 24px;
    color: #03111f;
    font-size: 64px;
    font-weight: 900;
    letter-spacing: -0.08em;
    background: linear-gradient(135deg, #38bdf8, #22c55e);
    box-shadow: 0 24px 60px rgba(56, 189, 248, 0.18);
}

.error-kicker {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.error-content h1 {
    margin: 0;
    max-width: 560px;
    font-size: 34px;
    line-height: 1.12;
}

.error-content p {
    max-width: 560px;
    margin: 14px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

@media (max-width: 760px) {
    .error-page-card {
        grid-template-columns: 1fr;
        padding: 26px;
    }

    .error-code {
        min-height: 130px;
        font-size: 48px;
    }

    .error-content h1 {
        font-size: 28px;
    }
}
