/* Global UX layer */
:root {
    --gio-bg: #f3f6fb;
    --gio-surface: #ffffff;
    --gio-soft: #eef2f7;
    --gio-border: #dce4ef;
    --gio-text: #172033;
    --gio-muted: #667085;
    --gio-primary: #176b87;
    --gio-primary-dark: #0f5267;
    --gio-accent: #cad85d;
    --gio-danger: #c2414b;
    --gio-success: #247a55;
    --gio-warning: #b7791f;
    --gio-shadow: 0 14px 34px rgba(23, 32, 51, .08);
}

body {
    background: var(--gio-bg);
    color: var(--gio-text);
}

/* Bootstrap 5 compatibility layer over the local SB Admin/Bootstrap bundle */
.row.g-0 { margin-left: 0; margin-right: 0; }
.row.g-0 > * { padding-left: 0; padding-right: 0; }
.row.g-1 { margin-left: -.125rem; margin-right: -.125rem; }
.row.g-1 > * { padding-left: .125rem; padding-right: .125rem; margin-bottom: .25rem; }
.row.g-2 { margin-left: -.25rem; margin-right: -.25rem; }
.row.g-2 > * { padding-left: .25rem; padding-right: .25rem; margin-bottom: .5rem; }
.row.g-3 { margin-left: -.5rem; margin-right: -.5rem; }
.row.g-3 > * { padding-left: .5rem; padding-right: .5rem; margin-bottom: 1rem; }
.row.g-4 { margin-left: -.75rem; margin-right: -.75rem; }
.row.g-4 > * { padding-left: .75rem; padding-right: .75rem; margin-bottom: 1.5rem; }

.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.d-grid { display: grid !important; }
.text-end { text-align: right !important; }
.text-start { text-align: left !important; }
.fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.fs-4 { font-size: 1.5rem !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }
.rounded-3 { border-radius: 10px !important; }
.rounded-4 { border-radius: 14px !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: 1rem !important; }
.font-monospace { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important; }

