/* ==========================================================================
   THEME INSTITUCIONAL — Paleta: Blanco #ffffff · Oro #c39324 · Oscuro #181818
   Sobrescribe la paleta de Argon Dashboard sin alterar la funcionalidad.
   Cargar SIEMPRE después de argon-dashboard.css.
   ========================================================================== */

:root {
    --tg-white: #ffffff;
    --tg-gold: #c39324;
    --tg-gold-strong: #a87c1c;
    --tg-gold-soft: #d9b45a;
    --tg-gold-tint: #faf5e6;
    --tg-gold-tint-2: #f5ecd7;
    --tg-dark: #181818;
    --tg-dark-soft: #242424;
    --tg-dark-line: #2e2e2e;
    --tg-ink-soft: rgba(24, 24, 24, 0.72);
    --tg-ink-muted: rgba(24, 24, 24, 0.55);

    /* Alineación con variables Bootstrap/Argon */
    --bs-primary: #c39324;
    --bs-primary-rgb: 195, 147, 36;
    --bs-dark: #181818;
    --bs-dark-rgb: 24, 24, 24;
    --bs-body-color: #181818;
    --bs-link-color: #a87c1c;
    --bs-link-hover-color: #c39324;
}

body {
    color: #181818;
    background-color: #ffffff;
}

