/* RUNPA — Portal de autogestión de empresas CORPOEZ (interior autenticado)
 * Basado en el prototipo "Diseñar portal de autogestión" y en continuidad
 * directa con las pantallas de acceso (runpa-acceso.css).
 */

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../../../../assets/plugins/poppins/Poppins-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../../../../assets/plugins/poppins/Poppins-Bold.woff2') format('woff2');
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../../../../assets/plugins/poppins/Poppins-ExtraBold.woff2') format('woff2');
}

body.customers {
    --cz-green: #0C7A2F;
    --cz-green-hover: #229039;
    --cz-green-dark: #095e24;
    --cz-green-light: #e8f6ec;
    --cz-green-soft: #f2faf4;
    --cz-accent: #97BE3D;

    --cz-surface: #ffffff;
    --cz-bg: #f2faf4;
    --cz-field-bg: #f9fafb;
    --cz-border: #e5e7eb;
    --cz-border-soft: rgba(12, 122, 47, 0.1);
    --cz-table-border: #e5e7eb;
    --cz-border-row: #f3f4f6;
    --cz-row-hover: #f2faf4;

    --cz-text: #374151;
    --cz-text-muted: #6b7280;
    --cz-text-soft: #9ca3af;
    --cz-text-dark: #1a2e22;
    --cz-danger: #dc2626;

    --cz-radius-card: 16px;
    --cz-radius-field: 12px;
    --cz-radius-pill: 999px;
    --cz-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --cz-shadow-btn: 0 1px 2px rgba(12, 122, 47, 0.18);
    --cz-focus-ring: 0 0 0 3px rgba(12, 122, 47, 0.22);

    --cz-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --cz-font-display: 'Poppins', 'Inter', system-ui, sans-serif;

    background-color: var(--cz-bg);
    color: var(--cz-text);
    font-family: var(--cz-font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.customers #wrapper {
    background: var(--cz-bg);
}

body.customers #content {
    padding-top: 28px;
    padding-bottom: 48px;
}

/* ==========================================================================
   CABECERA HORIZONTAL SUPERIOR BLANCA (Diseñar portal de autogestión)
   ========================================================================== */

body.customers .navbar.header {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--cz-surface);
    border: 0;
    border-bottom: 1px solid var(--cz-border-soft);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    min-height: 60px;
    margin-bottom: 0;
    border-radius: 0;
}

body.customers .navbar.header .container {
    max-width: 1280px;
}

body.customers .navbar.header .navbar-brand.logo {
    font-family: var(--cz-font-display);
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: 0.02em;
    color: var(--cz-green) !important;
    padding-top: 16px;
    padding-bottom: 16px;
}

body.customers .navbar.header .navbar-brand.cz-portal-logo {
    display: flex;
    align-items: center;
    height: 60px;
    padding-top: 10px;
    padding-bottom: 10px;
}

body.customers .navbar.header .navbar-brand.cz-portal-logo img {
    display: block;
    height: 36px;
    width: auto;
}

body.customers .navbar.header .navbar-nav > li > a {
    color: var(--cz-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 18px 12px;
    border-radius: 8px;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}

body.customers .navbar.header .navbar-nav > li > a:hover,
body.customers .navbar.header .navbar-nav > li > a:focus {
    color: var(--cz-text-dark);
    background: #f9fafb;
}

body.customers .navbar.header .navbar-nav > li.active > a {
    color: var(--cz-green);
    font-weight: 600;
    background: transparent;
}

body.customers .navbar.header .navbar-nav > li.active {
    position: relative;
}

body.customers .navbar.header .navbar-nav > li.active::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 2.5px;
    background: var(--cz-green);
    border-radius: 999px;
}

body.customers .navbar.header .navbar-nav > li.open > a,
body.customers .navbar.header .navbar-nav > li.open > a:hover,
body.customers .navbar.header .navbar-nav > li.open > a:focus {
    color: var(--cz-text-dark);
    background: #f9fafb;
}

body.customers .navbar.header .navbar-nav > li.active.open > a {
    color: var(--cz-green);
}

body.customers .navbar.header .navbar-nav > li > a .caret {
    margin-left: 3px;
}

body.customers .navbar.header .navbar-nav > li.dropdown > .dropdown-menu {
    min-width: 224px;
    padding: 6px;
    border: 1px solid var(--cz-border-soft);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    z-index: 1050;
}

body.customers .navbar.header .navbar-nav > li.dropdown > .dropdown-menu > li > a {
    color: var(--cz-text);
    font-size: 0.875rem;
    padding: 8px 12px;
    border-radius: 8px;
}

body.customers .navbar.header .navbar-nav > li.dropdown > .dropdown-menu > li > a:hover,
body.customers .navbar.header .navbar-nav > li.dropdown > .dropdown-menu > li > a:focus {
    color: var(--cz-green);
    background: var(--cz-bg);
}

