/* ----------------------------------------------------
   SISTEMA DE DISEÑO Y VARIABLES GLOBALES
   ---------------------------------------------------- */
:root {
    /* Fuentes */
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    
    /* Configuración por Defecto (Lavado) */
    --theme-primary: hsl(172, 85%, 45%);       /* Cian Esmeralda */
    --theme-primary-hover: hsl(172, 85%, 38%);
    --theme-primary-light: rgba(20, 219, 186, 0.15);
    --theme-bg-gradient: linear-gradient(135deg, hsl(210, 20%, 98%) 0%, hsl(172, 20%, 96%) 100%);
    --theme-accent: hsl(200, 95%, 45%);
    --theme-card-bg: rgba(255, 255, 255, 0.85);
    
    /* Colores Semánticos */
    --color-success: hsl(145, 63%, 42%);
    --color-warning: hsl(35, 92%, 52%);
    --color-danger: hsl(354, 76%, 45%);
    --color-info: hsl(200, 95%, 45%);
    
    /* Neutrales Oscuros (Premium Dark Accent) */
    --neutral-900: hsl(220, 30%, 10%);
    --neutral-800: hsl(220, 20%, 18%);
    --neutral-700: hsl(220, 15%, 28%);
    --neutral-600: hsl(220, 10%, 40%);
    --neutral-500: hsl(220, 8%, 56%);
    --neutral-400: hsl(220, 10%, 70%);
    --neutral-300: hsl(220, 12%, 84%);
    --neutral-200: hsl(220, 15%, 92%);
    --neutral-100: hsl(220, 20%, 97%);
    --neutral-50: hsl(0, 0%, 100%);

    /* Efectos */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.12);
    --blur-glass: blur(12px);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Safe Area (iOS / Notch) */
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* TEMA MECÁNICA */
.theme-mecanica {
    --theme-primary: hsl(215, 80%, 55%);       /* Azul Steel Premium - Más claro y legible */
    --theme-primary-hover: hsl(215, 80%, 47%);
    --theme-primary-light: rgba(74, 124, 238, 0.15);
    --theme-bg-gradient: linear-gradient(135deg, hsl(215, 20%, 94%) 0%, hsl(220, 15%, 88%) 100%); /* Tono acero premium, no totalmente blanco */
    --theme-accent: hsl(15, 95%, 55%);         /* Naranja Taller */
    --theme-card-bg: rgba(255, 255, 255, 0.85);
}

/* MODO OSCURO AUTOMÁTICO / ADAPTADO PARA MÓVILES (Estilo Premium) */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) {
        --theme-bg-gradient: linear-gradient(135deg, hsl(222, 20%, 8%) 0%, hsl(220, 25%, 12%) 100%);
        --theme-card-bg: rgba(26, 32, 46, 0.8);
        --neutral-900: hsl(220, 20%, 97%);
        --neutral-800: hsl(220, 15%, 90%);
        --neutral-700: hsl(220, 12%, 80%);
        --neutral-600: hsl(220, 10%, 65%);
        --neutral-500: hsl(220, 8%, 52%);
        --neutral-400: hsl(222, 12%, 38%);
        --neutral-300: hsl(222, 15%, 25%);
        --neutral-200: hsl(222, 18%, 18%);
        --neutral-100: hsl(222, 20%, 12%);
        --neutral-50: hsl(222, 20%, 15%);
        --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
        --shadow-lg: 0 16px 50px rgba(0,0,0,0.4);
    }

    :root:not(.theme-light) .theme-mecanica {
        --theme-primary: hsl(215, 85%, 65%);
        --theme-primary-hover: hsl(215, 85%, 57%);
        --theme-primary-light: rgba(99, 154, 255, 0.18);
        --theme-bg-gradient: linear-gradient(135deg, hsl(222, 18%, 18%) 0%, hsl(220, 22%, 24%) 100%);
        --theme-card-bg: rgba(38, 48, 68, 0.85);
    }
}

/* MODO OSCURO FORZADO POR CLASE (para selector manual) */
:root.theme-dark {
    --theme-bg-gradient: linear-gradient(135deg, hsl(222, 20%, 8%) 0%, hsl(220, 25%, 12%) 100%);
    --theme-card-bg: rgba(26, 32, 46, 0.8);
    --neutral-900: hsl(220, 20%, 97%);
    --neutral-800: hsl(220, 15%, 90%);
    --neutral-700: hsl(220, 12%, 80%);
    --neutral-600: hsl(220, 10%, 65%);
    --neutral-500: hsl(220, 8%, 52%);
    --neutral-400: hsl(222, 12%, 38%);
    --neutral-300: hsl(222, 15%, 25%);
    --neutral-200: hsl(222, 18%, 18%);
    --neutral-100: hsl(222, 20%, 12%);
    --neutral-50: hsl(222, 20%, 15%);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
    --shadow-lg: 0 16px 50px rgba(0,0,0,0.4);
}

:root.theme-dark .theme-mecanica {
    --theme-primary: hsl(215, 85%, 65%);
    --theme-primary-hover: hsl(215, 85%, 57%);
    --theme-primary-light: rgba(99, 154, 255, 0.18);
    --theme-bg-gradient: linear-gradient(135deg, hsl(222, 18%, 18%) 0%, hsl(220, 22%, 24%) 100%);
    --theme-card-bg: rgba(38, 48, 68, 0.85);
}

/* Reset y Bases */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Quita el destello al tocar en móvil */
}