/* ---------- Texto ---------- */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    color: #181818;
}
.text-primary { color: #c39324 !important; }
a.text-primary:hover { color: #a87c1c !important; }
.text-dark { color: #181818 !important; }
.text-secondary { color: rgba(24, 24, 24, 0.72) !important; }
.text-muted { color: rgba(24, 24, 24, 0.55) !important; }

.text-gradient.text-primary {
    background-image: linear-gradient(310deg, #a87c1c, #d9b45a);
}

/* ---------- Fondos ---------- */
.bg-primary { background-color: #c39324 !important; }
.bg-gradient-primary { background: linear-gradient(135deg, #c39324 0%, #a87c1c 100%) !important; }
.bg-secondary { background-color: #181818 !important; }
.bg-gradient-secondary { background: linear-gradient(135deg, #181818 0%, #2e2e2e 100%) !important; }
.bg-dark { background-color: #181818 !important; }
.bg-gradient-dark { background: linear-gradient(135deg, #181818 0%, #313131 100%) !important; }
.bg-gray-100:not(.dark-version) { background-color: #faf9f6 !important; }

/* Compatibilidad con el modo oscuro existente */
.dark-version h1, .dark-version .h1,
.dark-version h2, .dark-version .h2,
.dark-version h3, .dark-version .h3,
.dark-version h4, .dark-version .h4,
.dark-version h5, .dark-version .h5,
.dark-version h6, .dark-version .h6 {
    color: #ffffff;
}
.dark-version .text-secondary { color: rgba(255, 255, 255, 0.72) !important; }
.dark-version .text-muted { color: rgba(255, 255, 255, 0.55) !important; }
/* Compatibilidad con el modo oscuro existente (alineado a #181818, sin azules) */
.dark-version { background-color: #101010 !important; }
.dark-version > div[class*=bg-] { background-color: #101010 !important; }
.dark-version .sidenav { background: #181818 !important; }
.dark-version .card,
.dark-version .swal2-popup,
.dark-version .dropdown .dropdown-menu,
.dark-version .kanban-board {
    background: #1e1e1e;
}
.dark-version .bg-gradient-dark {
    background-image: linear-gradient(195deg, #2a2a2a, #181818);
}
.dark-version .card { border-color: rgba(255, 255, 255, 0.08); }
.dark-version .table thead th { border-bottom-color: rgba(195, 147, 36, 0.4) !important; }
.dark-version .table-hover > tbody > tr:hover > * { background-color: rgba(195, 147, 36, 0.12); }
.dark-version .alert-info { background: rgba(255,255,255,0.06); color: #bcd9ea; }
.dark-version .alert-success { background: rgba(255,255,255,0.06); color: #b6e2c6; }
.dark-version .alert-warning { background: rgba(195, 147, 36, 0.15); color: #e8c878; }
.dark-version .alert-danger { background: rgba(255,255,255,0.06); color: #f0b9b9; }
.dark-version .tg-login-card,
.dark-version .tg-hero-band {
    background: linear-gradient(120deg, #181818 0%, #262013 60%, #4a3a12 100%);
}

.border-primary { border-color: #c39324 !important; }
.border-dark { border-color: #181818 !important; }

/* Franja superior del layout (detrás del navbar): oscura con brillo dorado */
.min-height-300.bg-primary {
    background: linear-gradient(120deg, #181818 0%, #262013 55%, #4a3a12 100%) !important;
}

/* ---------- Botones ---------- */
.btn-primary {
    color: #ffffff !important;
    background-color: #c39324 !important;
    border-color: #c39324 !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus {
    color: #ffffff !important;
    background-color: #a87c1c !important;
    border-color: #a87c1c !important;
    box-shadow: 0 4px 14px rgba(195, 147, 36, 0.4) !important;
}
.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle,
.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary {
    color: #ffffff !important;
    background-color: #977019 !important;
    border-color: #977019 !important;
}
.btn-check:focus + .btn-primary,
.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(195, 147, 36, 0.45) !important;
}
.btn-primary:disabled,
.btn-primary.disabled {
    color: #ffffff !important;
    background-color: #c39324 !important;
    border-color: #c39324 !important;
}
.btn.bg-gradient-primary { color: #ffffff; }
.btn.bg-gradient-primary:hover {
    background: linear-gradient(135deg, #a87c1c 0%, #977019 100%) !important;
}
.btn-outline-primary {
    color: #a87c1c !important;
    border-color: #c39324 !important;
}
.btn-outline-primary:hover {
    color: #ffffff !important;
    background-color: #c39324 !important;
    border-color: #c39324 !important;
}
.btn-dark {
    color: #ffffff;
    background-color: #181818;
    border-color: #181818;
}
.btn-dark:hover {
    color: #ffffff;
    background-color: #2e2e2e;
    border-color: #2e2e2e;
}
.btn-white {
    color: #181818;
    background-color: #ffffff;
    border-color: #ffffff;
}

/* ---------- Enlaces ---------- */
a { color: #a87c1c; }
a:hover { color: #c39324; }
.navbar-vertical .nav-link { color: inherit; }

/* ---------- Formularios ---------- */
.form-control:focus,
.form-select:focus {
    border-color: #d9b45a !important;
    box-shadow: 0 0 0 2px rgba(195, 147, 36, 0.25) !important;
}
.form-control-color:focus {
    box-shadow: 0 0 0 2px rgba(195, 147, 36, 0.25) !important;
}
.form-check-input:checked {
    background-color: #c39324;
    border-color: #c39324;
}
.form-check-input:focus {
    border-color: #d9b45a;
    box-shadow: 0 0 0 2px rgba(195, 147, 36, 0.25);
}
.form-switch .form-check-input:checked {
    background-color: #c39324;
    border-color: #c39324;
}
.form-check-input.is-valid:checked,
.form-check-input.is-invalid:checked {
    background-color: #c39324;
}
.input-group-text {
    color: #181818;
}

/* ---------- Tablas ---------- */
.card .table thead th,
.table thead th {
    color: #181818;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.7rem;
    border-bottom: 1px solid rgba(195, 147, 36, 0.35) !important;
}
.table > :not(caption) > * > * {
    background-color: transparent;
}
.table-hover > tbody > tr:hover > * {
    background-color: rgba(195, 147, 36, 0.07);
    color: inherit;
    box-shadow: none;
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(24, 24, 24, 0.025);
}

/* ---------- Tarjetas ---------- */
.card {
    border: 1px solid rgba(24, 24, 24, 0.06);
    box-shadow: 0 3px 14px rgba(24, 24, 24, 0.06);
}
.card-header {
    border-bottom: 1px solid rgba(195, 147, 36, 0.18);
}

/* ---------- Sidenav oscura con acentos dorados ---------- */
.sidenav.bg-white,
.navbar-vertical.bg-white {
    background-color: #181818 !important;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35) !important;
}
.sidenav.bg-white .sidenav-header {
    border-bottom: 1px solid rgba(195, 147, 36, 0.25);
    padding-bottom: 0.75rem;
}
.sidenav.bg-white .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.82) !important;
}
.sidenav.bg-white .navbar-nav .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(195, 147, 36, 0.12);
}
.sidenav.bg-white .navbar-nav > .nav-item > .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(195, 147, 36, 0.2) !important;
    box-shadow: inset 3px 0 0 #c39324 !important;
    border-radius: 0.5rem;
}
.sidenav.bg-white .navbar-nav .nav-sm .nav-link {
    color: rgba(255, 255, 255, 0.65) !important;
}
.sidenav.bg-white .navbar-nav .nav-sm .nav-link.active,
.sidenav.bg-white .navbar-nav .nav-sm .nav-link:hover {
    color: #d9b45a !important;
}
.sidenav .nav-link .icon i {
    opacity: 1 !important;
    color: #c39324 !important;
}
.sidenav.bg-white .navbar-nav .nav-item .nav-link.active .icon i {
    color: #d9b45a !important;
}
.sidenav hr.horizontal.dark {
    background-image: linear-gradient(to right, rgba(195, 147, 36, 0.5), transparent) !important;
}
.sidenav .sidenav-header .navbar-brand {
    filter: none;
}
/* Chip blanco para que el logo respire sobre el fondo oscuro */
.sidenav .sidenav-header .navbar-brand-img {
    background-color: #ffffff;
    border-radius: 0.65rem;
    padding: 0.3rem 0.6rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* ---------- Dropdowns ---------- */
.dropdown-menu {
    border: 1px solid rgba(24, 24, 24, 0.08);
    box-shadow: 0 8px 24px rgba(24, 24, 24, 0.14);
}
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(195, 147, 36, 0.12);
    color: #181818;
}
.dropdown-item.active,
.dropdown-item:active {
    background-color: #c39324;
    color: #ffffff;
}

/* ---------- Paginación ---------- */
.page-item.active .page-link {
    color: #ffffff;
    background-color: #c39324;
    border-color: #c39324;
}
.page-link {
    color: #a87c1c;
}
.page-link:hover {
    color: #977019;
    background-color: rgba(195, 147, 36, 0.12);
    border-color: rgba(195, 147, 36, 0.3);
}
.page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(195, 147, 36, 0.3);
}

/* ---------- Badges y progresos ---------- */
.badge.bg-primary { color: #ffffff; }
.badge.bg-dark { color: #ffffff; }
.progress-bar { background-color: #c39324; }
.progress-bar.bg-dark { background-color: #181818; }

/* ---------- Acordeones ---------- */
.accordion-button { color: #181818; }
.accordion-button:not(.collapsed) {
    color: #181818;
    background-color: var(--tg-gold-tint);
    box-shadow: inset 0 -1px 0 rgba(195, 147, 36, 0.4);
}
.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(195, 147, 36, 0.25);
    border-color: rgba(195, 147, 36, 0.5);
}

/* ---------- Modales ---------- */
.modal-header.bg-gradient-primary {
    background: linear-gradient(135deg, #181818 0%, #3a2d10 100%) !important;
    color: #ffffff;
}

/* ---------- Nav pills / tabs ---------- */
.nav-pills .nav-link.active {
    background-color: #c39324;
    color: #ffffff;
}
.nav-tabs .nav-link.active {
    color: #181818;
    border-bottom: 2px solid #c39324;
}

/* ---------- Iconos de estadísticas ---------- */
.icon-shape.bg-primary { color: #ffffff; }
.icon-shape.bg-gradient-primary { color: #ffffff; }
.icon-shape.bg-dark,
.icon-shape.bg-gradient-dark { color: #ffffff; }

/* ---------- Select2 ---------- */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-color: rgba(24, 24, 24, 0.15);
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #d9b45a;
    box-shadow: 0 0 0 2px rgba(195, 147, 36, 0.25);
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #c39324;
    color: #ffffff;
}
.select2-container--default .select2-selection__choice {
    background-color: #181818;
    border-color: #181818;
    color: #ffffff;
}

/* ---------- Alertas (mantienen color semántico, borde institucional) ---------- */
.alert {
    border-radius: 0.6rem;
    border: 1px solid transparent;
    color: #181818;
}
.alert-info {
    background: #eef4f8;
    border-color: rgba(24, 24, 24, 0.08);
    color: #29505f;
}
.alert-success {
    background: #eef6f0;
    border-color: rgba(24, 24, 24, 0.08);
    color: #22633c;
}
.alert-warning {
    background: var(--tg-gold-tint-2);
    border-color: rgba(195, 147, 36, 0.35);
    color: #7c5d17;
}
.alert-danger {
    background: #faeeee;
    border-color: rgba(24, 24, 24, 0.08);
    color: #8f2f2f;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumb-item a { color: rgba(255, 255, 255, 0.75); }
.breadcrumb-item.text-white,
.breadcrumb-item.active { color: #ffffff !important; }
.breadcrumb .font-weight-bolder { color: #ffffff; }

/* ---------- Utilidades de enfoque ---------- */
.btn-check:focus + .btn,
.btn:focus {
    outline: 0;
}

/* ---------- Hero band del dashboard ---------- */
.tg-hero-band {
    background: linear-gradient(120deg, #181818 0%, #262013 60%, #4a3a12 100%);
    position: relative;
}
.tg-hero-band::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, #c39324, rgba(195, 147, 36, 0.1));
}

/* ---------- Login institucional (split 50/50 a pantalla completa) ---------- */
.tg-login-page {
    background-color: #ffffff;
}
.tg-login-aside {
    position: relative;
    background: radial-gradient(circle at 20% 15%, #3a2d10 0%, #181818 55%);
    overflow: hidden;
}
.tg-login-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(195, 147, 36, 0.28) 0%, transparent 42%),
        radial-gradient(circle at 15% 85%, rgba(195, 147, 36, 0.18) 0%, transparent 40%);
}
.tg-login-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(195, 147, 36, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(195, 147, 36, 0.12) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 75%);
}
.tg-login-aside > * {
    position: relative;
    z-index: 2;
}
.tg-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(195, 147, 36, 0.55);
    border-radius: 999px;
    color: #d9b45a;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.tg-feature {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.tg-feature-icon {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(195, 147, 36, 0.14);
    border: 1px solid rgba(195, 147, 36, 0.4);
    color: #d9b45a;
    font-size: 1.1rem;
}
.tg-input-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(24, 24, 24, 0.6);
    margin-bottom: 0.4rem;
}
.tg-login-page .form-control {
    border: 1px solid rgba(24, 24, 24, 0.14);
    border-radius: 0.6rem;
    background-color: #ffffff;
    color: #181818;
    padding: 0.7rem 1rem;
}
.tg-login-page .form-control::placeholder {
    color: rgba(24, 24, 24, 0.3);
}
.tg-login-page .form-control:focus {
    border-color: #c39324;
    box-shadow: 0 0 0 3px rgba(195, 147, 36, 0.18);
}
.tg-login-page .form-check-input {
    width: 2.2rem;
    height: 1.15rem;
    cursor: pointer;
}
.tg-login-page .btn-primary {
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 0.6rem;
}
/* Compatibilidad: tarjetas de las pantallas de contraseña */
.tg-login-card {
    border: 1px solid rgba(24, 24, 24, 0.08);
    border-top: 4px solid #c39324;
    border-radius: 1rem;
    box-shadow: 0 18px 44px rgba(24, 24, 24, 0.12);
}
.tg-login-title {
    color: #181818;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.tg-login-sub {
    color: rgba(24, 24, 24, 0.6);
}

/* ---------- Scrollbars webkit en zona oscura ---------- */
.sidenav ::-webkit-scrollbar-thumb {
    background-color: rgba(195, 147, 36, 0.5);
}

/* ---------- Impresión limpia ---------- */
@media print {
    .sidenav,
    .navbar-main {
        display: none !important;
    }
}