body.customers .navbar.header .navbar-nav > li.dropdown > .dropdown-menu > li.active > a {
    color: var(--cz-green);
    font-weight: 600;
    background: rgba(12, 122, 47, 0.1);
}

@media (min-width: 768px) {
    body.customers .navbar.header .container {
        display: flex;
        align-items: center;
    }

    body.customers .navbar.header .navbar-collapse {
        margin-left: auto;
        margin-right: auto;
    }

    body.customers .navbar.header .navbar-nav {
        display: flex;
        align-items: center;
        margin-right: 0;
    }

    body.customers .navbar.header .navbar-nav > li > a {
        display: block;
        line-height: 24px;
    }

    body.customers .navbar.header .navbar-nav > li.customers-nav-item-profile > a {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    body.customers .navbar.header .navbar-collapse:has(.customers-nav-item-login) {
        margin-right: 0;
    }

    body.customers .navbar.header .navbar-nav > li.customers-nav-item-login > a {
        display: inline-block;
        line-height: 20px;
        padding: 8px 16px;
    }
}

body.customers .navbar.header .navbar-nav > li.customers-nav-item-login::after {
    content: none;
}

@media (min-width: 768px) and (max-width: 1199px) {
    body.customers .navbar.header .navbar-nav > li > a {
        padding-left: 7px;
        padding-right: 7px;
        font-size: 0.8125rem;
    }

    body.customers .navbar.header .navbar-brand.cz-portal-logo img {
        height: 28px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    body.customers .navbar.header .container {
        width: 100%;
        max-width: 100%;
    }

    body.customers .navbar.header .navbar-collapse {
        overflow-x: auto;
        max-width: calc(100% - 110px);
    }

    body.customers .navbar.header .navbar-nav > li > a {
        padding-left: 5px;
        padding-right: 5px;
        font-size: 0.75rem;
    }
}

@media (max-width: 767px) {
    body.customers .navbar.header .navbar-brand.cz-portal-logo img {
        height: 30px;
    }

    body.customers .navbar.header .navbar-collapse {
        border-top: 1px solid #f3f4f6;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    body.customers .navbar.header .navbar-nav > li > a {
        padding: 10px 14px;
        border-radius: 12px;
        margin-bottom: 2px;
    }

    body.customers .navbar.header .navbar-nav > li.active > a {
        background: rgba(12, 122, 47, 0.1);
        color: var(--cz-green);
    }

    body.customers .navbar.header .navbar-nav > li.active::after {
        content: none;
    }
}

body.customers .navbar.header .client-profile-image-small {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(12, 122, 47, 0.25);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* —— Footer —— */
body.customers .footer {
    background: var(--cz-surface);
    border-top: 1px solid #f3f4f6;
    padding: 18px 0;
}

body.customers .footer .copyright-footer {
    color: var(--cz-text-soft);
    font-size: 0.75rem;
}

/* ==========================================================================
   MINI LOADER DE TRANSICIÓN ENTRE MÓDULOS (ModuleLoader)
   ========================================================================== */

.cz-module-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 0 24px;
    text-align: center;
}

.cz-module-loader-spinner {
    position: relative;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cz-module-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(151, 190, 61, 0.32);
    border-top-color: #0C7A2F;
    animation: czSpin 0.85s linear infinite;
}

.cz-module-loader-svg {
    width: 28px;
    height: 28px;
    color: #0C7A2F;
}

.cz-module-loader-label {
    margin: 0;
    color: #0C7A2F;
    font-family: 'Poppins', 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    max-width: 480px;
    overflow-wrap: anywhere;
}

@keyframes czSpin {
    to { transform: rotate(360deg); }
}

/* Pantalla de espera al enviar un formulario del portal (runpa-portal-espera.js).
   Por encima del mini loader y de los modales; sin temporizador de retiro. */
.cz-module-loader--envio {
    z-index: 2100;
    background: rgba(255, 255, 255, 0.88);
    cursor: wait;
}

.cz-module-loader--envio .cz-module-loader-label {
    font-size: 1rem;
}

.cz-module-loader-aviso {
    margin: 0;
    max-width: 360px;
    color: #374151;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
    .cz-module-loader--envio .cz-module-loader-ring {
        animation: none;
    }
}

/* ==========================================================================
   ENCABEZADOS Y LAYOUT DE PÁGINA
   ========================================================================== */

body.customers .container {
    max-width: 1280px;
}

body.customers .cz-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 24px;
}

body.customers .cz-page-title,
body.customers .section-client-dashboard > h3,
body.customers .tickets-summary-heading,
body.customers .section-heading-tickets,
body.customers .section-heading-open-ticket {
    font-family: var(--cz-font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--cz-text-dark);
}

body.customers .cz-page-title {
    margin: 0;
    font-size: 1.625rem;
    line-height: 1.25;
}

body.customers .cz-page-subtitle {
    margin: 6px 0 0;
    font-size: 0.875rem;
    color: var(--cz-text-muted);
}

body.customers .cz-page-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

body.customers .cz-page-head-actions form.cz-inline-form {
    display: inline;
}

body.customers .cz-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--cz-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

body.customers .cz-back-link:hover {
    color: var(--cz-green);
    text-decoration: none;
}

/* ==========================================================================
   TARJETAS Y KPIs PASTEL (Inicio, Inventario y Mis deudas)
   ========================================================================== */

body.customers .panel_s,
body.customers .cz-card {
    background: var(--cz-surface);
    border: 1px solid #f3f4f6;
    border-radius: var(--cz-radius-card);
    box-shadow: var(--cz-shadow-card);
    margin-bottom: 20px;
}

body.customers .panel_s > .panel-body,
body.customers .cz-card > .panel-body,
body.customers .cz-card-body {
    padding: 24px;
}

body.customers .cz-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-family: var(--cz-font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--cz-text-dark);
}

