:root {
    --primary: #0759a6;
    --primary-dark: #053f78;
    --accent: #34b4dc;
    --soft: #eef8fc;
    --ink: #1f2937;
}

body {
    background: #f5f8fb;
    color: var(--ink);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(7, 89, 166, .92), rgba(52, 180, 220, .78)),
        url('https://images.unsplash.com/photo-1523580846011-d3a5bc25702b?auto=format&fit=crop&w=1600&q=80') center/cover;
}

.login-shell {
    width: min(92vw, 430px);
}

.login-panel {
    background: rgba(255, 255, 255, .96);
    border-radius: 8px;
    padding: 2rem;
}

.brand-mark {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--primary);
    font-size: 2rem;
}

.app-layout {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    flex-direction: column;
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    display: flex;
    gap: .75rem;
    align-items: center;
    padding: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
    background: var(--primary-dark);
}

.sidebar-brand i {
    font-size: 2rem;
}

.sidebar-nav {
    padding: .75rem;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, .86);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .85rem;
    border-radius: 8px;
    margin-bottom: .25rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .16);
}

.offcanvas .sidebar-nav .nav-link {
    color: var(--primary-dark);
}

.offcanvas .sidebar-nav .nav-link:hover,
.offcanvas .sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--primary);
}

.main-area {
    flex: 1;
    min-width: 0;
}

.topbar {
    min-height: 64px;
}

.content-wrap {
    padding: 1.5rem;
}

.stat-card,
.panel {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--soft);
    color: var(--primary);
    font-size: 1.4rem;
}

.table thead th {
    background: #edf6fb;
    color: var(--primary-dark);
    white-space: nowrap;
}

.receipt-page {
    max-width: 880px;
    margin: 0 auto;
}

.ticket-body {
    background: #fff;
    color: #000;
}

.ticket {
    width: 80mm;
    padding: 8px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
}

.ticket h2,
.ticket h3,
.ticket p {
    text-align: center;
    margin: 6px 0;
}

.ticket-saved {
    display: none;
}

.void-stamp {
    position: absolute;
    inset: 42% auto auto 32%;
    transform: rotate(-18deg);
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: 800;
    color: rgba(220, 53, 69, .22);
    border: 6px solid rgba(220, 53, 69, .22);
    padding: .25rem 1rem;
    pointer-events: none;
}

.signature-line {
    width: min(260px, 80%);
    border-top: 1px solid #94a3b8;
    margin-top: 54px;
}

@media print {
    .sidebar,
    .topbar,
    .print-hide {
        display: none !important;
    }

    .content-wrap {
        padding: 0;
    }

    .card {
        box-shadow: none !important;
        border: 0 !important;
    }

    .ticket {
        width: 80mm;
    }
}

.badge-soft {
    background: var(--soft);
    color: var(--primary-dark);
}

.dashboard-hero {
    min-height: 150px;
    border-radius: 8px;
    padding: 1.4rem;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, var(--accent));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 16px 36px rgba(7, 89, 166, .22);
}

.dashboard-hero h2 {
    font-weight: 800;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.dashboard-stat {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
    transition: transform .18s ease, box-shadow .18s ease;
}

.dashboard-stat:hover,
.quick-actions a:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(7, 89, 166, .16);
}

