:root {
    --wk-brand: #5d78ff;
    --wk-sidebar-w: 250px;
}

body {
    min-height: 100vh;
}

/* ---- Login ---- */
.wk-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5d78ff 0%, #2b3a8c 100%);
    padding: 1.5rem;
}

.wk-login__card {
    width: 100%;
    max-width: 420px;
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .25);
}

.wk-login__logo {
    max-height: 56px;
}

/* ---- Admin layout ---- */
.wk-sidebar {
    width: var(--wk-sidebar-w);
    height: 100vh;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 1030;
}

.wk-sidebar .nav-link {
    border-radius: .5rem;
    padding: .5rem .75rem;
    margin-bottom: .15rem;
}

.wk-sidebar .nav-link.active {
    background-color: var(--wk-brand);
    color: #fff;
}

.wk-sidebar .nav-link:not(.active):hover {
    background-color: rgba(125, 125, 125, .15);
}

/* Animated chevron on collapsible sidebar entries */
.wk-collapse-arrow {
    transition: transform .2s ease;
}

.wk-sidebar .nav-link.collapsed .wk-collapse-arrow {
    transform: rotate(-90deg);
}

.wk-sidebar__heading {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    opacity: .55;
    padding: .75rem .75rem .25rem;
    margin: 0;
}

.wk-main {
    margin-left: var(--wk-sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wk-content {
    flex: 1;
    padding: 1.5rem;
}

.wk-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Dark overlay shown behind the off-canvas sidebar on mobile */
.wk-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 1029;
}

@media (max-width: 991.98px) {
    .wk-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease-in-out;
        box-shadow: .25rem 0 1.5rem rgba(0, 0, 0, .3);
    }
    .wk-sidebar.show {
        transform: translateX(0);
    }
    .wk-main {
        margin-left: 0;
    }
    .wk-content {
        padding: 1rem;
    }
    .wk-sidebar-backdrop.show {
        display: block;
    }
    body.wk-sidebar-open {
        overflow: hidden;
    }
}

.wk-brand-dot {
    width: 38px;
    height: 38px;
    border-radius: .5rem;
    background: var(--wk-brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.wk-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--wk-brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    font-weight: 700;
}

.table td .btn,
.table th .btn {
    --bs-btn-padding-y: .15rem;
    --bs-btn-padding-x: .45rem;
}

/* ---- Inicio ---- */
.wk-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    border-radius: 1rem;
    color: #fff;
    background:
        radial-gradient(circle at 85% -20%, rgba(255, 255, 255, .18) 0, transparent 45%),
        linear-gradient(135deg, #5d78ff 0%, #2b3a8c 100%);
    box-shadow: 0 .75rem 2rem rgba(43, 58, 140, .25);
}

.wk-hero__fecha {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .8;
}

.wk-hero__titulo {
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 700;
}

.wk-hero__meta {
    font-size: .9rem;
    opacity: .85;
}

.wk-hero__acciones {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.wk-hero__acciones .btn {
    font-weight: 600;
    color: #2b3a8c;
}

.wk-stat {
    border-radius: .85rem;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.wk-stat:hover {
    transform: translateY(-2px);
    border-color: var(--wk-brand);
    box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .08);
}

.wk-stat__icono {
    width: 42px;
    height: 42px;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.wk-stat__ir {
    transition: color .15s ease;
}

.wk-stat:hover .wk-stat__ir {
    color: var(--wk-brand) !important;
}

.wk-stat__numero {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.wk-stat__label {
    display: block;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-decoration: none;
}

/* Por encima del stretched-link de la tarjeta para que se pueda pulsar */
.wk-stat__extra {
    position: relative;
    z-index: 2;
    display: inline-block;
    margin-top: .35rem;
    font-size: .78rem;
    text-decoration: none;
}

@media (max-width: 575.98px) {
    .wk-hero {
        padding: 1.25rem;
    }
}

/* ---- Personas ---- */
/* Neutral text with a coloured dot, so every colour stays readable in light and dark. */
.wk-persona {
    display: inline-flex;
    align-items: center;
    padding: .15rem .55rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 50rem;
    background: var(--bs-body-bg);
    font-size: .8rem;
    font-weight: 500;
    white-space: nowrap;
}

.wk-persona__dot {
    flex-shrink: 0;
    width: .6rem;
    height: .6rem;
    margin-right: .4rem;
    border-radius: 50%;
    background: var(--wk-persona, var(--bs-secondary));
}

/* "Propia" in the persona dropdown: no colour, just an outline. */
.wk-persona__dot--vacio {
    background: transparent;
    border: 1px solid var(--bs-secondary-color);
}

/* Persona dropdown: the active item keeps its dot visible on the brand background. */
.wk-persona-select .dropdown-item.active .wk-persona__dot {
    box-shadow: 0 0 0 2px #fff;
}

/* "Nuevo" badge on recently added menu entries. */
.wk-nuevo {
    margin-left: auto;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.wk-personas-filtro .btn {
    display: inline-flex;
    align-items: center;
}

/* ---- DataTables ---- */
/* Our date columns sort by a numeric `data-order` (e.g. Ymd), so DataTables
   auto-detects them as numeric/date and right-aligns the cells while flipping
   the sort arrow to the left of the header. Keep these columns left-aligned
   with the arrow on the right, consistent with every other column. */
table.dataTable thead > tr > th.dt-type-numeric,
table.dataTable thead > tr > th.dt-type-date,
table.dataTable tbody > tr > td.dt-type-numeric,
table.dataTable tbody > tr > td.dt-type-date {
    text-align: left;
}

table.dataTable thead > tr > th.dt-type-numeric div.dt-column-header,
table.dataTable thead > tr > th.dt-type-date div.dt-column-header {
    flex-direction: row;
}
