/* ==========================================================================
   Horarios: calendario del equipo, descansos y propuesta de turnos (vista "schedule").
   Usa los tokens de theme.css.
   ========================================================================== */
body[data-view="schedule"] .global-search-shell {
    display: none;
}

.sch-view {
    display: grid;
    gap: 14px;
    width: min(100%, 860px);
    margin: 0 auto;
    color: var(--g-900);
    --sch-pendiente: #d89a1d;
    --sch-aprobada: #2b9a63;
    --sch-rechazada: #c9382c;
}

.sch-loading {
    margin: 0;
    padding: 28px 8px;
    text-align: center;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
}

/* ---------- Encabezado de la pantalla de usuarios ---------- */
.sch-hero {
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
    color: #fff;
}

.sch-hero-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.16);
}

.sch-hero-icon .icon {
    width: 28px;
    height: 28px;
}

.sch-hero h2 {
    margin: 0;
    font-size: 1.7rem;
    letter-spacing: -0.02em;
}

.sch-hero p {
    margin: 0;
    max-width: 44ch;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.4;
}

/* ---------- Tarjetas ---------- */
.sch-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.sch-card h3,
.sch-card h4 {
    margin: 0;
    color: var(--g-800);
    letter-spacing: 0.02em;
}

.sch-card h3 {
    font-size: 1rem;
}

.sch-card h4 {
    margin-top: 6px;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sch-center {
    justify-items: center;
    text-align: center;
}

.sch-empty,
.sch-hint,
.sch-none {
    margin: 0;
    color: #55665f;
    font-size: 0.86rem;
    line-height: 1.4;
}

.sch-hint[hidden],
.sch-error[hidden] {
    display: none;
}

.sch-error {
    margin: 0;
    color: var(--danger-700);
    font-weight: 700;
}

.sch-banner {
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--g-50);
    border: 1px dashed var(--g-600);
    font-size: 0.86rem;
    line-height: 1.35;
}

.sch-banner--warn {
    background: #fbf0cf;
    border-color: #d89a1d;
    color: #6b4f0e;
    font-weight: 700;
}

.sch-banner--ok {
    background: #e2f4ea;
    border-color: var(--sch-aprobada);
    color: #14573a;
    font-weight: 700;
}

.sch-link {
    justify-self: start;
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--g-700);
    font: inherit;
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
}

.sch-actions {
    display: grid;
    gap: 8px;
}

.sch-actions button {
    justify-content: center;
}

.sch-actions .icon {
    width: 18px;
    height: 18px;
}

.sch-danger {
    justify-self: start;
    padding: 8px 0 0;
    border: 0;
    background: none;
    color: var(--danger-700);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

/* ---------- Usuarios ---------- */
.sch-user-grid {
    display: grid;
    gap: 8px;
}

.sch-user-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: var(--g-900);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s var(--ease-out);
}

.sch-user-card:hover {
    border-color: var(--g-600);
    transform: translateY(-1px);
}

.sch-user-copy {
    display: grid;
    min-width: 0;
}

.sch-user-copy strong,
.sch-person-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sch-user-copy small,
.sch-person-copy small,
.sch-me-copy small {
    color: #55665f;
    font-weight: 700;
}

.sch-add-button {
    justify-content: center;
    gap: 8px;
}

.sch-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--g-100);
    color: var(--g-800);
    font-weight: 800;
}

.sch-avatar--gerente {
    background: #f1dcf3;
    color: #7a2a80;
}

.sch-avatar--supervisor {
    background: #dbe7fb;
    color: #24539e;
}

.sch-avatar--barista {
    background: #d9efe3;
    color: #17653f;
}

.sch-badge {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--g-100);
    color: var(--g-800);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sch-badge--gerente {
    background: #f1dcf3;
    color: #7a2a80;
}

.sch-badge--supervisor {
    background: #dbe7fb;
    color: #24539e;
}

.sch-badge--barista {
    background: #d9efe3;
    color: #17653f;
}

/* ---------- Encabezado con el usuario y pestañas ---------- */
.sch-me {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.sch-me-copy {
    display: grid;
    min-width: 0;
}

.sch-me-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sch-icon-button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--g-800);
    cursor: pointer;
}

.sch-icon-button .icon {
    width: 20px;
    height: 20px;
}

.sch-icon-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.sch-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 6px;
    padding: 5px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.16);
}

