/* Finco Produção: identidade visual Finco (preto, cinza claro, azul elétrico, Host Grotesk) */
:root {
  --black: #0B0B0C;
  --ink: #16161A;
  --gray-50: #F6F6F7;
  --gray-100: #EFEFEF;
  --gray-200: #E3E3E6;
  --gray-300: #CFCFD4;
  --gray-500: #6B6B76;
  --gray-700: #3A3A42;
  --blue: #0A2BFF;
  --blue-600: #0020D9;
  --blue-50: #ECEFFF;
  --green: #12A150;
  --green-50: #E7F7EE;
  --amber: #C27A00;
  --amber-50: #FFF4DE;
  --red: #E0243A;
  --red-50: #FDE9EC;
  --violet: #6B3BFF;
  --violet-50: #F0EBFF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 11, 12, .04), 0 4px 16px rgba(11, 11, 12, .04);
  --sidebar: 260px;
  --font: 'Host Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--gray-50);
  text-rendering: optimizeLegibility;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-600); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }
small, .muted { color: var(--gray-500); }
.ico { flex-shrink: 0; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 6px; }
.logo-txt { font-size: 24px; font-weight: 400; letter-spacing: -.03em; color: var(--black); line-height: 1; }
.logo-txt i { font-style: normal; color: var(--black); }
.logo.light .logo-txt, .logo.light .logo-txt i { color: #fff; }

/* Estrutura */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--black); color: #fff;
  display: flex; flex-direction: column; z-index: 40;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 20px 18px; }
