/* ============================================================ */
/* CRONOGRAMA DE PERSONAL (msch-*)                              */
/* Diseño coherente con el tema violeta del modal admin.        */
/* ============================================================ */

/* ---- Panel de sucursales ---- */
.msch-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 14px;
    border-bottom: 1.5px solid #ede9fe;
    margin-bottom: 14px;
}
.msch-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.msch-panel-title > i {
    font-size: 26px;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 8px;
    border-radius: 10px;
}
.msch-panel-title-main {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
}
.msch-panel-title-sub {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: capitalize;
}
.msch-panel-actions {
    display: flex;
    gap: 8px;
}

/* ---- Grid de cards de sucursales ---- */
.msch-suc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    padding: 4px;
}
.msch-suc-card {
    background: #fff;
    border: 1.5px solid #ede9fe;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 4px rgba(91, 33, 182, 0.05);
}
.msch-suc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91, 33, 182, 0.12);
    border-color: #c4b5fd;
}
.msch-suc-card-active {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25), 0 2px 8px rgba(91, 33, 182, 0.12);
}
.msch-suc-card-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #fff;
    flex-shrink: 0;
    animation: mschPulseActive 2s ease-in-out infinite;
}
.msch-suc-card-active-badge i {
    font-size: 16px;
}
@keyframes mschPulseActive {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.msch-suc-card-header {
    padding: 10px 12px;
    color: #fff;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
}
.msch-suc-card-icon {
    font-size: 22px;
    opacity: 0.9;
    flex-shrink: 0;
}
.msch-suc-card-head-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}
.msch-suc-card-title {
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msch-suc-card-type {
    font-size: 0.62rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msch-suc-card-body {
    padding: 10px 14px 14px;
    background: #faf8ff;
}
.msch-suc-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #374151;
    margin-top: 6px;
}
.msch-suc-stat i {
    font-size: 16px;
    color: #7c3aed;
}
.msch-suc-stat strong {
    color: #5B21B6;
    margin-left: auto;
    font-weight: 700;
}
.msch-suc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}
.msch-suc-meta i {
    font-size: 13px;
    color: #a78bfa;
}

.msch-suc-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.msch-suc-status-draft {
    background: #fef3c7;
    color: #92400e;
}
.msch-suc-status-published {
    background: #d1fae5;
    color: #065f46;
}
.msch-suc-status-archived {
    background: #e5e7eb;
    color: #4b5563;
}
.msch-suc-status-none {
    background: #f3f4f6;
    color: #6b7280;
}

/* ---- Editor de sucursal ---- */
.msch-editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 4px 14px;
    border-bottom: 1.5px solid #ede9fe;
    margin-bottom: 12px;
}
.msch-btn-back {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(124, 58, 237, 0.08);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    color: #7c3aed;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.msch-btn-back:hover {
    background: rgba(124, 58, 237, 0.15);
}
.msch-btn-back i {
    font-size: 18px;
}
.msch-editor-header-info {
    flex: 1;
}
.msch-editor-header-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}
.msch-editor-header-name i {
    color: #7c3aed;
}
.msch-editor-header-sub {
    font-size: 0.78rem;
    color: #6b7280;
}

/* ---- Selector de sucursal en el editor (reemplaza el header "Cronograma del mes") ---- */
.msch-editor-header-selector {
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 4px 4px 10px;
    margin-bottom: 10px;
}
.msch-sucursal-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #faf8ff 0%, #f5f3ff 100%);
    border: 1.5px solid #ede9fe;
    border-radius: 8px;
    padding: 4px 8px 4px 10px;
    min-width: 220px;
    flex: 1;
    max-width: 420px;
    box-shadow: 0 1px 3px rgba(91, 33, 182, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.msch-sucursal-selector:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10);
}
.msch-sucursal-selector-icon {
    color: #7c3aed;
    font-size: 20px !important;
    flex-shrink: 0;
}
.msch-sucursal-selector-wrap {
    flex: 1;
    min-width: 0;
}
.msch-sucursal-selector-input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2937;
    padding: 0;
    line-height: 1.25;
    cursor: pointer;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-overflow: ellipsis;
}
.msch-sucursal-selector-input:hover {
    color: #5B21B6;
}
.msch-sucursal-selector-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(91, 33, 182, 0.25);
}
.msch-sucursal-selector-badge i.material-icons {
    font-size: 11px !important;
}
.msch-editor-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .msch-editor-header-selector {
        padding: 4px 4px 8px;
    }
    .msch-sucursal-selector {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }
    .msch-editor-header-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ---- Sub-pestañas ---- */
.msch-sub-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid #ede9fe;
    margin-bottom: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}
.msch-sub-tabs::-webkit-scrollbar {
    display: none;
}
.msch-sub-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.msch-sub-tab:hover {
    color: #7c3aed;
    background: #faf8ff;
}
.msch-sub-tab-active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
    font-weight: 600;
}
.msch-sub-tab i {
    font-size: 18px;
}

.msch-sub-content {
    padding: 4px;
    overflow-x: hidden;
}

/* ---- Encabezados de sección ---- */
.msch-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}
.msch-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1f2937;
}
.msch-section-title i {
    color: #7c3aed;
    font-size: 20px;
}
.msch-section-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #ede9fe;
}

/* ---- Botones ---- */
.msch-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 1px 4px rgba(91, 33, 182, 0.18);
}
.msch-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
    box-shadow: 0 4px 10px rgba(91, 33, 182, 0.3);
}
.msch-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.msch-btn-primary i {
    font-size: 16px;
}
.msch-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    color: #7c3aed;
    border: 1.5px solid #ddd6fe;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}
.msch-btn-secondary:hover {
    background: #f5f3ff;
    border-color: #c4b5fd;
}
.msch-btn-secondary i {
    font-size: 16px;
}
.msch-btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
}
.msch-btn-sm i {
    font-size: 15px;
}

.msch-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---- Lista de asignaciones ---- */
.msch-assignments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.msch-assignment-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid #ede9fe;
    border-radius: 10px;
    transition: all 0.15s;
}
.msch-assignment-row:hover {
    background: #faf8ff;
    border-color: #ddd6fe;
}
.msch-assignment-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 38px;
    padding: 0 10px;
    border: 1.5px solid;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
}
.msch-assignment-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.msch-assignment-user-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.88rem;
}
.msch-assignment-user-meta {
    font-size: 0.72rem;
    color: #6b7280;
}
.msch-assignment-role {
    color: #7c3aed;
    font-weight: 500;
}

/* ---- Horarios de turnos ---- */
.msch-time-configs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.msch-time-row {
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1.5px solid #ede9fe;
    border-radius: 10px;
}
.msch-time-row:nth-child(odd) {
    background: #faf8ff;
}
.msch-time-hours {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.85rem;
    color: #6b7280;
}
.msch-time-hours input {
    width: 100px;
}
.msch-time-overlap {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 0.78rem;
    color: #6b7280;
}
.msch-time-color {
    width: 32px;
    height: 32px;
    padding: 2px;
    border: 1.5px solid #ddd6fe;
    border-radius: 6px;
    cursor: pointer;
}

.msch-time-presets {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 14px;
    padding: 10px;
    background: #f5f3ff;
    border-radius: 8px;
    flex-wrap: wrap;
}
.msch-preset-label {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 600;
}
.msch-preset-btn {
    padding: 4px 10px;
    background: #fff;
    color: #7c3aed;
    border: 1.5px solid #ddd6fe;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.msch-preset-btn:hover {
    background: #ede9fe;
    border-color: #c4b5fd;
}

/* ---- Grilla del cronograma ---- */
.msch-grid-wrapper {
    background: #fff;
    border: 1.5px solid #ede9fe;
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    overflow-x: hidden;
}
.msch-schedule-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #faf8ff;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #374151;
}
.msch-schedule-meta i {
    color: #7c3aed;
    vertical-align: middle;
    margin-right: 4px;
    font-size: 16px;
}
.msch-schedule-meta-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Botón de eliminar cronograma borrador (junto al chip "BORRADOR") */
.msch-btn-delete-draft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1.5px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.msch-btn-delete-draft:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #fca5a5;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.2);
}
.msch-btn-delete-draft:disabled {
    cursor: wait;
    opacity: 0.6;
}
.msch-btn-delete-draft .material-icons {
    font-size: 18px;
    margin: 0;
    color: #dc2626;
}

/* Variante roja del botón confirm de SweetAlert, para acciones
   destructivas (ej: eliminar cronograma). */
.swal-modern-confirm-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25) !important;
}
.swal-modern-confirm-danger:hover {
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35) !important;
    transform: translateY(-1px) !important;
}

.msch-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.msch-legend-item {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}
/* Los turnos (M/T/N) usan un estilo neutro común: el color en el cronograma
   queda reservado exclusivamente para identificar a cada usuario. */
.msch-legend-shift {
    background: #faf8ff;
    color: #5B21B6;
    border: 1px solid #ede9fe;
}
.msch-legend-franco {
    background: #f3f4f6;
    color: #4b5563;
}
.msch-legend-sc {
    background: #fee2e2;
    color: #991b1b;
}

/* ---- Leyenda de usuarios (chips con color personalizable) ---- */
.msch-users-legend {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 2px 0 12px;
}
.msch-user-chip-wrap {
    position: relative;
}
.msch-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 6px;
    border-radius: 999px;
    border: 1.5px solid #ddd6fe;
    background: #faf8ff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    line-height: 1.2;
}
.msch-user-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(91, 33, 182, 0.14);
}
.msch-user-chip-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.msch-user-chip strong {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
}
.msch-user-chip-name {
    font-weight: 500;
}

/* Botón para activar/desactivar los nombres dentro del cronograma.
   Se ubica al final de la fila de chips de usuarios. */
