:root{
  --bg:#0b1220; --surface:#ffffff; --surface-2:#f5f7fb; --line:#e6eaf2;
  --ink:#0f1b33; --ink-2:#5b6680; --muted:#8a93a8;
  --brand:#3b4cca; --brand-2:#5b6cf0; --brand-ink:#2a3699;
  --ok:#16a34a; --ok-bg:#e9f7ef; --warn:#d97706; --warn-bg:#fdf1e1; --err:#dc2626; --err-bg:#fdecec;
  --info:#2563eb; --info-bg:#e8f0fe;
  --radius:14px; --radius-sm:10px;
  --shadow:0 1px 2px rgba(16,27,51,.06), 0 8px 24px rgba(16,27,51,.06);
  --shadow-lg:0 10px 40px rgba(16,27,51,.14);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--ink);
  background:var(--surface-2);-webkit-font-smoothing:antialiased;min-height:100vh;display:flex;flex-direction:column}
a{color:var(--brand);text-decoration:none}
h1,h2,h3{margin:0;font-weight:600;letter-spacing:-.01em}

/* ---------- topbar ---------- */
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:14px 26px;background:linear-gradient(100deg,#1b2a6b,#3b4cca 60%,#5b6cf0);
  color:#fff;box-shadow:0 2px 18px rgba(27,42,107,.25);position:sticky;top:0;z-index:10}
.brand{display:flex;flex-direction:column;line-height:1.1}
.brand-mark{font-weight:700;font-size:18px;letter-spacing:-.02em}
.brand-mark span{color:#c7d0ff;font-weight:500}
.brand-sub{font-size:11.5px;color:#c2caf2;margin-top:2px;letter-spacing:.02em}
.topnav{display:flex;align-items:center;gap:8px}
.navlink{color:#dfe4ff;padding:8px 12px;border-radius:9px;font-size:14px;font-weight:500}
.navlink:hover{background:rgba(255,255,255,.12);color:#fff}
.user{display:flex;align-items:center;gap:10px;margin-left:8px;padding-left:14px;border-left:1px solid rgba(255,255,255,.18)}
.user-avatar{width:32px;height:32px;border-radius:50%;background:#fff;color:var(--brand-ink);
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px}
.user-name{font-size:13.5px;color:#eef0ff;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.logout-form{margin:0}
.btn-ghost{background:rgba(255,255,255,.14);color:#fff;border:none;padding:7px 12px;border-radius:9px;
  font-size:13px;font-weight:500;cursor:pointer;font-family:inherit}
.btn-ghost:hover{background:rgba(255,255,255,.26)}

/* ---------- content ---------- */
.content{flex:1;max-width:1120px;width:100%;margin:0 auto;padding:26px 24px 40px}
.page-head{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:20px}
.page-head h1{font-size:23px}
.page-head .sub{color:var(--muted);font-size:13.5px;margin-top:4px}
.foot{text-align:center;color:var(--muted);font-size:12px;padding:18px}

/* ---------- alert ---------- */
.alert{display:flex;align-items:center;gap:12px;border-radius:var(--radius-sm);padding:13px 16px;margin-bottom:20px;font-size:14px;border:1px solid transparent}
.alert .ico{font-size:18px;line-height:1}
.alert.err{background:var(--err-bg);color:#991b1b;border-color:#f6caca}
.alert.warn{background:var(--warn-bg);color:#92400e;border-color:#f3dcb4}
.alert.ok{background:var(--ok-bg);color:#166534;border-color:#bfe6cd}
.alert.info{background:var(--info-bg);color:#1e40af;border-color:#cfe0fd}

/* ---------- metric cards ---------- */
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin-bottom:22px}
.metric{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:17px 18px;box-shadow:var(--shadow)}
.metric .lab{font-size:12.5px;color:var(--muted);font-weight:500;display:flex;align-items:center;gap:7px}
.metric .val{font-size:24px;font-weight:700;margin-top:9px;display:flex;align-items:center;gap:9px;letter-spacing:-.02em}
.metric .hint{font-size:12px;color:var(--muted);margin-top:3px}

.dot{display:inline-block;width:10px;height:10px;border-radius:50%;flex:none}
.dot.ok{background:var(--ok);box-shadow:0 0 0 4px var(--ok-bg)}
.dot.warn{background:var(--warn);box-shadow:0 0 0 4px var(--warn-bg)}
.dot.err{background:var(--err);box-shadow:0 0 0 4px var(--err-bg)}
.dot.idle{background:#9aa3b8;box-shadow:0 0 0 4px #eef0f5}

/* ---------- panel + table ---------- */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:22px;overflow:hidden}
.panel-head{display:flex;align-items:center;justify-content:space-between;padding:15px 20px;border-bottom:1px solid var(--line)}
.panel-head h2{font-size:15.5px}
.panel-head .tag{font-size:11.5px;color:var(--muted)}
.tbl{width:100%;border-collapse:collapse}
.tbl th,.tbl td{padding:12px 20px;text-align:left;font-size:13.5px;border-bottom:1px solid var(--line)}
.tbl th{font-size:11.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:600;background:var(--surface-2)}
.tbl tr:last-child td{border-bottom:none}
.tbl tr:hover td{background:#fafbff}
.grp{font-size:11px;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.num{font-variant-numeric:tabular-nums;font-weight:600}
.cell-status{display:flex;align-items:center;gap:8px}
.mono{font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px}

.badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;padding:3px 9px;border-radius:999px;line-height:1.4}
.badge.ok{background:var(--ok-bg);color:#166534}
.badge.warn{background:var(--warn-bg);color:#92400e}
.badge.err{background:var(--err-bg);color:#991b1b}
.badge.idle{background:#eef0f5;color:#5b6680}
.http{font-weight:700;font-variant-numeric:tabular-nums}
.http.s2{color:var(--ok)} .http.s4{color:var(--err)} .http.s5{color:#b91c1c} .http.s0{color:var(--warn)}

/* ---------- auth ---------- */
body.auth{background:radial-gradient(1200px 600px at 70% -10%,#3b4cca22,transparent),
  radial-gradient(900px 500px at -10% 110%,#5b6cf022,transparent),var(--surface-2)}
.auth-shell{flex:1;display:flex;align-items:center;justify-content:center;padding:30px 18px}
.card-auth{width:100%;max-width:420px;background:var(--surface);border:1px solid var(--line);
  border-radius:18px;box-shadow:var(--shadow-lg);padding:34px 32px}
.card-auth .logo{font-weight:700;font-size:20px;color:var(--brand-ink);letter-spacing:-.02em}
.card-auth .logo span{color:var(--brand-2)}
.card-auth .tagline{color:var(--muted);font-size:13px;margin:4px 0 24px}
.card-auth h1{font-size:19px;margin-bottom:6px}
.card-auth .lead{color:var(--ink-2);font-size:13.5px;margin:0 0 22px}
.field{margin-bottom:16px}
.field label{display:block;font-size:13px;font-weight:500;margin-bottom:7px;color:var(--ink)}
.field input,.field textarea{width:100%;padding:11px 13px;border:1px solid var(--line);border-radius:10px;
  font-size:14px;font-family:inherit;background:var(--surface-2);transition:border .15s,box-shadow .15s;color:var(--ink)}
.field input:focus,.field textarea:focus{outline:none;border-color:var(--brand-2);background:#fff;box-shadow:0 0 0 3px #5b6cf022}
.field textarea{resize:vertical;min-height:84px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:12px 16px;
  background:linear-gradient(100deg,var(--brand),var(--brand-2));color:#fff;border:none;border-radius:11px;
  font-size:14.5px;font-weight:600;cursor:pointer;font-family:inherit;transition:filter .15s,transform .06s}
.btn:hover{filter:brightness(1.06)} .btn:active{transform:scale(.99)}
.btn.sec{background:#eef0f7;color:var(--brand-ink)}
.altlink{text-align:center;margin-top:18px;font-size:13.5px;color:var(--muted)}
.msg{border-radius:10px;padding:11px 14px;font-size:13.5px;margin-bottom:18px}
.msg.err{background:var(--err-bg);color:#991b1b}
.msg.ok{background:var(--ok-bg);color:#166534}
.msg.info{background:var(--info-bg);color:#1e40af}

/* approval list */
.req{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 20px;border-bottom:1px solid var(--line)}
.req:last-child{border-bottom:none}
.req .who{font-weight:600;font-size:14px}
.req .meta{color:var(--muted);font-size:12.5px;margin-top:3px}
.req .why{color:var(--ink-2);font-size:13px;margin-top:6px;max-width:520px}
.req-actions{display:flex;gap:8px;flex:none}
.btn-sm{padding:8px 14px;border-radius:9px;border:none;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.btn-sm.ap{background:var(--ok);color:#fff} .btn-sm.rj{background:#eef0f5;color:#991b1b}
.empty{padding:34px 20px;text-align:center;color:var(--muted);font-size:14px}
.refresh-link{background:#eef0f7;color:var(--brand-ink)}
.filters{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius);padding:16px 18px;margin-bottom:18px;box-shadow:var(--shadow)}
.filters>div{min-width:155px}.filters .filter-grow{flex:1;min-width:260px}
.filters label{display:block;font-size:11.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:600;margin-bottom:6px}
.filters input,.filters select{width:100%;height:40px;padding:8px 11px;border:1px solid var(--line);border-radius:9px;background:var(--surface-2);
  color:var(--ink);font-size:13.5px;font-family:inherit}
.filters input:focus,.filters select:focus{outline:none;border-color:var(--brand-2);box-shadow:0 0 0 3px #5b6cf022;background:#fff}
.filters .filter-button{width:auto;height:40px;padding:8px 20px;border-radius:9px}
.trace-metrics{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.table-scroll{overflow-x:auto}.trace-table{min-width:1040px}
.nowrap{white-space:nowrap}.direction{white-space:nowrap;font-size:12px;font-weight:600;color:var(--brand-ink)}
.trace-entity{font-weight:600;margin-bottom:3px}.trace-id{max-width:230px;overflow-wrap:anywhere}
.trace-uuid,.trace-source{font-size:11px;color:var(--muted);margin-top:3px;max-width:220px;overflow-wrap:anywhere}
.trace-detail{max-width:320px;line-height:1.45;color:var(--ink-2);overflow-wrap:anywhere}
.trace-link{text-decoration:none;color:var(--brand-2)!important;font-weight:600}.trace-link:hover{text-decoration:underline}
.home-trace-table{min-width:940px}.trace-error{color:var(--err)}
.trace-storage{font-size:11.5px;color:var(--muted);margin-top:6px;line-height:1.4}.trace-storage b{color:var(--ink-2)}
.panel-note{padding:10px 20px;border-bottom:1px solid var(--line);font-size:12.5px}.warn-note{background:var(--warn-bg);color:#92400e}
.panel-links{display:flex;align-items:center;gap:15px;flex-wrap:wrap;justify-content:flex-end}

/* ---------- central de recebimentos ---------- */
.content.wide{max-width:1460px;padding-top:30px}
.receive-hero{position:relative;display:flex;align-items:flex-end;justify-content:space-between;gap:28px;padding:28px 30px;margin-bottom:20px;
  overflow:hidden;color:#fff;border-radius:20px;background:linear-gradient(125deg,#172556 0%,#2e3ca4 58%,#5b6cf0 100%);box-shadow:0 18px 48px rgba(30,45,126,.22)}
.receive-hero:before,.receive-hero:after{content:"";position:absolute;border-radius:50%;border:1px solid rgba(255,255,255,.11)}
.receive-hero:before{width:280px;height:280px;right:-70px;top:-155px}.receive-hero:after{width:180px;height:180px;right:120px;bottom:-145px}
.receive-hero>div{position:relative;z-index:1}.receive-hero h1{font-size:31px;letter-spacing:-.035em;margin-top:9px}
.receive-hero p{max-width:680px;margin:8px 0 0;color:#dfe4ff;font-size:14.5px;line-height:1.55}
.eyebrow{display:flex;align-items:center;gap:8px;font-size:11px;text-transform:uppercase;letter-spacing:.1em;font-weight:700;color:#cbd2ff}
.eyebrow-dot{width:7px;height:7px;border-radius:50%;background:#6ee7b7;box-shadow:0 0 0 5px rgba(110,231,183,.13)}
.hero-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end;min-width:430px}
.action-btn{height:42px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 15px;border-radius:10px;border:1px solid transparent;
  font-family:inherit;font-size:13px;font-weight:650;cursor:pointer;white-space:nowrap;transition:transform .12s,box-shadow .16s,background .16s}
.action-btn:hover{transform:translateY(-1px)}.action-btn.primary{background:#fff;color:#2a3699;box-shadow:0 5px 16px rgba(10,18,60,.15)}
.action-btn.secondary{background:rgba(255,255,255,.11);color:#fff;border-color:rgba(255,255,255,.22)}
.action-btn.secondary:hover{background:rgba(255,255,255,.18)}.action-icon{width:22px;height:22px;display:grid;place-items:center;border-radius:6px;background:rgba(255,255,255,.14);font-size:10px;font-weight:800}
.refresh-symbol{font-size:18px;line-height:1}
.status-banner{display:flex;align-items:center;gap:14px;padding:15px 18px;margin-bottom:20px;border-radius:14px;border:1px solid #f2d49f;background:linear-gradient(90deg,#fff8e9,#fffdf8);color:#7c440c}
.status-banner-icon{width:32px;height:32px;display:grid;place-items:center;flex:none;border-radius:9px;background:#f59e0b;color:#fff;font-weight:800}
.status-banner strong{font-size:13.5px}.status-banner p{margin:3px 0 0;font-size:12.5px;color:#9a621f;line-height:1.45}.status-pill{margin-left:auto;white-space:nowrap;border-radius:999px;padding:5px 10px;font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;font-weight:750}.status-pill.offline{background:#fce7bd;color:#94520b}
.source-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:18px}
.source-card{position:relative;padding:19px 20px 18px;background:#fff;border:1px solid var(--line);border-top:3px solid #9aa3b8;border-radius:15px;box-shadow:var(--shadow);overflow:hidden}
.source-card:after{content:"";position:absolute;width:92px;height:92px;border-radius:50%;right:-36px;bottom:-50px;background:#eef1f8}
.source-card.active{border-top-color:#16a34a}.source-card.paused{border-top-color:#d97706}.source-card.disabled{border-top-color:#94a3b8}.source-card.error{border-top-color:#dc2626}
.source-top{display:flex;align-items:center;justify-content:space-between}.source-symbol{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#edf0ff;color:#3443b4;font-size:13px;font-weight:800}
.source-state{display:flex;align-items:center;gap:6px;font-size:10.5px;text-transform:uppercase;letter-spacing:.05em;font-weight:750;color:#64748b}.source-state .mini-dot{width:7px;height:7px;border-radius:50%;background:#94a3b8}.active .source-state .mini-dot{background:#16a34a}.paused .source-state .mini-dot{background:#d97706}.error .source-state .mini-dot{background:#dc2626}
.source-card h2{font-size:15px;margin-top:15px}.source-count{font-size:25px;font-weight:750;margin-top:6px;letter-spacing:-.03em}.source-count small{font-size:11.5px;font-weight:500;color:var(--muted);letter-spacing:0}
.source-meta{display:flex;justify-content:space-between;gap:12px;margin-top:12px;padding-top:11px;border-top:1px solid var(--line);font-size:10.5px;color:var(--muted)}.source-card>p{position:relative;z-index:1;margin:9px 0 0;font-size:11.5px;color:var(--ink-2);line-height:1.45;max-width:94%}
.receive-metrics{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:18px}.receive-kpi{position:relative;padding:16px 17px 15px;border-radius:14px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);overflow:hidden}
.receive-kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#3b4cca}.receive-kpi.purple:before{background:#7c3aed}.receive-kpi.amber:before{background:#f59e0b}.receive-kpi.green:before{background:#16a34a}.receive-kpi.slate:before{background:#64748b}
.kpi-label{display:block;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;font-weight:650}.receive-kpi>strong{display:block;font-size:25px;margin-top:7px;letter-spacing:-.03em}.receive-kpi>strong.date-value{font-size:20px;margin-top:10px}.kpi-caption{display:block;margin-top:3px;font-size:10.5px;color:#9aa3b8}
.analytics-grid{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(300px,1fr);gap:16px;margin-bottom:18px}.analytics-card{background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);padding:18px 20px}
.analytics-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.analytics-head h2{font-size:14.5px}.analytics-head p{font-size:11.5px;color:var(--muted);margin:4px 0 0}.chart-legend{display:flex;gap:14px;font-size:10.5px;color:var(--ink-2)}.chart-legend span{display:flex;align-items:center;gap:5px}.chart-legend i{width:8px;height:8px;border-radius:2px}.legend-oee{background:#4f5fdd}.legend-quality{background:#f59e0b}
.activity-chart{height:155px;display:grid;grid-template-columns:repeat(7,1fr);gap:12px;margin-top:18px;padding-top:4px;border-bottom:1px solid var(--line);background:repeating-linear-gradient(to bottom,transparent 0,transparent 38px,#f0f2f7 39px)}
.activity-column{min-width:0;display:grid;grid-template-rows:1fr auto auto;justify-items:center;gap:4px;position:relative}.bar-area{height:106px;width:min(38px,80%);display:flex;align-items:flex-end;justify-content:center;gap:3px}.bar{display:block;width:46%;min-height:2px;border-radius:4px 4px 1px 1px}.bar.oee{background:linear-gradient(#7180ed,#4554d1)}.bar.quality{background:linear-gradient(#fbbf5a,#ed9709)}.activity-column>strong{position:absolute;top:-1px;font-size:9.5px;color:var(--muted);font-weight:600}.activity-column>small{font-size:9.5px;color:var(--muted);white-space:nowrap}
.composition-card{display:flex;flex-direction:column}.composition-total{display:flex;align-items:baseline;gap:7px;margin:18px 0 16px}.composition-total strong{font-size:29px;letter-spacing:-.04em}.composition-total span{font-size:11.5px;color:var(--muted)}.composition-row{margin-top:13px}.composition-row>div:first-child{display:flex;align-items:center;justify-content:space-between;font-size:11.5px}.composition-row small{display:block;text-align:right;font-size:9.5px;color:var(--muted);margin-top:4px}.progress{height:7px;margin-top:7px;border-radius:99px;background:#eef0f6;overflow:hidden}.progress span{display:block;height:100%;min-width:0;border-radius:99px}.progress-oee{background:#4f5fdd}.progress-quality{background:#f59e0b}
.receive-filters{background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);padding:17px 18px;margin-bottom:18px}.filter-title{display:flex;align-items:center;gap:11px;padding-bottom:14px;border-bottom:1px solid var(--line)}.filter-symbol{width:34px;height:34px;display:grid;place-items:center;border-radius:10px;background:#edf0ff;color:#3443b4;font-size:20px}.filter-title strong{display:block;font-size:13.5px}.filter-title span{display:block;font-size:11px;color:var(--muted);margin-top:2px}.filter-fields{display:grid;grid-template-columns:minmax(260px,2fr) repeat(4,minmax(130px,1fr)) auto auto;gap:10px;align-items:end;padding-top:14px}.filter-fields label{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:650;margin-bottom:5px}.filter-fields input,.filter-fields select{width:100%;height:39px;border:1px solid var(--line);border-radius:9px;background:#f8f9fc;padding:0 10px;font:12.5px inherit;color:var(--ink)}.filter-fields input:focus,.filter-fields select:focus{outline:none;background:#fff;border-color:#6d79e6;box-shadow:0 0 0 3px #5b6cf01c}.filter-fields .action-btn.primary{height:39px;background:linear-gradient(100deg,#3b4cca,#5b6cf0);color:#fff}.clear-filter{height:39px;display:flex;align-items:center;padding:0 7px;font-size:11.5px;color:var(--muted);text-decoration:underline}
.receive-table-panel{background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);overflow:hidden}.receive-table-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 20px;border-bottom:1px solid var(--line)}.receive-table-head h2{font-size:15px}.receive-table-head p{font-size:11px;color:var(--muted);margin:4px 0 0}.result-chip{padding:5px 10px;border-radius:999px;background:#edf0ff;color:#3443b4;font-size:10.5px;font-weight:700}
.receive-table{width:100%;border-collapse:collapse;min-width:1180px}.receive-table th,.receive-table td{text-align:left;padding:13px 16px;border-bottom:1px solid var(--line);vertical-align:middle}.receive-table th{background:#f8f9fc;font-size:10px;text-transform:uppercase;letter-spacing:.055em;color:var(--muted);font-weight:700}.receive-table td{font-size:12px;color:var(--ink-2)}.receive-table tbody tr:hover{background:#fbfcff}.receive-table tbody tr:last-child td{border-bottom:0}.date-cell strong,.date-cell span{display:block;white-space:nowrap}.date-cell strong{color:var(--ink);font-size:11.5px}.date-cell span{font-size:10.5px;color:var(--muted);margin-top:2px}.type-chip{display:inline-flex;padding:4px 7px;border-radius:6px;font-size:9.5px;font-weight:800;letter-spacing:.04em}.type-chip.oee{color:#3948bf;background:#edf0ff}.type-chip.quality{color:#9a5a08;background:#fff3dc}.flow-label{display:block;color:var(--muted);font-size:9.5px;margin-top:5px;white-space:nowrap}.order-number{display:block;color:var(--ink);font-size:12.5px}.reference{display:block;margin-top:3px;font-size:11px;max-width:210px}.external-id{display:block;margin-top:4px;color:#8a93a8;font-size:9.5px;max-width:200px;overflow:hidden;text-overflow:ellipsis}.indicator-grid{display:grid;grid-template-columns:repeat(2,minmax(70px,1fr));gap:5px 12px}.indicator-grid span{display:flex;justify-content:space-between;gap:6px}.indicator-grid small{font-size:9px;color:var(--muted)}.indicator-grid strong{font-size:10.5px;color:var(--ink)}.quality-value{display:flex;align-items:baseline;gap:5px}.quality-value strong{font-size:17px;color:var(--ink)}.quality-value span{font-size:9.5px;color:var(--muted)}.nc-code{margin-top:4px;font-size:10px;font-weight:650;color:#166534}.record-status{display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border-radius:99px;font-size:9.5px;font-weight:700;white-space:nowrap}.record-status i{width:6px;height:6px;border-radius:50%}.record-status.stored{background:#edf0ff;color:#3443b4}.record-status.stored i{background:#4f5fdd}.record-status.staging{background:#fff3dc;color:#9a5a08}.record-status.staging i{background:#f59e0b}.record-status.processed{background:#eaf5ff;color:#176393}.record-status.processed i{background:#2a8bc5}.record-status.integrated{background:#e8f7ee;color:#166534}.record-status.integrated i{background:#16a34a}.storage-cell{max-width:360px}.table-name{display:inline-flex;padding:3px 6px;border-radius:5px;background:#f0f2f7;color:#4b5873;font-size:9.5px}.storage-cell p{font-size:10.5px;line-height:1.4;margin:5px 0 0;color:var(--ink-2)}.receive-empty{display:flex;flex-direction:column;align-items:center;gap:5px;padding:48px 20px;text-align:center;color:var(--muted)}.receive-empty .empty-symbol{font-size:27px;color:#6d79e6}.receive-empty strong{color:var(--ink);font-size:14px}.receive-empty span{font-size:11.5px}

@media(max-width:1180px){.receive-metrics{grid-template-columns:repeat(3,1fr)}.filter-fields{grid-template-columns:repeat(3,1fr)}.filter-search{grid-column:span 2}.source-grid{grid-template-columns:1fr}.source-card>p{max-width:100%}}
@media(max-width:760px){.content{padding:18px 14px}.content.wide{padding:18px 14px}.topbar{padding:12px 16px;align-items:flex-start}.topnav{flex-wrap:wrap;justify-content:flex-end}.user-name{display:none}.filters>div,.filters .filter-grow{min-width:100%;}.filters .filter-button{width:100%}.receive-hero{padding:23px 20px;align-items:flex-start;flex-direction:column}.receive-hero h1{font-size:25px}.hero-actions{min-width:0;width:100%;justify-content:flex-start}.hero-actions .action-btn{flex:1}.status-banner{align-items:flex-start}.status-pill{display:none}.receive-metrics{grid-template-columns:repeat(2,1fr)}.analytics-grid{grid-template-columns:1fr}.filter-fields{grid-template-columns:1fr}.filter-search{grid-column:auto}.filter-submit{width:100%}.clear-filter{justify-content:center}.source-meta{flex-direction:column;gap:4px}.activity-chart{gap:4px}.bar-area{width:28px}.receive-table-head{align-items:flex-start;flex-direction:column}}
@media(max-width:460px){.receive-metrics{grid-template-columns:1fr}.hero-actions{display:grid;grid-template-columns:1fr 1fr}.hero-actions .action-btn.primary{grid-column:span 2}.chart-legend{display:none}}

@media print{
  @page{size:landscape;margin:10mm}
  body{display:block;background:#fff;color:#111;font-size:10px}.topbar,.foot,.no-print,.status-banner,.source-grid,.receive-metrics,.analytics-grid{display:none!important}
  .content,.content.wide{max-width:none;padding:0;margin:0}.receive-hero{display:block;background:#fff;color:#111;box-shadow:none;border-radius:0;padding:0 0 12px;border-bottom:2px solid #25357f}.receive-hero h1{font-size:21px;color:#18265d}.receive-hero p,.eyebrow{color:#555}.receive-table-panel{border:0;box-shadow:none}.receive-table-head{padding:10px 0}.result-chip{color:#111;background:#eee}.table-scroll{overflow:visible}.receive-table{min-width:0}.receive-table th,.receive-table td{padding:6px 7px;font-size:8.5px}.receive-table th{background:#eee!important;color:#111}.receive-table tbody tr{break-inside:avoid}.storage-cell p{font-size:8px}.indicator-grid{gap:2px 6px}.type-chip,.record-status,.table-name{border:1px solid #aaa;background:#fff!important;color:#111!important}
}
.diagnosis-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:20px}.diagnosis-grid>div{background:#f8fafc;border:1px solid #e5eaf2;border-radius:14px;padding:16px}.diagnosis-grid span{display:block;color:#64748b;font-size:.76rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.diagnosis-grid strong{display:block;color:#0f2447;font-size:1.05rem;margin:8px 0}.diagnosis-grid p{color:#64748b;font-size:.84rem;line-height:1.45;margin:0}.flow-diagnosis{margin-bottom:20px}.flow-rules-panel{margin-bottom:20px}.rules-table{min-width:1180px}.rules-table td{vertical-align:top;line-height:1.45}
@media(max-width:900px){.diagnosis-grid{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.diagnosis-grid{grid-template-columns:1fr}}
.eligibility-panel{margin:0 0 20px;background:#fff;border:1px solid var(--line);border-top:4px solid #64748b;border-radius:16px;box-shadow:var(--shadow);overflow:hidden}
.eligibility-panel.blocked{border-top-color:#dc2626}.eligibility-panel.eligible{border-top-color:#d97706}.eligibility-panel.integrated{border-top-color:#16a34a}.eligibility-panel.not-found{border-top-color:#64748b}
.eligibility-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:21px 22px 18px;border-bottom:1px solid var(--line);background:linear-gradient(110deg,#fff,#f8f9fd)}
.eligibility-eyebrow{display:block;margin-bottom:5px;color:#5b6cf0;font-size:10px;font-weight:750;letter-spacing:.08em;text-transform:uppercase}.eligibility-head h2{font-size:19px}.eligibility-head p{margin:5px 0 0;color:var(--muted);font-size:12.5px;line-height:1.45}
.eligibility-summary{padding-top:2px}.eligibility-badge,.check-status{display:inline-flex;align-items:center;border-radius:999px;font-size:9.5px;font-weight:800;letter-spacing:.045em;text-transform:uppercase;white-space:nowrap}.eligibility-badge{padding:7px 11px}.eligibility-badge.ok{background:#e8f7ee;color:#166534}.eligibility-badge.blocked{background:#feecec;color:#b42318}.eligibility-badge.pending{background:#fff3dc;color:#9a5a08}.eligibility-badge.info{background:#eef1f6;color:#475569}
.eligibility-context{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border-bottom:1px solid var(--line);background:#fbfcff}.eligibility-context>div{min-width:0;padding:14px 18px;border-right:1px solid var(--line)}.eligibility-context>div:last-child{border-right:0}.eligibility-context span{display:block;color:var(--muted);font-size:9.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}.eligibility-context strong{display:block;margin-top:5px;color:var(--ink);font-size:11.5px;line-height:1.4;overflow-wrap:anywhere}
.eligibility-pending-list{display:grid;grid-template-columns:minmax(220px,.7fr) minmax(0,2fr);gap:22px;padding:17px 20px;border-bottom:1px solid #fecaca;background:#fff7f7}.eligibility-pending-list>div span{display:block;color:#b42318;font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.eligibility-pending-list>div strong{display:block;margin-top:5px;color:#7f1d1d;font-size:12px;line-height:1.45}.eligibility-pending-list ol{margin:0;padding-left:22px;color:#7f1d1d}.eligibility-pending-list li{padding:3px 0 7px;font-size:11.5px;line-height:1.4}.eligibility-pending-list li:last-child{padding-bottom:0}.eligibility-pending-list small{display:block;margin-top:2px;color:#9f3a38;font-size:10.5px}
.reprocess-form{display:flex;flex-direction:column;align-items:flex-end;gap:4px;margin-top:10px}.reprocess-button{border:0;border-radius:9px;padding:9px 12px;background:#3443b4;color:#fff;font:700 11px inherit;cursor:pointer;box-shadow:0 4px 12px rgba(52,67,180,.2)}.reprocess-button:hover{background:#28379f}.reprocess-form small{color:var(--muted);font-size:9px}.reprocess-status{display:grid;grid-template-columns:.7fr 1fr 2fr;gap:14px;padding:14px 18px;border-bottom:1px solid var(--line);background:#f8fafc}.reprocess-status.running{background:#eef3ff}.reprocess-status.success{background:#edf9f1}.reprocess-status.pending{background:#fff8e9}.reprocess-status.failed{background:#fff0f0}.reprocess-status span{display:block;color:var(--muted);font-size:9px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}.reprocess-status strong{display:block;margin-top:4px;color:var(--ink);font-size:11px;line-height:1.4}.reprocess-status small{display:block;margin-top:3px;color:var(--muted);font-size:9.5px}.operation-message.success{border-color:#9edab2;background:#effbf3;color:#166534}.operation-message.warning{border-color:#f2d49f;background:#fff8e9;color:#7c440c}.operation-message.error{border-color:#fecaca;background:#fff0f0;color:#9f1d1d}
.eligibility-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;padding:18px}.eligibility-check{position:relative;padding:15px 16px 14px;border:1px solid var(--line);border-left:4px solid #94a3b8;border-radius:12px;background:#fff}.eligibility-check.ok{border-left-color:#16a34a;background:#fbfefc}.eligibility-check.bloqueado{border-left-color:#dc2626;background:#fffafa}.eligibility-check.pendente{border-left-color:#d97706;background:#fffdf8}.eligibility-check.info{border-left-color:#64748b;background:#f8fafc}.check-top{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.check-top h3{font-size:12.5px;line-height:1.3}.check-status{padding:4px 7px;background:#eef1f6;color:#475569}.eligibility-check.ok .check-status{background:#e8f7ee;color:#166534}.eligibility-check.bloqueado .check-status{background:#feecec;color:#b42318}.eligibility-check.pendente .check-status{background:#fff3dc;color:#9a5a08}.eligibility-check.info .check-status{background:#e8edf4;color:#475569}.check-value{display:block;margin:9px 0 8px;color:var(--ink);font-size:11.5px;line-height:1.4;overflow-wrap:anywhere}.eligibility-check p{margin:5px 0 0;color:var(--ink-2);font-size:10.5px;line-height:1.45}.check-owner{margin-top:10px;padding-top:8px;border-top:1px dashed #dfe3ec;color:var(--muted);font-size:9.5px;font-weight:650}.eligibility-api-error{margin:0 18px 18px;padding:11px 13px;border-radius:9px;background:#fff0f0;color:#9f1d1d;font-size:11.5px;line-height:1.45}
@media(max-width:1080px){.eligibility-context{grid-template-columns:1fr 1fr}.eligibility-context>div:nth-child(2){border-right:0}.eligibility-context>div:nth-child(-n+2){border-bottom:1px solid var(--line)}.eligibility-grid{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.eligibility-head{flex-direction:column}.eligibility-context,.eligibility-grid,.eligibility-pending-list,.reprocess-status{grid-template-columns:1fr}.eligibility-context>div{border-right:0;border-bottom:1px solid var(--line)}.eligibility-context>div:last-child{border-bottom:0}.reprocess-form{align-items:stretch}}

/* Fila operacional de pendencias */
.pending-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:18px;padding:26px 28px;border-radius:18px;background:linear-gradient(120deg,#101a48,#3443b4);color:#fff;box-shadow:0 16px 40px rgba(30,44,112,.22)}
.pending-hero h1{margin-top:7px;font-size:28px;line-height:1.15}.pending-hero p{max-width:760px;margin:8px 0 0;color:#dfe4ff;font-size:13px}.pending-guide{margin-bottom:16px}
.pending-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:16px}.pending-kpis article{padding:17px 18px;border:1px solid var(--line);border-top:4px solid #64748b;border-radius:14px;background:#fff;box-shadow:var(--shadow)}.pending-kpis article.erp{border-top-color:#dc2626}.pending-kpis article.iot{border-top-color:#7c3aed}.pending-kpis article.api{border-top-color:#ea580c}.pending-kpis article.ready{border-top-color:#16a34a}.pending-kpis span,.pending-kpis small{display:block;color:var(--muted);font-size:10px}.pending-kpis span{font-weight:750;text-transform:uppercase;letter-spacing:.045em}.pending-kpis strong{display:block;margin:6px 0 3px;font-size:25px}
.pending-filters{display:grid;grid-template-columns:minmax(280px,1.5fr) minmax(220px,.8fr) auto auto;align-items:end;gap:12px;margin-bottom:16px;padding:16px 18px;border:1px solid var(--line);border-radius:14px;background:#fff}.pending-filters label{display:block;margin-bottom:6px;color:var(--muted);font-size:10px;font-weight:700;text-transform:uppercase}.pending-filters input,.pending-filters select{width:100%;min-height:40px;border:1px solid var(--line);border-radius:9px;padding:9px 11px;background:#fff;color:var(--ink);font:inherit;font-size:12px}
.pending-panel{overflow:hidden;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:var(--shadow)}.pending-panel-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border-bottom:1px solid var(--line);background:#fafbff}.pending-panel-head h2{font-size:17px}.pending-panel-head p{margin:4px 0 0;color:var(--muted);font-size:10.5px}
.pending-table{width:100%;border-collapse:collapse;min-width:1180px}.pending-table th{padding:11px 12px;background:#f6f7fb;color:#667085;font-size:9px;text-align:left;text-transform:uppercase;letter-spacing:.04em}.pending-table td{padding:13px 12px;border-top:1px solid #edf0f5;vertical-align:top;font-size:10.5px;line-height:1.45}.pending-record strong,.pending-record span,.pending-record small,.pending-attempt strong,.pending-attempt small{display:block}.pending-record strong{font-size:12.5px}.pending-record span{margin-top:3px;color:#3443b4;font-weight:650}.pending-record small,.pending-attempt small{margin-top:3px;color:var(--muted)}.pending-status{display:inline-flex;align-items:center;gap:6px;padding:6px 8px;border-radius:999px;font-size:9px;font-weight:800;white-space:nowrap}.pending-status i{width:6px;height:6px;border-radius:50%;background:currentColor}.pending-status.erp{background:#feecec;color:#b42318}.pending-status.iot{background:#f2eefe;color:#6d28d9}.pending-status.api{background:#fff0e8;color:#c2410c}.pending-status.ready{background:#e8f7ee;color:#166534}.pending-reason{max-width:260px;color:var(--ink);font-weight:550}.pending-owner{color:#3443b4;font-size:10px}.pending-action{max-width:300px;color:var(--ink-2)}.pending-detail{display:inline-flex;padding:7px 9px;border-radius:8px;background:#eef1ff;color:#3443b4;font-size:9.5px;font-weight:750;white-space:nowrap}.pending-detail:hover{background:#dfe4ff}
@media(max-width:1100px){.pending-kpis{grid-template-columns:repeat(3,1fr)}.pending-filters{grid-template-columns:1fr 1fr}.pending-hero{align-items:flex-start;flex-direction:column}}
@media(max-width:700px){.pending-kpis,.pending-filters{grid-template-columns:1fr}.pending-hero{padding:22px 20px}.pending-hero h1{font-size:23px}}
.pending-kpis article.provisional{border-top-color:#0891b2}
.pending-kpis article.queued{border-top-color:#ca8a04}
.pending-status.queued{background:#fef9c3;color:#854d0e}
.pending-status.provisional,.eligibility-badge.provisional{background:#e6f8fb;color:#0e7490}
.eligibility-panel.provisional{border-color:#67e8f9;box-shadow:0 10px 30px rgba(8,145,178,.12)}
.pending-kpis{grid-template-columns:repeat(7,minmax(0,1fr))}
@media(max-width:1100px){.pending-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:700px){.pending-kpis{grid-template-columns:1fr}}
