:root{
  --bg:#f3f6fb;
  --card:#ffffff;
  --text:#1f2a44;
  --muted:#73829a;
  --line:#e4eaf4;
  --shadow:0 14px 40px rgba(22,44,85,.08);
  --blue:#2f61e6;
  --blue-dark:#183f8f;
  --teal:#147b7b;
  --orange:#f08b25;
  --orange-dark:#d86f0e;
  --green:#16a34a;
  --yellow:#d99224;
  --red:#d65b61;
  --nav:#0f1e36;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit;text-decoration:none}
a:hover{text-decoration:none}
strong{font-weight:800}
.muted{color:var(--muted)}
.eyebrow{font-size:11px;letter-spacing:1.3px;text-transform:uppercase;color:#6580a7;font-weight:800;margin-bottom:8px}
.eyebrow.light{color:#eaf2ff}
h1,h2,h3,p{margin:0}
.layout{display:flex;min-height:100vh}
.sidebar{width:260px;background:linear-gradient(180deg,#10233f 0%,#0d1b31 100%);color:#dfe8fa;padding:24px 18px;display:flex;flex-direction:column;position:fixed;top:0;bottom:0;left:0}
.sidebar-head{display:flex;align-items:center;gap:14px;padding:4px 8px 28px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:24px}
.brand-logo{width:52px;height:52px;border-radius:16px;background:linear-gradient(135deg,var(--blue),#7ca0ff);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:900;font-size:21px;box-shadow:0 10px 24px rgba(47,97,230,.3)}
.sidebar-head strong{display:block;line-height:1.1;font-size:18px;color:#fff}
.sidebar-head span{display:block;font-size:11px;letter-spacing:1px;color:#8ea7d6;text-transform:uppercase;margin-top:5px}
nav{display:flex;flex-direction:column;gap:8px}
.nav-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;color:#b9caea;font-weight:700;font-size:14px}
.nav-item.active,.nav-item:hover{background:rgba(255,255,255,.08);color:#fff}
.sidebar-bottom{margin-top:auto;border-top:1px solid rgba(255,255,255,.08);padding-top:18px;color:#aebfe2;font-size:12px}
.sidebar-bottom small{display:block;margin-top:6px;font-size:11px}
.logout{margin-top:14px;border:0;background:#20355b;color:#fff;width:100%;padding:12px 14px;border-radius:12px;font-weight:800;cursor:pointer}
.content{margin-left:260px;width:calc(100% - 260px);padding:28px}
.topline{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:24px}
.topline h1{font-size:34px;line-height:1.05;letter-spacing:-1px;margin-bottom:8px}
.user-pill{display:inline-flex;align-items:center;gap:8px;padding:11px 14px;border-radius:999px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);font-weight:700;color:#496284}
.online-dot{width:10px;height:10px;border-radius:50%;background:#1bc47d;display:inline-block}
.card{background:var(--card);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow)}
.section-icon{width:44px;height:44px;border-radius:14px;background:#edf3ff;color:var(--blue);display:flex;align-items:center;justify-content:center;font-size:22px;margin-bottom:14px}
.upload-card{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:24px 26px;margin-bottom:20px}
.upload-card h2{margin-bottom:8px}
.upload-form{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.file-upload{cursor:pointer;border:1px dashed #b6c7e7;background:#fbfdff;border-radius:15px;padding:14px 16px;min-width:280px;max-width:360px;display:flex;flex-direction:column;gap:5px;position:relative}
.file-upload-title{font-weight:800;color:#2b3f62;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-upload small{color:#7f90aa;font-size:11px}
.file-upload input{position:absolute;inset:0;opacity:0;cursor:pointer}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:12px 18px;border-radius:14px;border:1px solid transparent;font-size:13px;font-weight:800;cursor:pointer}
.btn.primary{background:linear-gradient(135deg,var(--blue),#5783ff);color:#fff}
.btn.dark{background:#203453;color:#fff}
.btn.light{background:#fff;border-color:#d9e3f0;color:#304766}
.btn.full{width:100%}
.filter-card{margin-bottom:20px;overflow:hidden}
.section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}
.section-heading.inside{padding:22px 24px;border-bottom:1px solid #eff3f7}
.section-heading.inside.no-border{border-bottom:0;padding-bottom:10px}
.buttons{display:flex;gap:10px;flex-wrap:wrap}
.filters{display:flex;gap:12px;flex-wrap:wrap;align-items:end;padding:0 24px 22px}
.filters label{display:flex;flex-direction:column;gap:6px;color:#5f708a;font-size:12px;font-weight:700;min-width:170px}
.filters label.grow{flex:1}
.filters input,.filters select{background:#fff;border:1px solid #d6e1ee;border-radius:12px;padding:11px 12px;min-height:44px;color:#223450;outline:none}
.filters input:focus,.filters select:focus{border-color:#6e8fe8;box-shadow:0 0 0 3px rgba(87,131,255,.12)}
.clear-filter{font-size:13px;color:#6d7f99;font-weight:700;padding:12px 0}
.period-note{padding:0 24px 22px;color:#61738e;font-size:13px}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.hero-cards{display:grid;grid-template-columns:1.25fr .95fr;gap:18px;margin-bottom:20px}.hero-card{border-radius:26px;padding:26px;color:#fff;box-shadow:var(--shadow)}.hero-card-bmg{background:linear-gradient(135deg,#d86f0e,#f3a33d)}.hero-card-byx{background:linear-gradient(135deg,#173f91,#2f73ee)}.hero-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}.hero-card-head h2{font-size:30px;letter-spacing:-.8px;margin-bottom:7px}.hero-card-head p{color:rgba(255,255,255,.88);font-size:14px;max-width:420px}.hero-total{font-size:54px;font-weight:900;line-height:1;letter-spacing:-2px}.hero-lines{display:flex;flex-direction:column;gap:12px}.hero-lines.compact{max-width:520px}.hero-line{display:flex;justify-content:space-between;align-items:center;gap:18px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.14);border-radius:18px;padding:15px 18px;color:#fff}.hero-line span{font-size:14px;font-weight:800;line-height:1.45;max-width:80%;text-transform:none}.hero-line strong{font-size:26px;line-height:1;white-space:nowrap}.hero-meta{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}.hero-meta span{display:inline-flex;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.14);font-size:12px;font-weight:800;color:#fff}
.stat-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:22px;box-shadow:var(--shadow)}
.stat-card span{display:block;color:#71829b;font-size:12px;font-weight:700}
.stat-card strong{display:block;margin:12px 0 6px;font-size:36px;letter-spacing:-1.5px}
.stat-card small{color:#8b98aa;font-size:11px}
.stat-card.success strong{color:var(--green)}
.stat-card.warning strong{color:var(--yellow)}
.stat-card.danger strong{color:var(--red)}
.summary-section{border-radius:24px;padding:24px;margin-bottom:20px;color:#fff;box-shadow:var(--shadow)}
.summary-orange{background:linear-gradient(135deg,var(--orange-dark),#f3a640)}
.summary-blue{background:linear-gradient(135deg,var(--blue-dark),#2c6df0)}
.summary-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}
.summary-header h2{font-size:28px;margin-bottom:6px}
.summary-header p{color:rgba(255,255,255,.88)}
.summary-card-grid{display:grid;gap:16px}
.summary-card-grid.four{grid-template-columns:repeat(4,1fr)}
.summary-card-grid.two{grid-template-columns:repeat(2,1fr)}
.result-card{display:flex;flex-direction:column;gap:14px;border-radius:20px;padding:20px;min-height:190px;position:relative;overflow:hidden;color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.result-orange{background:rgba(255,255,255,.14)}
.result-blue{background:rgba(255,255,255,.12)}
.result-card-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.result-badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.17);font-size:10px;letter-spacing:1px;font-weight:800}
.result-code{font-size:11px;font-weight:800;letter-spacing:.7px;text-transform:uppercase;color:#f3f7ff}
.result-card h3{font-size:15px;line-height:1.45;min-height:42px;text-transform:uppercase}
.result-value{font-size:48px;font-weight:900;letter-spacing:-2px;line-height:1}
.result-meta{display:flex;flex-wrap:wrap;gap:8px}
.result-meta span{font-size:11px;font-weight:700;padding:7px 9px;border-radius:999px;background:rgba(255,255,255,.13);border:1px solid rgba(255,255,255,.15)}
.result-footer{margin-top:auto;display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;color:#eff5ff}
.result-footer strong{font-size:12px}
.table-card{margin-bottom:20px;overflow:hidden}
.table-scroll{overflow:auto}
table{border-collapse:collapse;width:100%;font-size:12px}
th{padding:15px 18px;background:#f7f9fc;border-top:1px solid var(--line);border-bottom:1px solid var(--line);font-size:10px;letter-spacing:1px;color:#6b7c95;text-transform:uppercase;text-align:left;white-space:nowrap}
td{padding:14px 18px;border-bottom:1px solid #eef2f7;vertical-align:top}
tbody tr:hover{background:#fafcff}
.right{text-align:right}
.count-cell{font-weight:900;font-size:14px}
.subline{display:block;margin-top:6px;color:#8694a8}
.history-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;font-size:12px;font-weight:800}
.history-actions form{margin:0}
.history-actions button{background:none;border:0;color:#d24c57;padding:0;font-weight:800;cursor:pointer}
.category-pill,.group-pill{display:inline-flex;align-items:center;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:800;letter-spacing:.4px}
.category-pill{background:#edf3ff;color:#375eaa}
.category-pill.cnc{background:#e9f8f1;color:#218061}
.category-pill.seguros{background:#fff1e7;color:#ae6d1e}
.category-pill.bmg_consignado{background:#edf4ff;color:#255fa0}
.category-pill.byx_happy,.category-pill.byx_amigoz{background:#eceaff;color:#5948c0}
.category-pill.nao_classificado{background:#fff1ee;color:#be5c50}
.group-pill{background:#e9faf2;color:#14855f}
.group-pill.pendencias{background:#fff4dd;color:#aa7720}
.group-pill.canceladas{background:#ffeceb;color:#c45d5e}
.empty{padding:38px 16px;text-align:center;color:#8895a7}
.empty-state{padding:60px 24px;text-align:center}
.empty-state-icon{font-size:48px;color:#ced8ea;margin-bottom:8px}
.alert{border-radius:14px;padding:14px 16px;margin-bottom:18px;font-weight:700;font-size:13px}
.alert.error{background:#fff1f2;border:1px solid #f0c6cc;color:#a63646}
.alert.success{background:#eefaf1;border:1px solid #b9e4ca;color:#146348}
footer{padding:6px 2px 12px;color:#8f9cb0;font-size:12px}
.auth-body{min-height:100vh;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 20% 5%,#d8e9ff,transparent 30%),linear-gradient(160deg,#eff4ff,#e9eef7);padding:20px}
.auth-panel{width:100%;max-width:440px;background:#fff;border:1px solid var(--line);border-radius:24px;padding:34px;box-shadow:0 30px 70px rgba(16,39,77,.12)}
.install-panel{max-width:700px}
.auth-panel .brand-logo{margin-bottom:22px}
.auth-panel h1{font-size:30px;letter-spacing:-1px;margin-bottom:10px}
.auth-panel p.muted{margin-bottom:24px}
.auth-panel label{display:block;font-size:12px;font-weight:800;color:#314562;margin-bottom:16px}
.auth-panel input{width:100%;margin-top:7px;padding:12px 13px;border-radius:12px;border:1px solid #d7e0eb;outline:none}
.auth-panel input:focus{border-color:#6d8de5;box-shadow:0 0 0 3px rgba(109,141,229,.12)}
.mini{margin-top:20px;text-align:center;color:#95a3b6;font-size:11px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}
.form-label-heading{font-size:11px;letter-spacing:1px;text-transform:uppercase;color:#7f91a9;font-weight:800;margin:18px 0}
@media (max-width:1280px){
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .hero-cards{grid-template-columns:1fr}
}
@media (max-width:980px){
  .sidebar{width:84px;padding:20px 10px}
  .sidebar-head{padding:0 2px 22px}
  .sidebar-head>div:nth-child(2),.nav-item span,.sidebar-bottom div,.sidebar-bottom small{display:none}
  .nav-item{justify-content:center;font-size:20px}
  .content{margin-left:84px;width:calc(100% - 84px);padding:22px 18px}
  .upload-card{flex-direction:column;align-items:stretch}
  .hero-cards{grid-template-columns:1fr}
}
@media (max-width:720px){
  .content{padding:18px 12px}
  .topline{flex-direction:column}
  .topline h1{font-size:28px}
  .user-pill{display:none}
  .stats-grid{grid-template-columns:1fr}
  .filters label{min-width:100%;flex:1 1 100%}
  .hero-card{padding:20px}
  .hero-card-head{flex-direction:column}
  .hero-card-head h2{font-size:24px}
  .hero-total{font-size:40px}
  .hero-line{padding:14px 15px}
  .hero-line span{max-width:none;font-size:13px}
  .hero-line strong{font-size:22px}
  .section-heading.inside,.filters,.period-note,.upload-card{padding-left:16px;padding-right:16px}
  .table-scroll table{min-width:760px}
  .form-grid{grid-template-columns:1fr}
  .auth-panel{padding:26px}
}