body {
    font-family: var(--font-primary);
    background: var(--theme-bg-gradient);
    color: var(--neutral-800);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background var(--transition-normal);
}

/* Garantizar que inputs, selects y textareas no se deformen o expandan por el contenido de texto */
input,
select,
textarea {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

/* Contenedor General SPA */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100%;
    position: relative;
    padding-bottom: calc(75px + var(--safe-area-bottom)); /* Espacio para Bottom Nav */
}

/* ----------------------------------------------------
   CABECERA PREMIUM
   ---------------------------------------------------- */
.app-header {
    background: var(--theme-card-bg);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-bottom: 1px solid var(--neutral-200);
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all var(--transition-normal);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

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

.brand-logo {
    background: var(--theme-primary-light);
    color: var(--theme-primary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.logo-icon {
    width: 24px;
    height: 24px;
}

.brand-info h1 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--neutral-900);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.brand-info .sub-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--neutral-500);
}

/* Selector de Categoría (Lavado / Mecánica) */
.category-toggle {
    background: var(--neutral-200);
    border-radius: 30px;
    padding: 3px;
    display: flex;
    gap: 2px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.toggle-btn {
    border: none;
    background: transparent;
    padding: 8px 16px;
    border-radius: 25px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.toggle-btn svg {
    width: 16px;
    height: 16px;
}

.toggle-btn.active {
    background: var(--theme-primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--theme-primary-light);
}

/* ----------------------------------------------------
   CONTENIDO PRINCIPAL Y SPA VIEWS
   ---------------------------------------------------- */
.app-main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.app-view {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.app-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ----------------------------------------------------
   BOTONES Y ELEMENTOS DE NAVEGACIÓN
   ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 13px 24px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    width: auto;
    user-select: none;
    -webkit-user-select: none;
}

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

.btn-primary {
    background: var(--theme-primary);
    color: #fff;
    box-shadow: 0 4px 14px var(--theme-primary-light);
    margin-top: 10px;
}

.btn-primary:hover {
    background: var(--theme-primary-hover);
    box-shadow: 0 6px 18px var(--theme-primary-light);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97) translateY(0);
}

.btn-secondary {
    background: var(--neutral-200);
    color: var(--neutral-900);
}

.btn-secondary:hover {
    background: var(--neutral-300);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: scale(0.97) translateY(0);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: scale(0.97) translateY(0);
}

.btn-warning {
    background: var(--color-warning);
    color: white;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    filter: brightness(0.9);
}

.btn-info {
    background: var(--color-info);
    color: white;
}

.btn-info:hover {
    filter: brightness(0.9);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.icon-btn {
    background: var(--neutral-200);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--neutral-800);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--neutral-300);
    transform: scale(1.05);
}

/* ----------------------------------------------------
   VIEW 1: CALENDARIO E INTERACTIVIDAD DE CITAS
   ---------------------------------------------------- */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-selector h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--neutral-900);
    min-width: 180px;
    text-align: center;
}

.calendar-wrapper {
    background: var(--theme-card-bg);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    width: 100%;
}

/* Rejilla de Línea de Tiempo */
.timeline-container {
    display: grid;
    grid-template-columns: 70px 1fr;
    position: relative;
    max-height: 600px;
    overflow-y: auto;
    scroll-behavior: smooth;
    min-height: 480px;
}

.time-axis {
    display: flex;
    flex-direction: column;
    background: var(--neutral-100);
    border-right: 1px solid var(--neutral-200);
}

.time-axis-label {
    height: 80px; /* 1 hora = 80px */
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-500);
    border-bottom: 1px dashed var(--neutral-200);
}

.timeline-grid {
    position: relative;
    height: 100%;
    min-height: 800px; /* Para cubrir el día laboral */
    background: var(--neutral-50);
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.grid-line {
    height: 80px;
    border-bottom: 1px dashed var(--neutral-200);
}

.grid-line.lunch-break {
    background: rgba(220, 220, 220, 0.2);
}

/* Días No Laborales Bloqueados */
.timeline-grid.non-working-day::after {
    content: "Día No Laboral";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.03),
        rgba(0,0,0,0.03) 10px,
        rgba(0,0,0,0.06) 10px,
        rgba(0,0,0,0.06) 20px
    ), var(--neutral-200);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--neutral-500);
    pointer-events: all;
}

.appointments-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 0 10px;
}

/* Tarjeta de Cita Interactiva */
.appt-card {
    position: absolute;
    left: 10px;
    right: 10px;
    border-radius: var(--radius-md);
    background: var(--theme-card-bg);
    border-left: 5px solid var(--theme-primary);
    box-shadow: var(--shadow-sm);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
    cursor: grab;
    user-select: none;
    touch-action: none; /* Permite PointerEvents de arrastre y tap sin cancelaciones por scroll en móvil */
    z-index: 10;
    border: 1px solid var(--neutral-200);
    border-left-width: 5px;
}

.appt-card:active {
    cursor: grabbing;
    opacity: 0.9;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.appt-card.priority-alta {
    border-left-color: var(--color-danger);
}
.appt-card.priority-media {
    border-left-color: var(--theme-primary);
}
.appt-card.priority-baja {
    border-left-color: var(--color-info);
}

.appt-card.status-paused {
    border-left-color: var(--color-warning);
    background: repeating-linear-gradient(
        45deg,
        rgba(245, 158, 11, 0.05) 0px,
        rgba(245, 158, 11, 0.05) 10px,
        transparent 10px,
        transparent 20px
    ), var(--theme-card-bg);
}

.appt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.appt-vehicle {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.appt-time-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--neutral-500);
    background: var(--neutral-200);
    padding: 2px 6px;
    border-radius: 4px;
}