.msch-toggle-names {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1.5px solid #ddd6fe;
    background: #faf8ff;
    color: #5B21B6;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    line-height: 1.2;
}
.msch-toggle-names:hover {
    background: #f5f3ff;
    box-shadow: 0 3px 10px rgba(91, 33, 182, 0.14);
    transform: translateY(-1px);
}
.msch-toggle-names .material-icons {
    font-size: 16px;
}
.msch-toggle-names-off {
    background: #fff;
    border-color: #e5e7eb;
    color: #6b7280;
}
.msch-toggle-names-off:hover {
    background: #f9fafb;
}

/* Popover de paleta */
.msch-color-picker {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    min-width: 220px;
    max-width: 260px;
    padding: 10px;
    background: #fff;
    border: 1.5px solid #ede9fe;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(91, 33, 182, 0.18);
    animation: mschColorPickerFade 0.15s ease;
}
@keyframes mschColorPickerFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msch-color-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.75rem;
    color: #6b7280;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ede9fe;
}
.msch-color-picker-header strong {
    color: #5B21B6;
    font-weight: 700;
}
.msch-color-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}
.msch-color-swatch {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 26px;
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.12s ease;
}
.msch-color-swatch:hover:not(:disabled) {
    transform: scale(1.1);
}
.msch-color-swatch:disabled {
    cursor: wait;
    opacity: 0.6;
}
.msch-color-swatch-selected {
    box-shadow: 0 0 0 2px #5B21B6, 0 0 0 4px #fff;
}
.msch-color-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 6px 10px;
    background: #faf8ff;
    border: 1px solid #ede9fe;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #5B21B6;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease;
}
.msch-color-reset:hover:not(:disabled) {
    background: #ede9fe;
}
.msch-color-reset .material-icons {
    font-size: 16px;
}
.msch-color-reset:disabled {
    cursor: wait;
    opacity: 0.6;
}

.msch-grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    table-layout: fixed;
}
.msch-grid-table thead th {
    padding: 8px 6px;
    background: #faf8ff;
    color: #7c3aed;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #ede9fe;
    text-align: center;
}
.msch-grid-th-day {
    width: 60px;
}
/* Encabezados de turnos (MAÑANA / TARDE / NOCHE / FRANCO): alineados a la
   izquierda para coincidir con el borde izquierdo del pill del body.
   El padding-left 5px = padding del td (4) + margen del entry (1), que es
   donde arranca el rectángulo coloreado del pill (visualmente lo que
   marca la columna). */
.msch-grid-th-shift,
.msch-grid-th-franco {
    text-align: left !important;
    padding-left: 5px !important;
}
.msch-grid-th-shift {
    color: #5B21B6;
}
.msch-grid-td-cell {
    text-align: left;
}
.msch-grid-th-franco {
    width: 90px;
    color: #4b5563;
}
.msch-grid-table tbody td {
    padding: 4px 4px;
    border-bottom: 1px solid #f3f0ff;
    vertical-align: top;
}
.msch-grid-row-weekend {
    background: rgba(124, 58, 237, 0.03);
}
.msch-grid-td-day {
    text-align: center;
    font-weight: 600;
    color: #5B21B6;
    min-width: 50px;
}
.msch-grid-td-day strong {
    display: block;
    font-size: 0.95rem;
}
.msch-grid-td-day small {
    color: #9ca3af;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
}
.msch-grid-td-cell {
    min-width: 0;
    padding: 4px;
    cursor: pointer;
    transition: background 0.15s;
    overflow: hidden;
}
.msch-grid-td-cell:hover {
    background: #f5f3ff;
}

.msch-cell-entry {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    margin: 1px 0;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}
.msch-cell-entry strong {
    font-weight: 700;
}
.msch-cell-franco {
    background: #f3f4f6;
    color: #4b5563;
}
.msch-cell-sc {
    color: #dc2626;
    font-style: italic;
    font-weight: 600;
}

/* =====================================================
   Responsive: pantallas chicas (móvil / tablet angosta)
   La tabla NUNCA desborda el contenedor: usamos
   table-layout: fixed + width 100% y las 4 columnas de
   turnos (MAÑANA/TARDE/NOCHE/FRANCO) se reparten
   equitativamente el ancho disponible. Si algún pill no
   cabe, se trunca con ellipsis.
   ===================================================== */
@media (max-width: 768px) {
    /* Reducir padding horizontal del contenedor del modal para aprovechar
       todo el ancho disponible en móvil. */
    .mpt-body {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
    .msch-sub-content {
        padding: 2px;
    }
    .msch-grid-wrapper {
        padding: 6px;
    }
    .msch-grid-table {
        table-layout: fixed;
        width: 100%;
        font-size: 0.72rem;
    }
    .msch-grid-table thead th {
        padding: 6px 3px;
        font-size: 0.65rem;
        letter-spacing: 0.2px;
    }
    .msch-grid-th-day {
        width: 36px;
    }
    .msch-grid-th-franco {
        width: auto;
    }
    .msch-grid-th-shift,
    .msch-grid-th-franco {
        padding-left: 4px !important;
    }
    .msch-grid-table tbody td {
        padding: 3px 2px;
        overflow: hidden;
    }
    .msch-grid-td-cell {
        min-width: 0;
        padding: 3px 2px;
    }
    .msch-grid-td-day {
        min-width: 0;
        width: 36px;
    }
    .msch-grid-td-day strong {
        font-size: 0.85rem;
    }
    .msch-grid-td-day small {
        font-size: 0.55rem;
    }
    .msch-cell-entry {
        padding: 2px 5px;
        margin: 1px 0;
        font-size: 0.65rem;
        gap: 3px;
        max-width: 100%;
        overflow: hidden;
    }
    .msch-cell-entry strong {
        font-size: 0.65rem;
        flex-shrink: 0;
    }
    .msch-cell-entry > span:not(.msch-cell-sc),
    .msch-cell-line > span:not(.msch-cell-sc):not(.msch-swap-hint) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
    /* Leyendas y meta también compactan su tipografía */
    .msch-legend-item,
    .msch-user-chip {
        font-size: 0.68rem;
        padding: 3px 8px 3px 5px;
    }
}

/* Pantallas muy chicas: mantenemos los nombres visibles (el usuario
   los puede ocultar manualmente con el toggle "Ocultar nombres"). Si
   el nombre no cabe en la celda, se corta con ellipsis gracias a las
   reglas del media (max-width: 768px). */
@media (max-width: 480px) {
    .msch-grid-table thead th {
        font-size: 0.6rem;
    }
    .msch-cell-entry {
        padding: 2px 4px;
        font-size: 0.6rem;
        gap: 2px;
    }
}

/* ---- Toolbar: botones compactos (Plantillas / Export) ---- */
.msch-btn-icon-only {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
}
.msch-btn-icon-only .material-icons {
    font-size: 18px;
}
.msch-btn-icon-only .mpt-spinner {
    width: 14px;
    height: 14px;
    border-width: 2px;
}
.msch-export-group {
    display: inline-flex;
    gap: 4px;
    padding: 0 4px;
    border-left: 1px solid #ede9fe;
    border-right: 1px solid #ede9fe;
}
/* Ocultar label de los botones compactos en pantallas angostas */
@media (max-width: 900px) {
    .msch-btn-label-hide {
        display: none;
    }
}

/* ---- Drag & Drop del cronograma ---- */
.msch-dnd-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 10px 0 12px;
    background: linear-gradient(135deg, #faf8ff 0%, #f5f3ff 100%);
    border: 1px dashed #c4b5fd;
    border-radius: 8px;
    color: #5B21B6;
    font-size: 0.78rem;
    font-weight: 500;
}
.msch-dnd-hint .material-icons {
    font-size: 18px;
    color: #7c3aed;
}
.msch-cell-entry[draggable="true"] {
    cursor: grab;
    user-select: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.msch-cell-entry[draggable="true"]:hover {
    box-shadow: 0 2px 6px rgba(91, 33, 182, 0.18);
    transform: translateY(-1px);
}
.msch-cell-entry[draggable="true"]:active {
    cursor: grabbing;
}
.msch-cell-dragging {
    opacity: 0.35;
    filter: grayscale(40%);
}
.msch-dropzone-hover {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%) !important;
    outline: 2px dashed #7c3aed;
    outline-offset: -3px;
}
.msch-dropzone-hover .msch-cell-entry {
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.35);
}

/* Resaltado de celdas tras "Ver en cronograma" desde Pendientes.
   - .msch-cell-swap-pulse: animación de glow 500ms × 3 (1.5s total).
   - .msch-cell-swap-highlight: borde permanente hasta que el usuario
     clickee otra celda no involucrada. */
