:root{
  --bg:#f3f6fb;--surface:#fff;--text:#0b1220;--muted:#667085;--line:#e5eaf1;
  --primary:#1d4ed8;--navy:#0b1f3a;--success:#15803d;--warning:#ca8a04;
  --danger:#dc2626;--radius:22px;--shadow:0 14px 45px rgba(15,23,42,.08)
}
*{box-sizing:border-box}body{margin:0;min-height:100vh;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;background:radial-gradient(circle at top right,rgba(29,78,216,.11),transparent 32%),var(--bg);color:var(--text)}
button,input{font:inherit}.hidden{display:none!important}.app-shell{width:min(100%,880px);margin:auto;padding:22px 16px 54px}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}.topbar h1{margin:4px 0 5px;font-size:clamp(27px,6vw,40px);letter-spacing:-.04em}.topbar p,.view-header p{margin:0;color:var(--muted)}
.eyebrow{font-size:10px;font-weight:900;letter-spacing:.16em;color:var(--primary)}.eyebrow.light{color:#bfdbfe}
.header-actions{display:flex;gap:8px;align-items:center}.brand-mark{display:grid;place-items:center;width:58px;height:58px;border-radius:19px;background:linear-gradient(145deg,#0b1f3a,#1d4ed8);color:#fff;font-weight:900;box-shadow:0 12px 28px rgba(29,78,216,.25)}
.logout-button,.icon-button,.text-button{border:1px solid var(--line);background:#fff;color:var(--muted);border-radius:12px;padding:9px 12px;font-weight:800;cursor:pointer}.icon-button{font-size:20px;padding:7px 12px}.text-button{color:var(--primary)}
.module-nav{position:sticky;top:8px;z-index:20;display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-bottom:18px;padding:7px;background:rgba(255,255,255,.94);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);backdrop-filter:blur(12px)}
.module-tab{display:grid;place-items:center;gap:3px;min-height:56px;border:0;border-radius:15px;background:transparent;color:var(--muted);font-size:18px;cursor:pointer}.module-tab span{font-size:10px;font-weight:800}.module-tab.active{background:var(--navy);color:#fff}
.hero-card{display:flex;justify-content:space-between;gap:18px;padding:24px;border-radius:26px;background:linear-gradient(135deg,#0b1f3a,#173f7a);color:#fff;box-shadow:0 22px 50px rgba(11,31,58,.24)}.hero-card h2{margin:8px 0;font-size:27px;letter-spacing:-.03em}.hero-card p{margin:0;color:#dbeafe;line-height:1.55}.hero-time{text-align:right;flex:0 0 auto}.hero-time span{display:block;color:#93c5fd;font-size:11px}.hero-time strong{font-size:12px}
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:14px}.kpi-card{padding:17px;border:1px solid var(--line);border-radius:20px;background:#fff;text-align:left;box-shadow:var(--shadow);cursor:pointer}.kpi-card strong{display:block;margin:12px 0 3px;font-size:27px}.kpi-card small{color:var(--muted);font-weight:700}.kpi-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:11px;font-weight:900}.kpi-icon.warning{background:#fff7ed;color:#c2410c}.kpi-icon.progress{background:#eff6ff;color:#1d4ed8}.kpi-icon.success{background:#f0fdf4;color:#15803d}.kpi-icon.neutral{background:#f8fafc;color:#475569}
.section-card,.search-card,.status-card,.loading-card,.message-card,.empty-state{margin-top:14px;padding:21px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.section-heading h3{margin:4px 0 0;font-size:20px}.view-header{margin:6px 2px 18px}.view-header h2{margin:5px 0 7px;font-size:28px;letter-spacing:-.04em}
.insights-list{display:grid;gap:10px;margin-top:16px}.insight{padding:15px;border-left:4px solid #94a3b8;border-radius:14px;background:#f8fafc}.insight.critico{border-color:var(--danger);background:#fff7f7}.insight.atencao{border-color:var(--warning);background:#fffbeb}.insight.normal{border-color:var(--success);background:#f0fdf4}.insight strong{display:block;margin-bottom:4px}.insight p{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
.bar-list{display:grid;gap:13px;margin-top:18px}.bar-item{display:grid;grid-template-columns:minmax(100px,180px) 1fr 38px;gap:10px;align-items:center}.bar-label{font-size:12px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-track{height:10px;background:#eef2f7;border-radius:999px;overflow:hidden}.bar-fill{height:100%;background:linear-gradient(90deg,#1d4ed8,#60a5fa);border-radius:inherit}.bar-value{font-size:12px;font-weight:900;text-align:right}.bar-list.large .bar-track{height:14px}
.filter-pills{display:flex;gap:8px;overflow:auto;margin-bottom:12px}.filter-pill{border:1px solid var(--line);background:#fff;border-radius:999px;padding:9px 13px;font-weight:800;color:var(--muted);cursor:pointer;white-space:nowrap}.filter-pill.active{background:var(--navy);color:#fff;border-color:var(--navy)}
.critical-list{display:grid;gap:10px}.critical-card{padding:17px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);cursor:pointer}.critical-top{display:flex;justify-content:space-between;gap:12px}.critical-card h4{margin:0 0 4px}.critical-card p{margin:0;color:var(--muted);font-size:13px}.critical-badge{height:max-content;padding:6px 9px;border-radius:999px;background:#fee2e2;color:#991b1b;font-size:10px;font-weight:900}.critical-meta{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.critical-meta span{padding:6px 8px;border-radius:9px;background:#f1f5f9;color:#475569;font-size:10px;font-weight:800}
.summary-grid,.executive-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:14px}.executive-grid{grid-template-columns:repeat(4,1fr)}.summary-card,.executive-card{padding:18px;border-radius:19px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow)}.summary-card strong,.executive-card strong{display:block;font-size:26px}.summary-card span,.executive-card span{color:var(--muted);font-size:12px;font-weight:700}
.trend-chart{display:flex;align-items:flex-end;gap:9px;height:210px;margin-top:20px;padding-top:12px;border-bottom:1px solid var(--line)}.trend-column{display:flex;flex:1;flex-direction:column;justify-content:flex-end;align-items:center;height:100%;gap:7px}.trend-value{font-size:10px;font-weight:900}.trend-bar{width:min(34px,75%);min-height:4px;border-radius:9px 9px 2px 2px;background:linear-gradient(180deg,#60a5fa,#1d4ed8)}.trend-label{font-size:10px;color:var(--muted);font-weight:700}
.search-row{display:grid;grid-template-columns:1fr auto;gap:9px}.search-row input{height:54px;border:1px solid var(--line);border-radius:15px;padding:0 15px;background:#f8fafc;outline:none}.search-row input:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(29,78,216,.1)}.search-row button,.login-card button{height:54px;border:0;border-radius:15px;padding:0 20px;background:linear-gradient(135deg,#0b1f3a,#1d4ed8);color:#fff;font-weight:900;cursor:pointer}
.empty-state{text-align:center;padding:38px}.empty-icon{display:grid;place-items:center;width:62px;height:62px;margin:auto auto 14px;border-radius:20px;background:#eff6ff;color:var(--primary);font-size:28px}.empty-state h2{margin:0 0 7px}.empty-state p{margin:0;color:var(--muted)}
.spinner{width:34px;height:34px;margin:auto;border:4px solid #dbeafe;border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-card{text-align:center}.message-card.error{color:#991b1b;background:#fff7f7;border-color:#fecaca}
.status-main{display:flex;justify-content:space-between;gap:12px}.order-label{font-size:11px;color:var(--muted);font-weight:900}.status-main h2{margin:4px 0;font-size:31px}.status-badge,.count-pill{display:grid;place-items:center;min-height:34px;padding:0 12px;border-radius:999px;font-size:11px;font-weight:900}.status-badge.andamento{background:#fef9c3;color:#854d0e}.status-badge.finalizado{background:#dcfce7;color:#166534}.status-badge.pendente{background:#ffedd5;color:#9a3412}.status-badge.cancelado{background:#fee2e2;color:#991b1b}.count-pill{background:#eff6ff;color:var(--primary)}
.customer-block{display:grid;gap:4px;margin-top:16px;padding-top:15px;border-top:1px solid var(--line)}.customer-block span{color:var(--muted);font-size:12px}.delivery-card,.updated-card{display:flex;gap:12px;align-items:center;margin-top:14px;padding:14px;border-radius:16px;background:#f8fafc}.delivery-content{display:grid;gap:2px}.delivery-label,.updated-card small{font-size:9px;color:var(--muted);font-weight:900;letter-spacing:.1em}.delivery-content small{color:var(--muted)}.metrics-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:14px}.metric{padding:13px;text-align:center;border-radius:15px;background:#f8fafc}.metric strong{display:block;font-size:21px}.metric span{font-size:10px;color:var(--muted);font-weight:700}
.steps-list{display:grid;gap:9px;margin-top:15px}.step-item{padding:14px;border:1px solid var(--line);border-radius:15px;background:#fbfdff}.step-top{display:flex;justify-content:space-between;gap:10px}.step-name{font-weight:900}.step-status{font-size:10px;font-weight:900;color:#854d0e}.step-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.step-meta span{padding:5px 8px;border-radius:8px;background:#f1f5f9;font-size:10px;color:#475569;font-weight:700}.all-done{text-align:center;color:var(--success)}
.login-overlay{position:fixed;inset:0;z-index:999;display:grid;place-items:center;padding:20px;background:rgba(11,18,32,.76);backdrop-filter:blur(10px)}.login-card{width:min(100%,410px);padding:30px;border-radius:27px;background:#fff;text-align:center;box-shadow:0 30px 80px rgba(0,0,0,.3)}.login-lock{display:grid;place-items:center;width:66px;height:66px;margin:auto auto 16px;border-radius:21px;background:#eff6ff;font-size:29px}.login-card h1{margin:7px 0}.login-card p{color:var(--muted)}.login-card form{display:grid;gap:9px;margin-top:20px}.login-card input{height:54px;border:1px solid var(--line);border-radius:15px;padding:0 15px}.login-error{margin-top:12px;padding:10px;border-radius:10px;background:#fff1f2;color:#991b1b;font-weight:700}
@media(max-width:650px){.app-shell{padding:15px 12px 40px}.topbar p{display:none}.brand-mark{width:50px;height:50px}.logout-button{display:none}.module-nav{bottom:8px;top:auto;position:fixed;left:10px;right:10px;margin:0;z-index:50}.app-shell{padding-bottom:92px}.kpi-grid{grid-template-columns:repeat(2,1fr)}.hero-card{display:grid}.hero-time{text-align:left}.summary-grid{grid-template-columns:repeat(3,1fr)}.executive-grid{grid-template-columns:repeat(2,1fr)}.search-row{grid-template-columns:1fr}.bar-item{grid-template-columns:105px 1fr 28px}.module-tab{min-height:52px}.module-tab span{font-size:9px}}


.company-selector{
  display:flex;justify-content:space-between;align-items:center;gap:14px;
  margin-bottom:14px;padding:15px 17px;background:#fff;border:1px solid var(--line);
  border-radius:18px;box-shadow:var(--shadow)
}
.company-selector div{display:grid;gap:4px}
.company-selector strong{font-size:14px}
.company-selector select,.list-summary select{
  min-height:42px;border:1px solid var(--line);border-radius:12px;
  padding:0 12px;background:#f8fafc;color:var(--text);font-weight:800;outline:none
}
.list-summary{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  margin:10px 0 12px;color:var(--muted);font-size:12px;font-weight:800
}
.pagination{
  display:flex;justify-content:center;align-items:center;gap:12px;margin-top:16px
}
.pagination button{
  border:1px solid var(--line);background:#fff;color:var(--primary);
  border-radius:12px;padding:10px 15px;font-weight:900;cursor:pointer
}
.pagination button:disabled{opacity:.4;cursor:not-allowed}
.pagination span{font-size:12px;color:var(--muted);font-weight:800}
.summary-grid{grid-template-columns:repeat(4,1fr)}
@media(max-width:650px){
  .company-selector{display:grid}
  .company-selector select{width:100%}
  .list-summary{align-items:flex-start}
  .summary-grid{grid-template-columns:repeat(2,1fr)}
}

.company-selector select:disabled{opacity:.55;cursor:wait}


.install-button{
  display:inline-flex;align-items:center;gap:7px;border:0;border-radius:13px;
  padding:10px 14px;background:linear-gradient(135deg,#0b1f3a,#1d4ed8);
  color:#fff;font-weight:900;cursor:pointer;
  box-shadow:0 10px 24px rgba(29,78,216,.2)
}
.install-button span{font-size:18px;line-height:1}
.install-modal{
  position:fixed;inset:0;z-index:1200;display:grid;place-items:center;
  padding:20px;background:rgba(11,18,32,.72);backdrop-filter:blur(9px)
}
.install-dialog{
  position:relative;width:min(100%,430px);padding:30px;border-radius:28px;
  background:#fff;text-align:center;box-shadow:0 30px 90px rgba(0,0,0,.32)
}
.install-close{
  position:absolute;top:13px;right:15px;width:36px;height:36px;border:0;
  border-radius:50%;background:#f1f5f9;color:#475569;font-size:25px;cursor:pointer
}
.install-app-icon{
  width:88px;height:88px;border-radius:22px;margin-bottom:14px;
  box-shadow:0 13px 28px rgba(11,31,58,.22)
}
.install-dialog h2{margin:7px 0;font-size:27px;letter-spacing:-.035em}
.install-dialog>p{margin:0;color:var(--muted);line-height:1.5}
.install-instructions{
  margin-top:18px;padding:16px;border-radius:17px;background:#f8fafc;
  text-align:left;border:1px solid var(--line)
}
.install-instructions strong{display:block;margin-bottom:8px;color:var(--navy)}
.install-instructions ol{margin:0;padding-left:21px;color:#475569}
.install-instructions li{margin:7px 0;line-height:1.45}
.install-confirm{
  width:100%;height:52px;margin-top:16px;border:0;border-radius:15px;
  background:linear-gradient(135deg,#0b1f3a,#1d4ed8);color:#fff;
  font-weight:900;cursor:pointer
}
@media(max-width:650px){
  .install-button{position:fixed;right:16px;bottom:82px;z-index:60;
    padding:12px 15px;border-radius:16px}
}
