:root{
--blue:#18624e;
--blue-deep:#114c3c;
--red:#E31226;
--ink:#182620;
--text:#384b43;
--muted:#53675e;
--field:#eef3f0;
--line:#dce5e0;
--tint:#e4f0e9;
--success-ink:#146B39;
--success-soft:#E8F6EE;
--warning-ink:#8F5500;
--warning-soft:#FFF4E0;
--success:#1B8A4A;
--error:#C4293A;
--safe-top: env(safe-area-inset-top, 0px);
--safe-bottom: env(safe-area-inset-bottom, 0px);
--nav-h: 64px;
}

*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}

html{
-webkit-text-size-adjust:100%;
background:#fff;
}

body{
font-family:'Instrument Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
color:var(--ink);
min-height:100vh;
min-height:100dvh;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
}

.app{
min-height:100vh;
min-height:100dvh;
display:flex;
flex-direction:column;
}

/* ===== TOPO (MARCA + SAUDAÇÃO) ===== */
.hero{
position:relative;
isolation:isolate;
overflow:hidden;
background:var(--blue);
color:#fff;
padding:calc(24px + var(--safe-top)) 20px 56px;
}

.topbar{
display:flex;
align-items:center;
justify-content:space-between;
gap:16px;
}

.greet{
display:flex;
flex-direction:column;
gap:2px;
min-width:0;
}

.greet .hello{
font-size:0.875rem;
font-weight:600;
color:rgba(255,255,255,0.8);
}

.greet .name{
font-weight:800;
font-size:1.5rem;
line-height:1.2;
letter-spacing:-0.03em;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
}

.avatar{
width:44px;
height:44px;
border-radius:50%;
background:#fff;
color:var(--blue);
display:flex;
align-items:center;
justify-content:center;
font-weight:800;
font-size:1.0625rem;
flex-shrink:0;
}

.summary{
display:flex;
margin-top:24px;
}

.sum-item{
flex:1;
display:flex;
flex-direction:column;
gap:4px;
}
.sum-item + .sum-item{
padding-left:20px;
border-left:1px solid rgba(255,255,255,0.24);
}

.sum-item .num{
font-weight:800;
font-size:1.875rem;
line-height:1;
letter-spacing:-0.03em;
font-variant-numeric:tabular-nums;
}

.sum-item .lbl{
font-size:0.8125rem;
font-weight:600;
color:rgba(255,255,255,0.78);
}

/* ===== FOLHA BRANCA ===== */
.sheet{
position:relative;
z-index:1;
flex:1;
background:#fff;
border-radius:28px 28px 0 0;
margin-top:-28px;
padding:24px 20px calc(var(--nav-h) + var(--safe-bottom) + 24px);
}

/* ===== AVISO (abre e fecha deslizando) ===== */
.notify-banner{
display:grid;
grid-template-rows:0fr;
visibility:hidden;
opacity:0;
transition:grid-template-rows .3s ease, opacity .25s ease, visibility 0s .3s;
}
.notify-banner.show{
grid-template-rows:1fr;
visibility:visible;
opacity:1;
transition:grid-template-rows .3s ease, opacity .25s ease, visibility 0s;
}

.notify-inner{
min-height:0;
overflow:hidden;
}

.notify-box{
display:flex;
align-items:center;
gap:12px;
margin-bottom:20px;
padding:12px 8px 12px 14px;
background:var(--tint);
border-radius:14px;
}

.notify-box .bell{
color:var(--blue);
display:flex;
flex-shrink:0;
}
.notify-box .bell svg{width:22px;height:22px;}

.notify-box .text{
flex:1;
font-size:0.8125rem;
font-weight:500;
line-height:1.4;
color:var(--text);
}
.notify-box .text strong{
display:block;
font-weight:800;
font-size:0.9375rem;
color:var(--ink);
margin-bottom:1px;
}

