:root {
  --navy-950: #052b4b;
  --navy-900: #073c69;
  --navy-800: #0c4b7d;
  --navy-700: #175f93;
  --blue-100: #dceaf4;
  --blue-50: #eef5fa;
  --ink-900: #18222d;
  --ink-700: #3f4d5b;
  --ink-500: #6d7a87;
  --line: #dbe3ea;
  --surface: #ffffff;
  --background: #f3f6f8;
  --success: #1c7a55;
  --success-bg: #e8f6f0;
  --danger: #b42335;
  --danger-bg: #fcecee;
  --warning: #a45f08;
  --warning-bg: #fff3dd;
  --shadow: 0 14px 35px rgba(5, 43, 75, 0.08);
  --radius: 16px;
  --sidebar: 268px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { margin: 0; min-height: 100vh; color: var(--ink-900); background: var(--background); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; background: linear-gradient(180deg, var(--navy-950), var(--navy-900)); color: #fff; z-index: 40; overflow-y: auto; box-shadow: 8px 0 30px rgba(3, 27, 47, .16); }
.sidebar::before { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; left: -140px; top: 120px; box-shadow: 0 0 0 42px rgba(255,255,255,.025), 0 0 0 84px rgba(255,255,255,.02); pointer-events: none; }
.brand { min-height: 102px; padding: 18px 18px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid rgba(255,255,255,.1); position: relative; }
.brand img { width: 62px; height: 62px; object-fit: cover; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-family: Georgia, serif; font-size: 1.35rem; letter-spacing: .18em; }
.brand-text span { color: rgba(255,255,255,.67); font-size: .75rem; }
.main-nav { padding: 18px 12px; display: grid; gap: 5px; position: relative; }
.nav-link { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 10px 13px; color: rgba(255,255,255,.75); border-radius: 11px; transition: .2s ease; font-size: .93rem; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.nav-link.active { background: #fff; color: var(--navy-900); box-shadow: 0 9px 24px rgba(0,0,0,.13); font-weight: 700; }
.nav-icon { width: 24px; text-align: center; font-size: 1.1rem; font-weight: 700; }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.1); position: relative; }
.profile-link { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 12px; }
.profile-link > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.profile-link strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .86rem; }
.profile-link small { color: rgba(255,255,255,.6); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18); font-weight: 800; }
.btn-logout { width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.8); background: transparent; }
.btn-logout:hover { background: rgba(255,255,255,.08); color: #fff; }

.main-content { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 72px; padding: 0 30px; display: flex; align-items: center; gap: 16px; justify-content: space-between; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(12px); }
.topbar-label { color: var(--ink-500); font-size: .84rem; letter-spacing: .04em; }
.topbar-user { padding: 7px 11px; background: var(--blue-50); color: var(--navy-800); border-radius: 999px; font-size: .78rem; font-weight: 700; }
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy-900); }
.content-area { padding: 28px 30px 48px; max-width: 1700px; margin: 0 auto; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin: 4px 0 24px; }
.page-header h1 { margin: 3px 0 5px; font-size: clamp(1.7rem, 3vw, 2.35rem); letter-spacing: -.035em; line-height: 1.1; }
.page-header p { margin: 0; color: var(--ink-500); }
.eyebrow { color: var(--navy-700); text-transform: uppercase; font-weight: 800; letter-spacing: .12em; font-size: .7rem; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn { min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; font-size: .9rem; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy-900); color: #fff; box-shadow: 0 8px 20px rgba(7,60,105,.17); }
.btn-primary:hover { background: var(--navy-800); }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink-900); }
.btn-secondary:hover { border-color: #b9c7d2; }
.btn-ghost { color: var(--ink-500); background: transparent; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--navy-800); font-weight: 800; }
.btn-icon:hover { background: var(--blue-50); }
.btn-icon.danger { color: var(--danger); }
.table-actions form { display: inline-flex; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.panel-narrow { max-width: 720px; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.panel-header h2 { font-size: 1.05rem; margin: 0 0 3px; }
.panel-header p { margin: 0; color: var(--ink-500); font-size: .86rem; }
.panel-header > a { color: var(--navy-700); font-weight: 700; font-size: .85rem; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { min-height: 134px; padding: 19px; display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 80px; height: 80px; border: 12px solid var(--blue-50); border-radius: 50%; right: -32px; bottom: -38px; }
.stat-icon { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-50); color: var(--navy-800); font-weight: 850; }
.stat-card div { display: flex; flex-direction: column; min-width: 0; }
.stat-card small { color: var(--ink-500); font-weight: 700; }
.stat-card strong { font-size: 1.45rem; margin: 4px 0 2px; letter-spacing: -.03em; }
.stat-card span:last-child { color: var(--ink-500); font-size: .75rem; }
.dashboard-grid, .detail-grid, .quote-bottom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.list-stack { display: grid; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 13px 0; border-top: 1px solid #edf1f4; }
.list-row:first-child { border-top: 0; padding-top: 2px; }
.list-row:hover strong { color: var(--navy-700); }
.list-row > div { display: flex; flex-direction: column; }
.list-row span, td small { color: var(--ink-500); font-size: .76rem; display: block; margin-top: 2px; }
.list-value { align-items: flex-end; white-space: nowrap; font-weight: 750; }
.list-value small { margin-top: 5px; }
.danger-text { color: var(--danger) !important; }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar > input, .filter-bar > select { min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 170px; }
.search-field { flex: 1 1 300px; min-width: 220px; min-height: 42px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; }
.search-field input { border: 0; outline: 0; width: 100%; background: transparent; }
.search-field span { color: var(--ink-500); }

.table-wrap { overflow-x: auto; border-radius: 11px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { background: #f7f9fb; color: var(--ink-500); font-size: .72rem; text-transform: uppercase; letter-spacing: .055em; text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
td { padding: 13px 12px; border-bottom: 1px solid #edf1f4; vertical-align: middle; font-size: .88rem; }
tbody tr:hover { background: #fbfdfe; }
tbody tr:last-child td { border-bottom: 0; }
td strong { display: block; }
.actions-col { width: 100px; text-align: right; }
.table-actions { display: flex; justify-content: flex-end; gap: 6px; }
.table-link { color: var(--navy-800); }
.empty-cell { text-align: center; color: var(--ink-500); padding: 35px; }

.badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 4px 8px; font-size: .68rem; line-height: 1.25; font-weight: 800; white-space: nowrap; }
.badge-success { color: var(--success); background: var(--success-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-info { color: var(--navy-800); background: var(--blue-50); }
.badge-neutral { color: #596673; background: #edf1f4; }

.form-page { display: grid; gap: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.one-column { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: .78rem; color: var(--ink-700); font-weight: 760; }
.field > small { color: var(--ink-500); font-size: .72rem; }
.field input, .field select, .field textarea, .quote-items-table input, .quote-items-table select { width: 100%; min-height: 43px; border: 1px solid #cdd8e1; border-radius: 10px; padding: 9px 11px; color: var(--ink-900); background: #fff; outline: none; transition: .16s ease; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .quote-items-table input:focus, .quote-items-table select:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(23,95,147,.11); }
.field-span-2 { grid-column: span 2; }
.inline-options { display: flex; gap: 25px; flex-wrap: wrap; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.check { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-700); font-size: .86rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--navy-800); }
.check.centered { width: 100%; justify-content: center; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.sticky-actions { position: sticky; bottom: 12px; z-index: 18; background: rgba(243,246,248,.92); padding: 12px; border-radius: 13px; backdrop-filter: blur(10px); border: 1px solid rgba(219,227,234,.9); }
.permission-table td:not(:first-child), .permission-table th:not(:first-child) { text-align: center; }
.stock-chip { padding: 8px 12px; border-radius: 10px; background: var(--success-bg); color: var(--success); font-size: .82rem; }
.stock-chip.low { background: var(--danger-bg); color: var(--danger); }
.stock-current { background: var(--blue-50); color: var(--navy-800); border-radius: 10px; padding: 12px 14px; font-weight: 700; }

.alert { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; border-radius: 11px; margin-bottom: 18px; border: 1px solid transparent; font-size: .88rem; }
.alert-success { color: var(--success); background: var(--success-bg); border-color: #c8eadd; }
.alert-danger { color: var(--danger); background: var(--danger-bg); border-color: #f4cbd1; }
.alert-warning { color: var(--warning); background: var(--warning-bg); border-color: #f5ddad; }
.alert-info { color: var(--navy-800); background: var(--blue-50); border-color: #cadfec; }
.alert-close { border: 0; background: transparent; font-size: 1.25rem; color: inherit; }
.notice { padding: 13px 14px; border-radius: 10px; color: var(--navy-800); background: var(--blue-50); font-size: .85rem; }
.notice.success { color: var(--success); background: var(--success-bg); }
.empty-state { display: grid; place-items: center; text-align: center; padding: 45px 20px; color: var(--ink-500); }
.empty-state strong { color: var(--ink-900); }
.empty-state.compact { padding: 25px 15px; }
.empty-state span { font-size: .83rem; }

.quote-items-table { min-width: 1040px; }
.quote-items-table th:nth-child(1) { width: 250px; }
.quote-items-table th:nth-child(2) { width: 240px; }
.quote-items-table th:nth-child(3), .quote-items-table th:nth-child(4), .quote-items-table th:nth-child(5) { width: 105px; }
.quote-line-total { font-weight: 800; white-space: nowrap; }
.totals-panel { align-self: start; }
.totals-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.totals-row.grand { margin-top: 13px; border: 0; background: var(--navy-950); color: #fff; border-radius: 12px; padding: 17px; }
.totals-row.grand strong { font-size: 1.35rem; }

.quote-document { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; margin-bottom: 20px; }
.quote-document-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; padding-bottom: 22px; border-bottom: 2px solid var(--navy-900); }
.quote-brand { display: flex; align-items: center; gap: 14px; }
.quote-brand img { width: 74px; height: 74px; object-fit: cover; border-radius: 14px; }
.quote-brand div { display: flex; flex-direction: column; }
.quote-brand strong { font-family: Georgia, serif; color: var(--navy-900); font-size: 1.8rem; letter-spacing: .16em; }
.quote-brand span { color: var(--ink-500); font-size: .8rem; }
.quote-number { display: flex; flex-direction: column; align-items: flex-end; }
.quote-number > span { color: var(--ink-500); font-size: .7rem; letter-spacing: .15em; font-weight: 800; }
.quote-number > strong { font-size: 1.35rem; color: var(--navy-900); margin: 2px 0 6px; }
.quote-number small { color: var(--ink-500); }
.quote-status-line { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 0; }
.quote-customer { padding: 18px; background: #f7f9fb; border-radius: 12px; margin-bottom: 18px; }
.quote-customer > span { color: var(--ink-500); font-size: .68rem; letter-spacing: .12em; font-weight: 800; }
.quote-customer > strong { display: block; margin: 3px 0; font-size: 1.08rem; }
.quote-customer p { margin: 2px 0; color: var(--ink-500); font-size: .82rem; }
.quote-document-table { min-width: 900px; }
.quote-summary { display: grid; grid-template-columns: 1fr 330px; gap: 30px; margin-top: 24px; }
.quote-summary p { color: var(--ink-700); }
.quote-summary-values p { display: flex; justify-content: space-between; gap: 20px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quote-summary-values .grand { border: 0; background: var(--navy-950); color: #fff; border-radius: 10px; padding: 14px; margin-top: 9px; }
.quote-summary-values .grand strong { font-size: 1.2rem; }
.danger-zone { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.timeline { display: grid; gap: 0; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 12px; min-height: 76px; }
.timeline-item > span { width: 10px; height: 10px; border-radius: 50%; background: var(--navy-700); margin-top: 5px; position: relative; }
.timeline-item > span::after { content: ""; width: 2px; position: absolute; top: 12px; bottom: -66px; left: 4px; background: var(--line); }
.timeline-item:last-child > span::after { display: none; }
.timeline-item p { margin: 2px 0; color: var(--ink-700); }
.timeline-item small { color: var(--ink-500); }

details summary { color: var(--navy-700); cursor: pointer; font-weight: 700; }
details pre, .error-details { max-width: 560px; white-space: pre-wrap; overflow-wrap: anywhere; background: #101820; color: #e4edf5; padding: 12px; border-radius: 8px; font-size: .72rem; }

.login-body { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; background: #fff; }
.login-visual { position: relative; overflow: hidden; min-height: 100vh; background: linear-gradient(145deg, var(--navy-950), #0a4d7d 65%, #1e6899); }
.login-visual::before { content: ""; position: absolute; width: 560px; height: 560px; border: 2px solid rgba(255,255,255,.08); border-radius: 50%; left: -240px; top: -180px; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02); }
.login-visual::after { content: ""; position: absolute; width: 360px; height: 360px; right: -110px; bottom: -100px; transform: rotate(18deg); border: 40px solid rgba(255,255,255,.04); }
.login-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(3,25,43,.35), transparent 60%); }
.login-copy { position: absolute; left: clamp(38px, 8vw, 120px); right: clamp(38px, 10vw, 140px); bottom: 12vh; color: #fff; z-index: 2; }
.login-copy .eyebrow { color: #b9d7eb; }
.login-copy h1 { max-width: 720px; font-size: clamp(2.4rem, 5vw, 4.8rem); letter-spacing: -.055em; line-height: .98; margin: 12px 0 20px; }
.login-copy p { color: rgba(255,255,255,.72); max-width: 620px; font-size: 1.05rem; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #f8fafb; }
.login-card { width: min(430px, 100%); }
.login-logo { width: 105px; height: 105px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 24px; }
.login-heading h2 { margin: 0; font-size: 2rem; letter-spacing: -.035em; }
.login-heading p { color: var(--ink-500); margin: 5px 0 24px; }
.form-stack { display: grid; gap: 16px; }
.login-help { color: var(--ink-500); font-size: .76rem; margin-top: 18px; }
.error-body { min-height: 100vh; display: grid; place-items: center; background: var(--background); padding: 30px; }
.error-card { max-width: 680px; margin: 8vh auto; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 42px; box-shadow: var(--shadow); }
.error-code { font-size: 4rem; font-weight: 900; color: var(--navy-900); line-height: 1; }
.error-card h1 { margin: 12px 0 8px; }
.error-card p { color: var(--ink-500); }
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); transition: transform .24s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(3,25,43,.45); z-index: 35; }
  .sidebar-backdrop.show { display: block; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: grid; place-items: center; }
  .topbar { padding: 0 18px; justify-content: flex-start; }
  .topbar-user { margin-left: auto; }
  .content-area { padding: 22px 18px 40px; }
  .login-body { grid-template-columns: 1fr; }
  .login-visual { min-height: 310px; }
  .login-copy { inset: auto 28px 30px; }
  .login-copy h1 { font-size: 2.3rem; }
  .login-copy p { display: none; }
  .login-panel { padding: 34px 24px 50px; }
  .quote-summary { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .page-header { align-items: stretch; flex-direction: column; }
  .page-header .btn { width: 100%; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; }
  .stats-grid, .form-grid, .dashboard-grid, .detail-grid, .quote-bottom-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .panel { padding: 16px; border-radius: 13px; }
  .filter-bar { align-items: stretch; }
  .filter-bar > *, .filter-bar .btn { width: 100%; }
  .topbar-label { display: none; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .sticky-actions { bottom: 6px; }
  .quote-document { padding: 18px; }
  .quote-document-header { flex-direction: column; }
  .quote-number { align-items: flex-start; }
  .quote-brand img { width: 60px; height: 60px; }
  .quote-status-line { justify-content: flex-start; flex-wrap: wrap; }
  .stats-grid { gap: 12px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .print-hide, .alert { display: none !important; }
  .main-content { margin: 0; }
  .content-area { padding: 0; max-width: none; }
  .quote-document { box-shadow: none; border: 0; padding: 0; margin: 0; }
  .quote-document-table { min-width: 0; }
  .table-wrap { overflow: visible; }
  @page { size: A4; margin: 12mm; }
}

/* MSBA Controle v1.2 — navegação agrupada, dashboard e transições */
.sidebar,
.main-content { transition: transform .24s ease, margin-left .24s ease; }
.menu-toggle { display: grid; place-items: center; flex: 0 0 auto; }
.menu-toggle-lines { line-height: 1; font-size: 1.08rem; }
.app-shell.sidebar-collapsed .sidebar { transform: translateX(-105%); }
.app-shell.sidebar-collapsed .main-content { margin-left: 0; }

.main-nav { gap: 9px; }
.nav-link-dashboard { margin-bottom: 3px; }
.nav-group { display: grid; gap: 4px; }
.nav-group-toggle { width: 100%; min-height: 38px; padding: 7px 11px; border: 0; border-radius: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: transparent; color: rgba(255,255,255,.62); text-transform: uppercase; letter-spacing: .09em; font-size: .66rem; font-weight: 800; transition: background .2s ease, color .2s ease; }
.nav-group-toggle > span:first-child { display: flex; align-items: center; gap: 9px; }
.nav-group-toggle:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-group-icon { width: 22px; text-align: center; font-size: .88rem; }
.nav-chevron { font-size: .95rem; transition: transform .2s ease; }
.nav-group-items { display: grid; gap: 4px; overflow: hidden; max-height: 280px; opacity: 1; transition: max-height .24s ease, opacity .18s ease; }
.nav-group .nav-link { padding-left: 17px; min-height: 43px; }
.nav-group.collapsed .nav-group-items { max-height: 0; opacity: 0; pointer-events: none; }
.nav-group.collapsed .nav-chevron { transform: rotate(-90deg); }
.nav-group.has-active .nav-group-toggle { color: rgba(255,255,255,.9); }

.dashboard-filter-panel { margin-bottom: 22px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: 0 10px 30px rgba(5,43,75,.055); }
.dashboard-filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.compact-field { min-width: 155px; flex: 1 1 155px; }
.compact-field > span { font-size: .69rem; }
.custom-date-fields { display: none; align-items: end; gap: 12px; flex: 2 1 330px; }
.custom-date-fields.show { display: flex; }
.dashboard-filter-button { min-height: 43px; }
.filter-note { display: flex; align-items: center; gap: 8px; margin-top: 11px; color: var(--ink-500); font-size: .76rem; }
.filter-note-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--navy-700); box-shadow: 0 0 0 4px var(--blue-50); }

.dashboard-alerts { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.dashboard-alert { display: inline-flex; align-items: center; min-height: 38px; padding: 9px 13px; border: 1px solid transparent; border-radius: 999px; font-size: .78rem; font-weight: 750; transition: transform .2s ease, box-shadow .2s ease; }
a.dashboard-alert:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(5,43,75,.1); }
.dashboard-alert-danger { color: var(--danger); background: var(--danger-bg); border-color: #f4cbd1; }
.dashboard-alert-warning { color: var(--warning); background: var(--warning-bg); border-color: #f5ddad; }
.dashboard-alert-info { color: var(--navy-800); background: var(--blue-50); border-color: #cadfec; }
.dashboard-alert-success { color: var(--success); background: var(--success-bg); border-color: #c8eadd; }

.dashboard-section { margin: 0 0 38px; }
.dashboard-section-stock { padding-top: 28px; border-top: 1px solid var(--line); }
.dashboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 17px; }
.dashboard-section-heading h2 { margin: 2px 0 3px; font-size: 1.45rem; letter-spacing: -.025em; }
.dashboard-section-heading p { margin: 0; color: var(--ink-500); font-size: .84rem; }
.section-kicker { display: inline-flex; align-items: center; min-height: 23px; padding: 4px 8px; border-radius: 6px; color: var(--navy-800); background: var(--blue-50); text-transform: uppercase; letter-spacing: .11em; font-size: .62rem; font-weight: 850; }
.section-link { color: var(--navy-700); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.section-link:hover { color: var(--navy-950); }

.dashboard-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { min-width: 0; position: relative; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 10px 26px rgba(5,43,75,.05); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.metric-card::after { content: ""; position: absolute; width: 105px; height: 105px; right: -52px; bottom: -60px; border-radius: 50%; background: rgba(23,95,147,.055); }
.metric-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(5,43,75,.09); border-color: #c7d6e1; }
.metric-card-attention { border-color: #f0dbb1; }
.metric-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 31px; margin-bottom: 10px; }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; color: var(--navy-800); background: var(--blue-50); font-size: .78rem; font-weight: 900; }
.metric-card small { display: block; color: var(--ink-500); font-size: .72rem; }
.metric-card > strong { display: block; margin: 4px 0 3px; color: var(--navy-950); font-size: clamp(1.25rem, 2vw, 1.75rem); letter-spacing: -.045em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-caption { display: block; color: var(--ink-500); font-size: .69rem; }
.metric-trend, .metric-badge { min-height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 4px 7px; border-radius: 999px; font-size: .63rem; font-weight: 850; }
.metric-trend.positive { color: var(--success); background: var(--success-bg); }
.metric-trend.negative { color: var(--danger); background: var(--danger-bg); }
.metric-trend.neutral, .metric-badge.neutral { color: var(--ink-500); background: #f0f3f5; }
.metric-badge.warning { color: var(--warning); background: var(--warning-bg); }

.dashboard-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-chart-grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(320px, .7fr); }
.chart-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 12px 30px rgba(5,43,75,.055); }
.chart-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.chart-card-header h3 { margin: 0 0 3px; font-size: 1rem; letter-spacing: -.015em; }
.chart-card-header p { margin: 0; color: var(--ink-500); font-size: .76rem; }
.chart-chip { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: var(--navy-800); background: var(--blue-50); font-size: .62rem; font-weight: 800; }
.chart-stage { height: 315px; position: relative; }
.chart-stage-doughnut { height: 315px; }
.chart-stage canvas { position: relative; z-index: 1; }
.chart-skeleton { position: absolute; inset: 0; z-index: 3; border-radius: 11px; opacity: 0; visibility: hidden; background: linear-gradient(90deg, #f0f3f5 25%, #f7f9fa 45%, #f0f3f5 65%); background-size: 220% 100%; animation: dashboard-shimmer 1.25s linear infinite; transition: opacity .15s ease; }
.chart-card.is-loading .chart-skeleton { opacity: 1; visibility: visible; }
.dashboard-list-panel { margin-bottom: 0; }

.quote-items-free { min-width: 1210px; }
.quote-items-free th:nth-child(1) { width: 250px; }
.quote-items-free th:nth-child(2) { width: 270px; }
.quote-items-free th:nth-child(3) { width: 75px; }
.quote-items-free th:nth-child(4) { width: 92px; }
.quote-items-free th:nth-child(5),
.quote-items-free th:nth-child(6) { width: 125px; }
.quote-items-free th:nth-child(7) { width: 120px; }
.quote-product-name { font-weight: 700; }
.quote-unit { text-transform: uppercase; text-align: center; }

@keyframes dashboard-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (max-width: 1180px) {
  .dashboard-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-chart-grid-main, .dashboard-chart-grid { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: auto; }
}

@media (max-width: 900px) {
  .app-shell.sidebar-collapsed .sidebar { transform: translateX(-105%); }
  .app-shell.sidebar-collapsed .main-content { margin-left: 0; }
  .sidebar.open { transform: translateX(0) !important; }
  .dashboard-filters { align-items: stretch; }
  .custom-date-fields { flex-basis: 100%; }
  .commercial-filter { flex-basis: calc(50% - 6px); }
}

@media (max-width: 700px) {
  .dashboard-section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .dashboard-metric-grid { grid-template-columns: 1fr; }
  .dashboard-chart-grid { grid-template-columns: 1fr; }
  .dashboard-filters, .custom-date-fields { flex-direction: column; }
  .compact-field, .commercial-filter { width: 100%; flex-basis: auto; }
  .dashboard-filter-button { width: 100%; }
  .chart-stage, .chart-stage-doughnut { height: 280px; }
  .dashboard-alert { width: 100%; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* MSBA Controle v1.3 — inteligência comercial */
.dashboard-metric-grid-secondary { margin-top: 2px; }
.metric-card-compact { padding-top: 16px; padding-bottom: 16px; }
.metric-card-compact > strong { font-size: clamp(1.12rem, 1.7vw, 1.5rem); }
.dashboard-insights-grid,
.dashboard-list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-ranking-grid { margin-top: 0; }
.chart-stage-ranking { height: 340px; }
.dashboard-async-card,
.dashboard-async-section { transition: opacity .18s ease, filter .18s ease; }
.dashboard-async-card.is-refreshing,
.dashboard-async-section.is-refreshing { opacity: .68; }

.funnel-panel,
.comparison-panel { min-width: 0; }
.quote-funnel { display: grid; justify-items: center; gap: 9px; padding: 4px 0 1px; }
.funnel-step { --funnel-width: 100%; width: var(--funnel-width); min-width: 210px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 69px; padding: 13px 17px; border: 1px solid transparent; color: #fff; clip-path: polygon(3% 0, 97% 0, 100% 50%, 97% 100%, 3% 100%, 0 50%); transition: width .45s cubic-bezier(.22,.8,.25,1), transform .2s ease; }
.funnel-step:hover { transform: translateY(-2px); }
.funnel-step > div { display: flex; align-items: baseline; gap: 10px; }
.funnel-step span { font-size: .79rem; font-weight: 780; }
.funnel-step strong { font-size: 1.55rem; letter-spacing: -.04em; }
.funnel-step small { color: rgba(255,255,255,.78); font-size: .67rem; text-align: right; }
.funnel-step-sent { background: linear-gradient(100deg, #073c69, #175f93); border-color: #286e9f; }
.funnel-step-responded { background: linear-gradient(100deg, #9a661c, #d18a25); border-color: #dda14d; }
.funnel-step-approved { background: linear-gradient(100deg, #14583e, #1c7a55); border-color: #368b69; }

.comparison-table-wrap { overflow: auto; max-height: 315px; border: 1px solid var(--line); border-radius: 11px; }
.comparison-table { min-width: 610px; margin: 0; }
.comparison-table th,
.comparison-table td { padding: 10px 12px; font-size: .73rem; }
.comparison-table thead th { position: sticky; top: 0; z-index: 2; background: #f7f9fa; color: var(--ink-500); font-size: .64rem; text-transform: uppercase; letter-spacing: .055em; }
.comparison-table tbody th { color: var(--navy-950); font-weight: 750; text-align: left; }
.comparison-change { display: inline-flex; align-items: center; justify-content: center; min-width: 65px; padding: 4px 7px; border-radius: 999px; font-size: .63rem; font-weight: 850; }
.comparison-change.positive { color: var(--success); background: var(--success-bg); }
.comparison-change.negative { color: var(--danger); background: var(--danger-bg); }
.comparison-change.neutral { color: var(--ink-500); background: #f0f3f5; }

.list-row-attention { border-left: 3px solid #d18a25; padding-left: 13px; }
.stalled-days { color: var(--warning); font-size: .82rem; font-weight: 850; }

.filter-bar select[name="company_id"],
.filter-bar select[name="user_id"] { min-width: 170px; }
.quote-status-age { display: grid; gap: 2px; color: var(--ink-500); font-size: .7rem; }
.quote-status-age strong { color: var(--ink-700); font-size: .76rem; }

@media (max-width: 1180px) {
  .dashboard-insights-grid,
  .dashboard-list-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .funnel-step { min-width: 180px; padding: 12px 14px; }
  .funnel-step > div { gap: 7px; }
  .funnel-step strong { font-size: 1.3rem; }
  .funnel-step small { max-width: 92px; }
  .chart-stage-ranking { height: 310px; }
}
.filter-result-note { margin: 0 0 14px; padding: 9px 11px; border-left: 3px solid #d18a25; border-radius: 6px; color: #7b541b; background: #fff8e9; font-size: .75rem; }

/* MSBA Controle v1.4 — inteligência de estoque */
.form-help-card { margin-top: 17px; padding: 14px 16px; border: 1px solid #d5e3ed; border-left: 4px solid var(--navy-700); border-radius: 11px; background: linear-gradient(100deg, var(--blue-50), #fff); }
.form-help-card strong { display: block; color: var(--navy-900); margin-bottom: 3px; font-size: .85rem; }
.form-help-card p { margin: 0; color: var(--ink-500); font-size: .78rem; }
.table-title-link, .table-cell-stack { display: flex; flex-direction: column; min-width: 0; }
.table-title-link strong { color: var(--navy-950); }
.table-title-link:hover strong { color: var(--navy-700); }
.table-title-link small, .table-cell-stack small { color: var(--ink-500); font-size: .72rem; margin-top: 2px; }
.success-text { color: var(--success) !important; }
.warning-text { color: var(--warning) !important; }
.table-actions-cell { width: 92px; }

.inventory-filter-panel { margin-bottom: 16px; }
.inventory-filters { gap: 11px; }
.inventory-search { flex: 1 1 310px; }
.inventory-filters .compact-field { min-width: 145px; }
.analysis-method-chip { display: inline-flex; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-500); background: #fff; font-size: .68rem; font-weight: 750; white-space: nowrap; }
.inventory-summary-grid { margin-bottom: 14px; }
.inventory-summary-secondary { margin-bottom: 17px; }
.inventory-chart-main { grid-template-columns: minmax(300px, .72fr) minmax(0, 1.45fr); }
.inventory-chart-secondary { margin-bottom: 16px; }
.inventory-highlight-grid { margin-bottom: 16px; }
.inventory-table-panel { transition: opacity .18s ease; }
.inventory-table-panel.is-refreshing, .inventory-async-card.is-refreshing { opacity: .62; }
.inventory-table-wrap { max-height: 680px; border: 1px solid var(--line); }
.inventory-analysis-table { min-width: 1440px; }
.inventory-analysis-table thead th { position: sticky; top: 0; z-index: 4; }
.inventory-analysis-table td { font-size: .78rem; }
.inventory-analysis-table .badge { max-width: 150px; white-space: normal; text-align: center; }
.inventory-row.status-out { box-shadow: inset 3px 0 0 var(--danger); }
.inventory-row.status-critical { box-shadow: inset 3px 0 0 #d18a25; }
.inventory-row.status-stagnant { box-shadow: inset 3px 0 0 #8996a2; }
.inventory-row.status-excess { box-shadow: inset 3px 0 0 var(--navy-700); }
.inventory-row.status-healthy { box-shadow: inset 3px 0 0 var(--success); }

.product-detail-header { align-items: center; }
.product-detail-summary { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.5fr); gap: 16px; margin-bottom: 16px; }
.product-status-card { min-height: 132px; display: flex; flex-direction: column; justify-content: center; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.product-status-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -65px; bottom: -62px; border-radius: 50%; background: currentColor; opacity: .06; }
.product-status-card span { color: var(--ink-500); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 850; }
.product-status-card strong { margin: 5px 0 4px; font-size: 1.35rem; letter-spacing: -.025em; }
.product-status-card small { color: var(--ink-500); }
.product-status-card.status-healthy { color: var(--success); border-color: #c8eadd; background: linear-gradient(120deg, var(--success-bg), #fff 65%); }
.product-status-card.status-critical { color: var(--warning); border-color: #efd7a5; background: linear-gradient(120deg, var(--warning-bg), #fff 65%); }
.product-status-card.status-out { color: var(--danger); border-color: #efc7cd; background: linear-gradient(120deg, var(--danger-bg), #fff 65%); }
.product-status-card.status-stagnant { color: #596673; background: linear-gradient(120deg, #edf1f4, #fff 65%); }
.product-status-card.status-excess { color: var(--navy-700); border-color: #cadfec; background: linear-gradient(120deg, var(--blue-50), #fff 65%); }
.product-detail-meta { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.product-detail-meta div { padding: 17px 19px; border-bottom: 1px solid #edf1f4; }
.product-detail-meta div:nth-child(odd) { border-right: 1px solid #edf1f4; }
.product-detail-meta div:nth-last-child(-n+2) { border-bottom: 0; }
.product-detail-meta dt { color: var(--ink-500); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }
.product-detail-meta dd { margin: 4px 0 0; color: var(--navy-950); font-weight: 750; }
.period-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.period-tabs > span { color: var(--ink-500); font-size: .75rem; margin-right: 3px; }
.period-tab { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-500); font-size: .72rem; font-weight: 750; }
.period-tab:hover, .period-tab.active { color: #fff; border-color: var(--navy-800); background: var(--navy-800); }
.product-metric-grid { margin-bottom: 14px; }
.product-detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .65fr); gap: 16px; margin-bottom: 20px; }
.product-history-chart, .product-replenishment-panel { margin: 0; }
.analytics-definition-list { margin: 0; display: grid; }
.analytics-definition-list div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #edf1f4; }
.analytics-definition-list dt { color: var(--ink-500); font-size: .75rem; }
.analytics-definition-list dd { margin: 0; color: var(--navy-950); font-size: .78rem; font-weight: 800; text-align: right; }
.insight-callout { margin-top: 16px; padding: 13px 14px; border-radius: 10px; }
.insight-callout strong { display: block; margin-bottom: 3px; font-size: .8rem; }
.insight-callout p { margin: 0; font-size: .74rem; }
.insight-callout.warning { color: var(--warning); background: var(--warning-bg); }
.insight-callout.success { color: var(--success); background: var(--success-bg); }

@media (max-width: 1180px) {
  .inventory-chart-main { grid-template-columns: 1fr; }
  .product-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .product-detail-summary { grid-template-columns: 1fr; }
  .inventory-filters .compact-field { flex: 1 1 calc(50% - 10px); }
}

@media (max-width: 700px) {
  .product-detail-meta { grid-template-columns: 1fr; }
  .product-detail-meta div, .product-detail-meta div:nth-child(odd), .product-detail-meta div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid #edf1f4; }
  .product-detail-meta div:last-child { border-bottom: 0; }
  .inventory-filters .compact-field, .inventory-search { width: 100%; flex-basis: auto; }
  .period-tabs { align-items: stretch; }
  .period-tabs > span { width: 100%; }
}

/* MSBA Controle v1.5 — responsáveis e múltiplos fornecedores por item */
.quote-items-with-suppliers { min-width: 1510px; }
.quote-items-with-suppliers th:nth-child(1) { width: 230px; }
.quote-items-with-suppliers th:nth-child(2) { width: 235px; }
.quote-items-with-suppliers th:nth-child(3) { width: 285px; }
.quote-items-with-suppliers th:nth-child(4) { width: 72px; }
.quote-items-with-suppliers th:nth-child(5) { width: 90px; }
.quote-items-with-suppliers th:nth-child(6),
.quote-items-with-suppliers th:nth-child(7) { width: 118px; }
.quote-items-with-suppliers th:nth-child(8) { width: 118px; }
.quote-items-with-suppliers td { vertical-align: top; }
.quote-items-with-suppliers .quote-line-total { padding-top: 24px; }

.quote-supplier-picker { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 7px; align-items: start; min-width: 255px; }
.quote-supplier-list { display: grid; gap: 7px; }
.quote-supplier-entry { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 5px; align-items: center; }
.quote-supplier-entry select { min-height: 39px; padding: 7px 9px; font-size: .78rem; }
.quote-supplier-add,
.quote-supplier-remove { border: 1px solid var(--line); background: #fff; color: var(--navy-800); cursor: pointer; transition: .16s ease; }
.quote-supplier-add { width: 34px; height: 39px; border-radius: 10px; font-size: 1.18rem; font-weight: 800; }
.quote-supplier-remove { width: 30px; height: 30px; border-radius: 8px; color: var(--danger); font-size: 1rem; }
.quote-supplier-add:hover { border-color: var(--navy-700); background: var(--blue-50); transform: translateY(-1px); }
.quote-supplier-remove:hover { border-color: #efc2c8; background: var(--danger-bg); }

.quote-internal-panel { border-left: 4px solid var(--navy-700); }
.quote-internal-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.quote-internal-summary > div { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafb; }
.quote-internal-summary span { display: block; margin-bottom: 4px; color: var(--ink-500); font-size: .7rem; font-weight: 760; text-transform: uppercase; letter-spacing: .045em; }
.quote-internal-summary strong { color: var(--navy-950); font-size: .86rem; }
.quote-supplier-summary { display: grid; border-top: 1px solid var(--line); }
.quote-supplier-summary-row { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr); gap: 18px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf1f4; }
.quote-supplier-summary-row:last-child { border-bottom: 0; }
.quote-supplier-summary-row > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.quote-supplier-summary-row > div:first-child span { color: var(--ink-500); font-size: .68rem; font-weight: 750; }
.quote-supplier-summary-row > div:first-child strong { color: var(--navy-950); font-size: .84rem; }
.quote-supplier-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.supplier-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border: 1px solid #c9dce8; border-radius: 999px; color: var(--navy-800); background: var(--blue-50); font-size: .7rem; font-weight: 760; }
.supplier-badge.empty { color: var(--ink-500); border-color: var(--line); background: #f4f6f7; font-weight: 650; }
.filter-bar select[name="supplier_id"] { min-width: 180px; }

@media (max-width: 800px) {
  .quote-internal-summary { grid-template-columns: 1fr; }
  .quote-supplier-summary-row { grid-template-columns: 1fr; gap: 8px; }
}

/* MSBA Controle v1.6 — cotação profissional */
.btn-small { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: .76rem; }
.success-text { color: var(--success) !important; }
.revision-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid #c9dce8; border-radius: 999px; color: var(--navy-800); background: var(--blue-50); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.validity-pill { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border-radius: 999px; color: var(--success); background: var(--success-bg); font-size: .7rem; font-weight: 800; }
.validity-pill.warning { color: var(--warning); background: var(--warning-bg); }
.validity-pill.expired { color: var(--danger); background: var(--danger-bg); }

.quote-autosave-status { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-500); font-size: .75rem; font-weight: 700; box-shadow: 0 6px 18px rgba(5,43,75,.05); }
.autosave-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa8b5; transition: .2s ease; }
.quote-autosave-status[data-state="pending"] .autosave-dot { background: var(--warning); }
.quote-autosave-status[data-state="saving"] .autosave-dot { background: var(--navy-700); animation: autosave-pulse 1s infinite; }
.quote-autosave-status[data-state="saved"] .autosave-dot { background: var(--success); }
.quote-autosave-status[data-state="error"] { color: var(--danger); border-color: #efc2c8; }
.quote-autosave-status[data-state="error"] .autosave-dot { background: var(--danger); }
@keyframes autosave-pulse { 50% { transform: scale(1.45); opacity: .55; } }

.draft-restore-banner, .historical-version-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; margin-bottom: 20px; border: 1px solid #bcd4e4; border-radius: 14px; color: var(--navy-900); background: linear-gradient(135deg, #eef7fc, #fff); box-shadow: 0 10px 28px rgba(5,43,75,.06); }
.draft-restore-banner > div:first-child, .historical-version-banner { flex-wrap: wrap; }
.draft-restore-banner strong, .draft-restore-banner span { display: block; }
.draft-restore-banner span, .historical-version-banner span { margin-top: 2px; color: var(--ink-500); font-size: .8rem; }
.historical-version-banner { justify-content: flex-start; }

.quote-items-panel { overflow: visible; }
.quote-item-stack { display: grid; gap: 18px; }
.quote-item-card { border: 1px solid #d5e0e8; border-radius: 15px; background: #fbfdfe; overflow: visible; box-shadow: 0 8px 24px rgba(5,43,75,.045); }
.quote-item-card-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; border-bottom: 1px solid #e4ebf0; background: linear-gradient(90deg, #f3f8fb, #fff); border-radius: 15px 15px 0 0; }
.quote-item-card-header > div:first-child { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.quote-item-index { color: var(--navy-700); font-size: .68rem; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.quote-item-title { overflow: hidden; color: var(--navy-950); font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.quote-item-card-actions { display: flex; align-items: center; gap: 10px; }
.quote-item-card .quote-line-total { color: var(--navy-900); font-size: .92rem; }
.quote-item-main-grid { display: grid; grid-template-columns: minmax(220px, 1.3fr) minmax(180px, 1fr) minmax(180px, 1fr) 90px 110px 150px 130px; gap: 12px; align-items: end; padding: 15px; }
.quote-item-main-grid .field { min-width: 0; }
.quote-item-main-grid .field-span-2 { grid-column: span 2; }
.quote-product-field { position: relative; }
.product-history-results { position: absolute; z-index: 25; top: calc(100% + 5px); left: 0; right: 0; max-height: 310px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 18px 40px rgba(5,43,75,.16); }
.product-history-row { width: 100%; display: grid; gap: 2px; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf1f4; color: var(--ink-900); background: #fff; text-align: left; }
.product-history-row:last-child { border-bottom: 0; }
.product-history-row:hover { background: var(--blue-50); }
.product-history-row strong { color: var(--navy-900); font-size: .78rem; }
.product-history-row span { color: var(--ink-700); font-size: .7rem; }
.product-history-row small { color: var(--ink-500); font-size: .65rem; }

.supplier-comparison-editor { padding: 0 15px 15px; }
.supplier-comparison-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-top: 1px dashed #d5e0e8; }
.supplier-comparison-heading > div { display: flex; flex-direction: column; }
.supplier-comparison-heading strong { color: var(--navy-900); font-size: .82rem; }
.supplier-comparison-heading span { color: var(--ink-500); font-size: .72rem; }
.supplier-offer-list { display: grid; gap: 11px; }
.supplier-offer-card { position: relative; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: .18s ease; }
.supplier-offer-card:hover { border-color: #bfd0dc; box-shadow: 0 9px 24px rgba(5,43,75,.055); }
.supplier-offer-card.best-cost { border-left: 4px solid var(--navy-700); }
.supplier-offer-card.winner { border-color: #79b99d; background: linear-gradient(135deg, #f1fbf6, #fff 58%); box-shadow: 0 9px 24px rgba(28,122,85,.08); }
.supplier-offer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.supplier-winner-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-700); font-size: .72rem; font-weight: 800; cursor: pointer; }
.supplier-winner-toggle input { accent-color: var(--success); }
.quote-supplier-remove { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #efcfd4; border-radius: 8px; color: var(--danger); background: #fff; font-size: 1rem; }
.quote-supplier-remove:hover { background: var(--danger-bg); }
.supplier-offer-grid { display: grid; grid-template-columns: minmax(200px, 1.2fr) repeat(4, minmax(105px, .7fr)); gap: 9px; align-items: end; }
.supplier-offer-grid .field { min-width: 0; }
.supplier-field-wide { grid-column: span 2; }
.supplier-offer-grid .field span { font-size: .65rem; }
.supplier-offer-grid .field input, .supplier-offer-grid .field select { min-height: 38px; padding: 7px 9px; font-size: .76rem; }
.supplier-offer-metrics { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf1f4; color: var(--ink-500); font-size: .7rem; }
.supplier-offer-metrics strong { color: var(--navy-950); margin-left: 3px; }
.supplier-best-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; color: var(--navy-800); background: var(--blue-50); font-size: .65rem; font-weight: 800; }
.supplier-best-badge.delivery { color: var(--warning); background: var(--warning-bg); }
.supplier-empty-hint { padding: 12px; border: 1px dashed #cfd9e1; border-radius: 10px; color: var(--ink-500); background: #fafcfd; font-size: .75rem; text-align: center; }
.supplier-empty-hint[hidden] { display: none; }
.totals-row.internal { color: var(--ink-700); border-top: 1px dashed var(--line); font-size: .78rem; }

.quote-internal-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.supplier-comparison-view { display: grid; gap: 15px; }
.supplier-comparison-item { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; }
.supplier-comparison-item > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 15px; background: #f7f9fb; border-bottom: 1px solid var(--line); }
.supplier-comparison-item > header > div { display: flex; flex-direction: column; }
.supplier-comparison-item > header span:first-child { color: var(--ink-500); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.supplier-comparison-item > header strong { color: var(--navy-950); font-size: .86rem; }
.supplier-comparison-item > header small { color: var(--ink-500); font-size: .7rem; }
.supplier-selected-label { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; color: var(--success); background: var(--success-bg); font-size: .68rem; font-weight: 800; }
.supplier-selected-label.neutral { color: var(--ink-500); background: #eef1f3; }
.supplier-comparison-table { min-width: 1060px; }
.supplier-comparison-table td { font-size: .77rem; }
.supplier-comparison-table td small { margin-top: 3px; }
.supplier-comparison-table tr.selected-row { background: #effaf4; }
.supplier-comparison-table tr.selected-row:hover { background: #e8f7ef; }
.supplier-condition-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.supplier-badge.selected { color: var(--success); border-color: #a9d8c3; background: var(--success-bg); }
.supplier-badge.delivery { color: var(--warning); border-color: #f0d7a9; background: var(--warning-bg); }

.reminder-list, .revision-list { display: grid; gap: 9px; }
.reminder-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.reminder-card > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.reminder-card strong { color: var(--navy-950); font-size: .82rem; }
.reminder-card p { margin: 2px 0; color: var(--ink-700); font-size: .74rem; }
.reminder-card small { color: var(--ink-500); font-size: .68rem; }
.reminder-card.overdue { border-color: #efc2c8; background: #fff8f8; }
.reminder-card.concluido { opacity: .72; }
.reminder-card.cancelado { opacity: .55; }
.reminder-status { width: fit-content; margin-bottom: 3px; color: var(--ink-500); font-size: .61rem; font-weight: 850; letter-spacing: .06em; }
.reminder-actions { display: flex; gap: 6px; }
.reminder-actions form { margin: 0; }
.revision-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: .16s ease; }
.revision-row:hover { border-color: #b8cbd9; background: var(--blue-50); }
.revision-row.current { border-left: 4px solid var(--success); }
.revision-row > div { display: flex; flex-direction: column; min-width: 0; }
.revision-row strong { color: var(--navy-900); font-size: .8rem; }
.revision-row span, .revision-row small { color: var(--ink-500); font-size: .68rem; }
.quote-activity-timeline .timeline-revision > span { background: var(--success); }
.quote-activity-timeline .timeline-reminder > span { background: var(--warning); }
.quote-activity-timeline .timeline-reminder-complete > span { background: #8996a2; }
.quote-activity-timeline a { color: var(--navy-700); font-weight: 750; }

.app-dialog { width: min(560px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 16px; background: transparent; box-shadow: 0 30px 80px rgba(3,27,47,.28); }
.app-dialog::backdrop { background: rgba(3,27,47,.52); backdrop-filter: blur(3px); }
.dialog-card { border-radius: 16px; overflow: hidden; background: #fff; }
.dialog-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 20px; border-bottom: 1px solid var(--line); }
.dialog-card h2 { margin: 3px 0; font-size: 1.2rem; }
.dialog-card p { margin: 0; color: var(--ink-500); font-size: .8rem; }
.dialog-close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-500); background: #fff; font-size: 1.2rem; }
.dialog-body { padding: 18px 20px; }
.dialog-card > footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; border-top: 1px solid var(--line); background: #f8fafb; }
.option-list { display: grid; gap: 9px; }
.check-option { display: flex; align-items: flex-start; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.check-option:hover { background: var(--blue-50); }
.check-option input { margin-top: 3px; accent-color: var(--navy-800); }
.check-option span { display: flex; flex-direction: column; }
.check-option strong { font-size: .8rem; }
.check-option small { color: var(--ink-500); font-size: .7rem; }

@media (max-width: 1450px) {
  .quote-item-main-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .quote-product-field { grid-column: span 2; }
  .quote-item-main-grid .field-span-2 { grid-column: span 2; }
  .supplier-offer-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .supplier-field-wide { grid-column: span 2; }
  .quote-internal-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .draft-restore-banner { align-items: flex-start; flex-direction: column; }
  .quote-item-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-product-field, .quote-item-main-grid .field-span-2 { grid-column: 1 / -1; }
  .supplier-offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supplier-field-wide { grid-column: 1 / -1; }
  .quote-internal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reminder-card, .revision-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .quote-autosave-status { width: 100%; justify-content: center; }
  .quote-item-card-header { align-items: flex-start; }
  .quote-item-card-header > div:first-child { flex-direction: column; gap: 2px; }
  .quote-item-main-grid, .supplier-offer-grid { grid-template-columns: 1fr; }
  .quote-product-field, .quote-item-main-grid .field-span-2, .supplier-field-wide { grid-column: auto; }
  .supplier-comparison-heading { align-items: flex-start; flex-direction: column; }
  .supplier-comparison-item > header { align-items: flex-start; flex-direction: column; }
  .quote-internal-summary { grid-template-columns: 1fr; }
  .reminder-actions { width: 100%; }
  .reminder-actions form, .reminder-actions .btn { flex: 1; width: 100%; }
}

@media print {
  .historical-version-banner { display: none !important; }
}
.supplier-comparison-heading .quote-supplier-add { width: auto; height: auto; min-height: 34px; padding: 7px 11px; font-size: .76rem; border-radius: 9px; }

/* MSBA Controle v1.8 — solicitações, pedidos e recebimentos de compras */
.permission-na { display: inline-flex; width: 100%; justify-content: center; color: #9aa6b2; }
.purchase-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.purchase-shortcut { min-height: 88px; padding: 15px; display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 11px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 9px 24px rgba(5,43,75,.045); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.purchase-shortcut > span { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--navy-800); background: var(--blue-50); font-weight: 850; }
.purchase-shortcut strong { align-self: end; font-size: .87rem; }
.purchase-shortcut small { align-self: start; color: var(--ink-500); font-size: .7rem; }
.purchase-shortcut:hover, .purchase-shortcut.active { transform: translateY(-2px); border-color: #bfd0dc; box-shadow: 0 13px 28px rgba(5,43,75,.08); }
.purchase-shortcut.active { background: linear-gradient(145deg, #fff, var(--blue-50)); }
.purchase-metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.purchase-metric-grid .metric-card:last-child { grid-column: span 1; }
.purchase-overview-grid { align-items: start; }
.purchase-order-row.is-late { border-left: 3px solid var(--danger); padding-left: 10px; }
.purchase-row-late { background: #fff8f8; }
.purchase-row-late:hover { background: #fff3f4; }
.purchase-progress { width: 100%; min-width: 90px; height: 7px; overflow: hidden; border-radius: 999px; background: #e8eef2; }
.purchase-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-700), #4d91bd); }
.purchase-items-table { min-width: 1260px; }
.purchase-items-table th:first-child { width: 270px; }
.purchase-items-table th:nth-child(2) { width: 120px; }
.purchase-items-table th:nth-child(3), .purchase-items-table th:nth-child(4) { width: 125px; }
.purchase-items-table th:nth-child(5) { width: 230px; }
.purchase-items-table th:nth-child(6) { width: 250px; }
.purchase-items-table th:last-child { width: 48px; }
.purchase-items-table input, .purchase-items-table select,
.purchase-request-items-show input, .purchase-request-items-show select,
.purchase-receipt-table input { width: 100%; min-height: 41px; padding: 8px 10px; border: 1px solid #cdd8e1; border-radius: 9px; background: #fff; outline: none; }
.purchase-items-table input:focus, .purchase-items-table select:focus,
.purchase-request-items-show input:focus, .purchase-request-items-show select:focus,
.purchase-receipt-table input:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(23,95,147,.1); }
.purchase-stock-display { display: inline-flex; min-height: 32px; align-items: center; padding: 6px 9px; border-radius: 8px; color: var(--navy-800); background: var(--blue-50); font-size: .77rem; font-weight: 750; white-space: nowrap; }
.purchase-line-total { white-space: nowrap; color: var(--navy-950); }
.purchase-form-total { margin-top: 16px; padding: 15px 17px; display: flex; align-items: center; justify-content: flex-end; gap: 20px; border-radius: 12px; color: var(--navy-950); background: linear-gradient(135deg, #f6f9fb, var(--blue-50)); }
.purchase-form-total span { color: var(--ink-500); font-size: .78rem; font-weight: 760; }
.purchase-form-total strong { min-width: 150px; text-align: right; font-size: 1.25rem; }
.purchase-totals-grid { align-items: start; }
.purchase-status-banner { margin-bottom: 20px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #cfe0eb; border-radius: 14px; background: linear-gradient(135deg, #fff, var(--blue-50)); box-shadow: 0 10px 28px rgba(5,43,75,.05); }
.purchase-status-banner > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.purchase-status-banner > strong { font-size: 1.35rem; color: var(--navy-950); }
.purchase-status-banner.is-danger { border-color: #efc9cf; background: linear-gradient(135deg, #fff, var(--danger-bg)); }
.purchase-late-note { color: var(--danger); font-size: .78rem; font-weight: 750; }
.purchase-detail-grid { align-items: start; }
.purchase-definition-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.purchase-definition-list > div { padding: 11px 0; border-bottom: 1px solid #edf1f4; }
.purchase-definition-list > div:nth-child(odd) { padding-right: 18px; }
.purchase-definition-list dt { color: var(--ink-500); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.purchase-definition-list dd { margin: 3px 0 0; color: var(--ink-900); font-weight: 680; }
.purchase-note { margin-top: 16px; padding: 14px; border-radius: 10px; background: #f7f9fb; }
.purchase-note p { margin: 5px 0 0; color: var(--ink-700); white-space: pre-wrap; }
.purchase-action-panel .form-stack + .form-stack { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.purchase-reject-form { margin-top: 16px; }
.purchase-request-items-show { min-width: 1280px; }
.purchase-request-items-show th:first-child { width: 250px; }
.purchase-generate-actions { margin-top: 16px; display: flex; align-items: end; justify-content: flex-end; gap: 12px; }
.purchase-generate-actions .field { width: min(310px, 100%); }
.purchase-order-summary { margin-top: 18px; display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.purchase-order-summary > span { padding: 8px 11px; border-radius: 9px; color: var(--ink-500); background: #f7f9fb; font-size: .76rem; }
.purchase-order-summary > span strong { margin-left: 7px; color: var(--ink-900); }
.purchase-order-summary .grand { color: #fff; background: var(--navy-950); }
.purchase-order-summary .grand strong { color: #fff; }
.purchase-receipt-table { min-width: 1020px; }
.purchase-receipt-table th:first-child { width: 260px; }
.purchase-history-stats .stat-card { min-height: 118px; }

@media (max-width: 1320px) {
  .purchase-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .purchase-shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .purchase-metric-grid { grid-template-columns: 1fr; }
  .purchase-shortcuts { grid-template-columns: 1fr; }
  .purchase-definition-list { grid-template-columns: 1fr; }
  .purchase-definition-list > div:nth-child(odd) { padding-right: 0; }
  .purchase-status-banner { align-items: flex-start; flex-direction: column; }
  .purchase-generate-actions { align-items: stretch; flex-direction: column; }
  .purchase-generate-actions .field, .purchase-generate-actions .btn { width: 100%; }
}
.dashboard-purchase-strip { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(238,245,250,.8)); box-shadow: 0 12px 30px rgba(5,43,75,.055); }
.dashboard-purchase-strip .dashboard-section-heading { margin-bottom: 15px; }
.dashboard-purchase-late-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.dashboard-purchase-late-list a { padding: 11px; display: flex; flex-direction: column; border: 1px solid #efc9cf; border-radius: 10px; background: rgba(255,255,255,.9); }
.dashboard-purchase-late-list a strong { color: var(--danger); font-size: .82rem; }
.dashboard-purchase-late-list a span { margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.dashboard-purchase-late-list a small { color: var(--ink-500); font-size: .66rem; }
@media (max-width: 1180px) { .dashboard-purchase-late-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .dashboard-purchase-strip { padding: 16px; } .dashboard-purchase-late-list { grid-template-columns: 1fr; } }

/* =========================================================
   MSBA v1.9 - Produtividade, pesquisa e personalização
   ========================================================= */
.topbar { justify-content: flex-start; min-height: 72px; height: auto; padding-block: 10px; }
.topbar-search { position: relative; flex: 1 1 440px; max-width: 680px; min-width: 220px; margin-right: auto; }
.topbar-search > input { width: 100%; height: 44px; padding: 10px 78px 10px 42px; border: 1px solid var(--line); border-radius: 13px; outline: 0; color: var(--ink-900); background: #f8fafb; transition: .18s ease; }
.topbar-search > input:focus { background: #fff; border-color: var(--navy-700); box-shadow: 0 0 0 4px rgba(23,95,147,.1); }
.topbar-search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--navy-700); font-size: 1.2rem; pointer-events: none; z-index: 2; }
.topbar-search kbd { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); padding: 3px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; color: var(--ink-500); background: #fff; font-size: .68rem; font-family: inherit; pointer-events: none; }
.global-search-suggestions { position: absolute; top: calc(100% + 9px); left: 0; right: 0; max-height: min(570px, calc(100vh - 100px)); overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 24px 55px rgba(5,43,75,.2); z-index: 90; padding: 8px; }
.global-search-suggestions section + section { border-top: 1px solid #edf1f4; margin-top: 5px; padding-top: 5px; }
.global-search-group-title { display: block; padding: 7px 10px 5px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .09em; font-size: .65rem; }
.global-search-suggestion { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; }
.global-search-suggestion:hover, .global-search-suggestion:focus { background: var(--blue-50); outline: none; }
.global-search-suggestion-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #e7f0f7; color: var(--navy-800); font-weight: 800; }
.global-search-suggestion div { min-width: 0; display: flex; flex-direction: column; }
.global-search-suggestion strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; }
.global-search-suggestion span:not(.global-search-suggestion-icon), .global-search-suggestion small { color: var(--ink-500); font-size: .7rem; }
.global-search-suggestion small { max-width: 150px; text-align: right; }
.global-search-footer { display: block; padding: 10px; margin-top: 5px; border-top: 1px solid var(--line); color: var(--navy-700); font-size: .8rem; font-weight: 800; text-align: center; }
.global-search-empty { padding: 24px 16px; color: var(--ink-500); font-size: .8rem; text-align: center; }

.topbar-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.topbar-action { position: relative; min-width: 43px; height: 43px; padding: 5px 8px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border: 1px solid transparent; border-radius: 11px; color: var(--ink-700); background: transparent; transition: .18s ease; }
.topbar-action:hover, .topbar-action.is-active { color: var(--navy-800); background: var(--blue-50); border-color: #d6e5ef; }
.topbar-action > span { font-size: 1rem; line-height: 1; font-weight: 800; }
.topbar-action > small { margin-top: 3px; font-size: .58rem; white-space: nowrap; }
.topbar-action b { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 999px; background: var(--danger); color: #fff; font-size: .58rem; }
.topbar-user { min-width: 150px; padding: 5px 9px 5px 5px; display: flex; align-items: center; gap: 8px; border-radius: 12px; }
.topbar-user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, var(--navy-900), var(--navy-700)); }
.topbar-user > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.topbar-user strong, .topbar-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user strong { font-size: .72rem; }
.topbar-user small { color: var(--ink-500); font-size: .62rem; }

.topbar-notification-wrap { position: relative; }
.notification-panel { position: absolute; top: calc(100% + 11px); right: -54px; width: min(420px, calc(100vw - 24px)); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 25px 65px rgba(5,43,75,.22); z-index: 95; }
.notification-panel > header { min-height: 62px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.notification-panel > header div { display: flex; flex-direction: column; }
.notification-panel > header strong { font-size: .9rem; }
.notification-panel > header span { color: var(--ink-500); font-size: .7rem; }
.notification-panel > header button { border: 0; background: transparent; color: var(--navy-700); font-size: .7rem; font-weight: 800; }
.notification-panel > header button:disabled { opacity: .45; }
.notification-panel-list { max-height: 450px; overflow-y: auto; }
.notification-panel-item { position: relative; display: grid; grid-template-columns: 30px minmax(0,1fr) 25px; gap: 8px; padding: 12px 10px 12px 14px; border-bottom: 1px solid #edf1f4; background: #fff; }
.notification-panel-item:not(.is-read) { background: #f8fbfd; }
.notification-panel-item.is-read { opacity: .72; }
.notification-panel-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; font-weight: 900; background: var(--blue-50); color: var(--navy-800); }
.notification-danger .notification-panel-icon { color: var(--danger); background: var(--danger-bg); }
.notification-warning .notification-panel-icon { color: var(--warning); background: var(--warning-bg); }
.notification-success .notification-panel-icon { color: var(--success); background: var(--success-bg); }
.notification-panel-item a { min-width: 0; display: flex; flex-direction: column; }
.notification-panel-item a small { color: var(--navy-700); font-size: .61rem; font-weight: 850; letter-spacing: .07em; }
.notification-panel-item a strong { margin: 2px 0; font-size: .8rem; }
.notification-panel-item a span { color: var(--ink-500); font-size: .7rem; line-height: 1.35; }
.notification-panel-item > button { width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-500); }
.notification-panel-item > button:hover { background: var(--danger-bg); color: var(--danger); }
.notification-panel-empty { min-height: 155px; padding: 25px; display: grid; place-items: center; align-content: center; text-align: center; }
.notification-panel-empty span { color: var(--ink-500); font-size: .75rem; }
.notification-panel > footer { padding: 11px; text-align: center; background: #f8fafb; }
.notification-panel > footer a { color: var(--navy-700); font-size: .76rem; font-weight: 800; }

.quick-actions-dialog { width: min(680px, calc(100vw - 28px)); }
.quick-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-action-grid a { min-height: 88px; padding: 14px; display: grid; grid-template-columns: 42px minmax(0,1fr); grid-template-rows: auto auto; column-gap: 11px; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.quick-action-grid a:hover { border-color: #a9c2d4; background: var(--blue-50); transform: translateY(-1px); }
.quick-action-grid a > span { grid-row: 1 / 3; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--navy-800); background: #e5f0f7; font-size: 1.1rem; font-weight: 800; }
.quick-action-grid strong { font-size: .86rem; }
.quick-action-grid small { color: var(--ink-500); font-size: .7rem; }
.save-filter-dialog { width: min(500px, calc(100vw - 28px)); }

.global-search-page { padding: 12px; }
.global-search-page-form { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 10px; }
.global-search-page-icon { text-align: center; color: var(--navy-700); font-size: 1.3rem; }
.global-search-page-form input { min-height: 48px; border: 0; outline: none; font-size: 1rem; }
.search-results-summary { margin: 10px 0 18px; display: flex; align-items: baseline; gap: 8px; color: var(--ink-500); }
.search-results-summary strong { color: var(--navy-900); font-size: 1.35rem; }
.search-results-groups { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; align-items: start; }
.search-result-group { margin: 0; }
.search-group-icon { margin-right: 8px; color: var(--navy-700); }
.search-result-list { display: grid; }
.search-result-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto 22px; align-items: center; gap: 10px; padding: 12px 5px; border-top: 1px solid #edf1f4; }
.search-result-row:first-child { border-top: 0; }
.search-result-row:hover { background: #f8fafb; }
.search-result-symbol { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--navy-800); background: var(--blue-50); font-weight: 800; }
.search-result-row > div { min-width: 0; display: flex; flex-direction: column; }
.search-result-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.search-result-row span:not(.search-result-symbol):not(.search-result-arrow), .search-result-row small { color: var(--ink-500); font-size: .7rem; }
.search-result-row small { max-width: 160px; text-align: right; }
.search-result-arrow { color: var(--navy-700); }
.search-empty { min-height: 260px; }

.workspace-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,.85fr); gap: 20px; align-items: start; }
.workspace-side-stack { display: grid; gap: 20px; }
.workspace-side-stack > .panel { margin: 0; }
.workspace-notifications { min-height: 480px; }
.workspace-notification-list { display: grid; }
.workspace-notification { position: relative; display: grid; grid-template-columns: 12px minmax(0,1fr) 30px; gap: 9px; padding: 14px 4px; border-top: 1px solid #edf1f4; }
.workspace-notification:first-child { border-top: 0; }
.workspace-notification.is-read { opacity: .68; }
.workspace-notification-dot { width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--navy-700); box-shadow: 0 0 0 4px var(--blue-50); }
.workspace-notification.notification-danger .workspace-notification-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.workspace-notification.notification-warning .workspace-notification-dot { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-bg); }
.workspace-notification a { min-width: 0; display: flex; flex-direction: column; }
.workspace-notification a small { color: var(--navy-700); font-size: .62rem; font-weight: 850; letter-spacing: .07em; }
.workspace-notification a strong { margin: 2px 0; font-size: .88rem; }
.workspace-notification a p { margin: 0; color: var(--ink-500); font-size: .76rem; }
.workspace-notification a time { margin-top: 5px; color: #8a97a3; font-size: .66rem; }
.workspace-notification-dismiss { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-500); }
.workspace-notification-dismiss:hover { color: var(--danger); background: var(--danger-bg); }
.workspace-link-list { display: grid; }
.workspace-link-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #edf1f4; }
.workspace-link-row:first-child { border-top: 0; }
.workspace-link-row > a { min-width: 0; flex: 1; padding: 11px 2px; display: flex; align-items: center; gap: 9px; }
.workspace-link-row > a > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: var(--blue-50); color: var(--navy-800); }
.workspace-link-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.workspace-link-row a > div { min-width: 0; display: flex; flex-direction: column; }
.workspace-link-row small { color: var(--ink-500); font-size: .65rem; }
.workspace-link-row form button { width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--ink-500); background: transparent; }
.workspace-link-row form button:hover { color: var(--danger); background: var(--danger-bg); }
.workspace-filters { margin-top: 20px; }
.saved-filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.saved-filter-card { min-width: 0; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfd; }
.saved-filter-card a { min-width: 0; display: flex; flex-direction: column; }
.saved-filter-card a > span { color: var(--navy-700); text-transform: uppercase; letter-spacing: .08em; font-size: .61rem; font-weight: 850; }
.saved-filter-card strong { margin: 4px 0; font-size: .86rem; }
.saved-filter-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-500); font-size: .66rem; }
.saved-filter-card form { align-self: flex-end; }
.dashboard-widget-hidden { display: none !important; }

@media (max-width: 1320px) {
  .topbar-action > small { display: none; }
  .topbar-action { min-width: 40px; padding-inline: 6px; }
  .topbar-user { min-width: 42px; }
  .topbar-user > span:last-child { display: none; }
}

@media (max-width: 1080px) {
  .topbar-search { max-width: none; }
  .topbar-save-filter, .topbar-actions > a.topbar-action { display: none; }
  .search-results-groups { grid-template-columns: 1fr; }
  .workspace-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .saved-filter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 700px) {
  .topbar { gap: 8px; padding-inline: 12px; }
  .topbar-search { flex-basis: auto; min-width: 0; }
  .topbar-search kbd { display: none; }
  .topbar-search > input { padding-right: 10px; }
  .topbar-actions { gap: 1px; }
  .topbar-actions > .topbar-action:not(.notification-trigger):not(.topbar-quick-action), .topbar-user { display: none; }
  .notification-panel { position: fixed; top: 68px; right: 12px; left: 12px; width: auto; }
  .global-search-suggestions { position: fixed; top: 68px; left: 12px; right: 12px; max-height: calc(100vh - 85px); }
  .quick-action-grid { grid-template-columns: 1fr; }
  .global-search-page-form { grid-template-columns: 28px minmax(0,1fr); }
  .global-search-page-form .btn { grid-column: 1 / -1; }
  .search-result-row { grid-template-columns: 38px minmax(0,1fr) 18px; }
  .search-result-row > small { display: none; }
  .workspace-metric-grid, .saved-filter-grid { grid-template-columns: 1fr; }
}

@media print {
  .global-search-suggestions, .notification-panel, .app-dialog { display: none !important; }
}

.quote-share-dialog { width: min(620px, calc(100vw - 28px)); }
.quote-share-options { display: grid; gap: 9px; }
.quote-share-option { width: 100%; min-height: 68px; padding: 12px; display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-900); background: #fff; text-align: left; }
.quote-share-option:hover { border-color: #abc4d6; background: var(--blue-50); }
.quote-share-option > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: var(--navy-800); background: #e5f0f7; font-weight: 900; font-size: .82rem; }
.quote-share-option > div { display: flex; flex-direction: column; }
.quote-share-option strong { font-size: .86rem; }
.quote-share-option small { color: var(--ink-500); font-size: .72rem; }
.quote-share-option.is-disabled { opacity: .55; }
.quote-share-feedback { color: var(--success); font-size: .76rem; font-weight: 750; margin-right: auto; }
.quick-fab { position: fixed; right: 24px; bottom: 24px; z-index: 28; min-width: 54px; height: 54px; padding: 0 17px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 18px; color: #fff; background: linear-gradient(145deg, var(--navy-900), var(--navy-700)); box-shadow: 0 15px 32px rgba(7,60,105,.28); font-size: 1.35rem; font-weight: 900; transition: .18s ease; }
.quick-fab span { font-size: .78rem; }
.quick-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(7,60,105,.34); }
@media (max-width: 700px) { .quick-fab { right: 16px; bottom: 16px; width: 52px; min-width: 52px; padding: 0; border-radius: 50%; } .quick-fab span { display: none; } }
@media print { .quick-fab { display: none !important; } }

/* MSBA Controle v1.10 — NCM, ICMS e máscaras brasileiras */
.input-masked-number { font-variant-numeric: tabular-nums; }
.quote-item-tax-summary { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 18px; margin: -2px 15px 15px; padding: 10px 12px; border: 1px solid #d9e6ee; border-radius: 10px; color: var(--ink-500); background: linear-gradient(90deg, #f5f9fc, #fff); font-size: .7rem; }
.quote-item-tax-summary span { display: inline-flex; align-items: center; gap: 5px; }
.quote-item-tax-summary strong { color: var(--navy-900); font-size: .76rem; }
.quote-item-tax-summary span:last-child strong { color: var(--success); font-size: .82rem; }
.quote-document-table { min-width: 980px; }
.quote-document-table td small + small { margin-top: 3px; }

@media (min-width: 1451px) {
  .quote-item-main-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .quote-product-field { grid-column: span 2; }
}
@media (max-width: 620px) {
  .quote-item-tax-summary { align-items: stretch; flex-direction: column; }
  .quote-item-tax-summary span { justify-content: space-between; }
}


/* MSBA Controle v1.10.1 — alinhamento do cadastro de itens da cotação */
.quote-item-main-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px 12px;
  align-items: start;
  padding: 16px;
}
.quote-item-main-grid .field {
  min-width: 0;
  align-self: start;
}
.quote-item-main-grid .field > span {
  display: flex;
  align-items: flex-end;
  min-height: 2.15em;
  line-height: 1.2;
}
.quote-item-main-grid .field > input,
.quote-item-main-grid .field > select,
.quote-item-main-grid .field > textarea {
  min-width: 0;
}
.quote-item-main-grid .field > small {
  line-height: 1.3;
}
.quote-item-main-grid .quote-item-field-product { grid-column: span 6; }
.quote-item-main-grid .quote-item-field-description { grid-column: span 6; }
.quote-item-main-grid .quote-item-field-ncm { grid-column: span 2; }
.quote-item-main-grid .quote-item-field-unit { grid-column: span 1; }
.quote-item-main-grid .quote-item-field-quantity { grid-column: span 2; }
.quote-item-main-grid .quote-item-field-price { grid-column: span 3; }
.quote-item-main-grid .quote-item-field-discount { grid-column: span 2; }
.quote-item-main-grid .quote-item-field-icms { grid-column: span 2; }

.quote-item-tax-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  margin: -1px 16px 16px;
  padding: 0;
  overflow: hidden;
}
.quote-item-tax-summary span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border-right: 1px solid #d9e6ee;
}
.quote-item-tax-summary span:last-child { border-right: 0; }
.quote-item-tax-summary strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .quote-item-main-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .quote-item-main-grid .quote-item-field-product,
  .quote-item-main-grid .quote-item-field-description { grid-column: 1 / -1; }
  .quote-item-main-grid .quote-item-field-ncm,
  .quote-item-main-grid .quote-item-field-unit,
  .quote-item-main-grid .quote-item-field-quantity,
  .quote-item-main-grid .quote-item-field-price,
  .quote-item-main-grid .quote-item-field-discount,
  .quote-item-main-grid .quote-item-field-icms { grid-column: span 2; }
}

@media (max-width: 800px) {
  .quote-item-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-item-main-grid .quote-item-field-product,
  .quote-item-main-grid .quote-item-field-description { grid-column: 1 / -1; }
  .quote-item-main-grid .quote-item-field-ncm,
  .quote-item-main-grid .quote-item-field-unit,
  .quote-item-main-grid .quote-item-field-quantity,
  .quote-item-main-grid .quote-item-field-price,
  .quote-item-main-grid .quote-item-field-discount,
  .quote-item-main-grid .quote-item-field-icms { grid-column: span 1; }
  .quote-item-tax-summary { grid-template-columns: 1fr; }
  .quote-item-tax-summary span {
    min-height: 42px;
    border-right: 0;
    border-bottom: 1px solid #d9e6ee;
  }
  .quote-item-tax-summary span:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
  .quote-item-main-grid { grid-template-columns: 1fr; padding: 14px; }
  .quote-item-main-grid .quote-item-field-product,
  .quote-item-main-grid .quote-item-field-description,
  .quote-item-main-grid .quote-item-field-ncm,
  .quote-item-main-grid .quote-item-field-unit,
  .quote-item-main-grid .quote-item-field-quantity,
  .quote-item-main-grid .quote-item-field-price,
  .quote-item-main-grid .quote-item-field-discount,
  .quote-item-main-grid .quote-item-field-icms { grid-column: 1; }
  .quote-item-main-grid .field > span { min-height: auto; }
  .quote-item-tax-summary { margin-inline: 14px; }
}

/* MSBA Controle v1.10.2 — listas, referência comercial e paginação */
.list-pagination { margin-top: 16px; padding-top: 14px; display: grid; grid-template-columns: minmax(150px, 1fr) auto minmax(220px, 1fr); align-items: center; gap: 14px; border-top: 1px solid var(--line); }
.pagination-summary { display: flex; align-items: baseline; gap: 5px; color: var(--ink-500); font-size: .76rem; }
.pagination-summary strong { color: var(--ink-900); font-size: .82rem; }
.page-size-form { display: flex; justify-content: center; }
.page-size-form label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-500); font-size: .75rem; white-space: nowrap; }
.page-size-form select { min-height: 36px; padding: 6px 28px 6px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-900); background: #fff; font-weight: 750; }
.pagination-controls { display: flex; justify-content: flex-end; align-items: center; gap: 5px; }
.pagination-button { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-700); background: #fff; font-size: .78rem; font-weight: 800; transition: .16s ease; }
button.pagination-button { cursor: pointer; }
.pagination-button:hover:not(.is-disabled), .pagination-button.is-active { border-color: var(--navy-700); color: #fff; background: var(--navy-700); }
.pagination-button.is-disabled, .pagination-button:disabled { opacity: .42; pointer-events: none; }
.pagination-ellipsis { min-width: 20px; text-align: center; color: var(--ink-500); }
.quotes-list-table { min-width: 1040px; }
.quotes-list-table th:nth-child(1) { width: 145px; }
.quotes-list-table th:nth-child(2) { width: 150px; }
.quotes-list-table th:nth-child(4) { width: 145px; }
.quotes-list-table th:nth-child(5) { width: 190px; }
.quotes-list-table th:nth-child(6) { width: 125px; }
.quote-reference-cell { display: flex; flex-direction: column; min-width: 120px; }
.quote-reference-cell strong { color: var(--navy-800); overflow-wrap: anywhere; }
.quote-reference-cell small { margin-top: 3px; }
.inventory-list-pagination .page-size-form { display: none; }

@media (max-width: 900px) {
  .list-pagination { grid-template-columns: 1fr auto; }
  .page-size-form { justify-content: flex-end; }
  .pagination-controls { grid-column: 1 / -1; justify-content: center; }
}

@media (max-width: 560px) {
  .list-pagination { grid-template-columns: 1fr; }
  .pagination-summary, .page-size-form, .pagination-controls { justify-content: center; }
  .pagination-controls { grid-column: auto; flex-wrap: wrap; }
}

@media print { .list-pagination { display: none !important; } }

/* =========================================================
   MSBA v1.11 — integração Cotação → Compras
   ========================================================= */
.purchase-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card-link { color: inherit; text-decoration: none; }
.metric-card-link:hover { transform: translateY(-3px); border-color: #b9cbd8; box-shadow: 0 17px 34px rgba(5,43,75,.1); }

.procurement-existing-alert { margin-bottom: 20px; }
.procurement-context { overflow: hidden; }
.procurement-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}
.procurement-context-grid > div {
  min-height: 78px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: #fff;
}
.procurement-context-grid span,
.procurement-batch-metrics span { color: var(--ink-500); font-size: .69rem; text-transform: uppercase; letter-spacing: .055em; font-weight: 800; }
.procurement-context-grid strong { color: var(--navy-950); font-size: .9rem; overflow-wrap: anywhere; }
.procurement-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.procurement-items { display: grid; gap: 15px; }
.procurement-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  transition: opacity .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.procurement-item.is-included { border-color: #b8cedc; box-shadow: 0 10px 26px rgba(5,43,75,.065); }
.procurement-item.is-excluded { opacity: .62; background: #f7f9fa; }
.procurement-item.has-error { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180,35,53,.11); transform: translateY(-2px); }
.procurement-item-header {
  min-height: 86px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fff, #f5f9fc);
}
.procurement-include { margin: 0; }
.procurement-include input { width: 19px; height: 19px; accent-color: var(--navy-800); }
.procurement-item-title,
.procurement-item-source { display: flex; flex-direction: column; min-width: 0; }
.procurement-item-title > span { color: var(--navy-700); font-size: .66rem; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.procurement-item-title strong { margin: 2px 0; color: var(--navy-950); font-size: .92rem; }
.procurement-item-title small,
.procurement-item-source small { color: var(--ink-500); font-size: .7rem; }
.procurement-item-source { min-width: 125px; text-align: right; }
.procurement-item-source > span { color: var(--ink-500); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.procurement-item-source strong { color: var(--navy-900); }
.procurement-item-body { padding: 16px; }
.procurement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  align-items: start;
}
.procurement-grid .field-span-2 { grid-column: span 2; }
.procurement-grid .field-span-4 { grid-column: 1 / -1; }
.procurement-grid .field > span { min-height: 2em; display: flex; align-items: flex-end; line-height: 1.2; }
.procurement-product-field { transition: opacity .18s ease; }
.procurement-product-field.is-required > span::after { content: " *"; color: var(--danger); }
.procurement-item-footer {
  padding: 11px 16px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--line);
  background: #f8fafb;
}
.procurement-item-footer span { color: var(--ink-500); font-size: .74rem; font-weight: 750; }
.procurement-item-footer strong { min-width: 120px; text-align: right; color: var(--navy-950); font-size: 1rem; }
.procurement-summary {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.procurement-summary > div { min-height: 76px; padding: 13px 16px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); background: #f8fafb; }
.procurement-summary > div:last-child { border-right: 0; }
.procurement-summary span { color: var(--ink-500); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.procurement-summary strong { margin-top: 3px; color: var(--navy-950); font-size: 1.15rem; }
.procurement-summary .grand { color: #fff; background: linear-gradient(135deg, var(--navy-950), var(--navy-800)); }
.procurement-summary .grand span,
.procurement-summary .grand strong { color: #fff; }
.procurement-history-panel { margin-top: 20px; }

.quote-procurement-panel { scroll-margin-top: 92px; }
.procurement-batch-list { display: grid; gap: 13px; }
.procurement-batch-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #fff, #f8fbfd); }
.procurement-batch-card.is-outdated { border-color: #edcf9f; background: linear-gradient(145deg, #fff, #fff9ee); }
.procurement-batch-card > header,
.procurement-batch-card > footer { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.procurement-batch-card > header > div { display: flex; flex-direction: column; min-width: 0; }
.procurement-batch-card > header > div > span { color: var(--navy-700); font-size: .65rem; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.procurement-batch-card > header strong { margin: 2px 0; color: var(--navy-950); }
.procurement-batch-card > header small,
.procurement-batch-card > footer small { color: var(--ink-500); font-size: .7rem; }
.procurement-batch-metrics { margin: 14px 0 11px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.procurement-batch-metrics > div { min-height: 66px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; border: 1px solid #e3eaf0; border-radius: 10px; background: rgba(255,255,255,.88); }
.procurement-batch-metrics strong { margin-top: 3px; color: var(--navy-950); font-size: .88rem; }
.procurement-progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e5edf2; }
.procurement-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-700), var(--success)); }
.procurement-batch-card > footer { margin-top: 8px; }
.procurement-revision-warning { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: var(--warning); background: var(--warning-bg); font-size: .72rem; font-weight: 680; }
.quote-procurement-inline { margin-top: 4px; }

.purchase-source-banner {
  margin-bottom: 20px;
  padding: 15px 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #bfd6e4;
  border-left: 4px solid var(--navy-700);
  border-radius: 13px;
  background: linear-gradient(135deg, #fff, var(--blue-50));
}
.purchase-source-banner > div { display: flex; flex-direction: column; min-width: 0; }
.purchase-source-banner strong { margin: 2px 0; color: var(--navy-950); }
.purchase-source-banner small,
.purchase-source-banner > span { color: var(--ink-500); font-size: .72rem; }
.purchase-source-banner > span { max-width: 480px; text-align: right; }
.purchase-source-banner.is-warning { border-color: #eccd98; border-left-color: var(--warning); background: linear-gradient(135deg, #fff, var(--warning-bg)); }
.item-origin-chip { margin-top: 5px; display: inline-flex; width: fit-content; padding: 3px 7px; border-radius: 999px; color: var(--navy-800); background: var(--blue-50); font-size: .63rem; font-weight: 800; }
.item-origin-chip.stock { color: var(--success); background: var(--success-bg); }
.item-origin-chip.no-stock { color: #596673; background: #edf1f4; }
.item-origin-chip.quote-source { color: var(--navy-800); background: #e6f1f8; }

@media (max-width: 1180px) {
  .procurement-context-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .procurement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .procurement-grid .field-span-4 { grid-column: 1 / -1; }
  .procurement-batch-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .purchase-metric-grid { grid-template-columns: 1fr; }
  .procurement-context-grid,
  .procurement-summary { grid-template-columns: 1fr; }
  .procurement-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .procurement-summary > div:last-child { border-bottom: 0; }
  .procurement-item-header { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .procurement-item-source { grid-column: 2; text-align: left; min-width: 0; }
  .procurement-grid { grid-template-columns: 1fr; }
  .procurement-grid .field-span-2,
  .procurement-grid .field-span-4 { grid-column: 1; }
  .procurement-grid .field > span { min-height: auto; }
  .procurement-toolbar { width: 100%; }
  .procurement-toolbar .btn { flex: 1; }
  .procurement-batch-card > header,
  .procurement-batch-card > footer,
  .purchase-source-banner { align-items: flex-start; flex-direction: column; }
  .purchase-source-banner > span { max-width: none; text-align: left; }
}

@media (max-width: 520px) {
  .procurement-batch-metrics { grid-template-columns: 1fr; }
  .procurement-item-body { padding: 13px; }
  .procurement-item-footer { justify-content: space-between; }
}
.quote-activity-timeline .timeline-procurement > span { background: var(--navy-700); box-shadow: 0 0 0 4px var(--blue-100); }

/* MSBA v1.11 - Indicador Cotação → Compras na dashboard */
.dashboard-purchase-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card-link { color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.metric-card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(19, 70, 125, .28); }
@media (max-width: 1280px) { .dashboard-purchase-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dashboard-purchase-metrics { grid-template-columns: 1fr; } }