body.customers .cz-card-head i {
    color: var(--cz-green);
    font-size: 1.05rem;
}

body.customers .cz-card-head h2,
body.customers .cz-card-head h3,
body.customers .cz-card-head h4,
body.customers .cz-card-head h5 {
    margin: 0;
    font-family: var(--cz-font-display);
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--cz-text-dark);
}

/* —— KPIs del Inicio (fondos pastel por categoría) —— */
body.customers .cz-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

body.customers .cz-kpi {
    --cz-kpi-bg: #f0fdf4;
    --cz-kpi-border: #dcfce7;
    --cz-kpi-fg: #229039;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: var(--cz-kpi-bg);
    border: 1px solid var(--cz-kpi-border);
    border-radius: var(--cz-radius-card);
    box-shadow: var(--cz-shadow-card);
    color: var(--cz-text);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

body.customers .cz-kpi:hover,
body.customers .cz-kpi:focus-visible {
    border-color: var(--cz-kpi-fg);
    box-shadow: 0 6px 16px rgba(12, 122, 47, 0.08);
    transform: translateY(-2px);
    text-decoration: none;
    outline: none;
}

body.customers .cz-kpi--warning { --cz-kpi-bg: #fffbeb; --cz-kpi-border: #fef3c7; --cz-kpi-fg: #f59e0b; }
body.customers .cz-kpi--info    { --cz-kpi-bg: #f0f9ff; --cz-kpi-border: #e0f2fe; --cz-kpi-fg: #38bdf8; }
body.customers .cz-kpi--success { --cz-kpi-bg: #f0fdf4; --cz-kpi-border: #dcfce7; --cz-kpi-fg: #229039; }
body.customers .cz-kpi--primary { --cz-kpi-bg: #eff6ff; --cz-kpi-border: #dbeafe; --cz-kpi-fg: #3b82f6; }
body.customers .cz-kpi--default { --cz-kpi-bg: #f9fafb; --cz-kpi-border: #f3f4f6; --cz-kpi-fg: #9ca3af; }

body.customers .cz-kpi-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

body.customers .cz-kpi-icon {
    flex-shrink: 0;
    font-size: 26px;
    line-height: 1;
    color: var(--cz-kpi-fg) !important;
}

body.customers .cz-kpi-value {
    font-family: var(--cz-font-display);
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--cz-text-dark);
    font-variant-numeric: tabular-nums;
}

body.customers .cz-kpi-label {
    margin-top: 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--cz-text-muted);
}

@media (max-width: 1199px) {
    body.customers .cz-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    body.customers .cz-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    body.customers .cz-kpi {
        padding: 16px;
    }
}

/* —— Tarjetas pastel de Inventario y Mis deudas —— */
body.customers .cz-stat-card {
    border-radius: var(--cz-radius-card);
    box-shadow: var(--cz-shadow-card);
}

body.customers .cz-stat-card--warning {
    background: #fff7ed;
    border: 1px solid #ffedd5;
}

body.customers .cz-stat-card--info {
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
}

body.customers .cz-stat-card--default {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}

body.customers .cz-stat-card h2 {
    font-family: var(--cz-font-display);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--cz-text-dark);
}

body.customers .cz-stat-icon {
    font-size: 1.875rem;
    opacity: 0.9;
}

body.customers .cz-deuda-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

body.customers .cz-deuda-card {
    border-radius: var(--cz-radius-card);
    padding: 20px;
    box-shadow: var(--cz-shadow-card);
}

body.customers .cz-deuda-card--danger {
    background: #fef2f2;
    border: 1px solid #fee2e2;
}

body.customers .cz-deuda-card--warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
}

body.customers .cz-deuda-card--success {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
}

body.customers .cz-deuda-card-label {
    margin: 0 0 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cz-text-muted);
}

body.customers .cz-deuda-card-value {
    margin: 0;
    font-family: var(--cz-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
}

body.customers .cz-deuda-card--danger .cz-deuda-card-value { color: #dc2626; }
body.customers .cz-deuda-card--warning .cz-deuda-card-value { color: #d97706; }
body.customers .cz-deuda-card--success .cz-deuda-card-value { color: var(--cz-green); }

@media (max-width: 767px) {
    body.customers .cz-deuda-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

body.customers .hr-panel-heading {
    border-color: var(--cz-border);
    margin: 16px 0 20px;
}

/* ==========================================================================
   BOTONES (Paridad con runpa-acceso.css)
   ========================================================================== */

body.customers .btn {
    border-radius: var(--cz-radius-field);
    font-weight: 600;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

body.customers .btn-primary {
    background: var(--cz-green);
    border-color: var(--cz-green);
    color: #ffffff;
    box-shadow: var(--cz-shadow-btn);
}

body.customers .btn-primary:hover,
body.customers .btn-primary:focus,
body.customers .btn-primary:active,
body.customers .btn-primary:active:hover {
    background: var(--cz-green-hover);
    border-color: var(--cz-green-hover);
    color: #ffffff;
}

body.customers .btn-primary:focus-visible,
body.customers .btn-default:focus-visible,
body.customers .btn-success:focus-visible {
    outline: none;
    box-shadow: var(--cz-focus-ring);
}

body.customers .btn-default {
    background: var(--cz-surface);
    border-color: var(--cz-border);
    color: var(--cz-text);
}

body.customers .btn-default:hover,
body.customers .btn-default:focus {
    background: #f9fafb;
    border-color: rgba(12, 122, 47, 0.3);
    color: var(--cz-green);
}

body.customers .btn-success {
    background: var(--cz-green);
    border-color: var(--cz-green);
    color: #ffffff;
}

body.customers .btn-success:hover,
body.customers .btn-success:focus {
    background: var(--cz-green-hover);
    border-color: var(--cz-green-hover);
    color: #ffffff;
}

body.customers .btn-danger {
    background: var(--cz-danger);
    border-color: var(--cz-danger);
    color: #ffffff;
}

body.customers .btn-sm,
body.customers .btn-xs {
    border-radius: 9px;
}

/* ==========================================================================
   FORMULARIOS, SELECTORES UNIFICADOS Y ALINEACIÓN DE FILAS
   ========================================================================== */

body.customers .form-control,
body.customers select.form-control,
body.customers textarea.form-control {
    background: var(--cz-field-bg);
    border: 1px solid var(--cz-border);
    border-radius: var(--cz-radius-field);
    color: var(--cz-text-dark);
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

body.customers .form-control:focus,
body.customers select.form-control:focus,
body.customers textarea.form-control:focus {
    background: var(--cz-surface);
    border-color: var(--cz-green);
    box-shadow: var(--cz-focus-ring);
    outline: 0;
}

body.customers .form-control[readonly],
body.customers .form-control[disabled] {
    background-color: #f3f4f6;
    color: var(--cz-text-muted);
}

body.customers label,
body.customers .control-label {
    font-weight: 600;
    color: var(--cz-text);
    font-size: 0.875rem;
}

body.customers input[type="checkbox"],
body.customers input[type="radio"] {
    accent-color: var(--cz-green);
}

/* bootstrap-select unificado (paridad con runpa-acceso.css, sin borde interno) */
body.customers .bootstrap-select.form-control {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

body.customers .bootstrap-select > .dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    background: var(--cz-field-bg);
    border: 1px solid var(--cz-border);
    border-radius: var(--cz-radius-field);
    color: var(--cz-text-dark);
    box-shadow: none;
    font-weight: 400;
    text-align: left;
}

body.customers .bootstrap-select > .dropdown-toggle .filter-option {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
}

body.customers .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.customers .bootstrap-select > .dropdown-toggle .bs-caret {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: 6px;
}

body.customers .bootstrap-select > .dropdown-toggle .caret {
    position: static;
    margin: 0 !important;
}

body.customers .bootstrap-select.open > .dropdown-toggle,
body.customers .bootstrap-select > .dropdown-toggle:focus {
    background: var(--cz-surface);
    border-color: var(--cz-green);
    box-shadow: var(--cz-focus-ring);
    outline: 0 !important;
}

body.customers .bootstrap-select .dropdown-menu,
body.customers > .bootstrap-select.open > .dropdown-menu {
    padding: 6px;
    border: 1px solid var(--cz-border);
    border-radius: var(--cz-radius-field);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
    z-index: 1060;
}

body.customers .bootstrap-select .dropdown-menu.inner,
body.customers > .bootstrap-select.open > .dropdown-menu .dropdown-menu.inner {
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

body.customers .bootstrap-select .dropdown-menu li a,
body.customers > .bootstrap-select.open > .dropdown-menu li a {
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--cz-text-dark);
}

body.customers .bootstrap-select .dropdown-menu li a:hover,
body.customers .bootstrap-select .dropdown-menu li.active a,
body.customers > .bootstrap-select.open > .dropdown-menu li a:hover,
body.customers > .bootstrap-select.open > .dropdown-menu li.active a {
    background: var(--cz-bg);
    color: var(--cz-green);
}

body.customers .bootstrap-select .dropdown-menu li.selected a,
body.customers > .bootstrap-select.open > .dropdown-menu li.selected a {
    background: rgba(12, 122, 47, 0.1);
    color: var(--cz-green);
    font-weight: 600;
}

/* Selector compacto de paginación DataTables */
body.customers .dataTables_length .bootstrap-select {
    width: auto !important;
    min-width: 78px;
}

body.customers .dataTables_length .bootstrap-select > .dropdown-toggle {
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
}

body.customers select.form-control:not([multiple]) {
    padding-right: 32px;
}

/* Filas de formulario con columna de botón alineada al pie (ej. Declarar excedente) */
@media (min-width: 992px) {
    body.customers .row:has(> [class*="col-"].tw-items-end) {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-end;
    }

    body.customers .row:has(> [class*="col-"].tw-items-end)::before,
    body.customers .row:has(> [class*="col-"].tw-items-end)::after {
        display: none;
    }

    body.customers .row:has(> [class*="col-"].tw-items-end) > [class*="col-"] {
        float: none;
    }

    body.customers .row:has(> [class*="col-"].tw-items-end) > [class*="col-"].tw-items-end > .form-group {
        width: 100%;
    }
}

/* Solicitud de extensión de toneladas: altura uniforme en campos y botón */
body.customers .runpa-exc-form-row input.form-control,
body.customers .runpa-exc-form-row select.form-control,
body.customers .runpa-exc-form-row .bootstrap-select > .dropdown-toggle {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
}

body.customers .runpa-exc-form-row .runpa-exc-submit-btn {
    height: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    padding-left: 14px;
    padding-right: 14px;
}

/* ==========================================================================
   TABLAS LIMPIAS (Sin doble borde en DataTables)
   ========================================================================== */

body.customers .table-responsive {
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    background: var(--cz-surface);
}

body.customers .table-responsive:not(:last-child) {
    margin-bottom: 16px;
}

body.customers .btn + .table-responsive,
body.customers .btn + .dataTables_wrapper {
    margin-top: 14px;
}

body.customers .table-responsive:has(.dataTables_wrapper),
body.customers .dataTables_wrapper .table-responsive {
    border: 0;
    border-radius: 0;
    background: transparent;
}

body.customers .table-responsive > .table,
body.customers .table-responsive > .table-bordered {
    border: 0;
}

body.customers .dataTables_wrapper table.table,
body.customers table.dataTable {
    border: 1px solid #f3f4f6 !important;
    border-radius: 12px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--cz-surface);
}

body.customers .dataTables_wrapper .dataTables_length,
body.customers .dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
}

body.customers .dataTables_wrapper .dataTables_info,
body.customers .dataTables_wrapper .dataTables_paginate {
    margin-top: 12px;
}

body.customers .table {
    margin-bottom: 0;
}

body.customers .table > thead > tr > th {
    background: var(--cz-surface);
    border-top: 0;
    border-bottom: 1px solid #f3f4f6;
    color: var(--cz-text-soft);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 14px;
}

body.customers .table > tbody > tr > td {
    vertical-align: middle;
    border-color: #f9fafb;
    color: var(--cz-text);
    padding: 12px 14px;
    font-size: 0.875rem;
}

body.customers .table-striped > tbody > tr:nth-of-type(odd) {
    background: var(--cz-surface);
}

body.customers .table-striped > tbody > tr:nth-of-type(even) {
    background: #fcfdfc;
}

body.customers .table > tbody > tr:hover {
    background: var(--cz-row-hover) !important;
}

/* —— Acciones en tabla de trámites —— */
body.customers .cz-tramite-actions-th {
    min-width: 140px;
}

body.customers .cz-tramite-actions-td {
    white-space: nowrap;
    text-align: right;
    vertical-align: middle !important;
}

body.customers .cz-tramite-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    vertical-align: middle;
}

body.customers .cz-tramite-actions .cz-btn-docs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 30px;
    border-radius: 8px;
    background: var(--cz-surface);
    border: 1px solid var(--cz-border);
    color: var(--cz-text-muted);
    text-decoration: none !important;
    transition: all 0.15s ease;
}

body.customers .cz-tramite-actions .cz-btn-docs:hover {
    background: var(--cz-bg);
    border-color: rgba(12, 122, 47, 0.35);
    color: var(--cz-green);
}

body.customers .cz-tramite-actions .cz-btn-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 0.75rem;
    border-radius: 8px;
    background: var(--cz-green-light);
    border: 1px solid rgba(12, 122, 47, 0.2);
    color: var(--cz-green);
    cursor: pointer;
    transition: all 0.15s ease;
}

body.customers .cz-tramite-actions .cz-btn-view:hover {
    background: var(--cz-green);
    border-color: var(--cz-green);
    color: #ffffff;
}

body.customers .cz-tramite-actions .cz-badge-corregir {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 26px;
    border-radius: var(--cz-radius-pill);
    background: rgba(220, 38, 38, 0.12) !important;
    border: 1px solid rgba(220, 38, 38, 0.28);
    color: #b91c1c !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

body.customers .cz-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid #f3f4f6;
    border-radius: var(--cz-radius-card);
    background: var(--cz-surface);
    margin-bottom: 10px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

body.customers .cz-list-row:hover {
    background: var(--cz-row-hover);
    border-color: var(--cz-border-soft);
}

/* ==========================================================================
   BADGES / LABELS (Píldoras suaves)
   ========================================================================== */

body.customers .label {
    border-radius: var(--cz-radius-pill);
    font-weight: 600;
    font-size: 0.7rem;
    padding: 4px 11px;
}

body.customers .label-success,
body.customers .badge-success {
    background: #dcfce7 !important;
    color: #15803d !important;
}

body.customers .label-warning,
body.customers .badge-warning {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

body.customers .label-danger,
body.customers .badge-danger {
    background: #fee2e2 !important;
    color: #dc2626 !important;
}

body.customers .label-info,
body.customers .badge-info {
    background: #e0f2fe !important;
    color: #0284c7 !important;
}

body.customers .label-primary {
    background: rgba(151, 190, 61, 0.22) !important;
    color: var(--cz-green) !important;
}

body.customers .label-default {
    background: #f3f4f6 !important;
    color: var(--cz-text-muted) !important;
}

/* ==========================================================================
   ALERTAS, AVISOS, ESTADOS VACÍOS, MODALES Y PAGINACIÓN
   ========================================================================== */

body.customers .alert {
    border-radius: var(--cz-radius-field);
    border-width: 1px;
}

body.customers .alert-info {
    background: #eff6ff;
    border-color: #dbeafe;
    color: #1e40af;
}

body.customers .alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

body.customers .alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

body.customers .cz-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 14px 18px;
    margin-bottom: 20px;
    background: var(--cz-green-soft);
    border: 1px solid var(--cz-border-soft);
    border-radius: var(--cz-radius-card);
    font-size: 0.875rem;
    color: var(--cz-text);
}

body.customers .cz-notice-icon {
    color: var(--cz-green);
    margin-right: 8px;
}

body.customers .cz-notice-text {
    flex: 1;
    min-width: 0;
}

body.customers .cz-notice-text strong {
    color: var(--cz-green);
}

body.customers .cz-help-card {
    background: var(--cz-bg);
    border: 1px solid var(--cz-border-soft);
    border-radius: var(--cz-radius-card);
    padding: 18px 20px;
    font-size: 0.875rem;
    color: var(--cz-text);
}

body.customers .cz-help-card h4 {
    margin: 0 0 4px;
    font-family: var(--cz-font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--cz-green);
}

body.customers .cz-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--cz-text-muted);
}

body.customers .cz-empty-state i {
    font-size: 2.5rem;
    color: #d1d5db;
    margin-bottom: 12px;
}

body.customers .cz-empty-state p {
    margin: 0;
    font-size: 0.9rem;
}

body.customers .modal-content {
    border-radius: var(--cz-radius-card);
    border: 1px solid var(--cz-border-soft);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.14);
}