.notify-box .close{
width:40px;
height:40px;
border:none;
background:transparent;
color:var(--muted);
border-radius:12px;
display:flex;
align-items:center;
justify-content:center;
cursor:pointer;
flex-shrink:0;
touch-action:manipulation;
}
.notify-box .close svg{width:18px;height:18px;}
.notify-box .close:active{background:rgba(24,98,78,0.10);}

/* ===== CABEÇALHO DA LISTA ===== */
.section-head{
display:flex;
align-items:center;
justify-content:space-between;
gap:12px;
margin-bottom:12px;
}

.section-head h2{
font-weight:800;
font-size:1.125rem;
letter-spacing:-0.02em;
color:var(--ink);
}

.section-head .see-all{
display:inline-flex;
align-items:center;
min-height:40px;
margin-right:-10px;
padding:0 10px;
color:var(--blue);
font-weight:700;
font-size:0.875rem;
text-decoration:none;
border-radius:10px;
touch-action:manipulation;
}
.section-head .see-all:active{background:var(--tint);}

/* ===== CARD DE ROMANEIO ===== */
.romaneios{
display:grid;
grid-template-columns:repeat(auto-fill, minmax(min(100%, 340px), 1fr));
gap:12px;
}

.romaneio{
background:#fff;
border:1px solid var(--line);
border-radius:16px;
padding:16px;
cursor:pointer;
color:inherit;
transition:background-color .12s, border-color .12s;
}
.romaneio:active{background:var(--field);}
.romaneio:focus-visible{outline:3px solid rgba(24,98,78,0.35);outline-offset:2px;}

