body {
    background-color: #f9fafb;
    color: #2d3436;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.sidebar {
    background-color: #2c3e50;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    padding-top: 20px;
}

.sidebar .nav-link {
    color: #ecf0f1;
    font-weight: 600;
    padding: 12px 20px;
    display: block;
    transition: background-color 0.3s ease;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #3498db;
    color: white;
    text-decoration: none;
}

main {
    margin-left: 220px;
    padding: 30px;
}

h1,
h2,
h3 {
    font-weight: 700;
    margin-bottom: 20px;
}

.btn-primary {
    background-color: #2980b9;
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #1c5980;
    color: white;
}

.table {
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
}

.table thead {
    background-color: #3498db;
    color: white;
}

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

/* Estilos adicionales para el dashboard */
.card {
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    border-radius: 0.5rem;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.btn-outline-primary,
.btn-outline-warning,
.btn-outline-success,
.btn-outline-info {
    border-width: 1.5px;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.rounded-circle {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animación para el gráfico */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

canvas#donutChart {
    animation: fadeIn 0.8s ease-out;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE + PWA
   ═══════════════════════════════════════════════════════════════ */

/* Hamburger menu button — hidden on desktop */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1100;
    background: #2c3e50;
    color: white;
    border: none;
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
}

/* Overlay behind sidebar on mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1060;
        width: 250px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.open {
        display: block;
    }

    main {
        margin-left: 0 !important;
        padding: 15px;
        padding-top: 60px;
    }

    /* Full-width cards on mobile */
    .card {
        margin-bottom: 12px;
    }

    /* Responsive tables: horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.8rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    h2 {
        font-size: 1.4rem;
    }
    h3 {
        font-size: 1.2rem;
    }

    /* Stack columns on mobile */
    .row > [class*="col-"] {
        margin-bottom: 12px;
    }

    /* Make forms full-width */
    input,
    select,
    textarea {
        font-size: 16px !important; /* prevents iOS zoom */
    }
}

/* PWA standalone mode adjustments */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
}