.sch-tab {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.sch-tab .icon {
    width: 20px;
    height: 20px;
}

.sch-tab.is-selected {
    background: #fff;
    color: var(--g-800);
    box-shadow: var(--shadow-xs);
}

.sch-tab-count {
    position: absolute;
    top: 3px;
    right: 8px;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--sch-pendiente);
    color: #fff;
    font-size: 0.68rem;
    line-height: 18px;
    text-align: center;
}

/* ---------- Calendario ---------- */
.sch-month-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
}

.sch-month-head h3 {
    text-align: center;
}

.sch-weekdays,
.sch-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.sch-weekdays span {
    text-align: center;
    color: #55665f;
    font-size: 0.74rem;
    font-weight: 800;
}

.sch-day {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    justify-items: center;
    gap: 2px;
    min-height: 52px;
    padding: 5px 2px 4px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #fff;
    color: var(--g-900);
    font: inherit;
    cursor: pointer;
    transition: background-color 0.12s, border-color 0.12s;
}

.sch-day-num {
    font-weight: 800;
    font-size: 0.95rem;
}

.sch-day.is-out {
    opacity: 0.42;
}

.sch-day.is-past {
    background: #eef2f0;
    color: #6f7f78;
}

.sch-day.is-today {
    border-color: var(--g-500);
}

.sch-day.is-focus {
    box-shadow: 0 0 0 2px rgba(70, 166, 126, 0.35);
}

.sch-day.is-selected {
    background: var(--g-700);
    border-color: var(--g-700);
    color: #fff;
}

.sch-day-marks {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 14px;
}

.sch-dot {
    display: inline-block;
    flex: none;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--sch-pendiente);
}

.sch-day-marks .sch-dot {
    margin-right: 0;
}

.sch-dot--pendiente { background: var(--sch-pendiente); }
.sch-dot--aprobada { background: var(--sch-aprobada); }
.sch-dot--rechazada { background: var(--sch-rechazada); }

.sch-day.is-selected .sch-dot {
    box-shadow: 0 0 0 2px #fff;
}

.sch-count {
    display: inline-grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--g-100);
    color: var(--g-800);
    font-size: 0.68rem;
    font-weight: 800;
}

.sch-day.is-selected .sch-count {
    background: #fff;
    color: var(--g-800);
}

.sch-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0;
    color: #55665f;
    font-size: 0.78rem;
    font-weight: 700;
}

.sch-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sch-legend .sch-dot {
    margin-right: 0;
}

.sch-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.sch-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.sch-chip {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--g-100);
    color: var(--g-800);
    font-size: 0.8rem;
    font-weight: 800;
}

/* ---------- Formularios ---------- */
.sch-form {
    gap: 12px;
}

/* Contraseña: el campo y el botón "Ver" van en una sola fila. */
.sch-password {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.sch-password-toggle {
    min-width: 72px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--g-800);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

/* Texto fijo con el aspecto de un campo (por ejemplo el puesto al darse de alta). */
.sch-static {
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--g-100);
    color: var(--g-900);
    font-weight: 800;
}

/* Dirección del enlace que se comparte con el equipo. */
.sch-link-url {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--g-100);
    color: var(--g-900);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
    user-select: all;
}

.sch-field {
    display: grid;
    gap: 5px;
}

.sch-label {
    color: var(--g-800);
    font-size: 0.82rem;
    font-weight: 800;
}

.sch-segment {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--g-100);
}

.sch-segment button {
    padding: 9px 6px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--g-900);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

.sch-segment button.is-selected {
    background: var(--g-700);
    color: #fff;
}

