/* ============================================================
   SECCIÓN 1: VARIABLES GLOBALES Y RESET BASE
   ============================================================ */
:root {
    --bg-dark: #0F172A;
    --bg-sidebar: #0B1120;
    --bg-card: #1E293B;
    --bg-card-inner: #0F172A;
    --bg-input: #334155;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: #3B82F6;

    --primary-blue: #2563EB;
    --primary-blue-hover: #1D4ED8;
    --zippy-orange: #FF9800;
    --zippy-green: #10B981;
    --zippy-red: #EF4444;

    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
}

* { 
    box-sizing: border-box; 
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', 'Inter', sans-serif;
    min-height: 100vh;
    background-color: var(--bg-dark) !important;
    background-image: none !important;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

.seccion-app { 
    width: 100%; 
    min-height: 100vh; 
}

/* ============================================================
   SECCIÓN 2: PANTALLA DE LOGIN
   ============================================================ */
#seccionLogin {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container { 
    width: 100%; 
    max-width: 460px; 
    padding: 24px; 
}

.card-login {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 44px 36px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.logo-login { 
    width: 92px; 
    height: 92px; 
    margin-bottom: 20px; 
    border-radius: 20px; 
}

.nombreEmpresa {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
}
.nombreEmpresa span { color: var(--zippy-orange); }

.subTitle {
    font-size: 15px;
    color: var(--text-muted);
    margin: 18px 0 34px 0;
    line-height: 1.6;
}

#btnGoogle {
    width: 100%;
    height: 58px;
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
    letter-spacing: 0.5px;
}
#btnGoogle:hover { 
    background-color: var(--primary-blue-hover); 
    transform: translateY(-2px); 
}

/* ============================================================
   SECCIÓN 3: PANTALLA DE CARGA (SPLASH)
   ============================================================ */
#seccionCargando {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-dark);
}

.welcome-splash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 20px 45px rgba(0,0,0,0.5);
    animation: fadeInSplash 0.3s ease-out;
}

@keyframes fadeInSplash {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.welcome-logo { 
    width: 76px; 
    height: 76px; 
    border-radius: 16px; 
    margin-bottom: 18px; 
}

#welcomeEmpresaTitulo {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 900;
    color: #FFF;
}

.welcome-dias-pill {
    display: inline-block;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #93C5FD;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 24px;
}

.loading-progress-container {
    width: 100%;
    height: 9px;
    background: #0F172A;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,0.08);
}

.loading-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2563EB, #10B981);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.loading-status-text {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   SECCIÓN 4: BARRA LATERAL (SIDEBAR)
   ============================================================ */
#seccionAdmin { 
    display: flex; 
    min-height: 100vh; 
}