body.customers .modal-header {
    border-bottom-color: #f3f4f6;
}

body.customers .modal-header .modal-title {
    font-family: var(--cz-font-display);
    font-weight: 700;
    color: var(--cz-text-dark);
}

body.customers .modal-footer {
    border-top-color: #f3f4f6;
}

body.customers .pagination > li > a,
body.customers .pagination > li > span {
    border-radius: 8px;
    margin: 0 2px;
    border-color: var(--cz-border);
    color: var(--cz-text);
}

body.customers .pagination > li > a:hover {
    background: var(--cz-bg);
    color: var(--cz-green);
    border-color: var(--cz-border-soft);
}

body.customers .pagination > .active > a,
body.customers .pagination > .active > a:hover {
    background: var(--cz-green);
    border-color: var(--cz-green);
    color: #ffffff;
}

body.customers .cz-lote-submit {
    border-top: 1px solid #f3f4f6;
}

body.customers .runpa-recaudo-portal-item {
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

body.customers .runpa-recaudo-portal-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

body.customers .runpa-recaudo-destacado {
    background: #fffbeb !important;
    border: 1px solid #fcd34d !important;
    border-radius: var(--cz-radius-field) !important;
    padding: 16px !important;
}

body.customers .cz-planilla-frame-wrap {
    padding: 0 !important;
    overflow: hidden;
    border-radius: 0 0 var(--cz-radius-card) var(--cz-radius-card);
}

body.customers .cz-planilla-frame {
    width: 100%;
    min-height: 80vh;
    border: 0;
    display: block;
}

body.customers .cz-line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.customers .cz-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   NOTIFICACIONES (Campana y página listado)
   ========================================================================== */

body.customers .runpa-notif-bell-toggle {
    position: relative;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
}

body.customers .runpa-notif-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1.125rem;
    color: var(--cz-text-muted);
}

