:root {
    --acrd-margin: 36px;
    --acrd-header-h: 70px;
    --acrd-vpad: 44px;
}

html,
body {
    height: 100%;
    min-height: 100vh;
}

body {
    background: linear-gradient(180deg, #191c21 70px, #21242b 100%);
    color: #e4e7ef;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header-bar {
    background: #232531;
    border-radius: 16px;
    box-shadow: 0 2px 20px #0006, 0 1px 2px #1d21334d;
    padding: 1.3rem 2.2rem 1.05rem 2.2rem;
    margin-bottom: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.3rem;
}

.dashboard-header-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #74b9ff;
    letter-spacing: -1.1px;
    display: flex;
    align-items: center;
    gap: 0.65em;
    margin: 0;
}

.dashboard-header-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* ACCORDION */
.accordion {
    margin-bottom: 2.1rem;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.accordion-item {
    background: transparent !important;
    border: 2.5px solid #254077 !important;
    margin-bottom: 0;
    border-radius: 13px !important;
    box-shadow: 0 1px 10px #0004, 0 0 0 2px #1e90ff44;
    display: flex;
    flex-direction: column;
}

.accordion-header {
    border-radius: 13px 13px 0 0;
    overflow: hidden;
}

.accordion-button {
    background: linear-gradient(90deg, #23283a 60%, #26324a 100%) !important;
    color: #aee4ff !important;
    font-weight: 600;
    font-size: 0.55em;
    border-bottom: 2px solid #254077 !important;
    box-shadow: none !important;
    outline: none !important;
    text-shadow: 0 1px 5px #17253999;
    transition: background 0.18s, color 0.18s, border 0.18s, border-radius 0.18s;
    letter-spacing: 0.01em;
    padding: 1.13em 1.6em 1em 1.6em;
    border-radius: 13px !important;
}

.accordion-button.collapsed {
    border-radius: 13px !important;
}

.accordion-button:not(.collapsed) {
    border-radius: 13px 13px 0 0 !important;
}

.accordion-button:hover,
.accordion-button:focus,
.accordion-button:not(.collapsed) {
    background: linear-gradient(90deg, #29488a 40%, #25345c 100%) !important;
    color: #fff !important;
    border-bottom: 2.2px solid #5cd1ff !important;
    text-shadow: 0 2px 12px #1e90ff44;
    box-shadow: 0 2px 10px #17a2b877 !important;
}

.accordion-button::after {
    filter: brightness(1.4) drop-shadow(0 0 2px #5cd1ff);
    opacity: 0.93;
}

.accordion-body {
    background: #181a20;
    color: #f2f4fa;
    padding: 0;
    border-radius: 0 0 13px 13px;
    flex: 1 1 auto;
    max-height: calc(100vh - var(--acrd-header-h) - var(--acrd-margin) - var(--acrd-vpad));
    overflow-y: auto;
    min-height: 0;
}

@media (max-width: 900px) {
    .accordion-body {
        max-height: 56vh;
    }
}

/* ======= TABLAS DARK THEME SOLO BORDES INFERIORES REDONDEADOS ======= */
.table,
.table-dashboard,
.table-dark,
.table-striped {
    background: #181a20 !important;
    color: #e3f6ff !important;
    border: none !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
    font-size: 1.05em;
    margin-bottom: 1.2em;
    box-shadow: 0 0 0 2.3px #1e90ff70, 0 2px 15px #1116 !important;
    border: 2.5px solid #254077 !important;
    border-radius: 0 0 13px 13px !important;
    /* solo abajo redondeado */
}

/* CABEZAL de la tabla sin redondeado */

.table thead,
.table-dashboard thead {
    background: linear-gradient(90deg, #24304a 0%, #202c40 100%) !important;
    border-radius: 0 !important;
    border-bottom: 2.2px solid #254077 !important;
    border-top: none !important;
    overflow: hidden;
}

.table thead tr,
.table-dashboard thead tr {
    background: transparent !important;
    border-radius: 0 !important;
    /* <-- sin redondeado */
}

.table thead th,
.table-dashboard thead th {
    border-top: none !important;
    border-radius: 0 !important;
    /* <-- sin redondeado */
}

.table thead th:first-child,
.table-dashboard thead th:first-child {
    border-top-left-radius: 0 !important;
}

.table thead th:last-child,
.table-dashboard thead th:last-child {
    border-top-right-radius: 0 !important;
}

/* Quita border-top en la primer fila del tbody para evitar cortes de color */
.table tbody tr:first-child td,
.table-dashboard tbody tr:first-child td {
    border-top: none !important;
}

/* Eliminar radio en celdas y filas de tabla por defecto */
.table th,
.table td,
.table thead th,
.table thead tr,
.table tbody tr,
.table-dashboard th,
.table-dashboard td,
.table-dashboard thead th,
.table-dashboard thead tr {
    border-radius: 0 !important;
}

/* Redondear solo las esquinas inferiores de la tabla (última fila, primera y última celda) */
.table tbody tr:last-child td:first-child,
.table-dashboard tbody tr:last-child td:first-child {
    border-bottom-left-radius: 13px !important;
}

.table tbody tr:last-child td:last-child,
.table-dashboard tbody tr:last-child td:last-child {
    border-bottom-right-radius: 13px !important;
}

.table th,
.table-dashboard th,
.table thead th {
    background: linear-gradient(90deg, #24304a 60%, #202c40 100%) !important;
    color: #5cd1ff !important;
    font-weight: 600;
    border-bottom: 2.2px solid #254077 !important;
    border-top: none !important;
    letter-spacing: .07em;
    font-size: 1.09em;
    text-shadow: 0 1px 5px #1e90ff24;
}

.table td,
.table-dashboard td,
.table tbody td {
    background: #181a20 !important;
    color: #dbefff !important;
    border-bottom: 1.5px solid #22304699 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
}

.table tbody tr,
.table-dashboard tbody tr {
    transition: background 0.12s;
}

.table tbody tr:hover,
.table-dashboard tbody tr:hover {
    background: #212b3b !important;
    color: #fff !important;
}

.table-striped>tbody>tr:nth-of-type(odd) {
    background: #1d2233 !important;
}

.table-striped>tbody>tr:nth-of-type(even) {
    background: #181a20 !important;
}

.table td:focus,
.table td:active {
    background: #232b3c !important;
    outline: 2px solid #60c8fe !important;
    color: #fff !important;
}

.table,
.table th,
.table td,
.table-dashboard,
.table-dashboard th,
.table-dashboard td {
    border-color: #22304699 !important;
}

/* TABLE CONTAINER */
.table-responsive {
    border-radius: 0 0 13px 13px;
    margin-bottom: 0;
}

/* Botones y badges */
.btn,
.table-dashboard .btn {
    border-radius: 7px;
    font-weight: 500;
    letter-spacing: .07em;
    box-shadow: none !important;
    transition: background .14s, color .14s;
}

.btn-primary {
    background: linear-gradient(90deg, #2d65c9, #195096);
    border: none;
    color: #fff;
}

.btn-primary:hover {
    background: #1a3881;
    color: #fff;
}

.btn-secondary,
.table-dashboard .btn-secondary {
    background: #273142 !important;
    color: #b3c8f3 !important;
    border: none !important;
}

.btn-secondary:hover {
    background: #353c53;
    color: #b3c8f3;
}

.btn-success {
    background: #1edb98;
    color: #102821;
    border: none;
}

.btn-success:hover {
    background: #10a56e;
    color: #d2fbe6;
}

.btn-info,
.table-dashboard .btn-info {
    background: #195096 !important;
    color: #fff !important;
    border: none !important;
}

.btn-info:hover {
    background: linear-gradient(90deg, #002058ff, #195096);
    color: #c1e5fa;
    transition: .3s;
}

.btn-warning,
.table-dashboard .btn-warning {
    background: #b99200 !important;
    color: #fff !important;
    border: none !important;
}

.btn-warning:hover {
    background: #917000;
    color: #fffbe2;
}

.btn-light {
    background: #f6f8fa;
    color: #195096;
    border: 1.3px solid #c5d4e7;
}

.btn-light:hover {
    background: #e9eef3;
    color: #195096;
}

.btn-outline-primary {
    border-color: #409cff !important;
    color: #76caff !important;
}

.btn-outline-primary:hover {
    background: #409cff !important;
    color: #fff !important;
}

.table-dashboard .btn-action {
    margin-right: .5em;
    min-width: 30px !important;
    min-height: 28px;
    padding: 0.13em 0.75em;
    font-size: 1em;
    box-shadow: none !important;
}

.table-dashboard .btn-action:last-child {
    margin-right: 0;
}

.table-dashboard .badge-active {
    background: #1edb98 !important;
    color: #102821 !important;
    font-weight: 600;
}

.table-dashboard .badge-inactive {
    background: #232436 !important;
    color: #8f96a8 !important;
}

.btn-add {
    background: linear-gradient(90deg, #2d65c9, #195096);
    color: #fff;
    font-weight: 500;
    border: none;
    box-shadow: 0 1px 6px #2344a966;
}

.btn-add:hover {
    background: linear-gradient(90deg, #002058ff, #195096);
    color: #fff;
    transition: .3s;
}

@media (max-width: 700px) {
    .dashboard-header-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1rem 0.6rem 1rem;
    }

    .dashboard-header-title {
        font-size: 1.2rem;
        margin-bottom: .8rem;
    }

    .accordion-button {
        font-size: 1em;
    }
}

#toast-container .toast {
    background: #1e222b;
    color: #bfefff;
    border: 1.5px solid #267dc4;
}

.tr-resaltado-eliminado {
    animation: fadeHighlightRed 1.3s linear;
    background: #9c25257a !important;
}

.tr-resaltado-restaurado {
    animation: fadeHighlightGreen 1.3s linear;
    background: #1edb988a !important;
}

@keyframes fadeHighlightRed {
    0% {
        background: #e24141e9;
    }

    85% {
        background: #a62525a0;
    }

    100% {
        background: transparent;
    }
}

@keyframes fadeHighlightGreen {
    0% {
        background: #21dd7ae6;
    }

    85% {
        background: #189b5aa0;
    }

    100% {
        background: transparent;
    }
}

.tr-resaltado-ultima {
    animation: fadeHighlightBlue 1.8s linear;
    background: #4286f57d !important;
}

@keyframes fadeHighlightBlue {
    0% {
        background: #54aaffc7;
    }

    80% {
        background: #1e90ff63;
    }

    100% {
        background: transparent;
    }
}


.table thead th,
.table-dashboard thead th {
    background: none !important;
    /* ¡Sin fondo por columna! */
    color: #5cd1ff !important;
    font-weight: 600;
    border-bottom: 2.2px solid #254077 !important;
    border-top: none !important;
    letter-spacing: .07em;
    font-size: 1.09em;
    text-shadow: 0 1px 5px #1e90ff24;
    border-radius: 0 !important;
}


/* ======= BOTÓN CAMBIO DE TEMA - MODO DARK ======= */
#toggleThemeBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #232531;
    box-shadow: 0 2px 8px #13192c88;
    transition: background 0.18s, box-shadow 0.16s;
    cursor: pointer;
    position: relative;
    outline: none;
    margin-left: 1rem;
}

#toggleThemeBtn:hover,
#toggleThemeBtn:focus {
    background: #2c3344;
    box-shadow: 0 2px 16px #222c4699;
}

#themeIcon {
    font-size: 1.4em;
    transition: color 0.16s, filter 0.16s;
    color: #aee4ff;
    filter: drop-shadow(0 1px 4px #191c21cc);
}
