:root {
  --blue: #0b4aa2;
  --blue-2: #0e64d2;
  --blue-soft: #edf5ff;
  --ink: #142033;
  --muted: #667085;
  --line: #d8e0ea;
  --bg: #f5f7fb;
  --card: #ffffff;
  --green: #18864b;
  --green-soft: #e8f7ee;
  --orange: #b76000;
  --orange-soft: #fff3e4;
  --red: #b42318;
  --shadow: 0 12px 32px rgba(20, 32, 51, .08);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 72px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 12px 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.topbar > div:first-child strong { font-size: 24px; color: var(--blue); }
.topbar > div:first-child span { color: var(--muted); }
.topbar nav { display: flex; gap: 8px; }
.topbar nav a { text-decoration: none; padding: 10px 14px; border-radius: 10px; color: var(--muted); font-weight: 700; }
.topbar nav a.active, .topbar nav a:hover { color: var(--blue); background: var(--blue-soft); }
.userbox { justify-self: end; display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; text-align: right; }
.userbox small { grid-column: 1; color: var(--muted); }
.userbox form { grid-row: 1 / span 2; grid-column: 2; }
.container { width: min(1600px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 60px; }
.login-container { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(460px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 36px; box-shadow: var(--shadow); }
.login-card h1 { margin: 18px 0 8px; }
.login-card > p { color: var(--muted); margin-top: 0; }
.brand-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; color: white; background: linear-gradient(135deg, var(--blue), var(--blue-2)); font-size: 32px; font-weight: 900; }
.demo-users { margin-top: 22px; color: var(--muted); }
.demo-users p { margin: 8px 0; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(32px, 5vw, 50px); line-height: 1; margin: 6px 0 10px; }
.page-heading p { color: var(--muted); margin: 0; max-width: 760px; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 900; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: 0 6px 20px rgba(20,32,51,.04); }
.panel h2 { margin-top: 0; }
.form-grid { display: grid; gap: 16px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 7px; font-size: 13px; color: #3d4b60; font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid #c8d2df; border-radius: 10px; padding: 12px 13px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(14,100,210,.12); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.section-divider { height: 1px; background: var(--line); margin: 26px 0; }
.items-title { display: flex; justify-comzent: space-between; gap: 20px; align-items: flex-start; }
.items-title h2 { margin-bottom: 6px; }
.items-title p { margin: 0; color: var(--muted); }
#items-list { display: grid; gap: 12px; margin-top: 16px; }
.item-row { display: grid; grid-template-columns: 2fr .7fr 1fr auto; gap: 12px; align-items: end; padding: 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; }
.remove-item { width: 42px; height: 42px; border: 0; border-radius: 10px; background: #feeceb; color: var(--red); font-size: 24px; cursor: pointer; }
.checkbox-label { display: flex; flex-direction: row; align-items: center; gap: 10px; align-self: end; min-height: 44px; }
.checkbox-label input, .confirm-line input { width: 18px; height: 18px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; }
.form-actions span { color: var(--muted); }
.primary, .secondary, .success-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 11px; padding: 11px 16px; text-decoration: none; font-weight: 900; cursor: pointer; }
.primary { color: white; background: linear-gradient(135deg, var(--blue), var(--blue-2)); }
.secondary { color: var(--blue); background: var(--blue-soft); border: 1px solid #cfe1f7; }
.success-button { color: white; background: var(--green); }
.large { min-height: 50px; padding: 14px 20px; font-size: 16px; }
.full-width { width: 100%; }
.link-button { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 800; }
.alert { margin: 0 0 18px; padding: 13px 16px; border-radius: 12px; border: 1px solid #b8ddc5; background: var(--green-soft); color: #125c35; font-weight: 700; }
.alert.error { border-color: #f1b7b3; background: #fff0ef; color: var(--red); }
.delivery-board { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 10px; }
.delivery-column { min-width: 270px; background: #eef2f7; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.delivery-column > header { min-height: 130px; padding: 18px; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: white; }
.delivery-column h2 { margin: 0 0 8px; font-size: 18px; }
.delivery-column header p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.count { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 900; }
.column-body { display: grid; gap: 12px; padding: 12px; }
.order-card { background: white; border: 1px solid #d4dde8; border-radius: 14px; padding: 15px; box-shadow: 0 4px 12px rgba(20,32,51,.05); }
.order-card-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.order-card-head strong { color: var(--blue); }
.order-card h3 { margin: 12px 0 3px; }
.order-card p { margin: 5px 0; }
.address { color: #455468; font-size: 13px; line-height: 1.45; }
.items-summary { padding-left: 18px; margin: 12px 0; }
.items-summary li { margin: 5px 0; }
.items-summary small { color: var(--muted); }
.order-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px dashed var(--line); text-transform: capitalize; }
.driver-chip { display: inline-flex; padding: 7px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 800; }
.assign-form { display: grid; gap: 11px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.confirm-line { display: flex; flex-direction: row; align-items: center; gap: 9px; }
.empty-state { padding: 24px 14px; text-align: center; color: var(--muted); border: 1px dashed #c5cfdb; border-radius: 12px; }
.status-aguardando_entregador > header { border-top: 5px solid #7b8797; }
.status-enviado_entregador > header { border-top: 5px solid var(--blue-2); }
.status-em_deslocamento > header { border-top: 5px solid #e08a00; }
.status-entregue_hoje > header { border-top: 5px solid var(--green); }
.location-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.location-panel h2, .location-panel p { margin: 0; }
.location-panel p { color: var(--muted); margin-top: 4px; }
.driver-list { width: min(760px, 100%); display: grid; gap: 16px; }
.driver-order { background: white; border: 1px solid var(--line); border-left: 6px solid var(--blue-2); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.driver-order.status-em_deslocamento { border-left-color: #e08a00; }
.driver-order.status-entregue_hoje { border-left-color: var(--green); opacity: .82; }
.driver-order-title { display: flex; justify-content: space-between; align-items: center; }
.status-pill { padding: 7px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 900; }
.driver-order h2 { margin: 16px 0 4px; }
.driver-address { font-size: 18px; line-height: 1.45; }
.large-items { font-size: 17px; }
.delivered-note { padding: 14px; border-radius: 10px; background: var(--green-soft); color: #125c35; text-align: center; font-weight: 800; }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { grid-row: 2; grid-column: 1 / -1; overflow-x: auto; }
  .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 720px) {
  .topbar { position: static; padding: 12px 16px; gap: 12px; }
  .topbar > div:first-child span { display: none; }
  .userbox > span, .userbox > small { display: none; }
  .topbar nav { justify-content: stretch; }
  .topbar nav a { flex: 1; text-align: center; }
  .container { width: min(100% - 20px, 1600px); padding-top: 18px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading h1 { font-size: 36px; }
  .panel, .login-card { padding: 18px; border-radius: 16px; }
  .form-grid.three { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .items-title, .form-actions, .location-panel { flex-direction: column; align-items: stretch; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .item-row label:first-child { grid-column: 1 / -1; }
  .remove-item { justify-self: end; }
  .delivery-board { grid-template-columns: repeat(4, minmax(86vw, 1fr)); margin-right: -10px; padding-right: 10px; scroll-snap-type: x proximity; }
  .delivery-column { scroll-snap-align: start; }
  .driver-order { padding: 17px; }
  .driver-address { font-size: 16px; }
}
