/* assets/css/style.css */

:root {
    --bg-dark: #24343c;
    --orange-gradient: linear-gradient(135deg, #f08821 0%, #d87014 100%);
    --text-light: #ffffff;
    --text-dark: #24343c;
    --text-muted: #a0aab2;
    --font-main: 'Mulish', sans-serif;
    --radius-btn: 10px;
    --radius-card: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-main); background-color: #f4f7f6; color: var(--text-dark); }

/* =========================================
   1. PANTALLA DE LOGIN
========================================= */
.login-pantalla {
    height: 100vh; display: flex; justify-content: center; align-items: center; background-color: var(--bg-dark);
}
.login-tarjeta {
    background: rgba(255, 255, 255, 0.05); backdrop-filter: blur(10px); padding: 40px;
    border-radius: var(--radius-card); text-align: center; border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.login-logo { color: var(--text-light); font-size: 24px; font-weight: 700; margin-bottom: 5px; }
.login-subtitulo { color: var(--text-muted); font-size: 13px; margin-bottom: 30px; letter-spacing: 1px; }

.btn-google {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: #ffffff; color: var(--text-dark); text-decoration: none;
    padding: 12px 24px; border-radius: var(--radius-btn); font-weight: 600; font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-google:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2); }
.google-icon { width: 18px; height: 18px; }

/* =========================================
   2. LAYOUT DEL ERP (Logueado)
========================================= */
.erp-layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: 250px; background-color: var(--bg-dark); color: var(--text-light);
    display: flex; flex-direction: column; transition: transform 0.3s ease; z-index: 1000;
}
.sidebar-header { padding: 20px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; }
.sidebar-logo { font-size: 20px; font-weight: 700; color: #f08821; width: 100%; text-align: center;}
.sidebar-nav { flex: 1; padding: 20px 0; overflow-y: auto; }

.nav-item {
    display: block; padding: 15px 25px; color: var(--text-muted); text-decoration: none;
    font-size: 14px; font-weight: 600; transition: all 0.2s; border-left: 4px solid transparent;
}
.nav-item:hover, .nav-item.active { 
    background-color: rgba(255,255,255,0.05); color: var(--text-light); border-left: 4px solid #f08821; 
}

.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.05); }
.nav-item.logout { 
    background: var(--orange-gradient); color: #fff; border-radius: var(--radius-btn);
    text-align: center; border-left: none; padding: 12px; margin-top: 10px;
}
.nav-item.logout:hover { 
    transform: translateY(-2px); box-shadow: 0 4px 15px rgba(240,136,33,0.3); border-left: none;
}

