/* =====================================================
   LABURO ERP — TEMA VISUAL v3.0
   Unificado: páginas originales + nuevas
===================================================== */

/* ── RESET BASE ──────────────────────────────────── */
html { font-size: 14px; }

:root {
    --laburo-azul:  #2A6293;
    --laburo-rojo:  #B32424;
    --laburo-plomo: #705D54;
    --laburo-bg:    #f0f2f5;
    --laburo-card:  #ffffff;
    --laburo-borde: #e2e6ea;
    --laburo-texto: #2d3748;
    --laburo-muted: #718096;
    --shadow-xs: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

body {
    background-color: var(--laburo-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--laburo-texto);
    font-size: 0.9rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── TIPOGRAFÍA ──────────────────────────────────── */
h1 { font-size: 1.6rem;  font-weight: 700; }
h2 { font-size: 1.4rem;  font-weight: 700; }
h3 { font-size: 1.2rem;  font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 600; }
h5 { font-size: 0.95rem; font-weight: 600; }
h6 { font-size: 0.85rem; font-weight: 600; }
small, .small { font-size: 0.78rem; }

/* ── COLORES CORPORATIVOS ────────────────────────── */
.text-laburo-azul  { color: var(--laburo-azul)  !important; }
.text-laburo-rojo  { color: var(--laburo-rojo)  !important; }
.text-laburo-plomo { color: var(--laburo-plomo) !important; }
.bg-laburo-azul    { background-color: var(--laburo-azul)  !important; }
.bg-laburo-rojo    { background-color: var(--laburo-rojo)  !important; }
.bg-laburo-plomo   { background-color: var(--laburo-plomo) !important; }
.bg-laburo-navbar  { background-color: var(--laburo-azul)  !important; }
.border-laburo-rojo{ border-color: var(--laburo-rojo) !important; }

/* ── BOTONES ─────────────────────────────────────── */
.btn {
    font-size: 0.82rem; font-weight: 500;
    padding: 0.38rem 0.85rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.01em;
    transition: all 0.18s ease;
}
.btn-sm  { font-size: 0.76rem; padding: 0.28rem 0.65rem; }
.btn-lg  { font-size: 0.9rem;  padding: 0.5rem 1.1rem; }

.btn-laburo-azul {
    background-color: var(--laburo-azul);
    color: white; border: none;
}
.btn-laburo-azul:hover { background-color: #1f4b73; color: white; }

.btn-laburo-rojo {
    background-color: var(--laburo-rojo) !important;
    border-color: var(--laburo-rojo) !important;
    color: white !important;
}
.btn-laburo-rojo:hover {
    background-color: #8c1c1c !important;
    border-color: #8c1c1c !important;
}

.btn-laburo-plomo {
    background-color: var(--laburo-plomo);
    color: white; border: none;
}
.btn-laburo-plomo:hover { background-color: #574841; color: white; }
.btn-whatsapp { background-color: #25D366; color: white; border: none; }
.btn-whatsapp:hover { background-color: #1ebe5d; color: white; }

/* ── CARDS ───────────────────────────────────────── */
.card {
    border-radius: var(--radius-md);
    border: 1px solid var(--laburo-borde);
    box-shadow: var(--shadow-xs);
    background: var(--laburo-card);
}
.card-header {
    font-size: 0.82rem; font-weight: 600;
    padding: 0.6rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--laburo-borde);
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

/* Headers de card con color de fondo (bg-laburo-plomo etc) */
.card-header.bg-laburo-plomo,
.card-header.bg-laburo-azul,
.card-header.bg-laburo-rojo,
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-danger,
.card-header.bg-warning {
    color: white;
    border-bottom: none;
}
.card-header.bg-warning { color: #1a1a1a !important; }

.card-body  { padding: 1rem; }
.card-footer{ padding: 0.6rem 1rem; background: #fafafa; }

/* KPI cards — compatibilidad con ambos estilos */
.kpi-card {
    background: white;
    border-radius: var(--radius-md);
    border: none;
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid transparent;
    transition: transform 0.18s, box-shadow 0.18s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Cards nuevas con solo shadow-sm — normalizar */
.card.shadow-sm  { box-shadow: var(--shadow-sm)  !important; }
.card.shadow-md  { box-shadow: var(--shadow-md)  !important; }
.card.border-0   { border: 1px solid var(--laburo-borde) !important; }

/* ── TABLAS ──────────────────────────────────────── */
.table {
    font-size: 0.82rem;
    color: var(--laburo-texto);
}
.table th {
    font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--laburo-muted);
    background-color: #f8f9fb !important;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--laburo-borde);
    white-space: nowrap;
}
.table td {
    padding: 0.48rem 0.75rem;
    vertical-align: middle;
    border-color: #f0f0f0;
}
.table-hover tbody tr:hover { background-color: #f5f8ff; }
.tabla-compacta th,
.tabla-compacta td {
    font-size: 0.78rem;
    padding: 0.4rem 0.65rem;
    vertical-align: middle;
}

/* ── FORMULARIOS ─────────────────────────────────── */
.form-control, .form-select {
    font-size: 0.82rem; padding: 0.38rem 0.7rem;
    border-radius: var(--radius-sm);
    border-color: var(--laburo-borde);
    color: var(--laburo-texto);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--laburo-azul);
    box-shadow: 0 0 0 3px rgba(42,98,147,0.12);
}
.form-control-sm, .form-select-sm { font-size: 0.76rem; padding: 0.28rem 0.55rem; }
.form-label {
    font-size: 0.76rem; font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--laburo-muted);
}

/* ── BADGES ──────────────────────────────────────── */
.badge {
    font-size: 0.7rem; font-weight: 600;
    padding: 0.28em 0.58em;
    border-radius: 4px; letter-spacing: 0.02em;
}

/* ── MODALES ─────────────────────────────────────── */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
}
.modal-header {
    padding: 0.75rem 1.1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-title { font-size: 0.9rem; font-weight: 700; }
.modal-body  { padding: 1.1rem; }
.modal-footer{ padding: 0.65rem 1.1rem; background: #fafafa; }

/* Headers de modal con color */
.modal-header.bg-laburo-azul,
.modal-header.bg-laburo-rojo,
.modal-header.bg-primary,
.modal-header.bg-success,
.modal-header.bg-danger,
.modal-header.bg-warning {
    color: white;
}
.modal-header.bg-warning { color: #1a1a1a !important; }
.modal-header .btn-close-white { filter: invert(1) brightness(2); }

/* ── ALERTAS ─────────────────────────────────────── */
.alert { font-size: 0.82rem; padding: 0.55rem 0.9rem; border-radius: var(--radius-sm); }

/* ── TABS ────────────────────────────────────────── */
.nav-tabs .nav-link {
    font-size: 0.8rem; font-weight: 600;
    padding: 0.45rem 0.9rem;
    color: var(--laburo-muted);
    border: none; border-bottom: 2px solid transparent;
    border-radius: 0; transition: color 0.15s, border-color 0.15s;
}
.nav-tabs .nav-link.active {
    color: var(--laburo-azul);
    border-bottom-color: var(--laburo-azul);
    background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--laburo-azul); border-bottom-color: #c5d8ee; }

/* ── DROPDOWNS ───────────────────────────────────── */
.dropdown-menu {
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--laburo-borde);
    box-shadow: var(--shadow-md);
    padding: 0.3rem;
}
.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.38rem 0.75rem;
    font-size: 0.82rem;
}

/* ── INPUT GROUPS ────────────────────────────────── */
.input-group-text {
    font-size: 0.82rem; padding: 0.38rem 0.7rem;
    background: #f8f9fb; border-color: var(--laburo-borde);
}

/* ── PÁGINA: ENCABEZADOS (normalizar h2/h3 en páginas viejas y nuevas) ── */
.page-title, .contenido-principal h2, .contenido-principal h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--laburo-azul);
    margin-bottom: 0;
}

/* ── CONTENIDO PRINCIPAL ─────────────────────────── */
.contenido-principal {
    margin-left: 72px;
    transition: margin-left 0.28s cubic-bezier(0.4,0,0.2,1);
    padding: 20px 24px;
    min-height: 100vh;
}
.contenido-principal.expandido { margin-left: 268px; }

/* ── SIDEBAR ─────────────────────────────────────── */
.laburo-sidebar {
    height: 100vh; width: 72px;
    position: fixed; top: 0; left: 0;
    background-color: #1a1a24;
    transition: width 0.28s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden; z-index: 1000;
    padding: 14px 9px;
    display: flex; flex-direction: column;
    color: #fff;
}
.laburo-sidebar.expandido { width: 240px; }

.sb-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding: 0 4px; min-height: 24px;
}
.sb-dots   { color: #3a3a4a; font-size: 0.75rem; letter-spacing: 3px; }
.sb-toggler {
    background: none; border: none; color: #666;
    cursor: pointer; font-size: 0.95rem;
    transition: color 0.18s, transform 0.28s cubic-bezier(0.4,0,0.2,1);
    padding: 0; line-height: 1;
}
.sb-toggler:hover { color: #fff; }
.laburo-sidebar:not(.expandido) .sb-toggler { transform: rotate(180deg); }

.sb-profile-card {
    border-radius: var(--radius-lg); padding: 8px;
    display: flex; align-items: center;
    margin-bottom: 14px; overflow: hidden;
    border: 1px solid #2a2a36;
    background: rgba(37,37,50,0);
}
.sb-avatar {
    width: 34px; height: 34px; border-radius: 8px;
    background: #3a3a4a;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
    border: 1px solid #3d3d4d; overflow: hidden;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-user-info {
    margin-left: 9px; opacity: 0; white-space: nowrap;
    transition: opacity 0.18s ease; pointer-events: none;
}
.laburo-sidebar.expandido .sb-user-info {
    opacity: 1; transition: opacity 0.22s ease 0.1s; pointer-events: auto;
}
.sb-user-name { font-weight: 600; font-size: 0.8rem; display: block; }
.sb-user-role  { font-size: 0.68rem; color: #e57373; font-weight: 500; }

.sb-search-container { position: relative; margin-bottom: 14px; }
.sb-search-input {
    width: 100%; background: #252530; border: 1px solid #2f2f3e;
    border-radius: 8px; padding: 7px 7px 7px 30px;
    color: white; font-size: 0.76rem;
    opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.laburo-sidebar.expandido .sb-search-input {
    opacity: 1; pointer-events: auto; transition: opacity 0.22s ease 0.1s;
}
.sb-search-input::placeholder { color: #555; }
.sb-search-icon {
    position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%); color: #666; font-size: 0.72rem;
}

.sb-section-title {
    font-size: 0.6rem; color: #444;
    text-transform: uppercase; letter-spacing: 1.2px;
    margin: 10px 0 4px 10px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.18s ease; white-space: nowrap;
}
.laburo-sidebar.expandido .sb-section-title {
    opacity: 1; transition: opacity 0.22s ease 0.1s; pointer-events: auto;
}

.sb-scroll {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin; scrollbar-color: #2a2a36 transparent;
}
.sb-scroll::-webkit-scrollbar { width: 3px; }
.sb-scroll::-webkit-scrollbar-thumb { background: #2a2a36; border-radius: 2px; }

.sb-link {
    display: flex; align-items: center;
    padding: 8px 10px; color: #888;
    text-decoration: none !important;
    border-radius: 8px; margin-bottom: 2px;
    transition: background 0.14s, color 0.14s;
    overflow: hidden; white-space: nowrap; cursor: pointer;
}
.sb-link:hover  { background: rgba(255,255,255,0.05); color: #ddd; }
.sb-link.active { background: var(--laburo-rojo); color: #fff !important; }
.sb-link i:first-child { font-size: 0.95rem; min-width: 22px; text-align: center; flex-shrink: 0; }
.sb-link span {
    margin-left: 9px; font-size: 0.79rem;
    opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.laburo-sidebar.expandido .sb-link span {
    opacity: 1; transition: opacity 0.22s ease 0.1s; pointer-events: auto;
}

.flecha-desplegable {
    margin-left: auto !important; font-size: 0.65rem !important;
    opacity: 0; pointer-events: none;
    transition: transform 0.2s ease, opacity 0.18s ease !important;
}
.laburo-sidebar.expandido .flecha-desplegable { opacity: 1; pointer-events: auto; }
.sb-link[aria-expanded="true"] .flecha-desplegable { transform: rotate(90deg); }

.sb-submenu {
    background: rgba(0,0,0,0.15); border-radius: 6px;
    margin: 1px 4px; padding: 3px 0; overflow: hidden;
}
.sb-submenu .sb-link { padding: 7px 10px 7px 26px; font-size: 0.76rem; margin-bottom: 1px; }
.sb-submenu .sb-link i:first-child { font-size: 0.82rem; min-width: 19px; }

.sb-footer {
    padding-top: 8px; border-top: 1px solid #22222e;
    margin-top: 6px; flex-shrink: 0;
}

/* ── UTILIDADES EXTRA ────────────────────────────── */
.wms-card { border-radius: var(--radius-md); border: none; box-shadow: var(--shadow-sm); background: white; }
.kpi-icon  { font-size: 1.8rem; opacity: 0.15; }

/* Normalizar text-primary/success/danger/warning a colores Laburo donde aplica */
.table .text-primary { color: var(--laburo-azul) !important; }

/* Separador de sección */
.seccion-titulo {
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--laburo-muted);
    border-bottom: 1px solid var(--laburo-borde);
    padding-bottom: 4px; margin-bottom: 12px;
}

/* Progress bars */
.progress { border-radius: 4px; }
.progress-bar { border-radius: 4px; }

/* Scrollbar global */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