.appt-desc-text {
    font-size: 0.75rem;
    color: var(--neutral-600);
    margin: 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.appt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--neutral-500);
}

.appt-client {
    display: flex;
    align-items: center;
    gap: 4px;
}

.appt-client svg {
    width: 12px;
    height: 12px;
}

.appt-badges {
    display: flex;
    gap: 4px;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
}

.status-indicator-dot.paused {
    background: var(--color-warning);
    animation: pulse 1.5s infinite;
}

/* Tirador de Redimensión en Agenda */
.resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle::after {
    content: "";
    width: 30px;
    height: 3px;
    background: var(--neutral-300);
    border-radius: 2px;
}

/* ----------------------------------------------------
   VIEW 2: RECEPCIÓN Y FORMULARIO DE INGRESO
   ---------------------------------------------------- */
.sub-nav {
    display: flex;
    background: var(--neutral-100);
    padding: 6px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    gap: 4px;
}

.sub-nav-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.sub-nav-btn svg {
    width: 16px;
    height: 16px;
}

.sub-nav-btn.active {
    background: var(--theme-card-bg);
    color: var(--theme-primary);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-container {
    background: var(--theme-card-bg);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.form-container h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--neutral-900);
}

.responsive-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media(min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-group.full-width {
        grid-column: span 2;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-700);
}

.form-group select,
.form-group input,
.form-group textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-300);
    background: var(--neutral-50);
    color: var(--neutral-900);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px var(--theme-primary-light);
    background: var(--neutral-50);
}

.form-group select:disabled,
.form-group input:disabled,
.form-group textarea:disabled {
    background: var(--neutral-100);
    border-color: var(--neutral-200);
    color: var(--neutral-500);
    cursor: not-allowed;
    opacity: 0.85;
}

/* Rejilla de Formulario Auto-Adaptable (Mobile-First) */
.responsive-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

@media (min-width: 576px) {
    .responsive-form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .responsive-form-grid.grid-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Envoltorio premium con icono decorativo a la izquierda */
.premium-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.premium-input-wrapper svg {
    position: absolute;
    left: 14px;
    color: var(--neutral-500);
    width: 16px;
    height: 16px;
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 10;
}

.premium-input-wrapper select,
.premium-input-wrapper input,
.premium-input-wrapper textarea {
    padding-left: 42px !important;
}

.premium-input-wrapper:focus-within svg {
    color: var(--theme-primary);
}

.hidden {
    display: none !important;
}

/* Módulo Multimedia */
.multimedia-section,
.checklist-section {
    border-top: 1px solid var(--neutral-200);
    padding-top: 20px;
    margin-top: 10px;
}

.multimedia-section h3,
.checklist-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neutral-900);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.section-desc {
    font-size: 0.8rem;
    color: var(--neutral-500);
    margin-bottom: 16px;
}

.media-actions {
    margin-bottom: 12px;
}

.media-gallery {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 0;
    scrollbar-width: none; /* Ocultar barra Firefox */
}

.media-gallery::-webkit-scrollbar {
    display: none; /* Ocultar Chrome/Safari */
}

.media-photo-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    flex-shrink: 0;
}

.media-photo-wrapper .media-photo {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
    display: block;
}

.media-photo-wrapper:hover .media-photo {
    transform: scale(1.05);
}

.btn-remove-photo {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-danger);
    border: 2px solid var(--theme-card-bg);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), background var(--transition-fast);
    padding: 0;
}

.btn-remove-photo:hover {
    background: hsl(354, 70%, 45%);
    transform: scale(1.15);
}

.btn-remove-photo svg {
    width: 12px;
    height: 12px;
    stroke-width: 3;
}

.empty-gallery-msg, .empty-list-msg {
    font-size: 0.8rem;
    color: var(--neutral-500);
    font-style: italic;
    padding: 12px 0;
}

/* Checklist Visual y Auto interactivo */
.defect-selector {
    margin-bottom: 16px;
}

.selector-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--neutral-700);
    display: block;
    margin-bottom: 8px;
}

.defect-types {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.defect-type-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-300);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--neutral-50);
    color: var(--neutral-700);
    transition: all var(--transition-fast);
}

.defect-type-option.active {
    background: var(--theme-primary-light);
    border-color: var(--theme-primary);
    color: var(--neutral-900);
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.color-dot.scratch { background: var(--color-warning); }
.color-dot.dent { background: hsl(20, 95%, 55%); }
.color-dot.crack { background: var(--color-danger); }

.car-diagram-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.car-diagram {
    width: 100%;
    max-width: 650px; /* Incrementado para mejor visualización de las 6 vistas */
    background: var(--neutral-100);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    aspect-ratio: 800 / 520; /* Coincide exactamente con el viewBox del SVG */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.car-svg-wrapper {
    width: 95%;
    height: 95%;
    color: var(--neutral-600);
    transition: color var(--transition-normal);
}

.car-svg-wrapper svg {
    width: 100%;
    height: 100%;
}

/* Estilos para las partes interactivas del coche */
.interactive-part {
    fill: var(--neutral-200);
    fill-opacity: 0.05;
    stroke: var(--neutral-400);
    stroke-width: 1.2;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.interactive-part:hover {
    fill: var(--theme-primary);
    fill-opacity: 0.22;
    stroke: var(--theme-primary);
    stroke-width: 1.8;
    filter: drop-shadow(0 0 4px var(--theme-primary));
}

.interactive-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Clics pasan a través hacia el SVG */
    cursor: crosshair;
}

/* Pin interactivo en el coche */
.defect-pin {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    cursor: pointer;
    pointer-events: auto; /* IMPORTANTE: Habilitar clics en los pines */
    animation: pin-pulse 1.5s infinite;
}

.defect-pin.pin-scratch { background: var(--color-warning); }
.defect-pin.pin-dent { background: hsl(20, 95%, 55%); }
.defect-pin.pin-crack { background: var(--color-danger); }

.diagram-legend {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--neutral-500);
}

.defect-summary h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 8px;
}

