body { background-color: #f5f7fa; color: #202b3b; }
h1 { font-weight: 700; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-shell { width: min(100%, 430px); margin: auto; }
.login-card { border-radius: 1rem; box-shadow: 0 1rem 2.5rem rgba(32, 43, 59, .1); }
.login-card .card-body { padding: clamp(1.25rem, 6vw, 2rem); }
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand img { display: block; width: 88px; height: 88px; object-fit: contain; margin: 0 auto .75rem; border-radius: .5rem; }
.login-brand h1 { font-size: 1.65rem; margin-bottom: .25rem; }
.login-form { display: grid; gap: 1rem; }
.login-form .form-control, .login-form .btn { min-height: 48px; }
.account-form { width: 100%; max-width: 520px; }
.account-form .form-control { min-height: 48px; }
.account-list { display: grid; gap: 1rem; }
.account-card { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.account-info { min-width: 0; overflow-wrap: anywhere; }
.receipt-document { max-width: 780px; margin: 0 auto; padding: clamp(1rem, 5vw, 3rem); background: #fff; border: 1px solid #dfe5ec; border-radius: .75rem; color: #202b3b; box-shadow: 0 .5rem 1.5rem rgba(32, 43, 59, .06); }
.receipt-header { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px solid #202b3b; }
.receipt-header img { width: 112px; height: 76px; flex: 0 0 112px; object-fit: contain; border-radius: .35rem; }
.receipt-header p { font-size: .9rem; }
.receipt-header .receipt-company-name { margin: 0 0 .25rem; font-size: 1.25rem; font-weight: 700; }
.receipt-title-row { display: flex; flex-direction: column; gap: .25rem; margin: 1.5rem 0 1rem; }
.receipt-title-row h1 { margin: 0; font-size: clamp(1.25rem, 5vw, 1.75rem); letter-spacing: .035em; }
.receipt-title-row > span, .receipt-date { color: #667085; }
.receipt-section { margin-top: 1.25rem; }
.receipt-section h2 { padding-bottom: .4rem; border-bottom: 1px solid #dfe5ec; font-size: 1rem; font-weight: 700; }
.receipt-section p { margin: .35rem 0; overflow-wrap: anywhere; }
.receipt-items { display: grid; gap: .35rem; }
.receipt-items > div { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid #edf0f4; }
.receipt-items > div span { overflow-wrap: anywhere; }
.receipt-items > div strong { white-space: nowrap; }
.receipt-payment { margin-top: 1.5rem; padding: 1rem; border: 1px solid #dfe5ec; border-radius: .5rem; background: #f8fafc; }
.receipt-paid-label { margin: 0; color: #667085; font-size: .8rem; font-weight: 700; letter-spacing: .08em; }
.receipt-paid-value { margin: .1rem 0 .75rem; font-size: clamp(1.8rem, 8vw, 2.5rem); font-weight: 700; }
.receipt-words { line-height: 1.6; }
.receipt-totals { display: grid; gap: .35rem; margin: .75rem 0 0; }
.receipt-totals > div { display: flex; justify-content: space-between; gap: 1rem; }
.receipt-totals dt { font-weight: 400; }
.receipt-totals dd { margin: 0; font-weight: 700; white-space: nowrap; }
.receipt-method { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.25rem 0; }
.receipt-signatures { display: grid; gap: 2rem; margin: 3rem 0 1rem; text-align: center; }
.receipt-signatures p { margin: .4rem 0 0; font-size: .85rem; }
.signature-line { display: block; width: min(100%, 300px); margin: 0 auto; border-top: 1px solid #667085; }
.signature-capture { margin: 1.5rem 0; padding: 1rem; border: 1px solid #dfe5ec; border-radius: .75rem; background: #f8fafc; }
.signature-captures { display: grid; gap: 1rem; }
.signature-captures .signature-capture { margin: 0; min-width: 0; }
.signature-canvas { display: block; width: 100%; height: 180px; max-width: 100%; border: 1px dashed #98a2b3; border-radius: .5rem; background: #fff; touch-action: none; }
.signature-saved { display: block; width: min(100%, 300px); height: 72px; object-fit: contain; margin: 0 auto; }
.signature-editor[hidden], .signature-edit-toggle[hidden] { display: none !important; }
.receipt-footer { margin: 1.5rem 0 0; padding-top: .75rem; border-top: 1px solid #dfe5ec; color: #667085; font-size: .75rem; text-align: center; }
.issuer-card { display: flex; flex-direction: row; align-items: center; gap: 1rem; border-left: 4px solid var(--issuer-accent, #b8872f); min-width: 0; }
.issuer-card img { flex: 0 0 32%; width: 32%; max-width: 150px; height: 72px; object-fit: contain; }
.issuer-card > div { min-width: 0; overflow-wrap: anywhere; }
.issuer-card h2 { margin: 0 0 .25rem; color: var(--issuer-color, #172b46); font-size: 1.15rem; }
.issuer-card p { margin-bottom: .25rem; overflow-wrap: anywhere; }
.issuer-label { color: #667085; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff !important; color: #000 !important; font-size: 10pt; }
  nav, .receipt-actions, .no-print, body > main > .alert, footer:not(.receipt-signatures) { display: none !important; }
  body > main.container { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .receipt-document { max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; color: #000; }
  .receipt-payment { background: #fff; }
  .receipt-signatures { break-inside: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
}
.card { border-color: #dfe5ec; border-radius: .75rem; }
.table { vertical-align: middle; }
.observacoes { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 28rem; }

/* A interface prioriza o uso com uma mão em telas de celular. */
.btn-touch { min-height: 44px; padding: .625rem 1rem; display: inline-flex; align-items: center; justify-content: center; }
.page-heading { display: flex; flex-direction: column; align-items: stretch; gap: 1rem; }
.page-heading h1 { font-size: clamp(1.65rem, 7vw, 2.25rem); margin-bottom: 0; }
.back-link { color: #0d6efd; text-decoration: none; }
.search-card { border-radius: .75rem; }
.search-card .form-control, .search-card .btn { min-height: 48px; }
.client-list { display: grid; gap: 1rem; }
.client-card { padding: 1rem; gap: 1rem; min-width: 0; }
.client-info { min-width: 0; }
.client-info h2 { overflow-wrap: anywhere; }
.client-details { display: grid; gap: .625rem; }
.client-details dt { color: #667085; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .035em; }
.client-details dd { margin: 0; overflow-wrap: anywhere; }
.client-actions, .form-actions { display: flex; gap: .625rem; }
.client-actions > *, .client-actions .btn { flex: 1; }
.customer-form { border-radius: .75rem; }
.customer-form .form-control, .customer-form .form-select { min-height: 48px; }
.customer-form textarea.form-control { min-height: 112px; }
.form-actions { flex-direction: column; }
.navbar-nav .nav-link { padding: .75rem 0; }
.navbar-toggler { min-width: 44px; min-height: 44px; }
.navbar-logo { display: block; width: 36px; height: 36px; object-fit: contain; border-radius: .2rem; }
.filter-actions { display: flex; flex-direction: column; gap: .5rem; }
.filter-actions > * { width: 100%; }
.service-list { display: grid; gap: 1rem; }
.service-card { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; min-width: 0; }
.service-info { min-width: 0; }
.service-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.service-title-row h2 { min-width: 0; overflow-wrap: anywhere; }
.service-description { color: #667085; white-space: pre-wrap; overflow-wrap: anywhere; }
.service-details { display: grid; gap: .625rem; }
.service-details dt { color: #667085; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .035em; }
.service-details dd { margin: 0; overflow-wrap: anywhere; }
.service-price { color: #202b3b; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.service-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; }
.service-actions > :first-child { grid-column: 1 / -1; }
.service-actions form, .service-actions .btn { width: 100%; }
.catalog-form { border-radius: .75rem; }
.catalog-form .form-control, .catalog-form .form-select { min-height: 48px; }
.catalog-form textarea.form-control { min-height: 112px; }
.empty-state { border-radius: .75rem; }
.quote-list, .quote-item-list { display: grid; gap: 1rem; }
.quote-card { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; min-width: 0; }
.quote-info { min-width: 0; }
.quote-title-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .875rem; }
.quote-title-row h2 { overflow-wrap: anywhere; }
.quote-details { display: grid; gap: .625rem; }
.quote-details dt { color: #667085; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .035em; }
.quote-details dd { margin: 0; overflow-wrap: anywhere; }
.quote-price { font-weight: 700; font-size: 1.125rem; }
.status-rascunho { background: #e9ecef; color: #344054; }
.status-enviado { background: #cff4fc; color: #055160; }
.status-aprovado { background: #d1e7dd; color: #0f5132; }
.status-recusado { background: #f8d7da; color: #842029; }
.quote-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.quote-actions > *, .quote-actions .btn { width: 100%; min-width: 0; }
.quote-actions .btn { white-space: normal; }
.quote-form { border-radius: .75rem; }
.quote-form .form-control, .quote-form .form-select { min-height: 48px; }
.quote-form textarea.form-control { min-height: 100px; }
.quote-items-heading { display: flex; flex-direction: column; align-items: stretch; gap: .875rem; margin: 1.75rem 0 1rem; }
.quote-items-heading .btn { align-self: flex-start; }
.quote-item { padding: 1rem; min-width: 0; }
.quote-item-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.quote-item-heading .btn { min-height: 44px; }
.material-price-fields[hidden] { display: none !important; }
.quote-scope-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.quote-material-info { min-width: 0; overflow-wrap: anywhere; }
.item-total { display: block; min-height: 48px; padding: .65rem .75rem; border-radius: .375rem; background: #f3f6fa; font-weight: 700; }
.quote-total-panel { display: grid; gap: .5rem; padding: 1rem; border: 1px solid #dfe5ec; border-radius: .75rem; background: #f8fafc; }
.quote-total-panel > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.quote-total-panel > div > span { min-width: 0; }
.quote-total-panel > div > strong { flex: 0 0 auto; }
.quote-grand-total { margin-top: .25rem; padding-top: .75rem; border-top: 1px solid #cbd5e1; font-size: 1.125rem; }
.quote-grand-total strong { color: #0d6efd; font-size: 1.3rem; }
.quote-form .form-actions { margin-top: 1.25rem; }
.quote-summary, .status-panel { border-radius: .75rem; }
.quote-observations { white-space: pre-wrap; overflow-wrap: anywhere; }
.quote-detail-item { display: flex; flex-direction: column; gap: .75rem; padding: 1rem; }
.quote-detail-item > div { min-width: 0; }
.quote-detail-item h3 { overflow-wrap: anywhere; }
.quote-detail-item > strong { white-space: nowrap; }
.detail-totals { max-width: 100%; }
.status-form { display: flex; flex-direction: column; gap: .75rem; }
.status-form .form-select { min-height: 48px; }
.quote-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; margin: 1.5rem 0; }
.quote-detail-actions > *, .quote-detail-actions .btn { width: 100%; min-width: 0; }
.quote-detail-actions .btn { white-space: normal; }
.quote-detail-actions form { grid-column: 1 / -1; }
.quote-detail-actions form .btn { width: 100%; }
.dashboard-heading { margin-bottom: 1.75rem; }
.dashboard-heading h1 { font-size: clamp(1.9rem, 8vw, 2.75rem); margin-bottom: .375rem; }
.dashboard-eyebrow { color: #0d6efd; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.dashboard-section { margin-top: 2rem; }
.dashboard-section-title { margin-bottom: 1rem; font-size: 1.25rem; font-weight: 700; }
.dashboard-navigation-card, .dashboard-stat-card, .dashboard-empty { border-radius: .75rem; }
.dashboard-navigation-card .card-body { gap: .5rem; }
.dashboard-navigation-card p { margin-bottom: .75rem; }
.dashboard-stat-card .card-body { position: relative; min-height: 120px; padding: 1.125rem; }
.dashboard-stat-label { margin: 0 0 .5rem; color: #667085; font-size: .875rem; font-weight: 600; }
.dashboard-stat-value { margin: 0; color: #202b3b; font-size: 2rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dashboard-stat-highlight { border-color: #b9d2ff; background: #f6f9ff; }
.dashboard-stat-highlight .dashboard-stat-value { color: #0d6efd; }
.dashboard-currency { font-size: clamp(1.5rem, 7vw, 2rem); }
.dashboard-status-summary { margin-top: 1.25rem; padding: 1rem; border: 1px solid #dfe5ec; border-radius: .75rem; background: #fff; }
.dashboard-status-summary h3 { margin-bottom: .75rem; }
.dashboard-status-grid { display: grid; grid-template-columns: 1fr; gap: .625rem; }
.dashboard-status-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem .625rem; border-radius: .5rem; background: #f8fafc; }
.dashboard-status-item strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.dashboard-section-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.dashboard-recent-list { display: grid; gap: .75rem; }
.dashboard-recent-card { display: flex; flex-direction: column; gap: .75rem; min-width: 0; padding: 1rem; color: inherit; text-decoration: none; }
.dashboard-recent-card:hover, .dashboard-recent-card:focus-visible { border-color: #86b7fe; background: #fbfdff; color: inherit; }
.dashboard-recent-main { display: grid; gap: .25rem; min-width: 0; }
.dashboard-recent-number { color: #0d6efd; font-weight: 700; }
.dashboard-recent-client { overflow-wrap: anywhere; }
.dashboard-recent-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .625rem; }
.dashboard-recent-meta time { color: #667085; font-size: .875rem; }
.dashboard-quick-links { display: flex; flex-direction: column; gap: .625rem; }
.approved-list, .financial-summary, .material-list { display: grid; gap: 1rem; }
.approved-list { grid-template-columns: 1fr; }
.approved-card { min-width: 0; }
.approved-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.approved-values dt { color: #667085; font-size: .8rem; }
.approved-values dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.financial-summary { grid-template-columns: 1fr; }
.financial-summary .card-body { min-width: 0; gap: .35rem; }
.financial-summary span, .financial-summary small { color: #667085; }
.financial-summary strong { font-size: 1.35rem; overflow-wrap: anywhere; }
.financial-form { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.financial-form .form-control { min-height: 48px; }
.material-row { display: flex; flex-direction: column; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid #dfe5ec; overflow-wrap: anywhere; }
.material-row .btn { width: 100%; }
.report-filter { border-radius: .75rem; }
.report-filter-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.report-filter .form-control { min-height: 48px; }
.report-filter-actions { display: grid; grid-template-columns: 1fr; gap: .5rem; align-content: end; }
.report-filter-actions .btn { width: 100%; }
.report-summary-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.report-stat { min-width: 0; }
.report-stat .card-body { display: flex; flex-direction: column; justify-content: space-between; gap: .5rem; min-height: 108px; }
.report-stat span { color: #667085; font-size: .875rem; font-weight: 600; }
.report-stat strong { font-size: clamp(1.35rem, 7vw, 1.75rem); line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report-positive strong { color: #198754; }
.report-warning strong { color: #b02a37; }
.report-list-heading { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.report-quotes { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.report-quote-card { min-width: 0; padding: 1rem; }
.report-quote-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.report-quote-heading > div { min-width: 0; overflow-wrap: anywhere; }
.report-quote-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0 0 1rem; }
.report-quote-values dt { color: #667085; font-size: .75rem; }
.report-quote-values dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.quick-client-fields .form-control { min-height: 48px; }
.modal#cliente-rapido-modal .modal-content { display: flex; flex-direction: column; overflow: hidden; }
#cliente-rapido-form { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; overflow: hidden; }
#cliente-rapido-form .modal-body { flex: 1 1 auto; min-height: 0; max-height: calc(100vh - 200px); max-height: calc(var(--cliente-modal-altura, 100dvh) - 200px); overflow-y: auto; overscroll-behavior: contain; }
#cliente-rapido-form .modal-footer { flex: 0 0 auto; }
.quick-client-actions { display: grid; grid-template-columns: 1fr; gap: .5rem; }
.quick-client-actions .btn { width: 100%; }

@media (max-width: 575.98px) {
  .receipt-header { align-items: flex-start; gap: .75rem; }
  .receipt-header img { width: 88px; height: 64px; flex-basis: 88px; }
  .receipt-header p { font-size: .82rem; overflow-wrap: anywhere; }
  .issuer-card { align-items: flex-start; gap: .75rem; padding: .875rem; }
  .issuer-card img { flex-basis: 28%; width: 28%; height: 64px; }
  .issuer-card h2 { font-size: 1rem; }
  #cliente-rapido-modal { top: var(--cliente-modal-deslocamento, 0px); height: var(--cliente-modal-altura, 100dvh); }
  #cliente-rapido-modal .modal-dialog { width: 100vw; max-width: none; height: var(--cliente-modal-altura, 100dvh); margin: 0; }
  #cliente-rapido-modal .modal-content { height: var(--cliente-modal-altura, 100dvh); min-height: var(--cliente-modal-altura, 100dvh); border-radius: 0; }
  #cliente-rapido-modal .modal-header { flex: 0 0 auto; }
  #cliente-rapido-modal .modal-footer { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
}

@media (min-width: 768px) {
  .receipt-signatures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) 1.2fr; align-items: end; }
  .report-filter-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-list-heading { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .report-quotes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-client-actions { display: flex; }
  .quick-client-actions .btn { width: auto; }
  .approved-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .financial-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .financial-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
  .financial-form h3 { grid-column: 1 / -1; }
  .financial-form button { justify-self: start; }
  .material-row { flex-direction: row; align-items: center; justify-content: space-between; }
  .material-row .btn { width: auto; }
  .page-heading { flex-direction: row; align-items: center; justify-content: space-between; }
  .client-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 1.25rem; }
  .client-details { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .client-actions { flex: 0 0 auto; }
  .client-actions > * { flex: 0 0 auto; }
  .form-actions { flex-direction: row; }
  .filter-actions { flex-direction: row; }
  .filter-actions > * { flex: 1; width: auto; }
  .service-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 1.25rem; }
  .service-info { flex: 1; }
  .service-details { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .service-actions { flex: 0 0 auto; grid-template-columns: repeat(3, auto); }
  .service-actions > :first-child { grid-column: auto; }
  .service-actions > * { width: auto; }
  .service-actions form, .service-actions .btn { width: auto; }
  .quote-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 1.25rem; }
  .quote-info { flex: 1; }
  .quote-details { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .quote-actions { flex: 0 0 21rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quote-items-heading { flex-direction: row; align-items: center; justify-content: space-between; }
  .quote-item { padding: 1.25rem; }
  .detail-totals { max-width: 28rem; margin-left: auto; }
  .status-form { flex-direction: row; }
  .status-form .form-select { flex: 1; }
  .quote-detail-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quote-detail-actions form { grid-column: auto; }
  .dashboard-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-recent-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .dashboard-recent-main { flex: 1; }
  .dashboard-recent-meta { flex: 0 0 auto; justify-content: flex-end; }
  .dashboard-quick-links { flex-direction: row; flex-wrap: wrap; }
  .navbar-nav .nav-link { padding-right: .75rem; padding-left: .75rem; }
}
