/* ============================================
   ESTILOS GLOBALES - SISTEMA DE FACTURACIÓN
   ============================================ */

:root {
    --mint: #39bda7;
    --mint-hover: #2da896;
    --mint-light: #e8f8f5;
    --mint-dark: #2c9580;
    --text: #16303b;
    --text-muted: #8aa4ad;
    --border: #e7eff2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f7fbfc 0%, #e8f8f5 100%);
    color: var(--text);
    min-height: 100vh;
}

/* ===== NAVBAR MINT — refresh 2026-07 =====
   Ahora usa el gradient 3-stops de FactureloSV para consistencia con
   el hero y con el resto del sistema de diseño. */
.navbar-mint {
    background: linear-gradient(135deg,#1a5c4a 0%,#2c9580 50%,#39bda7 100%);
    box-shadow: 0 4px 20px rgba(15,74,58,.18);
    padding-top: .55rem;
    padding-bottom: .55rem;
}

.navbar-mint .navbar-brand,
.navbar-mint .nav-link,
.navbar-mint .navbar-text {
    color: #fff !important;
}

.navbar-mint .navbar-brand {
    font-weight: 700;
    letter-spacing: -.01em;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.navbar-mint .navbar-brand i {
    background: rgba(255,255,255,.20);
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem;
}

.navbar-mint .nav-link:hover {
    color: #f5fffd !important;
    text-decoration: none;
    background: rgba(255,255,255,.10);
    border-radius: 8px;
}

.navbar-mint .btn-outline-light {
    border: 1.5px solid rgba(255,255,255,.35);
    color: #fff;
    border-radius: 999px;
    padding: .4rem 1.1rem;
    font-weight: 500; font-size: .82rem;
    background: rgba(255,255,255,.10);
    backdrop-filter: blur(6px);
    transition: all .15s ease;
}

.navbar-mint .btn-outline-light:hover {
    background: rgba(255,255,255,.22);
    border-color: #fff;
    transform: translateY(-1px);
}

/* Botón Salir con estilo diferenciado */
.navbar-mint .btn-salir {
    background: rgba(220,38,38,.20);
    border-color: rgba(255,255,255,.35);
    color: #fff;
}
.navbar-mint .btn-salir:hover {
    background: rgba(220,38,38,.35);
    color: #fff;
}

.badge-ghost {
    background: rgba(255,255,255,.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 20px;
    padding: .5rem 1rem;
    font-size: .875rem;
    font-weight: 500;
}

/* ===== CARDS ===== */
.card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(57, 189, 167, .08);
    transition: all .3s;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 12px 32px rgba(57, 189, 167, .15);
}

.card-header {
    background: linear-gradient(135deg, var(--mint) 0%, #5ed0be 100%);
    color: #fff;
    border: 0;
    padding: 0.4rem 0.75rem;
    border-radius: 16px 16px 0 0 !important;
    font-weight: 600;
}

.section-title {
    background: linear-gradient(135deg, var(--mint) 0%, #5ed0be 100%);
    color: #fff;
    font-weight: 600;
    border-radius: 16px 16px 0 0 !important;
}

.section-title h5 {
    margin: 0;
    color: #fff;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: .75rem 1rem;
    transition: all .3s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 .25rem rgba(57, 189, 167, .15);
    outline: 0;
}

.form-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: .5rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--mint) !important;
    border: 0;
    border-radius: 10px;
    padding: .75rem 1.5rem;
    font-weight: 600;
    transition: all .3s;
}

.btn-primary:hover {
    background: var(--mint-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(57, 189, 167, .3);
}

.btn-success {
    background: var(--mint) !important;
    border: 0;
}

.btn-success:hover {
    background: var(--mint-hover) !important;
}

.btn-secondary {
    border-radius: 10px;
    padding: .75rem 1.5rem;
    font-weight: 600;
}

.btn-danger {
    border-radius: 8px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* ===== ITEMS DE FACTURA ===== */
.item-row {
    position: relative;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all .3s;
}

.item-row:hover {
    border-color: var(--mint);
    box-shadow: 0 4px 12px rgba(57, 189, 167, .1);
}

.remove-item {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity .2s;
}

.remove-item:hover {
    opacity: 1;
}

/* ===== RESUMEN DE TOTALES ===== */
#resumen-totales {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

#resumen-totales .card {
    border-radius: 12px;
    border: 0;
}

#resumen-totales .bg-light {
    background: var(--mint-light) !important;
    border: 1px solid rgba(57, 189, 167, .1);
}

#resumen-totales .bg-primary {
    background: linear-gradient(135deg, var(--mint) 0%, var(--mint-dark) 100%) !important;
}

/* ===== PAGE HEADER (barra superior de formularios) ===== */
.page-header {
    background: linear-gradient(135deg, #2e7d62 0%, #39bda7 100%);
    color: #fff;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.page-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.3rem;
}
.page-header small {
    opacity: .85;
    font-size: .85rem;
}
.page-header .ph-icon {
    font-size: 2rem;
    opacity: .9;
}

/* ===== LOADER ===== */
.loader-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, .95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loader-overlay .spinner-border {
    color: var(--mint);
    width: 4rem;
    height: 4rem;
}

/* ===== ALERTS ===== */
.alert {
    border: 0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background: var(--mint-light);
    color: var(--mint-dark);
    border-left: 4px solid var(--mint);
}

/* ===== VALIDACIÓN ===== */
.invalid-feedback {
    font-size: .875rem;
    color: #dc3545;
}

.was-validated .form-control:invalid {
    border-color: #dc3545;
}

.was-validated .form-control:valid {
    border-color: var(--mint);
}

/* ===== TÍTULOS Y TEXTOS ===== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: 600;
}

.text-center {
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .card-body {
        padding: 1.25rem;
    }
    
    .item-row {
        padding: 1rem;
    }
    
    .navbar-mint .navbar-brand {
        font-size: 1rem;
    }
    
    .badge-ghost {
        font-size: .75rem;
        padding: .4rem .8rem;
    }
}

/* ===== UTILITIES ===== */
.text-mint {
    color: var(--mint);
}

.bg-mint {
    background-color: var(--mint);
}

.border-mint {
    border-color: var(--mint);
}

.text-danger {
    color: #dc2626 !important;
}

.fw-bold {
    font-weight: 600 !important;
}

/* ===== COMPATIBILIDAD CON BOOTSTRAP ICONS ===== */
.bi {
    vertical-align: -.125em;
}

/* ===== FIX PARA SELECT DE TRIBUTOS ===== */
.codigo-tributo {
    max-width: 100%;
}

/* ===== MEJORAS VISUALES ADICIONALES ===== */
.container {
    max-width: 1200px;
}

.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col, .col-md-2, .col-md-3, .col-md-5, .col-md-6, .col-md-12 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* ===== ANIMACIONES SUAVES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-in-out;
}

/* ===== MEJORA DE ACCESIBILIDAD ===== */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--mint);
    outline-offset: 2px;
}