.msch-cell-swap-highlight {
    position: relative;
    z-index: 1;
    box-shadow: inset 0 0 0 2px #7c3aed, 0 0 0 1px rgba(124, 58, 237, 0.18);
    background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%) !important;
}
.msch-cell-swap-highlight.msch-grid-td-franco {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%) !important;
}
.msch-cell-swap-pulse {
    animation: msch-cell-swap-pulse 500ms ease-in-out 3;
}
@keyframes msch-cell-swap-pulse {
    0%   { box-shadow: inset 0 0 0 2px #7c3aed, 0 0 0 0 rgba(124, 58, 237, 0.55); }
    50%  { box-shadow: inset 0 0 0 3px #7c3aed, 0 0 0 8px rgba(124, 58, 237, 0); }
    100% { box-shadow: inset 0 0 0 2px #7c3aed, 0 0 0 0 rgba(124, 58, 237, 0); }
}
.msch-grid-td-franco {
    background: #faf8ff;
}

/* ---- Badges en el editor de plantilla ---- */
.msch-cell-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}
.msch-cell-badge-m {
    background: #dcfce7;
    color: #166534;
}
.msch-cell-badge-t {
    background: #dbeafe;
    color: #1e40af;
}
.msch-cell-badge-n {
    background: #f3e8ff;
    color: #6b21a8;
}
.msch-cell-badge-f {
    background: #fee2e2;
    color: #991b1b;
}
.msch-cell-badge-sc {
    background: #f3f4f6;
    color: #6b7280;
    font-style: italic;
}
.msch-cell-badge-empty {
    background: transparent;
    color: #d1d5db;
}

/* ---- Biblioteca de plantillas ---- */
.msch-library-float {
    max-width: 780px;
    width: 95%;
}
.msch-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}
.msch-template-card {
    background: #fff;
    border: 1.5px solid #ede9fe;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.15s;
}
.msch-template-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.08);
}
.msch-template-system {
    background: linear-gradient(180deg, #faf8ff 0%, #fff 100%);
    border-color: #ddd6fe;
}
.msch-template-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}
.msch-template-card-header > i {
    font-size: 20px;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 6px;
    border-radius: 8px;
}
.msch-template-name {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.9rem;
    line-height: 1.2;
}
.msch-template-scope {
    margin-top: 4px;
}
.msch-template-badge-system,
.msch-template-badge-global,
.msch-template-badge-sucursal {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.msch-template-badge-system {
    background: #ede9fe;
    color: #5B21B6;
}
.msch-template-badge-global {
    background: #dbeafe;
    color: #1e40af;
}
.msch-template-badge-sucursal {
    background: #dcfce7;
    color: #166534;
}
.msch-template-card-body {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 8px;
    line-height: 1.35;
}
.msch-template-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 10px;
    padding: 6px 0;
    border-top: 1px dashed #ede9fe;
}
.msch-template-card-meta i {
    font-size: 13px;
    color: #a78bfa;
    margin-right: 4px;
    vertical-align: middle;
}
.msch-template-card-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ---- Editor de plantilla ---- */
.msch-template-editor-float {
    max-width: 980px;
    width: 98%;
    height: 92vh;
    display: flex;
    flex-direction: column;
}
.msch-template-editor-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.msch-template-editor-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.msch-editor-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.msch-template-grid-section {
    background: #faf8ff;
    border: 1.5px solid #ede9fe;
    border-radius: 10px;
    padding: 10px;
}
.msch-template-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.msch-template-grid-header strong {
    color: #5B21B6;
}
.msch-template-grid-hint {
    font-size: 0.72rem;
    color: #6b7280;
    font-style: italic;
}
.msch-template-grid-wrapper {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #ede9fe;
    border-radius: 6px;
}
.msch-template-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    background: #fff;
}
.msch-template-grid thead th {
    position: sticky;
    top: 0;
    background: #f5f3ff;
    color: #7c3aed;
    padding: 6px;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    text-align: center;
    z-index: 1;
    border-bottom: 1.5px solid #ddd6fe;
}
.msch-template-grid tbody td {
    text-align: center;
    padding: 3px;
    border-bottom: 1px solid #f3f0ff;
}
.msch-template-grid-day {
    background: #faf8ff;
    font-weight: 600;
    color: #5B21B6;
}
.msch-template-grid-cell {
    cursor: pointer;
    transition: background 0.1s;
}
.msch-template-grid-cell:hover {
    background: #ede9fe;
}

/* ---- Switches ---- */
.msch-switch-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
}
.msch-switch-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #7c3aed;
    cursor: pointer;
}

.msch-config-form {
    max-width: 540px;
}
.msch-config-form .mpt-form-group {
    margin-bottom: 14px;
}
.msch-config-form small {
    display: block;
    color: #6b7280;
    font-size: 0.72rem;
    margin-top: 3px;
}

