/* ============================================================
   TecnoHogar — App CSS
   Mobile-first, Bootstrap 5 base
   ============================================================ */

:root {
    --th-primary:    #2563eb;
    --th-sidebar-bg: #1e293b;
    --th-sidebar-w:  240px;
    --th-topbar-h:   56px;
}

/* ---------------------------------------------------------------
   Body & layout
--------------------------------------------------------------- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
}

/* ---------------------------------------------------------------
   Auth layout
--------------------------------------------------------------- */
.auth-body {
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    border-radius: 1rem;
    border: none;
}

.auth-logo {
    width: 64px;
    height: 64px;
    background: var(--th-primary);
    color: #fff;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

/* ---------------------------------------------------------------
   Sidebar
--------------------------------------------------------------- */
#wrapper {
    min-height: 100vh;
}

#sidebar {
    width: var(--th-sidebar-w);
    min-height: 100vh;
    background: var(--th-sidebar-bg);
    color: #cbd5e1;
    transition: width .25s ease, transform .25s ease;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f8fafc;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
}

#sidebar .nav-link {
    color: #94a3b8;
    border-radius: .5rem;
    padding: .5rem .75rem;
    font-size: .9rem;
    transition: background .15s, color .15s;
}

#sidebar .nav-link:hover:not(.disabled) {
    background: rgba(255,255,255,.08);
    color: #f8fafc;
}

#sidebar .nav-link.active {
    background: var(--th-primary);
    color: #fff;
}

#sidebar .nav-link.disabled {
    opacity: .45;
    cursor: not-allowed;
}

.sidebar-divider {
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: .75rem;
}

/* ---------------------------------------------------------------
   Topbar
--------------------------------------------------------------- */
.topbar {
    height: var(--th-topbar-h);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 1rem;
}

/* ---------------------------------------------------------------
   Stat cards
--------------------------------------------------------------- */
.stat-card {
    border-radius: .75rem;
    transition: transform .15s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    flex-shrink: 0;
}

/* ---------------------------------------------------------------
   Cards generales
--------------------------------------------------------------- */
.card {
    border-radius: .75rem;
}

/* ---------------------------------------------------------------
   Tables
--------------------------------------------------------------- */
.table th {
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #64748b;
}

/* ---------------------------------------------------------------
   Responsive: sidebar colapsado en móvil
--------------------------------------------------------------- */
@media (max-width: 767.98px) {
    #sidebar {
        position: fixed;
        transform: translateX(-100%);
        z-index: 1050;
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1040;
    }

    #sidebar-overlay.show {
        display: block;
    }
}

/* ---------------------------------------------------------------
   Utilities
--------------------------------------------------------------- */
.fw-semibold { font-weight: 600 !important; }
