:root {
    --bz-bg: #0a0a0a;
    --bz-bg-soft: #141414;
    --bz-card: #1a1a1a;
    --bz-border: #2a2a2a;
    --bz-green: #1e5c1e;
    --bz-green-light: #2f8a2f;
    --bz-brown: #4a2a1c;
    --bz-brown-light: #6b3d28;
    --bz-gray: #555555;
    --bz-gray-light: #707070;
    --bz-white: #ffffff;
    --bz-text: #f2f2f2;
    --bz-text-muted: #b5b5b5;
    --bz-header-bg: #c9c9c9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bz-bg);
    color: var(--bz-text);
    font-family: 'Poppins', 'Segoe UI', Helvetica, Arial, sans-serif;
    min-height: 100vh;
}

/* ---------- Login ---------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 15%, rgba(30, 92, 30, 0.18), transparent 45%),
        radial-gradient(circle at 80% 85%, rgba(74, 42, 28, 0.18), transparent 45%),
        var(--bz-bg);
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--bz-card);
    border: 1px solid var(--bz-border);
    border-radius: 18px;
    padding: 40px 36px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.login-logo {
    max-width: 180px;
    margin-bottom: 24px;
}

.login-title {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.login-subtitle {
    color: var(--bz-text-muted);
    font-size: 0.9rem;
    margin: 0 0 28px;
}

.login-form {
    text-align: left;
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bz-text-muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--bz-border);
    background: var(--bz-bg-soft);
    color: var(--bz-text);
    font-size: 0.95rem;
    font-family: inherit;
}

.field input:focus {
    outline: none;
    border-color: var(--bz-green-light);
    box-shadow: 0 0 0 3px rgba(47, 138, 47, 0.25);
}

.form-error {
    background: rgba(74, 42, 28, 0.35);
    border: 1px solid var(--bz-brown-light);
    color: #f2c9b4;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    text-align: left;
}

.form-error p {
    margin: 0;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 999px;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
    filter: brightness(1.12);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--bz-green);
    color: var(--bz-white);
}

.btn-ghost {
    background: transparent;
    color: var(--bz-text-muted);
    border: 1px solid var(--bz-border);
}

.btn-ghost:hover {
    color: var(--bz-white);
    border-color: var(--bz-gray-light);
}

/* ---------- Dashboard ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: var(--bz-header-bg);
}

.topbar .btn-ghost {
    background: #141414;
    color: var(--bz-white);
    border-color: #141414;
}

.topbar .btn-ghost:hover {
    background: var(--bz-border);
    border-color: var(--bz-border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    color: #141414;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
}

.home-link:hover {
    background: rgba(0, 0, 0, 0.16);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-actions .btn {
    text-decoration: none;
}

.text-link {
    color: #555555;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 8px;
    transition: color 0.15s ease;
}

.text-link:hover {
    color: #141414;
    text-decoration: underline;
}

.topbar-brand img {
    height: 36px;
    display: block;
}

.dashboard {
    padding: 56px 32px;
    max-width: 960px;
    margin: 0 auto;
}

.dashboard-title {
    font-weight: 800;
    font-size: 2rem;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.dashboard-subtitle {
    color: var(--bz-text-muted);
    margin: 0 0 36px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.tile {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-radius: 18px;
    text-align: center;
    text-decoration: none;
    color: var(--bz-white);
    font-weight: 800;
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, filter 0.15s ease;
}

.tile:hover {
    transform: translateY(-4px);
    filter: brightness(1.15);
}

.tile-green {
    background: var(--bz-green);
}

.tile-brown {
    background: var(--bz-brown);
}

.tile-gray {
    background: var(--bz-gray);
}

.tile-white {
    background: var(--bz-white);
    color: var(--bz-green);
}

.back-link {
    display: inline-block;
    color: var(--bz-text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.back-link:hover {
    color: var(--bz-white);
}

/* ---------- Administrador de usuarios ---------- */

.table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bz-card);
    border: 1px solid var(--bz-border);
    border-radius: 12px;
    overflow: hidden;
}

