:root {
    --ink: #17211f;
    --muted: #71807b;
    --paper: #f5f5ef;
    --panel: #fffef9;
    --line: #dfe4da;
    --green: #2d715c;
    --lime: #cde96b;
    --orange: #e87945;
    --blue: #4385a5;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: 'DM Sans', sans-serif; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; opacity: .42; background-image: linear-gradient(rgba(45,113,92,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(45,113,92,.06) 1px, transparent 1px); background-size: 32px 32px; }
.app-container { max-width: 1180px; margin: auto; padding: 28px 34px 64px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 42px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; font-weight: 700; }
.brand small { display: block; color: var(--green); font-family: 'DM Sans', sans-serif; font-size: .58rem; letter-spacing: .14em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--panel); background: var(--green); font-size: .74rem; letter-spacing: .05em; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
#connectionDot { width: 8px; height: 8px; border-radius: 50%; background: #b5c0b8; }
#connectionDot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(45,113,92,.12); }
.hero { display: flex; justify-content: space-between; gap: 40px; align-items: end; padding: 36px 0 48px; border-top: 1px solid var(--line); }
.eyebrow { margin: 0 0 13px; color: var(--green); font-size: .68rem; font-weight: 700; letter-spacing: .17em; }
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; }
h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 4.8rem); line-height: .98; letter-spacing: -.03em; font-weight: 600; }
h1 em { color: var(--green); font-style: normal; }
.hero-copy { max-width: 410px; margin: 20px 0 0; color: var(--muted); line-height: 1.55; }
.auth-box { width: min(100%, 390px); padding: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 8px 8px 0 rgba(45,113,92,.08); }
.auth-box label { display: block; margin-bottom: 8px; font-size: .72rem; font-weight: 700; }
.auth-controls { display: flex; gap: 8px; }
.auth-fields { margin-bottom: 8px; }
.auth-fields input { width: 50%; }
.secondary { color: var(--green); background: #e7f1db; }
.auth-message { min-height: 16px; margin: 10px 0 0; color: var(--green); font-size: .72rem; }
.auth-message.error { color: #9d3e26; }
.account-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; }
.link-button, .danger-button { padding: 0; color: var(--green); background: transparent; font-size: .7rem; }
.danger-button { color: #9d3e26; }
input { min-width: 0; flex: 1; padding: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; outline: none; }
input:focus { border-color: var(--green); }
button { padding: 0 17px; border: 0; color: white; background: var(--green); font: inherit; font-weight: 700; cursor: pointer; }
button:hover { background: #215744; } button:disabled { opacity: .6; cursor: wait; }
#lastUpdate { margin: 11px 0 0; color: var(--muted); font-size: .72rem; }
.loading { color: var(--green); font-size: .78rem; font-weight: 700; padding-bottom: 15px; }
.hidden { display: none; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { min-height: 145px; padding: 20px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--green); }
.stat-card.transit { border-top-color: var(--blue); } .stat-card.near { border-top-color: var(--orange); } .stat-card.done { border-top-color: var(--lime); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: .75rem; }
.stat-card strong { display: block; margin: 13px 0 2px; font-family: 'Space Grotesk', sans-serif; font-size: 2.4rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 58px 0 18px; border-bottom: 1px solid var(--line); }
h2 { margin: 0 0 13px; font-size: 1.8rem; } #packageCount { padding-bottom: 16px; color: var(--muted); font-size: .8rem; }
.grid-pacotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.grid-compras { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.purchase-card { display: grid; gap: 8px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--blue); }
.purchase-card small { color: var(--muted); font-size: .74rem; }
.purchase-status { justify-self: start; padding: 5px 8px; color: var(--green); background: #e7f1db; font-size: .68rem; font-weight: 700; }
.card { padding: 22px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--green); }
.card.near-delivery { border-left-color: var(--orange); } .card.delivered { border-left-color: var(--lime); } .card.waiting { border-left-color: #b5c0b8; }
.card-head { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.card-kicker { margin: 0 0 5px; color: var(--muted); font-size: .62rem; letter-spacing: .12em; }
.card h3 { margin: 0; font-size: 1.12rem; letter-spacing: .03em; }
.description { margin: 10px 0 19px; color: var(--muted); font-size: .82rem; }
.status-badge { padding: 6px 9px; color: var(--green); background: #e7f1db; font-size: .68rem; font-weight: 700; text-align: right; white-space: nowrap; }
.near-delivery .status-badge { color: #a74a25; background: #fff0e6; } .delivered .status-badge { color: #4d6818; background: #eef6c7; }
.timeline { border-left: 1px solid var(--line); padding-left: 17px; margin: 4px 0 0 4px; }
.evento { position: relative; margin: 0 0 18px; } .evento:last-child { margin-bottom: 0; }
.evento::before { content: ''; position: absolute; left: -22px; top: 3px; width: 8px; height: 8px; border: 3px solid var(--panel); background: var(--green); border-radius: 50%; box-shadow: 0 0 0 1px var(--green); }
.evento-data { color: var(--muted); font-size: .68rem; } .evento-status { margin: 3px 0; font-size: .82rem; font-weight: 700; } .evento-local { color: var(--muted); font-size: .74rem; }
.muted, .empty-state span { color: var(--muted); font-size: .8rem; } .empty-state { padding: 36px; border: 1px dashed var(--line); } .empty-state strong, .empty-state span { display: block; } .empty-state span { margin-top: 7px; }
.notice.error { padding: 14px; color: #9d3e26; border: 1px solid #f0c7b5; background: #fff1eb; font-size: .82rem; }
@media (max-width: 760px) { .app-container { padding: 20px 18px 44px; } .topbar { padding-bottom: 28px; } .hero { display: block; padding: 28px 0 34px; } .auth-box { margin-top: 28px; } .stats-grid { grid-template-columns: repeat(2, 1fr); } .stat-card { min-height: 125px; padding: 16px; } .grid-pacotes { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .connection { display: none; } .auth-controls { display: block; } .auth-fields input { width: 100%; } input, button { width: 100%; min-height: 44px; } button { margin-top: 8px; } }
