/**
 * Wizard Nuevo Parte — estilo neumórfico iSATManager
 */

.nuevo-parte-sheet,
.crear-parte-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--cpm-bottom-nav-h);
    z-index: 260;
    background: var(--cpm-bg);
    transform: translateY(100%);
    transition: transform 0.32s ease;
    display: flex;
    flex-direction: column;
}

.nuevo-parte-sheet.active,
.crear-parte-sheet.active {
    transform: translateY(0);
}

body.nuevo-parte-open,
body.crear-parte-open {
    overflow: hidden;
}

body.nuevo-parte-open .isat-fab,
body.crear-parte-open .isat-fab {
    opacity: 0;
    pointer-events: none;
}

.nuevo-parte-sheet__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--cpm-surface);
    box-shadow: var(--cpm-shadow-sm);
    flex-shrink: 0;
}

.nuevo-parte-sheet__back,
.nuevo-parte-sheet__menu {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--cpm-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: #0F766E;
    flex-shrink: 0;
}

.nuevo-parte-sheet__title {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #0F766E;
}

.nuevo-parte-sheet__progress {
    padding: 0.75rem 1.25rem 0;
    flex-shrink: 0;
}

.np-progress__meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--cpm-neutral-light);
    margin-bottom: 0.5rem;
}

.np-progress__label {
    color: #0D9488;
    font-weight: 600;
}

.np-progress__track {
    height: 6px;
    background: #E5E7EB;
    border-radius: 99px;
    overflow: hidden;
}

.np-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #0D9488, #14B8A6);
    border-radius: 99px;
    transition: width 0.3s ease;
}

.nuevo-parte-sheet__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem;
    touch-action: pan-y;
}

.nuevo-parte-sheet__footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
    background: var(--cpm-surface);
    box-shadow: 0 -2px 12px rgba(51, 51, 51, 0.06);
}

.nuevo-parte-sheet__footer .btn,
.crear-parte-sheet__footer .btn,
#np-create-btn,
#cp-confirm-btn {
    touch-action: manipulation;
    min-height: 48px;
}

.np-step__title {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: var(--cpm-neutral);
}

.np-step__subtitle {
    font-size: 0.875rem;
    color: var(--cpm-neutral-light);
    margin: 0 0 1.25rem;
    line-height: 1.45;
}

/* Búsqueda */
.np-search {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: var(--cpm-surface);
    border-radius: var(--cpm-radius);
    padding: 0.875rem 1rem;
    box-shadow: inset 0 2px 6px rgba(51, 51, 51, 0.06), var(--cpm-shadow-sm);
    margin-bottom: 1rem;
}

.np-search i {
    color: #9CA3AF;
}

.np-search__input {
    border: none;
    background: transparent;
    flex: 1;
    font-family: var(--cpm-font);
    font-size: 0.9375rem;
    outline: none;
}

/* Añadir cliente */
.np-add-client {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: var(--cpm-surface);
    border: none;
    border-radius: var(--cpm-radius);
    padding: 1rem;
    box-shadow: var(--cpm-shadow-sm);
    margin-bottom: 1.25rem;
    cursor: pointer;
    text-align: left;
}

.np-add-client__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #E0F2FE;
    color: #0284C7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.np-add-client__text {
    flex: 1;
    font-weight: 600;
    color: #0F766E;
}

.np-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.np-section-head__label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--cpm-neutral-light);
}

.np-section-head__link {
    border: none;
    background: none;
    color: #2563EB;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0;
}

/* Tarjetas cliente */
.np-client-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.np-client-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    background: var(--cpm-surface);
    border: none;
    border-radius: var(--cpm-radius);
    padding: 1rem;
    box-shadow: var(--cpm-shadow-sm);
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s;
}

.np-client-card:active {
    transform: scale(0.98);
}

.np-client-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--cpm-radius-sm);
    background: var(--cpm-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--cpm-neutral-light);
    flex-shrink: 0;
}

.np-client-card__body {
    flex: 1;
    min-width: 0;
}

.np-client-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.np-client-card__name {
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--cpm-neutral);
}

.np-client-card__badge {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    white-space: nowrap;
}

.np-client-card__badge--activo {
    background: #D1FAE5;
    color: #047857;
}

.np-client-card__badge--urgente {
    background: #FEE2E2;
    color: #B91C1C;
}

.np-client-card__badge--pendiente {
    background: #F3F4F6;
    color: #6B7280;
}

.np-client-card__addr {
    font-size: 0.8125rem;
    color: var(--cpm-neutral-light);
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
}

.np-client-card__chev {
    color: #D1D5DB;
}

/* Tipos de servicio */
.np-service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.np-service-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 100px;
    background: var(--cpm-surface);
    border: 2px solid transparent;
    border-radius: var(--cpm-radius);
    box-shadow: var(--cpm-shadow-sm);
    cursor: pointer;
    padding: 1rem;
    font-family: var(--cpm-font);
}