.sch-segment button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sch-segment--small {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sch-segment--small button {
    padding: 7px 2px;
    font-size: 0.76rem;
}

.sch-stepper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sch-stepper {
    display: inline-grid;
    grid-template-columns: 40px 64px 40px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.sch-stepper button {
    height: 40px;
    border: 0;
    background: var(--g-50);
    color: var(--g-800);
    cursor: pointer;
}

.sch-stepper button .icon {
    width: 18px;
    height: 18px;
}

.sch-stepper output {
    text-align: center;
    font-weight: 800;
}

.sch-days {
    display: grid;
    gap: 8px;
}

.sch-day-pref {
    display: grid;
    gap: 4px;
}

.sch-day-name {
    font-weight: 800;
    text-transform: capitalize;
}

.sch-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sch-filter {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--g-900);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.sch-filter.is-selected {
    background: var(--g-700);
    border-color: var(--g-700);
    color: #fff;
}

/* ---------- Peticiones ---------- */
.sch-requests {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sch-request {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}

.sch-request:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.sch-request-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.sch-request-copy .sch-badge {
    justify-self: start;
}

.sch-request-copy p {
    margin: 0;
    overflow-wrap: anywhere;
}

.sch-request-copy small {
    color: #55665f;
}

.sch-status {
    font-weight: 800;
}

.sch-status--pendiente { color: #8a5c05; }
.sch-status--aprobada { color: #14703f; }
.sch-status--rechazada { color: var(--danger-700); }

.sch-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}

.sch-mini {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--g-900);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.sch-mini--ok {
    border-color: var(--sch-aprobada);
    color: #14703f;
}

.sch-mini--no {
    border-color: var(--sch-rechazada);
    color: var(--danger-700);
}

/* ---------- Equipo ---------- */
.sch-people {
    display: grid;
    gap: 10px;
}

.sch-person {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.sch-person.is-me {
    border-color: var(--g-500);
}

.sch-person header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.sch-person-copy {
    display: grid;
    min-width: 0;
}

.sch-person-pref {
    margin: 0;
    font-weight: 800;
    color: var(--g-800);
}

.sch-person small {
    color: #55665f;
}

.sch-person-requests {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.86rem;
}

.sch-person-requests .sch-dot {
    margin-right: 6px;
}

.sch-more {
    color: #55665f;
}

/* ---------- Tablas de gestión ---------- */
.sch-table-wrap {
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.sch-table {
    width: 100%;
    min-width: 640px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
}

.sch-table th,
.sch-table td {
    padding: 5px 4px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    vertical-align: middle;
}

.sch-table thead th {
    background: var(--g-50);
    color: var(--g-800);
    font-weight: 800;
    white-space: nowrap;
}

.sch-table tbody th,
.sch-table tfoot th,
.sch-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 108px;
    padding-left: 8px;
    background: #fff;
    text-align: left;
    box-shadow: 1px 0 0 var(--border);
}

.sch-table thead th:first-child {
    background: var(--g-50);
    z-index: 2;
}

.sch-th-name {
    display: block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.sch-table th small {
    display: block;
    color: #55665f;
    font-weight: 700;
}

.sch-cell {
    display: grid;
    gap: 1px;
    padding: 4px 3px;
    border-radius: 8px;
    background: #eef2f0;
    color: #55665f;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sch-cell b {
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sch-cell--apertura { background: #d8e7ff; color: #1b4a93; }
.sch-cell--post { background: #d3efec; color: #115a54; }
.sch-cell--pre { background: #fbdceb; color: #8a2557; }
.sch-cell--inter { background: #fdebc4; color: #7a5208; }
.sch-cell--cierre { background: #e5dcf8; color: #4a2d8a; }
.sch-cell--descanso { background: #fbdcdc; color: #9b2b2b; }
.sch-cell--libre { background: transparent; color: #9aa8a2; }
.sch-cell--pendiente { background: #fbf0cf; color: #6b4f0e; }
.sch-cell--aprobada { background: #d9f0e4; color: #14573a; }
.sch-cell--rechazada { background: #f6dcd9; color: #8f2118; text-decoration: line-through; }

.sch-swatch--apertura { background: #d8e7ff; }
.sch-swatch--post { background: #d3efec; }
.sch-swatch--pre { background: #fbdceb; }
.sch-swatch--inter { background: #fdebc4; }
.sch-swatch--cierre { background: #e5dcf8; }
.sch-swatch--descanso { background: #fbdcdc; }

.sch-total {
    min-width: 46px;
    color: var(--g-800);
    font-weight: 800;
    white-space: nowrap;
}

.sch-cover th {
    font-size: 0.72rem;
}

.sch-cover td {
    font-weight: 800;
}

.sch-cover td.is-low {
    background: #fbdcdc;
    color: #9b2b2b;
}

.sch-notes {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 18px;
    font-size: 0.86rem;
    line-height: 1.35;
}

.sch-notes--warn {
    color: #8f2118;
    font-weight: 700;
}

.sch-details summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--g-700);
}

/* ---------- Tipos de petición ---------- */
.sch-kind {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #fbdcdc;
    color: #9b2b2b;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 15px;
}

.sch-kind .sch-dot {
    width: 7px;
    height: 7px;
    margin-right: 0;
}

.sch-kind--apertura { background: #d8e7ff; color: #1b4a93; }
.sch-kind--post { background: #d3efec; color: #115a54; }
.sch-kind--pre { background: #fbdceb; color: #8a2557; }
.sch-kind--inter { background: #fdebc4; color: #7a5208; }
.sch-kind--cierre { background: #e5dcf8; color: #4a2d8a; }

.sch-day.is-selected .sch-kind {
    box-shadow: 0 0 0 2px #fff;
}

.sch-kind-tag {
    display: inline-block;
    padding: 0 8px;
    border-radius: 999px;
    background: #fbdcdc;
    color: #9b2b2b;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 18px;
    vertical-align: 1px;
}

.sch-kind-tag--apertura { background: #d8e7ff; color: #1b4a93; }
.sch-kind-tag--post { background: #d3efec; color: #115a54; }
.sch-kind-tag--pre { background: #fbdceb; color: #8a2557; }
.sch-kind-tag--inter { background: #fdebc4; color: #7a5208; }
.sch-kind-tag--cierre { background: #e5dcf8; color: #4a2d8a; }

.sch-segment--wrap {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.sch-kind-choice.is-selected {
    background: var(--g-700);
    color: #fff;
}

.sch-filter.is-recommended:not(.is-selected) {
    border-color: var(--g-500);
}

.sch-cell.is-requested {
    outline: 2px solid var(--g-700);
    outline-offset: -2px;
}

/* ---------- Peticiones pendientes agrupadas por persona ---------- */
.sch-groups {
    display: grid;
    gap: 12px;
}

.sch-group {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
}

.sch-group-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.sch-group-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sch-group-copy h4 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0;
    text-transform: none;
    overflow-wrap: anywhere;
}

.sch-group-copy small {
    color: #55665f;
    font-weight: 700;
}

.sch-group-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sch-group-row {
    display: grid;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--g-50);
}

.sch-group-row-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sch-group-reason {
    flex-basis: 100%;
    overflow-wrap: anywhere;
}

.sch-group-bulk {
    padding-top: 4px;
    border-top: 1px dashed var(--border);
}

.sch-hero--compact {
    gap: 4px;
}

.sch-hero--compact .sch-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
}

/* ---------- Descargas ---------- */
.sch-export {
    display: grid;
    gap: 10px;
}

.sch-export-row {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
}

.sch-export-copy {
    display: grid;
}

.sch-export-copy small {
    color: #55665f;
    font-weight: 700;
}

.sch-export-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.sch-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 6px;
    border: 0;
    border-radius: 12px;
    background: var(--g-700);
    color: #fff;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
}

.sch-export-btn .icon {
    width: 16px;
    height: 16px;
}

.sch-export-btn--plain {
    background: var(--g-100);
    color: var(--g-800);
}

@media (min-width: 720px) {
    .sch-export-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 330px);
        align-items: center;
    }
}

/* ---------- Hoja "Imagen lista" / "PDF listo" (celular) ---------- */
.sch-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(4, 31, 23, 0.55);
}

.sch-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 91;
    display: grid;
    gap: 10px;
    box-sizing: border-box;
    width: min(100%, 520px);
    max-height: 92vh;
    margin-inline: auto;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    background: var(--surface-strong);
    box-shadow: var(--shadow-lg);
}

.sch-sheet h3 {
    margin: 0;
    text-align: center;
    color: var(--g-800);
}

.sch-sheet-preview {
    justify-self: center;
    max-width: 100%;
    max-height: 38vh;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
    -webkit-touch-callout: default;
}

.sch-sheet .sch-link {
    justify-self: center;
}

/* ---------- Pantallas grandes ---------- */
@media (min-width: 720px) {
    .sch-user-grid,
    .sch-people {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sch-actions {
        grid-auto-flow: column;
        grid-auto-columns: max-content;
    }

    .sch-day {
        min-height: 62px;
    }

    .sch-table {
        min-width: 0;
    }
}

html.perf-lite .sch-user-card,
html.perf-lite .sch-day {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .sch-user-card,
    .sch-day {
        transition: none;
    }
}

/* ---------- Bitácora, permiso de administración y respaldo ---------- */
.sch-audit {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.sch-audit-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--g-50);
    font-size: 0.86rem;
    line-height: 1.35;
}

.sch-audit-row time {
    color: #55665f;
    font-size: 0.78rem;
    font-weight: 800;
}

.sch-admin-tag {
    justify-self: start;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fbf0cf;
    color: #6b4f0e;
    font-size: 0.74rem;
    font-weight: 800;
}

/* ---------- Calendario: marcas compactas (caben en casillas de 35 a 48 px) ---------- */
/* La etiqueta del tipo de petición (propia) va debajo del número, angosta, con su estado como un puntito
   pegado a la esquina; el contador de peticiones de otras personas es una insignia en la esquina de la
   casilla. Así nada cambia de altura ni se sale de la casilla en el celular. */
.sch-day {
    overflow: hidden;
}

.sch-day .sch-day-marks {
    max-width: 100%;
    min-width: 0;
}

.sch-day .sch-kind {
    position: relative;
    justify-content: center;
    gap: 0;
    min-width: 0;
    max-width: 100%;
    padding: 1px 4px;
    font-size: 0.62rem;
    letter-spacing: 0;
    line-height: 14px;
    white-space: nowrap;
}

.sch-day .sch-kind .sch-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 7px;
    height: 7px;
    margin: 0;
    box-shadow: 0 0 0 1.5px #fff;
}

.sch-day .sch-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    font-size: 0.6rem;
    line-height: 1;
}

.sch-day.is-selected .sch-kind .sch-dot {
    box-shadow: 0 0 0 1.5px var(--g-700);
}

.sch-day-num {
    line-height: 1.2;
}

@media (max-width: 359px) {
    .sch-day .sch-count {
        top: 1px;
        right: 1px;
        min-width: 12px;
        height: 12px;
        padding: 0 2px;
        font-size: 0.55rem;
    }
}

.sch-chip.is-selected {
    background: var(--g-700);
    color: #fff;
}

/* ---------- Avisos dentro de la app (campanita) ---------- */
.sch-me {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
}

.sch-bell {
    position: relative;
}

.sch-bell.is-open {
    background: var(--g-100);
}

.sch-bell-count {
    position: absolute;
    top: -4px;
    right: -4px;
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--surface-strong);
}

.sch-notices-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sch-notice-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sch-notice {
    display: grid;
    gap: 2px;
    padding: 9px 11px;
    border-radius: 12px;
    background: #f3f6f4;
    color: var(--g-900);
    font-size: 0.88rem;
    line-height: 1.35;
}

.sch-notice small {
    color: #55665f;
    font-size: 0.74rem;
    font-weight: 700;
}

.sch-notice.is-new {
    background: #e3f3ea;
    box-shadow: inset 3px 0 0 var(--g-500);
}

/* ---------- Cobertura al aprobar ---------- */
.sch-impact {
    display: grid;
    gap: 3px;
    margin-top: 6px;
    padding: 7px 9px;
    border-radius: 10px;
    background: #fff4dd;
    color: #6d4a07;
    font-size: 0.8rem;
    line-height: 1.35;
}

.sch-impact--warn {
    background: #fde4e1;
    color: #8a2a21;
}

.sch-impact ul {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0 0 0 16px;
}

/* El aviso de cobertura al aprobar lista una razón por renglón. */
#confirm-message {
    white-space: pre-line;
}

/* ---------- Vacaciones, "No disponible" y reparto del mes ---------- */
.sch-kind--vacaciones,
.sch-kind-tag--vacaciones,
.sch-cell--vacaciones {
    background: #d4eef3;
    color: #0b5d70;
}

.sch-swatch--vacaciones { background: #d4eef3; }
.sch-swatch--nodisp { background: #e4e7e6; }

.sch-cell--nodisp {
    background: #e4e7e6;
    color: #4f5d58;
    font-style: italic;
}

.sch-avail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #55665f;
    font-size: 0.78rem;
}

.sch-avail > span {
    flex-basis: 100%;
    font-weight: 800;
}

.sch-avail-btn {
    padding: 3px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #eef2f0;
    color: var(--g-800);
    font-size: 0.76rem;
    font-weight: 800;
}

.sch-avail-btn.is-selected {
    background: #4f5d58;
    color: #fff;
}

.sch-table--fair {
    min-width: 520px;
}

.sch-table--fair td.is-high {
    background: #fde4e1;
    color: #8a2a21;
    font-weight: 800;
}

.sch-table--fair td.is-low {
    background: #dfeaf9;
    color: #1b4a93;
    font-weight: 800;
}

/* ---------- Filtros de la bitácora ---------- */
.sch-audit-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}

.sch-audit-filters .sch-link {
    grid-column: 1 / -1;
    justify-self: start;
}

/* Con 4 pestañas (Peticiones, Propuesta, Reparto, Bitácora) en pantallas angostas el texto debe poder encogerse. */
.sch-segment button {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 400px) {
    .sch-segment button {
        padding-inline: 3px;
        font-size: 0.8rem;
    }
}

.sch-stepper-row > .sch-label {
    min-width: 0;
}

/* ---------- Copias dentro de la aplicación ---------- */
.sch-backups {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sch-backups li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f3f6f4;
    font-size: 0.86rem;
}

.sch-backups small {
    display: block;
    color: #55665f;
    font-size: 0.74rem;
    font-weight: 700;
}

/* ---------- Horario publicado y edición de celdas ---------- */
button.sch-cell {
    display: block;
    width: 100%;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.sch-cell.is-editing {
    outline: 2px solid var(--g-700);
    outline-offset: 1px;
}

.sch-cell-editor {
    border: 2px solid var(--g-500);
}

.sch-cell-editor .sch-chips {
    margin: 8px 0;
}

.sch-myweek {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sch-myday {
    border-radius: 14px;
    background: #f3f6f4;
}

.sch-myday.is-today {
    box-shadow: inset 0 0 0 2px var(--g-500);
}

.sch-myday > button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--g-900);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sch-myday-date em {
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--g-700);
    color: #fff;
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 800;
}

.sch-myday-shift {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sch-myday-shift small {
    color: #55665f;
    font-weight: 700;
}

.sch-myday-shift .sch-cell {
    display: inline-block;
    width: auto;
    padding: 3px 10px;
}

.sch-whoworks {
    display: grid;
    gap: 6px;
    padding: 0 12px 12px;
}

.sch-who {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
}

.sch-who small {
    color: #55665f;
}

.sch-who .is-me {
    font-weight: 800;
}

.sch-table--roster {
    min-width: 560px;
}

.sch-table--roster tr.is-me th,
.sch-table--roster tr.is-me td {
    background: #e6f3ec;
}

/* ---------- Cambios de turno ---------- */
.sch-swapbox {
    display: grid;
    gap: 8px;
    margin: 0 12px 12px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    justify-items: start;
}

.sch-swapbox--form {
    justify-items: stretch;
}

.sch-swapbox .sch-hint {
    margin: 0;
}

.sch-swap-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sch-swap {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--g-300, #c9d2cd);
    border-radius: 12px;
    background: #fff;
    font-size: 0.88rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.sch-swap--abierta { border-left-color: #2f6fbf; }
.sch-swap--aceptada { border-left-color: #c58a07; }
.sch-swap--aprobada { border-left-color: var(--sch-aprobada); }
.sch-swap--rechazada { border-left-color: var(--sch-rechazada); }

.sch-swap-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--g-100);
    color: var(--g-800);
    font-size: 0.72rem;
    font-weight: 800;
    vertical-align: 1px;
}

.sch-swap-note {
    display: block;
    color: #55665f;
}

.sch-swap .sch-hint {
    margin: 0;
}

/* ---------- Avisos por WhatsApp ---------- */
.sch-wa {
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.sch-wa .sch-hint {
    margin: 0;
}

.sch-wa-facts {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0 0 0 18px;
    font-size: 0.86rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

[data-sch-wa-card] .sch-banner small {
    display: block;
    margin-top: 4px;
    opacity: 0.85;
}

/* ---------- Mi horario en UKG ---------- */
.sch-ukg-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sch-ukg-day {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--sch-aprobada);
    border-radius: 12px;
    background: #fff;
    font-size: 0.9rem;
}

.sch-ukg-day.is-today {
    background: #e6f3ec;
}

.sch-ukg-day.is-other {
    border-left-color: #c58a07;
}

.sch-ukg-date em {
    margin-left: 4px;
    color: #14703f;
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 800;
}

.sch-ukg-time {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    font-weight: 800;
}

.sch-ukg-time small {
    color: #55665f;
    font-size: 0.78rem;
    font-weight: 700;
}

.sch-ukg-tag {
    padding: 1px 8px;
    border-radius: 999px;
    background: #fff4dd;
    color: #6d4a07;
    font-size: 0.74rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* ---------- Horario del equipo desde UKG ---------- */
.sch-ukg-share {
    display: grid;
    gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.sch-ukg-share h4 {
    margin: 0;
}

.sch-ukg-share .sch-hint,
.sch-ukg-share .sch-banner {
    margin: 0;
}

.sch-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
}

.sch-check input {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.sch-segment--small button {
    font-size: 0.82rem;
}