.msch-profile-form {
    max-width: 760px;
}
.msch-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}
.msch-profile-full {
    grid-column: 1 / -1;
}
@media (max-width: 767px) {
    .msch-profile-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Perfil de sucursal (spf-*) ---- */
.spf-root {
    width: 100%;
    max-width: none;
    padding: 2px 2px 6px;
}
.spf-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(300px, 1.05fr);
    gap: 12px;
    align-items: stretch;
}
.spf-layout--profile {
    display: block;
    width: 100%;
    max-width: none;
}
#modalPosTypes .spf-layout--profile + .spim-root,
.spf-root .spim-root {
    width: 100%;
    max-width: none;
    margin-top: 4px;
}
.spf-layout--billing {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: none;
}
.spf-billing-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 12px 16px;
}
.spf-billing-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 12px;
}
.spf-arca-fiscal-host {
    width: 100%;
}
.spf-cred-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 10px 16px;
    align-items: stretch;
}
.spf-cred-col--fiscal {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.spf-cred-col--fiscal .spf-arca-fiscal-host,
.spf-cred-col--fiscal .afc-root,
.spf-cred-col--fiscal .afc-stack {
    flex: 1;
    min-height: 0;
}
.spf-cred-col--cert {
    min-width: 0;
    padding-left: 16px;
    border-left: 1px solid #ede9fe;
    display: flex;
    flex-direction: column;
}
.spf-cred-col--cert .spf-cert-status {
    margin-bottom: 6px;
}
.spf-cred-col--cert .spf-cert-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    min-height: 0;
}
.spf-cred-col--cert .spf-cert-label {
    margin-bottom: 4px;
}
.spf-cred-col--cert .spf-cert-file,
.spf-cred-col--cert .spf-cert-dropzone {
    flex: 1;
}
.spf-card-subtitle {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 2px;
    line-height: 1.3;
}
.spf-card-head-icon--arca {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}
.spf-hint--arca {
    margin: 0 0 12px;
}
.spf-card--arca .spf-card-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.spf-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #7c3aed;
    padding: 0;
    cursor: pointer;
    vertical-align: middle;
}
.spf-info-btn .material-icons {
    font-size: 20px;
}
.spf-info-btn:hover {
    background: #f5f3ff;
    color: #5B21B6;
}
.spf-card--arca.spf-card--pulse {
    animation: spf-arca-pulse 500ms ease-in-out 3;
    box-shadow: inset 0 0 0 2px #7c3aed, 0 0 0 1px rgba(124, 58, 237, 0.18);
}
@keyframes spf-arca-pulse {
    0%   { box-shadow: inset 0 0 0 2px #7c3aed, 0 0 0 0 rgba(124, 58, 237, 0.55); }
    50%  { box-shadow: inset 0 0 0 3px #7c3aed, 0 0 0 8px rgba(124, 58, 237, 0); }
    100% { box-shadow: inset 0 0 0 2px #7c3aed, 0 0 0 0 rgba(124, 58, 237, 0); }
}
.spf-cert-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.spf-cert-grid--single {
    grid-template-columns: 1fr;
    max-width: 420px;
}
.spf-cert-key-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f5f3ff;
    color: #5B21B6;
    font-size: 0.78rem;
    font-weight: 600;
}
.spf-cert-key-hint .material-icons {
    font-size: 16px;
    opacity: 0.85;
}
.spf-cert-label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5B21B6;
}
.spf-cert-label .material-icons {
    font-size: 15px;
    opacity: 0.85;
}
.spf-cert-btn--wsaa {
    flex-shrink: 0;
    background: linear-gradient(135deg, #5B21B6, #7c3aed);
    border: none;
    color: #fff;
    padding: 6px 12px;
}
.spf-cert-btn--wsaa:hover:not(:disabled) {
    background: linear-gradient(135deg, #4c1d95, #6d28d9);
    border: none;
    color: #fff;
}
.spf-cert-btn--wsaa:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.spf-cert-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 72px;
    padding: 12px;
    border: 1.5px dashed #c4b5fd;
    border-radius: 10px;
    background: #faf8ff;
    color: #5B21B6;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.spf-cert-dropzone:hover:not(:disabled) {
    border-color: #7c3aed;
    background: #f5f3ff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}
.spf-cert-dropzone:disabled {
    opacity: 0.7;
    cursor: wait;
}
.spf-cert-dropzone .material-icons {
    font-size: 28px;
    color: #7c3aed;
}
.spf-cert-dropzone-title {
    font-size: 0.84rem;
    font-weight: 600;
}
.spf-cert-dropzone-hint {
    font-size: 0.72rem;
    color: #6b7280;
    text-align: center;
}
.spf-cert-input-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}
.spf-cert-file {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding: 8px 10px;
    border: 1.5px solid #ddd6fe;
    border-radius: 10px;
    background: #fff;
}
.spf-cert-file-main {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}
.spf-cert-file-icon {
    font-size: 22px;
    color: #16a34a;
    flex-shrink: 0;
}
.spf-cert-file-text {
    min-width: 0;
}
.spf-cert-file-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1f2937;
    word-break: break-all;
}
.spf-cert-file-meta {
    margin-top: 2px;
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.35;
}
.spf-cert-meta-subido {
    color: #059669;
    font-weight: 600;
}
.spf-cert-meta-vence {
    color: #7c3aed;
    font-weight: 600;
}
.spf-cert-meta-sep {
    color: #9ca3af;
}
.spf-cert-test-msg {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-top: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.35;
}
.spf-cert-test-msg .material-icons {
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}
.spf-cert-test-msg--ok {
    color: #047857;
}
.spf-cert-test-msg--err {
    color: #b91c1c;
}
.spf-cert-btn--probar {
    width: auto;
    min-width: 0;
    padding: 0 8px;
    gap: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #5B21B6;
}
.spf-cert-btn--probar .material-icons {
    font-size: 16px;
}
.spf-cert-file-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: auto;
}
.spf-cert-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 7px;
    background: #faf8ff;
    color: #5B21B6;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.spf-cert-btn .material-icons {
    font-size: 15px;
}
.spf-cert-btn:hover:not(:disabled) {
    background: #f5f3ff;
    border-color: #c4b5fd;
}
.spf-cert-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.spf-cert-btn--danger {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
    padding: 5px 8px;
}
.spf-cert-btn--danger:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #fca5a5;
}
.spf-cert-spinner {
    width: 22px;
    height: 22px;
}
.spf-cert-status {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.4;
}
.spf-cert-status .material-icons {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}
.spf-cert-status--ok {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.spf-cert-status--ok .material-icons {
    color: #16a34a;
}
.spf-cert-status--warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.spf-cert-status--warn .material-icons {
    color: #d97706;
}
.spf-cert-status--muted {
    background: #faf8ff;
    border: 1px solid #ede9fe;
    color: #6b7280;
}
.spf-cert-status--muted .material-icons {
    color: #7c3aed;
}
.spf-card--profile {
    overflow: visible;
    position: relative;
    z-index: 1;
}
.spf-card--profile.spf-card--suggestions-open {
    z-index: 120;
}
.spf-card-body--profile {
    padding: 0;
}
.spf-profile-fields {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 10px;
    padding: 8px 12px 6px;
    border-bottom: 1px solid #f3f0ff;
    background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
}
.spf-profile-section-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 12px 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1d4ed8;
}
.spf-profile-section-label .material-icons {
    font-size: 16px;
}
.spf-card--profile .spf-location-split {
    grid-template-columns: minmax(220px, 38%) minmax(0, 1fr);
    min-height: clamp(150px, 22vh, 210px);
    border-top: 1px solid #f3f0ff;
}
@media (min-width: 992px) {
    .spf-profile-fields {
        grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(160px, 0.85fr);
        gap: 8px 12px;
        padding: 10px 14px 8px;
    }
    .spf-card--profile .spf-location-split {
        grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
        min-height: clamp(168px, 20vh, 220px);
    }
    .spf-location-meta-fields {
        gap: 10px;
    }
}
.spf-card--profile .spf-map-block {
    min-height: 100%;
    background: #eef2ff;
}
.spf-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.spf-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.spf-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
    box-shadow: 0 8px 24px rgba(91, 33, 182, 0.22);
    color: #fff;
}
.spf-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.spf-hero-icon .material-icons {
    font-size: 28px;
    color: #fff;
}
.spf-hero-kicker {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.82;
    font-weight: 600;
}
.spf-hero-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 2px;
}
.spf-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.spf-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.72rem;
    font-weight: 600;
}
.spf-meta-line {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.76rem;
    opacity: 0.92;
}
.spf-meta-line .material-icons {
    font-size: 14px;
}
.spf-card {
    border: 1.5px solid #ede9fe;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(91, 33, 182, 0.06);
    overflow: hidden;
}
.spf-card.spf-card--location {
    overflow: visible;
    position: relative;
    z-index: 1;
}
.spf-card.spf-card--location.spf-card--suggestions-open,
.spf-card.spf-card--profile.spf-card--suggestions-open {
    z-index: 120;
}
.spf-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #faf8ff 0%, #fff 100%);
    border-bottom: 1px solid #f3f0ff;
}
.spf-card-head--compact {
    padding: 8px 12px;
    background: linear-gradient(135deg, #faf8ff 0%, #f5f3ff 100%);
}
.spf-card-head-text {
    flex: 1;
    min-width: 0;
}
.spf-autosave-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #059669;
    flex-shrink: 0;
}
.spf-autosave-chip .material-icons {
    font-size: 16px;
}
.spf-card-head-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #5B21B6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.spf-card-head-icon .material-icons {
    font-size: 20px;
}
.spf-card-head-icon--maps {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}
.spf-card-head-icon--billing {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #059669;
}
.spf-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #5B21B6;
}
.spf-card-sub {
    font-size: 0.74rem;
    color: #6b7280;
    margin-top: 1px;
}
.spf-card-body {
    padding: 14px 16px 16px;
}
.spf-card-body--compact {
    padding: 10px 12px 12px;
}
.spf-card-body--flush {
    padding: 0;
}
.spf-card--general,
.spf-card--location {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.spf-card--location .spf-card-body--flush {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.spf-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}
.spf-field-full {
    grid-column: 1 / -1;
}
.spf-field label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7c3aed;
    margin-bottom: 2px;
}
.spf-field label .material-icons {
    font-size: 14px;
    opacity: 0.85;
}
.spf-input,
.spf-select {
    width: 100%;
    border: 1.5px solid #ddd6fe;
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 0.84rem;
    color: #1f2937;
    background: #faf8ff;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.spf-input:focus,
.spf-select:focus {
    outline: none;
    border-color: #7c3aed;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.spf-input:disabled,
.spf-input.spf-input--derived {
    background: #f5f3ff;
    border-color: #e9e5ff;
    color: #374151;
    cursor: default;
    opacity: 1;
    box-shadow: none;
}
.spf-field--derived {
    margin-bottom: 0;
}
.spf-field--derived label {
    font-size: 0.68rem;
}
.spf-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.35;
}
.spf-hint-warn {
    color: #b45309;
}
.spf-field-control {
    position: relative;
}
.spf-location-split {
    display: grid;
    grid-template-columns: minmax(140px, 42%) minmax(0, 1fr);
    min-height: clamp(128px, 20vh, 168px);
    height: 100%;
}
.spf-location-side {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
    padding: 8px 10px;
    border-left: 1px solid #f3f0ff;
    background: #fff;
    min-width: 0;
}
.spf-location-panel {
    margin: 0 16px 16px;
    border: 1.5px solid #ddd6fe;
    border-radius: 12px;
    overflow: visible;
    background: #faf8ff;
}
.spf-location-body {
    padding: 12px 14px 10px;
    position: relative;
    z-index: 2;
}
.spf-card--location .spf-map-block {
    width: 100%;
    max-width: none;
    margin: 0;
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: #eef2ff;
    min-height: 100%;
}
.spf-input--location {
    background: #fff;
    border-color: #e9e5ff;
}
.spf-location-panel .spf-address-field {
    margin-bottom: 0;
}
.spf-map-block {
    position: relative;
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: #eef2ff;
}
.spf-location-fields {
    padding-top: 0 !important;
}
.spf-address-field {
    margin-bottom: 0;
}
.spf-address-input-wrap {
    position: relative;
    z-index: 5;
}
.spf-address-input-wrap.spf-address-suggestions-open {
    z-index: 200;
}
.spf-address-form {
    margin: 0;
    padding: 0;
}
.spf-autofill-trap {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
    padding: 0;
    margin: 0;
    border: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}
.spf-address-form .spf-input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}
.spf-address-input-wrap .spf-map-search-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
}
.spf-location-meta-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}
.spf-address-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1.5px solid #ede9fe;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(91, 33, 182, 0.22);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100050;
}
.spf-address-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 0.8rem;
    color: #374151;
    line-height: 1.35;
    border-bottom: 1px solid #f3f0ff;
}
.spf-address-suggestion:last-child {
    border-bottom: none;
}
.spf-address-suggestion .material-icons {
    font-size: 18px;
    color: #7c3aed;
    flex-shrink: 0;
    margin-top: 1px;
}
.spf-address-suggestion:hover,
.spf-address-suggestion-active {
    background: #f5f3ff;
    color: #5B21B6;
}

/* Indicador de autoguardado por campo (spinner → check verde) */
.spf-field-indicator {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    z-index: 9999;
    pointer-events: none;
}
.spf-field-spinner {
    background: #fff;
    border: 2.5px solid #ede9fe;
    border-top-color: #7c3aed;
    box-shadow: 0 1px 4px rgba(91, 33, 182, 0.25);
    animation: spfFieldSpin .6s linear infinite;
}
@keyframes spfFieldSpin { to { transform: rotate(360deg); } }
.spf-field-check {
    background: #10b981;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.5);
    animation: spfFieldCheckPop .25s ease;
}
.spf-field-check i { font-size: 16px; }
@keyframes spfFieldCheckPop {
    0% { transform: scale(0); }
    60% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.spf-map-canvas {
    width: 100%;
    height: 100%;
    min-height: clamp(128px, 20vh, 168px);
    background: #e5e7eb;
    z-index: 1;
}
.spf-map-canvas .leaflet-container {
    font-family: inherit;
}
.spf-map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(250, 248, 255, 0.88);
    color: #7c3aed;
    font-size: 0.75rem;
    font-weight: 600;
}
.spf-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}
.spf-btn-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(91, 33, 182, 0.28);
    transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.spf-btn-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(91, 33, 182, 0.34);
}
.spf-btn-save:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.spf-btn-save .material-icons {
    font-size: 18px;
}

