html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

:root {
    /* PALETA INSTITUCIONAL GOBIERNO SJ / DGR */
    --gov-blue: #01579B;
    --gov-celeste: #0dcaf0;
    --dgr-orange: #f39200;
    --dgr-orange-hover: #d68100;
    --dgr-dark: #222222;
    --dgr-dark-secondary: #333333;
    --dgr-bg: #f8f9fa;
    --dgr-gray: #e0e0e0;
    --dgr-border: #d7dce2;
    --dgr-success: #198754;
    --dgr-danger: #dc3545;
}

body {
    margin-bottom: 60px;
    background-color: var(--dgr-bg);
    font-family: 'Segoe UI', sans-serif;
}

/* UTILIDADES INSTITUCIONALES */
.text-dgr {
    color: var(--dgr-orange) !important;
}

.bg-dgr {
    background-color: var(--dgr-orange) !important;
    color: white !important;
}

.bg-gov-blue {
    background-color: var(--gov-blue) !important;
    color: white !important;
}

.bg-dgr-dark {
    background-color: var(--dgr-dark) !important;
    color: white !important;
}

.border-dgr {
    border-color: var(--dgr-orange) !important;
}

.shadow-dgr {
    box-shadow: 0 6px 18px rgba(0,0,0,.08) !important;
}

/* BOTONES DGR */
.btn-dgr,
.btn-rentas {
    background-color: var(--dgr-orange);
    color: white;
    border: none;
    transition: all 0.25s ease;
    font-weight: 700;
}

    .btn-dgr:hover,
    .btn-rentas:hover {
        background-color: var(--dgr-orange-hover);
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.12);
    }

.btn-dgr-dark {
    background-color: var(--dgr-dark);
    color: white;
    border: none;
    transition: all .25s ease;
    font-weight: 700;
}

    .btn-dgr-dark:hover {
        background-color: var(--dgr-dark-secondary);
        color: white;
        transform: translateY(-1px);
    }

.btn-outline-dgr {
    color: var(--dgr-orange);
    border: 1px solid var(--dgr-orange);
    background: white;
    font-weight: 700;
}

    .btn-outline-dgr:hover {
        color: white;
        background: var(--dgr-orange);
    }

/* FOCUS */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(243, 146, 0, .35);
    border-color: var(--dgr-orange);
}

/* HEADER / NAV INSTITUCIONAL */
.dgr-topbar {
    background: linear-gradient(90deg, var(--dgr-dark), #111);
    color: white;
    border-bottom: 4px solid var(--dgr-orange);
}

.dgr-brand {
    font-weight: 800;
    letter-spacing: .3px;
    color: white !important;
}

    .dgr-brand .brand-mark {
        color: var(--dgr-orange);
    }

.dgr-admin-btn {
    background: var(--dgr-orange);
    color: white !important;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .85rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0,0,0,.18);
}

    .dgr-admin-btn:hover {
        background: var(--dgr-orange-hover);
        color: white !important;
    }

/* PANEL ADMINISTRADOR */
.admin-nav-wrapper {
    background-color: white;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--dgr-gray);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.admin-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-tab-item {
    color: #555;
    text-decoration: none;
    padding: 18px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .admin-tab-item:hover {
        color: var(--dgr-orange);
    }

    .admin-tab-item.active {
        color: var(--dgr-orange);
        border-bottom: 3px solid var(--dgr-orange);
    }

.admin-gear-container {
    color: var(--dgr-orange);
    font-size: 1.4rem;
}

/* CARDS / TABLAS */
.card-dgr {
    border: none;
    border-radius: 18px;
    background: white;
    box-shadow: 0 5px 16px rgba(0,0,0,.06);
}

.card-dgr-header {
    background: white;
    border-bottom: 1px solid #eee;
    padding: 16px 20px;
    font-weight: 800;
    color: var(--dgr-dark);
}

.table-dgr thead {
    background: #f4f5f7;
    color: #555;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
}

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

    .table-dgr tbody tr:hover {
        background: #fff8ef;
    }

/* BADGES */
.badge-dgr {
    background: var(--dgr-orange);
    color: white;
}

.badge-dgr-dark {
    background: var(--dgr-dark);
    color: white;
}

/* MODALES INSTITUCIONALES */
.modal-content.dgr-modal,
.dgr-modal .modal-content {
    border: none;
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0,0,0,.25);
    overflow: hidden;
}