.brand { display: flex; flex-direction: column; gap: 4px; color: #fff; }
.brand-sub { font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.65); padding-left: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-group { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); padding: 18px 12px 8px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,.82); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: var(--blue); color: #fff; }
.nav-link span { flex: 1; }
.nav-count { font-style: normal; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.14); color: #fff; padding: 1px 8px; border-radius: 99px; }
.nav-count.danger { background: var(--red); }
.nav-link.active .nav-count { background: rgba(255,255,255,.25); }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; font-weight: 600; }
.user-info { flex: 1; display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-info strong { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { color: rgba(255,255,255,.65); font-size: 12px; }
.sidebar .icon-btn { color: rgba(255,255,255,.8); }
.sidebar .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 32px; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.topbar-title { flex: 1; }
.topbar-title h1 { font-size: 22px; }
.topbar-title p { color: var(--gray-500); font-size: 14px; margin-top: 2px; }
.topbar-date { display: flex; align-items: center; gap: 6px; color: var(--gray-500); font-size: 13px; background: #fff; border: 1px solid var(--gray-200); padding: 7px 12px; border-radius: 99px; }
.content { padding: 24px 32px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head:not(:empty) { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--gray-500); font-size: 14px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.only-mobile { display: none !important; }
.backdrop { display: none; }
.bottom-nav { display: none; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:active { filter: brightness(.94); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); color: #fff; }
.btn-dark { background: var(--black); color: #fff; }
.btn-dark:hover { background: #26262b; color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--gray-200); }
.btn-light:hover { border-color: var(--gray-300); color: var(--ink); }
.btn-danger { background: var(--red-50); color: var(--red); }
.btn-danger:hover { background: #fbd5db; color: var(--red); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--gray-100); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
.link-btn.danger { color: var(--red); }

/* Cartões */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--gray-100); flex-wrap: wrap; }
.card-head h2 { font-size: 16px; }
.card-head p { font-size: 13px; color: var(--gray-500); }
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.card.dark { background: var(--black); color: #fff; border-color: var(--black); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }
.stack > * + * { margin-top: 20px; }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.kpi-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); flex-shrink: 0; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--gray-500); }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; }
.kpi-extra { font-size: 12.5px; color: var(--gray-500); margin-top: 2px; }
.kpi.danger .kpi-ico { background: var(--red-50); color: var(--red); }
.kpi.warn .kpi-ico { background: var(--amber-50); color: var(--amber); }
.kpi.ok .kpi-ico { background: var(--green-50); color: var(--green); }
.kpi.dark { background: var(--black); border-color: var(--black); color: #fff; }
.kpi.dark .kpi-ico { background: var(--blue); color: #fff; }
.kpi.dark .kpi-label, .kpi.dark .kpi-extra { color: rgba(255,255,255,.72); }

/* Fluxo de produção */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.flow-step { position: relative; padding: 18px 16px; border-right: 1px solid var(--gray-100); color: inherit; display: block; }
.flow-step:last-child { border-right: 0; }
.flow-step:hover { background: var(--gray-50); color: inherit; }
.flow-step .n { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.flow-step .l { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--gray-500); margin-bottom: 8px; }
.flow-step .l .ico { color: var(--blue); }
.flow-step .s { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.flow-step .s b { color: var(--red); font-weight: 600; }

/* Barras */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: 12px; font-size: 14px; }
.bar-track { height: 10px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.bar-row strong { text-align: right; font-weight: 600; }
.progress { height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.progress.ok span { background: var(--green); }

/* Gráfico de colunas */
.cols { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 180px; }
.col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.col-bar { flex: 1; width: 100%; max-width: 28px; display: flex; align-items: flex-end; background: var(--gray-50); border-radius: 6px; overflow: hidden; }
.col-bar span { display: block; width: 100%; background: var(--blue); border-radius: 6px 6px 0 0; min-height: 2px; }
.col:last-child .col-bar span { background: var(--black); }
.col-v { font-size: 12px; font-weight: 600; color: var(--gray-700); min-height: 14px; }
.col-l { font-size: 12px; font-weight: 500; color: var(--gray-500); }

/* Selos */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: var(--gray-100); color: var(--gray-700); white-space: nowrap; }
.badge.ok { background: var(--green-50); color: var(--green); }
.badge.warn { background: var(--amber-50); color: var(--amber); }
.badge.danger { background: var(--red-50); color: var(--red); }
.badge.info, .badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.violet { background: var(--violet-50); color: var(--violet); }
.badge.muted { background: var(--gray-100); color: var(--gray-500); }
.badge.dark { background: var(--black); color: #fff; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--gray-500); text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--gray-200); background: var(--gray-50); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFAFB; }
.table .num, .table th.num { text-align: right; white-space: nowrap; }
.table .strong { font-weight: 600; }
.table td.actions { text-align: right; white-space: nowrap; }
.table a.row-link { color: var(--ink); font-weight: 600; white-space: nowrap; }
.table a.row-link:hover { color: var(--blue); }
.table tfoot td { font-weight: 600; background: var(--gray-50); }
.cell-sub { display: block; font-size: 12.5px; font-weight: 500; color: var(--gray-500); }

/* Formulários */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-2 { grid-column: span 2; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: #fff; border: 1px solid var(--gray-200); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2385858F' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.input { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,43,255,.12); }
.input[readonly] { background: var(--gray-50); color: var(--gray-700); }
.input-sm { height: 38px; font-size: 14px; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.dyn-row { display: grid; gap: 10px; align-items: end; margin-bottom: 10px; }
.dyn-row.r3 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) 38px; }
.dyn-row.r4 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 2fr) 38px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 160px; height: 40px; font-size: 14px; }
.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-500); }
.search .input { padding-left: 38px; }

.tabs { display: flex; gap: 4px; background: var(--gray-100); padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px; }
.tabs a { padding: 8px 16px; border-radius: 9px; color: var(--gray-700); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tabs a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Alertas */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; background: var(--blue-50); color: var(--blue-600); transition: opacity .4s; }
.alert.success { background: var(--green-50); color: var(--green); }
.alert.error { background: var(--red-50); color: var(--red); }
.alert.warn { background: var(--amber-50); color: var(--amber); }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--gray-100); }
.list li:last-child { border-bottom: 0; }
.list .t { font-weight: 500; }
.list .s { font-size: 12px; color: var(--gray-500); }
.list a.li-link { color: inherit; display: block; flex: 1; min-width: 0; }

.empty { text-align: center; padding: 40px 20px; color: var(--gray-500); }
.empty .ico { color: var(--gray-300); margin-bottom: 8px; }

/* Linha do tempo de etapas */
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tl-step { border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px; background: #fff; position: relative; }
.tl-step .tl-top { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-300); }
.tl-step.feito .tl-dot { background: var(--green); }
.tl-step.atual { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,43,255,.08); }
.tl-step.atual .tl-dot { background: var(--blue); }
.tl-step dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.tl-step dt { color: var(--gray-500); }
.tl-step dd { margin: 0; text-align: right; }
.tl-step .badge { margin-top: 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border: 1px solid var(--gray-100); border-radius: 12px; overflow: hidden; }
.stat { background: #fff; padding: 14px 16px; box-shadow: 1px 1px 0 var(--gray-100); }
.stat span { display: block; font-size: 12px; font-weight: 500; color: var(--gray-500); }
.stat strong { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.stat strong.red { color: var(--red); } .stat strong.green { color: var(--green); } .stat strong.blue { color: var(--blue); }

.info-list { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; margin: 0; }
.info-list dt { color: var(--gray-500); }
.info-list dd { margin: 0; text-align: right; font-weight: 500; }

.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; border: 2px dashed var(--gray-300); border-radius: var(--radius); padding: 36px 20px; cursor: pointer; background: var(--gray-50); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-50); }
.dropzone .ico { color: var(--blue); }
.dropzone strong { font-size: 16px; }
.dropzone input { display: none; }
.dropzone .file-name { font-size: 13px; color: var(--blue); font-weight: 500; }