.defect-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.defect-item {
    background: var(--neutral-100);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    border-left: 4px solid var(--neutral-300);
}

.defect-item.scratch { border-left-color: var(--color-warning); }
.defect-item.dent { border-left-color: hsl(20, 95%, 55%); }
.defect-item.crack { border-left-color: var(--color-danger); }

.btn-remove-defect {
    background: transparent;
    border: none;
    color: var(--neutral-500);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.btn-remove-defect:hover {
    color: var(--color-danger);
}

/* ----------------------------------------------------
   CLIENTES Y TRASPASO DE PROPIEDAD
   ---------------------------------------------------- */
.clients-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 768px) {
    .clients-layout {
        grid-template-columns: 320px 1fr;
    }
}

.clients-sidebar {
    background: var(--theme-card-bg);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 550px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--neutral-100);
    border-radius: var(--radius-md);
    padding: 0 12px;
}

.search-bar svg {
    color: var(--neutral-500);
    width: 16px;
    height: 16px;
}

.search-bar input {
    border: none;
    background: transparent;
    padding: 12px 8px;
    outline: none;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--neutral-900);
    width: 100%;
}

.clients-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.client-card-item {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.client-card-item:hover,
.client-card-item.active {
    border-color: var(--theme-primary);
    background: var(--theme-primary-light);
}

.client-card-item h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.client-card-item p {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

.client-detail-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    min-height: 400px;
}

.empty-detail-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--neutral-500);
    text-align: center;
    gap: 12px;
    padding: 60px 0;
}

.empty-detail-msg svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
}

/* Detalle Cliente Expandido */
.client-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--neutral-200);
    padding-bottom: 16px;
}

.client-profile-info h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.client-profile-info p {
    font-size: 0.8rem;
    color: var(--neutral-500);
}

.vehicles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media(min-width: 992px) {
    .vehicles-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.vehicle-profile-card {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vehicle-plate-badge {
    background: hsl(220, 30%, 10%);
    color: #fff;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 4px;
    border: 1px solid hsl(220, 10%, 40%);
    letter-spacing: 0.05em;
}

.vehicle-card-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.tech-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}

.history-item {
    background: var(--neutral-50);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--neutral-900);
}

.history-item-date {
    color: var(--neutral-500);
}

.history-item-desc {
    color: var(--neutral-600);
    margin-top: 3px;
}

.vehicle-actions-row {
    margin-top: 6px;
}

/* ----------------------------------------------------
   VIEW 3: TRABAJOS DE MECÁNICA Y PRIORIZACIÓN
   ---------------------------------------------------- */
.jobs-control {
    background: var(--theme-card-bg);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar .search-bar {
    flex: 1;
    min-width: 250px;
}

.sort-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-700);
}

.sort-selector select {
    max-width: 180px;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-300);
    background: var(--neutral-50);
    color: var(--neutral-900);
    font-family: var(--font-primary);
    font-size: 0.85rem;
}

.jobs-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media(min-width: 768px) {
    .jobs-list {
        grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    }
}

.job-card {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.job-card:hover {
    transform: translateY(-2px);
    border-color: var(--theme-primary);
}

.job-card.priority-high {
    border-top: 4px solid var(--color-danger);
}
.job-card.priority-medium {
    border-top: 4px solid var(--theme-primary);
}
.job-card.priority-low {
    border-top: 4px solid var(--color-info);
}

.job-card.completed {
    opacity: 0.82;
    border-top: 4px solid var(--neutral-400) !important;
    background: var(--neutral-50);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.job-card-vehicle {
    font-weight: 700;
    color: var(--neutral-900);
    font-size: 0.95rem;
}

.priority-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.priority-badge.high { background: rgba(220, 38, 38, 0.1); color: var(--color-danger); }
.priority-badge.medium { background: var(--theme-primary-light); color: var(--theme-primary); }
.priority-badge.low { background: rgba(14, 165, 233, 0.1); color: var(--color-info); }

.job-card-body p {
    font-size: 0.8rem;
    color: var(--neutral-600);
}

.job-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.job-status-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
}

.job-status-pill.status-in-progress {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
}

.job-status-pill.status-paused {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
}

.job-status-pill.status-completed {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

/* ----------------------------------------------------
   VIEW 4: ESTADÍSTICAS Y DASHBOARD
   ---------------------------------------------------- */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.stats-filters {
    display: flex;
    gap: 8px;
}

.form-control-sm {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-300);
    background: var(--neutral-50);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    color: var(--neutral-900);
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media(min-width: 576px) {
    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media(min-width: 992px) {
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.kpi-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.total-jobs-icon { background: rgba(82, 108, 255, 0.15); color: hsl(230, 85%, 60%); }
.revenue-icon { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.active-jobs-icon { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.efficiency-icon { background: rgba(20, 219, 186, 0.15); color: hsl(172, 85%, 45%); }

.kpi-info {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-500);
}

.kpi-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--neutral-900);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr 1fr;
    }
    .chart-card.full-width {
        grid-column: span 2;
    }
}

.chart-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 240px;
}

/* ----------------------------------------------------
   VIEW 5: CONFIGURACIÓN
   ---------------------------------------------------- */
.config-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 768px) {
    .config-layout {
        grid-template-columns: 240px 1fr;
    }
}

