:root {
    --bg-primary: #f5f5f7;
    --bg-white: #ffffff;
    --bg-gray: #f0f0f2;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #a1a1a6;
    --accent: #ff6b35;
    --accent-secondary: #f7931e;
    --accent-green: #34c759;
    --accent-red: #ff3b30;
    --accent-blue: #007aff;
    --accent-purple: #af52de;
    --accent-yellow: #ffcc00;
    --border-color: rgba(0,0,0,0.08);
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
}

.top-bar {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    padding: 20px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.top-bar-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.top-bar h1 {
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar h1 svg { width: 24px; height: 24px; }

.top-bar-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-badge {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-badge svg { width: 16px; height: 16px; }

.top-bar-actions a {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.top-bar-actions a:hover { background: rgba(255,255,255,0.3); }

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: var(--bg-white);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
}

.tab-btn:hover { background: var(--bg-gray); }

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: white;
}

.tab-btn svg { width: 18px; height: 18px; }

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

.filters-card {
    background: var(--bg-white);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filters-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

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

.filter-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-gray);
    min-width: 160px;
    transition: all 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
    background: var(--bg-white);
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green) 0%, #30b350 100%);
    color: white;
}

.btn-secondary {
    background: var(--bg-gray);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--accent-red) 0%, #ff453a 100%);
    color: white;
}

.btn-blue {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #5856d6 100%);
    color: white;
}

