:root {
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --fab-color: #3b82f6;
    --radius: 12px;
    --transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --status-pending: #f59e0b;
    --status-pending-bg: #fef3c7;
    --status-complete: #10b981;
    --status-complete-bg: #d1fae5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.top-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-btn, a.nav-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-btn:hover {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    margin-bottom: 1.5rem;
}

.view-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f9fafb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

td {
    font-size: 0.9rem;
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

.clickable-rows tbody tr {
    cursor: pointer;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending);
}

.badge-complete {
    background-color: var(--status-complete-bg);
    color: var(--status-complete);
}

.badge-platform {
    background: #e0e7ff; 
    color: #3730a3;
}

/* Inline actions */
.btn-inline {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}
.btn-inline:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    color: #ef4444 !important;
    border-color: #fca5a5 !important;
}

.btn-danger:hover {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #dc2626 !important;
}

/* Botones de acción en Repuestos (Estilo FAB destacado) */
.stock-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-stock-action {
    border: none;
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s, background-color 0.2s;
}

.btn-stock-action:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.btn-stock-action:active {
    transform: translateY(0) scale(0.98);
}

.btn-stock-add {
    background-color: var(--fab-color);
    color: white;
}

.btn-stock-add:hover {
    background-color: var(--primary-hover);
}

.btn-stock-delete {
    background-color: #ef4444;
    color: white;
}

.btn-stock-delete:hover {
    background-color: #dc2626;
}

/* Imágenes 128x128 y Badges en Repuestos */
.stock-img-128 {
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    display: block;
}

.stock-img-placeholder-128 {
    width: 128px;
    height: 128px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2.2rem;
}

.stock-badge {
    font-size: 0.9rem !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
}

/* Stepper de Cantidad (Disponible con Flechas) */
.quantity-stepper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 4px 8px;
    box-shadow: var(--shadow-sm);
}

.btn-qty-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-qty-step:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-qty-step:active {
    transform: scale(0.95);
}

/* FAB */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--fab-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
    z-index: 100;
}

.fab.active {
    display: flex;
}

.fab:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s linear;
    z-index: 1000;
}

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

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translate3d(0, 20px, 0) scale(0.96);
    transition: transform 0.25s ease;
    will-change: transform;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-lg {
    max-width: 700px;
}

.modal-overlay.active .modal-content {
    transform: translate3d(0, 0, 0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Detalles Cliente */
.detalles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.detalles-section {
    margin-bottom: 1.5rem;
}

.det-text-box {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.det-fotos-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.det-foto-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.det-foto-thumb:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.detalles-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="number"],
textarea,
input[type="file"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #f9fafb;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: var(--card-bg);
}

.btn-submit {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.btn-submit:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    padding: 0.75rem 1.25rem;
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-outline:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Botón Eliminar Cliente (Danger) */
.btn-outline.btn-danger {
    background-color: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

.btn-outline.btn-danger:hover {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

#btn-toggle-estado:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.2);
}

/* Image previews in tables */
.img-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* Image Viewer (Lightbox) */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-viewer.active {
    opacity: 1;
    pointer-events: all;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.iv-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2010;
}

.iv-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 2010;
}

.iv-nav:hover {
    background: rgba(255,255,255,0.3);
}

.iv-prev {
    left: 20px;
}

.iv-next {
    right: 20px;
}

/* Gamepad Tester Styles - Legacy (kept for switch/slider) */
.switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }

/* ── Gamepad Tester Layout ─────────────────────────────── */

/* Card */
.gp-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem 2rem 1.5rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-md);
}
.gp-card-body {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}
.gp-left {
    flex: 1.3;
    min-width: 0;
}
.gp-right {
    flex: 1;
    min-width: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 1rem;
}

/* Header — big name like hardwaretester */
.gp-header-info { margin-bottom: 1.4rem; }
.gp-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1.1;
}
.gp-id-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Stats row */
.gp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}
.gp-stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 3px;
    text-transform: uppercase;
}
.gp-stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

/* Buttons grid */
.gp-buttons-grid {
    display: grid !important;
    grid-template-columns: repeat(9, 1fr) !important;
    gap: 6px !important;
    max-width: 100% !important;
    margin-bottom: 1.4rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}
.gp-btn-cell {
    position: relative;
    overflow: hidden;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    margin: 0 auto;
    transition: border-color 0.1s;
}
.gp-btn-fill {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: #c7d2fe;
    height: 0%;
    z-index: 0;
}
.gp-btn-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.gp-btn-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
}
.gp-btn-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    display: block;
}

