/* Padrão visual do sistema de orçamentos MULTTECH. */
html{font-size:13px}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0;background:#f3f4f6;color:#1f2937;font: .9rem/1.3 Arial,sans-serif}aside{position:fixed;inset:0 auto 0 0;width:214px;padding:12px 10px;display:flex;flex-direction:column;background:linear-gradient(180deg,#151d2b,#111827);color:#fff;overflow:auto}.brand{display:flex;align-items:center;gap:10px;margin-bottom:22px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;flex:0 0 38px;border-radius:12px;background:linear-gradient(135deg,#b91c1c,#dc2626);font-weight:800;box-shadow:0 12px 22px #b91c1c38}.brand strong{font-size:1.08rem;font-weight:800}.brand small{display:block;font-size:.68rem;color:#ffffffbf;margin-top:4px}nav{display:flex;flex-direction:column;gap:8px}nav a{display:flex;align-items:center;gap:8px;padding:11px 12px;color:#f8fafc;text-decoration:none;border-radius:10px;font-size:.92rem;font-weight:600}nav a:hover,nav a.active{background:#273244}nav a.active{box-shadow:inset 3px 0 #dc2626}nav svg{width:14px;height:14px;flex:0 0 14px;color:#dbe5f2}.sidebar-footer{margin-top:auto;padding-top:24px}.sidebar-footer small{color:#94a3b8;display:block;padding:10px}.sidebar-footer .logout{width:100%;background:#273244;box-shadow:none}#menu-toggle{display:none}main{margin-left:214px;padding:20px;min-width:0}h1{font-size:1.8rem;letter-spacing:-.025em;margin:0 0 8px}h2{font-size:1.35rem;margin:0 0 12px}.subtitle,.muted{color:#64748b}.subtitle{margin-bottom:20px}.card{margin:16px 0;overflow:auto;min-width:0}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:16px 0}.four{grid-template-columns:repeat(4,minmax(0,1fr))}.grid .card{margin:0}.stat{font-size:2rem;font-weight:700;color:#111827;margin-top:10px;letter-spacing:-.025em}.four .stat{font-size:1.8rem}.form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.wide{grid-column:1/-1}label{display:block;font-size:.88rem;font-weight:600;color:#374151}.actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}a{color:#b91c1c;text-underline-offset:3px}.page-heading{display:flex;justify-content:space-between;align-items:start;gap:16px}.card small{display:block;color:#64748b;margin-top:5px;font-weight:400}.empty{padding:24px;color:#64748b}.notice{padding:12px 16px;border:1px solid #cbd5e1;border-radius:8px;background:#f1f5f9;margin:16px 0}.notice.success{color:#166534;background:#f0fdf4;border-color:#bbf7d0}.notice.error{color:#991b1b;background:#fef2f2;border-color:#fecaca}.badge{display:inline-block;padding:4px 9px;border-radius:20px;background:#fef3c7;color:#92400e;font-size:.8rem}.badge.late{color:#991b1b;background:#fee2e2}.badge.paid{color:#166534;background:#dcfce7}.danger{color:#b91c1c}.manual-row{display:grid;grid-template-columns:1fr 1fr auto;gap:14px;align-items:end;margin-bottom:14px}summary{cursor:pointer;font-weight:600}.delete-vendor{margin-top:8px}
.card {
  background: linear-gradient(180deg, #ffffff 0%, #fdfefe 100%);
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.card h2 {
  font-size: 1.35rem;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.texto-ajuda {
  margin: -4px 0 12px;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}

.card-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 8px 9px;
  margin: 0 0 8px;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  box-sizing: border-box;
  background: #fff;
  font: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:not([type="number"]):not([type="file"]),
textarea {
  text-transform: uppercase;
}

.sem-caixa-alta {
  text-transform: none !important;
}

textarea {
  resize: vertical;
  min-height: 78px;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #b91c1c;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

button {
  background: linear-gradient(180deg, #c91c1c 0%, #b91c1c 100%);
  color: white;
  border: none;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  margin: 2px;
  font-size: 0.82rem;
  box-shadow: 0 6px 14px rgba(185, 28, 28, 0.14);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

button:hover {
  background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%);
  box-shadow: 0 8px 18px rgba(153, 27, 27, 0.2);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.88rem;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

th {
  background: #f8fafc;
  text-align: left;
  color: #334155;
}

th,
td {
  padding: 8px 9px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  min-width: 0;
}

input,select,textarea{margin:6px 0 4px;min-height:34px}input:not([type=number]):not([type=file]),textarea{text-transform:none}input[type=hidden]{display:none}.button{display:inline-block;background:linear-gradient(180deg,#c91c1c,#b91c1c);color:#fff;padding:9px 13px;border-radius:8px;font-weight:700;font-size:.85rem;text-decoration:none;box-shadow:0 6px 14px #b91c1c24}button{min-height:34px;padding:9px 13px;margin:0}.secondary{background:linear-gradient(180deg,#475569,#334155);color:#fff;box-shadow:0 6px 14px #0f172a24}.secondary:hover{background:#273244}.form button{align-self:end}td,th{white-space:nowrap}tbody tr:nth-child(even){background:#fcfcfd}.auth-page{min-height:100vh;display:grid;place-items:center;padding:28px;background:radial-gradient(circle at 10% 20%,#b91c1c2e,transparent 28%),linear-gradient(135deg,#0f172a 0%,#172033 48%,#f3f4f6 48%,#f8fafc 100%)}.auth-shell{width:min(960px,100%);display:grid;grid-template-columns:1.1fr .9fr;gap:18px}.auth-brand,.auth-form{border-radius:20px;padding:36px;box-shadow:0 20px 60px #0f172a26}.auth-brand{background:linear-gradient(145deg,#151d2b,#273244);color:white;display:flex;flex-direction:column;justify-content:space-between;min-height:460px}.auth-brand h1{font-size:2.8rem;line-height:1.1;max-width:380px}.auth-brand p{color:#cbd5e1;font-size:1rem;line-height:1.6}.auth-form{background:white;display:flex;flex-direction:column;justify-content:center}.auth-form form{display:grid;gap:14px}.auth-form h2{font-size:1.8rem}.auth-form p{margin:0 0 24px;color:#64748b}@media(max-width:1100px){.four,.form{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:760px){aside{position:static;width:100%;padding:12px 16px}.brand{margin:0}.brand>div{flex:1}#menu-toggle{display:block;background:#273244;box-shadow:none}aside nav,aside .sidebar-footer{display:none}aside.menu-open nav{display:flex;margin-top:16px}aside.menu-open .sidebar-footer{display:block}main{margin:0;padding:18px}.form,.grid,.four{grid-template-columns:1fr}.page-heading{flex-wrap:wrap}.manual-row{grid-template-columns:1fr}.auth-shell{grid-template-columns:1fr}.auth-brand{min-height:220px;padding:26px}.auth-brand h1{font-size:2rem;margin-top:24px}.auth-form{padding:26px}.auth-page{padding:18px}}

input[name="name"],input[name="fantasy"],input[name="address"],input[name="city"],input[name="state"],input[name="contact"],input[name="registration_status"],input[name="description"],input[name="notes"],input[name="location"],input[name="unit"],input[name="document"],input[name="reference"],input[name="destination_bank"],textarea[name="notes"]{text-transform:uppercase}

/* Ações padronizadas: largura natural e alinhamento consistente. */
button,.button,.action-edit,.action-delete{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:8px 14px;font:600 12px/1.2 Arial,sans-serif;white-space:nowrap;border-radius:7px;text-decoration:none;box-sizing:border-box;vertical-align:middle;transition:background .15s,border-color .15s}
button:hover,.button:hover{transform:none;box-shadow:0 2px 6px #0f172a14}.form>button{justify-self:start;align-self:end;width:auto}.form-actions{padding-top:14px;margin-top:4px;border-top:1px solid #e5e7eb}.actions{gap:10px}.actions button,.actions .button{flex:0 0 auto}.row-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}.row-actions form,.delete-vendor{display:inline-flex;margin:0}.action-edit{border:1px solid #cbd5e1;background:#fff;color:#334155;box-shadow:none}.action-edit:hover{background:#f1f5f9;border-color:#94a3b8;color:#0f172a}.action-delete{border:1px solid #fecaca;background:#fff1f2;color:#b91c1c;box-shadow:none}.action-delete:hover{background:#fee2e2;border-color:#f87171;color:#991b1b;box-shadow:none}.row-actions .action-edit,.row-actions .action-delete{min-height:30px;padding:6px 10px;font-size:11px}td:has(.row-actions){width:1%;vertical-align:middle}.secondary{border:1px solid #cbd5e1;background:#f8fafc;color:#334155;box-shadow:none}.secondary:hover{background:#e2e8f0;color:#0f172a}.form #cnpj-lookup{justify-self:start;align-self:center}button:disabled{cursor:not-allowed}#menu-toggle{min-height:30px;width:32px;padding:5px}.sidebar-footer .logout{justify-content:center}@media(max-width:760px){.form-actions{gap:10px}.form-actions button,.form-actions .button{min-height:40px}.row-actions{gap:6px}}

.work-tabs{display:flex;align-items:center;gap:24px;border-bottom:1px solid #cbd5e1;margin:20px 0;flex-wrap:wrap}.work-tabs span{padding:12px 0;color:#b91c1c;font-weight:700;border-bottom:2px solid #b91c1c}.work-tabs a{color:#475569;padding:12px 0;text-decoration:none}.row-actions .button{min-height:30px;padding:6px 10px;font-size:11px}

#order-items select{min-width:200px}#order-items input{min-width:100px}#order-items [name=item_notes]{min-width:170px}.order-totals{background:#f8fafc;padding:8px 16px;border-radius:8px}.order-totals p{display:flex;justify-content:space-between;gap:16px}.table-responsive{overflow-x:auto}input[name=document_number],input[name=item_notes]{text-transform:uppercase}

.search-picker{position:relative;min-width:0}.picker-query{font-weight:400}.picker-results{position:absolute;left:0;right:0;top:100%;z-index:30;background:#fff;border:1px solid #cbd5e1;border-radius:8px;box-shadow:0 12px 24px #0f172a24;max-height:260px;overflow-y:auto}.picker-results [role=option]{padding:10px 12px;cursor:pointer;border-bottom:1px solid #f1f5f9}.picker-results [role=option]:hover,.picker-results [aria-selected=true]{background:#fef2f2}.picker-results strong{display:block;font-size:12px}.picker-results small{display:block;color:#64748b;font-size:11px;margin-top:4px}.picker-results p{padding:12px;margin:0;color:#64748b}.card:has(.search-picker){overflow:visible}

.picker-results{position:fixed;z-index:1000;max-height:240px}.item-picker{min-width:240px}#order-items td{vertical-align:middle}#order-items [data-unit-output],#order-items [data-line-total]{text-align:center;font-weight:700;vertical-align:middle;padding:12px 18px}#order-items [data-unit-output],.item-unit-heading{min-width:80px;text-align:center}#order-items [data-line-total],.item-subtotal-heading{min-width:130px;text-align:center}#order-items input{margin-top:4px;margin-bottom:4px}.item-picker .picker-query{width:100%;font-weight:400}

.adjustment-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:start;min-width:0}@media(max-width:460px){.adjustment-pair{grid-template-columns:1fr}}

.system-version{display:inline-block;margin:0 10px 4px;padding:4px 9px;border:1px solid #475569;border-radius:6px;color:#e2e8f0;font-size:11px;font-weight:700;letter-spacing:.03em}

.row-actions .icon-action{width:38px;height:38px;min-height:38px;padding:8px;flex:0 0 38px}.icon-action svg{display:block;width:20px;height:20px;pointer-events:none}.icon-action:focus-visible{outline:3px solid #2563eb;outline-offset:3px}

/* Wrap long names and documents without forcing horizontal scrolling. */
.payables-table{table-layout:fixed;max-width:100%}
.payables-table th,.payables-table td{white-space:normal;overflow-wrap:anywhere;word-break:normal}
.payables-table th:nth-child(1){width:11%}.payables-table th:nth-child(2){width:22%}.payables-table th:nth-child(3){width:19%}
.payables-table th:nth-child(4){width:9%}.payables-table th:nth-child(5){width:8%}.payables-table th:nth-child(6){width:7%}.payables-table th:nth-child(7){width:8%}.payables-table th:nth-child(8){width:8%}.payables-table th:nth-child(9){width:8%}
.payables-table .row-actions{flex-wrap:wrap;gap:6px}.payables-table .badge{white-space:normal}
@media(max-width:1000px){
 .payables-table,.payables-table tbody{display:block;width:100%}
 .payables-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .payables-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:14px;padding:8px;background:#fff}
 .payables-table td{display:block;width:auto!important;min-width:0;padding:9px 6px}
 .payables-table td::before{content:attr(data-label);display:block;font-weight:700;color:#475569;font-size:11px;margin-bottom:5px}
 .payables-table td:nth-child(2),.payables-table td:nth-child(3),.payables-table td[data-label="Ações"],.payables-table td.empty{grid-column:1/-1}
 .payables-table td.empty::before{display:none}
 .payables-table td[data-label="Ações"]{border-bottom:0}
}

/* Keep title actions together while descriptive columns absorb wrapping. */
.payables-table th:nth-child(9){width:144px}
.payables-table .row-actions{flex-wrap:nowrap;gap:6px;min-width:126px}
.payables-table .row-actions .icon-action{width:38px;flex:0 0 38px}
@media(min-width:1001px){
 .payables-table th:nth-child(1){width:10%}
 .payables-table th:nth-child(2){width:auto}
 .payables-table th:nth-child(3){width:19%}
 .payables-table th:nth-child(4){width:9%}
 .payables-table th:nth-child(5),.payables-table th:nth-child(6),.payables-table th:nth-child(7){width:8%}
 .payables-table th:nth-child(8){width:8%}
}

.form .settlement-actions{align-items:center;justify-content:flex-start}.form .settlement-actions>button,.form .settlement-actions>.button{align-self:center;min-height:38px;margin:0}

summary.reversal-toggle{display:list-item;list-style-position:inside;width:fit-content;padding:10px 14px;border:1px solid #b91c1c;border-radius:7px;background:#c91c1c;color:#fff;font-weight:700;cursor:pointer}summary.reversal-toggle:hover{background:#b91c1c}summary.reversal-toggle:focus-visible{outline:3px solid #2563eb;outline-offset:3px}

.allocation-action.allocation-complete{background:#2563eb;border-color:#2563eb;color:#fff}.allocation-action.allocation-complete:hover{background:#1d4ed8;border-color:#1d4ed8;color:#fff}.allocation-action.allocation-pending{background:#facc15;border-color:#eab308;color:#422006}.allocation-action.allocation-pending:hover{background:#eab308;border-color:#ca8a04;color:#422006}

.order-status{white-space:normal;max-width:150px;font-weight:600}.order-status.allocated{background:#dbeafe;color:#1e40af}.order-status.pending{background:#fef3c7;color:#854d0e}

.quantities-table th,.quantities-table td{white-space:normal;overflow-wrap:anywhere}.quantities-table td:nth-child(2){min-width:150px}

body{background:var(--page-bg,#f3f4f6)}aside{background:var(--sidebar,#151d2b);color:var(--sidebar-text,#fff)}aside nav a,aside nav svg,.brand small{color:inherit}aside nav a:hover,aside nav a.active{background:color-mix(in srgb,var(--sidebar,#151d2b),var(--sidebar-text,#fff) 14%)}aside nav a.active{box-shadow:inset 3px 0 var(--primary,#b91c1c)}.brand-mark,button:not(.secondary):not(.action-delete):not(#menu-toggle):not(.logout),.button:not(.secondary){background:var(--primary,#b91c1c);color:var(--primary-text,#fff)}.company-logo{width:44px;height:44px;object-fit:contain;flex:0 0 44px}.brand strong{overflow-wrap:anywhere}.brand>div{min-width:0}summary.reversal-toggle,.action-delete{--primary:#b91c1c}

/* Responsive layout shared by forms, movement screens and reports. */
main>*,.form>*,.card>*,.page-heading>*,.actions>*,fieldset{min-width:0}
input,select,textarea{max-width:100%;min-width:0}
input[type=checkbox],input[type=radio]{display:inline-block;width:auto;min-height:0;flex:0 0 auto}
img{max-width:100%}
h1,h2,h3,p,.subtitle,.notice,label,summary{overflow-wrap:anywhere}
.actions form{margin:0}.form .actions{align-items:center}.form .actions>button,.form .actions>.button{align-self:center}
@media(max-width:1100px){
 .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 main{padding:16px}.card{padding:16px}
 .responsive-table th,.responsive-table td{white-space:normal;overflow-wrap:anywhere}
 .responsive-table .row-actions{flex-wrap:wrap}
}
@media(max-width:1000px){
 main .responsive-table,main .responsive-table tbody,main .responsive-table tfoot{display:block;width:100%;max-width:100%;table-layout:auto}
 main .responsive-table .responsive-head{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}
 main .responsive-table tr:not(.responsive-head){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;border:1px solid #e2e8f0;border-radius:8px;padding:10px;margin:0 0 12px;background:#fff}
 main .responsive-table td{display:block;width:auto!important;min-width:0!important;max-width:100%;white-space:normal;overflow-wrap:anywhere;padding:9px 4px;text-align:left}
 main .responsive-table td::before{content:attr(data-label);display:block;font-weight:700;color:#475569;font-size:11px;margin-bottom:6px;text-align:left}
 main .responsive-table .responsive-empty,main .responsive-table .responsive-actions,main .responsive-table td:has(.search-picker){grid-column:1/-1}
 main .responsive-table .responsive-empty::before{display:none}
 main .responsive-table .row-actions{display:flex;flex-wrap:wrap;gap:8px}
 main .responsive-table .row-actions form{display:inline-flex}
 main .table-responsive{overflow:visible}
 #order-items .item-picker,#order-items input,#order-items select,#order-items [name=item_notes],#order-items [data-unit-output],#order-items [data-line-total]{min-width:0;width:100%}
 #order-items [data-unit-output],#order-items [data-line-total]{text-align:left;padding:9px 4px}
}
@media(max-width:760px){
 main{padding:14px}.card{padding:14px;margin:12px 0}
 .form,.grid,.four{grid-template-columns:1fr}
 .page-heading{display:block}.page-heading>.actions{margin-top:12px}
 .actions{gap:8px}.actions>button,.actions>.button{white-space:normal;max-width:100%;min-height:42px}
 button,.button,.action-edit,.action-delete{min-height:40px}
 .row-actions .icon-action{width:42px;height:42px;min-height:42px;flex-basis:42px}
 .payables-table .row-actions{min-width:0;gap:6px}
 .brand{gap:8px}.brand>div{flex:1}.brand strong{font-size:1rem}
 .company-logo{width:40px;height:40px;flex-basis:40px}
 #menu-toggle{min-height:40px;width:40px;flex:0 0 40px}
 nav a{min-height:44px}.work-tabs{gap:14px}
 input,select,textarea{font-size:16px}input[type=file]{padding:8px 5px;font-size:13px}
 .picker-results{max-width:calc(100vw - 24px)}.picker-results [role=option]{min-height:44px;overflow-wrap:anywhere}
 .auth-shell,.auth-brand,.auth-form{min-width:0;max-width:100%}.auth-page{padding:14px}.auth-brand,.auth-form{padding:22px}.auth-brand{min-height:180px}.auth-brand h1{font-size:1.7rem}
 .stat,.four .stat{font-size:1.8rem;overflow-wrap:anywhere}
 summary.reversal-toggle{max-width:100%}
}
@media(max-width:380px){
 main .responsive-table tr:not(.responsive-head),.payables-table tr{grid-template-columns:minmax(0,1fr)}
 .actions{align-items:stretch}.actions>button,.actions>.button{flex-grow:1}
}

@media(max-width:1000px){main .responsive-table td:has([name=item_notes]){grid-column:1/-1}}