.config-nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.config-nav::-webkit-scrollbar {
    display: none;
}

@media(min-width: 768px) {
    .config-nav {
        flex-direction: column;
        overflow-x: visible;
    }
    .config-nav-btn {
        width: 100%;
    }
}

.config-nav-btn {
    border: none;
    background: transparent;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 10px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.config-nav-btn.active {
    background: var(--theme-card-bg);
    color: var(--theme-primary);
    box-shadow: var(--shadow-sm);
}

.config-content {
    background: var(--theme-card-bg);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.config-section-wrapper {
    display: none;
}

.config-section-wrapper.active {
    display: block;
}

.config-header-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.config-card {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 16px;
}

.config-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 6px;
}

.desc-card {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-bottom: 12px;
}

/* Horarios Semanales Grid */
.weekly-schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
    gap: 8px;
}

.schedule-day-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--neutral-900);
    min-width: 100px;
}

.schedule-times {
    display: flex;
    align-items: center;
    gap: 6px;
}

.schedule-times select {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--neutral-300);
    background: var(--neutral-50);
    color: var(--neutral-900);
    font-size: 0.8rem;
}

/* Interruptor Deslizable (Switch) */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-switch {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--neutral-300);
    transition: .3s;
    border-radius: 24px;
}

.slider-switch:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider-switch {
    background-color: var(--theme-primary);
}

input:checked + .slider-switch:before {
    transform: translateX(20px);
}

/* Calendario Mensual Config */
.monthly-calendar-config {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 10px;
    text-align: center;
}

.cal-config-header {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--neutral-500);
    padding: 6px 0;
}

.cal-config-day {
    padding: 10px 0;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cal-config-day:hover {
    background: var(--neutral-200);
}

.cal-config-day.non-working {
    background: repeating-linear-gradient(
        45deg,
        rgba(239, 68, 68, 0.05),
        rgba(239, 68, 68, 0.05) 5px,
        rgba(239, 68, 68, 0.1) 5px,
        rgba(239, 68, 68, 0.1) 10px
    ), var(--neutral-100);
    border-color: var(--color-danger);
    color: var(--color-danger);
}

.cal-config-day.empty-day {
    background: transparent;
    border: none;
    cursor: default;
    pointer-events: none;
}

/* Opciones Modernas Radio & Checkbox */
.radio-group-modern,
.checkbox-group-modern {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label, .check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-800);
}

.radio-label input,
.check-label input {
    display: none;
}

.radio-custom,
.check-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--neutral-500);
    display: inline-block;
    transition: all var(--transition-fast);
}

.radio-custom { border-radius: 50%; }
.check-custom { border-radius: var(--radius-sm); }

input:checked + .radio-custom {
    border-color: var(--theme-primary);
    border-width: 6px;
    background: white;
}

input:checked + .check-custom {
    border-color: var(--theme-primary);
    background: var(--theme-primary);
    position: relative;
}

input:checked + .check-custom::after {
    content: "✓";
    color: white;
    font-size: 0.75rem;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

input:disabled + .check-custom,
input:disabled ~ .label-text {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tabla de Repuestos */
.parts-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
}

.parts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.parts-table th,
.parts-table td {
    padding: 12px;
    border-bottom: 1px solid var(--neutral-200);
}

.parts-table th {
    background: var(--neutral-100);
    font-weight: 700;
    color: var(--neutral-700);
}

.parts-table td {
    color: var(--neutral-800);
}

/* ----------------------------------------------------
   BOTTOM NAV BAR (NATIVO EN MÓVIL)
   ---------------------------------------------------- */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + var(--safe-area-bottom));
    background: var(--theme-card-bg);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border-top: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: var(--safe-area-bottom);
    z-index: 99;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
    transition: background var(--transition-normal);
}

.nav-item {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--neutral-500);
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    gap: 4px;
    transition: all var(--transition-fast);
    flex: 1;
    padding: 8px 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.nav-item.active {
    color: var(--theme-primary);
}

.nav-item.active svg {
    transform: translateY(-2px);
}

/* Ajuste Responsivo para Tablets y PC */
@media(min-width: 768px) {
    .app-container {
        padding-bottom: 0;
    }
    
    .app-bottom-nav {
        top: calc(77px); /* Colocar abajo del header */
        bottom: auto;
        left: 0;
        width: 70px;
        height: calc(100vh - 77px);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 20px;
        gap: 20px;
        border-top: none;
        border-right: 1px solid var(--neutral-200);
    }

    .app-main-content {
        padding-left: 90px; /* Desplazar para dar espacio al Bottom Nav que ahora es lateral */
    }

    .nav-item {
        flex: none;
        width: 100%;
    }
}