@media (hover:hover){
.romaneio:hover{border-color:#c8d7cf;}
}

.romaneio .top-row{
display:flex;
align-items:center;
justify-content:space-between;
gap:10px;
margin-bottom:16px;
}

.pl-badge{
display:flex;
align-items:baseline;
gap:6px;
min-width:0;
}
.pl-badge .pl-lbl{
font-size:0.875rem;
font-weight:600;
color:var(--muted);
}
.pl-badge .pl-num{
font-size:1.0625rem;
font-weight:800;
letter-spacing:-0.02em;
color:var(--ink);
font-variant-numeric:tabular-nums;
}

.top-right{
display:flex;
align-items:center;
gap:6px;
flex-shrink:0;
}

.status-pill{
font-size:0.75rem;
font-weight:700;
padding:4px 10px;
border-radius:999px;
}
.status-pill.pending{background:var(--warning-soft);color:var(--warning-ink);}
.status-pill.completed{background:var(--success-soft);color:var(--success-ink);}

.top-right .chev{
width:18px;
height:18px;
color:#98A2B3;
}

/* trajeto: saída → destino */
.route{
display:flex;
flex-direction:column;
gap:14px;
margin-bottom:16px;
}

.route-point{
position:relative;
z-index:1;
display:flex;
align-items:flex-start;
gap:14px;
}
.route-point:not(:last-child)::after{
content:"";
position:absolute;
left:7px;
top:20px;
bottom:-16px;
width:2px;
background:#c8d7cf;
z-index:-1;
}

.route-dot{
width:16px;
height:16px;
margin-top:2px;
flex-shrink:0;
border-radius:50%;
background:#fff;
border:3px solid var(--blue);
}
.route-dot.dest{
border-radius:4px;
border-color:var(--red);
background:var(--red);
}

.route-info{
display:flex;
flex-direction:column;
gap:1px;
min-width:0;
}
.route-info .rlbl{
font-size:0.75rem;
font-weight:600;
color:var(--muted);
}
.route-info .rval{
font-size:0.9375rem;
font-weight:700;
color:var(--ink);
line-height:1.3;
overflow-wrap:anywhere;
}

.romaneio .meta-row{
display:flex;
align-items:center;
flex-wrap:wrap;
gap:8px 16px;
padding-top:14px;
border-top:1px solid var(--line);
}

.meta-chip{
display:inline-flex;
align-items:center;
gap:6px;
font-size:0.8125rem;
font-weight:600;
color:var(--text);
}
.meta-chip svg{width:16px;height:16px;color:var(--muted);flex-shrink:0;}

.meta-chip.link{
margin:-6px -8px -6px auto;
padding:6px 10px;
border-radius:10px;
color:var(--blue);
font-weight:700;
text-decoration:none;
touch-action:manipulation;
}
.meta-chip.link svg{color:var(--blue);}
.meta-chip.link:active{background:var(--tint);}

/* ===== ESTADO VAZIO ===== */
.empty-state{
grid-column:1 / -1;
display:flex;
flex-direction:column;
align-items:center;
gap:8px;
padding:48px 24px;
text-align:center;
border:1px solid var(--line);
border-radius:16px;
}
.empty-state .em-ic{
width:56px;
height:56px;
margin-bottom:8px;
border-radius:50%;
background:var(--tint);
display:flex;
align-items:center;
justify-content:center;
color:var(--blue);
}
.empty-state .em-ic svg{width:28px;height:28px;}
.empty-state h3{
font-weight:800;
font-size:1.0625rem;
letter-spacing:-0.02em;
color:var(--ink);
}
.empty-state p{
font-size:0.875rem;
font-weight:500;
color:var(--muted);
line-height:1.5;
max-width:280px;
}

/* ===== TOAST ===== */
.toast{
position:fixed;
left:50%;
bottom:calc(var(--nav-h) + var(--safe-bottom) + 12px);
transform:translate(-50%, 12px);
width:calc(100% - 32px);
max-width:420px;
background:var(--ink);
color:#fff;
padding:14px 16px;
border-radius:12px;
font-weight:600;
font-size:0.875rem;
line-height:1.35;
display:flex;
align-items:center;
gap:10px;
box-shadow:0 8px 24px rgba(24,38,32,0.22);
opacity:0;
pointer-events:none;
transition:opacity .2s ease, transform .2s ease;
z-index:60;
}
.toast.show{opacity:1;transform:translate(-50%,0);}
.toast.success{background:var(--success);}
.toast.error{background:var(--error);}
.toast .spin{
width:16px;height:16px;
border-radius:50%;
border:2px solid rgba(255,255,255,0.35);
border-top-color:#fff;
animation:spin .7s linear infinite;
flex-shrink:0;
}
@keyframes spin{to{transform:rotate(360deg);}}

/* ===== CELULAR PEQUENO / TELA BAIXA ===== */
@media (max-width:360px){
.hero,.sheet{padding-left:16px;padding-right:16px;}
.greet .name{font-size:1.3rem;}
.sum-item .num{font-size:1.625rem;}
}

/* ===== PC: menu lateral azul + conteúdo ===== */
@media (min-width:900px){

.hero,
.sheet{
    width:100%;
    max-width:1160px;
}

.hero{
    background:transparent;
    color:var(--ink);
    padding:40px 48px 0;
    overflow:visible;
}
.greet .hello{color:var(--muted);}
.greet .name{font-size:2rem;}
.avatar{background:var(--blue);color:#fff;}

.summary{
    display:inline-flex;
    align-self:flex-start;
    margin-top:28px;
    padding:18px 28px;
    background:var(--field);
    border-radius:16px;
}
.sum-item{flex:none;min-width:130px;}
.sum-item + .sum-item{padding-left:28px;border-left-color:var(--line);}
.sum-item .lbl{color:var(--muted);}

.sheet{
    background:transparent;
    border-radius:0;
    margin-top:0;
    padding:32px 48px 48px;
}

.romaneios{gap:16px;}

/* barra inferior vira menu lateral */

.toast{
    left:calc(50% + (var(--rail-w) / 2));
    bottom:24px;
}
}

@media (prefers-reduced-motion:reduce){
*{animation-duration:0.001ms !important;transition-duration:0.001ms !important;}
}