.btn-wa {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    min-width: auto !important;
    flex: 0 !important;
    padding: 10px 12px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

.btn-add-catalog {
    padding: 8px;
    min-width: 36px;
    justify-content: center;
    background: var(--accent-green);
    color: white;
    border-radius: 8px;
}

/* Input with button */
.input-with-btn {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-btn select,
.input-with-btn input[type="text"] {
    flex: 1;
}

/* Vehicles Grid */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.vehicle-card {
    background: var(--bg-white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.vehicle-image {
    height: 180px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    position: relative;
}

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

.vehicle-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-disponible { background: var(--accent-green); color: white; }
.badge-colocado { background: var(--accent-purple); color: white; }
.badge-taller { background: var(--accent-secondary); color: white; }
.badge-vendido { background: var(--text-tertiary); color: white; }
.badge-perdido { background: var(--accent-red); color: white; }
.badge-perdida-total { background: #8e0000; color: white; }
.badge-aduana { background: #795548; color: white; }
.badge-reservado { background: var(--accent-blue); color: white; }
.badge-decomizado { background: #37474f; color: white; }

.vehicle-content { padding: 18px; }

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.vehicle-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.vehicle-placa {
    background: var(--bg-gray);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
}

.vehicle-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.vehicle-details .detail-label { color: var(--text-tertiary); }

.vehicle-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 14px;
}

.vehicle-arrendadora {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Dashboard charts */
.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}
.chart-bar-label {
    width: 120px;
    text-align: right;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.chart-bar-track {
    flex: 1;
    background: var(--bg-gray);
    border-radius: 6px;
    height: 24px;
    overflow: hidden;
}
.chart-bar-fill {
    height: 100%;
    border-radius: 6px;
    min-width: 2px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}
.chart-bar-value {
    width: 50px;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
}

.btn.saving {
    pointer-events: none;
    opacity: 0.7;
}
.btn.saving::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

mark.search-highlight {
    background: #fde047;
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
}

.vehicle-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vehicle-actions .btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 14px;
    font-size: 13px;
    justify-content: center;
}

/* Catalogs Section */
.catalogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.catalog-card {
    background: var(--bg-white);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.catalog-header {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #5856d6 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.catalog-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.catalog-count {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
}

.catalog-body {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.catalog-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-gray);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.catalog-item:last-child { margin-bottom: 0; }

.catalog-item-actions {
    display: flex;
    gap: 6px;
}

.catalog-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.catalog-item-actions button:hover {
    background: var(--bg-white);
}

.catalog-item-actions button.delete:hover {
    color: var(--accent-red);
}

.catalog-item-actions button svg {
    width: 16px;
    height: 16px;
}

.catalog-add {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.catalog-add input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.catalog-add input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show { display: flex; }

.modal-content {
    background: var(--bg-white);
    border-radius: 18px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-white);
    z-index: 10;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: var(--bg-gray);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--accent-red);
    color: white;
}

.modal-body { padding: 24px; }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-gray);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
    background: var(--bg-white);
}

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

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: var(--bg-white);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading svg {
    width: 48px;
    height: 48px;
    color: var(--accent);
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 20px;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 14px;
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 14px 22px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    animation: toastIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    cursor: pointer;
    max-width: 380px;
}

.toast.removing {
    animation: toastOut 0.25s ease forwards;
}

.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }
.toast.warning { background: #f59e0b; }
.toast.info { background: #3b82f6; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Batch operations */
.batch-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
}
.batch-bar.active { display: flex; flex-wrap: wrap; }
.batch-bar .batch-count { font-weight: 600; color: var(--accent-blue); }
.vehicle-card .batch-check {
    display: none;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    width: 22px;
    height: 22px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}
.batch-mode .vehicle-card { position: relative; cursor: pointer; }
.batch-mode .vehicle-card .batch-check { display: block; }
.batch-mode .vehicle-card.selected { outline: 2px solid var(--accent-blue); outline-offset: -2px; }

@media (max-width: 768px) {
    .top-bar-content { flex-direction: column; align-items: flex-start; }
    .vehicles-grid, .catalogs-grid { grid-template-columns: 1fr; }
    .filters-row, .form-row { flex-direction: column; grid-template-columns: 1fr; }
    .filter-group { width: 100%; }
    .tabs { flex-wrap: wrap; }
    #tab-dashboard > div { grid-template-columns: 1fr !important; }
    .chart-bar-label { width: 80px; font-size: 11px; }
}

/* Dropdown de grupos WhatsApp */
.whatsapp-group-container {
    position: relative;
}

.whatsapp-group-input {
    position: relative;
}


.whatsapp-groups-dropdown {
    position: fixed;
    background: var(--bg-white);
    border: 2px solid var(--accent);
    border-radius: 10px;
    max-height: 180px;
    width: 280px;
    overflow-y: auto;
    z-index: 2000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.whatsapp-groups-dropdown.show {
    display: block;
}

.whatsapp-group-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.whatsapp-group-item:last-child {
    border-bottom: none;
}

.whatsapp-group-item:hover {
    background: var(--bg-gray);
}

.whatsapp-group-item .group-icon {
    font-size: 18px;
}

.whatsapp-group-item .group-info {
    flex: 1;
    min-width: 0;
}

.whatsapp-group-item .group-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.whatsapp-group-item .group-id {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.whatsapp-groups-dropdown .no-results {
    padding: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.whatsapp-groups-dropdown .searching {
    padding: 14px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.current-group-name {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 6px;
}

.current-group-name .group-icon {
    font-size: 14px;
}

.current-group-name .group-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== FOTOS UPLOAD ===== */
.fotos-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.fotos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fotos-header h4 {
    color: var(--accent);
    margin: 0;
}

.fotos-count {
    background: var(--bg-gray);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.foto-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-gray);
    cursor: pointer;
}

.foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.foto-item:hover img {
    transform: scale(1.05);
}

.foto-item .foto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.foto-item:hover .foto-overlay {
    opacity: 1;
}

.foto-overlay button {
    background: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.foto-overlay button:hover {
    transform: scale(1.1);
}

.foto-overlay button.btn-delete {
    background: var(--accent-red);
    color: white;
}

.foto-overlay button svg {
    width: 18px;
    height: 18px;
}

.foto-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.foto-badge.local {
    background: var(--accent-green);
    color: white;
}

.foto-badge.externa {
    background: var(--accent-blue);
    color: white;
}

.foto-badge.whatsapp {
    background: #25D366;
    color: white;
}

.foto-badge.upload {
    background: var(--accent-purple);
    color: white;
}

/* Toggle para API */
.foto-api-toggle {
    position: absolute;
    bottom: 6px;
    left: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.7);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    color: white;
}

.foto-api-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.foto-api-toggle.publicada {
    background: var(--accent-green);
}

.foto-orden {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.7);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.fotos-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-gray);
    border-radius: 8px;
}

.fotos-actions-bar .info {
    font-size: 13px;
    color: var(--text-secondary);
}

.fotos-actions-bar .info strong {
    color: var(--accent-green);
}

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-gray);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: rgba(255,107,53,0.05);
}

.dropzone svg {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.dropzone.dragover svg {
    color: var(--accent);
}

.dropzone p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.dropzone .dropzone-hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.dropzone input[type="file"] {
    display: none;
}

.upload-progress {
    margin-top: 12px;
}

.upload-progress-bar {
    height: 4px;
    background: var(--bg-gray);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-bar .fill {
    height: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    transition: width 0.3s;
}

.upload-status {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: center;
}

.add-url-section {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.add-url-section input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.add-url-section input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Modal de vista previa */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.preview-modal.show {
    display: flex;
}

.preview-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.preview-modal .close-preview {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}
.preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 36px;
    padding: 16px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}
.preview-nav:hover { background: rgba(255,255,255,0.4); }
.preview-nav.prev { left: 20px; }
.preview-nav.next { right: 20px; }
.preview-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

/* ===== DETAIL PAGE ===== */
.detail-page {
    display: none;
}

.detail-page.active {
    display: block;
    animation: fadeInDetail 0.3s ease;
}

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

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
}

.breadcrumb a:hover { opacity: 0.7; }

.breadcrumb .separator { color: var(--text-tertiary); }

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.detail-header {
    background: var(--bg-white);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.detail-header .placa-big {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.detail-header .vehicle-info {
    flex: 1;
    min-width: 200px;
}

.detail-header .vehicle-info h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
}

.detail-header .header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-header .header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.detail-section-card {
    background: var(--bg-white);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.detail-section-card .section-title {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section-card .section-body {
    padding: 20px;
}

.detail-photos-section {
    grid-column: 1 / -1;
}

.foto-item[draggable="true"] { cursor: grab; }
.foto-item[draggable="true"]:active { cursor: grabbing; }
.foto-item.drag-over {
    outline: 3px dashed var(--accent);
    outline-offset: -3px;
    transform: scale(1.05);
}

.unsaved-indicator {
    display: none;
    background: var(--accent-yellow);
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.unsaved-indicator.show { display: inline-block; }

@media (max-width: 1024px) {
    .detail-content {
        grid-template-columns: 1fr;
    }
    .detail-photos-section {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .detail-header .header-actions {
        width: 100%;
    }
    .detail-header .header-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

/* Sync Planilla badge */
.sync-planilla-badge {
    font-size: 11px;
    color: #888;
    font-weight: normal;
    cursor: pointer;
    transition: color 0.2s;
}
.sync-planilla-badge:hover {
    color: var(--accent);
}
.sync-planilla-badge.syncing {
    animation: spin 1s linear infinite;
    display: inline-block;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