/* ----------------------------------------------------
   MODALES (GLASSMORPHISM Y DISEÑO MÓVIL)
   ---------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end; /* En móvil sale desde abajo */
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.modal-card {
    background: var(--theme-card-bg);
    backdrop-filter: var(--blur-glass);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

@media(min-width: 576px) {
    .modal-overlay {
        align-items: center; /* En PC se centra */
    }
    .modal-card {
        border-radius: var(--radius-lg);
        width: 90%;
        max-width: 500px;
        transform: scale(0.9);
        max-height: 90vh;
    }
    .modal-card.modal-sm {
        max-width: 400px;
    }
    .modal-overlay.active .modal-card {
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.close-btn {
    border: none;
    background: transparent;
    color: var(--neutral-600);
    cursor: pointer;
}

.modal-body {
    padding: 20px 24px 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-info-text {
    font-size: 0.85rem;
    color: var(--neutral-600);
    margin-bottom: 16px;
}

.transfer-warning-box {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--color-danger);
    padding: 10px;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--color-danger);
    margin: 16px 0;
}

.transfer-warning-box svg {
    flex-shrink: 0;
}

/* Detalles Cita Modal */
.detail-badge-row {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

#detail-category-badge { background: var(--theme-primary-light); color: var(--theme-primary); }
#detail-priority-badge { background: var(--neutral-200); color: var(--neutral-700); }
.status-badge { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }

.detail-info-group h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--neutral-900);
}

.detail-info-group p {
    font-size: 0.8rem;
    color: var(--neutral-600);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.detail-description {
    margin: 16px 0;
}

.detail-description h5,
.detail-defects h5,
.mecanica-assignment-section h6,
.appointment-photos-section h5 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-bottom: 6px;
}

.detail-description p {
    font-size: 0.8rem;
    color: var(--neutral-700);
}

.defect-pills {
    list-style: none;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.defect-pill {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--neutral-200);
    color: var(--neutral-700);
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.defect-pill.scratch {
    background: hsla(35, 92%, 52%, 0.12);
    color: hsl(35, 90%, 40%);
}

.defect-pill.dent {
    background: hsla(20, 95%, 55%, 0.12);
    color: hsl(20, 90%, 45%);
}

.defect-pill.crack {
    background: hsla(354, 76%, 45%, 0.12);
    color: hsl(354, 76%, 42%);
}

.mecanica-only-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pause-control-row {
    margin-top: 10px;
}

.parts-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.parts-search-row select {
    flex: 1;
}

.assigned-parts-list-wrapper {
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    max-height: 150px;
    overflow-y: auto;
}

.assigned-parts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    text-align: left;
}

.assigned-parts-table th,
.assigned-parts-table td {
    padding: 8px;
    border-bottom: 1px solid var(--neutral-200);
}

.assigned-parts-table th {
    background: var(--neutral-100);
}

.parts-total-cost-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin-top: 8px;
}

.appointment-gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
}

.appointment-photo-item {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* Estilos de Mecánica Avanzada y Controles de Facturación */
.mecanica-only-section .assigned-parts-table {
    width: 100%;
    border-collapse: collapse;
}
.mecanica-only-section .assigned-parts-table th {
    background: var(--neutral-100);
    color: var(--neutral-700);
    font-weight: 600;
    border-bottom: 1px solid var(--neutral-200);
}
.mecanica-only-section .assigned-parts-table td {
    background: transparent;
    color: var(--neutral-800);
    border-bottom: 1px solid var(--neutral-200);
    font-size: 0.8rem;
}
.mecanica-only-section .assigned-parts-table tr:hover td {
    background: var(--theme-primary-light);
}
.mecanica-only-section .empty-list-msg {
    color: var(--neutral-500) !important;
    font-style: italic;
}

/* Lavado Avanzada y Controles de Facturación */
.lavado-only-section .assigned-parts-table th {
    background: var(--neutral-100);
    color: var(--neutral-700);
    font-weight: 600;
    border-bottom: 1px solid var(--neutral-200);
}
.lavado-only-section .assigned-parts-table td {
    background: transparent;
    color: var(--neutral-800);
    border-bottom: 1px solid var(--neutral-200);
    font-size: 0.8rem;
}
.lavado-only-section .assigned-parts-table tr:hover td {
    background: var(--theme-primary-light);
}
.lavado-only-section .empty-list-msg {
    color: var(--neutral-500) !important;
    font-style: italic;
}

/* ----------------------------------------------------
   ANIMACIONES Y MEJORAS TÁCTILES
   ---------------------------------------------------- */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pin-pulse {
    0% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(0,0,0,0.4); }
    70% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 0 6px rgba(0,0,0,0); }
    100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}

/* Utilidades */
.hr {
    border: 0;
    height: 1px;
    background: var(--neutral-200);
    margin: 16px 0;
}

hr {
    border: none;
    border-top: 1px solid var(--neutral-200);
    margin: 16px 0;
}

/* ----------------------------------------------------
   FASE 9: EXCEPCIONES DE HORARIO Y GESTIÓN DE BLOQUES
   ---------------------------------------------------- */
.partial-block-overlay {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 5;
    background: repeating-linear-gradient(
        45deg,
        rgba(239, 68, 68, 0.08),
        rgba(239, 68, 68, 0.08) 10px,
        rgba(239, 68, 68, 0.15) 10px,
        rgba(239, 68, 68, 0.15) 20px
    );
    border-top: 1.5px solid rgba(239, 68, 68, 0.4);
    border-bottom: 1.5px solid rgba(239, 68, 68, 0.4);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: all 0.2s ease;
}

.partial-block-overlay::after {
    content: "⚠️ HORARIO BLOQUEADO (" attr(data-time) ")";
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 800;
    color: hsl(354, 76%, 42%);
    background: rgba(255, 255, 255, 0.9);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
}

