/**
 * Intranet Premium Stylesheet - FLy Cusco Peru
 *
 * @package FLy_Cusco_Peru
 */

/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.intranet-body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    font-weight: 700;
}

/* ==========================================================================
   2. AUTHENTICATION (LOGIN FRONTEND)
   ========================================================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #2563eb 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    right: -100px;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    z-index: 10;
    transition: var(--transition);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 28px;
    background: linear-gradient(135deg, #2563eb, #1e3a8a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 10px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 25px;
}

.form-options a {
    color: var(--primary);
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.login-card .error-message {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    display: none;
}

/* ==========================================================================
   3. APP SHELL LAYOUT
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    z-index: 50;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-bar .app-sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}
@media (max-width: 782px) {
    .admin-bar .app-sidebar {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-header h2 {
    color: #ffffff;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header span {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--success);
    font-weight: 700;
}

.sidebar-user {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-family: 'Outfit', sans-serif;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.user-role-badge {
    background-color: rgba(255,255,255,0.08);
    color: var(--sidebar-text);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    width: fit-content;
    margin-top: 4px;
    font-weight: 600;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 20px 16px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item a:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ffffff;
}

.menu-item.active a {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    color: #f87171;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    margin-left: 260px;
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

/* Filtros pills */
.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 12px;
}

.pill-filter {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    font-size: 12px;
}

.pill-filter.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.header-title h1 {
    font-size: 26px;
    font-weight: 800;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ==========================================================================
   4. CONTENT PANELS (SPA VIEWS)
   ========================================================================== */
.content-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card General */
.fly-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

/* Grid General */
.fly-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.fly-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* Widgets */
.widget-kpi {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kpi-details h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.kpi-details .kpi-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 5px;
}

.kpi-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-icon-blue { background-color: var(--primary-light); color: var(--primary); }
.kpi-icon-green { background-color: var(--success-light); color: var(--success); }
.kpi-icon-yellow { background-color: var(--warning-light); color: var(--warning); }
.kpi-icon-red { background-color: var(--danger-light); color: var(--danger); }

/* ==========================================================================
   5. DIRECTORIO & FILTERS
   ========================================================================== */
.directory-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

.filter-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    height: fit-content;
}

