﻿/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header */
.header {
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-img {
    height: 65px;
    width: auto;
    border-radius: 50%;
}

.logo-text {
    color: white;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: #DC143C;
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* Navigation */
.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: rgba(255,255,255,0.8);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-link svg {
    flex-shrink: 0;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

.menu-toggle svg {
    display: block;
}

/* User menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
}

.user-role {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
}

.logout-link {
    padding: 0.4rem;
    border-radius: 6px;
}

.logout-link:hover {
    background: rgba(255,255,255,0.2);
}

.role-cashier {
    background: #e67e22;
    color: white;
}

/* Main content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Dashboard layout */
.dashboard {
    display: flex;
    gap: 1.5rem;
    min-height: calc(100vh - 120px);
}

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 1.5rem;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f5f5f5;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    color: #111;
}

.badge {
    background: #DC143C;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-cash {
    background: #27ae60;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge-transfer {
    background: #3498db;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge-yes {
    background: #27ae60;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.badge-no {
    background: #95a5a6;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-help {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.moto-list {
    min-height: 150px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding: 0.5rem 0;
}

/* Zones area */
.zones-area {
    flex: 1;
}

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

.zones-header h2 {
    font-size: 1.3rem;
    color: #111;
}

.zones-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    color: #666;
    display: flex;
    align-items: center;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    min-width: 160px;
}

.filter-group select:focus {
    outline: none;
    border-color: #DC143C;
}

.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Zone card */
.zone-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.zone-header {
    padding: 1rem 1.25rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.zone-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.zone-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.zone-assigned-user {
    font-size: 0.75rem;
    opacity: 0.85;
    font-weight: 400;
}

.zone-count {
    background: rgba(255,255,255,0.25);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.zone-actions {
    display: flex;
    gap: 0.25rem;
}

.zone-body {
    padding: 1rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Moto card */
.moto-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: grab;
    transition: all 0.2s ease;
}

.moto-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.moto-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(1.02);
}

.moto-plate {
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #DC143C;
    background: #ffe6e6;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.moto-owner {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.moto-user {
    font-size: 0.8rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.moto-user svg {
    color: #DC143C;
}

.moto-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Dropzone states */
.dropzone {
    transition: all 0.2s ease;
    border: 2px dashed transparent;
    border-radius: 8px;
}

.dropzone-active {
    border-color: #DC143C;
    background: rgba(220, 20, 60, 0.05);
}

.dropzone-hover {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.empty-message {
    text-align: center;
    color: #aaa;
    padding: 2rem 1rem;
    font-style: italic;
    font-size: 0.9rem;
}

.empty-zones {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #888;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #DC143C;
    color: white;
}

.btn-primary:hover {
    background: #B22222;
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    margin-bottom: 1rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e9ecef;
    color: #333;
}

.btn-icon.btn-danger:hover {
    background: #fee;
    color: #e74c3c;
}

.btn-icon-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.btn-icon-sm:hover {
    background: rgba(255,255,255,0.3);
}

.btn-icon-sm.btn-danger:hover {
    background: rgba(231, 76, 60, 0.8);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    font-size: 1.1rem;
    color: #111;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.btn-close:hover {
    color: #333;
}

/* Forms */
.form-group {
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.form-group:first-of-type {
    margin-top: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.4rem;
}

.form-group input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #DC143C;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.form-group input[type="color"] {
    padding: 0.3rem;
    height: 42px;
    cursor: pointer;
}

.form-group select {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #DC143C;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
}

.form-group textarea:focus {
    outline: none;
    border-color: #DC143C;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: #1a1a1a;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

/* Modal large */
.modal-lg {
    max-width: 600px;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
}

/* Detail page */
.detail-container {
    max-width: 900px;
    margin: 0 auto;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: #e9ecef;
    color: #333;
}

.detail-title {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.plate-large {
    font-family: 'Courier New', monospace;
    font-size: 1.75rem;
    background: #1a1a1a;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 8px;
}

.brand-model-label {
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    margin-left: 0.75rem;
}

/* Info card */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f5f5f5;
}

.info-card-header h2 {
    font-size: 1.1rem;
    color: #111;
    margin: 0;
}

.info-card h2 {
    font-size: 1.1rem;
    color: #111;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f5f5f5;
}

/* Assign card */
.assign-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.assign-card h3 {
    font-size: 0.95rem;
    color: #111;
    white-space: nowrap;
}

.assign-form {
    flex: 1;
    max-width: 300px;
}

.assign-form select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

/* Close modal */
.close-summary {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.close-summary p {
    margin-bottom: 0.5rem;
}

.close-summary p:last-child {
    margin-bottom: 0;
}

.total-highlight {
    font-size: 1.25rem;
    font-weight: 700;
    color: #27ae60;
}

.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.warning-box svg {
    color: #856404;
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-box span {
    font-size: 0.9rem;
    color: #856404;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item label {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item {
    min-width: 0;
    overflow: hidden;
}

.info-item span {
    font-size: 1rem;
    color: #333;
    display: block;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Articles card */
.articles-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f5f5f5;
}

.articles-header h2 {
    font-size: 1.1rem;
    color: #111;
}

.articles-table-container {
    overflow-x: auto;
}

.articles-table {
    width: 100%;
    border-collapse: collapse;
}

.articles-table th,
.articles-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.articles-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
}

.articles-table tbody tr:hover {
    background: #f8f9fa;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: #6c5ce7;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
}

/* Brand/Model en tarjetas de moto */
.moto-brand-model {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    margin-top: 2px;
}

/* Total de articulos en tarjetas */
.moto-total {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #27ae60;
    margin-top: 4px;
}

.moto-total svg {
    color: #27ae60;
}

/* Form row para campos en linea */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    padding: 0;
    margin-bottom: 0;
}

.form-row .form-group:first-of-type {
    margin-top: 0;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.actions-cell {
    white-space: nowrap;
}

.empty-row {
    color: #999;
    font-style: italic;
}

.total-row {
    background: #f8f9fa;
}

.total-row td {
    border-bottom: none;
    font-size: 1.1rem;
}

/* Page container for history/settings */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

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

.page-header h1 {
    font-size: 1.5rem;
    color: #111;
}

/* Filters */
.filters-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    flex: 0 0 auto;
    min-width: 130px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* Summary card */
.summary-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-label {
    color: #666;
    font-size: 0.9rem;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #DC143C;
}

/* Table card */
.table-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    font-weight: 600;
    background: #f8f9fa;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.plate-badge-sm {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Settings section */
.settings-section {
    margin-bottom: 2rem;
}

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

.section-header h2 {
    font-size: 1.2rem;
    color: #111;
}

/* Role badges */
.role-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: #DC143C;
    color: white;
}

.role-admin_tecnico {
    background: #8e44ad;
    color: white;
}

.role-supervisor {
    background: #e67e22;
    color: white;
}

.role-cashier {
    background: #2980b9;
    color: white;
}

.role-technician {
    background: #27ae60;
    color: white;
}

.role-accounting {
    background: #27ae60;
    color: white;
}

/* Status badges */
.status-badge-active {
    color: #27ae60;
    font-weight: 600;
}

.status-badge-inactive {
    color: #e74c3c;
    font-weight: 600;
}

.status-badge-pending {
    color: #f39c12;
    font-weight: 600;
}

/* Detail grid in modal */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-section {
    margin-bottom: 1rem;
}

.detail-section h4 {
    font-size: 0.9rem;
    color: #111;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.detail-section p {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
    }

    .moto-list {
        max-height: 300px;
    }

    .zones-grid {
        grid-template-columns: 1fr;
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,0.1);
        border: none;
        color: white;
        padding: 0.5rem;
        cursor: pointer;
        border-radius: 8px;
        transition: background-color 0.2s;
    }

    .menu-toggle:hover {
        background: rgba(255,255,255,0.2);
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
        flex-direction: column;
        padding: 0.5rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        justify-content: flex-start;
    }

    .header-content {
        position: relative;
    }

    .user-menu {
        margin-left: auto;
    }

    .user-name {
        display: none;
    }

    .filters-form {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .summary-card {
        flex-direction: column;
        gap: 0.75rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================
   ACTIVITIES SECTION
   ===================== */
.activities-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.activities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f5f5f5;
}

.activities-header h2 {
    font-size: 1.1rem;
    color: #111;
}

.activities-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.activity-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.activity-user {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.activity-date {
    font-size: 0.8rem;
    color: #888;
}

/* Client request box */
.client-request-box {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff8e6;
    border-left: 4px solid #f1c40f;
    border-radius: 0 8px 8px 0;
}

.client-request-box label {
    font-weight: 600;
    color: #111;
    margin-bottom: 0.5rem;
    display: block;
}

.client-request-box p {
    margin: 0;
    color: #333;
    white-space: pre-wrap;
    line-height: 1.5;
}

.activity-type-badge {
    display: inline-block;
    background: #DC143C;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.activity-comment {
    color: #333;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
}

.activity-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.activity-photo {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.activity-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-activities {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.empty-activities svg {
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-activities p {
    font-size: 0.95rem;
}

/* Photo capture area */
.photo-capture-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-capture {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px dashed #ddd;
    border-radius: 10px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-capture:hover {
    border-color: #DC143C;
    background: #fff;
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

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

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.preview-remove:hover {
    background: #e74c3c;
}

.form-hint {
    color: #888;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Photo viewer */
.photo-viewer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.photo-viewer.active {
    display: flex;
}

.photo-viewer img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.photo-viewer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-viewer-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Responsive activities */
@media (max-width: 768px) {
    .activity-photos {
        grid-template-columns: repeat(3, 1fr);
    }

    .photo-preview {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Payments/Abonos Section */
.payments-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.payments-header h2 {
    font-size: 1.25rem;
    color: #333;
}

.payments-list {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

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

.payment-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.payment-amount {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.payment-method {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.method-cash {
    background: #e8f5e9;
    color: #2e7d32;
}

.method-transfer {
    background: #e3f2fd;
    color: #1565c0;
}

.payment-date {
    font-size: 0.8rem;
    color: #666;
}

.payment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-notes {
    font-size: 0.8rem;
    color: #888;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-payments {
    padding: 2rem;
    text-align: center;
    color: #888;
}

.payments-summary {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed #ddd;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 1.1rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 2px solid #ddd;
    border-bottom: none;
}

.text-success {
    color: #28a745;
}

/* Payment inputs in close modal */
.payment-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.payment-inputs .form-group {
    margin-bottom: 0;
}

.payment-inputs .form-group:last-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px dashed #ccc;
    margin-top: 0.5rem;
}

.payment-inputs .form-group:last-child label {
    font-weight: 600;
}

@media (max-width: 768px) {
    .payment-inputs {
        grid-template-columns: 1fr;
    }

    .payment-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Page container for expenses and cash register */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

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

.page-header h1 {
    font-size: 1.75rem;
    color: #333;
}

/* Data table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .text-right {
    text-align: right;
}

.data-table .text-center {
    text-align: center;
}

.data-table .empty-row {
    padding: 2rem;
    color: #888;
}

.expenses-summary {
    margin-bottom: 1.5rem;
}

.expenses-table-container {
    overflow-x: auto;
}

/* Warning banner */
.warning-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #856404;
}

/* Button warning */
.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ffca28 0%, #ffa726 100%);
}

/* Checkbox inline para tablas */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #28a745;
}

/* Articulo entregado */
.article-delivered td {
    background-color: #f0fff0 !important;
}

.article-delivered td:nth-child(n+2):nth-child(-n+7) {
    text-decoration: line-through;
    opacity: 0.6;
}

/* =====================
   PAGINATION
   ===================== */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

.pagination-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.pagination-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #DC143C;
    color: #DC143C;
}

.pagination-btn.active {
    background: #DC143C;
    color: white;
    border-color: #DC143C;
}

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

.pagination-dots {
    padding: 0 0.5rem;
    color: #666;
}

/* =====================
   PHOTO BUTTONS (Camera + Gallery)
   ===================== */
.photo-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.photo-buttons .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

/* =====================
   ARTICLES INPUT SECTION (multi-row)
   ===================== */
.articles-input-section {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 0.5rem;
}

#articlesInputBody tr td input,
#articlesInputBody tr td select {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    outline: none;
}

#articlesInputBody tr td input:focus,
#articlesInputBody tr td select:focus {
    border-color: #DC143C;
    box-shadow: 0 0 0 2px rgba(220,20,60,0.1);
}

#articlesInputBody tr:hover td {
    background: #fafafa;
}

.btn-gallery {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.btn-gallery:hover {
    background: #bbdefb;
}

.photo-source-hint {
    margin-bottom: 0.5rem;
}

/* =====================
   HISTORY SECTION
   ===================== */
.history-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.history-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.history-search-box {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-tab:hover {
    border-color: #DC143C;
}

.search-tab.active {
    background: #DC143C;
    color: white;
    border-color: #DC143C;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
}

.search-input-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.search-input-group input:focus {
    outline: none;
    border-color: #DC143C;
}

.history-results {
    min-height: 100px;
}

.history-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #999;
    text-align: center;
}

.history-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.history-empty p {
    margin-bottom: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: #DC143C;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    text-decoration: underline;
}

.btn-link:hover {
    color: #DC143C;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.history-item:hover {
    border-color: #DC143C;
    box-shadow: 0 2px 8px rgba(139,0,0,0.1);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-plate {
    background: #1a1a2e;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 1px;
}

.history-date {
    color: #666;
    font-size: 0.85rem;
}

.history-item-body {
    margin-bottom: 0.75rem;
}

.history-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.history-label {
    color: #666;
}

.history-total {
    font-weight: 600;
    color: #28a745;
}

.history-item-footer {
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    text-align: right;
}

.history-view-link {
    color: #DC143C;
    font-size: 0.85rem;
    font-weight: 500;
}

/* =====================
   MOTO CARD - HISTORY INDICATOR
   ===================== */
.moto-card.has-history {
    border-left: 3px solid #17a2b8;
    background: linear-gradient(135deg, #e8f4f8 0%, white 30%);
}

.moto-card .history-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #17a2b8;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.moto-card {
    position: relative;
}
