:root {
    --idee-primary: #32b5f4;
    --idee-primary-dark: #1689c3;
    --idee-primary-soft: #e4f6ff;
    --idee-page: #eaf6fc;
    --idee-page-alt: #f4f8fc;
    --idee-surface: #ffffff;
    --idee-surface-soft: #f8fcff;
    --idee-border: #b8c7d9;
    --idee-border-soft: #dce7f1;
    --idee-text: #16263d;
    --idee-muted: #52657a;
    --idee-success: #23865b;
    --idee-danger: #b4475a;
    --idee-warning: #b87516;
    --idee-shadow: 0 14px 34px rgba(41, 78, 110, .09);
    --idee-shadow-soft: 0 7px 20px rgba(41, 78, 110, .07);
}

* {
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(circle at 8% 6%, rgba(50, 181, 244, .13), transparent 29rem),
        linear-gradient(135deg, var(--idee-page) 0%, var(--idee-page-alt) 58%, #edf4fa 100%);
    color: var(--idee-muted);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    min-height: 100vh;
}

.app-header {
    background: transparent;
    padding: 28px 24px 0;
}

.app-header .container-fluid {
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(248, 252, 255, .96));
    border: 1px solid rgba(184, 199, 217, .76);
    border-radius: 18px;
    box-shadow: var(--idee-shadow);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1440px;
    padding: 25px 28px !important;
    position: relative;
}

