:root {
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --primary-color: #E30613;
    --primary-hover: #B30510;
    --secondary-color: #2a2f38;
    --sidebar-bg: #121417;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --fg: #121417;
    --muted: #6b7380;
    --border: #e0e0e0;
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: "Figtree", "Segoe UI", system-ui, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

.page {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.nav-menu {
    padding: 16px 0;
}

.logo-section {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
}

.logo-section h3 {
    color: white;
    margin: 0;
    font-family: "Outfit", "Segoe UI", system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #e0e0e0;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: rgba(227, 6, 19, 0.5);
}

.nav-link.active {
    background-color: var(--primary-color);
    border-left-color: #9b0410;
    color: white;
    font-weight: 600;
}

.nav-link i {
    margin-right: 10px;
    font-size: 1.15rem;
}

main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-row {
    height: var(--topbar-height);
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px;
    box-shadow: none;
}

.content {
    flex: 1;
    background-color: var(--bg);
}

/* Login Layout — brand dark, no blue */
.empty-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(227, 6, 19, 0.22), transparent 55%),
        linear-gradient(160deg, #121417 0%, #1a1d24 55%, #121417 100%);
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    min-height: 100vh;
    padding: 20px 20px 32px;
}

.login-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 40px;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.08);
    max-width: 400px;
    width: 100%;
    flex-shrink: 0;
}

.login-footer {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

.login-footer a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: none;
    margin-bottom: 20px;
}

.card-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

/* Tables */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:hover {
    background-color: #eef1f5;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 16px;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: none;
}

.btn-group-sm .btn {
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 10px 15px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}

.form-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--fg);
}

/* Badges */
.badge {
    padding: 6px 10px;
    font-weight: 600;
    border-radius: 6px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    main {
        margin-left: 0;
    }

    .page {
        flex-direction: column;
    }
}

/* Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