.total-box { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--gray-50); border-radius: 10px; font-size: 14px; margin-top: 12px; }
.total-box strong { font-size: 20px; }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--black); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 480px; height: 480px; border-radius: 50%; background: radial-gradient(circle, rgba(10,43,255,.9), rgba(10,43,255,0) 70%); filter: blur(10px); }
.auth-art h2 { font-size: 44px; font-weight: 400; line-height: 1.1; max-width: 460px; position: relative; z-index: 1; }
.auth-art h2 b { font-weight: 700; }
.auth-art small { color: rgba(255,255,255,.5); position: relative; z-index: 1; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: #fff; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 26px; margin: 28px 0 6px; }
.auth-box > p { color: var(--gray-500); margin-bottom: 24px; }
.auth-box .field { margin-bottom: 16px; }

.error-page { max-width: 480px; margin: 15vh auto; text-align: center; padding: 24px; font-family: var(--font); }
.error-page h1 { font-size: 28px; margin-bottom: 8px; }
.error-page p { color: var(--gray-500); margin-bottom: 24px; }

.text-right { text-align: right; }
.text-red { color: var(--red); } .text-green { color: var(--green); } .text-blue { color: var(--blue); }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--gray-100); margin: 20px 0; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-500); margin: 24px 0 12px; }

/* Tablet */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow-step:nth-child(3) { border-right: 0; }
  .flow-step:nth-child(-n+3) { border-bottom: 1px solid var(--gray-100); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}