.filter-sidebar h3 {
    font-size: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 18px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Card de Hotel/Tour */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-img {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.product-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.tag-badge {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

.product-price-box {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-item {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.price-value {
    font-size: 18px;
    font-weight: 800;
}

.price-value.neto {
    color: var(--success);
}

.btn-card-details {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    text-align: center;
    background-color: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
}

.btn-card-details:hover {
    background-color: var(--primary);
    color: #ffffff;
}

/* ==========================================================================
   6. DETALLE MODAL / SLIDE-OVER
   ========================================================================== */
.fly-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

.fly-modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.fly-modal-container {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 10;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

/* Estilos de Itinerario */
.timeline {
    position: relative;
    margin: 20px 0;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-day {
    position: absolute;
    left: -31px;
    top: 0;
    background-color: var(--primary);
    color: #ffffff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #ffffff;
}

.timeline-content {
    background-color: var(--bg-app);
    padding: 15px;
    border-radius: var(--radius-sm);
}

.timeline-content h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.timeline-content p {
    font-size: 13px;
    color: var(--text-muted);
}

.confidential-alert {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 15px;
    color: #b45309;
    font-size: 12px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   7. ITINERARY BUILDER
   ========================================================================== */
.builder-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 25px;
    align-items: start;
}

.builder-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 120px; /* Evita que la barra flotante tape el contenido final */
}

/* Catálogo y Búsqueda Izquierda */
.builder-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    height: calc(100vh - 120px);
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.builder-catalog-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 2px;
}

/* Píldoras de Filtro (Pills) */
.pill-filter {
    background-color: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    outline: none;
}

.pill-filter:hover {
    background-color: #e2e8f0;
    color: var(--text-main);
}

.pill-filter.active {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Tarjeta del Catálogo */
.catalog-card {
    display: flex;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    align-items: center;
    transition: var(--transition);
    cursor: grab;
    user-select: none;
}

.catalog-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.catalog-card-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.catalog-card-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.catalog-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.catalog-card-meta {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.catalog-card-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.catalog-card-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--danger);
}

.btn-catalog-add {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
}

.btn-catalog-add:hover {
    background-color: var(--primary);
    color: #ffffff;
}

/* Variante de paquete en catálogo */
.catalog-card-package {
    border-left: 3px solid #0d9488;
    background: linear-gradient(135deg, rgba(13,148,136,0.04), transparent);
}

.catalog-card-expand-hint {
    font-size: 9px;
    font-weight: 600;
    color: #0d9488;
    display: block;
    margin-top: 2px;
    letter-spacing: 0.2px;
}

.btn-catalog-expand {
    background-color: rgba(13,148,136,0.12) !important;
    color: #0d9488 !important;
    font-size: 16px !important;
    font-weight: 900;
}

.btn-catalog-expand:hover {
    background-color: #0d9488 !important;
    color: #ffffff !important;
}

/* Slot de paquete en el timeline */
.timeline-slot-card.is-package-day {
    border-left: 3px solid #0d9488;
    background: linear-gradient(135deg, rgba(13,148,136,0.04), var(--bg-card));
}

/* Línea de Tiempo (Timeline) */
.builder-timeline-container {
    position: relative;
    padding-left: 28px;
    border-left: 2px solid var(--border-color);
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.builder-day-box {
    position: relative;
    padding: 0;
    margin-bottom: 0;
    background: none;
    border: 2px dashed transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, padding 0.2s ease, margin 0.2s ease;
}

.builder-day-box.drag-over {
    background-color: rgba(13, 148, 136, 0.05) !important;
    border: 2px dashed #0d9488 !important;
    border-radius: var(--radius-md);
    padding: 15px !important;
    margin: -15px !important;
}

.timeline-day-header {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.timeline-day-header:hover {
    color: var(--primary);
}

.day-bullet {
    position: absolute;
    left: -38px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--bg-app);
    border: 2px solid var(--text-muted);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.timeline-day-header.active .day-bullet {
    border-color: var(--primary);
    background-color: #ffffff;
}

.timeline-day-header.active .day-bullet::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
}

.builder-slots {
    min-height: 50px;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Tarjeta del Slot asignado */
.timeline-slot-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.timeline-slot-card:hover {
    box-shadow: var(--shadow-md);
}

.slot-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.slot-title-box {
    flex-grow: 1;
    min-width: 0;
}

.slot-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.slot-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    background-color: #f8fafc;
    gap: 4px;
    flex-shrink: 0;
}

.slot-input-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
}

.slot-time-input, .slot-pax-input {
    border: none;
    background: none;
    outline: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    width: 45px;
    text-align: center;
}

.slot-pax-input {
    width: 25px;
}

.slot-price-box {
    display: flex;
    align-items: center;
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    background-color: var(--danger-light);
    gap: 4px;
    flex-shrink: 0;
}

.slot-price-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--danger);
}

.slot-price-value {
    font-size: 11px;
    font-weight: 700;
    color: var(--danger);
}

.btn-remove-slot-new {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-slot-new:hover {
    color: var(--danger);
}

/* Dropzone vacía */
.empty-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255,255,255,0.01);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.empty-dropzone:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.empty-dropzone span.dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}


/* Footer de Totales Constructor */
.builder-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    background-color: var(--bg-card);
    border-top: 2px solid var(--primary);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 40;
}

.totals-group {
    display: flex;
    gap: 30px;
}

.total-stat {
    display: flex;
    flex-direction: column;
}

.total-stat-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.total-stat-value {
    font-size: 24px;
    font-weight: 800;
}

.total-stat-value.sale {
    color: var(--primary);
}

.markup-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.markup-input-container input {
    width: 60px;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    text-align: center;
}

/* ==========================================================================
   8. B2B SUPPLIER PORTAL & SALES CHARTS
   ========================================================================== */
/* B2B Portal */
.b2b-form-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
}

.b2b-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

.b2b-table th {
    background-color: var(--bg-app);
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.b2b-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.b2b-table tr:hover {
    background-color: #f8fafc;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
}

.status-badge.active { background-color: var(--success-light); color: var(--success); }
.status-badge.pending { background-color: var(--warning-light); color: var(--warning); }

/* SVG Sales Chart */
.svg-chart-container {
    height: 240px;
    position: relative;
    margin-top: 20px;
}

.svg-chart {
    width: 100%;
    height: 100%;
}

.chart-grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 4;
}

.chart-line {
    stroke: var(--primary);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
}

.chart-area {
    fill: url(#chart-gradient);
    opacity: 0.15;
}

.chart-dot {
    fill: var(--primary);
    stroke: #ffffff;
    stroke-width: 2;
    cursor: pointer;
    transition: var(--transition);
}

.chart-dot:hover {
    r: 7;
}

.chart-label {
    font-size: 10px;
    fill: var(--text-muted);
    text-anchor: middle;
}

/* ==========================================================================
   9. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
    .app-sidebar {
        width: 70px;
        overflow: hidden;
        height: 100vh;
        box-sizing: border-box;
    }
    .app-sidebar .user-info, 
    .app-sidebar .sidebar-header h2 .brand-text,
    .app-sidebar .brand-sub,
    .app-sidebar .menu-item span:not(.dashicons),
    .app-sidebar .sidebar-footer span:not(.dashicons) {
        display: none;
    }
    .app-sidebar .sidebar-header {
        padding: 12px 8px;
        align-items: center;
    }
    .app-sidebar .sidebar-header h2 {
        justify-content: center;
        gap: 0;
        margin: 0;
    }
    .app-sidebar .sidebar-user {
        padding: 10px 8px;
        justify-content: center;
    }
    .app-sidebar .sidebar-menu {
        padding: 10px 8px;
        gap: 4px;
        overflow-y: auto;
        min-height: 0;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE 10+ */
    }
    .app-sidebar .sidebar-menu::-webkit-scrollbar {
        width: 0;
        display: none; /* Chrome/Safari */
    }
    .app-sidebar .menu-item a {
        justify-content: center;
        padding: 10px 0;
        gap: 0;
    }
    .app-sidebar .sidebar-footer {
        padding: 10px 8px;
    }
    .app-sidebar .btn-logout {
        justify-content: center;
        padding: 10px 0;
        gap: 0;
    }
    .app-main {
        margin-left: 70px;
    }
    .builder-bottom-bar {
        left: 70px;
    }
    .directory-layout, .b2b-form-layout {
        grid-template-columns: 1fr;
    }
}

