/* =============================================================
   ASV Control - Estilos
   Paleta corporativa basada en azul navy ASV
   ============================================================= */

:root {
    --asv-navy:       #0d2c4f;
    --asv-navy-dark:  #081e36;
    --asv-navy-light: #1a4378;
    --asv-accent:     #ffb500;
    --asv-grey-bg:    #f4f6f9;
    --asv-text:       #1f2d3d;
    --sidebar-width:  240px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--asv-grey-bg);
    color: var(--asv-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

/* ============== Layout principal ============== */
.layout {
    display: flex;
    min-height: 100vh;
}
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    min-width: 0;
}
.content {
    flex: 1;
    padding: 1.5rem;
}
.footer {
    text-align: center;
    padding: 1rem;
    color: #8898aa;
    border-top: 1px solid #e9ecef;
    background: #fff;
}

/* ============== Sidebar ============== */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--asv-navy);
    color: #d6e1ee;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    background: var(--asv-navy-dark);
}
.brand-link {
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.brand-link i { color: var(--asv-accent); font-size: 1.3rem; }
.sidebar-logo {
    max-height: 40px;
    max-width: 200px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}
.btn-close-sidebar {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}
.nav-section {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #6b7d94;
    letter-spacing: 0.05em;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1.25rem;
    color: #cfd9e6;
    text-decoration: none;
    border-left: 3px solid transparent;
    font-size: 0.92rem;
    transition: all 0.15s;
}
.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.nav-item.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--asv-accent);
}
.nav-item i { width: 1.1rem; text-align: center; }

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.user-pill { flex: 1; min-width: 0; }
.user-pill-name {
    color: #fff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
}
.user-pill-role {
    color: #8fa1bb;
    font-size: 0.72rem;
}
.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    cursor: pointer;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1020;
}
body.sidebar-open .sidebar-backdrop { display: block; }

/* ============== Topbar ============== */
.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}
.btn-toggle-sidebar {
    background: transparent;
    border: 0;
    font-size: 1.4rem;
    color: var(--asv-navy);
    cursor: pointer;
}
.topbar-title {
    flex: 1;
    font-weight: 500;
    color: var(--asv-navy);
}
.topbar-user {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ============== Páginas ============== */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 {
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--asv-navy);
    margin-bottom: 0.25rem;
}
.page-header h1 i { color: var(--asv-accent); margin-right: 0.4rem; }

/* ============== Auth (login) ============== */
.auth-body {
    background: linear-gradient(135deg, var(--asv-navy) 0%, var(--asv-navy-light) 100%);
    min-height: 100vh;
}
.auth-wrapper {
    max-width: 420px;
    margin: 0 auto;
    padding: 3rem 1rem 2rem;
}
.auth-card {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.auth-brand { text-align: center; margin-bottom: 2rem; }
.auth-brand i {
    font-size: 2.5rem;
    color: var(--asv-accent);
}
.auth-brand h1 {
    color: var(--asv-navy);
    margin: 0.5rem 0 0;
    font-size: 1.6rem;
    font-weight: 600;
}
.auth-brand p { color: #6c757d; margin: 0.25rem 0 0; }
.auth-footer { text-align: center; margin-top: 1.5rem; }

/* ============== Stat cards (dashboard) ============== */
.stat-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--asv-navy);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-card .stat-icon {
    font-size: 1.8rem;
    color: var(--asv-navy);
    opacity: 0.7;
}
.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}
.stat-primary { border-left-color: #0d6efd; }
.stat-primary .stat-icon { color: #0d6efd; }
.stat-info { border-left-color: #0dcaf0; }
.stat-info .stat-icon { color: #0dcaf0; }
.stat-warning { border-left-color: #ffc107; }
.stat-warning .stat-icon { color: #ffc107; }
.stat-success { border-left-color: #198754; }
.stat-success .stat-icon { color: #198754; }

/* ============== Cards & tables ============== */
.card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card-header {
    background: #fbfcfd;
    font-weight: 500;
    border-bottom: 1px solid #e9ecef;
}
.table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.82rem;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 2px solid #dee2e6;
}

/* ============== Buttons ============== */
.btn-primary {
    background: var(--asv-navy);
    border-color: var(--asv-navy);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--asv-navy-light);
    border-color: var(--asv-navy-light);
}

/* ============== Flash ============== */
.flash-stack { margin-bottom: 1rem; }

/* ============== Mobile ============== */
@media (max-width: 767.98px) {
    .main-area { margin-left: 0; }
    .sidebar { transform: translateX(-100%); transition: transform 0.25s; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .content { padding: 1rem; }
    .page-header h1 { font-size: 1.2rem; }
}