/* ===== SCROLL SUAVE ===== */
html {
    scroll-behavior: smooth;
}
/* ===== FORMULARIOS COMPACTOS ===== */
.form-control-sm,
.form-select-sm {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    min-height: unset;
}

textarea.form-control-sm {
    padding: 0.25rem 0.5rem;
}

.form-label.small {
    font-size: 0.75rem;
    margin-bottom: 0.15rem !important;
}

.card-header.section-title h5 {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.card-body.p-2 {
    padding: 1rem 1.25rem !important;
}

.card-body.pb-2 {
    padding: 1rem 1.25rem 0.75rem !important;
}

.card-body {
    padding: 1rem 1.25rem !important;
}

.invalid-feedback {
    font-size: 0.7rem;
}

.table-sm thead th {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    font-weight: 600;
}

.table-sm tbody td {
    padding: 0.2rem 0.3rem;
    vertical-align: middle;
}

.table-sm tbody td .form-control-sm,
.table-sm tbody td .form-select-sm {
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
    font-size: 0.78rem;
    height: auto;
    line-height: 1.3;
}

/* ============================================================
   RESPONSIVE GLOBAL — tabletas, iPad, móvil
   Breakpoints:
     ≥1200px  desktop                (sin cambios)
     992-1199 laptop pequeña          (sin cambios)
     768-991  iPad landscape          (.responsive-tablet)
     576-767  iPad portrait / móvil L (.responsive-mobile-lg)
     <576px   móvil                   (.responsive-mobile)
   ============================================================ */

/* TODOS los tamaños — evitar overflow horizontal de la página */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* TODA tabla recibe contenedor scroll horizontal en pantallas chicas
   sin tener que modificar cada plantilla. */
@media (max-width: 991.98px) {
    table.table {
        font-size: .82rem;
    }
    table.table th, table.table td {
        white-space: nowrap;
    }
    /* Si la tabla no tiene wrapper .table-responsive, simulamos uno con scroll */
    .card-body > table.table,
    .container > table.table,
    .container-fluid > table.table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* TABLET LANDSCAPE / iPad (≤991px) */
@media (max-width: 991.98px) {
    .container, .container-fluid {
        padding-left: .75rem;
        padding-right: .75rem;
    }
    .card-body { padding: 0.9rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.05rem; }
    h5 { font-size: .95rem; }

    /* Formularios DTE: reducir paddings y permitir que el row haga wrap */
    .form-card, .config-card {
        padding: 1rem !important;
        max-width: 100% !important;
        margin: 1rem auto !important;
    }

    /* Sidebar más estrecho */
    .sidebar { width: 220px !important; }
    .main-area { padding: 1rem .75rem !important; }
}

/* MÓVIL / TABLET PORTRAIT (≤767px) */
@media (max-width: 767.98px) {
    body { font-size: .95rem; }
    .container, .container-fluid { padding-left: .5rem; padding-right: .5rem; }
    .card { border-radius: 10px; }
    .card-body { padding: 0.75rem; }

    /* Navbar: botones más pequeños, dropdown país compacto */
    .navbar-mint .navbar-brand { font-size: .95rem; }
    .navbar-mint .btn-sm { padding: .2rem .45rem; font-size: .78rem; }

    /* Formularios — apilar columnas */
    .row > [class*="col-"] { margin-bottom: .5rem; }
    .form-label.small { font-size: .78rem; margin-bottom: .15rem; }
    .form-control-sm, .form-select-sm { font-size: .85rem; }

    /* Botones grandes apilados */
    .btn-lg { padding: .6rem 1rem; font-size: .95rem; }
    .d-flex.justify-content-end.gap-2 { flex-wrap: wrap; }
    .d-flex.justify-content-end.gap-2 .btn { flex: 1 1 auto; }

    /* Encabezados de columna de tablas: ocultar columnas auxiliares en móvil */
    table.table th, table.table td { padding: .35rem .4rem; font-size: .78rem; }

    /* Cards de KPI en una columna */
    .kpi-card, .kpi { margin-bottom: .5rem; }

    /* Hacer iframe contenedor que se adapte */
    iframe { width: 100% !important; min-height: 70vh; }

    /* Modal mobile-friendly */
    .modal-dialog { margin: .5rem; max-width: calc(100% - 1rem); }

    /* Sidebar: en móvil convertir a drawer (over-content) */
    .sidebar {
        position: fixed !important;
        top: 56px;
        left: 0;
        bottom: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform .25s ease;
        width: 75vw !important;
        max-width: 280px;
        box-shadow: 4px 0 12px rgba(0,0,0,.15);
    }
    .sidebar.sidebar-open { transform: translateX(0); }
    .page-wrapper .main-area { margin-left: 0 !important; width: 100% !important; }

    /* Botón hamburguesa visible en móvil */
    .mobile-menu-btn { display: inline-flex !important; }

    /* Galería de imágenes 2 columnas en móvil */
    .col-6.col-md-3 { flex: 0 0 50%; max-width: 50%; }
}

/* MÓVIL PEQUEÑO (≤575px) */
@media (max-width: 575.98px) {
    h2 { font-size: 1.05rem; }
    .card-header.section-title h5 { font-size: .9rem; }

    /* Resúmenes de totales — apilar */
    .row.g-2 > .col-md-3,
    .row.g-2 > .col-md-6 { flex: 0 0 100%; max-width: 100%; }

    /* Selector país en navbar: ocultar texto, solo bandera */
    .navbar-mint .dropdown .d-none.d-md-inline { display: none !important; }
}

/* Botón hamburguesa solo en pantallas chicas */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    padding: .25rem .5rem;
}

/* Backdrop cuando el sidebar móvil está abierto */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1030;
}
.sidebar-backdrop.show { display: block; }