.user-table th,
.user-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bz-border);
    text-align: center;
}

.user-table th:first-child,
.user-table td:first-child {
    text-align: left;
}

.user-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bz-text-muted);
}

.user-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--bz-green-light);
}

.tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bz-green);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-actions .btn {
    text-decoration: none;
}

.form-success {
    background: rgba(30, 92, 30, 0.3);
    border: 1px solid var(--bz-green-light);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.form-card {
    max-width: 480px;
    background: var(--bz-card);
    border: 1px solid var(--bz-border);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.field-help {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: var(--bz-text-muted);
}

.field-error {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: #a3341c;
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field .check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--bz-text);
    margin: 0;
    cursor: pointer;
}

.check input {
    width: 18px;
    height: 18px;
    accent-color: var(--bz-green-light);
}

.form-card .form-actions {
    margin-top: 8px;
}

/* ---------- Tema claro (páginas interiores) ---------- */

.theme-light {
    --bz-bg: #f4f5f2;
    --bz-bg-soft: #f0f1ed;
    --bz-card: #ffffff;
    --bz-border: #e0e2dc;
    --bz-gray: #9a9a9a;
    --bz-text: #1c1c1c;
    --bz-text-muted: #5f6360;
}

.theme-light .card,
.theme-light .filter,
.theme-light .kpi,
.theme-light .user-table {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.theme-light main .btn-ghost:hover {
    color: var(--bz-text);
}

.theme-light .back-link {
    color: #3d413e;
}

.theme-light .back-link:hover {
    color: var(--bz-text);
}

.theme-light .tag {
    color: var(--bz-white);
}

.theme-light .data-table tbody tr:nth-child(odd) {
    background: #f6f7f4;
}

/* ---------- Dashboard de producción ---------- */

.dashboard-wide {
    max-width: 1440px;
    padding-top: 32px;
}

.dashboard-wide .dashboard-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
}

.filter {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bz-card);
    border: 1px solid var(--bz-green);
    border-radius: 12px;
    padding: 10px 12px;
}

.filter > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bz-text-muted);
}

.filter select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--bz-border);
    background: var(--bz-bg-soft);
    color: var(--bz-text);
    font-family: inherit;
    font-size: 0.8rem;
}

/* El ancho de cada filtro no depende del texto elegido (los nombres largos se cortan con "…") */
.filter {
    min-width: 0;
}

.filter .ts-wrapper,
.filter .ts-control,
.filter select {
    min-width: 0;
    max-width: 100%;
}

.filter .ts-control > .item,
.ts-resumen {
    min-width: 0;
    flex: 0 1 auto;
}

/* Desplegables con buscador (Tom Select) */
.filter .ts-wrapper {
    font-size: 0.8rem;
}

.filter .ts-control {
    min-height: 0;
    padding: 6px 28px 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--bz-border);
    background: var(--bz-bg-soft);
    color: var(--bz-text);
    font-size: 0.8rem;
    box-shadow: none;
    white-space: nowrap;
    overflow: hidden;
}

