:root {
  color-scheme: light;
  --vermelho: #e2231a;
  --vermelho-escuro: #b81913;
  --vermelho-claro: #fdecea;
  --texto: #2b2b2b;
  --texto-suave: #6b6b6b;
  --borda: #e2e2e2;
  --fundo: #f4f5f7;
  --branco: #ffffff;
  --verde: #1e8e3e;
  --page-gutter: clamp(14px, 2.1vw, 30px);
  --page-top: clamp(16px, 1.8vw, 26px);
  --fonte: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--fonte);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--fundo);
  color: var(--texto);
  font: 14px var(--fonte);
}

.admin-body { min-height: 100vh; }
.menu-lateral {
  position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 230px;
  display: flex; min-height: 100vh; flex-direction: column; padding: 0; border-right: 1px solid var(--borda);
  background: var(--branco); transition: transform .2s ease;
}
.menu-lateral .logo-area { display: flex; align-items: center; justify-content: center; padding: 16px 14px; border-bottom: 3px solid var(--vermelho); }
.menu-lateral .logo-area img { display: block; width: 100%; height: auto; max-height: 60px; object-fit: contain; }
.menu-lateral nav { padding: 12px 0; }
.menu-item {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 13px 20px;
  border: 0; background: none; color: var(--texto-suave); cursor: pointer;
  font: 14px var(--fonte); text-align: left; text-decoration: none;
}
.menu-item:hover { background: var(--fundo); }
.menu-item.ativo { border-left: 3px solid var(--vermelho); background: var(--vermelho-claro); color: var(--vermelho); font-weight: 600; }
.menu-footer { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-left: 20px; border-top: 1px solid var(--borda); color: var(--texto-suave); font-size: 11px; }
.menu-footer > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-logout-form { flex: 0 0 auto; margin: 0; }
.menu-logout { width: auto; color: var(--texto-suave); font-size: 14px; text-decoration: none; }
.botao-menu-lateral {
  position: fixed; z-index: 90; top: 14px; left: 214px; display: flex; width: 34px; height: 34px;
  align-items: center; justify-content: center; border: 1px solid var(--borda); border-radius: 50%;
  background: var(--branco); color: var(--texto); box-shadow: 0 2px 8px rgba(0,0,0,.14);
  cursor: pointer; font-size: 24px; line-height: 1; transition: left .2s ease;
}
.botao-menu-lateral:hover { color: var(--vermelho); }
.conteudo-principal { margin-left: 230px; max-width: calc(100vw - 230px); transition: margin-left .2s ease, max-width .2s ease, padding .2s ease; }
.sidebar-is-collapsed .menu-lateral { transform: translateX(-100%); }
.sidebar-is-collapsed .botao-menu-lateral { left: 12px; }
.sidebar-is-collapsed .conteudo-principal { margin-left: 0; max-width: 100vw; padding: 26px 30px 60px 64px; }
.sidebar-is-collapsed .page-shell { max-width: none; }

button, input, select, textarea { font: inherit; }
.topbar {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 26px;
  border-bottom: 3px solid var(--vermelho);
  background: var(--branco);
}

.logo-link { display: block; width: 142px; }
.logo-link img { display: block; width: 100%; height: auto; max-height: 60px; object-fit: contain; }
.user-area { display: flex; align-items: center; gap: 14px; color: var(--texto-suave); font-size: 12px; }
.user-area form { display: inline; }
.user-area button { border: 0; background: none; color: var(--vermelho); cursor: pointer; font-size: 12px; text-decoration: underline; }
.conteudo-principal { min-width: 0; padding: var(--page-top) var(--page-gutter) clamp(40px, 4vw, 60px); }
.page-shell { width: 100%; max-width: 1600px; margin: 0 auto; }
.page-heading { margin-bottom: clamp(14px, 1.5vw, 20px); }