/* Circularity */
.gp-circularity-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.circularity-poly {
    fill: rgba(139, 92, 246, 0.4); /* purple tint to match reference */
    stroke: rgba(139, 92, 246, 0.8);
    stroke-width: 0.02;
    transition: all 0.1s linear;
}
.circularity-error-label {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 800;
    font-family: 'Inter', 'Roboto', sans-serif;
    text-align: center;
}
.circularity-error-val {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 900;
    font-family: 'Inter', 'Roboto', sans-serif;
    text-align: center;
}
.gp-btn-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    display: block;
}

/* Sticks row */
.gp-sticks-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 2.5rem !important;
    max-width: 100% !important;
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-start !important;
    align-items: flex-start !important;
}
.gp-stick {
    display: flex;
    flex-direction: column;
}
.gp-stick-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}
.gp-stick-content {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    min-width: max-content;
}
.gp-stick-axes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90px;
    flex-shrink: 0;
}
.gp-axis-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gp-axis-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.gp-axis-val {
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    display: block;
    width: 90px;
    white-space: nowrap;
    overflow: hidden;
}
.gp-stick-svg {
    display: block;
    border-radius: 50%;
}

/* Decimal toggle */
.gp-decimal-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}
.gp-label-xs {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Vibration section */
.gp-vib-section { display: flex; flex-direction: column; gap: 0.5rem; }
.gp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.gp-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: var(--font);
    color: #374151;
    cursor: pointer;
    transition: all 0.18s ease;
}
.gp-action-btn i { font-size: 1rem; }
.gp-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

@media (max-width: 900px) {
    .gp-card-body { flex-direction: column; }
    .gp-right { flex: 1; max-width: 100%; }
}

/* ── Modales de Diálogo Personalizados (Confirm, Prompt, Alert) ── */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.custom-modal-card {
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    border-radius: 18px;
    padding: 2rem 1.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    transform: scale(0.92) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.custom-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 1.25rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.custom-modal-icon.primary {
    background: #eff6ff;
    color: #2563eb;
}

.custom-modal-icon.danger {
    background: #fef2f2;
    color: #ef4444;
}

.custom-modal-icon.warning {
    background: #fffbeb;
    color: #f59e0b;
}

.custom-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.custom-modal-message {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.custom-modal-input-group {
    margin-bottom: 1.5rem;
}

.custom-modal-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.custom-modal-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.custom-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-modal {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn-modal-cancel {
    background: #f1f5f9;
    color: #475569;
}

.btn-modal-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-modal-primary {
    background: #2563eb;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-modal-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-modal-danger {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-modal-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* Stock Selector & Repuestos Usados en Clientes */
.stock-selector-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: background 0.15s;
}

.stock-selector-item:hover {
    background: #f1f5f9;
}

.repuestos-cliente-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0.5rem;
}

.repuesto-used-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.repuesto-used-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.repuesto-used-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.repuesto-used-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-qty-mini {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}

.btn-qty-mini:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-remove-used-stock {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s;
    margin-left: 4px;
}

.btn-remove-used-stock:hover {
    background: #fef2f2;
}

/* Repuestos Bloqueados (Fijos) vs Borradores */
.repuesto-locked {
    background: #fafafa;
    border: 1px solid #e2e8f0;
}

.repuesto-draft {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.badge-locked-tag {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Badges de Garantía (Contador / Expiró) */
.badge-warranty {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    font-size: 0.85rem !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
}

.badge-expired {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    font-size: 0.85rem !important;
    padding: 5px 12px !important;
    border-radius: 20px !important;
}

/* Image Previews */
.image-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    padding: 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}

.image-preview-thumb {
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 2px solid white;
}

.image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}

.image-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid white;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cuadro "Añadir Foto" (Mismo tamaño que las fotos 80x80) */
.det-foto-add-card {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: #f8fafc;
    border: 2px dashed #94a3b8;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.det-foto-add-card svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary-color);
    transition: transform 0.2s ease;
}

.det-foto-add-card:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: scale(1.03);
}

.det-foto-add-card:hover svg {
    transform: scale(1.15);
}

/* Botón Rectangular "Agregar Repuesto" */
.repuesto-add-btn-row {
    width: 100%;
    height: 48px;
    border-radius: 10px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.repuesto-add-btn-row svg {
    width: 22px;
    height: 22px;
    stroke: var(--primary-color);
    transition: transform 0.2s ease;
}

.repuesto-add-btn-row:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: translateY(-1px);
}

.repuesto-add-btn-row:hover svg {
    transform: scale(1.15);
}

.det-foto-wrapper {
    position: relative;
    display: inline-block;
}

.det-foto-wrapper .btn-delete-foto {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.det-foto-wrapper:hover .btn-delete-foto {
    opacity: 1;
}

.det-foto-wrapper .btn-delete-foto:hover {
    transform: scale(1.15);
    background: #dc2626;
}

/* Botón Captura de Gamepad */
.btn-screenshot-gamepad {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: var(--transition);
    z-index: 10;
}

.btn-screenshot-gamepad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