.filter .ts-wrapper.single .ts-control,
.filter .ts-wrapper.single.input-active .ts-control {
    background: var(--bz-bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center;
    cursor: pointer;
}

.filter .ts-control > .item {
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter .ts-wrapper.focus .ts-control {
    border-color: var(--bz-green-light);
    box-shadow: none;
}

/* Selección múltiple: una sola línea con un resumen ("P3: Pala" o "3 seleccionados") en vez de una etiqueta por opción */
.filter .ts-wrapper.multi .ts-control {
    flex-wrap: nowrap;
    background: var(--bz-bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center;
    cursor: pointer;
}

.filter .ts-wrapper.multi .ts-control > .item {
    display: none;
}

.filter .ts-wrapper.multi .ts-control,
.filter .ts-wrapper.multi.has-items .ts-control {
    padding: 6px 28px 6px 8px;
}

.filter .ts-wrapper.multi .ts-control > input {
    min-width: 0;
    font-size: 0.8rem;
}

.filter .ts-wrapper.multi.has-items .ts-control > input:not(:focus) {
    width: 0;
    flex: 0 0 0;
}

.ts-resumen {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--bz-green);
}

.ts-resumen:empty {
    display: none;
}

.ts-dropdown .option input[type="checkbox"] {
    margin-right: 6px;
    accent-color: var(--bz-green-light);
}

.ts-dropdown {
    font-size: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--bz-border);
    background: var(--bz-card);
    color: var(--bz-text);
    min-width: 240px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.ts-dropdown .dropdown-input {
    border-bottom: 1px solid var(--bz-border);
    padding: 8px 10px;
    font-family: inherit;
}

.ts-dropdown .dropdown-input:focus {
    outline: none;
}

.ts-dropdown .active {
    background: rgba(47, 138, 47, 0.12);
    color: var(--bz-text);
}

.ts-dropdown .selected {
    font-weight: 600;
}

.filter select:focus {
    outline: none;
    border-color: var(--bz-green-light);
}

.kpi {
    flex: 1 1 170px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--bz-green);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bz-card);
    text-align: center;
}

.kpi-label {
    background: var(--bz-green);
    color: var(--bz-white);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 6px;
}

.kpi-value {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    padding: 6px 12px;
}

.dash-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.dash-grid-top {
    grid-template-columns: 1fr 1fr;
}

.dash-grid-bottom {
    grid-template-columns: 1.2fr 1fr 1fr;
}

.dash-grid-personal-top {
    grid-template-columns: 1.7fr 1fr 0.9fr;
}

.dash-grid-personal-bottom {
    grid-template-columns: 2fr 1fr;
}

.card {
    background: var(--bz-card);
    border: 1px solid var(--bz-green);
    border-radius: 12px;
    padding: 14px 16px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.card-title {
    margin: 0 0 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chart-box {
    position: relative;
    height: 280px;
}

.card-scroll {
    height: 300px;
    overflow-y: auto;
}

.bar-box {
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.data-table th,
.data-table td {
    padding: 5px 8px;
    text-align: left;
}

.data-table .num {
    text-align: right;
    white-space: nowrap;
}

.data-table thead th {
    position: sticky;
    top: 0;
    background: var(--bz-card);
    color: var(--bz-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--bz-gray);
}

.data-table tbody tr:nth-child(odd) {
    background: var(--bz-bg-soft);
}

.data-table tfoot td {
    position: sticky;
    bottom: 0;
    background: var(--bz-card);
    font-weight: 700;
    border-top: 1px solid var(--bz-gray);
}

.data-table .empty {
    text-align: center;
    color: var(--bz-text-muted);
    padding: 24px;
}

/* ---------- Fichas de persona ---------- */

.filter-search input {
    width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--bz-border);
    background: var(--bz-bg-soft);
    color: var(--bz-text);
    font-family: inherit;
    font-size: 0.85rem;
}

.filter-search input:focus {
    outline: none;
    border-color: var(--bz-green-light);
}

.filter.filter-search {
    flex: 2 1 260px;
}

.table-scroll {
    overflow-x: auto;
}

.people-table {
    font-size: 0.8rem;
}

.people-table td,
.people-table th {
    padding: 9px 10px;
    white-space: nowrap;
}

.people-table a {
    color: var(--bz-text);
    font-weight: 600;
    text-decoration: none;
}

.row-link {
    cursor: pointer;
}

.row-link:hover td {
    background: rgba(47, 138, 47, 0.08);
}

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-ok { background: rgba(47, 138, 47, 0.14); color: #1e5c1e; }
.badge-off { background: rgba(163, 52, 28, 0.12); color: #a3341c; }
.badge-info { background: var(--bz-green); color: var(--bz-white); }
.badge-soft { background: var(--bz-bg-soft); color: var(--bz-text-muted); border: 1px solid var(--bz-border); }

.ficha-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ficha-nav .back-link {
    margin: 0;
}

.ficha-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bz-text-muted);
}

.ficha-switch .ts-wrapper {
    width: 300px;
    text-transform: none;
}

.ficha-switch .ts-control {
    border-radius: 8px;
    font-size: 0.85rem;
}

.ficha-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.ficha-avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bz-green);
    color: var(--bz-white);
    font-size: 1.6rem;
    font-weight: 800;
}