.dgr-modal-header,
.modal-header.dgr-modal-header {
    background: var(--dgr-orange);
    color: white;
    border: none;
    padding: 16px 20px;
}

    .dgr-modal-header .modal-title {
        font-weight: 800;
    }

.dgr-modal-body,
.modal-body.dgr-modal-body {
    background: #f8f9fa;
}

.dgr-modal-footer,
.modal-footer.dgr-modal-footer {
    background: white;
    border-top: 1px solid #eee;
}

/* SWEETALERT estilo DGR */
.swal2-popup {
    border-radius: 18px !important;
    border: none !important;
    box-shadow: 0 14px 40px rgba(0,0,0,.22) !important;
}

.swal2-title {
    color: var(--dgr-dark) !important;
    font-weight: 800 !important;
}

.swal2-confirm {
    background-color: var(--dgr-orange) !important;
    border-radius: 999px !important;
    font-weight: 800 !important;
}

.swal2-cancel {
    border-radius: 999px !important;
    font-weight: 800 !important;
}

/* CHATBOT DGR */
.chatbot-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    border: 1px solid var(--dgr-border);
    border-radius: 18px;
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: 0 6px 22px rgba(0,0,0,.08);
}

.chatbot-header {
    background: linear-gradient(90deg, var(--dgr-dark), #111);
    color: white;
    padding: 16px 20px;
    border-bottom: 4px solid var(--dgr-orange);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .chatbot-header h3 {
        font-weight: 800;
    }

    .chatbot-header small {
        color: #f3f3f3;
    }

.chatbot-messages {
    height: 620px;
    overflow-y: auto;
    padding: 20px;
    background: #eef1f5;
}

.chatbot-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-top: 1px solid var(--dgr-border);
}

.chat-message {
    margin-bottom: 14px;
    display: flex;
}

    .chat-message.bot {
        justify-content: flex-start;
    }

    .chat-message.user {
        justify-content: flex-end;
    }

.chat-bubble {
    max-width: 92%;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.4;
    font-size: 14px;
}

.chat-message.bot .chat-bubble {
    background: white;
    border: 1px solid var(--dgr-border);
    box-shadow: 0 2px 6px rgba(0,0,0,.03);
}

.chat-message.user .chat-bubble {
    background: var(--dgr-dark);
    color: white;
}

.chatbot-admin-link {
    background: var(--dgr-orange);
    color: white !important;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: .8rem;
    font-weight: 800;
    text-decoration: none;
}

    .chatbot-admin-link:hover {
        background: var(--dgr-orange-hover);
    }

/* LISTADOS DEL CHAT */
.cuenta-card,
.deuda-card {
    border: 1px solid var(--dgr-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fff;
    transition: all .18s ease;
}

    .cuenta-card:hover,
    .deuda-card:hover {
        background: #fff8ef;
        border-color: rgba(243,146,0,.45);
    }

.selected-total-box {
    background: #f8f9fa;
    border: 1px solid var(--dgr-border);
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
}

.deuda-table {
    font-size: 13px;
}

.btn-loading {
    pointer-events: none;
    opacity: .75;
}

/* BOTÓN VERDE NUEVO */
.btn-nuevo-green {
    background-color: #198754;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
}

    .btn-nuevo-green:hover {
        background-color: #157347;
        color: white;
    }

.text-danger-dgr {
    color: #dc3545;
    opacity: 0.7;
    transition: 0.2s;
}

    .text-danger-dgr:hover {
        opacity: 1;
    }
