:root {
    --ink: #172033;
    --muted: #667085;
    --line: #e6e8ee;
    --surface: #ffffff;
    --page: #f5f7fb;
    --primary: #0f766e;
    --primary-dark: #115e59;
}

html, body { margin: 0; padding: 0; }
body { background: var(--page); color: var(--ink); }
.app-shell { display: flex; min-height: 100vh; }
.mobile-header, .mobile-drawer-overlay, .mobile-drawer, .mobile-drawer-close { display: none; }
.sidebar { width: 260px; background: #101828; color: #fff; padding: 20px 16px; position: sticky; top: 0; height: 100vh; transition: width .2s ease, padding .2s ease; }
.desktop-sidebar { box-sizing: border-box; flex: 0 0 260px; max-width: 260px; overflow-x: hidden; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 1.25rem; font-weight: 700; }
.brand-mark { width: 38px; height: 38px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: 0 0 38px; font-size: .86rem; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-toggle { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: rgba(255,255,255,.06); color: #fff; display: grid; place-items: center; line-height: 1; }
.sidebar-toggle:hover { background: rgba(255,255,255,.12); }
.sidebar .nav-link { color: #cbd5e1; border-radius: 8px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; min-height: 42px; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link img { width: 20px; height: 20px; filter: brightness(0) invert(1); opacity: .78; flex: 0 0 20px; }
.sidebar-footer { position: absolute; bottom: 20px; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.sidebar-footer small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cbd5e1; }
.sidebar-footer a { color: #fff; }
.sidebar-section-label { display: block; margin: 14px 12px 4px; color: #98a2b3; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.is-sidebar-collapsed .sidebar { width: 78px; padding-left: 14px; padding-right: 14px; }
.app-shell.is-sidebar-collapsed > .desktop-sidebar { flex-basis: 78px; max-width: 78px; overflow: hidden; }
.is-sidebar-collapsed .brand { justify-content: center; }
.is-sidebar-collapsed .brand-name,
.is-sidebar-collapsed .sidebar .nav-link span,
.is-sidebar-collapsed .desktop-sidebar .sidebar-section-label,
.is-sidebar-collapsed .sidebar-footer small,
.is-sidebar-collapsed .sidebar-footer a { display: none; }
.is-sidebar-collapsed .sidebar-top { justify-content: center; flex-direction: column; }
.is-sidebar-collapsed .desktop-sidebar .sidebar-nav { width: 100%; min-width: 0; overflow: hidden; }
.is-sidebar-collapsed .desktop-sidebar .nav-link { box-sizing: border-box; width: 100%; min-width: 0; justify-content: center; gap: 0; padding-left: 0; padding-right: 0; overflow: hidden; }
.is-sidebar-collapsed .desktop-sidebar .nav-link img { margin: 0 auto; }
.is-sidebar-collapsed .sidebar-footer { justify-content: center; }
.content { flex: 1; padding: 32px; min-width: 0; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: 1.7rem; font-weight: 700; }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.panel, .metric { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.04); }
.list-search { margin: 0 0 14px; }
.list-search-field { position: relative; display: block; width: min(100%, 520px); }
.list-search-field > span[aria-hidden] { position: absolute; z-index: 1; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.list-search-field .form-control { min-height: 44px; padding-left: 42px; }
.list-search-empty { padding: 24px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); text-align: center; }
.panel { padding: 22px; }
.panel h2, .section-title { font-size: 1.05rem; margin: 0 0 16px; font-weight: 700; }
.metric { padding: 18px; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; }
.metric span, .price-row span { color: var(--muted); }
.metric strong { font-size: 1.8rem; }
.dashboard-section { margin-bottom: 24px; }
.dashboard-quick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dashboard-section > h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .035em; }
.dashboard-status-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.dashboard-kpi-card, .dashboard-value-card { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px rgba(16,24,40,.04); }
.dashboard-kpi-card { min-height: 128px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.dashboard-kpi-card span, .dashboard-value-card span { color: var(--muted); font-size: .82rem; font-weight: 700; line-height: 1.25; }
.dashboard-kpi-card strong { font-size: 1.8rem; }
.dashboard-value-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dashboard-value-card { min-height: 128px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; }
.dashboard-value-card strong { font-size: 1.3rem; overflow-wrap: anywhere; }
.dashboard-card-icon, .dashboard-action-icon { width: 24px; height: 24px; flex: 0 0 24px; }
.dashboard-actions-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dashboard-actions-heading h2 { margin-bottom: 3px; }
.dashboard-actions-heading p, .dashboard-recommendation-group header p { margin: 0; color: var(--muted); }
.dashboard-recommendation-groups { display: grid; gap: 22px; }
.dashboard-recommendation-group > header { margin-bottom: 10px; }
.dashboard-recommendation-group h3 { margin: 0 0 3px; font-size: 1rem; font-weight: 800; }
.dashboard-action-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.dashboard-action-item { display: grid; grid-template-columns: 28px minmax(160px, 1fr) minmax(145px, .8fr) minmax(220px, 1.5fr) auto; gap: 12px; align-items: center; padding: 13px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.dashboard-action-item:last-child { border-bottom: 0; }
.dashboard-action-item > div { min-width: 0; }
.dashboard-action-item small { display: block; margin-bottom: 2px; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
.dashboard-action-item strong { display: block; overflow-wrap: anywhere; }
.dashboard-action-item .btn { white-space: nowrap; }
.dashboard-all-clear { min-height: 150px; display: grid; place-content: center; gap: 4px; border: 1px dashed #99d5cb; border-radius: 8px; background: #f2fbf8; color: var(--primary-dark); text-align: center; padding: 24px; }
.dashboard-all-clear strong { font-size: 1.2rem; }
.proposal-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.proposal-tabs { margin-bottom: 16px; }
.proposal-tab-content { min-width: 0; }
.proposal-archived-notice { margin-bottom: 16px; }
.proposal-revisions-list { margin-bottom: 0; }
.proposal-mail-modal .modal-dialog { max-width: 900px; }
.proposal-mail-attachments { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; }
.proposal-mail-attachments label { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.5rem; }
.proposal-send-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1.25rem; }
@media (max-width: 768px) {
    .list-search-field { width: 100%; }
  .proposal-mail-modal .modal-dialog { width: calc(100% - 1rem); max-width: none; height: calc(100dvh - 1rem); margin: .5rem; }
  .proposal-mail-modal .modal-content { max-height: calc(100dvh - 1rem); }
  .proposal-mail-attachments { display: grid; grid-template-columns: 1fr; }
  .proposal-mail-attachments label { padding: .45rem; border: 1px solid #dee2e6; border-radius: .5rem; }
  .proposal-send-summary { align-items: flex-start; flex-direction: column; }
}
.price-row { border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; justify-content: space-between; gap: 12px; }
.proposal-status-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.proposal-status-label { color: var(--muted); display: block; font-size: .82rem; margin-bottom: 4px; }
.proposal-status-final { color: var(--muted); font-weight: 700; }
.proposal-status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.proposal-status-rascunho { background: #f1f5f9; color: #475569; }
.proposal-status-enviada { background: #eff6ff; color: #1d4ed8; }
.proposal-status-em-negociacao { background: #fff7ed; color: #c2410c; }
.proposal-status-aprovada { background: #ecfdf5; color: #047857; }
.proposal-status-implantacao { background: #eef2ff; color: #4338ca; }
.proposal-status-concluida { background: #dcfce7; color: #166534; }
.proposal-status-recusada { background: #fef2f2; color: #b91c1c; }
.proposal-status-expirada { background: #fefce8; color: #a16207; }
.proposal-status-cancelada { background: #374151; color: #ffffff; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.actions { text-align: right; white-space: nowrap; }
.responsive-list { overflow: visible; padding: 0; }
.responsive-list .table { width: 100%; margin: 0; table-layout: fixed; }
.responsive-list th, .responsive-list td { padding: 14px 16px; vertical-align: middle; overflow-wrap: anywhere; }
.responsive-list th { color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.responsive-list tbody tr:last-child td { border-bottom: 0; }
.responsive-list .list-primary { min-width: 0; }
.responsive-list .list-primary strong { display: block; line-height: 1.3; }
.responsive-list .list-secondary-text { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.responsive-list .list-value, .responsive-list .list-status { white-space: nowrap; }
.responsive-list .list-actions { width: 1%; min-width: max-content; text-align: right; white-space: normal; }
.responsive-list .list-actions-inner { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.responsive-list .list-actions form { margin: 0; }
.responsive-list .list-actions .btn { white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; background: #f1f5f9; color: #475569; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.status-badge.is-active { background: #ecfdf5; color: #047857; }
.status-badge.is-inactive { background: #f1f5f9; color: #667085; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.settings-form { padding-bottom: 0; }
.settings-tabs { margin: -6px 0 22px; gap: 4px; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; }
.settings-tabs .nav-link { color: var(--muted); white-space: nowrap; border-radius: 8px 8px 0 0; }
.settings-tabs .nav-link.active { color: var(--primary-dark); font-weight: 700; }
.settings-tab-content { min-height: 420px; }
.settings-section-header { margin-bottom: 18px; }
.settings-section-header h2 { margin-bottom: 4px; }
.settings-section-header p { margin: 0; color: var(--muted); }
.settings-section-divider { border-top: 1px solid var(--line); margin: 26px 0 22px; }
.settings-toggle { display: flex; align-items: center; gap: 8px; min-height: 38px; margin: 0; }
.commercial-contact-qr { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #f8fafc; }
.commercial-contact-qr-preview { aspect-ratio: 1 / 1; border: 1px dashed #cbd5e1; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.commercial-contact-qr-preview img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.commercial-contact-qr-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.commercial-contact-qr-actions .btn input { position: absolute; opacity: 0; pointer-events: none; }
.settings-form-actions { position: sticky; bottom: 0; z-index: 4; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin: 24px -22px 0; padding: 16px 22px; background: #fff; box-shadow: 0 -10px 24px rgba(16,24,40,.06); border-radius: 0 0 8px 8px; }
.settings-form-actions span { color: var(--muted); font-size: .9rem; }
.smtp-settings-sections { display: grid; gap: 16px; }
.smtp-settings-card { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #f8fafc; }
.smtp-settings-card header { margin-bottom: 16px; }
.smtp-settings-card h3 { margin: 0 0 3px; font-size: 1rem; font-weight: 800; }
.smtp-settings-card header p { margin: 0; color: var(--muted); font-size: .9rem; }
.smtp-password-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: .86rem; }
.smtp-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.smtp-combination-warning { margin-top: 10px; padding: 9px 11px; border: 1px solid #f3d28b; border-radius: 8px; background: #fff8e8; color: #7a4b00; font-size: .86rem; }
.smart-select { position: relative; min-width: min(100%, 280px); }
.smart-select-trigger { width: 100%; min-height: 38px; border: 1px solid #dee2e6; border-radius: .375rem; background: #fff; color: var(--ink); padding: .375rem .75rem; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.smart-select-trigger::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-top: -4px; flex: 0 0 8px; }
.smart-select-trigger.has-value { border-color: #b8c4d6; }
.smart-select.is-open .smart-select-trigger { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(15,118,110,.12); }
.smart-select-menu { display: none; position: absolute; z-index: 1080; top: calc(100% + 6px); left: 0; right: 0; max-height: min(420px, 70vh); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 18px 44px rgba(16,24,40,.16); }
.smart-select.is-open .smart-select-menu { display: block; }
.smart-select-search { padding: 10px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.smart-select-options { max-height: 335px; overflow: auto; }
.smart-select-option, .smart-select-new { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 11px 12px; text-align: left; color: var(--ink); }
.smart-select-option:hover, .smart-select-option.is-active { background: #ecfdf5; }
.smart-select-option span { display: inline-flex; border-radius: 999px; background: #f1f5f9; color: var(--muted); padding: 2px 7px; margin-bottom: 5px; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.smart-select-option strong { display: block; font-size: .96rem; line-height: 1.25; }
.smart-select-option small { display: block; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.smart-select-new { color: var(--primary-dark); font-weight: 700; background: #f8fafc; }
.smart-select-empty { padding: 14px; color: var(--muted); text-align: center; }
.smart-select-summary { border: 1px solid var(--line); border-radius: 8px; margin-top: 10px; padding: 10px 12px; background: #f8fafc; display: grid; gap: 6px; }
.smart-select-summary[hidden] { display: none; }
.smart-select-summary div { min-width: 0; }
.smart-select-summary small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; font-weight: 700; }
.smart-select-summary strong { display: block; overflow-wrap: anywhere; }
.ui-dialog-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; background: rgba(16,24,40,.54); opacity: 0; transition: opacity 150ms ease; }
.ui-dialog-overlay.is-visible { opacity: 1; }
.ui-dialog-overlay.is-leaving { opacity: 0; }
.ui-dialog-window { width: min(420px, 100%); border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 24px 70px rgba(16,24,40,.24); padding: 26px; text-align: center; transform: translateY(4px); transition: transform 150ms ease; }
.ui-dialog-overlay.is-visible .ui-dialog-window { transform: translateY(0); }
.ui-dialog-icon { width: 46px; height: 46px; border-radius: 999px; margin: 0 auto 14px; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; }
.ui-dialog-info .ui-dialog-icon { background: #eff6ff; color: #1d4ed8; }
.ui-dialog-success .ui-dialog-icon { background: #ecfdf5; color: #047857; }
.ui-dialog-warning .ui-dialog-icon { background: #fffbeb; color: #b45309; }
.ui-dialog-error .ui-dialog-icon { background: #fef2f2; color: #b91c1c; }
.ui-dialog-confirm .ui-dialog-icon, .ui-dialog-choice .ui-dialog-icon { background: #f8fafc; color: var(--primary-dark); }
.ui-dialog-window h2 { margin: 0 0 8px; color: var(--ink); font-size: 1.2rem; font-weight: 800; }
.ui-dialog-window p { margin: 0; color: var(--muted); line-height: 1.48; }
.ui-dialog-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.ui-dialog-actions .btn { min-width: 108px; }
.ui-dialog-choice .ui-dialog-actions { flex-wrap: wrap; }
.ui-dialog-form .ui-dialog-window { text-align: left; width: min(460px, 100%); }
.ui-dialog-form .ui-dialog-icon, .ui-dialog-form .ui-dialog-window h2, .ui-dialog-form p[data-ui-dialog-message]:empty { text-align: center; }
.ui-dialog-fields { display: grid; gap: 14px; margin-top: 16px; }
.ui-dialog-field label { display: block; margin-bottom: 6px; font-weight: 700; font-size: .85rem; color: var(--ink); }
.ui-dialog-field .form-control, .ui-dialog-field .form-select { width: 100%; }
.has-quick-view-open { overflow: hidden; }
.quick-view-overlay { position: fixed; inset: 0; z-index: 1900; display: grid; place-items: center; padding: 24px; background: rgba(16,24,40,.58); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 160ms ease, visibility 160ms ease; }
.quick-view-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.quick-view-dialog { width: min(900px, 100%); max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 28px 80px rgba(16,24,40,.28); transform: translateY(6px); transition: transform 160ms ease; }
.quick-view-overlay.is-open .quick-view-dialog { transform: translateY(0); }
.quick-view-header, .quick-view-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: #fff; }
.quick-view-header { border-bottom: 1px solid var(--line); }
.quick-view-footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.quick-view-header h2 { margin: 0; font-size: 1.2rem; font-weight: 800; }
.quick-view-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border: 0; border-radius: 8px; background: #f1f5f9; color: var(--ink); font-size: 1.45rem; line-height: 1; }
.quick-view-close:hover { background: #e2e8f0; }
.quick-view-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 20px; overscroll-behavior: contain; }
.client-history-loading, .client-history-empty { padding: 32px 18px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.client-history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.client-history-head h3 { margin: 0 0 4px; font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.client-history-head p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.client-history-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.client-history-metrics div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.client-history-metrics span, .client-history-metrics strong { display: block; }
.client-history-metrics span { color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; }
.client-history-metrics strong { margin-top: 3px; font-size: 1.05rem; overflow-wrap: anywhere; }
.client-summary-bar { margin-top: 16px; }
.client-summary-divergence { color: #b45309; cursor: help; }
.client-history-list { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.client-history-section { margin-bottom: 22px; }
.client-history-section h4 { margin: 0 0 10px; font-size: .92rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.client-history-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.client-history-section-head h4 { margin: 0; }
.client-history-section-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-stage-field { display: flex; align-items: center; gap: 10px; }
.client-stage-field select { max-width: 260px; }
.client-stage-hint { color: var(--muted); font-size: .82rem; min-height: 1.2em; }
.client-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; }
.client-timeline-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; }
.client-timeline-item-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.client-timeline-item-head strong { font-size: .92rem; }
.client-timeline-proposal { color: var(--muted); font-size: .82rem; }
.client-timeline-date { margin-left: auto; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.client-timeline-description { margin: 6px 0 0; overflow-wrap: anywhere; }
.client-timeline-author { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.client-timeline-empty { padding: 18px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.validation-summary { border: 1px solid; border-radius: 8px; margin-bottom: 18px; padding: 14px 16px; }
.validation-summary[hidden] { display: none; }
.validation-summary strong, .validation-summary span { display: block; }
.validation-summary strong { margin-bottom: 4px; }
.validation-summary ul { margin: 8px 0 0; padding-left: 20px; }
.validation-summary--error { border-color: #f1aeb5; background: #fff5f5; color: #842029; }
.validation-summary--warning { border-color: #ffda6a; background: #fff9e6; color: #664d03; }
.validation-summary--success { border-color: #75b798; background: #edf9f0; color: #0f5132; }
.validation-summary--info { border-color: #9eeaf9; background: #eefafd; color: #055160; }
.validation-field--error .smart-select-trigger, .validation-field--error .form-control { border-color: #dc3545; }
.validation-field--warning .smart-select-trigger, .validation-field--warning .form-control { border-color: #ffc107; }
.validation-field--success .smart-select-trigger, .validation-field--success .form-control { border-color: #198754; }
.validation-field--info .smart-select-trigger, .validation-field--info .form-control { border-color: #0dcaf0; }
.validation-field--error .smart-select-trigger:focus { border-color: #dc3545; box-shadow: 0 0 0 .2rem rgba(220,53,69,.16); }
.validation-field-message { margin-top: 6px; font-size: .875rem; }
.validation-field-message--error { color: #b02a37; }
.validation-field-message--warning { color: #997404; }
.validation-field-message--success { color: #146c43; }
.validation-field-message--info { color: #087990; }
.plan-editor { padding-bottom: 0; }
.plan-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.plan-builder { min-width: 0; }
.plan-services-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.plan-services-header p { color: var(--muted); margin: -8px 0 0; }
.plan-search-row { margin-bottom: 12px; }
.plan-total-summary { border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 10px 14px; min-width: 180px; text-align: right; }
.plan-total-summary span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.plan-total-summary strong { display: block; font-size: 1.25rem; }
.plan-service-grid { display: grid; gap: 12px; }
.plan-service-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; box-shadow: 0 8px 22px rgba(16,24,40,.035); }
.plan-service-card-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.plan-service-heading { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.plan-service-icon { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; display: grid; place-items: center; flex: 0 0 42px; font-weight: 800; }
.plan-service-card h3 { font-size: 1.02rem; font-weight: 700; margin: 0 0 2px; }
.plan-service-card small { color: var(--muted); }
.plan-service-status { border-radius: 999px; background: #f1f5f9; color: var(--muted); padding: 4px 9px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.plan-service-status.is-linked { background: #ecfdf5; color: var(--primary-dark); }
.plan-service-status.is-temporary { background: #fff7ed; color: #9a3412; }
.plan-service-warning { border: 1px solid #fed7aa; border-radius: 8px; background: #fff7ed; color: #9a3412; padding: 8px 10px; margin-bottom: 12px; font-size: .9rem; }
.plan-service-fields { display: grid; grid-template-columns: minmax(96px, .42fr) minmax(140px, .6fr) minmax(150px, .7fr); gap: 12px; align-items: end; }
.commercial-cycles-table th, .commercial-cycles-table td { white-space: nowrap; }
.commercial-cycle-discount { min-width: 110px; }
.plan-price-output { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; display: flex; align-items: center; padding: 6px 10px; font-weight: 700; }
.plan-discount-note { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.plan-summary-panel { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; box-shadow: 0 8px 22px rgba(16,24,40,.035); }
.plan-summary-panel h2 { font-size: 1rem; font-weight: 800; margin: 0 0 12px; text-transform: uppercase; color: var(--muted); }
.plan-summary-metrics { display: grid; gap: 8px; }
.plan-summary-metrics span { border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 9px 10px; color: var(--muted); font-size: .82rem; }
.plan-summary-metrics strong { display: block; color: var(--ink); font-size: 1rem; margin-top: 2px; }
.plan-summary-items { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: grid; gap: 8px; color: var(--muted); font-size: .88rem; }
.plan-summary-items div { color: var(--ink); }
.plan-add-service-dialog { max-width: min(860px, calc(100vw - 32px)); }
.plan-add-service-dialog .modal-content { max-height: min(88dvh, 820px); overflow: hidden; }
.plan-add-service-dialog .modal-body { overflow: auto; }
.plan-modal-filters { display: grid; grid-template-columns: 1fr 220px; gap: 10px; margin-bottom: 12px; }
.plan-service-picker-list { display: grid; gap: 10px; }
.plan-service-picker-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-service-picker-card strong, .plan-service-picker-card small, .plan-service-picker-card span { display: block; }
.plan-service-picker-card small { color: var(--muted); margin: 2px 0; }
.plan-service-picker-card span { color: var(--ink); font-weight: 700; }
.plan-form-actions { position: sticky; bottom: 0; z-index: 5; justify-content: space-between; border-top: 1px solid var(--line); margin: 24px -22px 0; padding: 16px 22px; background: #fff; box-shadow: 0 -10px 24px rgba(16,24,40,.06); border-radius: 0 0 8px 8px; }
.logo-preview { border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 110px; display: grid; place-items: center; padding: 14px; }
.logo-preview img { max-width: 100%; max-height: 96px; object-fit: contain; }
.logo-empty { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); min-height: 110px; display: grid; place-items: center; padding: 14px; text-align: center; }
.solution-preview h3 { margin: 8px 0 4px; }
.solution-preview h4 { font-size: .95rem; margin: 16px 0 8px; }
.solution-preview-icon { font-size: 2rem; line-height: 1; }
.solution-form-actions { border-top: 1px solid var(--line); margin: 24px -22px -22px; padding: 16px 22px; background: #f8fafc; border-radius: 0 0 8px 8px; }
.solution-tabs { row-gap: 6px; }
.solution-live-preview { position: sticky; top: 24px; }
.solution-live-preview h3 { margin: 10px 0 4px; font-size: 1.35rem; }
.solution-preview-swatch { width: 100%; height: 8px; border-radius: 8px; margin-bottom: 18px; }
.solution-preview-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.solution-preview-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--muted); background: #fff; font-size: .875rem; }
.solution-image-placeholder { border: 1px dashed var(--line); border-radius: 8px; background: #f8fafc; color: var(--muted); min-height: 92px; display: grid; place-items: center; text-align: center; padding: 14px; }
.solution-tab-header { margin-bottom: 18px; }
.solution-tab-header p { color: var(--muted); margin: 4px 0 0; }
.solution-benefit-form { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 18px; background: #f8fafc; }
.solution-benefit-form h3 { font-size: 1rem; font-weight: 700; margin: 0 0 14px; }
.solution-empty-state { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); padding: 18px; text-align: center; }
.benefit-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: start; margin-bottom: 12px; background: #fff; }
.benefit-icon { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; font-size: 1.2rem; font-weight: 700; background: #f8fafc; }
.benefit-icon img { width: 24px; height: 24px; }
.benefit-content h3 { margin: 0 0 4px; font-size: 1rem; }
.benefit-content p { margin: 0 0 8px; color: var(--muted); }
.benefit-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: .875rem; }
.benefit-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sales-plan-tab-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sales-plan-tab-header p + p { margin-top: 2px; }
.sales-plans-list { display: grid; gap: 12px; }
.sales-plan-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 16px; align-items: start; background: #fff; box-shadow: 0 8px 22px rgba(16,24,40,.035); }
.sales-plan-card.is-inactive { opacity: .68; }
.sales-plan-card-icon { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; font-size: 1.2rem; font-weight: 700; background: #f8fafc; }
.sales-plan-card-icon img { width: 24px; height: 24px; }
.sales-plan-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sales-plan-card-content h3 { margin: 0; font-size: 1.03rem; font-weight: 700; }
.sales-plan-card-content p { margin: 8px 0 0; color: var(--muted); }
.sales-plan-card-meta { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 8px; }
.sales-plan-card-meta span { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); background: #f8fafc; font-size: .9rem; min-width: 0; }
.sales-plan-card-meta small { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; margin-bottom: 2px; }
.sales-plan-status { border-radius: 999px; padding: 4px 9px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.sales-plan-status.is-active { background: #ecfdf5; color: var(--primary-dark); }
.sales-plan-status.is-inactive { background: #f1f5f9; color: var(--muted); }
.sales-plan-card-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; min-width: 210px; }
.sales-plan-form-section { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #f8fafc; margin-bottom: 14px; }
.sales-plan-form-section h4 { font-size: .95rem; font-weight: 700; margin: 0 0 14px; text-transform: uppercase; color: var(--muted); }
.sales-plan-status-select { max-width: 220px; }
.sales-plan-modal-dialog { max-width: min(1120px, calc(100vw - 32px)); }
.sales-plan-modal-dialog .modal-content { max-height: min(92dvh, 920px); overflow: hidden; }
.sales-plan-modal-form { display: flex; flex-direction: column; max-height: min(92dvh, 920px); }
.sales-plan-modal-form .modal-header { flex: 0 0 auto; }
.sales-plan-modal-form .modal-body { flex: 1 1 auto; overflow: auto; padding: 20px; }
.sales-plan-modal-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr); gap: 20px; align-items: start; }
.sales-plan-modal-footer { flex: 0 0 auto; justify-content: space-between; gap: 12px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -10px 24px rgba(16,24,40,.06); }
.sales-plan-client-preview { position: sticky; top: 0; border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.06); }
.sales-plan-client-preview > span { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.sales-plan-stars { color: #f59e0b; letter-spacing: 2px; margin-bottom: 12px; }
.sales-plan-preview-icon { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--primary); margin-bottom: 12px; }
.sales-plan-client-preview h4 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 800; }
.sales-plan-client-preview strong, .sales-plan-client-preview em { display: inline-flex; border-radius: 999px; padding: 5px 10px; margin: 0 6px 10px 0; font-size: .85rem; }
.sales-plan-client-preview strong { background: #ecfdf5; color: var(--primary-dark); }
.sales-plan-client-preview em { background: #f8fafc; color: var(--ink); font-style: normal; border: 1px solid var(--line); }
.sales-plan-client-preview p { color: var(--muted); margin: 4px 0 0; }
.icon-picker-preview { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; align-items: center; gap: 10px; background: #fff; min-height: 58px; }
.icon-picker-thumb { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: .75rem; text-align: center; }
.icon-picker-thumb img { width: 24px; height: 24px; }
.icon-picker-state { min-width: 0; }
.icon-picker-state strong, .icon-picker-state small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-picker-state small { color: var(--muted); }
.icon-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 10px; }
.icon-picker-option { border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 112px; padding: 12px 8px; display: grid; place-items: center; gap: 6px; color: var(--ink); }
.icon-picker-option:hover, .icon-picker-option.is-selected { border-color: var(--primary); background: #ecfdf5; }
.icon-picker-option img { width: 28px; height: 28px; }
.icon-picker-option strong { font-size: .9rem; text-align: center; }
.icon-picker-option small { color: var(--muted); font-size: .78rem; }
.icon-picker-empty { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); padding: 18px; text-align: center; }
.modal { z-index: 1065 !important; }
.modal-backdrop { z-index: 1060 !important; }
.guest-bg { min-height: 100vh; background: linear-gradient(135deg, #101828, #0f766e); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 10px; padding: 32px; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.login-card h1 { margin: 14px 0 4px; font-size: 1.8rem; }
.login-card p { color: var(--muted); margin: 0; }
.login-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; background: var(--primary); color: #fff; font-weight: 800; border-radius: 8px; }

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar, .is-sidebar-collapsed .sidebar { position: static; width: 100%; height: auto; padding: 14px; }
    .sidebar-top, .is-sidebar-collapsed .sidebar-top { flex-direction: row; justify-content: space-between; margin-bottom: 12px; }
    .sidebar-nav { flex-direction: row !important; overflow-x: auto; padding-bottom: 2px; }
    .sidebar .nav-link, .is-sidebar-collapsed .sidebar .nav-link { flex: 0 0 auto; justify-content: center; padding: 10px; }
    .sidebar .nav-link span, .is-sidebar-collapsed .sidebar .nav-link span { display: none; }
    .is-sidebar-collapsed .brand-name { display: inline; }
    .sidebar-footer, .is-sidebar-collapsed .sidebar-footer { position: static; margin-top: 12px; justify-content: space-between; }
    .is-sidebar-collapsed .sidebar-footer small, .is-sidebar-collapsed .sidebar-footer a { display: inline; }
    .content { padding: 20px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-header .btn, .page-header > .d-flex { width: 100%; }
    .settings-tab-content { min-height: auto; }
    .settings-form-actions { align-items: stretch; flex-direction: column; }
    .settings-form-actions .btn { width: 100%; }
    .smtp-settings-card { padding: 14px; }
    .smtp-settings-actions { display: grid; grid-template-columns: 1fr; }
    .smtp-settings-actions .btn { width: 100%; min-height: 44px; }
    .benefit-card, .sales-plan-card { grid-template-columns: 1fr; }
    .benefit-actions, .sales-plan-card-actions { justify-content: flex-start; }
    .sales-plan-card-actions { min-width: 0; }
    .sales-plan-card-meta { grid-template-columns: 1fr; }
    .plan-editor-layout { grid-template-columns: 1fr; }
    .plan-summary-panel { position: static; }
    .plan-services-header { display: block; }
    .plan-services-header .btn { width: 100%; margin-top: 12px; }
    .plan-total-summary { text-align: left; margin-top: 12px; }
    .plan-service-fields { grid-template-columns: 1fr; }
    .plan-service-card-main { display: block; }
    .plan-service-card-main .btn { margin-top: 10px; }
    .plan-service-status { display: inline-flex; margin-top: 8px; }
    .sales-plan-tab-header { display: block; }
    .sales-plan-tab-header .btn { width: 100%; margin-top: 12px; }
    .dashboard-status-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dashboard-action-item { grid-template-columns: 28px minmax(135px, 1fr) minmax(125px, .8fr) minmax(180px, 1.3fr) auto; gap: 9px; }
    .proposal-header-actions { width: 100%; justify-content: flex-start; }
}

@media (min-width: 769px) and (max-width: 1366px) {
    .responsive-list .list-secondary { display: none; }
    .responsive-list th, .responsive-list td { padding: 12px 10px; }
    .responsive-list .list-actions-inner { gap: 5px; }
    .responsive-list .btn-sm { padding-left: .5rem; padding-right: .5rem; }
}

@media (max-width: 991.98px) {
    .sales-plan-modal-dialog { max-width: calc(100vw - 24px); margin-left: auto; margin-right: auto; }
    .sales-plan-modal-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, .72fr); gap: 16px; }
    .sales-plan-client-preview { padding: 14px; }
}

@media (max-width: 768px) {
    body.has-mobile-drawer-open { overflow: hidden; }
    .app-shell { display: block; }
    .mobile-header { position: sticky; top: 0; z-index: 1030; display: grid; grid-template-columns: minmax(0, 1fr) 42px; align-items: center; gap: 12px; width: 100%; height: 64px; min-height: 64px; margin: 0; padding: 10px 16px; background: #101828; color: #fff; box-shadow: 0 4px 18px rgba(16,24,40,.16); }
    .mobile-header .brand { font-size: 1.05rem; }
    .mobile-header .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
    .mobile-menu-toggle, .mobile-drawer-close { width: 42px; height: 42px; margin: 0; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; font-size: 1.35rem; line-height: 1; }
    .mobile-menu-icon { width: 20px; display: grid; gap: 4px; }
    .mobile-menu-icon i { display: block; width: 100%; height: 2px; border-radius: 999px; background: currentColor; }
    .mobile-menu-toggle:hover, .mobile-drawer-close:hover { background: rgba(255,255,255,.16); }
    .app-shell > .desktop-sidebar, .is-sidebar-collapsed.app-shell > .desktop-sidebar { display: none !important; }
    .mobile-drawer, .is-sidebar-collapsed .mobile-drawer { display: block; position: fixed; z-index: 1050; inset: 0 auto 0 0; width: 80vw; max-width: 320px; height: 100dvh; margin: 0; padding: 12px 16px 18px; overflow-y: auto; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 48px rgba(16,24,40,.24); }
    .is-mobile-drawer-open .mobile-drawer { transform: translateX(0); }
    .sidebar-top, .is-sidebar-collapsed .sidebar-top { min-height: 42px; justify-content: flex-end; margin: 0 0 12px; }
    .sidebar-top .brand { display: none; }
    .sidebar-toggle { display: none; }
    .mobile-drawer-close { display: grid; }
    .sidebar-nav { flex-direction: column !important; gap: 4px !important; overflow: visible; padding: 0; }
    .sidebar .nav-link, .is-sidebar-collapsed .sidebar .nav-link { justify-content: flex-start; min-height: 44px; padding: 11px 12px; }
    .sidebar .nav-link span, .is-sidebar-collapsed .sidebar .nav-link span { display: inline; }
    .sidebar-footer, .is-sidebar-collapsed .sidebar-footer { position: absolute; bottom: 18px; left: 16px; right: 16px; display: grid; gap: 4px; align-items: stretch; margin: 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
    .sidebar-footer .sidebar-user, .sidebar-footer .sidebar-logout { display: flex; align-items: center; min-height: 44px; margin: 0; padding: 10px 12px; border-radius: 8px; }
    .sidebar-footer .sidebar-user { overflow: hidden; color: #cbd5e1; text-overflow: ellipsis; white-space: nowrap; }
    .sidebar-footer .sidebar-logout { color: #fff; text-decoration: none; }
    .sidebar-footer .sidebar-logout:hover { background: rgba(255,255,255,.08); }
    .mobile-drawer-overlay { position: fixed; z-index: 1040; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(16,24,40,.58); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    .is-mobile-drawer-open .mobile-drawer-overlay { display: block; opacity: 1; pointer-events: auto; }
    .content { padding: 16px; }
    .content, .content > *, .panel, .row, form { max-width: 100%; min-width: 0; }
    img, input, select, textarea { max-width: 100%; }
    .panel.responsive-list { border: 0; box-shadow: none; background: transparent; }
    .responsive-list .table, .responsive-list tbody { display: block; width: 100%; }
    .responsive-list thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    .responsive-list tbody { display: grid; gap: 12px; }
    .responsive-list tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px rgba(16,24,40,.04); }
    .responsive-list tbody td { display: block; width: auto !important; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; }
    .responsive-list tbody td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .responsive-list tbody td.list-primary { grid-column: 1 / -1; font-size: 1rem; }
    .responsive-list tbody td.list-primary { order: -1; }
    .responsive-list tbody td.list-primary::before { display: none; }
    .responsive-list tbody td.list-secondary { color: var(--muted); }
    .responsive-list tbody td.list-wide { grid-column: 1 / -1; }
    .responsive-list tbody td.list-actions { order: 99; grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
    .responsive-list tbody td.list-actions { min-width: 0; }
    .responsive-list tbody td.list-actions::before { display: none; }
    .responsive-list .list-actions-inner { justify-content: flex-start; }
    .responsive-list .list-actions-inner > * { flex: 1 1 120px; min-width: 0; }
    .responsive-list .list-actions form .btn, .responsive-list .list-actions > .list-actions-inner > .btn { width: 100%; }
    .responsive-list .list-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .quick-view-overlay { padding: 12px; }
    .quick-view-dialog { width: 100%; max-height: 90dvh; }
    .quick-view-header, .quick-view-footer { padding: 13px 14px; }
    .quick-view-body { padding: 14px; }
    .client-history-head { display: grid; gap: 10px; }
    .client-history-head .status-badge { justify-self: start; }
    .client-history-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-history-list { border: 0; overflow: visible; }
    .client-history-list .list-actions-inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-history-list .list-actions-inner > * { width: 100%; min-width: 0; }
    .dashboard-quick-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-quick-actions .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; white-space: normal; }
    .dashboard-status-grid, .dashboard-value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-kpi-card, .dashboard-value-card { min-height: 88px; }
    .dashboard-actions-panel { padding: 14px; }
    .dashboard-action-list { display: grid; gap: 10px; border: 0; overflow: visible; }
    .dashboard-action-item { grid-template-columns: 28px minmax(0, 1fr); gap: 10px 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(16,24,40,.035); }
    .dashboard-action-item:last-child { border-bottom: 1px solid var(--line); }
    .dashboard-action-client { grid-column: 2; }
    .dashboard-action-number, .dashboard-action-description { grid-column: 1 / -1; }
    .dashboard-action-item .btn { grid-column: 1 / -1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .proposal-header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .proposal-header-actions .btn { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; white-space: normal; }
    .proposal-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .proposal-tabs .nav-link { min-height: 44px; white-space: nowrap; }
    .sales-plan-modal-dialog { max-width: 100vw; margin: 0; min-height: 100dvh; }
    .sales-plan-modal-dialog .modal-content,
    .sales-plan-modal-form { min-height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .sales-plan-modal-form .modal-body { padding: 16px; }
    .sales-plan-modal-grid { grid-template-columns: 1fr; }
    .sales-plan-client-preview { position: static; }
    .sales-plan-modal-footer { padding: 12px 16px; }
    .sales-plan-modal-footer .btn { flex: 1 1 0; }
    .plan-add-service-dialog { max-width: 100vw; margin: 0; min-height: 100dvh; }
    .plan-add-service-dialog .modal-content { min-height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .plan-modal-filters { grid-template-columns: 1fr; }
    .plan-service-picker-card { align-items: flex-start; flex-direction: column; }
    .plan-service-picker-card .btn { width: 100%; }
    .plan-form-actions .btn { flex: 1 1 0; }
}
.user-qr-preview{min-height:150px;border:1px dashed var(--bs-border-color);border-radius:.75rem;padding:1rem;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.user-qr-preview img{display:block;width:min(160px,100%);height:160px;object-fit:contain;margin-bottom:.75rem}@media(max-width:576px){.user-qr-preview{min-height:130px}.user-qr-preview img{height:130px}}
.contract-variable-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.contract-variable-grid>div,.contract-variable-grid>code{display:flex;flex-direction:column;gap:3px;padding:10px;border:1px solid var(--line);border-radius:8px;background:#f8fafc;overflow-wrap:anywhere}.contract-variable-grid small{color:var(--muted)}.contract-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.contract-summary-grid .metric{display:grid;gap:5px;padding:18px}.contract-solution-list{display:grid;gap:14px}.contract-solution-list>article{display:grid;gap:8px;padding:16px;border:1px solid var(--line);border-radius:8px}.contract-solution-list p,.contract-clause p{white-space:normal;margin-bottom:0}.contract-clause{padding:14px 0;border-bottom:1px solid var(--line)}.contract-clause h3{font-size:1rem;text-transform:capitalize}@media(max-width:768px){.contract-variable-grid,.contract-summary-grid{grid-template-columns:1fr}.contract-summary-grid .metric{padding:14px}.contract-solution-list>article{padding:14px}}
.contract-wizard{display:grid;gap:18px}.contract-wizard-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:0;padding:0;list-style:none}.contract-wizard-steps li{display:flex;align-items:center;justify-content:center;gap:8px;padding:12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--muted)}.contract-wizard-steps li.is-active{border-color:var(--primary);color:var(--primary);box-shadow:0 0 0 2px rgba(15,118,110,.1)}.contract-wizard-steps b{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#e2e8f0}.contract-wizard-steps .is-active b{background:var(--primary);color:#fff}.contract-wizard-pane{padding:24px}.contract-model-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.contract-model-option{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;padding:16px;border:1px solid var(--line);border-radius:9px;cursor:pointer}.contract-model-option:has(input:checked){border-color:var(--primary);background:#f0fdfa}.contract-model-option input{grid-row:1/3}.contract-model-option span{color:var(--muted);font-size:.88rem}.contract-block-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.contract-block-list h3{grid-column:1/-1;font-size:1rem;margin:14px 0 2px}.contract-block-list label{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:8px;padding:11px;border:1px solid var(--line);border-radius:8px}.contract-block-list small{color:var(--muted)}.contract-wizard-actions{display:flex;justify-content:flex-end;gap:10px}.contract-preview{position:relative;max-width:900px;margin:0 auto;padding:28px;border:1px solid var(--line);border-radius:8px;background:#fff;overflow:hidden}.contract-document{position:relative;color:#1f2937}.contract-document header{text-align:center;margin-bottom:28px}.contract-document header h1{font-size:1.6rem;margin-top:6px}.contract-document section{margin:20px 0}.contract-document h2{font-size:1.05rem;text-transform:capitalize}.contract-document h3{font-size:1rem}.contract-document h4{font-size:.9rem;margin-top:12px}.contract-watermark{position:absolute;z-index:0;top:40%;left:8%;transform:rotate(-28deg);font-size:3.5rem;font-weight:800;color:rgba(185,28,28,.12);white-space:nowrap;pointer-events:none}.contract-draft-notice{position:relative;padding:10px;text-align:center;background:#fef3c7;border:1px solid #f59e0b;font-weight:700;margin-bottom:20px}.contract-warning{padding:10px;background:#fff7ed;border:1px solid #fb923c;margin-bottom:18px}.contract-service{padding:12px 0;border-bottom:1px solid var(--line)}@media(max-width:768px){.contract-wizard-steps li{padding:9px 4px}.contract-wizard-steps li span{display:none}.contract-wizard-pane{padding:16px}.contract-model-grid,.contract-block-list{grid-template-columns:1fr}.contract-preview{padding:16px}.contract-watermark{font-size:2rem;left:2%}.contract-wizard-actions .btn{flex:1}}

/* CTR-002A: documento contratual único para tela, impressão e futuro PDF. */
.contract-preview{box-sizing:border-box;max-width:210mm;padding:0;border:0;border-radius:2px;background:#fff;box-shadow:0 8px 30px rgba(15,23,42,.12);overflow:visible}
.contract-document{position:relative;isolation:isolate;box-sizing:border-box;width:100%;min-height:297mm;color:#172033;background:#fff;font-family:"DejaVu Sans",Arial,Helvetica,sans-serif;font-size:10.5pt;line-height:1.55;overflow-wrap:anywhere}
.contract-document *{box-sizing:border-box}.contract-document section{margin:0}.contract-document h1,.contract-document h2,.contract-document h3,.contract-document p,.contract-document dl,.contract-document dd{margin-top:0}.contract-document h2{font-size:11.5pt;line-height:1.35;letter-spacing:.035em;text-transform:uppercase;color:#123f3b}.contract-document h3{font-size:10.5pt;line-height:1.35}.document-cover{display:flex;flex-direction:column;min-height:297mm;padding:22mm 18mm 18mm;border-top:7px solid #0f766e;page-break-after:always;break-after:page}.contract-cover-top{display:flex;justify-content:space-between;align-items:flex-start;gap:24px}.contract-brand{display:flex;align-items:center;min-height:50px;max-width:58%}.contract-brand img{display:block;max-width:190px;max-height:64px;width:auto;height:auto;object-fit:contain}.contract-status-stamp{min-width:112px;padding:9px 12px;border:2px solid #334155;text-align:center;line-height:1.15;letter-spacing:.08em}.contract-status-stamp strong,.contract-status-stamp span{display:block}.contract-status-stamp span{margin-top:4px;font-size:7.5pt}.contract-status-stamp.status-minuta{border-color:#9a3412;color:#9a3412}.contract-cover-title{margin:auto 0;text-align:left}.contract-cover-title>span{font-size:9pt;font-weight:700;letter-spacing:.18em;color:#0f766e}.contract-cover-title h1{max-width:150mm;margin:12px 0 24px;font-size:25pt;line-height:1.15;text-transform:uppercase;color:#172033}.contract-cover-title p{margin:2px 0}.contract-cover-title .contract-number{font-size:15pt;font-weight:700;letter-spacing:.04em}.contract-cover-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 28px;padding-top:20px;border-top:1px solid #94a3b8}.contract-cover-details div,.contract-service-card dl div,.contract-payment dl div{min-width:0}.contract-cover-details dt,.contract-service-card dt,.contract-payment dt{margin-bottom:2px;font-size:7.5pt;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#64748b}.contract-cover-details dd{margin-bottom:0;font-weight:600}.contract-page-body{position:relative;padding:14mm 17mm 15mm}.contract-page-header{display:grid;grid-template-columns:minmax(90px,1fr) auto minmax(110px,1fr);align-items:center;gap:16px;margin-bottom:14mm!important;padding-bottom:7px;border-bottom:1px solid #cbd5e1;font-size:8pt}.contract-page-header>div:nth-child(2){text-align:center}.contract-page-header>div:last-child{text-align:right}.contract-page-header span{display:block;color:#64748b}.contract-brand-small{min-height:28px}.contract-brand-small img{max-width:105px;max-height:30px}.contract-parties,.contract-services,.contract-payment,.contract-signatures{margin-bottom:11mm!important}.contract-party-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.contract-party-grid article,.contract-service-card,.contract-payment{padding:14px;border:1px solid #cbd5e1;border-radius:4px;background:#fff}.contract-party-grid h3{margin-bottom:9px;color:#0f766e}.contract-party-grid p{margin-bottom:4px}.contract-clause{margin-bottom:8mm!important;padding:0!important;border:0!important}.contract-clause h2{margin-bottom:3mm}.contract-rich-text{text-align:justify;white-space:normal}.contract-service-list{display:grid;gap:10px}.contract-service-heading{display:flex;justify-content:space-between;gap:16px;padding-bottom:7px;border-bottom:1px solid #e2e8f0}.contract-service-heading h3{margin:0}.contract-service-heading strong{white-space:nowrap;color:#0f766e}.contract-service-card dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px;margin:9px 0 0}.contract-service-card dd{margin-bottom:0}.contract-payment{border-left:4px solid #0f766e}.contract-payment>h2{margin-bottom:10px}.contract-payment dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 18px;margin-bottom:0}.contract-payment-full{grid-column:1/-1}.contract-signature-grid,.contract-witness-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16mm;margin-top:22mm;text-align:center}.contract-witness-grid{margin-top:18mm}.contract-signature-line{display:block;border-top:1px solid #334155;margin-bottom:7px}.contract-signatures p{margin:2px 0}.contract-signatures small{color:#64748b}.contract-page-footer{display:grid;grid-template-columns:1fr auto;gap:3px 20px;margin-top:15mm;padding-top:6px;border-top:1px solid #cbd5e1;font-size:7pt;color:#64748b}.contract-page-footer small{grid-column:1/-1}.contract-watermark{position:absolute;z-index:2;top:145mm;left:50%;transform:translate(-50%,-50%) rotate(-31deg);font-size:38pt;font-weight:800;letter-spacing:.06em;color:rgba(153,27,27,.09);white-space:nowrap;pointer-events:none}.avoid-page-break{break-inside:avoid;page-break-inside:avoid}.keep-with-next{break-after:avoid;page-break-after:avoid}.document-page-break{break-before:page;page-break-before:always}
@media(max-width:768px){.contract-preview{width:100%;box-shadow:none}.contract-document{min-height:0;font-size:10pt}.document-cover{min-height:0;padding:28px 20px}.contract-cover-top,.contract-service-heading{align-items:flex-start}.contract-cover-title{margin:60px 0}.contract-cover-title h1{font-size:20pt}.contract-cover-details,.contract-party-grid,.contract-service-card dl,.contract-payment dl,.contract-signature-grid,.contract-witness-grid{grid-template-columns:1fr}.contract-page-body{padding:24px 20px}.contract-page-header{grid-template-columns:1fr auto}.contract-page-header>div:last-child{grid-column:1/-1;text-align:left}.contract-watermark{position:fixed;top:50%;font-size:22pt}.contract-signature-grid,.contract-witness-grid{gap:25mm;margin-top:18mm}}
@page{size:A4;margin:0}
@media print{
 html,body{width:210mm!important;margin:0!important;padding:0!important;background:#fff!important}
 body *{visibility:hidden}
 .contract-document-panel,.contract-document-panel *,.contract-saved-document,.contract-saved-document *{visibility:visible}
 .app-shell,.content,.contract-document-panel,.contract-saved-document,.contract-preview{display:block!important;width:210mm!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:#fff!important;box-shadow:none!important;overflow:visible!important}
 .sidebar,.mobile-header,.mobile-drawer,.mobile-drawer-overlay,.contract-screen-actions,.contract-screen-meta,.contract-wizard-actions,button,.btn,nav{display:none!important}
 .contract-document-panel{position:absolute!important;inset:0 auto auto 0!important}
 .contract-document{width:210mm!important;min-height:297mm!important;font-size:10pt!important}
 .contract-watermark{position:fixed!important;top:50%!important;left:50%!important;font-size:38pt!important}
 .document-cover{min-height:297mm!important}
 .avoid-page-break{break-inside:avoid!important;page-break-inside:avoid!important}
 .keep-with-next{break-after:avoid!important;page-break-after:avoid!important}
 .document-page-break{break-before:page!important;page-break-before:always!important}
}