.app-header .container-fluid::before {
    background: linear-gradient(180deg, var(--idee-primary), #83d7fc);
    border-radius: 18px 0 0 18px;
    bottom: 0;
    content: "";
    left: 0;
    position: absolute;
    top: 0;
    width: 5px;
}

.app-header h1 {
    align-items: center;
    color: var(--idee-text);
    display: flex;
    font-size: clamp(1.5rem, 2.7vw, 2rem);
    font-weight: 650;
    letter-spacing: -.025em;
    line-height: 1.2;
    margin: 5px 0 6px;
}

.app-header h1::before {
    align-items: center;
    background: var(--idee-primary-soft);
    border: 1px solid rgba(50, 181, 244, .22);
    border-radius: 12px;
    color: var(--idee-primary-dark);
    content: "\F4D2";
    display: inline-flex;
    flex: 0 0 45px;
    font-family: bootstrap-icons;
    font-size: 1.25rem;
    height: 45px;
    justify-content: center;
    margin-right: 13px;
    width: 45px;
}

.app-header p {
    color: var(--idee-muted);
    line-height: 1.55;
    margin: 0 0 0 58px;
}

.eyebrow {
    color: var(--idee-primary-dark);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .13em;
    margin-left: 58px;
    text-transform: uppercase;
}

.app-header .btn-light {
    background: #fff;
    border: 1px solid var(--idee-border);
    color: var(--idee-text);
}

main.container-fluid {
    margin: 0 auto;
    max-width: 1440px;
    padding: 24px !important;
}

.panel {
    background: linear-gradient(145deg, var(--idee-surface), var(--idee-surface-soft));
    border: 1px solid rgba(184, 199, 217, .7);
    border-radius: 16px;
    box-shadow: var(--idee-shadow-soft);
}

.filter-panel {
    overflow: visible;
    padding: 23px;
    position: relative;
    z-index: 5;
}

.form-label {
    color: var(--idee-text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    margin-bottom: 7px;
}

.form-control,
.form-select {
    background-color: #fbfdff;
    border: 1px solid var(--idee-border);
    border-radius: 10px;
    color: var(--idee-text);
    font: inherit;
    min-height: 43px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.form-control::placeholder {
    color: #8797a9;
}

.form-control:hover,
.form-select:hover {
    border-color: #91abc2;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    border-color: var(--idee-primary);
    box-shadow: 0 0 0 3px rgba(50, 181, 244, .16);
    color: var(--idee-text);
}

.search-wrap {
    position: relative;
}

.search-wrap > .bi-search {
    color: #7890a7;
    left: 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.search-wrap .form-control {
    padding-left: 40px;
}

.search-results {
    background: #fff;
    border: 1px solid var(--idee-border);
    border-radius: 11px;
    box-shadow: 0 16px 32px rgba(22, 38, 61, .14);
    left: 0;
    max-height: 310px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    z-index: 30;
}

.search-result {
    background: #fff;
    border: 0;
    border-bottom: 1px solid #e6edf4;
    color: var(--idee-text);
    display: block;
    padding: 12px 14px;
    text-align: left;
    transition: background-color .18s ease;
    width: 100%;
}

.search-result:first-child {
    border-radius: 10px 10px 0 0;
}

.search-result:last-child {
    border-bottom: 0;
    border-radius: 0 0 10px 10px;
}

.search-result:hover,
.search-result:focus {
    background: #edf8fd;
    outline: none;
}

.search-result strong {
    display: block;
    font-weight: 600;
}

.search-result small {
    color: var(--idee-muted);
}

.preset-row {
    align-items: center;
    border-top: 1px solid var(--idee-border-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding-top: 15px;
}

.preset-row > span {
    color: var(--idee-muted);
    font-size: .8rem;
    font-weight: 600;
    margin-right: 2px;
}

.selected-user {
    background: #eef9fe;
    border: 1px solid #c7e9f8;
    border-left: 4px solid var(--idee-primary);
    border-radius: 10px;
    color: var(--idee-text);
    margin-top: 15px;
    padding: 11px 14px;
}

.selected-user strong {
    font-weight: 600;
}

.selected-user span {
    color: var(--idee-muted);
    margin-left: 10px;
}

.page-message {
    border: 1px solid transparent;
    border-radius: 10px;
    margin-top: 13px;
    padding: 11px 14px;
}

.page-message.error {
    background: #fff3f5;
    border-color: #f2c9d1;
    color: #9d384b;
}

.page-message.success {
    background: #ebf8f2;
    border-color: #c7ead9;
    color: #23724f;
}

.action-bar {
    align-items: center;
    background: linear-gradient(145deg, var(--idee-surface), var(--idee-surface-soft));
    border: 1px solid rgba(184, 199, 217, .7);
    border-radius: 14px;
    box-shadow: var(--idee-shadow-soft);
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 19px 0 15px;
    padding: 15px 18px;
}

.action-bar strong {
    color: var(--idee-text);
    display: block;
    font-size: .98rem;
    font-weight: 650;
}

.action-bar #totalResultados {
    display: block;
    font-size: .8rem;
    margin-top: 2px;
}

.summary-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    margin-bottom: 17px;
}

.summary-card {
    background: linear-gradient(145deg, #fff, #f7fbfe);
    border: 1px solid rgba(184, 199, 217, .72);
    border-radius: 14px;
    box-shadow: 0 6px 17px rgba(41, 78, 110, .055);
    min-height: 104px;
    overflow: hidden;
    padding: 19px 18px 16px;
    position: relative;
}

.summary-card::before {
    background: linear-gradient(90deg, var(--idee-primary), #9bddfb);
    content: "";
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.summary-card span {
    color: var(--idee-muted);
    display: block;
    font-size: .73rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.summary-card strong {
    color: var(--idee-text);
    display: block;
    font-size: 1.42rem;
    font-weight: 650;
    letter-spacing: -.025em;
    margin-top: 9px;
}

#seccionTabla {
    overflow: hidden;
    position: relative;
}

.history-table-wrap {
    max-height: 68vh;
    scrollbar-color: #b8cad9 #edf4f9;
    scrollbar-width: thin;
}

.history-table {
    color: var(--idee-muted);
    font-size: .81rem;
    white-space: nowrap;
}

.history-table thead th {
    background: #294b66;
    border-color: rgba(255, 255, 255, .09);
    color: #f7fbff;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .03em;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 2;
}

.history-table td,
.history-table th {
    padding: 12px 11px;
    vertical-align: middle;
}

.history-table td {
    border-color: #e5edf4;
}

.history-table tbody tr:nth-child(even) td {
    background: #f8fbfe;
}

.history-table tbody tr:hover td {
    background: #eaf7fd;
}

.history-table .money {
    color: var(--idee-text);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.history-table small {
    color: #74879a !important;
    margin-top: 2px;
}

.history-table .badge {
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .69rem;
    font-weight: 600;
    letter-spacing: .015em;
    padding: 6px 10px;
}

.history-table .text-bg-success {
    background: #e6f7ef !important;
    border-color: #c8ebda;
    color: #24714f !important;
}

.history-table .text-bg-warning {
    background: #fff6df !important;
    border-color: #f1dfae;
    color: #966314 !important;
}

.history-table .text-bg-secondary {
    background: #edf2f6 !important;
    border-color: #d7e1e9;
    color: #52657a !important;
}

.history-table .text-bg-danger {
    background: #fff0f2 !important;
    border-color: #efcbd2;
    color: #a54053 !important;
}

.actions-column {
    min-width: 210px;
    right: 0;
}

.history-table td:last-child {
    background: #fff;
    border-left: 1px solid #dce7f1;
    position: sticky;
    right: 0;
}

.history-table tbody tr:nth-child(even) td:last-child {
    background: #f8fbfe;
}

.history-table tbody tr:hover td:last-child {
    background: #eaf7fd;
}

.action-buttons {
    display: flex;
    gap: 6px;
}

.loading-state {
    align-items: center;
    backdrop-filter: blur(2px);
    background: rgba(248, 252, 255, .9);
    color: var(--idee-primary-dark);
    gap: 12px;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 4;
}

.empty-state {
    color: var(--idee-muted);
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    align-items: center;
    background: var(--idee-primary-soft);
    border-radius: 16px;
    color: var(--idee-primary-dark);
    display: inline-flex;
    font-size: 2rem;
    height: 62px;
    justify-content: center;
    width: 62px;
}

.empty-state h2 {
    color: var(--idee-text);
    font-size: 1.12rem;
    font-weight: 650;
    margin: 14px 0 5px;
}

.pagination-wrap {
    align-items: center;
    border-top: 1px solid var(--idee-border-soft);
    display: flex;
    gap: 7px;
    justify-content: center;
    padding: 16px;
}

.btn {
    border-radius: 10px;
    font-size: .87rem;
    font-weight: 600;
    min-height: 41px;
    padding: .55rem 1rem;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(50, 181, 244, .2);
}

.btn-sm {
    border-radius: 8px;
    font-size: .78rem;
    min-height: 34px;
    padding: .38rem .67rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--idee-primary), #209ed9);
    border-color: var(--idee-primary);
    box-shadow: 0 5px 13px rgba(50, 181, 244, .2);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #20a9e9, var(--idee-primary-dark));
    border-color: var(--idee-primary-dark);
}

.btn-outline-primary {
    border-color: #8dcbe8;
    color: #2086b7;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--idee-primary-soft);
    border-color: var(--idee-primary);
    color: var(--idee-primary-dark);
}

.btn-outline-secondary {
    border-color: #b9c8d6;
    color: #52657a;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: #e9f0f5;
    border-color: #9fb2c2;
    color: var(--idee-text);
}

.btn-outline-danger {
    border-color: #deaab4;
    color: #aa4256;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: #fff0f2;
    border-color: #c66a7c;
    color: #96384a;
}

.btn-outline-success {
    border-color: #9bcdb6;
    color: #277653;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background: #eaf7f1;
    border-color: #62aa88;
    color: #206246;
}

.modal-content {
    background: var(--idee-surface);
    border: 1px solid rgba(184, 199, 217, .7);
    border-radius: 17px;
    box-shadow: 0 22px 55px rgba(22, 38, 61, .2);
    color: var(--idee-muted);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(145deg, #fff, var(--idee-surface-soft));
    border-bottom: 1px solid var(--idee-border-soft);
    padding: 18px 21px;
}

.modal-header .eyebrow {
    margin-left: 0;
}

.modal-title {
    color: var(--idee-text);
    font-weight: 650;
    margin-top: 3px;
}

.modal-body {
    padding: 21px;
}

.modal-footer {
    background: #fbfdff;
    border-top: 1px solid var(--idee-border-soft);
    gap: 7px;
    padding: 15px 21px;
}

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

.detail-item {
    background: var(--idee-surface-soft);
    border: 1px solid var(--idee-border-soft);
    border-radius: 10px;
    padding: 12px;
}

.detail-item span {
    color: var(--idee-muted);
    display: block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.detail-item strong {
    color: var(--idee-text);
    display: block;
    font-weight: 600;
    margin-top: 5px;
}

.detail-section {
    border-bottom: 1px solid #a8d9ef;
    color: var(--idee-primary-dark);
    font-size: .82rem;
    font-weight: 650;
    letter-spacing: .045em;
    margin: 21px 0 11px;
    padding-bottom: 7px;
}

@media (max-width: 991px) {
    .app-header {
        padding: 20px 16px 0;
    }

    main.container-fluid {
        padding: 20px 16px !important;
    }
}

@media (max-width: 767px) {
    .app-header .container-fluid,
    .action-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-header .container-fluid {
        padding: 21px !important;
    }

    .app-header .container-fluid::before {
        border-radius: 18px 18px 0 0;
        bottom: auto;
        height: 4px;
        right: 0;
        width: auto;
    }

    .app-header h1 {
        align-items: flex-start;
    }

    .app-header p,
    .eyebrow {
        margin-left: 0;
    }

    .app-header p {
        font-size: .9rem;
    }

    .app-header .btn-light {
        width: 100%;
    }

    .filter-panel {
        padding: 18px;
    }

    .selected-user span {
        display: block;
        margin: 4px 0 0;
    }

    .action-bar > div:last-child,
    .action-bar .btn {
        width: 100%;
    }

    .history-table-wrap {
        max-height: 62vh;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
    }
}

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