.main-content { flex: 1; display: flex; flex-direction: column; background-color: #f4f7f6; overflow-y: auto; position: relative; }
.topbar {
    background: #fff; padding: 15px 30px; display: flex; justify-content: flex-end; 
    align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.02); min-height: 65px;
}
.user-profile { display: flex; align-items: center; gap: 15px; }
.user-name { font-size: 10px; font-weight: 800; }
.user-avatar { width: 35px; height: 35px; border-radius: 50%; border: 2px solid #f08821; object-fit: cover; }
.app-contenedor { padding: 30px; transition: opacity 0.3s ease; }

/* =========================================
   3. FORMULARIO DE COMPRAS (Tarjeta Perla)
========================================= */
.form-card {
    background: linear-gradient(to bottom right, #001a4052, #88b8ff24);
    border-radius: var(--radius-card); padding: 30px; box-shadow: 0px 4px 15px rgba(0,0,0,0.05);
    max-width: 800px; margin: 0 auto;
}
.form-title { font-size: 20px; margin-bottom: 25px; color: var(--text-dark); border-bottom: 2px solid #ffffff; padding-bottom: 10px; }
.form-group { margin-bottom: 20px; }
.form-row { display: flex; gap: 20px; }
.form-col { flex: 1; }

.form-label { display: block; font-size: 10px; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; text-transform: capitalize; }
.form-control {
    width: 100%; padding: 12px 15px; border-radius: var(--radius-btn);
    border: 1px solid #e2e8f0; font-family: var(--font-main); font-size: 10px;
    transition: border-color 0.2s, box-shadow 0.2s; background-color: #fcfcfc;
}
.form-control:focus { outline: none; border-color: #f08821; box-shadow: 0 0 0 3px rgba(240, 136, 33, 0.1); }
textarea.form-control { border-radius: 15px; resize: vertical; min-height: 80px; }

.file-drop-area {
    border: 2px dashed #cbd5e1; border-radius: var(--radius-card); padding: 30px;
    text-align: center; color: #64748b; cursor: pointer; transition: all 0.2s; background: #fafafa; display: block;
}
.file-drop-area:hover { border-color: #f08821; background: #fff; }

.btn-submit {
    background: var(--orange-gradient); color: #fff; border: none;
    padding: 12px 30px; border-radius: var(--radius-btn); font-size: 14px; font-weight: 700;
    cursor: pointer; width: 100%; margin-top: 10px; transition: transform 0.2s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(240,136,33,0.3); }

/* =========================================
   4. RESPONSIVO Y MENÚ MÓVIL
========================================= */
.menu-toggle { background: none; border: none; cursor: pointer; display: none; color: var(--text-dark); }
.close-menu-btn { background: none; border: none; color: var(--text-muted); font-size: 28px; cursor: pointer; display: none; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; backdrop-filter: blur(2px); }
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
    .sidebar { position: fixed; height: 100%; transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .topbar { justify-content: space-between; }
    .menu-toggle { display: block; }
    .close-menu-btn { display: block; position: absolute; right: 15px; top: 15px; }
    .form-row { flex-direction: column; gap: 0; }
    .app-contenedor { padding: 15px; }
}

/* =========================================
   5. DASHBOARDS Y TARJETAS (Búsqueda)
========================================= */
.tabs-container {
    display: flex; background: #e2e8f0; border-radius: var(--radius-btn);
    padding: 5px; margin-bottom: 20px; max-width: 400px; margin-left: auto; margin-right: auto;
}
.tab-btn {
    flex: 1; padding: 10px; text-align: center; border-radius: 15px; cursor: pointer;
    font-weight: 700; font-size: 13px; color: var(--text-muted); transition: all 0.3s ease;
}
.tab-btn.active { background: var(--orange-gradient); color: #fff; box-shadow: 0 4px 10px rgba(240,136,33,0.3); }

.search-bar {
    width: 100%; padding: 12px 20px; border-radius: var(--radius-btn); border: 1px solid #cbd5e1;
    margin-bottom: 25px; font-family: var(--font-main); font-size: 14px; background: #fff;
}
.search-bar:focus { outline: none; border-color: #f08821; box-shadow: 0 0 0 3px rgba(240,136,33,0.1); }

.approval-card {
    background: #fff; border-radius: var(--radius-card); padding: 20px; margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); border-left: 5px solid #f08821; transition: transform 0.2s;
}
.approval-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.card-title { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.card-cost { font-size: 18px; font-weight: 700; color: #f08821; }
.card-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 15px; margin-bottom: 10px; font-weight: 700; text-transform: uppercase; }
.card-body { font-size: 13px; color: #475569; margin-bottom: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.card-actions { display: flex; gap: 10px; }
.btn-approve { flex: 1; background: var(--orange-gradient); color: #fff; border: none; padding: 12px; border-radius: var(--radius-btn); font-weight: 700; cursor: pointer; transition: transform 0.2s; }
.btn-reject { flex: 1; background: transparent; color: var(--text-dark); border: 1px solid #cbd5e1; padding: 12px; border-radius: var(--radius-btn); font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-approve:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(240,136,33,0.3); }
.btn-reject:hover { background: #f8fafc; border-color: #94a3b8; }

/* =========================================
   6. HISTORIAL VERTICAL (Línea de Tiempo)
========================================= */
.timeline-container { max-width: 800px; margin: 0 auto; padding: 20px 0; }
.timeline-header {
    background: #fff; padding: 20px; border-radius: var(--radius-card); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); margin-bottom: 30px;
    display: flex; justify-content: space-between; align-items: center;
}
.timeline { position: relative; padding-left: 30px; list-style: none; }
.timeline::before { content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: #e2e8f0; }

.timeline-item { position: relative; margin-bottom: 25px; }
.timeline-item::before {
    content: ''; position: absolute; left: -26px; top: 5px; width: 14px; height: 14px; 
    border-radius: 50%; background: #fff; border: 3px solid #cbd5e1; z-index: 2;
}
.timeline-item.success::before { border-color: #10b981; }
.timeline-item.warning::before { border-color: #f59e0b; }
.timeline-item.brand::before { border-color: #f08821; }

.timeline-card {
    background: #fff; padding: 20px; border-radius: var(--radius-card);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); border: 1px solid #f1f5f9;
}
.timeline-meta { font-size: 11px; color: #a0aab2; margin-bottom: 10px; font-weight: 700; display: flex; justify-content: space-between; text-transform: uppercase; }
.timeline-content { font-size: 14px; color: var(--text-dark); line-height: 1.6; }

/* =========================================
   7. ROLES, BADGES Y PRORRATEO
========================================= */
.status-badge { display: inline-block; padding: 4px 10px; border-radius: 10px; font-size: 11px; font-weight: bold; margin-top: 5px; }
.status-green { background: #dcfce7; color: #166534; }
.status-red { background: #fee2e2; color: #991b1b; }
.status-blue { background: #dbeafe; color: #1e40af; }
.status-yellow { background: #fef3c7; color: #92400e; }
.status-default { background: #f8fafc; color: #475569; }

.nav-badge, .badge-notif { background: #ef4444; color: white; font-weight: bold; }
.nav-badge { font-size: 10px; padding: 2px 6px; border-radius: 10px; margin-left: auto; }
.badge-notif { padding: 2px 7px; border-radius: 12px; font-size: 11px; margin-left: 10px; box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3); }

/* Colores de roles */
.card-solicitante { border-left: 4px solid #3b82f6; }
.text-solicitante { color: #2563eb; }
.card-aprobador { border-left: 4px solid #10b981; }
.text-aprobador { color: #047857; }
.card-finanzas { border-left: 4px solid #8b5cf6; }
.text-finanzas { color: #6d28d9; }

/* Prorrateo Box */
.prorrateo-container { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 15px; margin-bottom: 25px; }
.prorrateo-item { background: #f8fafc; border: 1px solid #cbd5e1; padding: 8px 12px; border-radius: 6px; font-size: 13px; }

/* =========================================
   8. ESTADOS DE TARJETAS (Pulsantes y Fijas)
========================================= */
@keyframes pulse-blue { 0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); } }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes pulse-orange { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
@keyframes pulse-purple { 0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); } }

.glow-blue { animation: pulse-blue 2s infinite; }
.glow-green { animation: pulse-green 2s infinite; }
.glow-red { animation: pulse-red 2s infinite; }
.glow-orange { animation: pulse-orange 2s infinite; }
.glow-purple { animation: pulse-purple 2s infinite; }

.solid-blue { border-left: 5px solid #2563eb !important; background-color: #f0f9ff !important; }

/* Tarjetas de Acción Pendiente */
.action-card-green { border-left: 4px solid #10b981 !important; background: #ffffff; }
.action-card-red { border-left: 4px solid #ef4444 !important; background: #fef2f2; }
.action-card-purple { border-left: 4px solid #8b5cf6 !important; background: #f5f3ff; }
.action-card-orange { border-left: 4px solid #f59e0b !important; background: #fffbeb; }

/* Textos Especiales */
.title-green { color: #047857; }
.title-red { color: #b91c1c; }
.title-purple { color: #5b21b6; }
.title-orange { color: #92400e; }
.text-orange-muted { color: #b45309; }


/* =========================================
   9. Reportes 
========================================= */



/* assets/css/style.css - Adiciones para Reportes Avanzados */

/* Filas cebreadas: una clara, una ligeramente más oscura */
.table-report tbody tr:nth-child(odd) { background-color: #ffffff; }
.table-report tbody tr:nth-child(even) { background-color: #f8fafc; }
.table-report tbody tr:hover { background-color: #f1f5f9; }

/* Encabezados interactivos */
.sortable-header {
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    user-select: none;
}
.sortable-header:hover { background-color: #edf2f7 !important; }

/* Indicadores de estado en el encabezado */
.header-status {
    font-size: 10px;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
}
.status-sort { color: #f08821; }
.status-filter { color: #ef4444; font-weight: 800; }

.filter-active {
    border-bottom: 3px solid #ef4444 !important;
}
.sort-active {
    border-bottom: 3px solid #f08821 !important;
}

/**
 * Archivo: assets/css/style.css
 * Sección: UI de Filtros Avanzados (Checkboxes)
 */

/* Contenedor principal del dropdown de filtro */
.filter-menu {
    display: none; /* Se activa por JS */
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-width: 180px;
    max-height: 250px;
    overflow-y: auto;
    padding: 12px;
    margin-top: 5px;
    color: #1e293b;
    text-transform: none; /* Para que los nombres no salgan en mayúsculas */
    font-weight: 400;
}

/* Items dentro del filtro */
.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 11px;
    border-radius: 4px;
    transition: background 0.2s;
}

.filter-item:hover {
    background: #f8fafc;
}

.filter-item input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: #f08821; /* Color institucional naranja */
}

/* Botones de acción dentro del filtro */
.filter-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.btn-filter-action {
    background: none;
    border: none;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    color: #64748b;
}

.btn-filter-confirm {
    color: #10b981;
}

/* Clase para mostrar el menú */
.filter-menu.active {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}