/* =============================================
   GASA Lavado Express - Portal Web
   Colores: Primary #0D6E7B | Secondary #C0392B
   ============================================= */

:root {
    --gasa-primary:    #0D6E7B;
    --gasa-primary-d:  #0a5561;
    --gasa-secondary:  #C0392B;
    --gasa-success:    #27AE60;
    --gasa-bg:         #F4F6F8;
    --sidebar-width:   260px;
    --topbar-height:   60px;
    --sidebar-bg:      #1a2332;
    --sidebar-hover:   #0D6E7B;
    --sidebar-active:  #0D6E7B;
    --font-main:       'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background:  var(--gasa-bg);
    color: #212529;
}

/* -----------------------------------------------
   Layout general
----------------------------------------------- */
.app-body { margin: 0; overflow: hidden; height: 100vh; }

.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* -----------------------------------------------
   Sidebar
----------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #cdd6e3;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .25s ease;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: var(--gasa-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand-text .brand-name {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.2;
}
.sidebar-brand-text .brand-sub {
    font-size: .72rem;
    color: #7d94b0;
    display: block;
}

.sidebar-section-title {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #7d94b0;
    padding: .85rem 1rem .35rem;
}

.sidebar-nav {
    padding: .5rem 0;
}

.sidebar-item { list-style: none; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    color: #cdd6e3;
    text-decoration: none;
    border-radius: 8px;
    margin: 2px 8px;
    font-size: .88rem;
    font-weight: 500;
    transition: background .18s, color .18s;
    position: relative;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: .95rem;
    opacity: .85;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(13,110,123,.25);
    color: #fff;
}

.sidebar-link.active {
    background: var(--gasa-primary);
    color: #fff;
}

.sidebar-link.active i { opacity: 1; }

/* Footer del sidebar */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: auto;
}

.sidebar-user { display: flex; align-items: center; gap: .65rem; flex: 1; min-width: 0; }

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gasa-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: .9rem;
    flex-shrink: 0;
}

.sidebar-user-name {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: .7rem;
    display: block;
}

.badge-role-admin    { color: #63b3ed; }
.badge-role-supervisor { color: #68d391; }
.badge-role-lavador  { color: #e2e8f0; }

.sidebar-logout {
    color: #7d94b0;
    font-size: 1rem;
    text-decoration: none;
    flex-shrink: 0;
    transition: color .18s;
}
.sidebar-logout:hover { color: var(--gasa-secondary); }

/* -----------------------------------------------
   Topbar
----------------------------------------------- */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    gap: .75rem;
    flex-shrink: 0;
    z-index: 50;
}

.topbar-title h5 { font-size: .95rem; font-weight: 600; color: #343a40; }

.sidebar-toggle {
    background: none;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    cursor: pointer;
    transition: background .15s;
}
.sidebar-toggle:hover { background: var(--gasa-bg); }

/* -----------------------------------------------
   KPI Cards
----------------------------------------------- */
.kpi-card {
    border-radius: 12px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.kpi-value { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: .8rem; color: #6c757d; font-weight: 500; }

.border-danger { border: 2px solid #dc3545 !important; }

/* -----------------------------------------------
   Cards generales
----------------------------------------------- */
.card {
    border-radius: 12px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid rgba(0,0,0,.05);
}

/* -----------------------------------------------
   Tablas
----------------------------------------------- */
.table th {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    white-space: nowrap;
}
.table td { font-size: .88rem; vertical-align: middle; }

/* -----------------------------------------------
   Avatares
----------------------------------------------- */
.avatar-mini {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

/* -----------------------------------------------
   Bootstrap overrides
----------------------------------------------- */
.btn-primary {
    background-color: var(--gasa-primary);
    border-color: var(--gasa-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--gasa-primary-d);
    border-color: var(--gasa-primary-d);
}

.text-primary { color: var(--gasa-primary) !important; }
.bg-primary   { background-color: var(--gasa-primary) !important; }

a { color: var(--gasa-primary); }
a:hover { color: var(--gasa-primary-d); }

.pagination .page-link { color: var(--gasa-primary); }
.pagination .page-item.active .page-link {
    background-color: var(--gasa-primary);
    border-color: var(--gasa-primary);
}

/* -----------------------------------------------
   Login page
----------------------------------------------- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gasa-bg) 0%, #e8eef4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 40px rgba(0,0,0,.12);
    width: 100%;
    max-width: 420px;
}

.login-logo {
    width: 72px;
    height: 72px;
    background: var(--gasa-primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 1.25rem;
}

/* -----------------------------------------------
   Responsive sidebar toggle
----------------------------------------------- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 1050;
        transition: left .25s ease;
    }
    .sidebar.open { left: 0; }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 1049;
    }
    .sidebar-overlay.show { display: block; }
}

/* -----------------------------------------------
   Scrollbar personalizado
----------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c9d4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #8fa3b5; }