/* ---- Perfil: aprovechar alto del viewport (tablet/desktop; mobile sin cambios) ---- */
@media (min-width: 768px) {
    #modalPosTypes .mpt-body.mpt-body--perfil-fit {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-top: 0;
        padding-bottom: 4px;
        min-height: 0;
    }
    #modalPosTypes .mpt-body.mpt-body--perfil-fit .mpt-cronograma-root--perfil-fit {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    #modalPosTypes .mpt-body.mpt-body--perfil-fit .msch-sucursal-editor--perfil-fit {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    #modalPosTypes .mpt-body.mpt-body--perfil-fit .msch-editor-header-selector {
        flex-shrink: 0;
        padding: 0 4px 4px;
        margin-bottom: 4px;
    }
    #modalPosTypes .spf-root--fit {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0 2px 2px;
    }
    #modalPosTypes .spf-root--fit.msch-sub-content {
        padding: 0 2px;
    }
    #modalPosTypes .spf-layout--fit {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    #modalPosTypes .spf-layout--fit .spf-card--profile {
        flex: 0 1 48%;
        min-height: 0;
        max-height: 52%;
        display: flex;
        flex-direction: column;
    }
    #modalPosTypes .spf-layout--fit .spf-card-body--profile {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    #modalPosTypes .spf-layout--fit .spf-card-head--compact {
        padding: 6px 12px;
    }
    #modalPosTypes .spf-layout--fit .spf-profile-fields {
        flex-shrink: 0;
        padding: 6px 10px 4px;
        gap: 5px 8px;
    }
    #modalPosTypes .spf-layout--fit .spf-profile-section-label {
        flex-shrink: 0;
        padding: 1px 10px 0;
    }
    #modalPosTypes .spf-layout--fit .spf-card--profile .spf-location-split {
        flex: 1 1 auto;
        min-height: 0;
        grid-template-columns: minmax(200px, 32%) minmax(0, 1fr);
    }
    #modalPosTypes .spf-layout--fit .spf-card--profile .spf-map-block {
        min-height: 0;
        position: relative;
    }
    #modalPosTypes .spf-layout--fit .spf-map-canvas {
        min-height: 0 !important;
        height: 100%;
    }
    #modalPosTypes .spf-layout--fit .spf-location-side {
        padding: 6px 8px;
        gap: 4px;
    }
    #modalPosTypes .spf-layout--fit .spf-input,
    #modalPosTypes .spf-layout--fit .spf-select {
        padding: 5px 8px;
        font-size: 0.82rem;
    }
    #modalPosTypes .spf-layout--fit .spf-field label {
        margin-bottom: 2px;
        font-size: 0.68rem;
    }
    #modalPosTypes .spf-layout--fit > .spim-root {
        flex: 1 1 auto;
        min-height: 0;
        margin-top: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    #modalPosTypes .spf-root--fit .spim-root {
        flex: 1 1 auto;
        min-height: 0;
        margin-top: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    #modalPosTypes .spf-root--fit .spim-head {
        flex-shrink: 0;
        margin-bottom: 4px;
    }
    #modalPosTypes .spf-root--fit .spim-head-title {
        font-size: 0.86rem;
    }
    #modalPosTypes .spf-root--fit .spim-dnd-hint {
        flex-shrink: 0;
        margin: 0 0 6px;
        padding: 5px 10px;
        font-size: 0.72rem;
    }
    #modalPosTypes .spf-root--fit .spim-tabs {
        flex-shrink: 0;
        margin-bottom: 4px;
    }
    #modalPosTypes .spf-root--fit .spim-tab {
        padding: 5px 10px;
        font-size: 0.78rem;
    }
    #modalPosTypes .spf-root--fit .spim-type-block {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 6px 10px;
    }
    #modalPosTypes .spf-root--fit .spim-type-head {
        flex-shrink: 0;
        margin-bottom: 4px;
    }
    #modalPosTypes .spf-root--fit .spim-type-head > i {
        font-size: 20px;
    }
    #modalPosTypes .spf-root--fit .spim-type-title {
        font-size: 0.82rem;
    }
    #modalPosTypes .spf-root--fit .spim-type-desc {
        font-size: 0.68rem;
    }
    #modalPosTypes .spf-root--fit .spim-banks {
        flex: 1 1 auto;
        min-height: 0;
        gap: 8px;
        align-items: stretch;
        grid-template-rows: minmax(0, 1fr);
    }
    #modalPosTypes .spf-root--fit .spim-bank {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    #modalPosTypes .spf-root--fit .spim-bank-title {
        flex-shrink: 0;
        margin-bottom: 2px;
    }
    #modalPosTypes .spf-root--fit .spim-grid {
        flex: 1 1 auto;
        min-height: 0 !important;
        padding: 4px;
        gap: 5px;
        align-content: start;
        overflow-y: auto;
        overflow-x: hidden;
    }
    #modalPosTypes .spf-root--fit .spim-card {
        max-width: none;
        justify-self: stretch;
    }
}

@media (min-width: 992px) {
    #modalPosTypes .spf-layout--fit .spf-card--profile {
        flex-basis: 46%;
        max-height: 50%;
    }
    #modalPosTypes .spf-layout--fit .spf-card--profile .spf-location-split {
        grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    }
}

@media (min-width: 768px) and (max-height: 820px) {
    #modalPosTypes .spf-layout--fit .spf-card--profile {
        flex-basis: 44%;
        max-height: 46%;
    }
    #modalPosTypes .spf-layout--fit .spf-profile-fields {
        padding: 5px 8px 3px;
    }
    #modalPosTypes .spf-root--fit .spim-type-block {
        padding: 5px 8px;
    }
}

@media (min-width: 768px) and (max-height: 680px) {
    #modalPosTypes .spf-layout--fit .spf-card--profile {
        flex-basis: 40%;
        max-height: 42%;
    }
    #modalPosTypes .spf-layout--fit .spf-card-head--compact {
        padding: 4px 10px;
    }
    #modalPosTypes .spf-root--fit .spim-dnd-hint {
        padding: 4px 8px;
        margin-bottom: 4px;
    }
}

.pac-container {
    z-index: 100050 !important;
    border-radius: 10px;
    border: 1.5px solid #ede9fe;
    box-shadow: 0 12px 32px rgba(91, 33, 182, 0.18);
    font-family: inherit;
    margin-top: 4px;
}
@media (max-width: 991px) {
    .spf-layout,
    .spf-layout--billing {
        grid-template-columns: 1fr;
        max-width: none;
    }
    .spf-billing-fields,
    .spf-billing-row {
        grid-template-columns: 1fr;
    }
    .spf-cert-grid {
        grid-template-columns: 1fr;
    }
    .spf-cred-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .spf-cred-col--cert {
        padding-left: 0;
        border-left: none;
        padding-top: 10px;
        border-top: 1px solid #ede9fe;
    }
    .spf-layout--profile {
        max-width: none;
    }
    .spf-profile-fields {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 12px;
    }
    .spf-location-split,
    .spf-card--profile .spf-location-split {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .spf-location-side {
        border-left: none;
        border-top: 1px solid #f3f0ff;
        padding: 10px;
    }
    .spf-card--location .spf-map-block,
    .spf-card--profile .spf-map-block {
        min-height: 140px;
    }
    .spf-map-canvas {
        min-height: 140px;
        height: 140px;
    }
    .spf-location-meta-fields {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
@media (max-width: 767px) {
    .spf-root {
        padding: 0;
    }
    .spf-layout {
        gap: 10px;
    }
    .spf-field-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .spf-card-head--compact {
        padding: 8px 10px;
    }
    .spf-card-body--compact {
        padding: 8px 10px 10px;
    }
    .spf-card--location .spf-map-block,
    .spf-card--profile .spf-map-block,
    .spf-map-canvas {
        min-height: 120px;
        height: 120px;
    }
    .spf-input,
    .spf-select {
        padding: 9px 10px;
        font-size: 16px; /* evita zoom en iOS */
    }
    .spf-field--derived label {
        font-size: 0.66rem;
    }
}

/* ---- Historial ---- */
.msch-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msch-history-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ede9fe;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.msch-history-row:hover {
    background: #faf8ff;
    border-color: #ddd6fe;
}
.msch-history-date {
    min-width: 70px;
    color: #5B21B6;
    font-size: 0.9rem;
}
.msch-history-info {
    flex: 1;
}
.msch-history-template {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.85rem;
}
.msch-history-status {
    margin-top: 3px;
}
.msch-history-chev {
    color: #a78bfa;
    font-size: 20px;
}

.msch-history-event {
    padding: 8px 10px;
    background: #faf8ff;
    border-left: 3px solid #7c3aed;
    border-radius: 4px;
    margin-bottom: 4px;
}
.msch-history-event-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #1f2937;
}
.msch-history-icon {
    color: #7c3aed;
    font-size: 16px;
}
.msch-history-date-mini {
    margin-left: auto;
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 400;
}
.msch-history-event-user {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}
.msch-history-event-user i {
    font-size: 13px;
}

/* ---- Utilidades ---- */
.msch-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 30px;
    color: #7c3aed;
    font-size: 0.9rem;
}
.msch-warning-box {
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #fef3c7;
    border: 1.5px solid #fbbf24;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #92400e;
    margin: 8px 0;
}
.msch-warning-box i {
    color: #d97706;
    font-size: 18px;
    flex-shrink: 0;
}

/* ---- Edición de celda ---- */
.msch-cell-edit-row {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f3f0ff;
}
.msch-cell-edit-pos {
    background: #ede9fe;
    color: #5B21B6;
    font-weight: 700;
    text-align: center;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.82rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .msch-suc-grid {
        grid-template-columns: 1fr;
    }
    .msch-time-row {
        grid-template-columns: 1fr;
    }
    .msch-editor-row-inline {
        grid-template-columns: 1fr;
    }
    .msch-sub-tabs {
        overflow-x: auto;
        overflow-y: hidden;
    }
    .msch-grid-td-cell {
        min-width: 80px;
    }
}

/* ============================================================ */
/* User Picker con buscador (combobox del form de asignación)   */
/* ============================================================ */
/* Modal "Asignar puesto": altura natural cuando el buscador está cerrado.
   Cuando se despliega el buscador (msch-assignment-modal-expanded), el modal
   crece para acomodar el dropdown con un margen inferior cómodo, hasta 90vh. */
.msch-assignment-modal {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transition: min-height 0.22s ease, max-height 0.22s ease;
}
.msch-assignment-modal .mpt-form-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: visible;
    padding-bottom: 16px;
}
.msch-assignment-modal-expanded {
    min-height: min(560px, 90vh);
}
.msch-assignment-modal-expanded .mpt-form-body {
    padding-bottom: 24px;
}
/* Dropdown del buscador: max-height basado en viewport para que siempre
   deje un margen mínimo antes del borde del modal. */
.msch-assignment-modal .msch-user-picker-dropdown {
    max-height: min(320px, calc(90vh - 260px));
}