.np-service-type.active {
    border-color: #0D9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.np-service-type__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.np-service-type--blue .np-service-type__icon { background: #DBEAFE; color: #2563EB; }
.np-service-type--yellow .np-service-type__icon { background: #FEF3C7; color: #D97706; }
.np-service-type--teal .np-service-type__icon { background: #CCFBF1; color: #0D9488; }
.np-service-type--gray .np-service-type__icon { background: #F3F4F6; color: #6B7280; }

.np-service-type__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cpm-neutral);
}

/* Campos */
.np-field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cpm-neutral);
    margin-bottom: 0.5rem;
}

.np-textarea {
    width: 100%;
    border: none;
    border-radius: var(--cpm-radius);
    background: #EEF2F6;
    padding: 1rem;
    font-family: var(--cpm-font);
    font-size: 0.9375rem;
    resize: vertical;
    margin-bottom: 1.25rem;
    box-shadow: inset 0 2px 4px rgba(51, 51, 51, 0.04);
}

.np-select,
.np-input {
    width: 100%;
    border: none;
    border-radius: var(--cpm-radius);
    background: #EEF2F6;
    padding: 0.875rem 1rem;
    font-family: var(--cpm-font);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
    box-shadow: inset 0 2px 4px rgba(51, 51, 51, 0.04);
    color: var(--cpm-neutral);
}

.np-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748B' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.np-priority-row {
    display: flex;
    gap: 0.5rem;
}

.np-priority {
    flex: 1;
    min-height: 44px;
    border: 1.5px solid #E5E7EB;
    border-radius: 999px;
    background: var(--cpm-surface);
    font-family: var(--cpm-font);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cpm-neutral-light);
    cursor: pointer;
}

.np-priority.active {
    border-color: #2563EB;
    color: #1D4ED8;
    background: #EEF4FF;
}

/* Resumen cliente paso 3 */
.np-client-summary {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: var(--cpm-surface);
    border-radius: var(--cpm-radius);
    padding: 1rem;
    box-shadow: var(--cpm-shadow-sm);
    margin-bottom: 1.25rem;
}

.np-client-summary__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--cpm-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #0D9488;
}

.np-client-summary__label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--cpm-neutral-light);
}

.np-client-summary__name {
    font-weight: 700;
    color: #0F766E;
    font-size: 1rem;
}

.np-client-summary__svc {
    font-size: 0.8125rem;
    color: var(--cpm-neutral-light);
}

/* Mini calendario */
.np-cal {
    background: var(--cpm-surface);
    border-radius: var(--cpm-radius);
    padding: 1rem;
    box-shadow: var(--cpm-shadow-sm);
    margin-bottom: 1.25rem;
}

.np-cal__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.np-cal__nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--cpm-bg);
    border-radius: 50%;
}

.np-cal__month {
    font-weight: 700;
    text-transform: capitalize;
}

.np-cal__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--cpm-neutral-light);
    margin-bottom: 0.5rem;
}

.np-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    text-align: center;
}

.np-cal__day {
    border: none;
    background: transparent;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 0.875rem;
    margin: 0 auto;
    font-family: var(--cpm-font);
}

.np-cal__day--muted {
    color: #D1D5DB;
    pointer-events: none;
}

.np-cal__day.active {
    background: #0F766E;
    color: #fff;
    font-weight: 700;
}

/* Horarios */
.np-time-presets {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.np-time-preset {
    flex: 1;
    min-height: 44px;
    border: none;
    border-radius: var(--cpm-radius-sm);
    background: var(--cpm-surface);
    box-shadow: var(--cpm-shadow-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0F766E;
}

.np-time-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.np-time-range__field label {
    font-size: 0.75rem;
    color: var(--cpm-neutral-light);
    margin-bottom: 0.25rem;
    display: block;
}

.np-time-range select {
    min-height: 44px;
    border-radius: var(--cpm-radius-sm);
}

.np-time-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.np-time-chip {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--cpm-radius-sm);
    background: var(--cpm-surface);
    box-shadow: var(--cpm-shadow-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.np-time-chip.active {
    background: var(--cpm-secondary);
    color: var(--cpm-neutral);
}

.np-time-chip.suggested small {
    display: block;
    font-size: 0.5625rem;
    font-weight: 700;
    color: #0D9488;
}

.np-btn-next,
.np-btn-create {
    min-height: 52px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.np-empty {
    text-align: center;
    color: var(--cpm-neutral-light);
    padding: 1.5rem;
}

.np-empty--error {
    color: #DC2626;
}

@media (min-width: 992px) {
    .nuevo-parte-sheet,
    .crear-parte-sheet {
        display: none !important;
    }
}
