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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== LOGIN ===== */
.login-box {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    max-width: 400px;
    margin: 100px auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
    border: 1px solid #2a2a2a;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #ff6b35;
}

.login-box h2 {
    text-align: center;
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 30px;
}

.input-field {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: #ff6b35;
}

/* ===== BOTONES ===== */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

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

.btn-danger {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-warning {
    padding: 8px 16px;
    background: #ffc107;
    color: #111;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-warning:hover {
    background: #e0a800;
}

.error-message {
    color: #dc3545;
    margin-top: 10px;
    text-align: center;
}

/* ===== HEADER ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 20px;
}

.admin-header h1 {
    color: #ff6b35;
}

/* ===== BRAND / LOGO ===== */
.brand, .login-box__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.appLogo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 14px;
    background: #111;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
    border: 1px solid #2a2a2a;
}

.brand h1, .login-box__brand h1 {
    color: #ff6b35;
    margin: 0;
    font-size: 1.25rem;
}

.brand h2, .login-box__brand h2 {
    color: #888;
    margin: 0;
    font-size: 0.95rem;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    color: #888;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #e0e0e0;
    background: #2a2a2a;
}

.tab-btn.active {
    background: #ff6b35;
    color: white;
}

.tab-content {
    display: block;
}

/* ===== LISTADOS ===== */
.card-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.list-shell {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 16px;
}

.list-section-title {
    color: #ff6b35;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.list-divider {
    border-top: 1px solid #2a2a2a;
    margin: 12px 0;
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #232323;
}

.list-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.list-row-main {
    flex: 1;
}

.list-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.1);
    border-color: #ff6b35;
}

.card h4 {
    color: #ff6b35;
    margin-bottom: 10px;
}

.card p {
    margin: 5px 0;
    color: #b0b0b0;
}

.avatar-preview {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    color: #888;
}

.avatar-preview img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ff6b35;
}

.user-avatar {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ff6b35;
    margin-right: 10px;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-top: 10px;
}

.badge-active {
    background: #28a745;
    color: white;
}

.badge-inactive {
    background: #dc3545;
    color: white;
}

.badge-pendiente {
    background: #ffc107;
    color: #000;
}

.badge-asignado {
    background: #17a2b8;
    color: white;
}

.badge-completado {
    background: #28a745;
    color: white;
}

/* ===== CARD ACTIONS ===== */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.card-actions button {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 80px;
}

.card-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== ACTION BAR ===== */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== FORM ===== */
.form-container {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.form-container h4 {
    color: #ff6b35;
    margin-bottom: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.form-actions button {
    flex: 1;
}

/* ===== STATUS BAR ===== */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #1a1a1a;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #2a2a2a;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #232323;
    border: 1px solid #2f2f2f;
    border-radius: 8px;
    padding: 8px 12px;
}

.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: #1a1a1a;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #2a2a2a;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-item label {
    font-weight: bold;
    color: #888;
}

/* ===== TABLA GPS ===== */
.gps-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.gps-table th,
.gps-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a2a;
    color: #e0e0e0;
}

.gps-table th {
    background: #232323;
    color: #ff6b35;
    font-size: 0.9rem;
}

.gps-table tr:last-child td {
    border-bottom: none;
}

.gps-panel-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 860px) {
    .gps-panel-grid {
        grid-template-columns: 1fr 1.2fr;
        align-items: start;
    }
}

.gps-map-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px;
    margin-top: 12px;
}

.gps-map-frame {
    width: 100%;
    min-height: 340px;
    border-radius: 8px;
    background: #111;
}

.gps-selected-info {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #c8c8c8;
    background: #111;
    font-size: 0.95rem;
}

.gps-table tr[data-usuario-id] {
    cursor: pointer;
    transition: background 0.2s ease;
}

.gps-table tr[data-usuario-id]:hover {
    background: #111;
}

.gps-row-selected {
    background: rgba(255, 107, 53, 0.12) !important;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.leaflet-tooltip.gps-marker-label {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 107, 53, 0.8);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 25px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #ff6b35;
    margin: 0;
}

.modal-body {
    color: #e0e0e0;
}

/* ===== LIQUIDACIONES ===== */
.liquidacion-resumen {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.liquidacion-resumen p {
    margin: 5px 0;
}

.liquidacion-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.liquidacion-actions button {
    flex: 1;
    min-width: 120px;
}

/* ===== AJUSTES ===== */
.ajuste-info {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ajuste-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ajustes-section {
    margin: 15px 0;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
}

.ajustes-section h4 {
    color: #ff6b35;
    margin-bottom: 10px;
}

/* ===== HISTORIAL ===== */
.historial-section {
    margin-top: 20px;
}

.historial-section h4 {
    color: #ff6b35;
    margin-bottom: 10px;
}

.historial-item {
    background: #2a2a2a;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 3px solid #ff6b35;
}

.historial-item p {
    margin: 3px 0;
}

.historial-item.extra {
    border-left-color: #28a745;
}

.historial-item.descuento {
    border-left-color: #dc3545;
}

.historial-lista {
    max-height: 300px;
    overflow-y: auto;
}

/* ===== ALERTA DE NUEVO PEDIDO ===== */
.alerta-pedido-nuevo {
    animation: alertaEntrada 0.5s ease-out;
}

@keyframes alertaEntrada {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes iconoPulso {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .status-bar {
        flex-direction: column;
    }
    
    .modal-content {
        padding: 15px;
        max-height: 90vh;
    }
    
    .liquidacion-actions {
        flex-direction: column;
    }
    
    .liquidacion-actions button {
        width: 100%;
    }
}