/* =========================================================
   Oficina do Celular · Painel
   Folha de estilos única. Organização:
   1. Tokens (cores, medidas)      6. Lista de OS
   2. Base e formulários           7. Modais e formulário em etapas
   3. Botões                       8. Pesquisa de aparelho
   4. Login                        9. Avisos, carregamento, impressão
   5. Estrutura do painel         10. Celular
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #0b1210;
  --surface: #121b18;
  --surface-2: #17221e;
  --surface-3: #1d2a25;
  --line: #243530;
  --line-strong: #33483f;
  --text: #edf5f0;
  --text-2: #b9cbc1;
  --muted: #86a093;
  --accent: #7ee2a8;
  --accent-strong: #4fcf8a;
  --accent-ink: #062a18;
  --accent-soft: #7ee2a81f;

  --st-analise: #7dd3fc;
  --st-orcamento: #fbbf24;
  --st-reparo: #c4a1ff;
  --st-pronto: #6ee7a0;
  --info: #8fd8ff;
  --ok: #86efac;
  --warn: #fcd34d;
  --danger: #fca5a5;
  --danger-strong: #ef4444;
  --whatsapp: #25d366;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 0 #ffffff08 inset, 0 8px 24px #00000040;
  --shadow-lg: 0 24px 64px #000000a0;
  --sidebar: 248px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- 2. Base e formulários ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; min-height: 100vh; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.2; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ui-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

label { display: block; margin: 14px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: #0e1613; color: var(--text);
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #6d8479; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386a093' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input[type="file"] { padding: 9px; font-size: 13px; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-3); color: var(--text); font-weight: 600; cursor: pointer; }
input[type="month"], input[type="date"] { color-scheme: dark; }
textarea { resize: vertical; min-height: 64px; }
input.is-invalid, select.is-invalid { border-color: var(--danger-strong); box-shadow: 0 0 0 3px #ef444426; }

.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 0; }
.form-hint:empty { display: none; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 8px; }
.error-text:empty { display: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 3. Botões ---------- */
button { cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .55; cursor: progress; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .1s, filter .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-secondary { background: var(--surface-3); border-color: var(--line-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #3a1d1d; border-color: #6b2f2f; color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: #4a2222; }
.btn-whatsapp { background: var(--whatsapp); color: #052e16; }
.btn-block { width: 100%; margin-top: 16px; min-height: 44px; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; margin-top: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- 4. Login ---------- */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(900px 500px at 80% -10%, #173a2a 0, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 32px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); }
.login-title { font-size: 26px; margin: 28px 0 6px; }
.login-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }
.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.password-field button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; }
.password-field button:hover { color: var(--text); }
.login-footnote { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.login-footnote .ui-icon { width: 15px; height: 15px; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-glyph { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(150deg, #a7f3c7, #4fcf8a); color: var(--accent-ink); box-shadow: inset 0 1px #ffffff80; }
.brand-glyph .ui-icon { width: 21px; height: 21px; stroke-width: 2; }
.brand-glyph.small { width: 34px; height: 34px; border-radius: 9px; }
.brand-glyph.small .ui-icon { width: 18px; height: 18px; }

/* ---------- 5. Estrutura do painel ---------- */
.app { display: grid !important; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.app[style*="display: none"] { display: none !important; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar .brand { padding: 0 6px; }
.sidebar-cta { margin-top: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-caption { margin: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6d8479; }
.side-nav button, .side-logout { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; font-weight: 600; text-align: left; transition: background .15s, color .15s; }
.side-nav button:hover, .side-logout:hover { background: var(--surface-2); color: var(--text); }
.side-nav button.active { background: var(--accent-soft); color: var(--accent); }
.side-nav .ui-icon, .side-logout .ui-icon { width: 18px; height: 18px; }
.side-logout { margin-top: auto; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 18px 32px; background: #0b1210e6; backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-brand { display: none; }
.topbar-title { flex: 1; min-width: 0; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 600; }
.topbar h1 { font-size: 22px; }
.topbar-actions { display: flex; gap: 8px; }
.show-mobile { display: none !important; }

.content { max-width: 1180px; padding: 24px 32px 64px; }
.section { margin-bottom: 36px; scroll-margin-top: 90px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 17px; }
.section-note { font-size: 12.5px; color: var(--muted); }

/* Atenção hoje */
.attention-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.attention-card { --tone: var(--accent); position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center; padding: 16px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .15s, background .15s; }
.attention-card:hover { border-color: color-mix(in srgb, var(--tone) 55%, var(--line)); background: var(--surface-2); }
.attention-card[data-tone="ready"] { --tone: var(--st-pronto); }
.attention-card[data-tone="quote"] { --tone: var(--st-orcamento); }
.attention-card[data-tone="money"] { --tone: var(--info); }
.attention-card[data-tone="today"] { --tone: var(--st-reparo); }
.att-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 30%, transparent); }
.att-value { font-size: 24px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.att-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.att-hint { grid-column: 1 / -1; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention-card.has-alert .att-hint { color: var(--tone); }

/* Barra de busca e filtros */
.toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field .ui-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 38px; height: 42px; }
.toolbar-filters { display: flex; gap: 8px; }
.toolbar-filters select { width: 200px; height: 42px; }
.toolbar-filters input { width: 170px; height: 42px; }
.toolbar-filters .btn { height: 42px; }

/* Abas de etapa */
.status-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; transition: all .15s; }
.status-tab b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
.status-tab:hover { border-color: var(--line-strong); color: var(--text); }
.status-tab.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.status-tab.active b { background: #0b121022; color: var(--bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot[data-s="analise"] { background: var(--st-analise); }
.dot[data-s="orcamento"] { background: var(--st-orcamento); }
.dot[data-s="reparo"] { background: var(--st-reparo); }
.dot[data-s="pronto"] { background: var(--st-pronto); }

/* Financeiro e números */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 4px; }
.stat-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.stat-card.wide { grid-column: 1 / -1; }
.stat-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-label .ui-icon { width: 16px; height: 16px; }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-value[data-tone="info"] { color: var(--info); }
.stat-value[data-tone="ok"] { color: var(--ok); }
.stat-value[data-tone="danger"] { color: var(--danger); }
.stat-value[data-tone="warn"] { color: var(--warn); }
#reportModal .stat-grid { grid-template-columns: 1fr 1fr; }

/* ---------- 6. Lista de OS ---------- */
.os-table-head, .os-summary { display: grid; grid-template-columns: 112px minmax(0, 1.3fr) minmax(0, 1.4fr) 132px 120px 28px; gap: 14px; align-items: center; }
.os-table-head { padding: 0 16px 8px; font-size: 11.5px; font-weight: 700; color: #6d8479; text-transform: uppercase; letter-spacing: .05em; }
.right { text-align: right; justify-self: end; }
.os-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.os-list:has(> .empty-state) { background: none; border: 0; }
.os-row { --st: var(--muted); border-bottom: 1px solid var(--line); }
.os-row:last-child { border-bottom: 0; }
.os-row[data-status="Em análise"] { --st: var(--st-analise); }
.os-row[data-status="Em orçamento"] { --st: var(--st-orcamento); }
.os-row[data-status="Em reparo"] { --st: var(--st-reparo); }
.os-row[data-status="Pronto"] { --st: var(--st-pronto); }
.os-summary { position: relative; padding: 13px 16px; cursor: pointer; list-style: none; transition: background .12s; }
.os-summary::-webkit-details-marker { display: none; }
.os-summary::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--st); }
.os-summary:hover { background: var(--surface-2); }
.os-row[open] > .os-summary { background: var(--surface-2); }
.os-code { font-size: 12.5px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.os-date { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.os-main { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-sub { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--st); background: color-mix(in srgb, var(--st) 12%, transparent); white-space: nowrap; }
.status-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.os-value { display: block; font-weight: 800; font-variant-numeric: tabular-nums; }
.payment-badge { display: inline-block; font-size: 11.5px; font-weight: 700; }
.payment-paid { color: var(--ok); }
.payment-pending { color: #fdba74; }
.payment-partial { color: var(--info); }
.os-chev { color: var(--muted); transition: transform .2s; justify-self: end; }
.os-row[open] .os-chev { transform: rotate(180deg); }

.os-expand { padding: 4px 16px 18px 16px; background: var(--surface-2); }
.os-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 24px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.os-detail-grid .full { grid-column: 1 / -1; }
.os-detail-grid dt { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.os-detail-grid dd { font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.os-status-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; flex-wrap: wrap; }
.os-status-line label { margin: 0; }
.status-select { width: auto; min-width: 170px; height: 38px; padding-top: 0; padding-bottom: 0; font-weight: 700; color: var(--st); border-color: color-mix(in srgb, var(--st) 45%, var(--line-strong)); }
.os-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.os-actions .btn { min-height: 38px; padding: 0 12px; font-size: 13px; }
.os-actions .btn-wa { border-color: #1f6b44; color: #b7f7cf; background: #123424; }
.os-actions .btn-wa:hover { background: #164430; }
.os-actions .spacer { flex: 1; }
.preview-container { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; }
.preview-thumb { width: 64px; height: 64px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--line-strong); }

.empty-state { text-align: center; padding: 44px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-2); }
.empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; margin-bottom: 12px; color: var(--accent); background: var(--accent-soft); }
.empty-icon .ui-icon { width: 22px; height: 22px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 13px; color: var(--muted); }
.empty-action { margin-top: 16px; min-height: 40px; padding: 0 16px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* ---------- 7. Modais ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: #030806c7; backdrop-filter: blur(4px); animation: fade .15s ease; }
.modal-card { width: 100%; max-width: 640px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 22px 24px 24px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal-os { max-width: 720px; padding-bottom: 0; }
.sheet-sm { max-width: 420px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal-header h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.modal-subtitle { margin: 22px 0 10px; font-size: 14px; color: var(--text-2); }
.btn-close { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 20px; line-height: 1; }
.btn-close:hover { background: var(--surface-2); color: var(--text); }
.panel { margin-top: 14px; padding: 4px 16px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.panel-title { margin-top: 12px; font-size: 13.5px; font-weight: 700; }
.panel .btn-block { margin-top: 14px; }
.row-list { display: flex; flex-direction: column; gap: 6px; }
.row-list:empty::after { content: 'Nada por aqui ainda.'; color: var(--muted); font-size: 13px; }
.stock-item, .service-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.stock-item strong { color: var(--text); }
.stock-item small { color: var(--muted); }
.stock-low { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: var(--danger); background: #ef44441a; white-space: nowrap; }
.stock-low .ui-icon { width: 14px; height: 14px; }
.service-row span { flex: 1; }
.service-row button { min-height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 700; color: var(--text-2); }
.service-row button:hover { color: var(--text); background: var(--surface-3); }
#serviceSummary:not(:has(*)) { color: var(--muted); font-size: 13px; }

.menu-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.menu-list button { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: var(--r); font-size: 15px; font-weight: 600; text-align: left; }
.menu-list button:hover { background: var(--surface-2); }
.menu-list .menu-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); color: var(--accent); }
.menu-list .chev { margin-left: auto; color: var(--muted); }
.menu-list .danger { color: var(--danger); }
.menu-list .danger .menu-icon { color: var(--danger); background: #ef44441a; }

/* Formulário de OS em etapas */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; list-style: none; margin: 14px 0 4px; }
.stepper button { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 8px 0 0; border-top: 3px solid var(--line-strong); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
.stepper b { display: none; }
.stepper .done button { border-color: var(--accent-strong); color: var(--text-2); }
.stepper .current button { border-color: var(--accent); color: var(--text); }
.stepper .has-error button { border-color: var(--danger-strong); color: var(--danger); }
.form-step { border: 0; min-width: 0; }
.form-step[hidden] { display: none; }
@media (min-width: 761px) { .modal-os .form-step { min-height: 360px; } }
.form-step legend { font-size: 15px; font-weight: 700; padding-top: 14px; }
.checklist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checklist-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.checklist-item select { width: 128px; height: 34px; padding-top: 0; padding-bottom: 0; font-size: 12.5px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.choice-item { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.choice-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.choice-item input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent-strong); }
canvas#signatureCanvas { display: block; width: 100%; height: 150px; background: #fff; border-radius: var(--r-sm); touch-action: none; }
.legal-disclaimer { margin-top: 14px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.form-save-bar { position: sticky; bottom: 0; z-index: 3; margin: 20px -24px 0; padding: 12px 24px 16px; background: var(--surface); border-top: 1px solid var(--line); }
.form-actions { display: flex; gap: 8px; }
.form-actions #btnSaveOS { margin-left: auto; min-width: 140px; }
.form-actions #osPrev[hidden], .form-actions #osNext[hidden] { display: none; }

.discard-card { width: min(92vw, 420px); padding: 26px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); }
.discard-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 12px; color: var(--warn); background: #fbbf241a; }
.discard-card h3 { font-size: 18px; margin-bottom: 6px; }
.discard-card p { color: var(--muted); font-size: 13.5px; }
.discard-actions { display: grid; gap: 8px; margin-top: 22px; }

/* ---------- 8. Pesquisa de aparelho ---------- */
.device-search-overlay { position: fixed; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center; padding: 20px; background: #030806c7; backdrop-filter: blur(4px); }
.device-search-card { width: 100%; max-width: 720px; max-height: calc(100vh - 40px); overflow: auto; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow-lg); }
.device-search-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.device-search-head > div { flex: 1; min-width: 0; }
.device-search-head h3 { font-size: 18px; }
.device-search-sub { font-size: 12.5px; color: var(--muted); }
.device-search-head .btn-close .ui-icon { width: 18px; height: 18px; }
.device-search-row { display: grid; grid-template-columns: 170px 1fr; gap: 8px; }
.device-result { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.device-result:hover { border-color: var(--line-strong); }
.device-result > div { flex: 1; min-width: 0; }
.device-result strong { display: block; font-size: 14px; }
.device-result small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.device-result button { flex: none; min-height: 36px; padding: 0 14px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; }
.device-empty { margin-top: 10px; padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.device-empty .oc-tile { display: grid; margin: 0 auto 10px; width: 48px; height: 48px; }
.device-search-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.device-search-tools button, .device-search-tools a { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.device-search-tools button:hover, .device-search-tools a:hover { color: var(--text); border-color: var(--accent); }
.device-search-tools .ui-icon { width: 15px; height: 15px; }
.device-search-note { margin-top: 14px; font-size: 12px; color: var(--muted); }
.oc-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 1px 6px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); color: var(--accent); font-size: 11.5px; }
.oc-tile { --tc: var(--accent); display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 32%, transparent); }
.oc-tile .ui-icon { width: 20px; height: 20px; }
.device-search-head .oc-tile { width: 46px; height: 46px; border-radius: 13px; }
.device-search-head .oc-tile .ui-icon { width: 23px; height: 23px; }
.dm-suggest { margin-top: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.dm-suggest button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.dm-suggest button:last-child { border-bottom: 0; }
.dm-suggest button:hover { background: var(--surface-3); }
.dm-suggest small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.dm-suggest .oc-tile { width: 32px; height: 32px; border-radius: 9px; }
.dm-suggest .oc-tile .ui-icon { width: 16px; height: 16px; }
.dm-note { padding: 10px 12px; font-size: 12.5px; color: var(--text-2); }
.dm-note a, #deviceSearchStatus a { color: var(--accent); }
.dm-imei { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ---------- 9. Avisos, carregamento, impressão ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 2000; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--r); background: #173526; border: 1px solid #2f6b4a; color: #dcfce7; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .2s ease; }
.toast.error { background: #3a1d1d; border-color: #7f3434; color: #fee2e2; }
.toast .ui-icon { width: 18px; height: 18px; }
.update-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 2100; display: flex; align-items: center; gap: 12px; justify-content: space-between; max-width: 620px; margin: 0 auto; padding: 12px 14px; border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--line-strong); font-size: 13px; }
.update-notice[hidden] { display: none; }
.update-notice button { flex: none; min-height: 34px; padding: 0 12px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.skeleton { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.os-row.is-skeleton .os-summary { cursor: default; }
.os-row.is-skeleton .skeleton { height: 12px; }
.os-row.is-skeleton .skeleton + .skeleton { margin-top: 6px; height: 10px; width: 60%; }
.attention-card.is-loading .att-value, .stat-value:empty { color: transparent; }
.attention-card.is-loading .att-value { width: 48px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 0, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.toast { animation-name: toastIn; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

#printSection { display: none; }
@media print {
  body { background: #fff !important; }
  body * { visibility: hidden; }
  #printSection, #printSection * { visibility: visible; }
  #printSection { display: block !important; position: absolute; left: 0; top: 0; width: 100%; color: #000; background: #fff; padding: 5px; }
}

/* ---------- 10. Telas menores e celular ---------- */
@media (max-width: 1180px) {
  .os-table-head, .os-summary { grid-template-columns: 100px minmax(0, 1.2fr) minmax(0, 1.2fr) 124px 108px 24px; gap: 12px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar-filters { flex: 1 1 100%; }
  .toolbar-filters select, .toolbar-filters input { flex: 1; width: auto; min-width: 0; }
}
@media (max-width: 1024px) {
  :root { --sidebar: 76px; }
  .sidebar { padding: 18px 10px; align-items: center; }
  .sidebar .brand div, .nav-caption, .sidebar-cta { display: none; }
  .side-nav button, .side-logout { justify-content: center; width: 48px; height: 44px; padding: 0; font-size: 0; gap: 0; }
  .side-nav button .ui-icon, .side-logout .ui-icon { width: 20px; height: 20px; }
  .attention-grid, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .os-detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: inline-grid !important; }
  .topbar { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); gap: 12px; }
  .topbar-brand { display: block; }
  .topbar h1 { font-size: 18px; }
  .eyebrow { font-size: 11.5px; }
  .content { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .section { margin-bottom: 28px; scroll-margin-top: 76px; }
  .section-head { margin-bottom: 10px; }
  .section-head .section-note { display: none; }
  #resultsCount { display: block; }

  .attention-grid { gap: 10px; }
  .attention-card { grid-template-columns: 1fr; padding: 13px; }
  .att-icon { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; }
  .att-icon .ui-icon { width: 16px; height: 16px; }
  .att-value { font-size: 20px; padding-right: 34px; }
  .attention-card[data-tone="money"] .att-value { font-size: 17px; padding-right: 0; margin-top: 12px; }
  .att-label { font-size: 11.5px; line-height: 1.25; }
  .att-hint { font-size: 11.5px; margin-top: 8px; padding-top: 8px; }

  .toolbar-filters { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
  .toolbar-filters .btn { padding: 0 12px; }

  .os-table-head { display: none; }
  .os-summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "client value" "device status"; gap: 4px 12px; padding: 13px 14px 13px 16px; }
  .os-summary > .c-code { display: none; }
  .os-summary > .c-client { grid-area: client; }
  .os-summary > .c-device { grid-area: device; }
  .os-summary > .c-status { grid-area: status; justify-self: end; }
  .os-summary > .c-value { grid-area: value; }
  .os-summary > .os-chev { display: none; }
  .os-summary .os-sub .code-inline { display: inline; }
  .os-expand { padding: 4px 12px 14px; }
  .os-detail-grid { grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 12px; }
  .os-actions .btn { flex: 1 1 calc(50% - 4px); }
  .os-actions .spacer { display: none; }
  .status-select { flex: 1; }

  .stat-value { font-size: 18px; }
  .stat-card { padding: 13px; }

  .modal-overlay, .device-search-overlay { align-items: flex-end; padding: 0; }
  .modal-card, .device-search-card { max-width: none; max-height: 94vh; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-bottom: 0; }
  .modal-os { padding-bottom: 0; }
  .form-save-bar { margin: 16px -16px 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .form-actions #btnSaveOS { min-width: 0; flex: 1; }
  .stepper span { font-size: 11px; }
  .checklist-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .device-search-row { grid-template-columns: 1fr; gap: 0; }
  .device-search-row select { margin-bottom: 8px; }
  .device-result { flex-wrap: wrap; }
  .device-result > div { flex-basis: calc(100% - 56px); }
  .device-result button { width: 100%; }
  #reportModal .stat-grid, .stat-grid.three { grid-template-columns: 1fr 1fr; }
  .stat-grid.three .stat-card:first-child { grid-column: 1 / -1; }

  .app .bottom-nav { display: grid; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .update-notice { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
.bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; grid-template-columns: repeat(5, 1fr); align-items: end; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: #0f1714f2; backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.bottom-nav button .ui-icon { width: 22px; height: 22px; }
.bottom-nav button.active { color: var(--accent); }
.bottom-nav .bottom-cta span { display: grid; place-items: center; width: 50px; height: 50px; margin-top: -18px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px #4fcf8a40, 0 0 0 4px var(--bg); }
.bottom-nav .bottom-cta .ui-icon { width: 24px; height: 24px; stroke-width: 2.2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
.photo-hint { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface-2); }
.photo-hint strong { color: var(--text); }
.stock-item small { display: block; margin-top: 2px; }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); cursor: pointer; }

/* ---------- 11. Linha do tempo, relatórios e clientes ---------- */
.modal-wide { max-width: 860px; }
.timeline { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 4px; }
.tl-item { --st: var(--accent); position: relative; display: flex; flex-direction: column; min-width: 130px; padding: 20px 16px 0 0; }
.tl-item[data-s="Em análise"] { --st: var(--st-analise); }
.tl-item[data-s="Em orçamento"] { --st: var(--st-orcamento); }
.tl-item[data-s="Em reparo"] { --st: var(--st-reparo); }
.tl-item[data-s="Pronto"] { --st: var(--st-pronto); }
.tl-item::after { content: ''; position: absolute; left: 18px; right: 6px; top: 5px; height: 1px; background: var(--line-strong); }
.tl-item:last-child::after { display: none; }
.tl-dot { position: absolute; left: 0; top: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--st); background: var(--surface); z-index: 1; }
.tl-item.done .tl-dot { background: var(--st); }
.tl-item b { font-size: 12.5px; }
.tl-item small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.report-toolbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.report-month { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.report-month strong { font-size: 16px; }
.report-month input { width: 170px; height: 40px; }
.report-stats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-top: 6px; }
#reportModal .report-stats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.report-stats .stat-value { font-size: 20px; }
.delta { font-size: 11.5px; color: var(--muted); }
.delta i { font-style: normal; font-weight: 700; }
.delta i.up { color: var(--ok); }
.delta i.down { color: var(--danger); }

.bar-chart { margin-top: 14px; }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; height: 200px; border-bottom: 1px solid var(--line-strong); }
.bar-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; padding: 0 2px; cursor: pointer; }
.bar-track { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: calc(100% - 26px); }
.bar { display: block; width: 24px; max-width: 70%; min-height: 0; border-radius: 4px 4px 0 0; background: #3d5a4b; transition: background .15s; }
.bar-col:hover .bar, .bar-col:focus-visible .bar { background: #4f7361; }
.bar-col.is-selected .bar { background: #34a86d; }
.bar-value { position: absolute; top: 0; font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-label { position: absolute; bottom: -24px; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.bar-col.is-selected .bar-label { color: var(--text); font-weight: 700; }
.bar-tip { display: none; position: absolute; bottom: calc(100% - 20px); left: 50%; transform: translateX(-50%); z-index: 2; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); font-size: 12px; color: var(--text-2); white-space: nowrap; pointer-events: none; }
.bar-tip b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.bar-col:hover .bar-tip, .bar-col:focus-visible .bar-tip { display: flex; }
.bar-col.is-selected:hover .bar-tip { display: none; }
#reportChart { padding-bottom: 26px; }

.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rank-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 28px; gap: 10px; align-items: center; font-size: 13px; }
.rank-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 3px; background: #34a86d; }
.rank-list b { text-align: right; font-variant-numeric: tabular-nums; }
.rank-list .rank-empty { display: block; color: var(--muted); }

.client-search { margin: 12px 0; }
.client-search input { height: 42px; }
.client-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.client-list:has(> .empty-state) { border: 0; }
.client-row { border-bottom: 1px solid var(--line); }
.client-row:last-child { border-bottom: 0; }
.client-summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.client-summary::-webkit-details-marker { display: none; }
.client-summary:hover, .client-row[open] > .client-summary { background: var(--surface-2); }
.avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 800; }
.client-main, .client-side { display: flex; flex-direction: column; min-width: 0; }
.client-main { flex: 1; }
.client-main b, .client-side b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-main small, .client-side small { font-size: 12px; color: var(--muted); }
.client-side { align-items: flex-end; text-align: right; }
.client-side b { font-variant-numeric: tabular-nums; }
.client-body { padding: 4px 14px 16px; background: var(--surface-2); }
.client-os-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.client-os { --st: var(--muted); display: grid; grid-template-columns: 76px minmax(0, 1fr) auto 100px; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 13px; }
.client-os[data-status="Em análise"] { --st: var(--st-analise); }
.client-os[data-status="Em orçamento"] { --st: var(--st-orcamento); }
.client-os[data-status="Em reparo"] { --st: var(--st-reparo); }
.client-os[data-status="Pronto"] { --st: var(--st-pronto); }
.client-os-main { display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.client-os-main small { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-os .os-value { text-align: right; }

@media (max-width: 760px) {
  .report-month input { width: 150px; }
  .report-stats, #reportModal .report-stats { grid-template-columns: 1fr 1fr; }
  .report-cols { grid-template-columns: 1fr; }
  .bars { height: 170px; }
  .bar { width: 20px; }
  .client-os { grid-template-columns: minmax(0, 1fr) auto; }
  .client-os .os-code { display: none; }
  .client-os .status-chip { grid-row: 2; grid-column: 1; justify-self: start; }
  .client-os .os-value { grid-row: 1; grid-column: 2; }
  .timeline { flex-direction: column; gap: 10px; }
  .tl-item { padding: 0 0 0 22px; }
  .tl-dot { top: 2px; }
  .tl-item::after { left: 5px; right: auto; top: 16px; bottom: -12px; width: 1px; height: auto; }
}

/* =========================================================
   12. Bancada Pro Online · telas próprias no visual da Oficina
   (login por e-mail, listas, estoque, FRP, financeiro, agente IA,
   backup, assinatura e formulários em janela)
   ========================================================= */
[hidden] { display: none !important; }
.app[hidden] { display: none !important; }
a { color: var(--accent); }

/* Login */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(900px 500px at 80% -10%, #173a2a 0, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; padding: 32px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 26px; margin: 28px 0 6px; }
.auth-card > p { color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }
.auth-card form button[type="submit"] { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin-top: 16px; border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.auth-card form button[type="submit"]:hover { filter: brightness(1.06); }
.auth-card .link { display: block; width: 100%; margin-top: 14px; color: var(--accent); font-size: 13px; font-weight: 600; text-align: center; }
.auth-card .link:hover { text-decoration: underline; }
#register label input { margin-top: 6px; font-weight: 400; }

/* Rodapé da barra lateral: conta e idioma */
.side-account { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 12px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.side-account + .side-logout { margin-top: 0; }
.side-account .account-line { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; color: var(--text-2); }
.side-account .account-line span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#tenant { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.language-picker { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--muted); }
.language-picker .ui-icon { width: 16px; height: 16px; }
.language-picker select { height: 34px; padding: 0 30px 0 10px; font-size: 12.5px; background-position: right 8px center; }
.language-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Cartões e botões genéricos das telas do Bancada */
.content .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.content .card > h2 { font-size: 18px; margin-bottom: 8px; }
.content .card > p { color: var(--text-2); margin-bottom: 10px; }
.content .card > p strong { color: var(--text); }
.content button:not([class]), #content #new, .form-actions button:not(.secondary):not(.danger), .agent-form button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: var(--r-sm); background: var(--accent); color: var(--accent-ink); font-size: 13.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.content button:not([class]):hover, #content #new:hover, .form-actions button:not(.secondary):not(.danger):hover, .agent-form button:hover { filter: brightness(1.06); }
.content .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-3); color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap; }
.content .secondary:hover { border-color: var(--accent); }
.content .danger { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid #6b2f2f; background: #3a1d1d; color: #fecaca; font-size: 13px; font-weight: 700; white-space: nowrap; }
.content .danger:hover { background: #4a2222; }
.content .btn-ghost { min-height: 42px; }
.form-actions { flex-wrap: wrap; margin-top: 16px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
p.empty-state { padding: 28px 16px; font-size: 13px; color: var(--muted); }
.eyebrow { display: block; text-transform: none; }
.content .eyebrow, .banner-kicker, .level-kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--accent); text-transform: uppercase; }

/* Toolbar das listas (busca + novo) */
.content > .toolbar > #search { flex: 1; min-width: 0; height: 42px; padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386a093' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }
.content > .toolbar > #new { flex: none; }

/* Listas genéricas (clientes) */
#list.card { padding: 0; overflow: hidden; }
#list .row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
#list .row:last-child { border-bottom: 0; }
#list .row:hover { background: var(--surface-2); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-body b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-body small { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.actions, .order-actions, .inventory-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.actions .secondary, .actions .danger, .order-actions .secondary, .order-actions .danger, .inventory-actions .secondary, .inventory-actions .danger { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
.device-thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line-strong); background: #fff; }
.icon-tile { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; color: var(--accent); background: var(--accent-soft); border: 1px solid #7ee2a833; }
.icon-tile svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }

/* Ordens de serviço */
#list .order-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "pic body status" "pic acts acts"; gap: 8px 14px; align-items: center; }
.order-row > .device-thumb, .order-row > .order-device-icon { grid-area: pic; align-self: start; }
.order-device-icon .icon-tile { width: 52px; height: 52px; border-radius: 13px; }
.order-row > .row-body { grid-area: body; }
.order-row > .order-status { grid-area: status; }
.order-row > .order-actions { grid-area: acts; justify-content: flex-start; }
.order-status { --st: var(--st-analise); display: inline-flex; align-items: center; gap: 7px; justify-self: end; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--st); background: color-mix(in srgb, var(--st) 12%, transparent); white-space: nowrap; }
.order-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.order-status[data-s="orcamento"] { --st: var(--st-orcamento); }
.order-status[data-s="reparo"] { --st: var(--st-reparo); }
.order-status[data-s="pronto"] { --st: var(--st-pronto); }
.order-status[data-s="entregue"] { --st: var(--muted); }
.action-button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.action-button:hover { color: var(--text); border-color: var(--accent); }
.action-button[data-budget] { border-color: #1f6b44; color: #b7f7cf; background: #123424; }
.action-button[data-budget]:hover { background: #164430; }
.action-icon { display: inline-grid; place-items: center; }
.action-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Status nas linhas da tela inicial */
.os-row[data-office-status-row="Em análise"] { --st: var(--st-analise); }
.os-row[data-office-status-row="Em orçamento"] { --st: var(--st-orcamento); }
.os-row[data-office-status-row="Em reparo"] { --st: var(--st-reparo); }
.os-row[data-office-status-row="Pronto"] { --st: var(--st-pronto); }
.os-code b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.os-code small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.os-main small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Faixas de abertura (estoque, FRP, relatórios, financeiro) */
.inventory-banner, .frp-page-banner, .report-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: radial-gradient(600px 220px at 100% 0, #173a2a 0, transparent 70%), var(--surface); }
.inventory-banner h2, .frp-page-banner h2, .report-hero h2 { font-size: 20px; margin: 6px 0 4px; }
.inventory-banner p, .frp-page-banner p, .report-hero p { color: var(--text-2); font-size: 13.5px; max-width: 640px; }
.inventory-banner .icon-tile, .frp-page-banner .icon-tile, .report-hero .icon-tile { width: 52px; height: 52px; border-radius: 14px; }
.inventory-banner .icon-tile svg, .frp-page-banner .icon-tile svg, .report-hero .icon-tile svg { width: 24px; height: 24px; }

/* Estoque */
#list:has(.inventory-summary) { background: none; border: 0; overflow: visible; }
.inventory-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.inventory-stat { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.inventory-stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.inventory-stat strong { font-size: 20px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.inventory-stat.is-low strong { color: var(--danger); }
.inventory-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.inventory-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.inventory-row:last-child { border-bottom: 0; }
.inventory-row:hover { background: var(--surface-2); }
.inventory-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inventory-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inventory-category { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.inventory-copy b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventory-copy small { font-size: 12.5px; color: var(--muted); }
.inventory-balance { display: grid; grid-template-columns: auto auto; justify-content: start; align-items: baseline; gap: 2px 8px; }
.inventory-balance > span:first-child { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.inventory-balance strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.inventory-balance small { font-size: 12px; color: var(--muted); }
.stock-badge { grid-column: 1 / -1; justify-self: start; margin-top: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.stock-badge.is-low { color: var(--danger); background: #ef44441a; }
.stock-badge.is-ok { color: var(--ok); background: #86efac1a; }
.inventory-adjust { width: 34px; padding: 0 !important; font-size: 18px !important; }
.inventory-form-intro { margin: 6px 0 4px; }
.inventory-form-intro p { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* FRP */
.frp-reference-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.frp-reference-card p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.frp-reference-links { display: flex; flex-wrap: wrap; gap: 8px; }
.frp-reference-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); color: var(--text-2); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.frp-reference-links a:hover { color: var(--text); border-color: var(--accent); }
.frp-reference-card small { color: var(--muted); font-size: 12px; }
.level-tag { --lv: var(--muted); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--lv); background: color-mix(in srgb, var(--lv) 13%, transparent); white-space: nowrap; }
.level-easy { --lv: var(--ok); }
.level-medium { --lv: var(--warn); }
.level-hard { --lv: #fdba74; }
.level-very-hard { --lv: var(--danger); }
.frp-form-intro, .privacy-note { color: var(--muted); font-size: 12.5px; margin: 6px 0 4px; }
.frp-level-card { margin-top: 14px; padding: 14px 16px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--lv) 40%, var(--line)); background: color-mix(in srgb, var(--lv) 8%, var(--surface-2)); }
.frp-level-card .level-kicker { color: var(--lv); }
.frp-level-card h3 { font-size: 17px; margin: 4px 0; color: var(--lv); }
.frp-level-card p { font-size: 13px; color: var(--text-2); }

/* Financeiro e relatórios */
.report-page { display: flex; flex-direction: column; gap: 14px; }
.report-page > .report-hero { margin-bottom: 0; }
.report-page .report-stats { margin-top: 0; }
.stat-card small { font-size: 12px; color: var(--muted); }
.stat-label svg { width: 16px; height: 16px; }
.report-panel { min-width: 0; }
.report-panel .section-head { margin-bottom: 4px; }
.report-subtitle { color: var(--muted); font-size: 12.5px; }
.report-toolbar { margin-top: 0; }
.report-toolbar .secondary { width: 42px; height: 42px; padding: 0; font-size: 20px; }
.finance-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0 12px; font-size: 13px; color: var(--text-2); }
.finance-summary span { display: inline-flex; align-items: center; gap: 7px; }
.finance-summary b { color: var(--text); font-variant-numeric: tabular-nums; }
.finance-summary.vertical { flex-direction: column; gap: 0; }
.finance-summary.vertical span { justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.finance-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.finance-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.finance-row:last-child { border-bottom: 0; }
.finance-row-main { display: flex; flex-direction: column; min-width: 0; }
.finance-row-main b { font-size: 13px; }
.finance-row-main small, .finance-row-value small { font-size: 11.5px; color: var(--muted); }
.finance-row-value { display: grid; justify-items: end; gap: 2px; text-align: right; }
.finance-row-value strong { font-variant-numeric: tabular-nums; }
.payment-chip { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-3); }
.payment-chip.pago { color: var(--ok); background: #86efac1a; }
.payment-chip.parcial { color: var(--info); background: #8fd8ff1a; }
.payment-chip.pendente { color: #fdba74; background: #fdba741a; }
.report-note { display: flex; gap: 10px; margin-top: 14px; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.report-note svg { width: 18px; height: 18px; color: var(--accent); }
.report-stock-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.report-stock-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.report-stock-row > span { color: var(--accent); display: grid; }
.report-stock-row > span svg { width: 18px; height: 18px; }
.report-stock-row div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.report-stock-row small { font-size: 12px; color: var(--muted); }
.report-stock-row strong { font-size: 12px; color: var(--danger); }
.report-footnote { color: var(--muted); font-size: 12px; }

/* Agente IA */
.agent-shell { display: flex; flex-direction: column; gap: 14px; max-width: 860px; }
.agent-hero { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: radial-gradient(600px 220px at 100% 0, #173a2a 0, transparent 70%), var(--surface); }
.agent-hero h2 { font-size: 20px; margin: 6px 0 4px; }
.agent-hero p { color: var(--text-2); font-size: 13.5px; }
.agent-messages { display: flex; flex-direction: column; gap: 10px; min-height: 260px; max-height: 52vh; overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.agent-message { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.agent-message.bot { align-self: flex-start; background: var(--surface-3); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.agent-message.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); font-weight: 600; border-bottom-right-radius: 4px; }
.agent-form { display: flex; gap: 8px; }
.agent-form input { flex: 1; height: 44px; }
.agent-form button { min-height: 44px; }
.agent-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-suggestions button { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.agent-suggestions button:hover { color: var(--text); border-color: var(--accent); }

/* Formulário em janela (mesmo padrão dos modais da Oficina) */
#editor:not(:empty) { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: #030806c7; backdrop-filter: blur(4px); animation: fade .15s ease; }
#editor .editor-card { width: 100%; max-width: 720px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 22px 24px 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.editor-card > .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.editor-card > .section-heading h2 { font-size: 19px; margin-top: 4px; }
.editor-close { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 20px; line-height: 1; }
.editor-close:hover { background: var(--surface-2); color: var(--text); }
.editor-card .form-actions { position: sticky; bottom: 0; z-index: 3; margin: 20px -24px 0; padding: 12px 24px 16px; background: var(--surface); border-top: 1px solid var(--line); flex-direction: row-reverse; justify-content: flex-start; }
.editor-card .form-actions button:not(.secondary) { min-width: 140px; }
.content .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.content .grid .wide { grid-column: 1 / -1; }
.content .grid > label > input, .content .grid > label > select, .content .grid > label > textarea { margin-top: 6px; font-weight: 400; }
.content .grid > label { position: relative; }
.order-customer-box { margin-top: 14px; padding: 4px 16px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.order-customer-box .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; }
.order-customer-box .section-heading h3 { font-size: 14.5px; margin-top: 2px; }
.order-customer-box .secondary { min-height: 34px; font-size: 12.5px; }
.customer-hint { margin-top: 8px; font-size: 12px; color: var(--muted); }
.photo-field { margin-top: 14px; padding: 4px 16px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.photo-field > p { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
#photoPreview { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.photo-preview { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line-strong); }
.photo-placeholder { font-size: 12.5px; color: var(--muted); }
#backupFile { margin: 6px 0 4px; }

/* Botão de pesquisa extra na barra lateral */
#deviceSearchNav { order: 0; }

/* Telas médias */
@media (max-width: 1024px) {
  .side-account { display: none; }
  .side-logout { margin-top: auto; }
  .inventory-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Celular */
@media (max-width: 760px) {
  .auth-card { padding: 26px 20px; }
  .content > .toolbar { flex-wrap: nowrap; }
  .content > .toolbar > #new { padding: 0 14px; }
  #list .row { flex-wrap: wrap; padding: 12px 14px; }
  #list .row > .actions { width: 100%; justify-content: flex-start; }
  #list .order-row { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "pic body" "status status" "acts acts"; }
  .order-row > .device-thumb, .order-device-icon .icon-tile { width: 44px; height: 44px; }
  .order-row > .order-status { justify-self: start; }
  .order-actions .action-button { flex: 1 1 calc(50% - 6px); justify-content: center; }
  .inventory-banner, .frp-page-banner, .report-hero { padding: 16px; }
  .inventory-banner .icon-tile, .frp-page-banner .icon-tile, .report-hero .icon-tile { display: none; }
  .inventory-banner h2, .frp-page-banner h2, .report-hero h2 { font-size: 17px; }
  .inventory-stat strong { font-size: 17px; }
  .inventory-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main bal" "acts acts"; gap: 10px; }
  .inventory-main { grid-area: main; }
  .inventory-balance { grid-area: bal; justify-items: end; }
  .inventory-balance > span:first-child, .stock-badge { justify-self: end; }
  .inventory-actions { grid-area: acts; justify-content: flex-start; }
  .inventory-actions .secondary:not(.inventory-adjust), .inventory-actions .danger { flex: 1; }
  .agent-message { max-width: 92%; }
  .agent-messages { max-height: 48vh; }
  .agent-form button { padding: 0 14px; }
  .content .grid { grid-template-columns: 1fr; }
  #editor:not(:empty) { align-items: flex-end; padding: 0; }
  #editor .editor-card { max-width: none; max-height: 94vh; border-radius: 20px 20px 0 0; padding: 18px 16px 0; border-bottom: 0; }
  .editor-card .form-actions { margin: 16px -16px 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .editor-card .form-actions button { flex: 1; min-width: 0 !important; }
  .finance-row { flex-wrap: wrap; }
  .content .card { padding: 16px; }
}
body.editor-open { overflow: hidden; }
.menu-list .more-language { display: flex; align-items: center; gap: 12px; margin: 0; padding: 8px 10px; font-size: 15px; font-weight: 600; color: var(--text); }
.menu-list .more-language select { flex: 1; height: 40px; font-size: 14px; }
#deviceSearchNav { display: flex; }
#officeSearch { padding-left: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386a093' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }
.content .dm-suggest button { display: flex; justify-content: flex-start; width: 100%; min-height: 0; padding: 10px 12px; border-radius: 0; background: none; color: var(--text); font-weight: 600; white-space: normal; text-align: left; border: 0; border-bottom: 1px solid var(--line); filter: none; }
.content .dm-suggest button:hover { background: var(--surface-3); }
.content .agent-suggestions button { min-height: 0; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; filter: none; }
.content .agent-suggestions button:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 760px) {
  .attention-card .att-label { padding-right: 34px; }
  .os-summary > .os-code { display: none; }
  .bar-col:not(.is-selected) .bar-value { display: none; }
  .report-month strong { font-size: 15px; }
}

/* Barras de rolagem escuras e discretas (V9.1) */
:root { color-scheme: dark; }
html { scrollbar-color: var(--line-strong) var(--bg); }
.sidebar { scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #46604f; }
/* Menu lateral mais compacto em telas baixas, para caber sem rolar */
@media (min-width: 1025px) and (max-height: 900px) {
  .sidebar { gap: 12px; padding: 16px 14px; }
  .nav-caption { margin: 8px 10px 4px; }
  .side-nav button, .side-logout { padding: 7px 10px; }
  .side-account { padding: 8px 10px; gap: 6px; }
  #tenant { display: none; }
}

/* Ações de WhatsApp na OS (tela inicial) e Configurações (V9.2) */
.os-expand .os-status-line { margin: 14px 0 10px; }
.os-expand .os-actions { margin-top: 4px; }
.os-actions .btn .ui-icon { width: 16px; height: 16px; }
.cfg-form { display: flex; flex-direction: column; gap: 14px; }
.cfg-form .card > p { font-size: 13px; color: var(--muted); }
.cfg-switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.cfg-switch { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-size: 14px; color: var(--text); cursor: pointer; }
.cfg-switch:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cfg-switch input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-strong); }
.cfg-ico { display: grid; color: var(--accent); }
.cfg-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.content .cfg-var { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--accent); font: 600 12px/1.2 ui-monospace, Menlo, Consolas, monospace; min-height: 0; }
.content .cfg-var:hover { border-color: var(--accent); }
.cfg-msg { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.cfg-msg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.content .cfg-reset { color: var(--muted); font-size: 12.5px; font-weight: 600; min-height: 0; padding: 0; background: none; text-decoration: underline; }
.content .cfg-reset:hover { color: var(--text); filter: none; }
.cfg-preview { margin-top: 8px; padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: #123424; border: 1px solid #1f6b44; color: #d6f5e3; font-size: 13px; white-space: pre-wrap; }
.cfg-save { position: sticky; bottom: 0; z-index: 3; padding: 12px 0 16px; background: linear-gradient(transparent, var(--bg) 30%); display: flex; justify-content: flex-end; }
.cfg-save button { min-width: 220px; }
@media (max-width: 760px) {
  .os-expand .os-actions .btn { flex: 1 1 calc(50% - 4px); }
  .cfg-save { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .cfg-save button { width: 100%; }
}

/* Aparelhos esquecidos (V9.3) */
.forgot-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid #fbbf2440; border-radius: var(--r-lg); overflow: hidden; }
.forgot-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.forgot-row:last-child { border-bottom: 0; }
.forgot-days { display: grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 14px; background: #fbbf241a; border: 1px solid #fbbf2440; color: var(--warn); font-size: 11px; font-weight: 700; line-height: 1.1; text-transform: uppercase; }
.forgot-days b { font-size: 20px; font-variant-numeric: tabular-nums; }
.forgot-row.is-late .forgot-days { background: #ef44441a; border-color: #ef444440; color: var(--danger); }
.forgot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.forgot-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forgot-main small { font-size: 12.5px; color: var(--muted); }
.forgot-main .forgot-last { color: var(--text-2); }
.forgot-row .btn-wa { flex: none; min-height: 38px; padding: 0 14px; font-size: 13px; border-color: #1f6b44; color: #b7f7cf; background: #123424; }
.forgot-row .btn-wa:hover { background: #164430; }
.forgot-nophone { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) {
  .forgot-row { flex-wrap: wrap; }
  .forgot-row .btn-wa { width: 100%; }
}
