html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background-color: #f8f9fa;
}

/* Sidebar */
#sidebar {
    width: 260px;
    transition: transform 0.3s ease;
}

#sidebar .nav-link {
    border-radius: 6px;
    padding: 8px 12px;
    transition: background-color 0.2s;
}

#sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main content */
#main-content {
    margin-left: 260px;
    min-width: 0;
    max-width: 100%;
}

/* Sidebar overlay */
#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.stat-card {
    border-left: 4px solid;
    border-radius: 8px;
}

.stat-card.primary { border-left-color: #0d6efd; }
.stat-card.success { border-left-color: #198754; }
.stat-card.info { border-left-color: #0dcaf0; }
.stat-card.warning { border-left-color: #ffc107; }
.stat-card.danger { border-left-color: #dc3545; }

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #6c757d;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Favorites */
.favorite-star {
    color: #ffc107;
    cursor: pointer;
}

.favorite-star-empty {
    color: #dee2e6;
    cursor: pointer;
}

/* ===== Mobile / Tablet Responsive (< 992px) ===== */
@media (max-width: 991.98px) {
    /* Sidebar: off-screen by default, slide in when .show */
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    /* Main content: full width, no left margin */
    #main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Reduce padding */
    #main-content .container-fluid {
        padding: 1rem !important;
    }

    /* Page titles */
    h4 {
        font-size: 1.2rem;
    }

    /* Stat cards */
    .stat-card h3 {
        font-size: 1.4rem;
    }

    .stat-card h6 {
        font-size: 0.8rem;
    }

    /* Buttons in header rows */
    .d-flex.justify-content-between .btn {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }

    /* Login */
    .login-container {
        padding: 1rem;
    }

    .login-card {
        max-width: 100%;
    }
}

/* ===== Extra small (< 576px) ===== */
@media (max-width: 575.98px) {
    #main-content .container-fluid {
        padding: 0.75rem !important;
    }

    /* Filter buttons full width */
    .card-body .row.g-3 .col-md-2 .btn,
    .card-body .row.g-3 .col-md-3 .btn,
    .card-body .row.g-3 .col-md-4 .btn {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    /* Table */
    .table {
        font-size: 0.8rem;
    }

    .table .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }

    .badge {
        font-size: 0.7rem;
    }

    .stat-card .bi.fs-1 {
        font-size: 1.5rem !important;
    }
}
