:root {
    --sidebar-width: 260px;
    --dmg-red: #E30613;
    --dmg-red-dark: #B80510;
    --dmg-red-light: #FF0717;
    --sidebar-bg: #f8f9fa;
    --sidebar-hover: rgba(227, 6, 19, 0.08);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
}

/* --- Sidebar ------------------------------------------------------- */

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, var(--sidebar-bg) 100%);
    color: #212529;
    overflow-y: auto;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    border-right: 1px solid #dee2e6;
    z-index: 1030;
}

.sidebar-header {
    background-color: rgba(227, 6, 19, 0.05);
    border-bottom: 2px solid var(--dmg-red);
    padding: 1.5rem 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
}

.logo-img {
    max-width: 150px;
    height: auto;
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    letter-spacing: 0.05em;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.65rem 1rem;
    border-radius: 0.375rem;
    margin: 0.15rem 0.75rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--dmg-red);
    border-left-color: var(--dmg-red);
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, var(--dmg-red) 0%, var(--dmg-red-dark) 100%);
    color: #fff;
    border-left-color: var(--dmg-red-light);
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.4);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
}

.nav-section-title {
    color: var(--dmg-red);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0 1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}

.user-profile {
    margin-top: auto;
    padding: 1.1rem;
    border-top: 1px solid #dee2e6;
    background-color: rgba(0, 0, 0, 0.03);
}

/* --- Main content ---------------------------------------------------- */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.75rem 2rem;
    flex: 1;
    min-width: 0;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-weight: 600;
    font-size: 1.5rem;
}

/* --- Components -------------------------------------------------------- */

.card {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 0.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eef0f2;
    font-weight: 600;
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
}

.card-kpi .display-6 {
    font-weight: 700;
}

.table-actions {
    white-space: nowrap;
}

.table-actions form {
    display: inline;
}

.badge-status {
    padding: 0.35em 0.65em;
    font-size: 0.8rem;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--dmg-red-dark);
    border-color: var(--dmg-red-dark);
}

.btn-outline-primary {
    color: var(--dmg-red);
    border-color: var(--dmg-red);
}

.btn-outline-primary:hover {
    background-color: var(--dmg-red);
    border-color: var(--dmg-red);
}

a {
    color: var(--dmg-red-dark);
}

a:hover {
    color: var(--dmg-red);
}

.progress {
    height: 0.75rem;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: none;
    }
    .main-content {
        margin-left: 0;
    }
}