.ficha-main {
    flex: 1 1 280px;
    min-width: 0;
}

.ficha-name {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ficha-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ficha-datos {
    display: grid;
    grid-template-columns: repeat(3, minmax(130px, auto));
    gap: 10px 28px;
    margin: 0;
}

.ficha-datos dt,
.vac-datos dt {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bz-text-muted);
}

.ficha-datos dd,
.vac-datos dd {
    margin: 2px 0 0;
    font-size: 0.88rem;
    font-weight: 600;
}

.ficha-anio {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bz-text-muted);
}

.ficha-anio select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--bz-green);
    background: var(--bz-card);
    font-family: inherit;
    font-weight: 600;
}

.ficha-kpis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.ficha-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--bz-card);
    border: 1px solid var(--bz-border);
    border-left: 4px solid var(--bz-green);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ficha-kpi.is-alert {
    border-left-color: #a3341c;
}

.ficha-kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bz-text-muted);
}

.ficha-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
}

.ficha-kpi.is-alert .ficha-kpi-value {
    color: #a3341c;
}

.ficha-grid-top {
    grid-template-columns: 2fr 1fr;
}

.ficha-grid-mid {
    grid-template-columns: 1.6fr 1fr;
}

.ficha-grid-bottom {
    grid-template-columns: 1fr 1fr 1.2fr;
}

.card-note {
    margin: -4px 0 10px;
    font-size: 0.75rem;
    color: var(--bz-text-muted);
}

.vac-box {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 8px;
}

.vac-bar {
    height: 14px;
    border-radius: 999px;
    background: var(--bz-bg-soft);
    border: 1px solid var(--bz-border);
    overflow: hidden;
}

.vac-fill {
    height: 100%;
    background: var(--bz-green-light);
}

.vac-fill.is-over {
    background: #a3341c;
}

.vac-datos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0;
}

.vac-datos .is-ok dd { color: #1e5c1e; }
.vac-datos .is-alert dd { color: #a3341c; }

.check-ok {
    color: var(--bz-green-light);
    font-weight: 800;
}

.check-no,
.muted {
    color: var(--bz-text-muted);
}

.mini-chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .ficha-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .ficha-grid-top,
    .ficha-grid-mid,
    .ficha-grid-bottom {
        grid-template-columns: 1fr;
    }

    .ficha-datos {
        grid-template-columns: repeat(2, 1fr);
    }
}

.notice-mark {
    color: #b8860b;
    cursor: help;
}

/* ---------- Actualizar datos ---------- */

.datos-page .card {
    margin-bottom: 24px;
}

.upload-box {
    gap: 14px;
}

.drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 34px 20px;
    border: 2px dashed var(--bz-green-light);
    border-radius: 12px;
    background: rgba(47, 138, 47, 0.04);
    color: var(--bz-green);
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.drop-zone:hover,
.drop-zone.is-over {
    background: rgba(47, 138, 47, 0.1);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-title {
    font-weight: 700;
    color: var(--bz-text);
}

.drop-hint {
    font-size: 0.78rem;
    color: var(--bz-text-muted);
}

.drop-files {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bz-green);
}

.upload-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
}

.upload-results li {
    padding: 10px 12px;
    border-radius: 8px;
}

.upload-results li.is-ok {
    background: rgba(47, 138, 47, 0.08);
}

.upload-results li.is-error {
    background: rgba(163, 52, 28, 0.08);
    color: #7a2614;
}

.upload-msg {
    margin-top: 4px;
    font-size: 0.8rem;
}

.datos-table td {
    vertical-align: top;
    padding: 10px;
}

.small {
    font-size: 0.75rem;
}

.restore-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.restore-form select {
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid var(--bz-border);
    background: var(--bz-bg-soft);
    font-family: inherit;
    font-size: 0.75rem;
}