body.customers .runpa-notif-bell-toggle:hover .runpa-notif-icon-wrap {
    color: var(--cz-green);
}

body.customers .runpa-notif-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: var(--cz-green);
    border: 2px solid var(--cz-surface);
    border-radius: var(--cz-radius-pill);
}

body.customers .runpa-notif-dropdown {
    min-width: 380px;
    max-width: 440px;
    width: calc(100vw - 32px);
    padding: 0 !important;
    border: 1px solid var(--cz-border-soft);
    border-radius: var(--cz-radius-card);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

body.customers .runpa-notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 10px;
    background: var(--cz-surface);
}

body.customers .runpa-notif-dropdown-header strong {
    font-family: var(--cz-font-display);
    font-size: 0.875rem;
    color: var(--cz-text-dark);
}

body.customers .runpa-notif-dropdown-count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--cz-green);
    background: var(--cz-green-light);
    padding: 2px 8px;
    border-radius: var(--cz-radius-pill);
}

body.customers .runpa-notif-dropdown .divider {
    margin: 0;
    background: #f3f4f6;
}

body.customers .runpa-notif-dropdown-scrollable {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0;
    margin: 0;
}

body.customers .runpa-notif-dropdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.customers .runpa-notif-item-link {
    display: block;
    padding: 12px 16px !important;
    white-space: normal !important;
    text-decoration: none !important;
    color: inherit !important;
    border-left: 3px solid transparent;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

body.customers .runpa-notif-item-unread .runpa-notif-item-link {
    background: var(--cz-green-light);
    border-left-color: var(--cz-green);
}

body.customers .runpa-notif-item-link:hover {
    background: var(--cz-row-hover) !important;
}

body.customers .runpa-notif-item-title {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--cz-text-dark);
    margin-bottom: 4px;
    line-height: 1.35;
}