/* Día con bloqueo parcial en ajustes */
.cal-config-day.partial-blocked {
    border: 2px solid var(--color-warning) !important;
    background: repeating-linear-gradient(
        45deg,
        rgba(245, 158, 11, 0.08),
        rgba(245, 158, 11, 0.08) 5px,
        transparent 5px,
        transparent 10px
    ) !important;
    color: hsl(35, 90%, 40%) !important;
    font-weight: 700 !important;
    position: relative;
}

.cal-config-day.partial-blocked::after {
    content: "";
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-warning);
}

/* Gestión de bloques en Ajustes */
.blocks-management-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.blocks-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
}

.block-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--neutral-800);
    font-weight: 500;
    transition: all 0.2s ease;
}

.block-item:hover {
    border-color: var(--neutral-300);
    background: var(--neutral-200);
}

.btn-delete-block {
    background: none;
    border: none;
    color: var(--neutral-500);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.btn-delete-block:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
}

.inline-add-block-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    background: var(--neutral-50);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--neutral-200);
}

.inline-input-group {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--neutral-300);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding-right: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.inline-input-group:focus-within {
    border-color: var(--theme-primary);
}

.inline-input-group input {
    border: none;
    outline: none;
    padding: 6px 10px;
    width: 80px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-800);
    background: transparent;
}

.input-suffix {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-500);
    user-select: none;
}

/* Margen superior para botones de registro y acciones de formulario */
.form-actions {
    margin-top: 24px;
}

/* ----------------------------------------------------
   MÓDULO DE LOGIN ADMINISTRATIVO (PREMIUM)
   ---------------------------------------------------- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    background: linear-gradient(135deg, hsl(222, 25%, 6%) 0%, hsl(220, 30%, 12%) 100%);
    overflow: hidden;
    font-family: var(--font-primary);
}

.login-background-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(20, 219, 186, 0.15) 0%, rgba(74, 124, 238, 0.05) 50%, transparent 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(80px);
    z-index: 1;
    pointer-events: none;
    animation: pulseGlow 10s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.login-card {
    background: rgba(26, 32, 46, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    background: rgba(20, 219, 186, 0.12);
    color: var(--theme-primary, hsl(172, 85%, 45%));
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid rgba(20, 219, 186, 0.25);
    box-shadow: 0 8px 24px rgba(20, 219, 186, 0.15);
}

.login-logo-icon {
    width: 30px;
    height: 30px;
}

.login-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--neutral-500);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(17, 24, 39, 0.5);
    color: #ffffff;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-fast);
}

.login-input-wrapper input:focus {
    border-color: var(--theme-primary, hsl(172, 85%, 45%));
    background: rgba(17, 24, 39, 0.8);
    box-shadow: 0 0 0 3px rgba(20, 219, 186, 0.15);
}

.login-input-icon {
    position: absolute;
    left: 14px;
    color: var(--neutral-500);
    width: 20px;
    height: 20px;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.login-input-wrapper input:focus + .login-input-icon {
    color: var(--theme-primary, hsl(172, 85%, 45%));
}

.btn-toggle-password {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--neutral-500);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.btn-toggle-password:hover {
    color: #ffffff;
}

.login-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    color: var(--neutral-500);
    transition: color var(--transition-fast);
}

.remember-me-label:hover {
    color: #ffffff;
}

.remember-me-label input {
    display: none;
}

.remember-me-label .checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(17, 24, 39, 0.5);
    display: inline-block;
    position: relative;
    transition: all var(--transition-fast);
}

.remember-me-label input:checked + .checkbox-custom {
    background: var(--theme-primary, hsl(172, 85%, 45%));
    border-color: var(--theme-primary, hsl(172, 85%, 45%));
}

.remember-me-label input:checked + .checkbox-custom::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn-login {
    margin-top: 12px;
    padding: 14px 20px;
    font-size: 0.95rem;
    background: var(--theme-primary, hsl(172, 85%, 45%));
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(20, 219, 186, 0.2);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(20, 219, 186, 0.35);
    background: var(--theme-primary-hover, hsl(172, 85%, 38%));
}

.btn-login:active {
    transform: translateY(0);
}

/* ====================================================
   AJUSTES RESPONSIVOS PARA DISPOSITIVOS MÓVILES (MÁXIMO ANCHO)
   ==================================================== */
@media (max-width: 767px) {
    .app-header {
        padding: 12px 14px;
    }
    .brand-info .sub-title {
        display: none !important;
    }
    .brand-info h1 {
        font-size: 1.1rem !important;
    }
    .toggle-btn span {
        display: none !important;
    }
    .header-actions {
        gap: 8px !important;
    }
    .config-content {
        padding: 14px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    .config-card {
        padding: 12px !important;
    }
    .config-header-btn {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
    .config-header-btn h2 {
        font-size: 1.15rem !important;
    }
    .parts-table-wrapper, .table-container {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* ====================================================
   TRABAJOS PENDIENTES Y COLA DE ESPERA
   ==================================================== */
.jobs-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

@media (min-width: 992px) {
    .jobs-layout-grid {
        grid-template-columns: 1.3fr 0.7fr;
        gap: 24px;
    }
}

.pending-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar personalizado para la cola de pendientes */
.pending-jobs-list::-webkit-scrollbar {
    width: 6px;
}
.pending-jobs-list::-webkit-scrollbar-track {
    background: transparent;
}
.pending-jobs-list::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 3px;
}
.pending-jobs-list::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

.autocomplete-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--theme-card-bg);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    padding: 6px 0;
}

/* Modal layers override for child/nested modals */
#add-client-modal,
#add-vehicle-modal {
    z-index: 1100;
}

