/* =========================================================
   XPERTECH - MODULO CAJA
   ========================================================= */

:root {
    --x-caja-bg: #0f172a;
    --x-caja-panel: #111827;
    --x-caja-panel-2: #0b1220;
    --x-caja-border: rgba(148, 163, 184, .12);
    --x-caja-text: #e5e7eb;
    --x-caja-muted: #94a3b8;
    --x-caja-soft: #cbd5e1;

    --x-blue: #3b82f6;
    --x-blue-soft: rgba(59, 130, 246, .14);

    --x-green: #22c55e;
    --x-green-soft: rgba(34, 197, 94, .14);

    --x-red: #ef4444;
    --x-red-soft: rgba(239, 68, 68, .14);

    --x-orange: #f59e0b;
    --x-orange-soft: rgba(245, 158, 11, .14);

    --x-indigo: #6366f1;
    --x-indigo-soft: rgba(99, 102, 241, .14);

    --x-purple: #a855f7;
    --x-purple-soft: rgba(168, 85, 247, .14);

    --x-cyan: #06b6d4;
    --x-cyan-soft: rgba(6, 182, 212, .14);

    --x-shadow-lg: 0 20px 50px rgba(2, 6, 23, .28);
    --x-shadow-md: 0 12px 30px rgba(2, 6, 23, .18);
    --x-radius-xl: 24px;
    --x-radius-lg: 18px;
    --x-radius-md: 14px;
    --x-radius-sm: 12px;
}

/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

.x-caja-page {
    padding: 18px;
    color: var(--x-caja-text);
}

.x-caja-page .row {
    margin-left: -10px;
    margin-right: -10px;
}

.x-caja-page .row>[class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

/* =========================================================
   HEADER
   ========================================================= */

.x-caja-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px 24px;
    border: 1px solid var(--x-caja-border);
    border-radius: var(--x-radius-xl);
    background:
        radial-gradient(1200px 500px at 20% 0%, rgba(47, 111, 237, .25), transparent 55%),
        radial-gradient(900px 450px at 90% 10%, rgba(110, 162, 255, .18), transparent 55%),
        linear-gradient(180deg, #0b1220 0%, #0a1020 100%);
    box-shadow: var(--x-shadow-md);
}

.x-page-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -.03em;
    color: #fff;
}

.x-page-subtitle {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--x-caja-muted);
    max-width: 720px;
}

.x-caja-head__status {
    min-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.x-caja-head__meta {
    display: grid;
    gap: 7px;
    font-size: 13px;
    color: var(--x-caja-soft);
    text-align: right;
}

.x-caja-head__meta i {
    width: 18px;
    text-align: center;
    margin-right: 6px;
    color: var(--x-caja-muted);
}

.x-caja-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.x-caja-badge i {
    font-size: 12px;
}

.x-caja-badge--open {
    color: #d1fae5;
    background: rgba(16, 185, 129, .16);
    border-color: rgba(16, 185, 129, .24);
    box-shadow: 0 10px 25px rgba(16, 185, 129, .12);
}

.x-caja-badge--closed {
    color: #e5e7eb;
    background: rgba(148, 163, 184, .14);
    border-color: rgba(148, 163, 184, .20);
}

/* =========================================================
   TOOLBAR DE ACCIONES
   ========================================================= */

.x-caja-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    flex-direction: row-reverse;
}

.x-action-mini {
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: .22s ease;
    box-shadow: 0 8px 20px rgba(2, 6, 23, .12);
}

.x-action-mini i {
    font-size: 13px;
}

.x-action-mini:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(2, 6, 23, .16);
}

.x-action-mini--primary {
    background: var(--x-blue-soft);
    color: #dbeafe;
    border-color: rgba(59, 130, 246, .22);
}

.x-action-mini--success {
    background: var(--x-green-soft);
    color: #dcfce7;
    border-color: rgba(34, 197, 94, .22);
}

.x-action-mini--danger {
    background: var(--x-red-soft);
    color: #fee2e2;
    border-color: rgba(239, 68, 68, .22);
}