body.customers .runpa-notif-item-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    margin-left: 6px;
    padding: 1px 7px;
    vertical-align: middle;
    background: rgba(12, 122, 47, 0.12) !important;
    color: var(--cz-green) !important;
    border-radius: var(--cz-radius-pill);
}

body.customers .runpa-notif-item-msg {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--cz-text-muted);
    margin-bottom: 6px;
    white-space: pre-line;
    word-break: break-word;
}

body.customers .runpa-notif-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
}

body.customers .runpa-notif-item-date {
    display: block;
    font-size: 0.6875rem;
    color: var(--cz-text-soft);
}

body.customers .runpa-notif-item-cta {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--cz-green);
    white-space: nowrap;
}

body.customers .runpa-notif-item-cta i {
    margin-right: 4px;
}

body.customers .runpa-notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--cz-text-muted);
    font-size: 0.875rem;
}

body.customers .runpa-notif-dropdown-footer {
    padding: 10px 16px 14px;
    text-align: center;
    background: var(--cz-bg);
}

body.customers .runpa-notif-dropdown-footer .btn {
    width: 100%;
}

/* —— Notificaciones: página listado —— */
body.customers .cz-notif-card {
    background: var(--cz-surface);
    border: 1px solid #f3f4f6;
    border-radius: var(--cz-radius-card);
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: var(--cz-shadow-card);
}

