/* Painel do Good Jurídico (complementa o style.css) */
.brand-bag { background: url('/img/logo-mark.svg') center / cover no-repeat; }
.badge.novo { background: #fef3c7; color: #b45309; }
.badge.pronto, .badge.enviado { background: #ede9fe; color: #6d28d9; }
.badge.entregue { background: #dcfce7; color: #15803d; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #f1f2f6; display: inline-grid; place-items: center; vertical-align: middle; }
.prod-cell { display: flex; align-items: center; gap: 10px; }
.prod-cell small { display: block; color: var(--muted); }
.var-table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.var-table th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 700; padding: 4px; }
.var-table td { padding: 4px; vertical-align: middle; }
.var-table input[type=text], .var-table input[type=number], .var-table input:not([type]) { width: 100%; min-width: 60px; }
.var-table .erp-link { font-size: .78rem; color: var(--muted); display: block; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.photo-grid figure { margin: 0; position: relative; width: 86px; height: 86px; border-radius: 12px; overflow: hidden; background: #f1f2f6; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid figure button { position: absolute; border: 0; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: 3px 6px; cursor: pointer; }
.photo-grid .ph-del { top: 4px; right: 4px; }
.photo-grid .ph-cover { bottom: 4px; left: 4px; }
.photo-grid .ph-first { position: absolute; bottom: 4px; left: 4px; background: var(--primary); color: var(--on-primary); font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.photo-add { width: 86px; height: 86px; border-radius: 12px; border: 2px dashed var(--border); display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: .8rem; text-align: center; }
.share-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.share-box code { background: #f6f7fb; padding: 8px 12px; border-radius: 10px; word-break: break-all; }
.order-items td:last-child { text-align: right; white-space: nowrap; }
.status-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.erp-ok { color: #15803d; font-weight: 700; }
.erp-err { color: var(--danger); }
.stock-low { color: var(--danger); font-weight: 700; }

/* Ordens de serviço */
.badge.recebido, .badge.analise { background: #e0f2fe; color: #0369a1; }
.badge.orcamento { background: #fef3c7; color: #b45309; }
.badge.aprovado, .badge.reparo { background: #ede9fe; color: #6d28d9; }
.badge.peca { background: #ffedd5; color: #c2410c; }
.badge.pronto { background: #dcfce7; color: #15803d; }
.badge.recusado { background: #fee2e2; color: #b91c1c; }
.os-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.os-grid .card { margin-bottom: 18px; }
.os-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.os-head h1 { margin: 0; }
.os-head small { color: var(--muted); display: block; }
.os-dl { display: grid; gap: 6px; margin: 0; }
.os-dl div { display: grid; grid-template-columns: 150px 1fr; gap: 10px; }
.os-dl dt { color: var(--muted); font-size: .88rem; }
.os-dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.check-grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.check-grid .seg { display: inline-flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.check-grid .seg button { border: 0; background: #fff; padding: 6px 10px; font: inherit; font-size: .82rem; cursor: pointer; }
.check-grid .seg button.on[data-s=ok] { background: #dcfce7; color: #15803d; font-weight: 700; }
.check-grid .seg button.on[data-s=problema] { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.check-grid .seg button.on[data-s=na] { background: #eef1f5; font-weight: 700; }
.items-table input { width: 100%; }
.items-table td { padding: 4px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { padding: 0 0 12px 14px; position: relative; font-size: .92rem; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline li.priv::before { background: #9ca3af; }
.timeline small { display: block; color: var(--muted); font-size: .78rem; }
.secret { font-family: ui-monospace, monospace; background: #f6f7fb; padding: 2px 8px; border-radius: 6px; }
.prio { color: var(--danger); font-weight: 800; }
.late { color: var(--danger); font-weight: 700; }
@media (max-width: 900px) { .os-grid { grid-template-columns: minmax(0, 1fr); } .os-dl div { grid-template-columns: 1fr; gap: 0; } }
.table-wrap + .main-head, .table-wrap + h2 { margin-top: 28px; }
.os-grid > div { min-width: 0; }
@media (max-width: 640px) {
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: 1.2fr 70px 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .items-table td { padding: 0; }
  .items-table td:nth-child(2) { grid-column: 1 / -1; order: -1; }
  .os-head .status-steps { width: 100%; }
}


/* Good Jurídico */
.badge.v-x { background: #f1f3f7; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; letter-spacing: -.01em; }
.pre { white-space: pre-wrap; word-break: break-word; }
.small { font-size: .85rem; }
.late { color: var(--danger); font-weight: 700; }
.head-actions { align-items: center; }
.back { margin-bottom: 14px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: .75rem; font-weight: 800; }
button.link { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.danger, button.link.danger { color: var(--danger); }
.btn.danger { color: var(--danger); }
.modal.modal-wide { width: min(760px, 100%); }
.card-soft { background: var(--bg); border-radius: 14px; padding: 14px 14px 0; margin-bottom: 16px; }
.notice { background: var(--primary-soft); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-size: .92rem; }
.notice-warn { background: #fff7ed; color: #9a3412; }
/* Abas */
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 3px solid transparent; margin-bottom: -1.5px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
/* Listas em cartões */
.list { list-style: none; margin: 0; padding: 0; }
.list.card { padding: 6px 18px; }
.list li { border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.link-row, .row-line { display: flex; justify-content: space-between; gap: 12px; align-items: center; width: 100%; padding: 11px 0; text-align: left; }
.link-row { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.link-row:hover b { color: var(--primary); }
.link-row small, .row-line small { display: block; color: var(--muted); font-size: .8rem; }
.link-row .right, .row-line .right { text-align: right; font-size: .85rem; white-space: nowrap; flex: 0 0 auto; }
/* Início */
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.home-grid .card { padding: 20px 22px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-head h2 { font-size: 1.1rem; margin: 0; }
h3.sub { font-size: .9rem; color: var(--muted); margin: 14px 0 0; }
.stat-btn { font: inherit; text-align: left; cursor: pointer; color: inherit; }
.stat-btn:hover { border-color: var(--primary); }
.stat-danger { border-color: #fecdd3; background: #fff1f2; }
.stat-danger .v { color: var(--danger); }
.stat-warn { border-color: #fde68a; background: #fffbeb; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.kv dt { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
/* Prazos */
.due { font-size: .78rem; color: var(--muted); font-weight: 600; }
.due-soon { color: #b45309; }
.due-today { color: #fff; background: #d97706; padding: 1px 8px; border-radius: 999px; }
.due-late { color: #fff; background: var(--danger); padding: 1px 8px; border-radius: 999px; }
tr.row-late td { background: #fff5f6; }
.alert-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.alert-strip span { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: .88rem; }
.alert-strip .a-late { background: #fff1f2; border-color: #fecdd3; color: var(--danger); }
.alert-strip .a-today { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.calc-box { background: var(--bg); border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--border)); border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; font-size: .88rem; }
.calc-box ul { margin: 6px 0 0; padding-left: 18px; }
.calc-due { font-size: 1.05rem; color: var(--primary-dark); }
.prio-urgente { color: #fff; background: var(--danger); border-radius: 6px; padding: 0 6px; font-size: .72rem; }
.prio-alta { color: #9a3412; background: #ffedd5; border-radius: 6px; padding: 0 6px; font-size: .72rem; }
/* Histórico */
.timeline .vis { color: var(--success); }
.ev-actions { font-size: .8rem; }
/* Publicações */
.pub { padding: 16px 18px; margin-bottom: 12px; }
.pub-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.pub-head small { display: block; }
.pub-text { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; max-height: 220px; overflow: auto; }
/* Quadro da equipe */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.board-col h3 { font-size: .95rem; display: flex; gap: 6px; align-items: center; }
/* Agenda semanal */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px; min-height: 140px; display: flex; flex-direction: column; gap: 6px; }
.day.today { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.day h3 { font-size: .85rem; text-transform: capitalize; margin: 0 0 4px; display: flex; justify-content: space-between; }
.day h3 span { color: var(--muted); font-weight: 600; }
.ev { border: 0; text-align: left; font: inherit; font-size: .78rem; border-radius: 10px; padding: 6px 8px; cursor: pointer; background: var(--primary-soft); color: var(--text); display: grid; gap: 1px; border-left: 3px solid var(--primary); }
.ev b { font-size: .72rem; }
.ev small { color: var(--muted); }
.ev-prazo { background: #fff7ed; border-left-color: #d97706; }
.ev-reuniao { background: #eef2ff; border-left-color: #6366f1; }
.ev-pericia { background: #ecfeff; border-left-color: #0891b2; }
@media (max-width: 1000px) { .week { grid-template-columns: minmax(0, 1fr); } .day { min-height: 0; } .home-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr 1fr; } .link-row .right { white-space: normal; } .board { grid-template-columns: repeat(4, 240px); } }
.board-col .link-row { flex-direction: column; align-items: flex-start; gap: 4px; } .board-col .link-row .right { text-align: left; } .board-col .link-row .badge { display: none; }