.x-action-mini--warning {
    background: var(--x-orange-soft);
    color: #fef3c7;
    border-color: rgba(245, 158, 11, .24);
}

.x-action-mini--info {
    background: var(--x-cyan-soft);
    color: #cffafe;
    border-color: rgba(6, 182, 212, .22);
}

.x-action-mini--dark {
    background: rgba(255, 255, 255, .06);
    color: #f3f4f6;
    border-color: rgba(255, 255, 255, .08);
}

/* =========================================================
   CARDS KPI
   ========================================================= */

.x-stat-card {
    position: relative;
    overflow: hidden;
    min-height: 138px;
    border-radius: 22px;
    padding: 18px 18px 16px;
    border: 1px solid var(--x-caja-border);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .015)),
        #0f172a;
    box-shadow: var(--x-shadow-md);
    transition: .25s ease;
}

.x-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--x-shadow-lg);
}

.x-stat-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 18px;
}

.x-stat-card__label {
    font-size: 13px;
    color: var(--x-caja-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.x-stat-card__value {
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.03em;
    color: #fff;
}

.x-stat-card--blue .x-stat-card__icon {
    background: var(--x-blue-soft);
    color: var(--x-blue);
}

.x-stat-card--green .x-stat-card__icon {
    background: var(--x-green-soft);
    color: var(--x-green);
}

.x-stat-card--red .x-stat-card__icon {
    background: var(--x-red-soft);
    color: var(--x-red);
}

.x-stat-card--indigo .x-stat-card__icon {
    background: var(--x-indigo-soft);
    color: var(--x-indigo);
}

.x-stat-card--purple .x-stat-card__icon {
    background: var(--x-purple-soft);
    color: var(--x-purple);
}

/* =========================================================
   CARD BASE
   ========================================================= */

.x-card {
    border: 1px solid var(--x-caja-border);
    border-radius: var(--x-radius-xl);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, .01)),
        var(--x-caja-panel);
    box-shadow: var(--x-shadow-md);
    overflow: hidden;
}

.x-card__head {
    padding: 18px 20px 0;
}

.x-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -.02em;
}

.x-card__subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--x-caja-muted);
}

.x-card__body {
    padding: 18px 20px 20px;
}

/* =========================================================
   RESUMEN DE SESION
   ========================================================= */

.x-info-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid rgba(255, 255, 255, .05);
    min-height: 52px;
}

.x-info-line--block {
    align-items: flex-start;
    flex-direction: column;
}

.x-info-line__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--x-caja-muted);
}

.x-info-line__value {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    text-align: right;
}

.x-info-line--block .x-info-line__value {
    text-align: left;
    width: 100%;
}

/* =========================================================
   PILLS / BADGES
   ========================================================= */

.x-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .06em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.x-pill--blue {
    color: #dbeafe;
    background: rgba(59, 130, 246, .15);
    border-color: rgba(59, 130, 246, .24);
}

.x-pill--success {
    color: #dcfce7;
    background: rgba(34, 197, 94, .15);
    border-color: rgba(34, 197, 94, .24);
}

.x-pill--danger {
    color: #fee2e2;
    background: rgba(239, 68, 68, .15);
    border-color: rgba(239, 68, 68, .24);
}

.x-pill--muted {
    color: #e5e7eb;
    background: rgba(148, 163, 184, .16);
    border-color: rgba(148, 163, 184, .20);
}

/* =========================================================
   RESUMEN POR METODO
   ========================================================= */

.x-method-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, .08);
    font-size: 14px;
}

.x-method-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.x-method-item span {
    color: var(--x-caja-soft);
    font-weight: 600;
}

.x-method-item strong {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

/* =========================================================
   TABS
   ========================================================= */

.x-tabs {
    padding: 12px 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    background: rgba(255, 255, 255, .015);
}

.x-tabs .nav-item {
    margin-right: 8px;
}

.x-tabs .nav-link {
    border: 0 !important;
    border-radius: 14px 14px 0 0;
    padding: 12px 14px;
    color: var(--x-caja-muted);
    font-size: 13px;
    font-weight: 700;
    background: transparent;
    transition: .2s ease;
}

.x-tabs .nav-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, .04);
}