/* Optimización para laptops y pantallas de 1200px o menos */
@media (max-width: 1200px) {
    .app-main {
        padding: 20px;
    }
    .builder-bottom-bar {
        padding: 15px 20px;
    }
}

/* Colapsar barra de totales inferior cuando el ancho se reduce */
@media (max-width: 1100px) {
    .builder-bottom-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px 20px;
    }
    .totals-group {
        justify-content: space-between;
        gap: 15px;
    }
    .builder-actions {
        width: 100%;
    }
    .builder-actions button {
        flex: 1;
    }
    .builder-main {
        padding-bottom: 180px; /* Más espacio inferior ya que la barra colapsada es más alta */
    }
}

/* Colapsar a una columna en pantallas de tableta o móvil de menos de 900px */
@media (max-width: 900px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }
    .builder-sidebar {
        height: auto;
        position: static;
    }
}

/* ==========================================================================
   10. NOTIFICACIONES & ALERTAS DE COMPRAS
   ========================================================================== */
.notification-bell-container {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.notification-bell {
    font-size: 20px;
    color: var(--text-muted);
    transition: var(--transition);
}

.notification-bell:hover {
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 10px;
    border: 2px solid var(--bg-app);
}

.notification-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    width: 320px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.notification-dropdown.active {
    display: block;
    animation: modalUp 0.2s ease-out;
}

.notification-header {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.notification-item {
    padding: 12px 16px;
    font-size: 12px;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.4;
    transition: var(--transition);
}

.notification-item:hover {
    background-color: var(--primary-light);
}

.notification-item.critical {
    border-left: 4px solid var(--danger);
}

.notification-item.warning {
    border-left: 4px solid var(--warning);
}

.notification-item-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================================================
   11. BIBLIA DE VIAJES (ESTILO EXCEL CON ALERTAS)
   ========================================================================== */
.excel-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.viajes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 15px;
}

.viajes-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    text-align: left;
}

.viajes-table td {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}

.viaje-row-critical {
    background-color: #fff5f5 !important;
}

.viaje-row-warning {
    background-color: #fffbeb !important;
}

.badge-alert-critical {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}

.badge-alert-warning {
    background-color: var(--warning-light);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}

.badge-alert-none {
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-alert-purchased {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}

.checkbox-large {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ==========================================================================
   12. LOG DE AUDITORÍA
   ========================================================================== */
.audit-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

.audit-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.audit-card:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.audit-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.audit-vendedor {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.audit-action {
    font-size: 13px;
    color: var(--text-main);
}

.audit-time {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

/* ==========================================================================
   13. INTERFAZ CRONOLÓGICA DE LA BIBLIA (PESTAÑAS Y ACORDEONES)
   ========================================================================== */
.year-tabs-container {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.year-tab-button {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.year-tab-button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.year-tab-button.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.month-accordion {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.month-accordion:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.month-accordion-header {
    background-color: #f8fafc;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 700;
    font-size: 14px;
    color: #334155;
    transition: var(--transition);
}

.month-accordion-header:hover {
    background-color: #f1f5f9;
}

.month-accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

.month-accordion.active .month-accordion-icon {
    transform: rotate(180deg);
}

.month-accordion-content {
    display: none;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.month-accordion.active .month-accordion-content {
    display: block;
}

/* ==========================================================================
   12. DIRECTORY CRUD & SERVICE MODAL STYLES
   ========================================================================== */
.card-actions-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.btn-card-edit:hover {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

.btn-card-delete:hover {
    background-color: var(--danger) !important;
    color: #ffffff !important;
}

.cond-field {
    display: none; /* Controlado dinámicamente por JS */
}

.service-itinerary-day {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.service-itinerary-day .day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.service-itinerary-day .day-header span {
    font-weight: 700;
    font-size: 12px;
    color: var(--primary);
}

.service-itinerary-day .btn-remove-day-service {
    background: none;
    border: none;
    color: var(--danger);
    font-weight: 600;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.service-itinerary-day .btn-remove-day-service:hover {
    text-decoration: underline;
}

.service-image-preview img {
    max-width: 100%;
    border-radius: var(--radius-sm);
}


