/* ============================================
   HOMEADMIN - ESTILO MODERNO ÁMBAR
   Diseño minimalista con colores cálidos
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f7f3ee;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: #1a1a2e;
    padding: 2rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 2rem;
}

.sidebar-brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.sidebar-brand-text {
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

.sidebar-brand-text span {
    color: #f59e0b;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.sidebar-nav a i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25);
}

.sidebar-nav .nav-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.2);
    padding: 1rem 1rem 0.5rem;
    font-weight: 700;
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show {
    display: block;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
}

/* ===== HEADER TOP ===== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.top-header-left h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
}

.top-header-left p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin: 0;
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: #f8f4f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s ease;
    cursor: pointer;
}

.header-btn:hover {
    background: #f59e0b;
    color: white;
}

.header-btn-mobile {
    display: none;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    font-size: 2.2rem;
    opacity: 0.08;
}

.stat-label {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.5px;
}

.stat-value.text-green {
    color: #10b981;
}

.stat-value.text-red {
    color: #ef4444;
}

.stat-value.text-blue {
    color: #3b82f6;
}

.stat-value.text-yellow {
    color: #f59e0b;
}

.stat-sub {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* ===== CARDS ===== */
.card-modern {
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 1.5rem;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card-header-modern {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    background: #faf8f6;
}

.card-header-modern i {
    color: #f59e0b;
    margin-right: 8px;
}

.card-body-modern {
    padding: 1.5rem;
}

/* ===== BADGES ===== */
.badge-category {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 600;
}

.badge-success-custom {
    background: #d1fae5;
    color: #065f46;
}

.badge-info-custom {
    background: #dbeafe;
    color: #1e40af;
}

.badge-warning-custom {
    background: #fef3c7;
    color: #92400e;
}

/* ===== BOTONES ===== */
.btn-primary-custom {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.35);
    color: white;
}

.btn-sm-custom {
    padding: 4px 10px;
    font-size: 0.7rem;
    border-radius: 8px;
}

.btn-outline-secondary {
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #475569;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
    background: #f8f4f0;
    border-color: #cbd5e1;
}

/* ===== TABLA ===== */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #94a3b8;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.table tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #faf8f6;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== SERVICE CARDS ===== */
.service-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    transition: all 0.3s ease;
    background: white;
    height: 100%;
    border-left: 4px solid #f59e0b;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.service-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.badge-day {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* ===== PROVEEDOR CARDS ===== */
.proveedor-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    transition: all 0.3s ease;
    background: white;
    height: 100%;
    border-left: 4px solid #f59e0b;
}

.proveedor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.contact-info {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.contact-info i {
    width: 22px;
    color: #f59e0b;
}

.stars {
    color: #f59e0b;
    font-size: 0.85rem;
}

.stars .text-muted {
    color: #d1d5db !important;
}

/* ===== ICONOS ===== */
.icon-option {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    border: 2px solid transparent;
}

.icon-option:hover {
    background: #faf8f6;
    transform: scale(1.05);
}

.icon-option.selected {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.icon-grid {
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
    background: #faf8f6;
    border-radius: 12px;
}

/* ===== SERVICE BADGE ===== */
.service-badge {
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ===== GRÁFICOS ===== */
.chart-card {
    background: white;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 1.5rem;
    height: 100%;
}

.chart-card .card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a2e;
    background: #faf8f6;
}

.chart-card .card-body {
    padding: 1.5rem;
}

canvas {
    max-height: 280px;
    width: 100% !important;
}

/* ===== FILTROS ===== */
.filter-section {
    background: white;
    border-radius: 18px;
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
}

.filter-section .form-label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #1a1a2e;
}

.filter-section .form-control,
.filter-section .form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    background: #faf8f6;
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    background: white;
}

/* ===== ALERTAS ===== */
.alert-custom {
    border-radius: 14px;
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

/* ===== MODAL ===== */
.modal-content {
    border-radius: 18px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #1a1a2e, #2d2d44);
    color: white;
    border-radius: 18px 18px 0 0;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a2e;
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: #faf8f6;
}

.form-control:focus,
.form-select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
    background: white;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    .header-btn-mobile {
        display: flex;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1rem;
    }
    .top-header-left h1 {
        font-size: 1.3rem;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .stat-card .stat-value {
        font-size: 1.3rem;
    }
    .card-body-modern {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .top-header-right {
        width: 100%;
        justify-content: space-between;
    }
    .top-header {
        padding: 0.75rem;
    }
}