/* ============================================================
   SISTEMA DE DISEÑO FACTURELOSV 2026-07
   Basado en el look & feel de www.facturelosv.com
   Componentes reutilizables — cualquier template puede consumir
   estas clases para heredar el estilo consistente.
   ============================================================ */

:root {
    /* Paleta oficial (verde teal FactureloSV) */
    --fx-deep:    #0f4a3a;
    --fx-mint-1:  #1a5c4a;
    --fx-mint:    #2c9580;
    --fx-mint-2:  #39bda7;
    --fx-mint-3:  #5ed0be;
    --fx-mint-4:  #a7f3d0;
    --fx-mint-bg: #e8f8f5;
    --fx-mint-soft: #f0faf8;

    /* Neutros */
    --fx-text:    #16303b;
    --fx-text-2:  #334155;
    --fx-muted:   #6b8a92;
    --fx-muted-2: #94a3b8;
    --fx-border:  #d4e2e0;
    --fx-border-soft: #e5f2ef;
    --fx-bg-soft: linear-gradient(135deg,#f0faf8 0%,#e8f8f5 100%);

    /* Semánticos */
    --fx-danger:  #dc2626;
    --fx-warning: #f59e0b;
    --fx-info:    #3b82f6;
    --fx-success: #10b981;

    /* Shadows y radios */
    --fx-shadow-sm: 0 3px 14px rgba(57,189,167,.07);
    --fx-shadow:    0 4px 20px rgba(57,189,167,.08);
    --fx-shadow-lg: 0 8px 32px rgba(26,92,74,.20);
    --fx-shadow-hover: 0 8px 28px rgba(57,189,167,.14);
    --fx-radius:    16px;
    --fx-radius-sm: 10px;
    --fx-radius-lg: 22px;

    /* Ring focus */
    --fx-ring: 0 0 0 4px rgba(57,189,167,.16);
}

/* -------- Fondo global de todas las pantallas -------- */
body {
    background: var(--fx-bg-soft);
    font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--fx-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Los inputs de Bootstrap heredan look moderno automáticamente */
.form-control, .form-select, textarea.form-control {
    border-radius: var(--fx-radius-sm);
    border: 1.5px solid var(--fx-border);
    font-size: .88rem;
    padding: .55rem .8rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--fx-mint);
    box-shadow: var(--fx-ring);
    outline: 0;
}
.form-label {
    font-size: .78rem; font-weight: 600; color: var(--fx-text-2);
    margin-bottom: .35rem; letter-spacing: .01em;
}

/* -------- HERO (cabecera con gradient teal) -------- */
.fx-hero {
    background: linear-gradient(135deg,#1a5c4a 0%,#2c9580 50%,#39bda7 100%);
    border-radius: 18px; padding: 1.4rem 1.75rem; color: #fff;
    box-shadow: var(--fx-shadow-lg); margin-bottom: 1.25rem;
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 1rem;
}
.fx-hero::before {
    content: ''; position: absolute; right: -40px; top: -40px;
    width: 180px; height: 180px; border-radius: 50%;
    background: rgba(255,255,255,.08); z-index: 0;
}
.fx-hero::after {
    content: ''; position: absolute; right: 80px; bottom: -30px;
    width: 100px; height: 100px; border-radius: 50%;
    background: rgba(255,255,255,.05); z-index: 0;
}
.fx-hero .fx-hero-icon {
    width: 52px; height: 52px; border-radius: 14px;
    background: rgba(255,255,255,.18);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: inset 0 -3px 8px rgba(0,0,0,.10); z-index: 1;
    flex-shrink: 0;
}
.fx-hero .fx-hero-icon i { font-size: 1.55rem; }
.fx-hero .fx-hero-text { z-index: 1; flex: 1; }
.fx-hero .fx-hero-text h1,
.fx-hero .fx-hero-text h2 {
    font-size: 1.45rem; font-weight: 600; margin: 0; color: #fff;
}
.fx-hero .fx-hero-sub {
    font-size: .82rem; opacity: .90; font-weight: 300;
    margin-top: .15rem;
}
.fx-hero .fx-hero-actions {
    margin-left: auto; z-index: 1;
    display: flex; gap: .5rem; align-items: center;
    flex-wrap: wrap;
}

/* -------- KPI CARDS -------- */
.fx-kpi {
    background: #fff; border-radius: var(--fx-radius); padding: 1rem 1.15rem;
    border: 1px solid var(--fx-border-soft);
    box-shadow: var(--fx-shadow);
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex; align-items: center; gap: .9rem;
    height: 100%;
}
.fx-kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--fx-shadow-hover);
}
.fx-kpi .fx-kpi-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.35rem; color: #fff; flex-shrink: 0;
}
.fx-kpi.fx-kpi-blue   .fx-kpi-icon { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.fx-kpi.fx-kpi-green  .fx-kpi-icon { background: linear-gradient(135deg,#2c9580,#39bda7); }
.fx-kpi.fx-kpi-gray   .fx-kpi-icon { background: linear-gradient(135deg,#64748b,#475569); }
.fx-kpi.fx-kpi-amber  .fx-kpi-icon { background: linear-gradient(135deg,#f59e0b,#d97706); }
.fx-kpi.fx-kpi-red    .fx-kpi-icon { background: linear-gradient(135deg,#ef4444,#dc2626); }
.fx-kpi.fx-kpi-violet .fx-kpi-icon { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.fx-kpi.fx-kpi-cyan   .fx-kpi-icon { background: linear-gradient(135deg,#06b6d4,#0891b2); }
.fx-kpi.fx-kpi-pink   .fx-kpi-icon { background: linear-gradient(135deg,#ec4899,#db2777); }
.fx-kpi .fx-kpi-num {
    font-size: 1.75rem; font-weight: 700; line-height: 1;
    color: var(--fx-text); margin: 0;
}
.fx-kpi .fx-kpi-lbl {
    font-size: .72rem; color: var(--fx-muted); text-transform: uppercase;
    letter-spacing: .05em; font-weight: 600; margin-top: .15rem;
}

/* -------- FORM SECTIONS (card con header colorido) -------- */
.fx-section {
    background: #fff; border-radius: var(--fx-radius);
    box-shadow: var(--fx-shadow);
    border: 1px solid var(--fx-border-soft);
    margin-bottom: 1.25rem;
    overflow: hidden;
    transition: box-shadow .2s ease;
}
.fx-section:hover { box-shadow: var(--fx-shadow-hover); }
.fx-section-head {
    display: flex; align-items: center; gap: .8rem;
    padding: .85rem 1.25rem;
    background: linear-gradient(180deg,#f5fbfa 0%,#eef8f5 100%);
    border-bottom: 2px solid #d4efe8;
}
.fx-section-head .fx-badge-icon {
    width: 38px; height: 38px; border-radius: 10px; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; flex-shrink: 0;
    background: linear-gradient(135deg,#2c9580,#39bda7);
}
.fx-section-head .fx-badge-icon.blue    { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.fx-section-head .fx-badge-icon.cyan    { background: linear-gradient(135deg,#0ea5e9,#0284c7); }
.fx-section-head .fx-badge-icon.green   { background: linear-gradient(135deg,#10b981,#059669); }
.fx-section-head .fx-badge-icon.amber   { background: linear-gradient(135deg,#f59e0b,#d97706); }
.fx-section-head .fx-badge-icon.violet  { background: linear-gradient(135deg,#8b5cf6,#7c3aed); }
.fx-section-head .fx-badge-icon.pink    { background: linear-gradient(135deg,#ec4899,#db2777); }
.fx-section-head h5, .fx-section-head h6 {
    margin: 0; font-size: .95rem; font-weight: 600; color: var(--fx-text);
    letter-spacing: .02em;
}
.fx-section-head .fx-sub {
    font-size: .7rem; color: var(--fx-muted); font-weight: 400;
    display: block; margin-top: .05rem;
}
.fx-section-body { padding: 1.15rem 1.25rem .95rem; }

/* Input con ícono a la izquierda (patrón usado en cliente / compras) */
.fx-input-icon { position: relative; }
.fx-input-icon > i {
    position: absolute; left: .85rem; top: 50%;
    transform: translateY(-50%); color: #94a3b8; z-index: 2;
    pointer-events: none; font-size: .95rem;
}
.fx-input-icon .form-control,
.fx-input-icon .form-select {
    padding-left: 2.3rem;
}

/* -------- TABLA CARD (listado con header gradient) -------- */
.fx-tabla {
    background: #fff; border-radius: var(--fx-radius);
    box-shadow: var(--fx-shadow);
    border: 1px solid var(--fx-border-soft); overflow: hidden;
}
.fx-tabla-head {
    background: linear-gradient(135deg,#1a5c4a 0%,#2c9580 50%,#39bda7 100%);
    padding: .7rem 1.15rem; color: #fff;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .5rem;
}
.fx-tabla-head .titulo {
    font-weight: 600; font-size: .95rem;
    display: inline-flex; align-items: center; gap: .5rem;
    color: #fff;
}
.fx-tabla-head .contador {
    background: rgba(255,255,255,.20); padding: .2rem .7rem;
    border-radius: 16px; font-size: .75rem; font-weight: 500;
}
.fx-tabla table {
    margin: 0; font-size: .85rem;
}
.fx-tabla table thead th {
    background: #f5fbfa; color: var(--fx-muted);
    font-size: .7rem; text-transform: uppercase;
    letter-spacing: .05em; font-weight: 600;
    padding: .75rem .85rem;
    border-bottom: 2px solid #d4efe8; border-top: none;
    white-space: nowrap;
}
.fx-tabla table tbody td {
    padding: .75rem .85rem; vertical-align: middle;
    color: var(--fx-text); border-bottom: 1px solid var(--fx-mint-soft);
}
.fx-tabla table tbody tr { transition: background .12s ease; }
.fx-tabla table tbody tr:hover { background: var(--fx-mint-soft); }
.fx-tabla table tbody tr:last-child td { border-bottom: none; }

/* -------- BOTONES -------- */
.btn-fx-primary {
    background: linear-gradient(135deg,#1a5c4a 0%,#2c9580 50%,#39bda7 100%);
    border: none; color: #fff;
    border-radius: 12px; padding: .55rem 1.15rem;
    font-weight: 600; font-size: .9rem; letter-spacing: .01em;
    box-shadow: 0 4px 14px rgba(44,149,128,.28);
    transition: transform .12s ease, box-shadow .15s ease;
    display: inline-flex; align-items: center; gap: .4rem;
    text-decoration: none;
}
.btn-fx-primary:hover {
    transform: translateY(-1px); color: #fff;
    box-shadow: 0 6px 20px rgba(44,149,128,.38);
}
.btn-fx-secondary {
    background: #fff; color: var(--fx-muted); border: 1.5px solid var(--fx-border);
    border-radius: 10px; padding: .55rem 1rem; font-size: .85rem;
    font-weight: 500; transition: all .12s ease;
    display: inline-flex; align-items: center; gap: .3rem;
    justify-content: center; text-decoration: none;
}
.btn-fx-secondary:hover {
    background: #f1f5f9; color: #334155; border-color: #94a3b8;
}
.btn-fx-danger {
    background: #fff; color: #dc2626; border: 1.5px solid #fecaca;
    border-radius: 10px; padding: .55rem 1rem; font-size: .85rem;
    font-weight: 500; transition: all .12s ease;
    display: inline-flex; align-items: center; gap: .3rem;
    justify-content: center;
}
.btn-fx-danger:hover { background: #fee2e2; color: #991b1b; }

/* Botón "Regresar" pill */
.btn-fx-back {
    background: #fff; color: var(--fx-muted);
    border: 1.5px solid var(--fx-border);
    border-radius: 10px; padding: .35rem .75rem; font-size: .82rem;
    display: inline-flex; align-items: center; gap: .3rem;
    transition: all .12s ease; text-decoration: none;
}
.btn-fx-back:hover { background: #f1f5f9; color: #334155; }

/* Botones de acción cuadrados (para columnas de tabla) */
.fx-btn-accion {
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid; background: #fff; font-size: .85rem;
    padding: 0; transition: all .12s ease;
}
.fx-btn-accion.ver    { border-color: #a7f3d0; color: #059669; }
.fx-btn-accion.ver:hover    { background: #d1fae5; }
.fx-btn-accion.editar { border-color: #bfdbfe; color: #2563eb; }
.fx-btn-accion.editar:hover { background: #dbeafe; }
.fx-btn-accion.borrar { border-color: #fecaca; color: #dc2626; }
.fx-btn-accion.borrar:hover { background: #fee2e2; }
.fx-btn-accion.imprimir { border-color: #ddd6fe; color: #7c3aed; }
.fx-btn-accion.imprimir:hover { background: #ede9fe; }

/* -------- BADGES -------- */
.fx-badge {
    display: inline-block; padding: .25rem .55rem; border-radius: 6px;
    font-size: .68rem; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase;
}
.fx-badge.green { background: #d1fae5; color: #065f46; }
.fx-badge.blue  { background: #dbeafe; color: #1e40af; }
.fx-badge.amber { background: #fef3c7; color: #92400e; }
.fx-badge.red   { background: #fee2e2; color: #991b1b; }
.fx-badge.gray  { background: #e5e7eb; color: #374151; }
.fx-badge.violet{ background: #ede9fe; color: #5b21b6; }
.fx-badge.pink  { background: #fce7f3; color: #9d174d; }

/* -------- ALERTAS -------- */
.alert {
    border-radius: 12px !important; border: 1px solid !important;
    font-size: .88rem;
}
.alert-success { background: #d1fae5; border-color: #a7f3d0; color: #065f46; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.alert-info    { background: #dbeafe; border-color: #bfdbfe; color: #1e40af; }

/* -------- EMPTY STATE -------- */
.fx-empty {
    text-align: center; padding: 3rem 1rem;
    background: var(--fx-mint-soft); border-radius: 12px; margin: 1rem;
}
.fx-empty i { font-size: 3rem; color: var(--fx-muted-2); }
.fx-empty h5 { color: #334155; margin-top: .65rem; font-size: 1.05rem; }
.fx-empty p  { color: var(--fx-muted); font-size: .85rem; margin-bottom: 1rem; }

/* -------- WRAPPER responsive con max-width -------- */
.fx-wrap { max-width: 1400px; margin: 0 auto; }
.fx-wrap-narrow { max-width: 920px; margin: 0 auto; }
.fx-wrap-wide { max-width: 1600px; margin: 0 auto; }

/* -------- Utilities cortas -------- */
.text-fx-mint { color: var(--fx-mint) !important; }
.bg-fx-mint-soft { background: var(--fx-mint-soft) !important; }
.border-fx { border-color: var(--fx-border-soft) !important; }