.msch-user-picker {
    position: relative;
    width: 100%;
}
.msch-user-picker-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #ddd6fe;
    border-radius: 8px;
    transition: all 0.15s;
    cursor: text;
}
.msch-user-picker-input-wrap:focus-within {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.msch-user-picker-icon {
    padding-left: 10px;
    color: #a78bfa;
    font-size: 18px;
    flex-shrink: 0;
}
.msch-user-picker-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 0.88rem;
    color: #1f2937;
    width: 100%;
}
.msch-user-picker-input::placeholder {
    color: #9ca3af;
}
.msch-user-picker-selected-overlay {
    position: absolute;
    inset: 2px 2px 2px 32px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    pointer-events: auto;
    border-radius: 6px;
}
.msch-user-picker-selected-name {
    font-size: 0.88rem;
    color: #1f2937;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: capitalize;
}
.msch-user-picker-clear {
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.msch-user-picker-clear:hover {
    background: #f3f4f6;
    color: #ef4444;
}
.msch-user-picker-clear i {
    font-size: 16px;
}

.msch-user-picker-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1.5px solid #ddd6fe;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(91, 33, 182, 0.14);
    z-index: 1000;
    padding: 4px;
}
.msch-user-picker-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    color: #9ca3af;
    font-size: 0.85rem;
}
.msch-user-picker-empty i {
    font-size: 20px;
}
.msch-user-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}
.msch-user-picker-item:hover {
    background: #faf8ff;
}
.msch-user-picker-item-active {
    background: #ede9fe;
}
.msch-user-picker-item-active:hover {
    background: #ddd6fe;
}
.msch-user-picker-item-taken {
    opacity: 0.7;
}
.msch-user-picker-item-info {
    flex: 1;
    min-width: 0;
}
.msch-user-picker-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2937;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msch-user-picker-item-meta {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 1px;
    text-transform: capitalize;
}
.msch-user-picker-item-meta-global {
    color: #a78bfa;
    font-style: italic;
}
.msch-user-picker-item-badge {
    color: #f59e0b;
    display: flex;
    align-items: center;
}
.msch-user-picker-item-badge i {
    font-size: 16px;
}

/* =====================================================
   Export JPG / PDF del cronograma
   ===================================================== */
/* Durante la exportación ocultamos elementos internos
   (meta del borrador, leyenda de turnos, hint de DnD). */
.msch-exporting .msch-hide-in-export {
    display: none !important;
}

/* Header de exportación: oculto en pantalla, visible solo al exportar */
.msch-export-header {
    display: none;
}
.msch-exporting .msch-export-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 18px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.18);
}
.msch-exporting .msch-export-header .msch-export-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.msch-exporting .msch-export-header .msch-export-subtitle {
    font-size: 0.85rem;
    opacity: 0.92;
    font-weight: 500;
}

/* Compactación de la tabla durante el export: las celdas ocupan sólo el
   ancho justo necesario para el contenido, evitando márgenes blancos. */
.msch-exporting .msch-grid-table {
    width: auto !important;
    table-layout: auto !important;
}
.msch-exporting .msch-grid-td-cell {
    min-width: 0 !important;
    padding-right: 14px !important;
    white-space: nowrap;
}
.msch-exporting .msch-grid-th-shift,
.msch-exporting .msch-grid-th-franco {
    padding-right: 14px !important;
    white-space: nowrap;
}
.msch-exporting .msch-cell-entry {
    white-space: nowrap;
}
/* Garantizar que el header (título) y la leyenda de usuarios no excedan
   el ancho del wrap durante el export. */
.msch-exporting .msch-export-header,
.msch-exporting .msch-users-legend {
    max-width: 100%;
    box-sizing: border-box;
}

/* Franco vacío: conserva look neutro cuando no hay usuario */
.msch-cell-franco-empty {
    background: #f3f4f6 !important;
    color: #6b7280 !important;
}

/* ============================================================ */
/* Intercambio de turnos (swaps) — badge en celda + popover      */
/* ============================================================ */

/* La celda con swap pasa a dos líneas: nombre + detalle del cambio */
.msch-cell-has-swap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 2px !important;
}

.msch-cell-line {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    width: 100%;
}
.msch-cell-line-1 {
    justify-content: flex-start;
}

/* Primera línea: etiqueta "Cambio pendiente" estilo warning junto al nombre.
   Se mantiene discreta: tipografía pequeña, sin mayúsculas, para no quitarle
   protagonismo al nombre del usuario. */
.msch-swap-hint {
    margin-left: auto;
    padding: 0 5px;
    border-radius: 8px;
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.1px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.4;
    opacity: 0.85;
}
.msch-swap-hint-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.msch-swap-hint-approved {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.msch-swap-hint-rejected {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.msch-swap-hint-reverted {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

/* Segunda línea: nombres involucrados en el intercambio */
.msch-swap-details {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.msch-swap-details:hover {
    box-shadow: 0 1px 3px rgba(91, 33, 182, 0.25);
}
.msch-swap-details .msch-swap-details-name {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex-shrink: 1;
}
.msch-swap-details i.material-icons {
    font-size: 13px !important;
    line-height: 1 !important;
    flex-shrink: 0;
}
.msch-swap-details-pending {
    background: rgba(251, 191, 36, 0.12);
    color: #92400e;
    border: 1px dashed #fcd34d;
}
.msch-swap-details-approved {
    background: rgba(16, 185, 129, 0.10);
    color: #065f46;
    border: 1px dashed #6ee7b7;
}
.msch-swap-details-rejected {
    background: rgba(239, 68, 68, 0.10);
    color: #991b1b;
    border: 1px dashed #fca5a5;
}
.msch-swap-details-reverted {
    background: rgba(107, 114, 128, 0.10);
    color: #4b5563;
    border: 1px dashed #d1d5db;
}

/* ---- Popover / modal flotante de detalle del intercambio ---- */
.msch-swap-overlay {
    z-index: 10050 !important;
}
.msch-swap-float {
    border: 1px solid #ede9fe;
    box-shadow: 0 20px 50px rgba(91, 33, 182, 0.22);
}

.msch-swap-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-weight: 600;
    font-size: 0.88rem;
}
.msch-swap-status > i.material-icons {
    font-size: 20px;
    margin-top: 1px;
    flex-shrink: 0;
}
.msch-swap-status-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.msch-swap-status-main {
    line-height: 1.2;
}
.msch-swap-status-sub {
    font-weight: 500;
    font-size: 0.78rem;
    opacity: 0.9;
    line-height: 1.25;
}
.msch-swap-status-sub strong {
    font-weight: 700;
}
.msch-swap-status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.msch-swap-status-approved {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.msch-swap-status-rejected {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.msch-swap-status-reverted {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.msch-swap-parties {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
}
.msch-swap-party {
    flex: 1;
    min-width: 0;
    background: #faf8ff;
    border: 1px solid #ede9fe;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.msch-swap-party-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #7c3aed;
    font-weight: 600;
}
.msch-swap-party-name {
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 700;
    word-break: break-word;
    line-height: 1.2;
}
.msch-swap-party-pos {
    font-size: 0.75rem;
    color: #6b7280;
}
.msch-swap-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c3aed;
    flex-shrink: 0;
}
.msch-swap-arrow i.material-icons {
    font-size: 26px;
}

.msch-swap-meta {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    color: #374151;
}
.msch-swap-meta strong {
    color: #5B21B6;
    margin-right: 4px;
}
.msch-swap-forced {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #b45309;
    font-weight: 600;
    padding-top: 4px;
    border-top: 1px dashed #fcd34d;
    margin-top: 4px;
}
.msch-swap-forced i.material-icons {
    font-size: 16px;
}

.msch-swap-approval {
    margin-bottom: 14px;
}
.msch-swap-approval-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
}
.msch-swap-approval-line i.material-icons {
    font-size: 18px;
}
.msch-swap-approval-line strong {
    font-weight: 700;
}
.msch-swap-approval-ok {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}
.msch-swap-approval-rej {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.msch-swap-approval-pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.msch-swap-approval-notes {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #4b5563;
    font-style: italic;
    padding-left: 6px;
    border-left: 3px solid #ddd6fe;
}

.msch-swap-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}
.msch-btn-approve-swap,
.msch-btn-reject-swap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.msch-btn-approve-swap i.material-icons,
.msch-btn-reject-swap i.material-icons {
    font-size: 16px;
}
.msch-btn-approve-swap {
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(91, 33, 182, 0.25);
}
.msch-btn-approve-swap:hover:not(:disabled) {
    background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(91, 33, 182, 0.35);
}
.msch-btn-reject-swap {
    background: #fff;
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}
.msch-btn-reject-swap:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #ef4444;
}
.msch-btn-approve-swap:disabled,
.msch-btn-reject-swap:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive: en móviles, apilar las partes del intercambio */
@media (max-width: 480px) {
    .msch-swap-parties {
        flex-direction: column;
    }
    .msch-swap-arrow {
        transform: rotate(90deg);
        height: 24px;
    }
    .msch-swap-actions {
        flex-direction: column-reverse;
    }
    .msch-swap-actions .mpt-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Ocultar el badge de swap durante la exportación a JPG/PDF */
.msch-exporting .msch-swap-badge,
.msch-exporting .msch-cell-has-swap {
    outline: none !important;
}
.msch-exporting .msch-swap-badge {
    display: none !important;
}

/* ============================================================ */
/* Pestaña "Pendientes" — Solicitudes de cambio de turno         */
/* ============================================================ */

/* Badge contador en el sub-tab */
.msch-sub-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #78350f;
    border: 1px solid #fcd34d;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.35);
}

/* Filtros rápidos */
.msch-pending-filters {
    display: inline-flex;
    background: #faf8ff;
    border: 1px solid #ede9fe;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.msch-pending-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.msch-pending-filter i {
    font-size: 16px;
}
.msch-pending-filter:hover {
    color: #5B21B6;
    background: #ede9fe;
}
.msch-pending-filter-active {
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 1px 4px rgba(91, 33, 182, 0.25);
}
.msch-pending-filter-active:hover {
    color: #fff;
    background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%);
}

/* Lista de cards: grid responsive (3 cols en desktop, 2 en tablet, 1 en mobile) */
.msch-pending-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
    padding: 4px 0;
    align-items: stretch;
}
.msch-pending-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1.5px solid #ede9fe;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(91, 33, 182, 0.06);
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.msch-pending-card:hover {
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.12);
    border-color: #ddd6fe;
}
.msch-pending-card-rejected {
    opacity: 0.92;
}