body.customers .cz-notif-card-unread {
    border-left: 4px solid var(--cz-green);
    background: linear-gradient(90deg, var(--cz-green-light) 0%, var(--cz-surface) 12%);
}

body.customers .cz-notif-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

body.customers .cz-notif-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cz-green-light);
    color: var(--cz-green);
    border-radius: 12px;
    font-size: 1rem;
}

body.customers .cz-notif-card-body {
    flex: 1;
    min-width: 0;
}

body.customers .cz-notif-card-title {
    font-family: var(--cz-font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--cz-text-dark);
    margin: 0 0 4px;
}

body.customers .cz-notif-card-msg {
    font-size: 0.875rem;
    color: var(--cz-text-muted);
    margin: 0 0 8px;
    line-height: 1.55;
    white-space: pre-line;
    word-break: break-word;
}

body.customers .cz-notif-recaudos-list {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 0.8125rem;
    color: var(--cz-text);
}

body.customers .cz-notif-recaudos-list li {
    margin-bottom: 4px;
}

body.customers .cz-notif-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

body.customers .cz-notif-card-date {
    font-size: 0.75rem;
    color: var(--cz-text-soft);
}

/* —— Soporte técnico (tarjetas de resumen de tickets) —— */
body.customers .cz-ticket-stat-card {
    display: block;
    background: var(--cz-surface);
    border: 1px solid #f3f4f6;
    border-radius: var(--cz-radius-card);
    padding: 16px 18px;
    box-shadow: var(--cz-shadow-card);
    text-decoration: none !important;
    transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

body.customers .cz-ticket-stat-card:hover {
    background: var(--cz-row-hover);
    border-color: var(--cz-border-soft);
    transform: translateY(-2px);
}

body.customers .cz-ticket-stat-card.is-active {
    border-color: rgba(12, 122, 47, 0.35);
    background: var(--cz-surface);
}

/* —— Responsive —— */
@media (max-width: 767px) {
    body.customers .cz-page-title {
        font-size: 1.375rem;
    }

    body.customers .panel_s > .panel-body,
    body.customers .cz-card > .panel-body,
    body.customers .cz-card-body {
        padding: 18px 16px;
    }

    body.customers .runpa-notif-dropdown {
        min-width: 0;
        max-width: none;
        left: auto !important;
        right: 8px !important;
    }

    body.customers .cz-notice {
        flex-direction: column;
        align-items: flex-start;
    }

    body.customers .cz-tramite-actions-td {
        white-space: normal;
    }

    body.customers .cz-tramite-actions {
        justify-content: flex-start;
    }
}

/* —— Galería 5 fotos acopio (Cartel de patio) —— */
body.customers .runpa-fotos-acopio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

body.customers .runpa-fotos-acopio-slot {
    position: relative;
    aspect-ratio: 1;
    border: 1px dashed var(--cz-border);
    border-radius: var(--cz-radius-field);
    background: var(--cz-field-bg);
    overflow: hidden;
}

body.customers .runpa-fotos-acopio-add-one {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--cz-green);
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

body.customers .runpa-fotos-acopio-add-one:hover {
    background: var(--cz-green-light);
    color: var(--cz-green-dark);
}

body.customers .runpa-fotos-acopio-filled {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

body.customers .runpa-fotos-acopio-thumb {
    width: 100%;
    height: calc(100% - 28px);
    object-fit: cover;
    display: block;
}

body.customers .runpa-fotos-acopio-name {
    display: block;
    font-size: 0.7rem;
    color: var(--cz-text-muted);
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.customers .runpa-fotos-acopio-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

body.customers .runpa-fotos-acopio-remove:hover {
    background: rgba(220, 38, 38, 0.9);
}

body.customers .runpa-fotos-acopio-counter {
    font-weight: 600;
    font-size: 0.875rem;
}

body.customers .runpa-field-error {
    min-height: 0;
    margin-top: 4px;
    font-size: 12px;
    color: var(--cz-danger);
}

body.customers .runpa-field-error-visible {
    min-height: 1em;
}

body.customers .runpa-input-error,
body.customers .runpa-has-error .form-control {
    border-color: var(--cz-danger);
    background-color: #fef2f2;
    box-shadow: none;
}

body.customers .runpa-recaudo-field.runpa-has-error .runpa-fotos-acopio-grid {
    outline: 1px solid var(--cz-danger);
    border-radius: var(--cz-radius-field);
}

/* —— Modal inventario (campos activos vs inhabilitados) —— */
body.customers #modal-inv-form .form-control,
body.customers #modal-inv-form .bootstrap-select > .dropdown-toggle {
    background-color: var(--cz-field-bg);
}

body.customers #modal-inv-form .form-control[disabled],
body.customers #modal-inv-form select.form-control[disabled],
body.customers .bootstrap-select.disabled > .dropdown-toggle,
body.customers .bootstrap-select > .dropdown-toggle.disabled {
    background-color: #f3f4f6 !important;
    color: var(--cz-text-muted) !important;
    cursor: not-allowed;
    opacity: 0.75;
}
