/* === RESET BÁSICO === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f3;
    color: #1f1f1d;
    line-height: 1.5;
    min-height: 100vh;
}

/* === HEADER === */
header {
    background: #1a1a1a;
    padding: 1rem 2rem;
    border-bottom: 3px solid #a01919;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    color: #fff;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.02em;
}

.stats {
    color: #b8b8b3;
    font-size: 0.9rem;
}

.stats span {
    font-weight: 700;
    color: #d63a3a;
}

/* === LAYOUT PRINCIPAL === */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* === CARDS === */
.card {
    background: #fff;
    border: 1px solid #e6e6e2;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f1f1d;
    margin-bottom: 1rem;
}

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

.card-header h2 {
    margin-bottom: 0;
}

/* === FORMULÁRIO === */
form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.row {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.row > * {
    flex: 1;
    min-width: 0;
}

input[type="text"],
input[type="number"] {
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    border: 1px solid #d8d8d3;
    border-radius: 6px;
    background: #fafaf8;
    color: #1f1f1d;
    transition: border-color 0.15s, background 0.15s;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #a01919;
    background: #fff;
}

/* === BOTÕES === */
button {
    padding: 0.65rem 1.3rem;
    font-size: 0.93rem;
    font-weight: 600;
    background: #a01919;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

button:hover {
    background: #7d1010;
}

button:disabled {
    background: #c4c4bf;
    cursor: not-allowed;
}

.botao-processar {
    background: #1d6e3e;
}

.botao-processar:hover {
    background: #134f2a;
}

/* === LISTAS DE PEDIDOS / SAÍDAS === */
.lista {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lista li {
    padding: 0.85rem 1rem;
    background: #fafaf8;
    border: 1px solid #ebebe6;
    border-radius: 6px;
    font-size: 0.92rem;
}

.lista li.vazio {
    color: #9a9a92;
    text-align: center;
    font-style: italic;
    background: transparent;
    border: 1px dashed #d8d8d3;
}

.pedido-id {
    color: #6a6a65;
    font-size: 0.82rem;
    margin-right: 0.5rem;
    font-weight: 600;
}

.pedido-endereco {
    color: #1f1f1d;
}

.pedido-cliente {
    color: #6a6a65;
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* === SAÍDAS === */
.saida {
    border-left: 3px solid #1d6e3e;
}

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

.saida-tipo {
    font-weight: 700;
    color: #1d6e3e;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.saida-distancia {
    color: #6a6a65;
    font-size: 0.85rem;
}

.saida-paradas {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
}

.parada {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.9rem;
}

.parada-numero {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1d6e3e;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-concluir {
    background: #1d6e3e;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
}

.btn-concluir:hover {
    background: #134f2a;
}

/* === MENSAGENS === */
.mensagem {
    font-size: 0.88rem;
    min-height: 1.2em;
    margin-top: 0.3rem;
}

.mensagem.sucesso {
    color: #1d6e3e;
}

.mensagem.erro {
    color: #a01919;
}

/* === MAPA === */
#mapa {
    height: 420px;
    width: 100%;
    border-radius: 6px;
    background: #f0f0eb;
}

/* === HISTÓRICO === */
.historico-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.historico-saida {
    font-weight: 600;
    color: #6a6a65;
    font-size: 0.85rem;
}

.historico-meta {
    color: #9a9a92;
    font-size: 0.82rem;
}

.historico-enderecos {
    color: #2a2a28;
    font-size: 0.9rem;
}