/* Global Premium Minimalist Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

/* ====================================================
   REGISTRO MULTIPASO WIZARD (GLASSMORPHIC)
   ==================================================== */
.wizard-step-node {
    transition: all 0.3s ease;
    cursor: default;
}
.wizard-step-node.active {
    background: var(--theme-primary) !important;
    color: #fff !important;
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 12px var(--theme-primary);
}
.wizard-step-node.completed {
    background: var(--color-success) !important;
    color: #fff !important;
    border-color: var(--color-success) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.plan-card {
    transition: all 0.2s ease;
}
.plan-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
}
.plan-card.active {
    border: 2px solid var(--theme-primary) !important;
    background: rgba(20, 219, 186, 0.08) !important;
    box-shadow: 0 0 15px rgba(20, 219, 186, 0.15);
}
#reg-packages-tbody tr:hover, #reg-users-tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

#reg-map-picker {
    transition: height 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

#reg-map-picker.expanded {
    height: 360px !important;
}

/* ====================================================
   GLOBAL PREMIUM LOADING OVERLAY
   ==================================================== */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 23, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.global-loader.active {
    opacity: 1;
    pointer-events: all;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transform: scale(0.9);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.global-loader.active .loader-content {
    transform: scale(1);
}

.loader-spinner {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--theme-primary) 0%, hsl(230, 85%, 60%) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: spin-loader 1s linear infinite;
    box-shadow: 0 0 20px rgba(20, 219, 186, 0.4);
}

.loader-spinner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    background: inherit;
    filter: blur(8px);
    opacity: 0.8;
    z-index: -1;
}

.loader-text {
    font-family: var(--font-primary), sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.5px;
    animation: loader-pulse 2s infinite ease-in-out;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes spin-loader {
    to { transform: rotate(360deg); }
}

@keyframes loader-pulse {
    0%, 100% { opacity: 0.6; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

/* ====================================================
   CUSTOM CONFIRM MODAL OVERLAY & CARD
   ==================================================== */
#custom-confirm-modal {
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#custom-confirm-modal.active {
    opacity: 1 !important;
}

#custom-confirm-modal.active .modal-card {
    transform: scale(1) !important;
}

/* ====================================================
   VEHICLE EDIT PHOTO GALLERY STYLE
   ==================================================== */
.edit-photo-gallery-item {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--neutral-200);
}

.edit-photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.edit-photo-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 10;
    font-weight: 800;
    line-height: 1;
}

.edit-photo-delete-btn:hover {
    background: #dc2626;
}

/* ====================================================
   MODERN PREMIUM JOB-CARD STYLING
   ==================================================== */
.job-card {
    background: var(--theme-card-bg);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    cursor: pointer;
}

.job-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--theme-primary-light);
}

.job-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--neutral-300);
}

.job-card.priority-high::before {
    background: var(--color-danger);
}

.job-card.priority-medium::before {
    background: var(--color-warning);
}

.job-card.priority-low::before {
    background: var(--color-success);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--neutral-100);
    padding-bottom: 10px;
}

.job-card-vehicle {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--neutral-900);
}

.vehicle-plate-badge {
    background: var(--neutral-800);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.priority-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
}

.priority-badge.medium {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
}

.priority-badge.low {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-success);
}

.job-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.job-card-body p {
    font-size: 0.82rem;
    color: var(--neutral-700);
    line-height: 1.4;
    margin: 0;
}

.job-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--neutral-200);
    padding-top: 12px;
    margin-top: auto;
    gap: 12px;
    flex-wrap: nowrap;
}

.job-status-row > div {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.job-status-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.job-status-pill.status-in-progress {
    background: rgba(20, 219, 186, 0.12);
    color: var(--theme-primary);
}

.job-status-pill.status-paused {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
}

.job-status-pill.status-completed {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-success);
}

/* Standarized buttons inside cards */
.job-status-row .btn {
    height: 34px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    padding: 0 12px !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.job-status-row .btn-secondary {
    background: var(--neutral-100) !important;
    color: var(--neutral-800) !important;
    border: 1px solid var(--neutral-300) !important;
}

.job-status-row .btn-secondary:hover:not(:disabled) {
    background: var(--neutral-200) !important;
    border-color: var(--neutral-400) !important;
}

.job-status-row .btn-primary {
    background: var(--theme-primary) !important;
    color: white !important;
    border: 1px solid var(--theme-primary) !important;
}

.job-status-row .btn-primary:hover:not(:disabled) {
    background: var(--theme-primary-hover) !important;
    transform: translateY(-1px);
}

/* ====================================================
   VEHICLE DEFECTS CHECKLIST DRAWING CANVAS
   ==================================================== */
#car-diagram-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    touch-action: none; /* Previene scroll en móviles mientras se dibuja */
    cursor: crosshair;
}

.defect-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 15px;
    gap: 12px;
}

.btn-undo-draw {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--neutral-100);
    color: var(--neutral-800);
    border: 1px solid var(--neutral-300);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-undo-draw:hover:not(:disabled) {
    background: var(--neutral-200);
    border-color: var(--neutral-400);
}

.btn-undo-draw:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====================================================
   SUBTLE SYNC BANNER/TOAST STYLES
   ==================================================== */
.sync-banner {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sync-banner.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sync-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--theme-primary, #14dbba);
    border-radius: 50%;
    animation: spin-loader 0.8s linear infinite;
    display: inline-block;
}







