/* =============================================
   ERP Agencia de Publicidad — Estilos globales
   ============================================= */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1d23;
    --sidebar-text: #adb5bd;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(13, 110, 253, 0.2);
    --sidebar-active-color: #6ea8fe;
    --topbar-height: 57px;
}

/* ===== LAYOUT PRINCIPAL ===== */
#wrapper {
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
#sidebar-wrapper {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.25s ease;
    overflow-y: scroll;
    overflow-x: hidden;
}

#page-content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;   /* contenido ancho (tableros) se desplaza dentro de su caja, no estira la página */
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

/* Heading del sidebar */
.sidebar-heading {
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Links del sidebar */
.sidebar-nav {
    flex: 1;
}

.sidebar-link {
    color: var(--sidebar-text) !important;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
    text-decoration: none;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff !important;
    transform: translateX(2px);
}

.sidebar-link.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-active-color) !important;
    font-weight: 600;
    border-left: 3px solid var(--sidebar-active-color);
}

.nav-section-title {
    padding: 0 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

.nav-section-title small {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer small {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
}

/* ===== TOPBAR ===== */
.navbar {
    min-height: var(--topbar-height);
}

/* ===== KPI CARDS ===== */
.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== CARDS ===== */
.card {
    border-radius: 12px;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    font-size: 0.9rem;
}

/* ===== TABLAS ===== */
.table-hover > tbody > tr:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

/* ===== BADGES DE ESTADO ===== */
.badge-estado-borrador    { background-color: #6c757d; }
.badge-estado-enviada     { background-color: #0d6efd; }
.badge-estado-aprobada    { background-color: #198754; }
.badge-estado-rechazada   { background-color: #dc3545; }
.badge-estado-expirada    { background-color: #fd7e14; }
.badge-estado-pendiente   { background-color: #6c757d; }
.badge-estado-en_progreso { background-color: #ffc107; color: #212529; }
.badge-estado-completada  { background-color: #198754; }
.badge-estado-cancelada   { background-color: #dc3545; }
.badge-estado-pausada     { background-color: #0dcaf0; }

/* ===== FORMULARIOS ===== */
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== PAGINACIÓN ===== */
.pagination .page-link {
    color: #0d6efd;
}
.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* ===== RESPONSIVE: ocultar sidebar en mobile ===== */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        transform: translateX(-100%);
    }

    #sidebar-wrapper.show {
        transform: translateX(0);
    }

    #page-content-wrapper {
        margin-left: 0;
    }
}

/* ===== SCROLLBAR en sidebar ===== */
#sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}
#sidebar-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
#sidebar-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.30);
    border-radius: 3px;
}
#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.55);
}

/* ===== PRINT ===== */
@media print {
    #sidebar-wrapper,
    .navbar,
    .btn,
    footer { display: none !important; }
    #page-content-wrapper { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
}

/* Observaciones de cotización con formato (HTML saneado) */
.observaciones-html p { margin-bottom: .25rem; }
.observaciones-html ul, .observaciones-html ol { margin-bottom: .25rem; padding-left: 1.5rem; }

/* ===== Tableros Kanban (embudo de ventas, tablero de producción) ===== */
.kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.kanban-col { flex: 0 0 280px; background: var(--bs-tertiary-bg, #f1f3f5); border-radius: .5rem; display: flex; flex-direction: column; max-height: 75vh; }
.kanban-col-header { padding: .6rem .75rem; border-bottom: 3px solid var(--bs-secondary); border-radius: .5rem .5rem 0 0; background: var(--bs-body-bg); }
.kanban-col-body { padding: .5rem; overflow-y: auto; min-height: 120px; flex: 1; }
.kanban-col.drop-ok .kanban-col-body { outline: 2px dashed var(--bs-primary); outline-offset: -4px; background: rgba(13, 110, 253, .05); }
.kanban-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: .4rem; padding: .55rem .65rem; margin-bottom: .5rem; font-size: .875rem; }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card.arrastrando { opacity: .45; }
.kanban-card a { text-decoration: none; }
.kanban-vacio { color: var(--bs-secondary-color); font-size: .8rem; text-align: center; padding: 1rem 0; }