#mainSidebar {
    width: 270px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-color);
}
.brand-logo { width: 44px; height: 44px; border-radius: 10px; }
.brand-title { display: block; font-weight: 900; font-size: 16px; color: var(--zippy-orange); }
.brand-sub { font-size: 12px; color: var(--text-muted); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.nav-section-label {
    font-size: 11.5px;
    font-weight: 800;
    color: #64748B;
    letter-spacing: 0.8px;
    margin: 18px 0 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-align: left;
}
.nav-item:hover { 
    background: rgba(255,255,255,0.05); 
    color: #FFF; 
}
.nav-item.active { 
    background: var(--primary-blue); 
    color: #FFF; 
    box-shadow: 0 4px 12px rgba(37,99,235,0.3); 
    font-weight: 700;
}

.badge-count {
    margin-left: auto;
    background: rgba(0,0,0,0.35);
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
}

.sidebar-footer {
    padding: 18px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dias-restantes-badge {
    background: #2563EB;
    color: #FFF;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.dias-restantes-badge.verde { background: #10B981 !important; color: #FFF !important; }
.dias-restantes-badge.naranja { background: #F59E0B !important; color: #FFF !important; }
.dias-restantes-badge.rojo { background: #EF4444 !important; color: #FFF !important; }

.btn-logout {
    width: 100%;
    padding: 11px;
    background: rgba(239, 68, 68, 0.1);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-logout:hover { background: #EF4444; color: #FFF; }

/* ============================================================
   SECCIÓN 5: TOPBAR Y ESPACIO DE TRABAJO
   ============================================================ */
#workspace {
    margin-left: 270px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#topBar {
    min-height: 72px;
    height: auto;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 26px;
    gap: 16px;
    flex-wrap: wrap;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1 1 250px;
    min-width: 220px;
}

#topBarTitle { 
    margin: 0; 
    font-size: 18.5px; 
    font-weight: 900; 
    color: #FFF; 
    line-height: 1.25;
}

.topbar-subtitle { 
    font-size: 13px; 
    color: var(--text-muted); 
    font-weight: 500; 
    margin-top: 4px;
    line-height: 1.4;
    word-break: break-word;
}

.topbar-center {
    flex: 1 1 280px;
    max-width: 440px;
    display: flex;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    width: 100%;
    min-width: 200px;
}

.search-box input {
    background: transparent;
    border: none;
    color: #FFF;
    outline: none;
    margin-left: 8px;
    width: 100%;
    font-size: 14px;
}

.topbar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.btn-anotar-rapido {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-anotar-rapido kbd {
    background: rgba(0,0,0,0.25);
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 12px;
}

#mainContent { 
    padding: 24px; 
    flex: 1; 
}

.tab-view { display: none; }
.tab-view.active { display: block; }

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
.panel-header h3 { 
    margin: 0; 
    font-size: 17px !important; 
    font-weight: 800; 
    color: #FFF;
}

/* ============================================================
   SECCIÓN 6: CONTABILIDAD (KPIS SUPERIORES Y 3 COLUMNAS)
   ============================================================ */
.kpi-top-bar-conta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card-big {
    background: linear-gradient(145deg, #1E293B, #0F172A);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.kpi-card-big:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.kpi-card-big.kpi-hoy { border-left: 6px solid #FF9800; }
.kpi-card-big.kpi-semana { border-left: 6px solid #2563EB; }
.kpi-card-big.kpi-mes { border-left: 6px solid #10B981; }
.kpi-card-big.kpi-anio { border-left: 6px solid #A855F7; }

.kpi-tag {
    font-size: 13px;
    font-weight: 900;
    color: #94A3B8;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.kpi-monto-principal {
    font-size: 28px;
    font-weight: 900;
    color: #FFFFFF;
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.kpi-desglose {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 800;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}
.sub-verde { color: #10B981; }
.sub-rojo { color: #EF4444; }

.conta-layout-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 18px;
    align-items: stretch;
}

.col-card-full, 
.panel-form-sticky {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 270px);
    min-height: 600px;
    padding: 18px !important;
}

.scroll-col-items {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}
.scroll-col-items::-webkit-scrollbar { width: 6px; }
.scroll-col-items::-webkit-scrollbar-thumb { 
    background: rgba(255,255,255,0.18); 
    border-radius: 4px; 
}

#formNuevoDato {
    background: var(--bg-card-inner);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 14px;
}

.tipo-movimiento-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    background: #1E293B;
    padding: 4px;
    border-radius: 8px;
}

.btn-tipo-mov {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
}
.btn-tipo-mov.activo {
    background: #2563EB;
    color: #FFF;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.form-inputs-compact {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.w-monto { flex: 1.1; }
.w-concepto { flex: 2; }

.input-wrap label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 700;
}
.input-wrap input {
    width: 100%;
    padding: 11px 13px;
    font-size: 15.5px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #FFF;
    outline: none;
    transition: border-color 0.2s;
}
.input-wrap input:focus {
    border-color: var(--border-focus);
}

.nota-accordion-wrapper {
    margin-bottom: 12px;
}
.btn-toggle-nota {
    background: transparent;
    border: none;
    color: #60A5FA;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    margin-bottom: 6px;
    display: inline-block;
}
.btn-toggle-nota:hover { text-decoration: underline; }

#contenedorNota textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #FFF;
    min-height: 50px;
    outline: none;
    font-family: inherit;
    font-size: 13.5px;
    resize: vertical;
}

.botones-anotar {
    display: flex;
    gap: 10px;
}
.btn-guardar-pro {
    flex: 2;
    background: var(--zippy-green);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    font-size: 14.5px;
    transition: 0.2s;
}
.btn-guardar-pro:hover { background: #059669; }

.btn-limpiar-pro {
    flex: 0.9;
    background: #475569;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 13.5px;
}
.btn-limpiar-pro:hover { background: #334155; }

.sub-seccion-hoy {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}
.sub-header-col {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 800;
    color: #F8FAFC;
    margin-bottom: 10px;
}
.badge-pill {
    background: #2563EB;
    color: #FFF;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 900;
}
.vacio-box {
    text-align: center;
    color: #64748B;
    font-size: 13px;
    padding: 24px 0;
}
.btn-secundario-mini {
    background: #334155;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

#contenedorItemsHoy > div {
    font-size: 14px !important;
    padding: 10px 12px !important;
    margin-bottom: 7px !important;
}

#sidebarList {
    list-style: none;
    padding: 0;
    margin: 0;
}

.separador-dia {
    margin-bottom: 10px !important;
    padding: 12px 14px !important;
    border-radius: 8px;
}
.separador-dia div:first-child {
    font-size: 14.5px !important;
    font-weight: 800;
}
.separador-dia div:last-child {
    font-size: 14px !important;
    font-weight: 700;
    margin-top: 4px;
}

#sidebarList li {
    font-size: 14.5px !important;
    padding: 10px 14px !important;
    margin-bottom: 6px !important;
    line-height: 1.4;
}

.separador-mes-card {
    background: #131E33;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px !important;
    margin-bottom: 12px !important;
    transition: transform 0.15s ease;
}
.separador-mes-card:hover { transform: scale(1.01); }

.mes-header-tit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 16px !important;
    color: #F8FAFC;
    margin-bottom: 10px;
}
.mes-header-tit span:last-child {
    font-size: 17.5px !important;
    font-weight: 900;
}

.mes-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.mes-stat-box { display: flex; flex-direction: column; }
.mes-stat-box span { font-size: 12px !important; color: #94A3B8; margin-bottom: 2px; font-weight: 600; }
.mes-stat-box strong { font-size: 14.5px !important; }

@media (max-width: 1200px) {
    .conta-layout-3col { grid-template-columns: 1fr !important; }
    .kpi-top-bar-conta { grid-template-columns: repeat(2, 1fr); }
    .col-card-full, .panel-form-sticky { height: auto; min-height: auto; }
}


/* ============================================================
   SECCIÓN 7: Pedidos
   ============================================================ */
/* ============================================================
   SECCIÓN 7: TARJETAS DE PEDIDOS (SOLO ICONOS, TEXTO GRANDE Y COMPACTO)
   ============================================================ */

.toolbar-pedidos {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.filtros-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.filtros-chips .chip {
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94A3B8;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.filtros-chips .chip:hover {
    border-color: #3B82F6;
    color: #FFF;
}

.filtros-chips .chip.active { 
    background: #2563EB; 
    color: #FFF; 
    border-color: #2563EB; 
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.filtros-chips .chip.chip-domi.active {
    background: #FF9800 !important;
    border-color: #FF9800 !important;
    color: #000000 !important;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

#pedidosGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 14px;
    align-items: stretch;
}

/* Tarjeta Principal */
.pedido-card {
    border: 1.5px solid rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 330px;
    position: relative;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    color: #0F172A !important;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pedido-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.pedido-card.en-ruta {
    box-shadow: 0 0 0 3px #16A34A, 0 6px 16px rgba(22, 163, 74, 0.25) !important;
}

/* Fila Superior Consolidada */
.card-top-consolidada {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    padding-bottom: 5px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.top-left-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-pago-pill {
    font-size: 11px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
}
.badge-pago-pill.pagado { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.badge-pago-pill.pendiente { background: #FEE2E2; color: #B91C1C; border: 1px solid #FCA5A5; }

.switch-ruta-mini {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 800;
    color: #1E293B;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 5px;
}
.switch-ruta-mini input {
    cursor: pointer;
    accent-color: #16A34A;
    width: 14px;
    height: 14px;
}

.badge-hora-entrega {
    font-size: 11.5px;
    font-weight: 900;
    color: #B91C1C;
    white-space: nowrap;
}

.domi-inline-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 140px;
    justify-content: flex-end;
}

.select-domi-inline {
    background: #FFFFFF;
    border: 1.5px solid #64748B;
    color: #0F172A;
    font-size: 11.5px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 5px;
    max-width: 130px;
    outline: none;
}

.btn-wa-domi-mini {
    background: #16A34A;
    color: #FFF !important;
    text-decoration: none;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 5px;
}

/* Barra de Creación y Referencia */
.card-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #334155;
    margin-bottom: 5px;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px 6px;
    border-radius: 4px;
}

.ref-tag-pro {
    background: rgba(0, 0, 0, 0.12);
    color: #0F172A;
    padding: 1px 7px;
    border-radius: 4px;
    font-weight: 900;
    font-size: 11px;
}

/* Banner de Adicionales de Orilla a Orilla */
.banner-adicional-full {
    width: 100%;
    background: #D97706;
    color: #FFFFFF !important;
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Cuerpo de la Tarjeta */
.card-body-compact {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex: 1;
    margin: 2px 0;
}

.card-img-block {
    width: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.mosaic-box {
    width: 100%;
    flex: 1;
    min-height: 185px;
    border-radius: 6px;
    overflow: hidden;
    background: #000000;
    border: 1px solid rgba(0, 0, 0, 0.25);
}

.sin-foto-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    font-size: 11px;
    font-weight: 700;
}

/* ============================================================
   FILAS DE INFORMACIÓN: SOLO ICONOS Y TEXTOS GRANDES
   ============================================================ */
.card-info-compact {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
}

.pedido-field-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px; /* TEXTO GRANDE Y FÁCIL DE LEER */
    line-height: 1.3;
    min-height: 24px;
}

/* Botón elegante de edición alineado verticalmente */
.pedido-field-row .btn-edit-pro {
    background: rgba(0, 0, 0, 0.06) !important;
    border: 1px solid rgba(0, 0, 0, 0.16) !important;
    color: #0F172A !important;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.pedido-field-row .btn-edit-pro:hover {
    background: #2563EB !important;
    color: #FFF !important;
    border-color: #2563EB !important;
    transform: scale(1.15);
}

.btn-spacer {
    width: 20px;
    height: 20px;
    display: inline-block;
    flex-shrink: 0;
}

/* Iconos grandes y claros */
.field-icon-only {
    width: 20px;
    font-size: 16px; /* Icono grande */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Valor del texto grande */
.field-value-main {
    flex: 1;
    min-width: 0;
    color: #000000;
    font-weight: 800;
    font-size: 13.5px;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Botón de WhatsApp con número grande */
.btn-pill-wa-lg {
    background: #16A34A;
    color: #FFFFFF !important;
    text-decoration: none;
    font-size: 13px !important;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.btn-pill-wa-lg:hover { background: #15803D; }

/* Enlace a Google Maps grande */
.btn-pill-maps-lg {
    color: #1D4ED8 !important;
    text-decoration: underline;
    font-size: 13.5px;
    font-weight: 800;
    word-break: break-word;
}

/* Fila de Nota resaltada */
.row-nota-clean {
    background: rgba(234, 88, 12, 0.12);
    border-left: 3px solid #EA580C;
    padding: 2px 6px;
    border-radius: 4px;
}
.row-nota-clean .field-value-main {
    color: #9A3412;
    font-weight: 800;
}

/* Acordeón de Dedicatoria */
.acordeon-mensaje-slim {
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 4px 8px;
    cursor: pointer;
}
.acordeon-mensaje-slim:hover { background: rgba(255, 255, 255, 0.9); }
.mensaje-resumen-slim {
    font-size: 11.5px;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mensaje-detalle-slim {
    font-size: 12px;
    color: #000000;
    font-style: italic;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px dashed rgba(0, 0, 0, 0.15);
    white-space: normal;
    max-height: 60px;
    overflow-y: auto;
}

/* Acciones Finales */
.card-actions-compact {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 5px;
}

.btn-act-print {
    background: #334155;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.btn-act-print:hover { background: #475569; }

.btn-act-entregar {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    flex: 1;
    white-space: nowrap;
}
.btn-act-entregar:hover { background: #1D4ED8; }

.fecha-header {
    grid-column: 1 / -1;
    font-weight: 800;
    font-size: 13.5px;
    margin: 5px 0 2px 0;
    padding: 5px 10px;
    background: #0B1120;
    color: #FF9800;
    border-left: 4px solid #FF9800;
    border-radius: 5px;
}


/* ============================================================
   SECCIÓN 8: MÉTRICAS Y GRÁFICOS FINANCIEROS
   ============================================================ */
.periodos-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card-periodo {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.card-periodo.hoy { border-top: 4px solid var(--zippy-orange); }
.card-periodo.ayer { border-top: 4px solid #64748B; }
.card-periodo.semana { border-top: 4px solid var(--primary-blue); }
.card-periodo.mes { border-top: 4px solid var(--zippy-green); }
.card-periodo.anio { border-top: 4px solid #A855F7; }

.periodo-badge { font-size: 13px; font-weight: 900; color: #FFF; margin-bottom: 12px; }
.periodo-body { display: flex; flex-direction: column; gap: 8px; }
.kpi-mini-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-muted); }
.kpi-mini-row.neto {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-color);
    font-size: 15px;
    font-weight: 900;
    color: #FFF;
}

.graficos-container-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.chart-card { min-height: 380px; }
.chart-wrapper { position: relative; height: 300px; width: 100%; }

/* ============================================================
   SECCIÓN 9: IMPRESIÓN DE TARJETAS 4x6 (TIPOGRAFÍA COMIC & ENCABEZADOS NÍTIDOS)
   ============================================================ */
.print-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.print-contenido {
    background: #FFFFFF !important;
    color: #0F172A !important; /* TEXTO OSCURO NÍTIDO SOBRE EL MODAL BLANCO */
    padding: 20px 24px;
    border-radius: 14px;
    width: 90vw;
    max-width: 920px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* ENCABEZADO DEL MODAL (CORREGIDO DE BLANCO A OSCURO) */
.print-contenido h3 {
    margin: 0 0 14px 0 !important;
    font-size: 19px !important;
    font-weight: 900 !important;
    color: #0F172A !important; /* Ahora 100% visible */
    display: flex;
    align-items: center;
    gap: 8px;
}

/* OPCIONES Y CASILLAS (MOSTRAR PARA / MOSTRAR DE) */
.opciones-impresion {
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    color: #0F172A !important;
}

.opciones-impresion label {
    margin-right: 20px;
    cursor: pointer;
    font-weight: 800 !important;
    color: #0F172A !important; /* Letra negra para los checkboxes */
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.opciones-impresion input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563EB;
    cursor: pointer;
}

.nota-impresion {
    margin-top: 8px;
    font-size: 12.5px;
    color: #475569 !important;
    line-height: 1.45;
}

.nota-impresion strong {
    color: #B45309 !important;
}

/* ÁREA DE LA TARJETA 4x6 */
.print-area-horizontal {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px 0;
}

.tarjeta-impresion {
    overflow: hidden;
    width: 152.4mm;
    height: 101.6mm;
    padding: 8mm 10mm 6mm 38mm; /* Margen izquierdo de 38mm para el ramo/logo */
    box-sizing: border-box;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1.5px solid #008558; /* Borde verde característico de la floristería */
    position: relative;
    color: #2C2C2C;
}

/* ============================================================
   TIPOGRAFÍA DE LA SEGUNDA IMAGEN (COMIC SANS MS / COMIC NEUE)
   ============================================================ */
.mensaje-principal {
    flex: 1;                              
    font-family: 'Comic Sans MS', 'Comic Neue', cursive, sans-serif !important;  
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    line-height: 1.35;
    white-space: pre-wrap;                 
    overflow-wrap: break-word;             
    color: #1E293B !important;                       
    height: 100%;
    margin: 0;
    overflow: hidden;
    padding: 2px 4px;
    font-weight: normal !important;
}

.de-para {
    margin-top: 2mm;
    font-size: 16px;
    text-align: center;
    font-family: 'Georgia', serif;
    color: #0F172A;
}

.de-para div {
    margin-top: 1mm;
}

.de-para strong {
    font-weight: 900;
}

.decoracion {
    text-align: center;
    font-size: 10px;
    color: #8B0000; /* Rojo quemado institucional */
    font-family: 'Georgia', serif;
    line-height: 1.3;
}

/* LOGO DE LA EMPRESA (FLORAL) */
.logo-empresa {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
    overflow: hidden;
}

.logo-empresa img {
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    display: block;
}

.logo-empresa .placeholder {
    position: absolute;
    inset: 0;
    z-index: 1;
    font-size: 9px;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.mensaje-principal,
.de-para,
.decoracion {
    position: relative;
    z-index: 2;
}

/* BOTONES INFERIORES DEL MODAL */
.print-botones {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    gap: 12px;
}

.print-botones button.guardar {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
}
.print-botones button.guardar:hover { background: #1D4ED8; }

.print-botones button.cancelar {
    background: #E2E8F0;
    color: #0F172A;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.print-botones button.cancelar:hover { background: #CBD5E1; }

/* REGLAS DIRECTAS PARA LA IMPRESORA FÍSICA */
@media print {
    body * { visibility: hidden; }
    #printArea, #printArea * { visibility: visible; }
    #printArea {
        position: fixed;
        top: 0;
        left: 0;
        width: 152.4mm;
        height: 101.6mm;
        margin: 0;
        box-sizing: border-box;
        border: none;
        box-shadow: none;
    }
    .tarjeta-impresion {
        padding-left: 38mm;
        width: 152.4mm;
        height: 101.6mm;
        border: none;
    }
    .mensaje-principal {
        font-family: 'Comic Sans MS', 'Comic Neue', cursive, sans-serif !important;
        font-weight: normal !important;
    }
}