:root {
  --ink: #11151C; --muted: #5B6472; --bg: #F3F4F6; --card: #FFFFFF; --line: #CBD0D8;
  --accent: #C2410C; --accent-dark: #9A3412; --ok-bg: #DCFCE7; --ok-ink: #14532D; --err-bg: #FEE2E2; --err-ink: #7F1D1D;
}
* { box-sizing: border-box; }
html, body { overscroll-behavior-y: none; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Barlow', system-ui, sans-serif; font-size: 17px; }
a { color: var(--accent); font-weight: 600; }
a:hover { color: var(--accent-dark); }
button, input { font-family: inherit; }

.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.shell.wide { max-width: 960px; }
.hero { background: var(--ink); color: #fff; padding: 40px 24px 28px; display: flex; flex-direction: column; gap: 10px; }
.hero .logo { width: 48px; height: 48px; border-radius: 12px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.hero h1 { margin: 0; font-size: 32px; line-height: 1.05; }
.hero p { margin: 0; color: #9CA3AF; font-size: 16px; }

.topbar { background: var(--ink); color: #fff; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar .who { display: flex; flex-direction: column; }
.topbar .role { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #D1D5DB; }
.topbar .name { font-size: 20px; font-weight: 700; }
.btn-ghost { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid #3B4452; background: transparent; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }

.card { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.section { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--card); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.panel h2 { margin: 0; font-size: 18px; }
.label, .field label { font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field select, .passwrap input, .inline-input { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 17px; background: #fff; color: var(--ink); }
.field select { padding: 0 14px; font-size: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.passwrap { position: relative; }
.passwrap input { padding-right: 56px; }
.eye { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
input:focus-visible, button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 3px solid #1D4ED8; outline-offset: 2px; }
.link { min-height: 44px; display: inline-flex; align-items: center; }
.right { align-self: flex-end; }
.center { text-align: center; color: var(--muted); margin: 0; }

.btn { min-height: 56px; border: 0; border-radius: 14px; font-size: 19px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.primary[disabled] { opacity: .6; cursor: wait; }
.btn.outline { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn.outline.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.small { min-height: 44px; font-size: 16px; padding: 0 14px; border-radius: 10px; }

.msg { border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.msg.ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid #86EFAC; }
.msg.err { background: var(--err-bg); color: var(--err-ink); border: 1px solid #FCA5A5; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 16px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.drop { background: #fff; border: 2px dashed var(--line); border-radius: 14px; min-height: 90px; padding: 12px; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.tabs { display: flex; overflow-x: auto; background: #fff; border-bottom: 1px solid #E5E7EB; }
.tab { flex: 1 0 auto; min-height: 52px; padding: 0 12px; white-space: nowrap; border: 0; background: transparent; font-size: 16px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
select.inline-input { appearance: auto; }
.textarea { min-height: 96px; padding: 12px 14px; resize: vertical; font-size: 17px; }
.options { display: flex; flex-direction: column; gap: 8px; }
.opt { min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); font-size: 17px; font-weight: 600; text-align: left; cursor: pointer; }
.opt.on { border-color: var(--accent); background: #FFEDD5; color: #7C2D12; }
.kpi { background: #fff; border-radius: 14px; padding: 14px; }
.kpi .n { font-size: 32px; font-weight: 700; }
.kpi .t { font-size: 14px; color: var(--muted); }
.kpi.warn { background: #FFEDD5; }
.kpi.warn .t, .kpi.warn .n { color: #7C2D12; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.bar-row .nm { width: 110px; flex-shrink: 0; }
.bar-row .track { flex: 1; height: 14px; border-radius: 7px; background: #E5E7EB; }
.bar-row .fill { height: 14px; border-radius: 7px; background: var(--accent); }
.bar-row .val { width: 36px; text-align: right; font-weight: 600; }

.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.item { background: #fff; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.item .media { background: #E5E7EB; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.item .media img, .item .media video { width: 100%; height: 100%; object-fit: cover; }
.item .meta { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item .title { font-weight: 700; }
.item .sub { color: var(--muted); font-size: 14px; }
.pill { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.pill.novo { background: #FFEDD5; color: #7C2D12; }
.pill.revisado { background: var(--ok-bg); color: var(--ok-ink); }
.list-row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; border-top: 1px solid #E5E7EB; gap: 10px; }
.list-row:first-of-type { border-top: 0; }
.muted { color: var(--muted); font-size: 15px; }

/* Ordem de produção */
.tabs .tab { font-size: 15px; padding: 0 4px; }
.pill.cancelada { background: #E5E7EB; color: #374151; }


/* Perfil, Lean e ISO */
.role-picker { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-picker legend { grid-column: 1 / -1; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.role-choice { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; cursor: pointer; }
.role-choice:has(input:checked) { color: #fff; background: var(--ink); border-color: var(--ink); }
.role-choice input { accent-color: var(--accent); width: 18px; height: 18px; }
.tool-grid, .iso-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tool-card { min-height: 58px; padding: 10px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.tool-card:has(input:checked) { border: 2px solid var(--accent); background: #FFF7ED; }
.tool-card input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--accent); }
.tool-card span { display: flex; flex-direction: column; gap: 2px; }
.tool-card small { color: var(--muted); line-height: 1.25; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tool-grid .btn, .iso-grid + .btn { grid-column: 1 / -1; }
.iso-finding { border: 1px solid var(--line); }
.iso-finding p { margin: 0; }
.evidence { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; background: var(--bg); }
.btn.outline { position: relative; }
@media (min-width: 700px) { .tool-grid, .iso-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 420px) { .tool-grid, .iso-grid { grid-template-columns: 1fr; } .bar-row .nm { width: 82px; } }
