:root {
  color-scheme:light;
  --ink:#171a1f;
  --ink-soft:#262b33;
  --sidebar:#171a1f;
  --sidebar-soft:#22262d;
  --muted:#687383;
  --line:#dfe4ea;
  --line-soft:#edf0f3;
  --yellow:#f4c430;
  --yellow-strong:#e7ad0b;
  --yellow-soft:#fff7d6;
  --bg:#f3f4f6;
  --surface:#fff;
  --red:#b42318;
  --red-soft:#feeceb;
  --green:#147d4a;
  --green-soft:#e4f7ec;
  --blue:#1d5f91;
  --shadow:0 1px 2px rgba(15,23,42,.05),0 8px 26px rgba(15,23,42,.045);
  --sidebar-width:284px;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { min-width:320px; background:var(--bg); }
body { margin:0; background:var(--bg); color:var(--ink); font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font:inherit; }
button,a { -webkit-tap-highlight-color:transparent; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible { outline:3px solid rgba(244,196,48,.5); outline-offset:2px; }
.app-shell { min-height:100vh; display:grid; grid-template-columns:var(--sidebar-width) minmax(0,1fr); }
.workspace { min-width:0; }

/* Navegação lateral */
.sidebar { position:sticky; top:0; height:100vh; display:flex; flex-direction:column; overflow:hidden; background:var(--sidebar); color:#fff; border-right:1px solid #2c3139; z-index:40; }
.sidebar-brand { min-height:78px; padding:15px 18px; display:flex; align-items:center; gap:12px; color:#fff; text-decoration:none; border-bottom:1px solid #2b3037; }
.brand-mark { width:40px; height:40px; flex:0 0 40px; display:grid; place-items:center; border-radius:11px; background:var(--yellow); color:#171a1f; font-size:.9rem; font-weight:950; letter-spacing:.04em; box-shadow:inset 0 -2px rgba(0,0,0,.12); }
.sidebar-brand strong,.sidebar-brand small { display:block; }
.sidebar-brand strong { font-size:1rem; letter-spacing:.01em; }
.sidebar-brand small { margin-top:2px; color:#9da6b2; font-size:.68rem; }
.sidebar-menu { flex:1; overflow-y:auto; overscroll-behavior:contain; padding:14px 11px 22px; scrollbar-width:thin; scrollbar-color:#3a4049 transparent; }
.nav-caption { margin:3px 11px 7px; color:#747f8c; font-size:.64rem; font-weight:850; letter-spacing:.13em; text-transform:uppercase; }
.nav-group { margin:10px 0 0; border-top:1px solid #2a2f36; padding-top:8px; }
.nav-group > summary,.nav-subgroup > summary { list-style:none; cursor:pointer; user-select:none; display:flex; align-items:center; color:#8f99a6; text-transform:uppercase; letter-spacing:.1em; font-weight:850; }
.nav-group > summary { justify-content:space-between; padding:7px 11px; font-size:.64rem; }
.nav-subgroup > summary { gap:8px; margin:6px 0 3px 43px; padding:6px 8px; font-size:.59rem; }
.nav-group > summary::-webkit-details-marker,.nav-subgroup > summary::-webkit-details-marker { display:none; }
.nav-group > summary::after,.nav-subgroup > summary::after { content:''; width:6px; height:6px; margin-left:auto; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg) translateY(-2px); transition:transform .15s ease; }
.nav-group:not([open]) > summary::after,.nav-subgroup:not([open]) > summary::after { transform:rotate(-45deg); }
.nav-group > summary .nav-badge { margin-left:auto; margin-right:10px; }
.nav-item { width:100%; min-height:43px; display:flex; align-items:center; gap:11px; border:0; border-radius:9px; padding:9px 11px; background:transparent; color:#cbd1d9; text-align:left; text-decoration:none; cursor:pointer; font-size:.83rem; font-weight:590; transition:background .14s ease,color .14s ease,transform .14s ease; }
.nav-item:hover { background:#282d35; color:#fff; }
.nav-item.active { background:var(--yellow); color:#171a1f; font-weight:800; box-shadow:0 4px 14px rgba(0,0,0,.14); }
.nav-item.active:hover { background:#ffd44f; }
.nav-item svg { width:20px; height:20px; flex:0 0 20px; fill:currentColor; opacity:.92; }
.nav-item > span:nth-last-child(2):first-of-type,.nav-item > span:last-child:first-of-type { min-width:0; }
.nav-subchildren .nav-item { min-height:38px; padding:7px 11px 7px 20px; font-size:.78rem; }
.nav-subchildren .nav-item svg { width:17px; height:17px; flex-basis:17px; }
.nav-code { width:29px; height:21px; flex:0 0 29px; display:grid; place-items:center; border:1px solid #4c535e; border-radius:5px; color:#9da6b2; font-size:.56rem; font-weight:900; letter-spacing:.02em; }
.nav-item.active .nav-code { border-color:#8c6800; color:#171a1f; background:rgba(255,255,255,.3); }
.nav-badge { min-width:21px; height:20px; margin-left:auto; padding:0 6px; display:inline-grid; place-items:center; border-radius:999px; background:#3b424d; color:#fff; font-size:.62rem; font-weight:900; }
.nav-badge.alert { background:#a72d25; }
.nav-item.active .nav-badge { background:#171a1f; color:#fff; }
.nav-external { margin-left:auto; color:#8d97a4; font-size:.78rem; }
.sidebar-footer { min-height:70px; padding:13px 18px; display:flex; align-items:center; gap:11px; border-top:1px solid #2b3037; background:#14171b; }
.sidebar-footer strong,.sidebar-footer small { display:block; max-width:180px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-footer strong { color:#f4f5f7; font-size:.78rem; }
.sidebar-footer small { color:#8f99a6; margin-top:2px; font-size:.66rem; }
.user-avatar { width:34px; height:34px; flex:0 0 34px; display:grid; place-items:center; border-radius:50%; background:#343a43; color:var(--yellow); font-size:.66rem; font-weight:900; }

/* Barra superior */
.topbar { height:70px; padding:0 26px; position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:18px; background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); backdrop-filter:blur(10px); }
.topbar-context { min-width:0; display:flex; align-items:center; gap:12px; }
.topbar-context small,.topbar-context strong { display:block; }
.topbar-context small { color:var(--muted); font-size:.65rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.topbar-context strong { margin-top:2px; font-size:.94rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.menu-toggle { width:40px; height:40px; display:none; place-items:center; border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--ink); cursor:pointer; }
.menu-toggle svg { width:21px; fill:currentColor; }
.top-actions { display:flex; align-items:center; gap:8px; }
.pill { display:inline-flex; align-items:center; gap:6px; border:1px solid #cce7d7; border-radius:999px; padding:6px 10px; color:#17683f; background:#effaf4; font-size:.7rem; font-weight:750; white-space:nowrap; }
.pill::before { content:''; width:7px; height:7px; border-radius:50%; background:#26a269; box-shadow:0 0 0 3px rgba(38,162,105,.12); }
.pill.offline { color:#92400e; background:#fff7ed; border-color:#fed7aa; }
.pill.offline::before { background:#e27a12; box-shadow:0 0 0 3px rgba(226,122,18,.12); }
.top-button { min-height:34px; border:1px solid var(--line); border-radius:8px; padding:6px 10px; background:#fff; color:#3e4856; cursor:pointer; font-size:.73rem; font-weight:720; }
.top-button:hover { border-color:#b8c0ca; background:#f8f9fa; color:var(--ink); }

/* Conteúdo */
main { width:100%; max-width:1600px; padding:30px 32px 54px; outline:0; }
main.equipment-layout { max-width:none; }
main.customer-layout { max-width:none; }
main.maintenance-layout { max-width:none; }
h1 { margin:0 0 6px; font-size:clamp(1.55rem,2.2vw,2rem); line-height:1.15; letter-spacing:-.025em; }
h2 { margin:0 0 14px; font-size:1.05rem; line-height:1.3; }
h3 { margin:16px 0 10px; font-size:.94rem; }
h4 { margin:14px 0 8px; font-size:.82rem; }
.lead { max-width:820px; margin:0; color:var(--muted); font-size:.88rem; line-height:1.55; }
.page-header { margin-bottom:22px; }
.page-kicker { margin:0 0 5px; color:#987000; font-size:.67rem; font-weight:900; letter-spacing:.1em; text-transform:uppercase; }
.grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.card { min-width:0; margin-bottom:18px; padding:19px; background:var(--surface); border:1px solid var(--line); border-radius:13px; box-shadow:var(--shadow); }
.metric { position:relative; overflow:hidden; }
.metric::after { content:''; position:absolute; width:46px; height:4px; left:19px; bottom:0; border-radius:5px 5px 0 0; background:var(--yellow); }
.metric strong { display:block; margin-bottom:3px; font-size:1.9rem; line-height:1; letter-spacing:-.04em; }
.metric small,.muted { color:var(--muted); }
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; flex-wrap:wrap; }
.toolbar .lead { margin-top:2px; }
.toolbar h1,.toolbar h2,.toolbar p { margin-bottom:0; }
.actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.period-form { display:flex; align-items:end; gap:8px; flex-wrap:wrap; }
.period-form label { min-width:145px; }
.report-controls { display:flex; align-items:end; gap:10px; flex-wrap:wrap; }
.report-controls label { min-width:145px; }
.report-controls .actions { margin-left:auto; }
.production-grid { display:flex; gap:28px; align-items:end; flex-wrap:wrap; }
.production-grid .metric strong { font-size:1.5rem; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.record-list { margin:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.record-list > div { display:grid; grid-template-columns:minmax(120px,.7fr) minmax(0,1.3fr); gap:14px; padding:10px 12px; border-bottom:1px solid var(--line-soft); }
.record-list > div:last-child { border-bottom:0; }
.record-list dt { color:var(--muted); font-size:.72rem; font-weight:750; }
.record-list dd { margin:0; text-align:right; font-size:.8rem; font-weight:700; }
.write-area { margin-top:18px; padding-top:4px; border-top:1px solid var(--line); }
.inline-check { display:flex; align-items:center; gap:8px; }
.inline-check input,.form-grid input[type="checkbox"] { width:auto; margin:0; }
.pagination { display:flex; align-items:center; justify-content:center; gap:14px; margin:18px 0 4px; color:var(--muted); font-size:.82rem; }
.button { min-height:36px; display:inline-flex; align-items:center; justify-content:center; border:1px solid var(--ink); border-radius:8px; padding:7px 12px; background:var(--ink); color:#fff; text-decoration:none; cursor:pointer; font-size:.77rem; font-weight:780; line-height:1.2; transition:transform .12s ease,box-shadow .12s ease,background .12s ease; }
.button:hover:not(:disabled) { transform:translateY(-1px); box-shadow:0 5px 12px rgba(15,23,42,.16); }
.button.secondary { border-color:#d5dbe2; background:#f5f7f9; color:#303844; }
.button.secondary:hover:not(:disabled) { background:#e9edf2; }
.button.danger { border-color:var(--red); background:var(--red); }
.button.warning { border-color:#f1c04d; background:#fff4c5; color:#715000; }
.button:disabled { opacity:.45; cursor:not-allowed; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:separate; border-spacing:0; font-size:.82rem; }
th,td { padding:12px 10px; border-bottom:1px solid var(--line-soft); text-align:left; vertical-align:middle; }
th { position:relative; color:#687383; background:#fafbfc; font-size:.66rem; font-weight:850; letter-spacing:.065em; text-transform:uppercase; white-space:nowrap; }
thead th:first-child { border-radius:8px 0 0 8px; }
thead th:last-child { border-radius:0 8px 8px 0; }
tbody tr { transition:background .12s ease; }
tbody tr:hover { background:#fffdf4; }
tbody tr:last-child td { border-bottom:0; }
td strong { color:#20242a; }
.status { display:inline-block; border-radius:999px; padding:4px 8px; background:#e8edf2; color:#4f5a68; font-size:.65rem; font-weight:850; line-height:1; white-space:nowrap; }
.status.ACTIVE,.status.APPROVED,.status.COMPLETED,.status.CLOSED { color:var(--green); background:var(--green-soft); }
.status.INACTIVE,.status.FAILED,.status.REJECTED,.status.CANCELLED,.status.red { color:var(--red); background:var(--red-soft); }
.status.PLANNED,.status.PENDING,.status.PROCESSING,.status.DRAFT,.status.yellow { color:#8a6100; background:#fff4c5; }
form.stack { display:grid; gap:12px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.full-width { grid-column:1/-1; }
.invoice-lines-section { display:grid; gap:12px; }
.invoice-lines-section > .toolbar { align-items:flex-start; margin:0; }
.invoice-lines-section h3 { margin:0 0 3px; }
.invoice-lines-section .toolbar .muted { margin:0; }
.invoice-line { display:grid; gap:12px; padding:14px; border:1px solid var(--line); border-radius:10px; background:#fcfdff; }
.invoice-line-heading { align-items:center; margin:0; padding-bottom:10px; border-bottom:1px solid var(--line-soft); }
.invoice-line-heading .page-kicker { display:block; margin-bottom:2px; }
.invoice-line-heading strong { font-size:.92rem; }
.invoice-line [data-invoice-line-total] { margin:0; }
.invoice-total { margin:0; padding:11px 12px; border-radius:8px; background:var(--yellow-soft); color:#664d00; font-weight:800; }
.spreadsheet-import-guidance { border-left:5px solid var(--yellow); }
.spreadsheet-import-guidance .toolbar { align-items:flex-start; margin-bottom:12px; }
.spreadsheet-source-notice { margin:0; padding:11px 13px; border:1px solid #eed78a; border-radius:9px; background:var(--yellow-soft); color:#674f00; font-size:.8rem; line-height:1.45; }
label { color:#3d4653; font-size:.76rem; font-weight:700; }
input,select,textarea { width:100%; min-height:40px; margin-top:5px; padding:8px 10px; border:1px solid #cbd2da; border-radius:8px; background:#fff; color:var(--ink); transition:border-color .12s ease,box-shadow .12s ease; }
input:hover,select:hover,textarea:hover { border-color:#aeb7c2; }
input:focus,select:focus,textarea:focus { border-color:#c79500; box-shadow:0 0 0 3px rgba(244,196,48,.16); outline:0; }
textarea { min-height:82px; resize:vertical; }
pre { max-height:300px; overflow:auto; padding:13px; border-radius:9px; background:#11151b; color:#e1e6ec; font-size:.74rem; line-height:1.5; }
dialog { width:min(760px,calc(100vw - 28px)); max-height:calc(100vh - 34px); overflow:auto; border:1px solid rgba(255,255,255,.3); border-radius:15px; padding:23px; color:var(--ink); background:#fff; box-shadow:0 24px 90px rgba(15,23,42,.38); }
dialog.order-detail-dialog { width:min(1040px,calc(100vw - 28px)); }
.order-answer { margin:0 0 14px; padding:12px 0; border-bottom:1px solid var(--line); }
.order-answer:last-of-type { border-bottom:0; }
.order-answer-head { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:baseline; margin-bottom:6px; }
.order-photos { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-start; }
.order-photo-card { display:grid; gap:6px; width:132px; margin:0; }
.order-photo { width:132px; height:132px; object-fit:cover; border-radius:10px; border:1px solid var(--line); background:#f3f3ee; }
.order-photo.signature-photo { width:220px; height:88px; object-fit:contain; background:#fff; }
.order-photo-placeholder { display:grid; place-items:center; width:132px; height:132px; border-radius:10px; border:1px dashed var(--line); color:var(--muted); font-size:.78rem; font-weight:750; }
.order-photo-toolbar { display:grid; gap:4px; }
dialog::backdrop { background:rgba(15,18,23,.68); backdrop-filter:blur(2px); }
.offline-banner { border-left:5px solid var(--red); background:#fff2f1; }
.offline-banner.queue { border-left-color:#c47d08; background:#fff9e8; }
.flow-card { border-left:5px solid var(--yellow); }
.flow-steps { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-top:14px; }
.flow-step { padding:11px; border:1px solid var(--line); border-radius:9px; background:#fafbfc; font-size:.76rem; line-height:1.45; }
.origin { color:#667180; font-size:.65rem; font-weight:780; letter-spacing:.02em; }
.pending-local { background:#fff8eb; }
.login { max-width:450px; margin:8vh auto; }
.error { min-height:1.2em; color:var(--red); }
.toast { position:fixed; right:22px; bottom:22px; max-width:420px; z-index:80; padding:13px 16px; border-left:4px solid var(--yellow); border-radius:9px; background:#171a1f; color:#fff; box-shadow:0 15px 40px rgba(15,23,42,.3); font-size:.82rem; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }

/* Visualização em lista ou cartões no módulo de manutenção */
.view-switcher { min-width:238px; min-height:44px; display:inline-flex; align-items:center; gap:3px; margin:0; padding:3px; border:1px solid #cfd6de; border-radius:10px; background:#e9edf1; }
.view-switcher-label { padding:0 8px; color:#657180; font-size:.65rem; font-weight:850; letter-spacing:.055em; text-transform:uppercase; }
.view-switcher label { position:relative; min-width:68px; min-height:36px; cursor:pointer; }
.view-switcher input { position:absolute; width:1px; height:1px; margin:0; opacity:0; pointer-events:none; }
.view-switcher label > span { min-height:36px; display:grid; place-items:center; padding:7px 10px; border-radius:7px; color:#4b5663; background:transparent; font-size:.72rem; font-weight:820; transition:background .12s ease,color .12s ease,box-shadow .12s ease; }
.view-switcher input:checked + span { color:#fff; background:#20262d; box-shadow:0 2px 7px rgba(15,23,42,.18); }
.view-switcher input:focus-visible + span { outline:3px solid rgba(244,196,48,.58); outline-offset:2px; }
.maintenance-card-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:13px; margin-bottom:18px; }
.card > .maintenance-card-grid { margin-bottom:0; }
.maintenance-card { min-width:0; overflow:hidden; display:flex; flex-direction:column; border:1px solid #d9e0e6; border-radius:12px; background:#fff; box-shadow:0 5px 16px rgba(15,23,42,.07); }
.maintenance-card-visual { position:relative; height:164px; flex:0 0 164px; display:grid; place-items:center; overflow:hidden; margin:0; background:radial-gradient(circle at 50% 58%,rgba(244,196,48,.2),transparent 50%),linear-gradient(145deg,#27313b,#14191f); }
.maintenance-card-visual::before { content:''; position:absolute; inset:0; opacity:.28; background-image:linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px); background-size:24px 24px; pointer-events:none; }
.maintenance-card-visual img { position:relative; z-index:1; width:100%; height:158px; padding:25px 30px 12px; object-fit:contain; filter:drop-shadow(0 10px 9px rgba(0,0,0,.32)); }
.maintenance-card-visual figcaption { position:absolute; inset:9px 10px 8px; z-index:2; display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:auto 1fr auto; align-items:start; gap:2px 8px; pointer-events:none; }
.maintenance-card-visual figcaption span { overflow:hidden; color:#f6cf49; font-size:.61rem; font-weight:900; letter-spacing:.08em; text-overflow:ellipsis; text-transform:uppercase; white-space:nowrap; }
.maintenance-card-visual figcaption strong { grid-row:1; grid-column:2; color:#fff; font-size:.72rem; letter-spacing:.025em; }
.maintenance-card-visual figcaption small { grid-row:3; grid-column:1/-1; justify-self:end; align-self:end; padding:3px 6px; border:1px solid rgba(255,255,255,.16); border-radius:999px; color:#b9c2cb; background:rgba(12,16,20,.72); font-size:.55rem; font-weight:750; }
.maintenance-card-body { min-height:0; flex:1; display:flex; flex-direction:column; padding:14px; }
.maintenance-card-heading { min-height:64px; display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding-bottom:11px; border-bottom:1px solid var(--line-soft); }
.maintenance-card-heading > div { min-width:0; }
.maintenance-card-heading .page-kicker { margin-bottom:3px; }
.maintenance-card-heading h3 { margin:0; overflow-wrap:anywhere; font-size:.96rem; }
.maintenance-card-heading p:last-child { margin:4px 0 0; overflow-wrap:anywhere; color:var(--muted); font-size:.7rem; line-height:1.35; }
.maintenance-card-pending { align-self:flex-start; margin:9px 0 0; }
.maintenance-card-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 13px; margin:8px 0 12px; }
.maintenance-card-facts div { min-width:0; padding:7px 0; border-bottom:1px solid var(--line-soft); }
.maintenance-card-facts dt { color:#7a8592; font-size:.6rem; font-weight:780; letter-spacing:.045em; text-transform:uppercase; }
.maintenance-card-facts dd { margin:3px 0 0; overflow-wrap:anywhere; color:#2a3139; font-size:.72rem; font-weight:720; line-height:1.35; }
.maintenance-card-actions { align-items:stretch; margin-top:auto; padding-top:2px; }
.maintenance-card-actions .button { min-height:40px; flex:1 1 calc(33.333% - 7px); padding:7px 9px; font-size:.69rem; }
.maintenance-card-actions > .muted { align-self:center; font-size:.72rem; }
.maintenance-empty { margin:0; padding:25px 14px; border:1px dashed #cbd3dc; border-radius:10px; color:var(--muted); text-align:center; }

/* Conteúdo técnico */
.quick-consultation form { grid-template-columns:minmax(240px,2fr) minmax(190px,1fr); align-items:end; }
.quick-consultation form > .actions,.quick-consultation form > p { grid-column:1/-1; }
.consultation-progress { margin:0; align-self:center; }
.technical-answer { border-top:5px solid var(--yellow); }
.answer-heading { display:flex; align-items:start; justify-content:space-between; gap:16px; margin-bottom:12px; }
.answer-heading h2 { margin:2px 0 4px; font-size:1.45rem; }
.eyebrow { margin:0; color:#8b6500; font-size:.66rem; font-weight:900; letter-spacing:.09em; text-transform:uppercase; }
.review-warning { padding:10px 12px; border-radius:8px; background:var(--yellow-soft); color:#694c00; font-size:.8rem; }
.answer-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:16px; }
.answer-block { min-width:0; padding:14px; border:1px solid var(--line); border-radius:10px; }
.answer-block h3 { margin:0 0 10px; }
.answer-block ul,.answer-block ol { margin:0; padding-left:20px; }
.answer-block li + li { margin-top:6px; }
.answer-block dl { margin:0; }
.answer-block dl div,.specification-table div { display:flex; justify-content:space-between; gap:16px; padding:7px 0; border-bottom:1px solid var(--line-soft); }
.answer-block dt,.specification-table span { color:var(--muted); }
.answer-block dd { margin:0; text-align:right; font-weight:700; }
.specification-table strong { text-align:right; }
.maintenance-summary + .maintenance-summary { margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.maintenance-summary > span,.sources span { display:block; margin:3px 0 8px; color:var(--muted); font-size:.75rem; }
.sources a { color:#075985; font-weight:750; overflow-wrap:anywhere; }
.missing-evidence { margin-top:14px; padding:14px; border-radius:10px; background:#fff1f2; color:#881337; }
.missing-evidence ul { margin-bottom:0; }
.sidebar-backdrop { display:none; }

/* Cadastro visual de clientes e relacionamento */
#customer-search { min-width:280px; }
.customer-metrics { display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:10px; margin-bottom:12px; }
.customer-metrics > div { padding:13px 15px; border:1px solid var(--line); border-radius:11px; background:#fff; box-shadow:var(--shadow); }
.customer-metrics strong,.customer-metrics span { display:block; }
.customer-metrics strong { font-size:1.4rem; line-height:1; }
.customer-metrics span { margin-top:4px; color:var(--muted); font-size:.68rem; font-weight:760; text-transform:uppercase; letter-spacing:.045em; }
.customer-sort-note { margin:0 0 13px; color:var(--muted); font-size:.76rem; }
.customer-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(350px,1fr)); gap:13px; align-items:stretch; }
.customer-card { min-width:0; display:flex; flex-direction:column; overflow:hidden; border:1px solid #d8dee5; border-top:4px solid var(--yellow); border-radius:13px; background:#fff; box-shadow:var(--shadow); }
.customer-card.is-inactive { opacity:.78; border-top-color:#9aa3ae; }
.customer-card-heading { min-height:112px; display:flex; align-items:flex-start; justify-content:space-between; gap:13px; padding:17px 17px 12px; border-bottom:1px solid var(--line-soft); }
.customer-card-heading > div { min-width:0; }
.customer-card-heading h2 { margin:4px 0 0; overflow-wrap:anywhere; font-size:1rem; }
.customer-document { margin:0; color:#7a8491; font-size:.64rem; font-weight:830; letter-spacing:.055em; text-transform:uppercase; }
.customer-legal-name { margin:5px 0 0; color:var(--muted); font-size:.7rem; line-height:1.35; }
.customer-relationship { flex:0 0 auto; display:inline-flex; align-items:center; border-radius:999px; padding:6px 9px; background:#edf0f3; color:#4f5a68; font-size:.65rem; font-weight:850; white-space:nowrap; }
.customer-relationship.has-contract { background:var(--green-soft); color:var(--green); }
.customer-relationship.crm-hot { background:#feeceb; color:#a5281f; }
.customer-relationship.crm-warm { background:#fff2ca; color:#7e5b00; }
.customer-relationship.crm-cold { background:#e8f3fa; color:#1d5f91; }
.customer-card-sections { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); flex:1; }
.customer-card-sections > section { min-width:0; padding:13px 17px 10px; }
.customer-card-sections > section + section { border-left:1px solid var(--line-soft); }
.customer-section-title { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.customer-section-title strong { font-size:.75rem; }
.customer-section-title span { color:var(--muted); font-size:.62rem; font-weight:750; }
.customer-contact { margin:0 0 8px; color:#333c48; font-size:.72rem; line-height:1.35; }
.customer-contact > strong { overflow-wrap:anywhere; }
.customer-contact > span { margin-left:5px; padding:2px 5px; border-radius:999px; background:var(--yellow-soft); color:#735500; font-size:.55rem; font-weight:850; text-transform:uppercase; }
.customer-contact small { color:var(--muted); overflow-wrap:anywhere; }
.customer-site-list { display:flex; flex-wrap:wrap; gap:6px; }
.customer-site-list > span { max-width:100%; padding:6px 8px; border:1px solid #e0e5ea; border-radius:8px; background:#f8fafb; }
.customer-site-list strong,.customer-site-list small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.customer-site-list strong { font-size:.68rem; }
.customer-site-list small { margin-top:2px; color:var(--muted); font-size:.59rem; }
.customer-card-empty,.customer-card-more { margin:4px 0; color:var(--muted); font-size:.69rem; }
.customer-crm-reason { margin:0; padding:10px 17px; border-top:1px solid var(--line-soft); background:#fffcf1; color:#62532b; font-size:.7rem; line-height:1.45; }
.customer-card-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 17px; border-top:1px solid var(--line); background:#fafbfc; }
.customer-card-footer > div:first-child { min-width:92px; }
.customer-card-footer small { display:block; margin-top:3px; color:var(--muted); font-size:.6rem; }
.customer-card-footer .actions { justify-content:flex-end; }
.customer-card-footer .button { min-height:34px; padding:6px 9px; font-size:.68rem; }
.customer-registry-state { color:var(--green); font-size:.66rem; font-weight:800; }
.customer-registry-state.inactive { color:var(--red); }
.customer-empty { grid-column:1/-1; padding:30px; border:1px dashed var(--line); border-radius:12px; color:var(--muted); text-align:center; }
.customer-relationship-detail { margin-bottom:18px; padding:13px; border:1px solid var(--line); border-radius:10px; background:#fafbfc; }
.customer-relationship-detail .customer-registry-state { margin-left:9px; }
.customer-relationship-detail p { margin:9px 0 0; color:#4f5965; font-size:.76rem; }
.crm-editor { margin:0; border-left:4px solid var(--yellow); background:#fffdf6; }
.crm-editor h3 { margin-top:0; }

/* Contratos, máquinas e checklists vinculados */
dialog.contract-dialog,dialog.contract-view-dialog { width:min(1060px,calc(100vw - 28px)); }
.field-count { color:var(--muted); font-size:.62rem; font-weight:650; }
.contract-equipment-picker { min-width:0; margin:3px 0; padding:15px; border:1px solid var(--line); border-radius:11px; }
.contract-equipment-picker legend { padding:0 6px; color:#303844; font-size:.82rem; font-weight:850; }
.contract-equipment-toolbar { display:flex; align-items:end; justify-content:space-between; gap:14px; margin-bottom:12px; }
.contract-equipment-toolbar label { flex:1; max-width:480px; }
.contract-equipment-toolbar p { margin:0 0 9px; color:var(--muted); font-size:.7rem; white-space:nowrap; }
.contract-equipment-options { max-height:320px; overflow:auto; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; padding:3px; overscroll-behavior:contain; }
.contract-equipment-option { min-width:0; display:flex; align-items:center; gap:9px; padding:9px; border:1px solid #dfe4ea; border-radius:9px; background:#fafbfc; cursor:pointer; }
.contract-equipment-option:hover { border-color:#c5a12b; background:#fffdf4; }
.contract-equipment-option:has(input:checked) { border-color:#c79500; background:var(--yellow-soft); box-shadow:0 0 0 2px rgba(244,196,48,.16); }
.contract-equipment-option input { width:18px; min-height:18px; flex:0 0 18px; margin:0; }
.contract-equipment-option > span:not(.status) { min-width:0; flex:1; }
.contract-equipment-option strong,.contract-equipment-option small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.contract-equipment-option strong { color:#252b33; font-size:.75rem; }
.contract-equipment-option small { margin-top:2px; color:var(--muted); font-size:.62rem; }
.contract-equipment-option .status { padding:4px 6px; font-size:.56rem; }
.contract-service-list { margin-top:20px; }
.contract-service-list > div:first-child { margin-bottom:12px; }
.contract-service-list h3,.contract-service-list p { margin-bottom:3px; }
.contract-service-card { overflow:hidden; margin-bottom:12px; border:1px solid var(--line); border-radius:11px; }
.contract-service-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:13px 15px; background:#f8fafb; border-bottom:1px solid var(--line); }
.contract-service-heading h3 { margin:1px 0 2px; font-size:.95rem; }
.contract-service-heading p { margin:0; color:var(--muted); font-size:.7rem; }
.contract-checklist-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.contract-checklist-state { min-width:0; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 15px; }
.contract-checklist-state + .contract-checklist-state { border-left:1px solid var(--line); }
.contract-checklist-state > div { min-width:0; }
.contract-checklist-state p { margin:0 0 3px; }
.contract-checklist-state strong,.contract-checklist-state small { display:block; }
.contract-checklist-state strong { overflow-wrap:anywhere; font-size:.76rem; }
.contract-checklist-state small { margin-top:5px; color:var(--muted); font-size:.66rem; line-height:1.4; }
.contract-checklist-state .button { flex:0 0 auto; }

/* Valor da hora-máquina: histórico financeiro somente interno */
dialog.equipment-detail-dialog { width:min(1040px,calc(100vw - 28px)); }
.hour-rate-panel { margin:19px 0; padding:17px; border:1px solid #d7dde4; border-left:5px solid var(--yellow); border-radius:11px; background:#fbfcfd; }
.hour-rate-panel > .toolbar { margin-bottom:12px; }
.hour-rate-panel h3,.hour-rate-panel h4 { margin:0 0 4px; }
.hour-rate-current { padding:15px; border-radius:10px; background:#171c22; color:#fff; }
.hour-rate-current > span { color:#9aa6b1; font-size:.65rem; font-weight:820; letter-spacing:.06em; text-transform:uppercase; }
.hour-rate-current > strong { display:block; margin-top:4px; color:var(--yellow); font-size:1.65rem; line-height:1.15; }
.hour-rate-current > strong small { margin-left:5px; color:#c8d0d8; font-size:.72rem; }
.hour-rate-current p { margin:7px 0 0; color:#aeb8c2; font-size:.68rem; }
.hour-rate-current.empty > strong { color:#fff; font-size:1.1rem; }
.hour-rate-pending,.hour-rate-form { margin-top:12px; padding:14px; border:1px solid #ead38a; border-radius:10px; background:#fffaf0; }
.hour-rate-pending > .toolbar { margin-bottom:9px; }
.hour-rate-pending > p { font-size:.76rem; }
.hour-rate-governance { padding:9px 11px; border-radius:8px; background:#f3f5f7; color:#4c5663; }
.hour-rate-form textarea { min-height:64px; }
.hour-rate-history { margin-top:12px; }
.hour-rate-history summary { cursor:pointer; color:#394351; font-size:.75rem; font-weight:800; }
.hour-rate-history .table-wrap { margin-top:10px; }
.status.SUPERSEDED { color:#56616f; background:#e8edf2; }

/* Catálogo visual da frota */
.equipment-catalog { padding:22px; color:#e8edf2; background:#12171d; border-color:#29323b; box-shadow:0 18px 46px rgba(15,23,42,.16); }
.equipment-catalog .page-kicker { color:#f4c430; }
.equipment-catalog h2 { color:#fff; margin-bottom:5px; font-size:1.26rem; }
.equipment-catalog-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:22px; margin-bottom:20px; }
.equipment-catalog-heading > div:first-child { min-width:0; }
.equipment-catalog-heading p:last-child { max-width:680px; margin:0; color:#97a3af; font-size:.8rem; line-height:1.5; }
.equipment-counts { display:grid; grid-template-columns:repeat(4,minmax(72px,1fr)); gap:7px; min-width:min(100%,360px); }
.equipment-counts > div { min-width:0; padding:10px 11px; border:1px solid #2d3741; border-radius:9px; background:#1b222a; }
.equipment-counts strong,.equipment-counts span { display:block; }
.equipment-counts strong { color:#fff; font-size:1.35rem; line-height:1; }
.equipment-counts span { margin-top:4px; color:#8f9ba7; font-size:.61rem; font-weight:750; text-transform:uppercase; letter-spacing:.06em; }
.equipment-filters { display:grid; grid-template-columns:minmax(220px,2fr) repeat(2,minmax(150px,1fr)) auto; align-items:end; gap:10px; padding:13px; border:1px solid #2b353f; border-radius:11px; background:#192027; }
.equipment-filters label { color:#b8c2cc; }
.equipment-filters input,.equipment-filters select { margin-top:6px; border-color:#3a4652; background:#11161b; color:#edf2f6; }
.equipment-filters input::placeholder { color:#77838e; }
.equipment-filters input:focus,.equipment-filters select:focus { border-color:#d8a700; box-shadow:0 0 0 3px rgba(244,196,48,.14); }
.equipment-catalog .equipment-filters .button.secondary { min-height:40px; border-color:#46525e; background:#2b343e; color:#f2f4f6; }
.equipment-catalog .equipment-filters .button.secondary:hover:not(:disabled) { background:#37424e; }
.equipment-filter-summary { margin:15px 2px 11px; color:#8f9ba7; font-size:.73rem; }
.equipment-filter-summary strong { color:#f4c430; }
.equipment-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(264px,1fr)); gap:13px; }
.equipment-card { min-width:0; overflow:hidden; border:1px solid #303b46; border-radius:12px; background:#1b222a; box-shadow:0 7px 17px rgba(0,0,0,.18); transition:border-color .15s ease,transform .15s ease,box-shadow .15s ease; }
.equipment-card:hover { border-color:#69747e; transform:translateY(-2px); box-shadow:0 12px 26px rgba(0,0,0,.26); }
.equipment-card-visual { position:relative; min-height:180px; display:flex; align-items:flex-end; justify-content:center; overflow:hidden; background:radial-gradient(circle at 50% 60%,rgba(244,196,48,.18),transparent 52%),linear-gradient(145deg,#242e38,#12171d); }
.equipment-card-visual::before { content:''; position:absolute; inset:0; opacity:.34; background-image:linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px); background-size:26px 26px; mask-image:linear-gradient(to bottom,rgba(0,0,0,.8),transparent 94%); pointer-events:none; }
.equipment-card-visual-top { position:absolute; inset:11px 11px auto; z-index:1; display:flex; align-items:flex-start; justify-content:space-between; gap:9px; }
.equipment-category { max-width:70%; overflow:hidden; color:#f6cf49; font-size:.62rem; font-weight:900; letter-spacing:.09em; text-transform:uppercase; text-overflow:ellipsis; white-space:nowrap; }
.equipment-card .status { padding:5px 8px; color:#12171d; background:#d8e0e6; }
.equipment-card .status.ACTIVE { color:#b9f4d1; background:#1d724b; }
.equipment-card .status.MAINTENANCE,.equipment-card .status.PLANNED { color:#ffe49a; background:#85600c; }
.equipment-card .status.INACTIVE { color:#ffd0cb; background:#8c2d29; }
.equipment-card-photo { position:relative; z-index:0; width:100%; height:176px; padding:23px 25px 9px; object-fit:contain; object-position:center bottom; filter:drop-shadow(0 13px 10px rgba(0,0,0,.28)); }
.equipment-card-photo[data-photo-source="custom"] { padding:0; object-fit:cover; object-position:center; filter:none; }
.equipment-photo-badge { position:absolute; right:10px; bottom:9px; z-index:1; padding:4px 7px; border:1px solid rgba(255,255,255,.17); border-radius:999px; background:rgba(14,18,22,.72); color:#aab4bd; font-size:.57rem; font-weight:800; letter-spacing:.02em; }
.equipment-photo-badge.is-custom { border-color:rgba(244,196,48,.55); color:#ffe58a; }
.equipment-card-body { padding:14px 14px 13px; }
.equipment-card-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.equipment-card-title h3 { min-height:2.25em; margin:3px 0 0; color:#f8fafc; font-size:.94rem; line-height:1.18; }
.equipment-tag { margin:0; color:#f4c430; font-size:1.16rem; font-weight:950; letter-spacing:.045em; line-height:1; }
.equipment-version { flex:0 0 auto; color:#9aa6b1; font-size:.68rem; font-weight:750; }
.equipment-pending { margin:9px 0 0; color:#f0c35c; }
.equipment-card-specs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 14px; margin:15px 0 13px; padding-top:11px; border-top:1px solid #303b46; }
.equipment-card-specs div { min-width:0; padding:5px 0; }
.equipment-card-specs dt { color:#82909c; font-size:.61rem; font-weight:750; text-transform:uppercase; letter-spacing:.055em; }
.equipment-card-specs dd { margin:3px 0 0; overflow:hidden; color:#e2e8ed; font-size:.73rem; font-weight:720; text-overflow:ellipsis; white-space:nowrap; }
.equipment-card-actions { align-items:stretch; gap:5px; }
.equipment-card-actions .button { min-height:38px; flex:1 1 calc(33.333% - 5px); padding:7px 8px; border-radius:7px; font-size:.69rem; }
.equipment-card-actions .button.secondary { border-color:#46525e; background:#2a343e; color:#f1f4f6; }
.equipment-card-actions .button.secondary:hover:not(:disabled) { background:#394651; }
.equipment-card-actions .button.danger { border-color:#85332e; background:#642824; }
.equipment-card-actions .button.warning { border-color:#a87912; background:#71520d; color:#ffe9a8; }
.equipment-empty { margin:14px 0 0; padding:26px 15px; border:1px dashed #45515c; border-radius:10px; color:#aab4bd; text-align:center; }
.equipment-photo-editor { display:grid; grid-template-columns:190px minmax(0,1fr); gap:18px; align-items:start; margin:5px 0 6px; padding:15px; border:1px solid var(--line); border-radius:11px; background:#fafbfc; }
.equipment-photo-preview { position:relative; min-height:150px; display:grid; place-items:center; overflow:hidden; border:1px solid #d8dee5; border-radius:10px; background:radial-gradient(circle at 50% 55%,#fff7d6,#eef1f4 70%); }
.equipment-photo-preview img { width:100%; height:150px; object-fit:contain; padding:10px; }
.equipment-photo-preview img[data-photo-source="custom"] { padding:0; object-fit:cover; }
.equipment-photo-preview-mark { position:absolute; right:7px; bottom:6px; display:grid; place-items:center; width:27px; height:27px; border-radius:7px; background:rgba(23,26,31,.82); color:var(--yellow); font-size:.55rem; font-weight:950; }
.equipment-photo-editor h3 { margin:0 0 6px; }
.equipment-photo-editor .actions { margin-top:10px; }
.equipment-photo-editor [data-equipment-photo-state] { min-height:1.2em; margin:9px 0 0; }
.equipment-photo-dialog-content[aria-busy="true"] { cursor:progress; }
.equipment-photo-dialog-content[aria-busy="true"] .equipment-photo-preview { opacity:.72; }

@media (max-width:1180px) {
  .grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:900px) {
  .app-shell { display:block; }
  .sidebar { position:fixed; inset:0 auto 0 0; width:min(var(--sidebar-width),86vw); height:100vh; transform:translateX(-103%); transition:transform .2s ease; box-shadow:16px 0 42px rgba(15,23,42,.32); }
  .sidebar.open { transform:translateX(0); }
  .menu-toggle { display:grid; }
  .sidebar-backdrop:not([hidden]) { display:block; position:fixed; inset:0; z-index:35; border:0; background:rgba(15,18,23,.62); }
  main { padding:22px 20px 44px; }
  .grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .flow-steps { grid-template-columns:1fr; }
}
@media (max-width:700px) {
  .answer-grid,.quick-consultation form { grid-template-columns:1fr; }
  .topbar { height:64px; padding:0 14px; }
  .topbar-context small { display:none; }
  .top-actions { gap:5px; }
  .top-button { padding:5px 7px; }
  .page-header > .actions { width:100%; }
  .page-header .view-switcher { flex:1 1 238px; }
}
@media (max-width:560px) {
  main { min-width:0; padding:17px 12px 38px; }
  .grid,.form-grid,.detail-grid { grid-template-columns:1fr; }
  .card { padding:15px; border-radius:11px; }
  .metric { min-height:90px; }
  .pagination { flex-wrap:wrap; }
  .answer-heading { display:block; }
  .pill { max-width:112px; overflow:hidden; text-overflow:ellipsis; padding:5px 7px; font-size:.62rem; }
  .topbar-context strong { max-width:128px; font-size:.82rem; }
  .toolbar { align-items:flex-start; }
  .toolbar > .actions,.toolbar > .button { width:100%; }
  .toolbar > .actions .button { flex:1; }
  .view-switcher { width:100%; }
  .view-switcher label { flex:1; }
  .maintenance-card-grid { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion:reduce) {
  .equipment-card,.view-switcher label > span { transition:none; }
  .equipment-card:hover { transform:none; }
}

@media (max-width:1020px) {
  .equipment-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .equipment-filters label:first-child { grid-column:1/-1; }
  .equipment-filters .button { justify-self:start; }
  .contract-equipment-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:700px) {
  .equipment-catalog-heading { display:block; }
  .equipment-counts { margin-top:16px; min-width:0; }
  .equipment-photo-editor { grid-template-columns:1fr; }
  .equipment-photo-preview { max-width:270px; }
  .equipment-card-actions .button { min-height:44px; }
  .customer-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .customer-grid { grid-template-columns:1fr; }
  .contract-equipment-toolbar { display:block; }
  .contract-equipment-toolbar label { max-width:none; }
  .contract-equipment-toolbar p { margin-top:8px; white-space:normal; }
  .contract-checklist-grid { grid-template-columns:1fr; }
  .contract-checklist-state + .contract-checklist-state { border-left:0; border-top:1px solid var(--line); }
}
@media (max-width:560px) {
  .equipment-catalog { padding:15px; }
  .equipment-filters { grid-template-columns:1fr; }
  .equipment-filters label:first-child { grid-column:auto; }
  .equipment-filters .button { width:100%; }
  .equipment-counts { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .equipment-grid { grid-template-columns:1fr; }
  #customer-search { min-width:0; }
  #customer-search-form { width:100%; }
  #customer-search-form input { flex:1 1 100%; }
  .customer-card-heading { min-height:0; display:block; }
  .customer-card-heading .customer-relationship { margin-top:10px; }
  .customer-card-sections { grid-template-columns:1fr; }
  .customer-card-sections > section + section { border-left:0; border-top:1px solid var(--line-soft); }
  .customer-card-footer { align-items:flex-start; flex-direction:column; }
  .customer-card-footer .actions { width:100%; }
  .customer-card-footer .button { flex:1; min-height:42px; }
  .contract-equipment-options { grid-template-columns:1fr; max-height:360px; }
  .contract-checklist-state { align-items:flex-start; flex-direction:column; }
  .contract-checklist-state .button { width:100%; min-height:42px; }
  .hour-rate-current > strong { font-size:1.35rem; }
}