.form-select {
    appearance: none;
    background-color: #fff;
    background-image: linear-gradient(45deg, transparent 50%, var(--gio-muted) 50%), linear-gradient(135deg, var(--gio-muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 13px) calc(50% - 3px);
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    border: 1px solid var(--gio-border);
    border-radius: 8px;
    color: var(--gio-text);
    display: block;
    min-height: 38px;
    padding: .375rem 2.25rem .375rem .75rem;
    width: 100%;
}

.form-select-sm {
    min-height: 31px;
    padding-bottom: .25rem;
    padding-top: .25rem;
}

.btn-close {
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    opacity: .65;
}
.btn-close:before { content: "×"; }
.btn-close:hover { opacity: 1; }

.bg-primary,
.badge.bg-primary { background-color: var(--gio-primary) !important; color: #fff !important; }
.bg-dark,
.badge.bg-dark { background-color: var(--gio-primary) !important; color: #fff !important; }
.bg-info,
.badge.bg-info { background-color: color-mix(in srgb, var(--gio-menu-icon) 18%, #ffffff) !important; color: var(--gio-primary) !important; }
.bg-warning,
.badge.bg-warning { background-color: var(--gio-accent) !important; color: var(--gio-primary) !important; }
.bg-success,
.badge.bg-success { background-color: var(--gio-success) !important; color: #fff !important; }
.bg-danger,
.badge.bg-danger { background-color: var(--gio-danger) !important; color: #fff !important; }
.bg-secondary,
.badge.bg-secondary { background-color: #667085 !important; color: #fff !important; }
.bg-light,
.badge.bg-light { background-color: color-mix(in srgb, var(--gio-bg) 72%, #ffffff) !important; color: var(--gio-primary) !important; }

.text-bg-primary { background: var(--gio-primary) !important; color: #fff !important; }
.text-bg-dark { background: var(--gio-primary) !important; color: #fff !important; }
.text-bg-warning { background: var(--gio-accent) !important; color: var(--gio-primary) !important; }
.text-bg-info { background: color-mix(in srgb, var(--gio-menu-icon) 18%, #ffffff) !important; color: var(--gio-primary) !important; }
.border-start { border-left: 4px solid var(--gio-border) !important; }
.border-primary { border-color: var(--gio-primary) !important; }
.border-success { border-color: var(--gio-success) !important; }

#content-wrapper,
#content {
    background: var(--gio-bg);
}

.container,
.container-fluid {
    max-width: 1440px;
}

.container.mt-4,
.container.mt-5,
.container-fluid.mt-4,
.container-fluid.mt-5 {
    margin-top: 1.25rem !important;
}

.card {
    border: 1px solid var(--gio-border);
    border-radius: 10px;
    box-shadow: var(--gio-shadow);
}

.card.shadow-sm,
.card.shadow-lg {
    box-shadow: var(--gio-shadow) !important;
}

.card-header {
    border-bottom: 1px solid var(--gio-border);
    padding: 1rem 1.15rem;
}

.card-header.bg-dark,
.bg-gradient-dark {
    background: #172033 !important;
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    font-weight: 800;
    letter-spacing: 0;
}

.gio-page-kicker {
    color: rgba(255, 255, 255, .72);
    display: block;
    font-size: .78rem;
    font-weight: 600;
    margin-top: .2rem;
}

.sidebar {
    box-shadow: 10px 0 28px rgba(23, 32, 51, .12);
    overflow-x: hidden;
}

.sidebar .sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar .nav-item .nav-link {
    border-radius: 8px;
    margin: 2px 10px;
    padding: .75rem .9rem;
    max-width: calc(100% - 20px);
    width: calc(100% - 20px);
}

.sidebar .nav-item .nav-link:hover,
.sidebar .nav-item.active .nav-link {
    background: rgba(202, 216, 93, .16);
}

.sidebar .sidebar-heading {
    color: rgba(255, 255, 255, .5);
    letter-spacing: .08em;
}

.sticky-footer {
    border-top: 1px solid var(--gio-border);
}

.form-control,
.form-select,
.custom-select {
    border: 1px solid var(--gio-border);
    border-radius: 8px;
    color: var(--gio-text);
    min-height: 38px;
}

.form-control:focus,
.form-select:focus,
.custom-select:focus {
    border-color: var(--gio-primary);
    box-shadow: 0 0 0 .18rem rgba(23, 107, 135, .14);
}

.form-label,
label {
    color: var(--gio-text);
    font-size: .84rem;
    font-weight: 700;
}

.input-group-text {
    border-color: var(--gio-border);
    font-weight: 700;
}

.btn {
    border-radius: 8px;
    font-weight: 700;
    letter-spacing: 0;
}

.btn-green,
.btn-primary {
    background: var(--gio-primary) !important;
    border-color: var(--gio-primary) !important;
    color: #fff !important;
}

.btn-green:hover,
.btn-primary:hover {
    background: var(--gio-primary-dark) !important;
    border-color: var(--gio-primary-dark) !important;
}

.btn-outline-dark {
    border-color: #172033;
    color: #172033;
}

.btn-outline-dark:hover {
    background: #172033;
    color: #fff;
}

/* Botón secundario institucional: toma el color principal del comercio */
.btn.btn-outline-light.btn-sm {
    background: color-mix(in srgb, var(--gio-primary) 12%, #ffffff) !important;
    border-color: var(--gio-primary) !important;
    color: var(--gio-primary-dark) !important;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--gio-primary) 12%, transparent);
}

.btn.btn-outline-light.btn-sm:hover,
.btn.btn-outline-light.btn-sm:focus,
.btn.btn-outline-light.btn-sm:active {
    background: var(--gio-primary) !important;
    border-color: var(--gio-primary) !important;
    color: var(--gio-on-primary, #ffffff) !important;
}

.btn.btn-outline-light.btn-sm:disabled,
.btn.btn-outline-light.btn-sm.disabled {
    background: color-mix(in srgb, var(--gio-primary) 7%, #ffffff) !important;
    border-color: color-mix(in srgb, var(--gio-primary) 40%, #ffffff) !important;
    color: color-mix(in srgb, var(--gio-primary) 55%, #ffffff) !important;
    opacity: .72;
}

/* Estados visibles y consistentes para todos los botones outline usados */
.btn-outline-primary { --gio-outline-color: var(--gio-primary); --gio-outline-on: var(--gio-on-primary, #fff); }
.btn-outline-success { --gio-outline-color: var(--gio-success, #198754); --gio-outline-on: #fff; }
.btn-outline-danger { --gio-outline-color: var(--gio-danger, #dc3545); --gio-outline-on: #fff; }
.btn-outline-warning { --gio-outline-color: var(--gio-accent, #ffc107); --gio-outline-on: var(--gio-on-accent, #111827); }
.btn-outline-info { --gio-outline-color: var(--gio-menu-icon, #0dcaf0); --gio-outline-on: #fff; }
.btn-outline-secondary { --gio-outline-color: #667085; --gio-outline-on: #fff; }
.btn-outline-dark { --gio-outline-color: var(--gio-primary-dark, #172033); --gio-outline-on: #fff; }

.btn.btn-outline-primary,
.btn.btn-outline-success,
.btn.btn-outline-danger,
.btn.btn-outline-warning,
.btn.btn-outline-info,
.btn.btn-outline-secondary,
.btn.btn-outline-dark {
    background: transparent !important;
    border-color: var(--gio-outline-color) !important;
    color: var(--gio-outline-color) !important;
}

.btn.btn-outline-primary:hover,
.btn.btn-outline-primary:focus,
.btn.btn-outline-primary:active,
.btn.btn-outline-success:hover,
.btn.btn-outline-success:focus,
.btn.btn-outline-success:active,
.btn.btn-outline-danger:hover,
.btn.btn-outline-danger:focus,
.btn.btn-outline-danger:active,
.btn.btn-outline-warning:hover,
.btn.btn-outline-warning:focus,
.btn.btn-outline-warning:active,
.btn.btn-outline-info:hover,
.btn.btn-outline-info:focus,
.btn.btn-outline-info:active,
.btn.btn-outline-secondary:hover,
.btn.btn-outline-secondary:focus,
.btn.btn-outline-secondary:active,
.btn.btn-outline-dark:hover,
.btn.btn-outline-dark:focus,
.btn.btn-outline-dark:active {
    background: var(--gio-outline-color) !important;
    border-color: var(--gio-outline-color) !important;
    color: var(--gio-outline-on) !important;
}

.btn.btn-outline-primary:disabled,
.btn.btn-outline-primary.disabled,
.btn.btn-outline-success:disabled,
.btn.btn-outline-success.disabled,
.btn.btn-outline-danger:disabled,
.btn.btn-outline-danger.disabled,
.btn.btn-outline-warning:disabled,
.btn.btn-outline-warning.disabled,
.btn.btn-outline-info:disabled,
.btn.btn-outline-info.disabled,
.btn.btn-outline-secondary:disabled,
.btn.btn-outline-secondary.disabled,
.btn.btn-outline-dark:disabled,
.btn.btn-outline-dark.disabled {
    background: transparent !important;
    border-color: var(--gio-outline-color) !important;
    color: var(--gio-outline-color) !important;
    opacity: .5;
}

.badge,
.badge.bg-dark {
    border-radius: 999px;
    font-weight: 800;
}

.gio-filter-panel {
    background: #f8fafc;
    border: 1px solid var(--gio-border);
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .85rem;
}

.gio-filter-panel .gio-filter-search {
    flex: 1 1 260px;
}

.gio-filter-panel .gio-filter-select {
    flex: 0 1 220px;
}

.gio-filter-panel .gio-page-size {
    flex: 0 0 150px;
}

.gio-table-summary {
    align-items: center;
    color: var(--gio-muted);
    display: flex;
    font-size: .82rem;
    font-weight: 700;
    gap: .45rem;
    min-height: 38px;
    white-space: nowrap;
}

.gio-table-summary .badge {
    background: var(--gio-primary);
}

.gio-client-pagination .page-link {
    border-color: var(--gio-border);
    color: var(--gio-primary);
    font-weight: 700;
}

.gio-client-pagination .page-item.disabled .page-link {
    color: var(--gio-muted);
}

.gio-view-header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.gio-view-title {
    margin: 0;
}

.gio-view-subtitle {
    color: var(--gio-muted);
    display: block;
    font-size: .86rem;
    font-weight: 600;
    margin-top: .15rem;
}

.gio-stat-card {
    background: #f8fafc;
    border: 1px solid var(--gio-border) !important;
    box-shadow: none !important;
}

.gio-detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.gio-detail-item {
    background: #f8fafc;
    border: 1px solid var(--gio-border);
    border-radius: 8px;
    padding: .9rem;
}

.gio-detail-label {
    color: var(--gio-muted);
    display: block;
    font-size: .72rem;
    font-weight: 800;
    margin-bottom: .25rem;
    text-transform: uppercase;
}

.gio-detail-value {
    color: var(--gio-text);
    font-weight: 800;
}

.gio-empty-row td {
    color: var(--gio-muted) !important;
    font-weight: 700;
    padding: 1.4rem !important;
    text-align: center;
}

.table-responsive {
    border-radius: 10px;
}

.table {
    background: #fff;
    border-color: var(--gio-border);
    color: var(--gio-text);
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--gio-border);
    vertical-align: middle;
}

.table thead th,
.table .table-light th {
    background: #f8fafc !important;
    color: #344054;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.table-hover tbody tr:hover > * {
    background: #eef8fb;
}

th.gio-sortable {
    cursor: pointer;
    padding-right: 1.8rem !important;
    position: relative;
}

th.gio-sortable:after {
    color: #98a2b3;
    content: "\f0dc";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: .65rem;
}

th.gio-sort-asc:after {
    content: "\f0de";
}

th.gio-sort-desc:after {
    content: "\f0dd";
}

.gio-actions,
td:last-child {
    white-space: nowrap;
}

.gio-actions .btn,
td:last-child .btn {
    margin-bottom: .2rem;
}

.gio-compact-actions .btn {
    align-items: center;
    display: inline-flex;
    gap: .3rem;
    justify-content: center;
}

.gio-dashboard-card {
    min-height: 100%;
}

.gio-dashboard-card .card-title {
    font-weight: 800;
}

@media (max-width: 767.98px) {
    .container,
    .container-fluid {
        padding-left: .85rem;
        padding-right: .85rem;
    }

    .card-header {
        align-items: stretch !important;
        flex-direction: column;
        gap: .75rem;
    }

    .card-header .btn,
    .card-header a.btn {
        width: 100%;
    }

    .gio-filter-panel {
        display: block;
    }

    .gio-filter-panel .gio-filter-search,
    .gio-filter-panel .gio-filter-select,
    .gio-filter-panel .gio-page-size,
    .gio-filter-panel .btn {
        margin-bottom: .65rem;
        width: 100%;
    }

    .gio-card-table table,
    .gio-card-table thead,
    .gio-card-table tbody,
    .gio-card-table th,
    .gio-card-table td,
    .gio-card-table tr {
        display: block;
    }

    .gio-card-table thead {
        display: none;
    }

    .gio-card-table table {
        background: transparent;
        border: 0;
    }

    .gio-card-table tbody tr {
        background: #fff;
        border: 1px solid var(--gio-border);
        border-radius: 10px;
        box-shadow: 0 8px 22px rgba(23, 32, 51, .07);
        margin-bottom: .85rem;
        overflow: hidden;
    }

    .gio-card-table tbody td,
    .gio-card-table tbody th {
        border: 0;
        border-bottom: 1px solid var(--gio-soft);
        min-height: 42px;
        padding-left: 45% !important;
        position: relative;
        white-space: normal;
    }

    .gio-card-table tbody td:before,
    .gio-card-table tbody th:before {
        color: var(--gio-muted);
        content: attr(data-label);
        font-size: .68rem;
        font-weight: 800;
        left: .85rem;
        position: absolute;
        text-transform: uppercase;
        top: .85rem;
        width: 36%;
    }

    .gio-actions,
    td:last-child {
        white-space: normal;
    }
}



/* ── ENCABEZADO ── */
.prest-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: var(--radius);
    padding: 22px 28px;
    color: #fff;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(37,99,235,.25);
}
.prest-header .prest-numero {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}
.prest-header .prest-sub {
    font-size: .82rem;
    color: rgba(255,255,255,.65);
    margin-top: 2px;
}
.btn-volver {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff !important;
    border-radius: 8px;
    font-size: .82rem;
    padding: 6px 14px;
    transition: background .2s;
}
.btn-volver:hover { background: rgba(255,255,255,.28); }

/* ── BADGE ESTADO PRINCIPAL ── */
.badge-estado {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .82rem;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 30px;
    letter-spacing: .3px;
}
.badge-estado.prestado   { background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.4); color: #fff; }
.badge-estado.devuelto   { background: #d1fae5; color: #065f46; border: 1.5px solid #6ee7b7; }
.badge-estado.comprado   { background: #f3f4f6; color: #111827; border: 1.5px solid #d1d5db; }
.badge-estado.cancelado  { background: #fee2e2; color: #991b1b; border: 1.5px solid #fca5a5; }
.badge-estado.vencido    { background: #fef3c7; color: #92400e; border: 1.5px solid #fcd34d; animation: pulse-warn 2s infinite; }

@keyframes pulse-warn {
    0%,100% { box-shadow: 0 0 0 0 rgba(217,119,6,.3); }
    50%      { box-shadow: 0 0 0 6px rgba(217,119,6,0); }
}

/* ── TARJETAS INFO ── */
.info-card {
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
}
.info-card:hover { transform: translateY(-3px); box-shadow: 0 10px 36px rgba(0,0,0,.13); }
.info-card .card-body { padding: 20px 22px; }
.info-card-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.info-card-icon.azul    { background: #dbeafe; color: var(--clr-azul); }
.info-card-icon.verde   { background: #d1fae5; color: var(--clr-verde); }
.info-card-icon.naranja { background: #fef3c7; color: var(--clr-naranja); }
.info-card-icon.rojo    { background: #fee2e2; color: var(--clr-rojo); }
.info-card .label { font-size: .75rem; color: var(--clr-gris); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.info-card .valor { font-size: 1.05rem; font-weight: 700; color: var(--clr-oscuro); line-height: 1.2; }
.info-card .sub   { font-size: .78rem; color: var(--clr-gris); margin-top: 2px; }
.info-card .sub.rojo { color: var(--clr-rojo); font-weight: 600; }

/* ── OBSERVACIONES ── */
.obs-box {
    background: linear-gradient(90deg, #eff6ff, #fff);
    border-left: 4px solid var(--clr-azul);
    border-radius: 0 10px 10px 0;
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: .88rem;
    color: #1e40af;
}

/* ── CARD SECCIÓN ── */
.seccion-card {
    border-radius: var(--radius);
    border: none;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}
.seccion-header {
    background: #fff;
    border-bottom: 2px solid #f1f5f9;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.seccion-header h5 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--clr-oscuro);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.seccion-header h5 .icono-titulo {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
}
.icono-titulo.azul  { background: #dbeafe; color: var(--clr-azul); }
.icono-titulo.ambar { background: #fef3c7; color: var(--clr-naranja); }

.badge-pill-custom {
    font-size: .72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}
.badge-pill-custom.azul  { background: #dbeafe; color: var(--clr-azul); }
.badge-pill-custom.ambar { background: #fef3c7; color: #92400e; }

/* ── TABLA ── */
.tabla-equipos thead th {
    background: #f8fafc;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--clr-gris);
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 14px;
}
.tabla-equipos tbody td { padding: 14px 14px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.tabla-equipos tbody tr:last-child td { border-bottom: none; }
.tabla-equipos tbody tr:hover { background: #f8fafc; }

.imei-chip {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    font-weight: 700;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: .5px;
}
.imei-chip.cambio { background: #fefce8; border-color: #fde047; color: #713f12; }
.imei-flecha { color: #94a3b8; font-size: .7rem; margin: 3px 0; display: block; }

.producto-nombre { font-weight: 700; font-size: .88rem; color: var(--clr-oscuro); }
.producto-sub    { font-size: .75rem; color: var(--clr-gris); margin-top: 1px; }
.badge-cambio-prod {
    font-size: .7rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde047;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

/* ── BADGES ESTADO TABLA ── */
.badge-tbl {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .72rem; font-weight: 700;
    padding: 4px 10px; border-radius: 20px;
}
.badge-tbl.prestado   { background: #dbeafe; color: #1d4ed8; }
.badge-tbl.devuelto   { background: #d1fae5; color: #065f46; }
.badge-tbl.comprado   { background: #f3f4f6; color: #111827; border: 1px solid #d1d5db; }
.badge-tbl.cambiado   { background: #fef3c7; color: #92400e; }
.badge-tbl.secondary  { background: #f3f4f6; color: #6b7280; }

/* ── BOTONES ACCIÓN ── */
.btn-accion {
    font-size: .72rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 7px;
    border: none;
    display: inline-flex; align-items: center; gap: 4px;
    transition: all .18s;
    cursor: pointer;
}
.btn-accion.devolver { background: #d1fae5; color: #065f46; }
.btn-accion.devolver:hover { background: #059669; color: #fff; }
.btn-accion.comprar  { background: #f3f4f6; color: #111827; border: 1px solid #d1d5db; }
.btn-accion.comprar:hover  { background: #111827; color: #fff; }
.btn-accion.cambiar  { background: #fef3c7; color: #92400e; }
.btn-accion.cambiar:hover  { background: #d97706; color: #fff; }

.procesado-tag {
    font-size: .75rem;
    color: #94a3b8;
    font-style: italic;
    display: flex; align-items: center; gap: 5px;
}

/* ── TIMELINE ── */
.timeline-wrap { padding: 8px 0; }
.tl-item {
    display: flex;
    gap: 18px;
    padding-bottom: 28px;
    position: relative;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 19px; top: 40px;
    width: 2px;
    bottom: 0;
    background: linear-gradient(to bottom, #e2e8f0, transparent);
}
.tl-dot {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .9rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(217,119,6,.3);
    position: relative;
    z-index: 1;
}
.tl-body {
    background: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 14px 18px;
    flex: 1;
}
.tl-body:hover { border-color: #fde047; background: #fffbeb; }
.tl-productos {
    display: flex; align-items: center; gap: 8px;
    font-size: .88rem; font-weight: 700;
    color: var(--clr-oscuro); flex-wrap: wrap;
    margin-bottom: 6px;
}
.tl-productos .flecha { color: #d97706; font-size: .9rem; }
.tl-productos .nuevo  { color: var(--clr-azul); }
.tl-imeis {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 6px; flex-wrap: wrap;
}
.tl-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 8px; flex-wrap: wrap; gap: 6px;
}
.tl-motivo {
    font-size: .78rem; color: #64748b;
    background: #f1f5f9; border-radius: 6px;
    padding: 3px 10px; display: inline-flex; align-items: center; gap: 5px;
}
.tl-fecha { font-size: .75rem; color: #94a3b8; }
.tl-user  { font-size: .75rem; color: #94a3b8; }

/* ── AUTOCOMPLETE ── */
.autocomplete-wrap { position: relative; }
#listaProductos {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 9999;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    list-style: none; margin: 4px 0 0; padding: 4px 0;
    max-height: 240px; overflow-y: auto; display: none;
}
.producto-item { padding: 10px 14px; cursor: pointer; transition: background .15s; }
.producto-item:hover { background: #f0f9ff; }
.p-nombre { font-size: .85rem; font-weight: 700; color: #1e293b; }
.p-info   { font-size: .75rem; color: #94a3b8; margin-top: 2px; }

/* ── VACÍO ── */
.empty-state { padding: 48px 20px; text-align: center; color: #94a3b8; }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: 10px; }
    
        :root {
            --lime: #cad85b;
            --lime-dark: #afc04a;
            --dark: #0e0f0c;
            --dark2: #161712;
            --dark3: #1e2018;
            --card: #1a1c15;
            --border: rgba(202,216,91,0.15);
            --text-muted: #6b7060;
            --text-light: #c8ccb8;
        }

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

        body.login {
            font-family: 'DM Sans', sans-serif;
           
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            
            position: relative;
        }

        /* ── Fondo animado ── */
        body.login::before {
            content: '';
            position: fixed;
            inset: 0;
            background:
                radial-gradient(ellipse 60% 50% at 20% 80%, rgba(202,216,91,0.07) 0%, transparent 60%),
                radial-gradient(ellipse 40% 40% at 80% 20%, rgba(202,216,91,0.05) 0%, transparent 60%);
            pointer-events: none;
        }

        /* Grid decorativo */
        body.login::after {
            content: '';
            position: fixed;
            inset: 0;
            background-image:
                linear-gradient(rgba(202,216,91,0.04) 1px, transparent 1px),
                linear-gradient(90deg, rgba(202,216,91,0.04) 1px, transparent 1px);
            background-size: 60px 60px;
            pointer-events: none;
        }

        /* ── Flash error ── */
        .flash-error {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 999;
            background: #2a1515;
            border: 1px solid #ff4444;
            color: #ff8080;
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 10px;
            animation: slideDown .3s ease;
        }
        .flash-error .close-btn {
            background: none;
            border: none;
            color: #ff8080;
            cursor: pointer;
            font-size: 18px;
            line-height: 1;
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
            to   { opacity: 1; transform: translateX(-50%) translateY(0); }
        }

        /* ── Wrapper ── */
        .login-wrapper {
            display: flex;
            width: 900px;
            max-width: 95vw;
            min-height: 540px;
            border-radius: 20px;
            overflow: hidden;
            border: 1px solid var(--border);
            box-shadow: 0 40px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
            animation: fadeUp .6s ease both;
            position: relative;
            z-index: 1;
        }

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

        /* ── Panel izquierdo ── */
        .panel-left {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 40px;
            position: relative;
            border-right: 1px solid var(--border);
        }

        .panel-left::before {
            content: '';
            position: absolute;
            inset: 0;
            background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(202,216,91,0.08) 0%, transparent 70%);
        }

        .logo-wrap {
            position: relative;
            z-index: 1;
            text-align: center;
        }

        .logo-wrap img {
            max-width: 180px;
            max-height: 180px;
            object-fit: contain;
            border-radius: 16px;
            filter: drop-shadow(0 8px 24px rgba(202,216,91,0.2));
            animation: float 4s ease-in-out infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50%       { transform: translateY(-8px); }
        }

        .logo-placeholder {
            width: 120px;
            height: 120px;
            border-radius: 24px;
            background: linear-gradient(135deg, var(--dark2), var(--dark3));
            border: 2px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 24px;
        }

        .logo-placeholder svg {
            width: 48px;
            height: 48px;
            color: var(--lime);
        }

        .business-name {
            font-family: 'Syne', sans-serif;
            font-size: 22px;
            font-weight: 700;
            color: #fff;
            margin-top: 24px;
            text-align: center;
            letter-spacing: -0.3px;
        }

        .business-tagline {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 8px;
            text-align: center;
            letter-spacing: 0.5px;
        }

        /* Decoración esquinas */
        .corner {
            position: absolute;
            width: 40px;
            height: 40px;
            opacity: 0.3;
        }
        .corner-tl { top: 20px; left: 20px; border-top: 2px solid var(--lime); border-left: 2px solid var(--lime); border-radius: 4px 0 0 0; }
        .corner-br { bottom: 20px; right: 20px; border-bottom: 2px solid var(--lime); border-right: 2px solid var(--lime); border-radius: 0 0 4px 0; }

        /* ── Panel derecho ── */
        .panel-right {
            width: 400px;
            background: var(--card);
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 52px 44px;
        }

        .login-header {
            margin-bottom: 36px;
        }

        .login-header .eyebrow {
            font-size: 11px;
            font-weight: 500;
            letter-spacing: 2px;
            text-transform: uppercase;
            color: var(--lime);
            margin-bottom: 10px;
        }

        .login-header h1 {
            font-family: 'Syne', sans-serif;
            font-size: 28px;
            font-weight: 800;
            color: #fff;
            line-height: 1.1;
        }

        .login-header p {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 8px;
        }

        /* ── Formulario ── */
        .form-group {
            margin-bottom: 18px;
        }

        .form-group label {
            display: block;
            font-size: 12px;
            font-weight: 500;
            color: var(--text-light);
            margin-bottom: 8px;
            letter-spacing: 0.3px;
        }

        .input-wrap {
            position: relative;
        }

        .input-wrap svg {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            width: 16px;
            height: 16px;
            color: var(--text-muted);
            transition: color .2s;
            pointer-events: none;
        }

        .input-wrap input {
            width: 100%;
            padding: 12px 14px 12px 42px;
            background: var(--dark3);
            border: 1px solid rgba(255,255,255,0.07);
            border-radius: 10px;
            color: #fff;
            font-size: 14px;
            font-family: 'DM Sans', sans-serif;
            transition: border-color .2s, box-shadow .2s;
            outline: none;
        }

        .input-wrap input::placeholder {
            color: var(--text-muted);
        }

        .input-wrap input:focus {
            border-color: var(--lime);
            box-shadow: 0 0 0 3px rgba(202,216,91,0.1);
        }

        .input-wrap input:focus + svg,
        .input-wrap:focus-within svg {
            color: var(--lime);
        }

        /* Toggle password */
        .toggle-pass {
            position: absolute;
            right: 14px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-muted);
            padding: 0;
            display: flex;
            align-items: center;
            transition: color .2s;
        }
        .toggle-pass:hover { color: var(--lime); }
        .toggle-pass svg { width: 16px; height: 16px; }

        /* ── Botón submit ── */
        .btn-login {
            width: 100%;
            padding: 13px;
            background: var(--lime);
            border: none;
            border-radius: 10px;
            color: #0e0f0c;
            font-family: 'Syne', sans-serif;
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            margin-top: 8px;
            transition: background .2s, transform .15s, box-shadow .2s;
            letter-spacing: 0.3px;
            position: relative;
            overflow: hidden;
        }

        .btn-login::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
        }

        .btn-login:hover {
            background: var(--lime-dark);
            transform: translateY(-1px);
            box-shadow: 0 8px 24px rgba(202,216,91,0.3);
        }

        .btn-login:active {
            transform: translateY(0);
        }

        /* ── Forgot password ── */
        .forgot-link {
            display: block;
            text-align: center;
            margin-top: 20px;
            font-size: 13px;
            color: var(--text-muted);
            text-decoration: none;
            transition: color .2s;
        }

        .forgot-link:hover {
            color: var(--lime);
            text-decoration: none;
        }

        /* ── Responsive ── */
        @media (max-width: 720px) {
            .panel-left { display: none; }
            .panel-right { width: 100%; padding: 40px 28px; }
            .login-wrapper { width: 100%; border-radius: 16px; }
        }

/* Final UX overrides for operational views */
#wrapper #content-wrapper,
#wrapper #content {
    background: var(--gio-bg) !important;
}

#wrapper .card:not(.info-card):not(.seccion-card),
#wrapper .gio-decorated-card {
    border: 1px solid var(--gio-border) !important;
    border-radius: 10px !important;
    box-shadow: var(--gio-shadow) !important;
}

#wrapper .card-header.bg-dark,
#wrapper .card-header.bg-secondary {
    background: #172033 !important;
}

#wrapper .table-responsive {
    background: #fff;
    border: 1px solid var(--gio-border);
    box-shadow: 0 8px 24px rgba(23, 32, 51, .05);
}

#wrapper .table {
    margin-bottom: 0;
}

#wrapper .table thead th {
    background: #f8fafc !important;
    color: #344054 !important;
}

#wrapper .gio-filter-panel {
    box-shadow: 0 8px 24px rgba(23, 32, 51, .05);
}

/* Bootstrap 5.3.8 + business-aware professional design system */
html { scroll-behavior: smooth; }

body {
    font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .925rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

#content { min-width: 0; }
#content > .container,
#content > .container-fluid { padding: 1.5rem clamp(1rem, 2vw, 2rem); }

.sidebar .sidebar-brand {
    height: 112px !important;
    padding: 1rem !important;
}

.gio-sidebar-logo {
    display: block;
    max-height: 78px;
    max-width: 88%;
    object-fit: contain;
    width: auto;
}

.sidebar .nav-item .nav-link {
    align-items: center;
    display: flex;
    gap: .65rem;
    min-height: 44px;
}

.sidebar .nav-item .nav-link i { width: 1.25rem; }

.card {
    --bs-card-border-color: var(--gio-border);
    --bs-card-border-radius: .875rem;
    overflow: hidden;
}

.card-header {
    background: color-mix(in srgb, var(--gio-secondary, var(--gio-bg)) 28%, #fff);
    min-height: 56px;
}

.btn {
    --bs-btn-border-radius: .625rem;
    align-items: center;
    display: inline-flex;
    gap: .4rem;
    justify-content: center;
    min-height: 38px;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.custom-select:focus-visible,
a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--gio-accent) 55%, transparent);
    outline-offset: 2px;
}

.form-control,
.form-select,
.custom-select,
.input-group-text { min-height: 42px; }

.table-responsive {
    border-radius: .75rem;
    overflow-x: auto;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--gio-border);
    padding: .8rem .9rem;
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * {
    background: color-mix(in srgb, var(--gio-primary) 5%, #fff);
}

.modal-content { border: 0; border-radius: 1rem !important; }
.modal-header,
.modal-footer { border-color: var(--gio-border); padding: 1rem 1.25rem; }
.modal-body { padding: 1.25rem; }

.dropdown-menu {
    --bs-dropdown-border-color: var(--gio-border);
    --bs-dropdown-border-radius: .75rem;
    padding: .5rem;
}

.dropdown-item { border-radius: .5rem; padding: .55rem .75rem; }
.dropdown-item:hover,
.dropdown-item:focus {
    background: color-mix(in srgb, var(--gio-primary) 8%, #fff);
    color: var(--gio-primary);
}

.pagination { --bs-pagination-active-bg: var(--gio-primary); --bs-pagination-active-border-color: var(--gio-primary); }

@media (max-width: 768px) {
    #content > .container,
    #content > .container-fluid { padding: 1rem; }
    .gio-view-header { align-items: stretch; flex-direction: column; }
    .gio-view-header .btn { width: 100%; }
    .card-header { padding: .85rem 1rem; }
    .table > :not(caption) > * > * { padding: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