/* Título de página con acciones a la derecha (p. ej. "Borrar filtros") */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.page-head .dashboard-title {
    margin: 0;
}

.tag-off {
    background: #a3341c;
}

.table-link {
    color: var(--bz-green);
    font-size: 0.8rem;
    font-weight: 600;
}

.icon-delete {
    display: inline-flex;
    padding: 6px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #a3341c;
    cursor: pointer;
}

.icon-delete:hover {
    background: rgba(163, 52, 28, 0.1);
}

.missing-list {
    margin: 0 0 24px;
    padding-left: 20px;
    line-height: 1.9;
}

/* ---------- Planificación ---------- */

.filter-bar-compact {
    gap: 8px;
}

.filter-bar-compact .filter {
    flex: 1 1 110px;
    padding: 8px 10px;
}

.filter-bar-compact .kpi {
    flex: 0 0 140px;
}

.filter-bar-compact .kpi-value {
    font-size: 1.3rem;
}

.plan-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.plan-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-size: 0.72rem;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: opacity 0.15s ease;
}

.legend-chip:hover {
    border-color: #555555;
}

.legend-chip.is-active {
    border-color: #1c1c1c;
}

.legend-chip.is-dim {
    opacity: 0.45;
}

.plan-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 7px 14px;
    font-size: 0.72rem;
    text-decoration: none;
}

.plan-card {
    padding: 0;
    overflow: hidden;
}

.plan-wrap {
    overflow: auto;
    max-height: 70vh;
}

.plan-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
    white-space: nowrap;
}

.plan-table thead th {
    position: sticky;
    background: #0b4a1f;
    color: #ffffff;
    font-weight: 600;
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
}

.plan-table thead th.plan-period {
    font-size: 0.85rem;
    font-weight: 700;
}

.plan-weekday {
    display: block;
    font-size: 0.62rem;
    font-weight: 400;
    opacity: 0.75;
}

.plan-table .plan-group {
    border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.plan-table th.plan-day {
    min-width: 46px;
    text-align: right;
}

.plan-table th.plan-day.is-weekend {
    background: #2c6b3d;
}

.plan-table .plan-name {
    position: sticky;
    left: 0;
    min-width: 260px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
    background: var(--bz-card);
    border-right: 1px solid var(--bz-border);
}

.plan-table thead .plan-name {
    z-index: 3;
    background: #0b4a1f;
}

.plan-table td {
    padding: 3px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.plan-table .plan-cell {
    text-align: right;
}

.plan-table td.is-weekend {
    background: #f6f7f4;
}

.plan-table .plan-total {
    position: sticky;
    right: 0;
    z-index: 1;
    min-width: 72px;
    text-align: right;
    font-weight: 700;
    background: var(--bz-card);
    border-left: 1px solid var(--bz-border);
    box-shadow: -4px 0 6px -4px rgba(0, 0, 0, 0.18);
}

.plan-table thead th.plan-total {
    z-index: 3;
    background: #0b4a1f;
}

.plan-sub td.plan-total {
    font-weight: 600;
    background: #f6f7f4;
}

.plan-person td {
    font-weight: 700;
    background: #ffffff;
}

.plan-person td.plan-name {
    font-weight: 700;
}

.plan-sub td.plan-name {
    padding-left: 34px;
    font-weight: 600;
    background: #f6f7f4;
}

.plan-toggle {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    padding: 0;
    border: 1px solid var(--bz-gray);
    border-radius: 4px;
    background: #ffffff;
    color: var(--bz-text);
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--bz-text-muted);
}

@media (max-width: 860px) {
    .tile-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1100px) {
    .dash-grid-top,
    .dash-grid-bottom,
    .dash-grid-personal-top,
    .dash-grid-personal-bottom {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .dashboard-wide {
        padding: 24px 16px;
    }

    .tile-grid {
        grid-template-columns: 1fr;
    }

    .tile {
        aspect-ratio: auto;
        min-height: 120px;
    }

    .topbar {
        padding: 14px 16px;
    }

    .login-card {
        padding: 32px 24px;
    }
}