/* Celular */
@media (max-width: 900px) {
  body { font-size: 15px; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .only-mobile { display: initial !important; }
  .hide-mobile { display: none !important; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; width: min(86vw, 320px); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 30; }
  .main { margin-left: 0; }
  .topbar { padding: 12px 16px; justify-content: space-between; }
  .topbar-logo { display: inline-flex !important; }
  .topbar .icon-btn.only-mobile { display: inline-grid !important; }
  .content { padding: 16px 16px 32px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .only-mobile { display: block !important; }
  .page-actions { margin-left: 0; }
  .page-actions .btn { flex: 1; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid { gap: 16px; }
  .kpis { gap: 12px; }
  .kpi { padding: 14px; flex-direction: column; gap: 10px; }
  .kpi-value { font-size: 22px; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step { border-bottom: 1px solid var(--gray-100); }
  .flow-step:nth-child(3) { border-right: 1px solid var(--gray-100); }
  .flow-step:nth-child(2n) { border-right: 0; }
  .flow-step:nth-last-child(-n+2) { border-bottom: 0; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .col-12, .col-8, .col-6, .col-4 { grid-column: span 2; }
  .col-3, .col-2 { grid-column: span 1; }
  .card-head { padding: 16px; }
  .card-body { padding: 16px; }
  .filters { width: 100%; }
  .filters .input, .filters .search { flex: 1 1 100%; min-width: 0; }
  .filters .search .input { width: 100%; }
  .form-actions .btn { flex: 1; }
  .bar-row { grid-template-columns: 90px 1fr 44px; }
  .cols { gap: 3px; height: 150px; }
  .col-v { display: none; }
  .dyn-row.r4 { grid-template-columns: 1fr 1fr 38px; }
  .dyn-row.r4 > :nth-child(1) { grid-column: span 3; }
  .dyn-row.r4 > :nth-child(3) { grid-column: span 1; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }

  /* Tabelas viram cartões */
  table.table.responsive thead { display: none; }
  table.table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); }
  .table.responsive tbody tr:hover { background: transparent; }
  .table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-size: 12px; color: var(--gray-500); text-align: left; flex-shrink: 0; }
  .table.responsive td.main-cell { display: block; text-align: left; padding-bottom: 8px; font-size: 15px; }
  .table.responsive td.main-cell::before { display: none; }
  .table.responsive td.actions { justify-content: flex-end; padding-top: 10px; }
  .table.responsive td.actions::before { display: none; }
  .table.responsive td:empty { display: none; }
  .table.responsive td:not(.main-cell) .cell-sub { display: none; }
  .table.responsive tfoot { display: block; }
  .table.responsive tfoot tr { display: flex; justify-content: space-between; flex-wrap: wrap; }
  .table.responsive tfoot td { width: auto; display: block; padding: 4px 0; background: transparent; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: #fff; border-top: 1px solid var(--gray-200);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 12px; font-weight: 500; color: var(--gray-500); border-radius: 10px; }
  .bottom-nav a.active { color: var(--blue); }
  .bottom-nav a.active .ico { stroke-width: 2.2; }
}

@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .kpi-value { font-size: 20px; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions, .form-actions, .btn { display: none !important; }
  .main { margin: 0; }
  .card { box-shadow: none; }
}

/* Componentes das variações, OP com itens e envio múltiplo */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.section-head .section-title { margin: 0; }
.add-row { display: flex; gap: 10px; }
.add-row .input { flex: 1; }
.row-sel td { background: var(--blue-50); }
.check-input { width: 18px; height: 18px; accent-color: var(--blue); }
.dyn-row.r5 { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) 38px; }
.timeline.t3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.grade { border: 1px solid var(--gray-200); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.grade-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.grade-head strong { font-size: 15px; }
.grade-tools { display: flex; align-items: center; gap: 8px; }
.grade-tools .input { width: 90px; height: 34px; font-size: 14px; }
.grade-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 14px; }
.grade-cell { border: 1px solid var(--gray-100); border-radius: 10px; padding: 10px; }
.grade-cell label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.grade-cell small { display: block; font-size: 12px; margin-bottom: 6px; }
.grade-cell .input { height: 38px; }
.grade-sub { padding: 0 14px 12px; font-size: 13px; color: var(--gray-500); font-weight: 500; }

.dist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.dist-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--gray-50); border-radius: 10px; font-size: 13px; }
.dist-item strong { white-space: nowrap; font-weight: 600; }
.dist-item.over { background: var(--red-50); color: var(--red); }
.dist-item.ok strong { color: var(--green); }
.bloco { border: 1px solid var(--gray-200); border-left: 4px solid var(--blue); border-radius: 12px; padding: 16px; margin-bottom: 14px; background: #fff; }
.bloco-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bloco details summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--blue); }
.bloco [data-bloco-mats] .dyn-row:first-child [data-mat-remove] { visibility: hidden; }

.dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
.dialog::backdrop { background: rgba(11,11,12,.45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--gray-100); }
.dialog-head h2 { font-size: 17px; }
.dialog-body { padding: 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

@media (max-width: 900px) {
  .timeline.t3 { grid-template-columns: 1fr; }
  .dyn-row.r5 { grid-template-columns: 1fr 1fr 38px; }
  .dyn-row.r5 > :nth-child(1), .dyn-row.r5 > :nth-child(2) { grid-column: span 3; }
  .add-row { flex-direction: column; }
  .grade-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bloco { padding: 12px; }
  .dialog-foot .btn { flex: 1; }
}

/* Corte simplificado */
.btn-lg { height: 52px; font-size: 16px; border-radius: 12px; margin-top: 20px; }
.fila { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.fila-card { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--ink); transition: border-color .15s; }
.fila-card:hover { border-color: var(--blue); color: var(--ink); }
.fila-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fila-top strong { font-size: 17px; }
.fila-prod { color: var(--gray-700); font-size: 14px; }
.fila-num { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.fila-num small { font-size: 13px; font-weight: 500; color: var(--gray-500); letter-spacing: 0; }
.fila-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--gray-500); margin-bottom: 4px; }
.corte-lista { list-style: none; margin: 0; padding: 0; }
.corte-lista li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--gray-100); }
.corte-item { display: flex; flex-direction: column; min-width: 0; }
.corte-item strong { font-size: 15px; font-weight: 600; }
.corte-item small { font-size: 13px; font-weight: 500; }
.corte-qtd { width: 110px; height: 48px; font-size: 20px; font-weight: 600; text-align: center; flex-shrink: 0; }
.corte-total { display: flex; align-items: center; justify-content: space-between; font-size: 15px; font-weight: 500; }
.corte-total strong { font-size: 22px; }
.corte-aviso { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--amber-50); color: var(--amber); font-size: 14px; font-weight: 500; }
.material-box { margin-top: 18px; border: 1px solid var(--gray-200); border-radius: 12px; padding: 14px 16px; background: var(--gray-50); }
.material-box-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin-bottom: 8px; }
.material-box ul { list-style: none; margin: 0; padding: 0; }
.material-box li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.material-box li + li { border-top: 1px dashed var(--gray-200); }
.material-box-alerta { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--amber); }
.mais-detalhes { margin-top: 18px; }
.mais-detalhes summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--blue); }
@media (max-width: 900px) {
  .corte-lista li { padding: 14px 16px; }
  .corte-qtd { width: 96px; }
}

/* Costura simplificada */
.fila-card.atrasado { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-50); }
.input-lg { height: 50px; font-size: 16px; font-weight: 500; }
.bloco { padding: 0; overflow: hidden; }
.bloco-head { gap: 10px; padding: 14px 16px; margin: 0; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
.bloco-head select { flex: 1; }
.bloco .corte-lista li { padding: 12px 16px; }
.bloco-resumo { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 16px; font-size: 14px; color: var(--gray-700); background: var(--blue-50); }
.bloco-resumo b { color: var(--ink); }
.bloco .material-box-alerta { padding: 0 16px; }
.bloco .mais-detalhes { margin: 12px 16px 16px; }
.bloco [data-bloco-mats] .dyn-row { margin-bottom: 8px; }
.sem-destino { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--amber-50); color: var(--amber); }
.sem-destino.zero { background: var(--green-50); color: var(--green); }
.preco-input { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--gray-500); }
.preco-input .input { width: 100px; text-align: right; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }

/* Painel simplificado */
.pn-bloco { margin-bottom: 26px; }
.pn-titulo { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); margin-bottom: 10px; }
.pn-titulo span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--black); color: #fff; font-size: 12px; letter-spacing: 0; }
.pn-lista { list-style: none; margin: 0; padding: 0; }
.pn-lista li { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--gray-100); }
.pn-lista li:last-child { border-bottom: 0; }
.pn-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--gray-100); color: var(--gray-700); }
.pn-ico.danger { background: var(--red-50); color: var(--red); }
.pn-ico.warn { background: var(--amber-50); color: var(--amber); }
.pn-ico.info { background: var(--blue-50); color: var(--blue); }
.pn-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pn-txt strong { font-size: 15px; font-weight: 600; }
.pn-txt strong a { color: var(--ink); }
.pn-txt small { font-size: 13px; font-weight: 500; color: var(--gray-500); }
.pn-sug { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.pn-sug strong { font-size: 22px; font-weight: 600; color: var(--blue); }
.pn-sug small { font-size: 12px; font-weight: 500; color: var(--gray-500); }
.pn-data { font-size: 13px; font-weight: 500; color: var(--gray-700); white-space: nowrap; }
.pn-mais { padding: 10px 18px; font-size: 13px; color: var(--gray-500); border-top: 1px solid var(--gray-100); }
.pn-ok { display: flex; align-items: center; gap: 14px; padding: 18px; color: var(--green); }
.pn-ok strong { color: var(--ink); font-size: 16px; }
.pn-ok p { color: var(--gray-500); font-size: 14px; }
.pn-vazio { display: flex; align-items: center; gap: 14px; padding: 18px; color: var(--gray-500); font-size: 14px; }
.pn-vazio .ico { color: var(--gray-300); }
.pn-fluxo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pn-fluxo a { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); box-shadow: var(--shadow); position: relative; transition: border-color .15s; }
.pn-fluxo a:hover { border-color: var(--blue); color: var(--ink); }
.pn-fluxo a:not(:last-child)::after { content: ''; position: absolute; right: -10px; top: 50%; width: 8px; height: 8px; border-top: 2px solid var(--gray-300); border-right: 2px solid var(--gray-300); transform: translateY(-50%) rotate(45deg); }
.pn-fluxo small { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--gray-500); }
.pn-fluxo small .ico { color: var(--blue); }
.pn-fluxo strong { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.pn-fluxo em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--gray-500); }
.pn-fluxo em.text-red { color: var(--red); }
.pn-rodape-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--gray-100); background: var(--gray-50); font-size: 13px; font-weight: 500; color: var(--gray-700); border-radius: 0 0 var(--radius) var(--radius); }
.pn-resumo { font-size: 13px; font-weight: 500; color: var(--gray-500); padding-top: 4px; }
@media (max-width: 900px) {
  .pn-fluxo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pn-fluxo a::after { display: none; }
  .pn-fluxo strong { font-size: 26px; }
  .pn-lista li { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .pn-lista li .pn-txt { flex: 1 1 calc(100% - 60px); }
  .pn-lista li .btn { margin-left: 48px; }
  .pn-rodape-card .btn { width: 100%; }
}

/* Visão geral (painel da administração) */
.vg-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.vg-kpi { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vg-kpi:first-child { background: var(--black); border-color: var(--black); color: #fff; }
.vg-kpi:first-child span, .vg-kpi:first-child em, .vg-kpi:first-child small { color: rgba(255,255,255,.72); }
.vg-kpi span { font-size: 13px; font-weight: 500; color: var(--gray-500); }
.vg-kpi strong { font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; white-space: nowrap; }
.vg-kpi strong small { font-size: 14px; font-weight: 500; color: var(--gray-500); letter-spacing: 0; }
.vg-kpi em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--gray-500); }
.vg-kpi em b { font-weight: 600; color: inherit; }
.vg-kpi:first-child em b.text-green { color: #5BE38E; }
.vg-kpi:first-child em b.text-red { color: #FF8A98; }
.vg-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.vg-etapas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--gray-100); }
.vg-etapas a { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; color: var(--ink); border-right: 1px solid var(--gray-100); border-top: 3px solid transparent; }
.vg-etapas a:last-child { border-right: 0; }
.vg-etapas a:hover { background: var(--gray-50); color: var(--ink); }
.vg-etapas a.c1 { border-top-color: var(--gray-300); }
.vg-etapas a.c2 { border-top-color: #9DB0FF; }
.vg-etapas a.c3 { border-top-color: var(--blue); }
.vg-etapas a.c4 { border-top-color: var(--amber); }
.vg-etapas small { font-size: 12.5px; font-weight: 500; color: var(--gray-500); }
.vg-etapas strong { font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; }
.vg-etapas em { font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--gray-500); }
.vg-etapas em.text-red { color: var(--red); }

.vg-ops { list-style: none; margin: 0; padding: 6px 0; }
.vg-ops li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) auto; align-items: center; gap: 16px; padding: 10px 18px; }
.vg-op-nome { display: flex; flex-direction: column; min-width: 0; color: var(--ink); }
.vg-op-nome:hover { color: var(--blue); }
.vg-op-nome strong { font-size: 14px; font-weight: 600; }
.vg-op-nome small { font-size: 12.5px; font-weight: 500; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vg-barra { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--gray-100); }
.vg-barra span, .vg-legenda i { display: block; height: 100%; }
.s-pronto { background: var(--green); } .s-revisao { background: var(--amber); } .s-costura { background: var(--blue); } .s-cortado { background: #9DB0FF; } .s-corte { background: var(--gray-300); }
.b-venda { background: var(--black); } .b-prod { background: var(--blue); }
.vg-op-fim { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.vg-op-fim small { font-size: 12px; font-weight: 500; color: var(--gray-500); white-space: nowrap; }
.vg-legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 18px 14px; font-size: 12.5px; font-weight: 500; color: var(--gray-500); }
.vg-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.vg-legenda i { width: 10px; height: 10px; border-radius: 3px; }

.vg-chart { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; height: 230px; align-items: end; }
.vg-sem { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.vg-cols { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 5px; border-bottom: 1px solid var(--gray-200); }
.vg-cols span { width: 38%; max-width: 26px; border-radius: 6px 6px 0 0; position: relative; min-height: 2px; }
.vg-cols i { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--gray-700); }
.vg-sem small { font-size: 12px; font-weight: 500; color: var(--gray-500); }
.card-body .vg-legenda { padding: 14px 0 0; }

.vg-lista { list-style: none; margin: 0; padding: 0; }
.vg-lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--gray-100); }
.vg-lista li > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.vg-lista strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.vg-lista small { font-size: 12.5px; font-weight: 500; color: var(--gray-500); }
.vg-dir { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.vg-dir > b { font-size: 20px; font-weight: 600; color: var(--blue); min-width: 44px; text-align: right; }
.vg-dir > b small { font-size: 12px; color: var(--gray-500); }
.vg-dias { font-size: 12.5px; font-weight: 500; }
.vg-rodape { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; background: var(--gray-50); font-size: 13px; font-weight: 500; color: var(--gray-500); border-radius: 0 0 var(--radius) var(--radius); }

.vg-costs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1px; background: var(--gray-100); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.vg-cost { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; background: #fff; color: var(--ink); }
.vg-cost:hover { background: var(--gray-50); color: var(--ink); }
.vg-cost.atrasada { box-shadow: inset 3px 0 0 var(--red); }
.vg-cost strong { font-size: 14px; font-weight: 600; }
.vg-cost-n { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.vg-cost-n small { font-size: 12.5px; color: var(--gray-500); font-weight: 500; }
.vg-cost > small { font-size: 12.5px; font-weight: 500; color: var(--gray-500); }

@media (max-width: 1200px) {
  .vg-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vg-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .vg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .vg-kpi:first-child { grid-column: span 2; }
  .vg-kpi strong { font-size: 20px; white-space: normal; overflow-wrap: anywhere; }
  .vg-etapas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vg-etapas a:nth-child(2) { border-right: 0; }
  .vg-etapas a:nth-child(-n+2) { border-bottom: 1px solid var(--gray-100); }
  .vg-ops li { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 16px; }
  .vg-barra { grid-column: span 2; grid-row: 2; }
  .vg-chart { height: 190px; gap: 6px; }
  .vg-lista li { padding: 12px 16px; flex-wrap: wrap; }
  .vg-rodape .btn { width: 100%; }
}

/* Receber e conferir */
.rec-cab { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px; gap: 12px; padding: 10px 20px; background: var(--gray-50); border-bottom: 1px solid var(--gray-100); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); }
.rec-cab span:not(:first-child) { text-align: center; }
.rec-lista li { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px; gap: 10px 12px; align-items: center; }
.rec-lista li .corte-qtd { width: 100%; }
.rec-lista li.tem-defeito { background: var(--red-50); }
.rec-def { color: var(--red); }
.rec-motivo { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rec-resumo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rec-resumo div { background: var(--gray-50); border-radius: 10px; padding: 10px 14px; }
.rec-resumo span { display: block; font-size: 12.5px; font-weight: 500; color: var(--gray-500); }
.rec-resumo strong { font-size: 22px; font-weight: 600; }
.rec-resumo .ok strong { color: var(--green); }
.rec-resumo .def strong { color: var(--red); }
@media (max-width: 900px) {
  .rec-cab, .rec-lista li { grid-template-columns: minmax(0, 1fr) 76px 76px; gap: 8px; padding-left: 16px; padding-right: 16px; }
  .rec-motivo { grid-template-columns: 1fr; }
  .rec-resumo strong { font-size: 18px; }
}
.vg-etapas a.c-ok { border-top-color: var(--green); }
.recibo-lista li { padding: 12px 0; }
.dialog-head h2 { display: flex; align-items: center; gap: 8px; }
.dialog-head h2 .ico { color: var(--green); }

/* Permissões por tela */
.perm-grade { border: 1px solid var(--gray-100); border-radius: var(--radius-sm); overflow: hidden; }
.perm-grade[hidden] { display: none; }
.perm-topo, .perm-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.perm-topo { background: var(--gray-50, #F6F6F7); font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.perm-linha { border-top: 1px solid var(--gray-100); }
.perm-nome { font-weight: 500; }
.perm-acoes { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--gray-100); }
.seg { display: inline-flex; background: var(--gray-100); border-radius: 999px; padding: 3px; gap: 2px; flex-shrink: 0; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--gray-500); white-space: nowrap; }
.seg input:checked + span { background: #fff; color: var(--black, #0B0B0C); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg input[value="2"]:checked + span { background: var(--blue); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.list li.sel { background: var(--blue-50); }
.mini-det { display: inline-block; }
.mini-det summary { list-style: none; }
.mini-det summary::-webkit-details-marker { display: none; }
@media (max-width: 640px) {
  .perm-linha { flex-direction: column; align-items: stretch; gap: 8px; }
  .seg { display: flex; }
  .seg label { flex: 1; text-align: center; }
  .seg span { padding: 7px 6px; font-size: 12.5px; }
}

/* WhatsApp */
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
.wa-chat { background: #EFE7DD; padding: 18px 16px 22px; border-radius: 0 0 var(--radius) var(--radius); }
.wa-balao { position: relative; background: #fff; border-radius: 0 10px 10px 10px; padding: 10px 12px 18px; max-width: 420px; font-size: 13.5px; line-height: 1.45; color: #111B21; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-balao::before { content: ""; position: absolute; left: -8px; top: 0; border-top: 10px solid #fff; border-left: 8px solid transparent; }
.wa-balao b { font-weight: 700; }
.wa-hora { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: #667781; }

/* Visão geral: cards clicáveis e detalhe */
button.vg-kpi { font: inherit; text-align: left; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; color: inherit; }
button.vg-kpi:hover { border-color: var(--blue); box-shadow: 0 6px 18px rgba(10,43,255,.12); transform: translateY(-1px); }
button.vg-kpi:first-child:hover { border-color: var(--blue); }
button.vg-kpi:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.vg-dlg { width: min(680px, calc(100vw - 24px)); }
.vg-dlg .dialog-head p { font-size: 13px; margin-top: 2px; }
.vg-dlg-body { max-height: min(70vh, 640px); overflow: auto; padding: 8px 20px 16px; }
.vg-det { width: 100%; border-collapse: collapse; font-size: 14px; }
.vg-det thead th { position: sticky; top: 0; background: #fff; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--gray-200); }
.vg-det thead th:first-child { text-align: left; }
.vg-det th, .vg-det td { padding: 7px 8px; }
.vg-det td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vg-det tbody + tbody .vg-det-prod th, .vg-det tbody + tbody .vg-det-prod td { border-top: 1px solid var(--gray-100); }
.vg-det-prod th { text-align: left; font-weight: 600; padding-top: 14px !important; }
.vg-det-prod th > span { display: inline; }
.vg-det-prod th b { float: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.vg-det-prod th small { font-weight: 400; }
.vg-det-tot td, .vg-det-tot th { font-weight: 700 !important; color: var(--ink) !important; border-top: 1px dashed var(--gray-200); }
.vg-det-var { white-space: nowrap; }
.vg-det-var { text-align: left; font-weight: 400; color: var(--gray-500); padding-left: 18px !important; }
@media (max-width: 640px) { .vg-det thead th { font-size: 10px; letter-spacing: 0; padding: 8px 4px; } .vg-det { font-size: 13px; } .vg-det th, .vg-det td { padding: 6px 5px; } .vg-det-var { padding-left: 10px !important; } }
.vg-custo { list-style: none; margin: 0; padding: 0; }
.vg-custo li { padding: 12px 0; border-bottom: 1px solid var(--gray-100); display: grid; gap: 3px; }
.vg-custo li:last-child { border-bottom: 0; }
.vg-custo-top { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.vg-custo-top b { font-variant-numeric: tabular-nums; }
.vg-custo-det { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--gray-500); }
.vg-custo-det b { color: var(--ink); font-weight: 600; }

/* Estoque: destino das peças com defeito */
.defeito-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.defeito-form input[type=number] { width: 72px; }
.defeito-form select { flex: 1 1 180px; min-width: 0; }