.stat-value {
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 800;
    color: var(--ink);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.quick-actions a {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .85rem;
    border-radius: 8px;
    background: #f8fbfd;
    color: var(--primary-dark);
    text-decoration: none;
    border: 1px solid #e3eef5;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.quick-actions i {
    font-size: 1.15rem;
    color: var(--primary);
}

.chart-card canvas {
    min-height: 280px;
}

.dashboard-table tbody tr {
    transition: background .18s ease;
}

.dashboard-table tbody tr:hover {
    background: #f8fbfd;
}

.status-pagado,
.status-pendiente,
.status-anulado,
.status-observado {
    border-radius: 999px;
    padding: .35rem .55rem;
    font-weight: 700;
}

.status-pagado {
    background: #e7f8ef;
    color: #166534;
}

.status-pendiente {
    background: #fff7df;
    color: #92400e;
}

.status-anulado {
    background: #fee2e2;
    color: #991b1b;
}

.status-observado {
    background: #e0f2fe;
    color: #075985;
}

.live-search {
    position: relative;
}

.live-search-results {
    position: absolute;
    z-index: 1050;
    top: calc(100% + .35rem);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dbe7f0;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
    transform-origin: top;
    animation: dropdownIn .18s ease-out;
}

.live-search-item {
    width: 100%;
    border: 0;
    background: #fff;
    text-align: left;
    padding: .75rem .9rem;
    border-bottom: 1px solid #eef2f6;
}

.live-search-item:hover,
.live-search-item:focus {
    background: var(--soft);
}

.student-preview {
    border: 1px solid #dbe7f0;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #f7fbfd);
    animation: fadeSlide .22s ease-out;
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scaleY(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}

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

@media (max-width: 767.98px) {
    .content-wrap {
        padding: 1rem;
    }

    .login-panel {
        padding: 1.4rem;
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Modal estilo Laravel para matriculas */
.matricula-modal .modal-dialog {
    max-width: min(980px, calc(100vw - 2rem));
}

.matricula-modal .modal-content {
    border-radius: 12px;
    overflow: hidden;
}

.matricula-modal.fade .modal-dialog {
    transform: translateY(18px) scale(.98);
    transition: transform .22s ease-out, opacity .22s ease-out;
}

.matricula-modal.show .modal-dialog {
    transform: translateY(0) scale(1);
}

.matricula-modal .modal-header {
    background: linear-gradient(180deg, #fff, #f8fbfd);
}

.matricula-modal .modal-body {
    background: #fff;
}

.matricula-modal .fw-semibold.text-primary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid #e7eef5;
}

.matricula-modal .fw-semibold.text-primary::before {
    content: '';
    width: .55rem;
    height: .55rem;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 .22rem rgba(7, 89, 166, .12);
}

.modal-backdrop.show {
    opacity: .58;
}

.modal-form-footer {
    position: sticky;
    bottom: -1.5rem;
    z-index: 2;
    background: linear-gradient(180deg, rgba(255, 255, 255, .86), #fff 45%);
    padding-bottom: .35rem;
}

@supports (backdrop-filter: blur(6px)) {
    .modal-backdrop.show {
        backdrop-filter: blur(6px);
    }
}

@media (max-width: 767.98px) {
    .matricula-modal .modal-dialog {
        max-width: 100%;
        margin: .5rem;
    }

    .matricula-modal .modal-header,
    .matricula-modal .modal-body {
        padding: 1rem !important;
    }

    .modal-form-footer {
        flex-direction: column-reverse;
    }

    .modal-form-footer .btn {
        width: 100%;
    }
}

/* Buscador dinamico de conceptos en registro de pagos */
.concept-search .input-group-text {
    background: #f8fbfd;
    color: var(--primary);
}

.concept-results {
    max-height: 360px;
}

.concept-result-item .text-muted {
    line-height: 1.35;
}

.concept-selected {
    min-height: 58px;
    padding: .75rem .85rem;
    border: 1px solid #dbe7f0;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #f7fbfd);
    box-shadow: inset 3px 0 0 rgba(7, 89, 166, .18);
    animation: fadeSlide .2s ease-out;
}

@media (max-width: 767.98px) {
    .concept-result-item .d-flex,
    .concept-selected .d-flex {
        align-items: flex-start !important;
        flex-direction: column;
    }
}

.quick-action-button {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .85rem;
    border-radius: 8px;
    background: #f8fbfd;
    color: var(--primary-dark);
    text-decoration: none;
    border: 1px solid #e3eef5;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    text-align: left;
}

.quick-action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(7, 89, 166, .16);
}

.quick-action-button i {
    font-size: 1.15rem;
    color: var(--primary);
}

/* Configuracion institucional */
.institution-logo-card {
    background: linear-gradient(180deg, #fff, #f8fbfd);
}

.logo-preview {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    border: 1px dashed #b9d7ea;
    background: #fff;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--primary);
    font-size: 3rem;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: .65rem;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, .95);
    padding: .2rem;
}

.sidebar-logo-sm {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.import-type-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 104px;
    padding: 18px;
    border: 1px solid rgba(13, 110, 253, 0.12);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.import-type-card:hover,
.import-type-card.active {
    transform: translateY(-2px);
    border-color: rgba(13, 110, 253, 0.38);
    box-shadow: 0 18px 42px rgba(13, 110, 253, 0.12);
}
.import-type-card.active {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.10), #fff 68%);
}
.import-type-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #0d6efd;
    background: #eef8ff;
    font-size: 1.45rem;
    flex: 0 0 auto;
}
.import-type-card strong,
.import-type-card small {
    display: block;
}
.import-type-card small {
    color: #6c757d;
    line-height: 1.35;
    margin-top: 4px;
}
.import-columns {
    padding: 14px;
    border: 1px dashed rgba(13, 110, 253, 0.28);
    border-radius: 10px;
    background: #f8fbff;
}
.import-preview-table {
    max-height: 520px;
    overflow: auto;
}
.empty-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: #6c757d;
    border: 1px dashed #d8e2ef;
    border-radius: 12px;
    background: #fbfdff;
}
.empty-state i {
    font-size: 3rem;
    color: #0d6efd;
}
.empty-state strong {
    color: #1f2937;
}
@media (max-width: 768px) {
    .import-type-card {
        min-height: auto;
    }
    .import-preview-table {
        max-height: none;
    }
}

.signature-preview {
    width: 100%;
    max-width: 260px;
    min-height: 116px;
    border: 1px dashed rgba(13, 110, 253, .35);
    border-radius: 12px;
    background: #f8fbff;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    overflow: hidden;
}
.signature-preview i {
    font-size: 2rem;
}
.signature-preview img {
    width: 100%;
    height: 116px;
    object-fit: contain;
    padding: 10px;
}
.institution-settings .form-control-color {
    min-width: 58px;
}
.institution-preview {
    border-left: 5px solid var(--preview-color, var(--primary));
    border-radius: 12px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(248, 251, 255, .95), #fff);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.institution-preview h3 {
    margin: 0;
    font-weight: 800;
    color: var(--preview-color, var(--primary));
}
.institution-preview p {
    margin: 4px 0 0;
    color: #6c757d;
}
.institution-preview-logo {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #eef8ff;
    color: var(--preview-color, var(--primary));
    flex: 0 0 auto;
    overflow: hidden;
}
.institution-preview-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}
.institution-preview-logo i {
    font-size: 2rem;
}
.institution-preview-chip {
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--preview-color, var(--primary));
    background: color-mix(in srgb, var(--preview-color, var(--primary)) 12%, #fff);
    font-weight: 700;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .institution-preview {
        align-items: flex-start;
        flex-direction: column;
    }
}

.receipt-signature-block {
    min-width: 220px;
}
.receipt-digital-signature {
    display: block;
    width: 180px;
    max-height: 78px;
    object-fit: contain;
    margin: 0 auto 6px;
}