.msch-pending-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 14px;
    background: #faf8ff;
    border-bottom: 1px solid #ede9fe;
}
.msch-pending-card-head-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.msch-pending-card-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.92rem;
    color: #1f2937;
    min-width: 0;
}
.msch-pending-card-title i {
    font-size: 18px;
    color: #7c3aed;
}
.msch-pending-card-actions-icons {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.msch-pending-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    padding: 0;
}
.msch-pending-icon-btn i {
    font-size: 16px;
    line-height: 1;
}
.msch-pending-icon-btn:hover:not(:disabled) {
    background: #ede9fe;
    color: #5B21B6;
    border-color: #ddd6fe;
}
.msch-pending-icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.msch-pending-icon-btn-whatsapp:hover:not(:disabled) {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}
.msch-spin {
    animation: msch-spin 0.9s linear infinite;
}
@keyframes msch-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Chip de estado (reemplaza la franja lateral) */
.msch-pending-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 0.44rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid transparent;
    align-self: flex-start;
}
.msch-pending-status-chip i {
    font-size: 8px;
}
.msch-pending-status-chip-pending {
    background: #fef3c7;
    color: #b45309;
    border-color: #fcd34d;
}
.msch-pending-status-chip-approved {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}
.msch-pending-status-chip-rejected {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.msch-pending-card-body {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
}

.msch-pending-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: #9ca3af;
}
.msch-pending-meta i {
    font-size: 13px;
    color: #c4b5fd;
}

