* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* MODO SELEÃ‡ÃƒO */
.mode-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.mode-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 800px;
    width: 100%;
}

.mode-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.mode-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.mode-card .icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.mode-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 28px;
}

.mode-card p {
    color: #6b7280;
    font-size: 16px;
}

/* PAINEL LOGÃSTICA */
.logistics-panel {
    display: none;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.logistics-panel.active {
    display: block;
}

.header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #667eea;
    font-size: 28px;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #10b981;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #6b7280;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card .icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    margin: 10px 0;
}

.stat-card.today .number { color: #667eea; }
.stat-card.pending .number { color: #f59e0b; }
.stat-card.route .number { color: #3b82f6; }
.stat-card.delivered .number { color: #10b981; }

.stat-card p {
    color: #6b7280;
    font-size: 14px;
}

.content-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.section-header h2 {
    color: #374151;
    font-size: 22px;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.delivery-list {
    display: grid;
    gap: 15px;
}

.delivery-item {
    border: 2px solid #e5e7eb;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.3s;
}

.delivery-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.delivery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.delivery-header .pedido {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.pendente {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.rota {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.entregue,
.status-badge.sucesso {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.ausente {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.recusado {
    background: #fecaca;
    color: #7f1d1d;
}

.status-badge.nao_encontrado {
    background: #fef3c7;
    color: #78350f;
}

.status-badge.reagendado {
    background: #e0e7ff;
    color: #3730a3;
}

.delivery-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    align-items: start;
    gap: 8px;
}

.info-item .icon {
    color: #667eea;
    font-size: 18px;
    margin-top: 2px;
}

.info-item .content {
    flex: 1;
}

.info-item .label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 3px;
}

.info-item .value {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.delivery-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

/* APP MOTORISTA */
.driver-app {
    display: none;
    min-height: 100vh;
    background: #f5f7fa;
}

.driver-app.active {
    display: block;
}

.driver-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.driver-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

.driver-header .driver-name {
    font-size: 18px;
    opacity: 0.9;
}

.driver-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.driver-stat {
    text-align: center;
}

.driver-stat .number {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.driver-stat.pending .number { color: #f59e0b; }
.driver-stat.route .number { color: #3b82f6; }
.driver-stat.done .number { color: #10b981; }

.driver-stat .label {
    font-size: 13px;
    color: #6b7280;
}

.driver-deliveries {
    padding: 20px;
}

.driver-delivery-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.driver-delivery-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.driver-delivery-card .pedido-number {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.driver-delivery-card .cliente-name {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.driver-delivery-card .endereco {
    color: #6b7280;
    font-size: 15px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.driver-delivery-card .horario {
    color: #667eea;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
}

.driver-delivery-card .obs {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    margin-bottom: 15px;
}

.big-button {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.big-button.start {
    background: #3b82f6;
    color: white;
}

.big-button.start:hover {
    background: #2563eb;
    transform: scale(1.02);
}

.big-button.complete {
    background: #10b981;
    color: white;
}

.big-button.complete:hover {
    background: #059669;
    transform: scale(1.02);
}

.big-button.completed {
    background: #e5e7eb;
    color: #6b7280;
    cursor: default;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* RELATÃ“RIOS */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.report-card {
    border: 2px solid #e5e7eb;
    padding: 20px;
    border-radius: 12px;
}

.report-card h3 {
    color: #374151;
    margin-bottom: 15px;
    font-size: 18px;
}

.report-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.report-item:last-child {
    border-bottom: none;
}

.obs-motorista {
    background: #fef3c7;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
}

.obs-motorista .label {
    color: #92400e;
    font-weight: bold;
    margin-bottom: 5px;
}

.obs-motorista .value {
    color: #92400e;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
    }

    .delivery-info {
        grid-template-columns: 1fr;
    }

    .driver-stats {
        grid-template-columns: 1fr;
    }

    .mode-cards {
        grid-template-columns: 1fr;
    }
}