.eyebrow {
  margin-bottom: 5px;
  color: var(--vermelho);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 { margin-bottom: 7px; color: #202124; font-size: clamp(23px, 2vw, 28px); line-height: 1.2; }
h2 { color: #222; font-size: 17px; }
h3 { color: #222; font-size: 15px; }
.page-heading > p:last-child { max-width: 700px; color: var(--texto-suave); line-height: 1.5; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 13px; }
.section-heading h2 { font-size: 18px; }
.dashboard-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 8px; }
.dashboard-summary-compact { grid-template-columns: repeat(2, minmax(0, 260px)); margin-bottom: 24px; }
.dashboard-summary-card { padding: 17px 19px; border: 1px solid var(--borda); border-radius: 10px; background: var(--branco); border-top: 3px solid var(--vermelho); }
.dashboard-summary-card span, .dashboard-summary-card strong, .dashboard-summary-card small { display: block; }
.dashboard-summary-card span { color: var(--texto-suave); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.dashboard-summary-card strong { margin: 6px 0 2px; color: #202124; font-size: 25px; }
.dashboard-summary-card small { color: var(--texto-suave); font-size: 11px; }
.text-link { color: var(--vermelho); font-size: 12px; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.card, .summary-card, .items-card, .confirmation-card, .empty-state {
  border: 1px solid var(--borda);
  border-radius: 10px;
  background: var(--branco);
}

.card { overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--borda); }
.card-header > div { display: flex; align-items: center; gap: 10px; }

.status { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-pending { background: #ececec; color: #555; }
.status-delivered { background: #e8f1fb; color: #24538a; }
.status-done { background: #e4f4ea; color: #17653b; }
.status-review { background: var(--vermelho-claro); color: var(--vermelho); white-space: nowrap; }
.status-cancelled { background: #ececec; color: #666; }

.toast-stack { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; width: min(420px, calc(100vw - 40px)); gap: 8px; }
.toast { padding: 13px 17px; border-radius: 9px; color: var(--branco); line-height: 1.45; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2); animation: toast-in 180ms ease-out both; }
.toast-success { background: #176b31; }
.toast-error { background: var(--vermelho); }
.toast.is-leaving { animation: toast-out 180ms ease-in both; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(24px); }
}

.request-grid { display: grid; grid-template-areas: "lookup manual" "result manual"; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
.lookup-card { grid-area: lookup; }
.manual-section { grid-area: manual; }
.request-grid .result-section { grid-area: result; margin-top: 0; }
.request-grid .review-grid { grid-template-columns: 1fr; }
.request-grid .review-grid .summary-card { min-height: auto; }
.lookup-form { display: grid; grid-template-columns: minmax(180px, 260px) auto; align-items: end; gap: 12px; padding: 20px; }
.manual-form { padding: 20px; }
.manual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.manual-grid .field > span { display: block; margin-bottom: 6px; color: var(--texto-suave); font-size: 13px; }
.manual-item-field, .manual-notes-field { grid-column: 1 / -1; }
.manual-destination .compact-field { margin-top: 0; }
.manual-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--texto-suave); font-size: 13px; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--borda); border-radius: 8px; background: var(--branco); color: #222; }
.field textarea { min-height: 74px; resize: vertical; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--vermelho); box-shadow: 0 0 0 3px rgba(226, 35, 26, 0.1); }
.field input:disabled { background: #f7f7f7; }
.field-help { margin-top: 6px; color: var(--texto-suave); font-size: 12px; line-height: 1.4; }

.button { min-height: 42px; padding: 10px 18px; border: 0; border-radius: 8px; font-weight: 600; cursor: pointer; }
.button-primary { background: var(--vermelho); color: var(--branco); }
.button-secondary { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--borda); background: var(--branco); color: var(--texto); text-decoration: none; }
.button-secondary:hover { border-color: #c8c8c8; background: #f8f8f8; }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.button-primary:not(:disabled):hover { background: var(--vermelho-escuro); }
.button-danger { min-height: 34px; padding: 7px 12px; background: #8f1712; color: var(--branco); }
.button-danger:not(:disabled):hover { background: #72120e; }
.button:disabled { cursor: not-allowed; opacity: 0.5; }
.button.is-loading { cursor: wait; }
.button:focus-visible, .logo-link:focus-visible { outline: 3px solid rgba(226, 35, 26, 0.18); outline-offset: 3px; }

.result-section { margin-top: 24px; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.summary-card { min-height: 142px; padding: 16px 18px; }
.summary-card strong, .summary-card > span { display: block; }
.summary-card strong { margin: 8px 0 6px; color: #222; font-size: 14px; }
.summary-card > span:last-child { color: var(--texto-suave); font-size: 12px; line-height: 1.5; }
.summary-label { color: var(--vermelho); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.review-grid { grid-template-columns: 0.75fr 1.1fr 1.4fr; }
.review-grid .summary-card { min-height: 230px; }
.compact-field { display: block; margin-top: 10px; }
.compact-field > span { display: block; margin-bottom: 5px; color: var(--texto-suave); font-size: 11px; }
.selected-address { display: block; margin-top: 8px; color: var(--texto-suave); font-size: 11px; line-height: 1.4; }
.branch-combobox { position: relative; }
.branch-results { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; left: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--borda); border-radius: 8px; background: var(--branco); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12); }
.branch-results button { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--borda); background: var(--branco); color: var(--texto); cursor: pointer; text-align: left; }
.branch-results button[hidden] { display: none; }
.branch-results button:last-child { border-bottom: 0; }
.branch-results button:hover, .branch-results button.is-active { background: var(--vermelho-claro); }
.branch-results strong, .branch-results span { display: block; }
.branch-results strong { font-size: 12px; }
.branch-results span { margin-top: 3px; color: var(--texto-suave); font-size: 11px; line-height: 1.35; }
.notes-card { margin-top: 12px; padding: 16px; border: 1px solid var(--borda); border-radius: 10px; background: var(--branco); }
.withdrawal-notes { margin-top: 7px; color: var(--texto); font-style: italic; }

.items-card { overflow: hidden; margin-top: 12px; }
.items-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--borda); }
.items-header span { color: var(--texto-suave); font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: top; }
th { background: #fafafa; color: var(--texto-suave); font-size: 11px; letter-spacing: 0.03em; text-transform: uppercase; }
th:last-child, td:last-child { width: 180px; text-align: right; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td { font-size: 13px; }
td strong, td span { display: block; }
td span { margin-top: 3px; color: var(--texto-suave); }

.confirmation-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; padding: 16px; }
.confirmation-card strong, .confirmation-card span { display: block; }
.confirmation-card span { margin-top: 4px; color: var(--texto-suave); font-size: 12px; line-height: 1.45; }
.persistence-warning { margin-top: 8px; color: var(--texto-suave); font-size: 12px; }
.recent-section { margin-top: 28px; scroll-margin-top: 20px; }
.empty-state { padding: 24px 18px; color: var(--texto-suave); text-align: center; }
.recent-section th:first-child, .recent-section td:first-child { width: 100px; }
.recent-table > thead > tr > th:nth-child(4), .recent-table > tbody > .withdrawal-main-row > td:nth-child(4) { width: 170px; text-align: left; }
.recent-table > thead > tr > th:last-child, .recent-table > tbody > .withdrawal-main-row > td:last-child { width: 180px; text-align: left; white-space: normal; }
.recent-table .status { justify-content: center; }
.details-toggle { display: block; margin-bottom: 9px; padding: 0; border: 0; background: none; color: var(--vermelho); cursor: pointer; font-size: 12px; font-weight: 600; }
.details-toggle::before { content: "▸ "; }
.details-toggle[aria-expanded="true"]::before { content: "▾ "; }
.withdrawal-detail-row > td { width: auto !important; padding: 0 14px 14px; text-align: left !important; white-space: normal !important; }
.withdrawal-expanded { padding: 14px; border: 1px solid var(--borda); border-radius: 9px; background: #fafafa; }
.expanded-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.expanded-summary-grid .summary-card { min-height: auto; }
.expanded-notes { margin-top: 12px; padding: 13px 15px; border: 1px solid var(--borda); border-radius: 9px; background: var(--branco); }
.expanded-notes strong, .expanded-notes span { display: block; }
.expanded-notes span { margin-top: 5px; color: var(--texto-suave); line-height: 1.45; }
.expanded-items { background: var(--branco); }
.purge-control, .cancel-control { min-width: 170px; text-align: left; white-space: normal; }
.purge-control { margin-top: 8px; }
.purge-control summary, .cancel-control summary { color: var(--vermelho); cursor: pointer; font-size: 12px; font-weight: 600; }
.purge-control form, .cancel-control form { display: grid; gap: 7px; margin-top: 9px; padding: 10px; border: 1px solid #f2c6c3; border-radius: 8px; background: #fff8f7; }
.purge-control p, .cancel-control p { color: var(--texto-suave); font-size: 11px; line-height: 1.4; }
.action-unavailable { color: var(--texto-suave); font-size: 11px; }
.confirm-form { display: grid; gap: 15px; padding: 20px; }
.confirm-form .field > span { display: block; margin-top: 6px; color: var(--texto-suave); font-size: 11px; line-height: 1.4; }
.confirm-form .button { justify-self: end; }
.filter-panel { margin-bottom: 28px; overflow: visible; }
.history-filters { display: grid; grid-template-columns: .65fr 1fr 1.55fr .85fr .85fr auto; align-items: end; gap: 12px; padding: 18px 20px 20px; }
.history-filters .field > span { display: block; margin-bottom: 6px; color: var(--texto-suave); font-size: 12px; }
.filter-actions { display: flex; align-items: center; gap: 8px; }
.history-results { margin-top: 10px; }
.history-table th:last-child, .history-table td:last-child { width: 120px; }
.history-table td:first-child { min-width: 160px; }
.history-table td:nth-child(3), .history-table td:nth-child(4) { min-width: 210px; }

/* Dashboard no mesmo padrão visual do Apontadores_AWP. */
.titulo-pagina { margin: 0 0 18px; color: #222; font-size: 20px; line-height: 1.25; }
.cards-resumo { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.card-num { min-width: 180px; flex: 1; padding: 16px 20px; border: 1px solid var(--borda); border-radius: 10px; background: var(--branco); }
.card-num strong, .card-num span { display: block; }
.card-num strong { margin-bottom: 3px; font-size: 28px; line-height: 1.1; }
.card-num span { color: var(--texto-suave); font-size: 12px; }
.card-num-waiting strong { color: #2563eb; }
.card-num-progress strong { color: #2563eb; }
.authorization-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.authorization-actions select { min-height: 34px; padding: 6px 30px 6px 10px; border: 1px solid var(--borda); border-radius: 8px; background: var(--branco); color: var(--texto); }
.authorization-table td:nth-child(2) { word-break: break-word; }
.inline-import-form { display: flex; align-items: center; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.file-input-visually-hidden { 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; }
.selected-file-name { max-width: 360px; overflow: hidden; color: var(--texto-suave); text-overflow: ellipsis; white-space: nowrap; }
.clear-selected-file { position: relative; display: inline-grid; width: 30px; height: 30px; place-items: center; padding: 0; color: #777; background: transparent; border: 1px solid var(--borda); border-radius: 50%; cursor: pointer; overflow: hidden; font-size: 0; }
.clear-selected-file::before, .clear-selected-file::after { position: absolute; width: 11px; height: 1.5px; background: currentColor; border-radius: 2px; content: ""; }
.clear-selected-file::before { transform: rotate(45deg); }
.clear-selected-file::after { transform: rotate(-45deg); }
.clear-selected-file:hover { color: var(--vermelho); border-color: var(--vermelho); }
.barra-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(7px, .8vw, 10px); margin-bottom: clamp(12px, 1.3vw, 18px); }
.tabela-wrap { overflow: hidden; border: 1px solid var(--borda); border-radius: 10px; background: var(--branco); }
.admin-list-table th, .admin-list-table td { padding: 12px 14px; vertical-align: middle; }
.admin-list-table th:last-child, .admin-list-table td:last-child { width: auto; text-align: left; white-space: normal; }
.admin-list-table tbody tr:last-child td { border-bottom: 0; }
.admin-list-table td > span:not(.status) { display: block; margin-top: 3px; color: var(--texto-suave); font-size: 11px; line-height: 1.35; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td, .clickable-row:focus td { background: #f8f8f8; }
.clickable-row:focus { outline: none; }
.is-inactive { opacity: .55; }
.button-link-danger { min-height: 34px; padding: 7px 4px; background: none; color: var(--vermelho); text-decoration: underline; }

.modal-fundo { position: fixed; z-index: 200; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.5); }
.modal-fundo[hidden] { display: none; }
.modal { width: 100%; max-width: 560px; max-height: 90vh; overflow: hidden; border-radius: 12px; background: var(--branco); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-formulario { max-width: 860px; }
.modal-cabecalho { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 4px solid var(--vermelho); border-bottom: 1px solid var(--borda); }
.modal-cabecalho h2 { font-size: 18px; }
.modal-fechar { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--texto-suave); cursor: pointer; font-size: 24px; }
.modal-fechar:hover { background: var(--fundo); color: var(--vermelho); }
.modal-conteudo { max-height: calc(90vh - 66px); overflow-y: auto; padding: 18px 20px; }
.modal-form { display: grid; gap: 14px; }
.modal-grade { display: grid; gap: 12px; }
.modal-grade-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.modal-grade-full { grid-column: 1 / -1; }
.modal-form .field > span { display: block; margin-bottom: 6px; color: var(--texto-suave); font-size: 13px; font-weight: 600; }
.modal-form .field small { display: block; margin-top: 5px; color: var(--texto-suave); font-size: 11px; }
.modal-form .field input, .modal-form .field select, .modal-form .field textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d8d8d8; border-radius: 10px; background: #fff; color: #222; }
.modal-form .field textarea { min-height: 70px; resize: vertical; }
.modal-form .field input:focus, .modal-form .field select:focus, .modal-form .field textarea:focus { outline: none; border-color: var(--vermelho); box-shadow: 0 0 0 3px rgba(226,35,26,.11); }
.branch-field { position: relative; }
.branch-help { display: block; margin-top: 5px; color: var(--texto-suave); font-size: 11px; font-weight: 400; }
.branch-suggestions { position: absolute; z-index: 20; top: calc(100% - 16px); right: 0; left: 0; max-height: 240px; overflow-y: auto; border: 1px solid var(--borda); border-radius: 9px; background: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.branch-suggestions[hidden] { display: none; }
.branch-option, .branch-empty { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #eee; background: #fff; color: var(--texto); text-align: left; font: inherit; }
.branch-option { cursor: pointer; }
.branch-option:hover, .branch-option.is-highlighted { background: #fff2f1; color: #a51712; }
.branch-option:last-child, .branch-empty:last-child { border-bottom: 0; }
.branch-empty { color: var(--texto-suave); font-size: 12px; }
.modal-acoes { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin: 16px -20px -18px; padding: 12px 20px; border-top: 1px solid var(--borda); background: #fff; }
.modal-acoes-between { justify-content: flex-start; }
.modal-action-spacer { flex: 1; }
.toggle-field { display: flex; align-items: center; gap: 8px; color: var(--texto); }
.toggle-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--vermelho); }
.modal-detalhes { display: flex; flex-direction: column; }
.modal-detalhes .modal-conteudo { min-height: 0; max-height: none; flex: 1; padding-top: 10px; }
.modal-detalhes > .modal-acoes { flex: 0 0 auto; margin: 0; }
.modal-detalhe-linha { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--borda); }
.modal-detalhe-linha-valor-unico { align-items: center; }
.modal-detalhe-linha .rot { flex: 0 0 125px; color: var(--texto-suave); }
.modal-detalhe-linha .val { max-width: 360px; font-weight: 600; text-align: right; line-height: 1.4; }
.modal-detalhe-linha .val strong, .modal-detalhe-linha .val small { display: block; }
.modal-detalhe-linha .val small { margin-top: 3px; color: var(--texto-suave); font-size: 11px; font-weight: 400; }
.modal-itens { margin-top: 16px; }
.modal-itens h3 { margin-bottom: 8px; }
.modal-itens table { border: 1px solid var(--borda); }
.foto-detalhe-botao { position: relative; display: block; width: 100%; margin-top: 14px; overflow: hidden; padding: 0; border: 1px solid var(--borda); border-radius: 8px; background: #111; cursor: zoom-in; }
.foto-detalhe { display: block; width: 100%; max-height: 620px; object-fit: contain; }
.foto-detalhe-botao > span { position: absolute; right: 10px; bottom: 10px; padding: 6px 10px; border-radius: 20px; background: rgba(0,0,0,.72); color: #fff; font-size: 12px; font-weight: 600; }
.visualizador-foto { position: fixed; z-index: 1000; inset: 0; display: flex; flex-direction: column; padding: 12px; background: rgba(0,0,0,.94); }
.visualizador-foto-barra { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px; padding-bottom: 10px; }
.visualizador-foto-barra button { min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid #555; border-radius: 8px; background: #252525; color: #fff; cursor: pointer; font: 700 20px var(--fonte); }
.visualizador-foto-barra button:hover { background: #3a3a3a; }
.visualizador-foto-barra .visualizador-zoom { min-width: 74px; font-size: 13px; }
.visualizador-foto-barra .visualizador-fechar { margin-left: 18px; border-color: var(--vermelho); background: var(--vermelho); font-size: 26px; }
.visualizador-foto-palco { display: flex; min-height: 0; flex: 1; align-items: flex-start; justify-content: center; overflow: auto; border-radius: 8px; }
.visualizador-foto-palco img { display: block; height: auto; margin: auto; object-fit: contain; transition: width .15s ease; cursor: zoom-in; }
.history-filter-bar input, .history-filter-bar select { min-height: 38px; padding: 7px 10px; border: 1px solid var(--borda); border-radius: 8px; background: #fff; }
.history-filter-bar input[name="oc"] { width: 145px; }
.history-filter-bar select { min-width: 190px; }
.history-filter-bar .history-term { min-width: 240px; flex: 1; }
.inline-date { display: flex; align-items: center; gap: 7px; color: var(--texto); font-size: 13px; }
.inline-date input { width: 145px; }

.modal-is-open { overflow: hidden; }
.botao-menu-lateral { padding: 0; line-height: 1; }
.sidebar-chevron { width: 8px; height: 8px; margin-left: 3px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
.sidebar-hamburger { display: none; font: 18px/1 Arial, sans-serif; }
.sidebar-is-collapsed .sidebar-chevron { display: none; }
.sidebar-is-collapsed .sidebar-hamburger { display: block; }
@media (max-width: 1600px) {
  .menu-lateral { width: 200px; }
  .menu-lateral .logo-area { padding: 14px 12px; }
  .menu-item { padding: 12px 16px; }
  .botao-menu-lateral { left: 184px; }
  .conteudo-principal { margin-left: 200px; max-width: calc(100vw - 200px); padding: 22px 20px 50px; }
  .sidebar-is-collapsed .botao-menu-lateral { left: 12px; }
  .sidebar-is-collapsed .conteudo-principal { margin-left: 0; max-width: 100vw; padding: 22px 20px 50px 64px; }
}
@media (max-width: 900px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: auto; }
  .request-grid { grid-template-areas: "lookup" "result" "manual"; grid-template-columns: 1fr; }
  .expanded-summary-grid { grid-template-columns: 1fr; }
  .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-search-field { grid-column: 1 / -1; }
  .filter-actions { justify-content: flex-end; }
  .history-filter-bar .history-term { min-width: 180px; }
}

@media (max-width: 620px) {
  .conteudo-principal { padding: 20px 12px 40px; }
  h1 { font-size: 24px; }
  .dashboard-summary, .dashboard-summary-compact { grid-template-columns: 1fr; }
  .card-header, .result-heading { align-items: flex-start; flex-direction: column; }
  .lookup-form { grid-template-columns: 1fr; }
  .lookup-form .button { width: 100%; }
  .manual-grid { grid-template-columns: 1fr; }
  .manual-item-field, .manual-notes-field { grid-column: auto; }
  .manual-actions .button { width: 100%; }
  .confirmation-card { align-items: stretch; flex-direction: column; }
  .confirmation-card .button { width: 100%; }
  .history-filters { grid-template-columns: 1fr; }
  .history-search-field { grid-column: auto; }
  .filter-actions .button { flex: 1; }
  .modal-fundo { align-items: stretch; padding: 0; }
  .modal { max-height: 100vh; border-radius: 0; }
  .modal-conteudo { max-height: calc(100vh - 66px); }
  .modal-grade-2 { grid-template-columns: 1fr; }
  .modal-grade-full { grid-column: auto; }
  .modal-detalhe-linha { flex-direction: column; gap: 4px; }
  .modal-detalhe-linha-valor-unico { align-items: stretch; }
  .modal-detalhe-linha .rot { flex-basis: auto; }
  .modal-detalhe-linha .val { max-width: none; text-align: left; }
  .history-filter-bar input[name="oc"], .history-filter-bar select, .history-filter-bar .history-term, .inline-date, .inline-date input { width: 100%; min-width: 0; }
  .inline-date { align-items: stretch; flex-direction: column; gap: 4px; }
}

.vehicle-choice { min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; display: flex; gap: 22px; align-items: center; }
.vehicle-choice legend { padding: 0 4px; color: #666; font-size: 0.85rem; }
.vehicle-choice label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.vehicle-choice input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: #e92018; }
.email-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.email-control span { font-size: 0.8rem; color: #666; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .toast, .toast.is-leaving { animation: none; }
}