/* Detalle del intercambio: antes/después dentro de una sola card */
.msch-pending-swap {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 10px;
    background: #faf8ff;
    border: 1px solid #ede9fe;
    border-radius: 10px;
}
.msch-pending-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msch-pending-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 0;
}
.msch-pending-section-header i {
    font-size: 13px;
}
.msch-pending-section-after .msch-pending-section-header {
    color: #6d28d9;
}
/* Botón "Ver en cronograma" en el header de la sección Después */
.msch-pending-view-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #ede9fe;
    color: #5B21B6;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.2px;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.msch-pending-view-btn:hover {
    background: #ddd6fe;
    border-color: #c4b5fd;
    color: #4c1d95;
}
.msch-pending-view-btn:active {
    transform: translateY(1px);
}
.msch-pending-view-btn i {
    font-size: 13px;
}
.msch-pending-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c3aed;
    margin: 4px 0;
    position: relative;
}
.msch-pending-divider::before,
.msch-pending-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ede9fe;
}
.msch-pending-divider i {
    font-size: 14px;
    background: #faf8ff;
    padding: 0 6px;
}
.msch-pending-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #1f2937;
    line-height: 1.25;
    min-width: 0;
}
.msch-pending-section-after .msch-pending-line {
    border-color: #ede9fe;
}
.msch-pending-line-changed {
    border-left: 3px solid #7c3aed;
    background: linear-gradient(90deg, #f5f3ff 0%, #fff 60%);
}
.msch-pending-line-date {
    font-weight: 700;
    color: #4b5563;
    font-variant-numeric: tabular-nums;
}
.msch-pending-line-sep {
    color: #d1d5db;
    flex-shrink: 0;
}
.msch-pending-line-pos {
    font-weight: 700;
    color: #5B21B6;
    background: #ede9fe;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.msch-pending-line-user {
    font-weight: 600;
    color: #111827;
    min-width: 0;
    word-break: break-word;
}
.msch-pending-line-badge {
    flex-shrink: 0;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Timeline compacta de 3 pasos: Emisor / Receptor / Administrador/a */
.msch-pending-timeline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border: 1px solid #ede9fe;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.msch-pending-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    position: relative;
}
.msch-pending-step-connector {
    width: 1px;
    height: 4px;
    background: #ddd6fe;
    margin-left: 19px;
    flex-shrink: 0;
}
.msch-pending-step-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    color: #9ca3af;
    border: 1.5px solid #e5e7eb;
    z-index: 1;
}
.msch-pending-step-icon i {
    font-size: 14px;
}
.msch-pending-step-pending .msch-pending-step-icon {
    background: #fef3c7;
    color: #d97706;
    border-color: #fcd34d;
}
.msch-pending-step-approved .msch-pending-step-icon {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}
.msch-pending-step-rejected .msch-pending-step-icon {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}
.msch-pending-step-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.25;
}
.msch-pending-step-role {
    font-size: 0.62rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    line-height: 1.1;
}
.msch-pending-step-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    word-break: break-word;
}
.msch-pending-step-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #111827;
}
.msch-pending-step-name-pending {
    color: #d1d5db;
    font-weight: 500;
}
.msch-pending-step-status {
    font-size: 0.74rem;
    font-weight: 500;
    color: #4b5563;
    position: relative;
}
.msch-pending-step-line .msch-pending-step-name + .msch-pending-step-status::before {
    content: '·';
    color: #d1d5db;
    margin-right: 6px;
    font-weight: 400;
}
.msch-pending-step-pending .msch-pending-step-status { color: #b45309; }
.msch-pending-step-approved .msch-pending-step-status { color: #15803d; }
.msch-pending-step-rejected .msch-pending-step-status { color: #b91c1c; }
.msch-pending-step-meta {
    font-size: 0.66rem;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}
.msch-pending-step-notes {
    margin-top: 2px;
    padding: 3px 6px;
    background: #faf8ff;
    border-left: 2px solid #c4b5fd;
    border-radius: 4px;
    font-size: 0.7rem;
    color: #4b5563;
    font-style: italic;
}

/* Avatar con inicial del usuario en el timeline */
.msch-pending-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    border: 1.5px solid #e5e7eb;
    font-size: 0.62rem;
    font-weight: 800;
    flex-shrink: 0;
    line-height: 1;
}

/* Motivo + adjuntos (datos privados) */
.msch-pending-private-data {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #78350f;
}
.msch-pending-notes {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.82rem;
    line-height: 1.35;
    font-style: italic;
}
.msch-pending-notes i {
    font-size: 16px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 1px;
}
.msch-pending-attachments {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msch-pending-attachments-h {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #92400e;
}
.msch-pending-attachments-h i { font-size: 13px; }
.msch-pending-attachments ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.msch-pending-attachments li a {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #5B21B6;
    text-decoration: none;
    background: #fff;
    border: 1px solid #ede9fe;
    border-radius: 6px;
    padding: 4px 8px;
}
.msch-pending-attachments li a:hover {
    background: #f5f3ff;
    border-color: #c4b5fd;
}
.msch-pending-attachments li a i { font-size: 14px; }
.msch-pending-att-name { font-weight: 600; flex: 1; min-width: 0; word-break: break-word; }
.msch-pending-att-size { color: #6b7280; font-size: 0.72rem; }

/* TTL */
.msch-pending-ttl {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    padding: 4px 10px;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    border-radius: 6px;
    color: #5B21B6;
}
.msch-pending-ttl i { font-size: 14px; }
.msch-pending-ttl-soon {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}
.msch-pending-ttl-stale {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    font-weight: 600;
}

/* Botón "cancelar mi solicitud" outline secundario */
.msch-btn-secondary-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: #fff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.msch-btn-secondary-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}
.msch-btn-secondary-outline i { font-size: 16px; }

/* ==== Dialog del swap (Swal) ==== */
.msch-swap-dialog .swal2-html-container {
    text-align: left !important;
    max-height: 60vh;
    overflow-y: auto;
}
.msch-swap-dialog-section {
    background: #faf8ff;
    border: 1px solid #ede9fe;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
}
.msch-swap-dialog-section-after {
    background: #f5f3ff;
    border-color: #ddd6fe;
}
.msch-swap-dialog-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 6px;
}
.msch-swap-dialog-section-title i { font-size: 14px; color: #7c3aed; }
.msch-swap-dialog-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 4px 0;
    font-size: 0.86rem;
    color: #1f2937;
}
.msch-swap-dialog-line .ld-date { font-weight: 700; color: #4b5563; }
.msch-swap-dialog-line .ld-pos { font-weight: 700; color: #5B21B6; background: #ede9fe; padding: 1px 6px; border-radius: 4px; font-size: 0.78rem; }
.msch-swap-dialog-line .ld-user { font-weight: 600; color: #111827; }
.msch-swap-dialog-line .ld-badge { font-family: monospace; font-weight: 700; padding: 1px 6px; border-radius: 4px; font-size: 0.78rem; letter-spacing: 0.4px; }
.msch-swap-dialog-line .ld-badge-m { background: #fef3c7; color: #b45309; }
.msch-swap-dialog-line .ld-badge-t { background: #dbeafe; color: #1e40af; }
.msch-swap-dialog-line .ld-badge-n { background: #ede9fe; color: #5B21B6; }
.msch-swap-dialog-line .ld-badge-f { background: #f3f4f6; color: #6b7280; }
.msch-swap-dialog-arrow {
    text-align: center;
    color: #7c3aed;
    margin: 2px 0;
}
.msch-swap-dialog-arrow i { font-size: 20px; }

.msch-swap-dialog-recipients {
    background: #ede9fe;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 8px 0;
}
.msch-swap-dialog-recipients ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msch-swap-dialog-recipients li {
    font-size: 0.84rem;
    color: #4b5563;
    line-height: 1.3;
}
.msch-swap-dialog-recipients li strong { color: #1f2937; }
.msch-swap-dialog-recipients li .r-role { color: #5B21B6; font-weight: 600; }
.msch-swap-dialog-recipients li em { font-style: normal; color: #6b7280; font-size: 0.8rem; }
.msch-swap-dialog-h {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.msch-swap-dialog-h i { font-size: 16px; color: #7c3aed; }

.msch-swap-dialog-warns {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 8px 0;
}
.msch-swap-dialog-warns ul {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msch-swap-dialog-warns li {
    font-size: 0.83rem;
    color: #78350f;
}
.msch-swap-dialog-warns-strong {
    background: #fee2e2;
    border-color: #fca5a5;
}
.msch-swap-dialog-warns-strong li { color: #991b1b; }
.msch-swap-dialog-more { font-size: 0.78rem; color: #6b7280; margin-top: 4px; }
.msch-swap-dialog-ttl {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    color: #5B21B6;
    background: #f5f3ff;
    border: 1px solid #ede9fe;
    border-radius: 8px;
    padding: 6px 10px;
    margin: 8px 0;
}
.msch-swap-dialog-ttl i { font-size: 16px; }

.msch-swap-dialog-form {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.msch-swap-dialog-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}
.msch-swap-dialog-textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    pointer-events: auto !important;
    user-select: text !important;
    background: #fff;
    color: #1f2937;
}
.msch-swap-dialog-textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}
.msch-swap-dialog-file {
    pointer-events: auto !important;
}
.msch-swap-dialog-file {
    font-size: 0.84rem;
}
.msch-swap-dialog-rules {
    font-size: 0.74rem;
    color: #6b7280;
}
.msch-swap-dialog-files-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msch-swap-dialog-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f9fafb;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
}
.msch-swap-dialog-file-item .fname { flex: 1; min-width: 0; word-break: break-word; }
.msch-swap-dialog-file-item .fsize { color: #6b7280; font-size: 0.74rem; }
.msch-swap-dialog-file-remove {
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}
.msch-swap-dialog-file-remove i { font-size: 14px; }

/* Acciones (botones de confirmar / rechazar) */
.msch-pending-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 7px 14px;
    background: #faf8ff;
    border-top: 1px solid #ede9fe;
}
.msch-btn-danger-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}
.msch-btn-danger-outline:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #dc2626;
}
.msch-btn-danger-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.msch-btn-danger-outline i {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 600px) {
    .msch-pending-list {
        grid-template-columns: 1fr;
    }
    .msch-pending-swap {
        padding: 10px;
    }
    .msch-pending-line {
        font-size: 0.82rem;
        padding: 6px 8px;
        gap: 4px;
    }
    .msch-pending-line-sep {
        display: none;
    }
    .msch-pending-card-actions {
        flex-direction: column-reverse;
    }
    .msch-pending-card-actions .msch-btn-primary,
    .msch-pending-card-actions .msch-btn-danger-outline {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   Importar cronograma del mes anterior (análisis con Keisi)
   ============================================================ */
.msch-import-file-input {
    display: none;
}

.msch-import-drop {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px dashed #c4b5fd;
    border-radius: 10px;
    background: #faf8ff;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.msch-import-drop:hover {
    border-color: #7c3aed;
    background: #f5f3ff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .08);
}
.msch-import-drop.is-error {
    border-color: #fca5a5;
    background: #fef2f2;
}
.msch-import-drop > .material-icons {
    color: #7c3aed;
    font-size: 26px;
    flex-shrink: 0;
}
.msch-import-drop-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.msch-import-drop-text strong {
    color: #5B21B6;
    font-size: 13px;
    font-weight: 600;
}
.msch-import-drop-text span {
    color: #8b8b9a;
    font-size: 11.5px;
}
.msch-import-paste-hint {
    color: #7c3aed !important;
    font-size: 11px !important;
    font-weight: 500;
    margin-top: 2px;
}
.msch-import-paste-btn {
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-left: auto;
    min-width: 52px;
    padding: 8px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    background: #fff;
    color: #5B21B6;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.msch-import-paste-btn .material-icons {
    font-size: 22px;
    color: inherit;
    line-height: 1;
}
.msch-import-paste-btn span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
}
.msch-import-paste-btn:hover {
    background: #f5f3ff;
    border-color: #c4b5fd;
    color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .08);
}

.msch-import-loading {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid #ede9fe;
    border-radius: 12px;
    background: linear-gradient(180deg, #faf8ff 0%, #f5f3ff 100%);
}
.msch-import-loading-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.msch-import-loading-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
    animation: mschImportPulse 1.5s ease-in-out infinite;
}
.msch-import-loading-icon > .material-icons {
    font-size: 22px;
    animation: mschImportSpin 2.6s linear infinite;
}
.msch-import-loading-texts {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}
.msch-import-loading-texts strong {
    color: #5B21B6;
    font-size: 13.5px;
    font-weight: 600;
}
.msch-import-loading-sub {
    color: #7c3aed;
    font-size: 12px;
    min-height: 16px;
    transition: opacity .25s ease;
    animation: mschImportFade .5s ease;
}
.msch-import-progress {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: #ede9fe;
    overflow: hidden;
}
.msch-import-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, #a78bfa 0%, #7c3aed 50%, #5B21B6 100%);
    animation: mschImportIndeterminate 1.3s ease-in-out infinite;
}
.msch-import-loading-hint {
    font-size: 11px;
    color: #a0a0ae;
    text-align: center;
}
@keyframes mschImportPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .35); }
    50% { box-shadow: 0 0 0 9px rgba(124, 58, 237, 0); }
}
@keyframes mschImportSpin {
    to { transform: rotate(360deg); }
}
@keyframes mschImportIndeterminate {
    0% { left: -42%; width: 42%; }
    50% { width: 55%; }
    100% { left: 100%; width: 42%; }
}
@keyframes mschImportFade {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.msch-import-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12.5px;
}
.msch-import-error > .material-icons {
    font-size: 20px;
    flex-shrink: 0;
}
.msch-import-retry {
    margin-left: auto;
    border: none;
    background: #dc2626;
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.msch-import-retry:hover {
    background: #b91c1c;
}

.msch-import-result {
    border: 1px solid #ede9fe;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(91, 33, 182, .08);
}
.msch-import-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(135deg, #5B21B6 0%, #7c3aed 100%);
}
.msch-import-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
}
.msch-import-badge > .material-icons {
    font-size: 18px;
}
.msch-import-clear {
    border: none;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.msch-import-clear:hover {
    background: rgba(255, 255, 255, .32);
}
.msch-import-clear > .material-icons {
    font-size: 16px;
}

.msch-import-meta {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f0ff;
}
.msch-import-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.msch-import-meta-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.msch-import-meta-value {
    font-size: 13px;
    color: #5B21B6;
    font-weight: 600;
}
.msch-import-conf {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 11px;
    font-weight: 700;
}
.msch-import-reason {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.35;
    margin-top: 4px;
}
.msch-import-reason > .material-icons {
    font-size: 15px;
    color: #a78bfa;
    flex-shrink: 0;
    margin-top: 1px;
}
.msch-import-reason-soft {
    color: #9ca3af;
}

.msch-import-preview {
    padding: 10px 12px;
}
.msch-import-preview-title {
    font-size: 12px;
    font-weight: 600;
    color: #5B21B6;
    margin-bottom: 6px;
}
.msch-import-preview-title span {
    color: #9ca3af;
    font-weight: 400;
}
.msch-import-preview-scroll {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #f3f0ff;
    border-radius: 8px;
}
.msch-import-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.msch-import-preview-table thead th {
    position: sticky;
    top: 0;
    background: #faf8ff;
    color: #7c3aed;
    text-align: left;
    padding: 6px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    z-index: 1;
}
.msch-import-preview-table tbody td {
    padding: 6px 8px;
    border-top: 1px solid #f3f0ff;
    vertical-align: top;
}
.msch-import-day {
    white-space: nowrap;
    width: 54px;
}
.msch-import-day strong {
    color: #111827;
}
.msch-import-day span {
    display: block;
    color: #9ca3af;
    font-size: 10.5px;
}
.msch-import-chip {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f0ff;
    color: #4c1d95;
    font-size: 11px;
    line-height: 1.6;
}
.msch-import-chip b {
    font-weight: 700;
    margin-right: 3px;
}
.msch-import-chip.shift-m { background: #fef9c3; color: #854d0e; }
.msch-import-chip.shift-t { background: #dbeafe; color: #1e40af; }
.msch-import-chip.shift-n { background: #ede9fe; color: #5b21b6; }
.msch-import-chip.shift-f { background: #fee2e2; color: #b91c1c; }
.msch-import-chip.shift-sc { background: #f3f4f6; color: #6b7280; }
.msch-import-preview-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    font-size: 11.5px;
    color: #8b8b9a;
    line-height: 1.35;
}
.msch-import-preview-hint > .material-icons {
    font-size: 15px;
    color: #a78bfa;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Modal Generar cronograma: no se mete debajo de la taskbar;
   footer de acciones siempre visible; no cierra al clic afuera. */
.msch-generate-overlay {
    /* hereda padding-bottom con --wf-taskbar-height de .mpt-type-form-overlay */
    align-items: flex-start;
}
.msch-generate-float {
    max-width: 440px;
    max-height: calc(100vh - 40px - var(--wf-taskbar-height, 0px) - var(--wf-bottom-reserve, 0px));
}
.msch-generate-float > .mpt-form-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.msch-generate-actions {
    flex-shrink: 0;
    margin-top: 0;
    padding: 12px 16px 14px;
    border-top: 1px solid #ede9fe;
    background: #fff;
}
@media (max-width: 767px) {
    .msch-generate-overlay {
        padding: 10px 10px calc(10px + var(--wf-taskbar-height, 0px) + var(--wf-bottom-reserve, 0px));
    }
    .msch-generate-float {
        max-height: calc(100vh - 20px - var(--wf-taskbar-height, 0px) - var(--wf-bottom-reserve, 0px));
    }
    .msch-import-preview-scroll {
        max-height: 160px;
    }
}
