:root {
    --idee-primary: #32b5f4;
    --idee-primary-dark: #168fce;
    --idee-bg: #eaf6fc;
    --idee-bg-soft: #f4f8fc;
    --idee-card: #ffffff;
    --idee-card-soft: #f8fcff;
    --idee-border: #b8c7d9;
    --idee-text: #16263d;
    --idee-muted: #52657a;
    --idee-success: #258c69;
    --idee-danger: #cf4656;
    --idee-shadow: 0 14px 36px rgba(30, 73, 108, .11);
}

* { box-sizing: border-box; }

body {
    min-height: 100vh;
    margin: 0;
    padding: 28px 20px 48px;
    color: var(--idee-muted);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    background:
        radial-gradient(circle at 8% 5%, rgba(50, 181, 244, .15), transparent 28rem),
        linear-gradient(135deg, var(--idee-bg) 0%, var(--idee-bg-soft) 56%, #edf5fb 100%);
}

body > .container {
    width: min(1420px, 100%);
    max-width: 1420px;
    margin: 0 auto !important;
    padding: 0;
}

.module-header {
    display: flex;
    min-height: 142px;
    align-items: center;
    gap: 22px;
    margin-bottom: 24px;
    padding: 28px 34px;
    background: linear-gradient(145deg, var(--idee-card), var(--idee-card-soft));
    border: 1px solid rgba(184, 199, 217, .72);
    border-radius: 22px;
    box-shadow: var(--idee-shadow);
}

.module-header-icon {
    display: grid;
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    place-items: center;
    color: #087fb9;
    font-size: 32px;
    background: linear-gradient(145deg, #dff4ff, #c9ecff);
    border: 1px solid #abe0fa;
    border-radius: 18px;
    box-shadow: 0 9px 20px rgba(50, 181, 244, .18);
}

.module-header h1 {
    margin: 0 0 8px;
    color: var(--idee-text);
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 650;
    line-height: 1.12;
    letter-spacing: -.025em;
}

.module-header p {
    margin: 0;
    color: var(--idee-muted);
    font-size: 1rem;
}

.dashboard-card {
    position: relative;
    display: flex;
    min-height: 112px;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    overflow: hidden;
    background: linear-gradient(145deg, var(--idee-card), var(--idee-card-soft));
    border: 1px solid rgba(184, 199, 217, .72);
    border-radius: 16px;
    box-shadow: var(--idee-shadow);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.dashboard-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--idee-primary);
}

.dashboard-card:hover {
    border-color: #9fcfe7;
    box-shadow: 0 17px 38px rgba(30, 73, 108, .14);
    transform: translateY(-2px);
}

.dashboard-card small {
    display: block;
    margin-bottom: 8px;
    color: var(--idee-muted) !important;
    font-size: 12px;
    font-weight: 600;
}

.dashboard-card h5 {
    color: var(--idee-text);
    font-size: 1.2rem;
    font-weight: 650 !important;
}

.dashboard-card #indiceMorosidad { color: var(--idee-danger) !important; }

.dashboard-card i {
    margin-left: 9px;
    color: #168fce !important;
    font-size: 26px;
    opacity: .72;
}

body > .container > .d-flex.flex-wrap.align-items-center {
    gap: 13px;
    margin-bottom: 18px !important;
    padding: 18px;
    background: linear-gradient(145deg, var(--idee-card), var(--idee-card-soft));
    border: 1px solid rgba(184, 199, 217, .72);
    border-radius: 17px;
    box-shadow: var(--idee-shadow);
}

.btn {
    min-height: 42px;
    padding: 9px 15px;
    font-family: inherit;
    font-weight: 600;
    border-radius: 10px;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease,
        box-shadow .2s ease, transform .2s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid rgba(50,181,244,.3); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg,var(--idee-primary),var(--idee-primary-dark)); border-color: var(--idee-primary-dark); }
.btn-success { background: var(--idee-success); border-color: #1d7959; }
.btn-danger { background: var(--idee-danger); border-color: #bb3949; }
.btn-warning { color: #624c0b; background: #f5da87; border-color: #dfc363; }
.btn-dark { background: #29465e; border-color: #20394e; }

.input-group { min-width: 240px; }
.input-group-text {
    color: #315d75;
    background: #eaf7fd !important;
    border-color: var(--idee-border);
    border-radius: 10px 0 0 10px;
}

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

.input-group > .form-control { border-radius: 0 10px 10px 0; }
.form-control:hover { border-color: #8db4d0; }
.form-control:focus { background: #fff; border-color: var(--idee-primary); box-shadow: 0 0 0 4px rgba(50,181,244,.14); }

body > .container > .row.g-0 {
    margin-bottom: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d3dfe9;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
}

.mini-total {
    min-height: 76px;
    padding: 12px;
    color: var(--idee-text);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    background: #f5faff;
    border: 0;
    border-right: 1px solid #dce5ed;
    border-radius: 0;
}

.mini-total i { margin-bottom: 4px; color: #168fce; font-size: 18px; }
.mini-total span { font-weight: 650; }

body > .container > .table-responsive {
    overflow: hidden auto;
    background: linear-gradient(145deg, var(--idee-card), var(--idee-card-soft));
    border: 1px solid #d3dfe9;
    border-radius: 0 0 17px 17px;
    box-shadow: var(--idee-shadow);
}

.table {
    width: 100%;
    min-width: 1050px;
    margin: 0;
    color: var(--idee-text);
    font-size: 13.5px;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    padding: 13px 10px;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    background: #29465e;
    border-color: #3b5b73;
}

.table tbody td {
    padding: 11px 10px;
    color: var(--idee-text);
    vertical-align: middle;
    background: #fff;
    border-color: #dce5ed;
}

.table tbody tr:nth-child(even) td { background: #f5faff; }
.table tbody tr:hover td { background: #eaf7fd; }

.table .badge {
    padding: 6px 9px;
    font-weight: 600;
    border-radius: 999px;
}

.table .bg-success { color: #176248 !important; background: #d8f1e6 !important; }
.table .bg-warning { color: #6c520c !important; background: #f8e7ae !important; }
.table .bg-danger { color: #8d2835 !important; background: #f7dce0 !important; }

.table td .btn {
    display: inline-grid;
    width: 36px;
    min-height: 36px;
    padding: 0;
    place-items: center;
    border-radius: 9px;
}

@media (max-width: 991px) {
    body > .container > .d-flex.flex-wrap.align-items-center { align-items: stretch !important; }
    body > .container > .d-flex.flex-wrap.align-items-center > div { flex: 1 1 280px; max-width: none !important; }
}

@media (max-width: 767px) {
    body { padding: 14px 11px 30px; }
    .module-header { min-height: 132px; gap: 15px; padding: 23px 17px; border-radius: 17px; }
    .module-header-icon { width: 50px; height: 50px; flex-basis: 50px; font-size: 24px; border-radius: 14px; }
    .module-header p { font-size: .84rem; }
    body > .container > .d-flex.flex-wrap.align-items-center { padding: 15px; border-radius: 16px; }
    body > .container > .d-flex.flex-wrap.align-items-center .d-flex { width: 100%; flex-wrap: wrap; }
    body > .container > .d-flex.flex-wrap.align-items-center .btn { flex: 1 1 120px; }
    .input-group { width: 100%; }
    body > .container > .row.g-0 { display: grid; grid-template-columns: repeat(2,1fr); }
    body > .container > .row.g-0 > .col { width: auto; }
}

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