.x-tabs .nav-link.active {
    color: #fff;
    background: rgba(99, 102, 241, .16);
}


/* =========================================================
   FILTROS / TOOLBAR TABLA
   ========================================================= */

.x-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.x-toolbar__left,
.x-toolbar__right {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.x-toolbar__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.x-toolbar__group label {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--x-caja-muted);
}

.x-toolbar__input,
.x-toolbar__select {
    min-width: 145px;
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(2, 6, 23, .45);
    color: #e5e7eb;
    outline: none;
    box-shadow: none;
}

.x-toolbar__input:focus,
.x-toolbar__select:focus {
    border-color: rgba(99, 102, 241, .45);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .10);
}

.x-search-box {
    position: relative;
    min-width: 250px;
}

.x-search-box i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--x-caja-muted);
    font-size: 13px;
}

.x-search-box input {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(2, 6, 23, .45);
    color: #e5e7eb;
    outline: none;
}

.x-search-box input:focus {
    border-color: rgba(59, 130, 246, .42);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .10);
}

/* =========================================================
   TABLAS
   ========================================================= */

.x-table {
    margin: 0;
    color: #e5e7eb;
    background: transparent;
}

.x-table thead th {
    border-top: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
    color: var(--x-caja-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 14px 14px;
    background: rgba(255, 255, 255, .02);
    white-space: nowrap;
}

.x-table tbody td {
    border-top: 1px solid rgba(255, 255, 255, .05) !important;
    padding: 14px 14px;
    vertical-align: middle;
    font-size: 14px;
    color: #e5e7eb;
}

.x-table tbody tr {
    transition: background .18s ease, transform .18s ease;
}

.x-table tbody tr:hover {
    background: rgba(255, 255, 255, .025);
}

.x-table .text-success {
    color: #4ade80 !important;
}

.x-table .text-danger {
    color: #f87171 !important;
}

.x-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.x-action-btn {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .2s ease;
    cursor: pointer;
}

.x-action-btn--soft {
    background: rgba(255, 255, 255, .06);
    color: #e2e8f0;
}

.x-action-btn--soft:hover {
    background: rgba(59, 130, 246, .16);
    color: #dbeafe;
    transform: translateY(-1px);
}

/* =========================================================
   MODALES
   ========================================================= */

.x-modal {
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 22px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, .01)),
        #0f172a;
    color: #e5e7eb;
    box-shadow: 0 30px 80px rgba(2, 6, 23, .38);
}

.x-modal .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    padding: 18px 20px;
    background: rgba(255, 255, 255, .02);
}

.x-modal .modal-title {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.x-modal .close {
    color: #cbd5e1;
    opacity: 1;
    text-shadow: none;
}

.x-modal .modal-body {
    padding: 20px;
}

.x-modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding: 16px 20px;
    background: rgba(255, 255, 255, .015);
}

.x-modal label {
    color: var(--x-caja-soft);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.x-modal .form-control,
.x-modal select,
.x-modal textarea {
    height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(2, 6, 23, .45);
    color: #e5e7eb;
    box-shadow: none;
}

.x-modal textarea.form-control {
    min-height: 110px;
    height: auto;
    resize: vertical;
    padding-top: 12px;
}

.x-modal .form-control:focus,
.x-modal select:focus,
.x-modal textarea:focus {
    border-color: rgba(99, 102, 241, .45);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .10);
    background: rgba(2, 6, 23, .58);
    color: #fff;
}

.x-modal .btn {
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 700;
    box-shadow: none;
}

.x-modal .btn-light {
    background: rgba(255, 255, 255, .08);
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, .08);
}

.x-modal .btn-light:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.x-modal .btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}

.x-modal .btn-success {
    background: #16a34a;
    border-color: #16a34a;
}

.x-modal .btn-danger {
    background: #dc2626;
    border-color: #dc2626;
}

.x-modal .btn-warning {
    background: #d97706;
    border-color: #d97706;
    color: #fff;
}

.x-modal .btn-info {
    background: #0891b2;
    border-color: #0891b2;
    color: #fff;
}

.x-modal .btn-dark {
    background: #111827;
    border-color: #111827;
}

/* =========================================================
   DATATABLES SI LO USAS DESPUES
   ========================================================= */

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--x-caja-muted) !important;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    background: rgba(2, 6, 23, .45) !important;
    color: #e5e7eb !important;
    min-height: 38px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    color: #cbd5e1 !important;
    border: 1px solid transparent !important;
    background: transparent !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: rgba(99, 102, 241, .16) !important;
    color: #fff !important;
    border-color: rgba(99, 102, 241, .22) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(255, 255, 255, .06) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, .08) !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1199px) {
    .x-caja-head {
        flex-direction: column;
        align-items: stretch;
    }

    .x-caja-head__status {
        align-items: flex-start;
        min-width: 100%;
    }

    .x-caja-head__meta {
        text-align: left;
    }
}

@media (max-width: 991px) {
    .x-stat-card__value {
        font-size: 26px;
    }

    .x-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .x-toolbar__left,
    .x-toolbar__right {
        width: 100%;
    }

    .x-search-box {
        min-width: 100%;
    }
}

@media (max-width: 767px) {
    .x-caja-page {
        padding: 12px;
    }

    .x-caja-head {
        padding: 18px;
        border-radius: 20px;
    }

    .x-page-title {
        font-size: 26px;
    }

    .x-card__body,
    .x-modal .modal-body,
    .x-tab-section {
        padding: 16px;
    }

    .x-caja-toolbar {
        gap: 8px;
    }

    .x-action-mini {
        width: 100%;
        justify-content: center;
    }

    .x-toolbar__input,
    .x-toolbar__select {
        min-width: 100%;
    }

    .x-table thead th,
    .x-table tbody td {
        padding: 12px 10px;
    }
}


.x-caja-saldo {
    background: linear-gradient(135deg, #0f172a, #020617);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 15px;
}

.x-caja-saldo__label {
    font-size: 13px;
    opacity: .6;
}

.x-caja-saldo__value {
    font-size: 32px;
    font-weight: 700;
}

.x-caja-kpis {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.x-kpi {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 12px;
}

.x-kpi span {
    font-size: 12px;
    opacity: .6;
}

.x-kpi strong {
    display: block;
    font-size: 16px;
}

.x-caja-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}


.x-metodo-bar {
    height: 6px;
    background: rgba(255, 255, 255, .05);
    border-radius: 10px;
    overflow: hidden;
}

.x-metodo-bar div {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
}

.x-help-btn {
    position: relative;
}

.x-help-btn::after {
    content: "Ver guía";
    position: absolute;
    bottom: -28px;
    right: 0;

    background: rgba(15, 18, 30, 0.95);
    color: #cbd7f0;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;

    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: all .2s ease;
    white-space: nowrap;
}

.x-help-btn:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.x-caja-head__status {
    position: relative;
    gap: 10px;
}

.x-help-btn {
    margin-top: 2px;
}

.x-caja-readonly-notice {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;

    display: flex;
    align-items: center;
    gap: 12px;

    background:
        radial-gradient(circle at top left, rgba(0, 183, 255, .12), transparent 36%),
        rgba(15, 23, 42, .72);

    border: 1px solid rgba(148, 163, 184, .18);
    color: #dbeafe;
}

.x-caja-readonly-notice i {
    width: 38px;
    height: 38px;
    border-radius: 14px;

    display: grid;
    place-items: center;

    background: rgba(0, 183, 255, .12);
    border: 1px solid rgba(0, 183, 255, .22);
    color: #7dd3fc;
}

.x-caja-readonly-notice strong {
    display: block;
    color: #ffffff;
    font-size: 13px;
    font-weight: 900;
}

.x-caja-readonly-notice span {
    display: block;
    margin-top: 2px;
    color: rgba(226, 242, 255, .72);
    font-size: 12.5px;
    line-height: 1.4;
}