/* ============================================================
   COMPONENTS.CSS — Botões, Cards, Badges, Inputs, Modais, etc.
   ============================================================ */

/* ──────────────────────────────────────────
   BUTTONS
   ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 38px;
  padding: 0 var(--s4);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--r-md);
  cursor: pointer;
  border: none;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  line-height: 1;
  letter-spacing: -0.01em;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn svg, .btn [data-lucide] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Sizes */
.btn-xs  { height: 28px; padding: 0 var(--s3); font-size: var(--text-xs); }
.btn-sm  { height: 34px; padding: 0 var(--s4); font-size: var(--text-xs); }
.btn-md  { height: 40px; padding: 0 var(--s5); }
.btn-lg  { height: 48px; padding: 0 var(--s6); font-size: var(--text-md); }
.btn-xl  { height: 56px; padding: 0 var(--s8); font-size: var(--text-lg); }

/* Variants */
.btn-primary {
  background: var(--c-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--c-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15,118,110,0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.btn-secondary:hover {
  background: var(--c-bg-alt);
  border-color: var(--c-border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-secondary);
}
.btn-ghost:hover {
  background: var(--c-bg-alt);
  color: var(--c-text);
}

.btn-accent {
  background: var(--c-accent);
  color: white;
  box-shadow: var(--shadow-accent);
}
.btn-accent:hover {
  background: var(--c-accent-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--c-danger);
  color: white;
}
.btn-danger:hover {
  background: #DC2626;
  transform: translateY(-1px);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--c-danger);
  border: 1px solid var(--c-danger-border);
}
.btn-danger-ghost:hover {
  background: var(--c-danger-bg);
}

.btn-success {
  background: var(--c-success);
  color: white;
}
.btn-success:hover { background: #0D9E6E; transform: translateY(-1px); }

.btn-outline-primary {
  background: transparent;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
}
.btn-outline-primary:hover {
  background: var(--c-primary-bg);
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  box-shadow: 0 4px 14px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover {
  background: #20BA5A;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,211,102,0.4);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-md);
}

.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-icon.btn-lg { width: 44px; height: 44px; }

/* Loading state */
.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: var(--s2);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ──────────────────────────────────────────
   CARDS
   ────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.soft-card,
.card-elevated {
  background: white;
  border: 0;
  border-radius: var(--r-2xl);
  box-shadow: 0 14px 34px rgba(15,23,42,0.08);
}

.card-flat,
.section-clean,
.mobile-section {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.mobile-shell {
  width: 100%;
  min-width: 0;
}

.mobile-list-card,
.mobile-stat-card {
  background: white;
  border: 0;
  border-radius: var(--r-2xl);
  box-shadow: 0 10px 28px rgba(15,23,42,0.07);
}

.card-clickable {
  cursor: pointer;
}

.card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s5) var(--s6);
  border-bottom: 1px solid var(--c-border);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-text);
}

.card-body {
  padding: var(--s6);
}

.card-footer {
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
}

/* Metric Cards */
.metric-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--s5) var(--s6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base), transform var(--t-base);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  min-height: 148px;
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Dark mode: card surfaces (global, desktop + mobile) */
[data-theme="dark"] .card,
[data-theme="dark"] .soft-card,
[data-theme="dark"] .card-elevated,
[data-theme="dark"] .mobile-list-card,
[data-theme="dark"] .mobile-stat-card,
[data-theme="dark"] .metric-card {
  background: #111c2f;
  border-color: #273449;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .stat-card {
  background: #111c2f;
  border-color: #273449;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
  border-color: #273449;
}

[data-theme="dark"] .card-footer {
  background: #0f1a2d;
}

/* Dark mode: table surfaces (global, desktop + mobile) */
[data-theme="dark"] .table-wrapper,
[data-theme="dark"] .content-card,
[data-theme="dark"] .table-card {
  background: #111c2f;
  border-color: #273449;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] thead {
  background: #0f1a2d;
  border-bottom-color: #273449;
}

[data-theme="dark"] thead th {
  color: #94a3b8;
}

[data-theme="dark"] tbody tr {
  border-bottom-color: #273449;
}

[data-theme="dark"] tbody tr:hover {
  background: #0f1a2d;
}

[data-theme="dark"] tbody td {
  color: #cbd5e1;
}

[data-theme="dark"] .td-main {
  color: #e2e8f0;
}

/* Header: título à esquerda, ícone à direita */
.metric-card__header,
.metric-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: 0;
}

/* Título */
.metric-card__title,
.metric-card-label,
.metric-label,
.stat-card-title {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Ícone */
.metric-card__icon,
.metric-card-icon,
.metric-icon,
.stat-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-card__icon svg,
.metric-card__icon [data-lucide],
.metric-card-icon svg,
.metric-card-icon [data-lucide],
.metric-icon svg,
.metric-icon [data-lucide],
.stat-card-icon svg,
.stat-card-icon [data-lucide] {
  width: 18px;
  height: 18px;
}

/* Valor principal */
.metric-card__value,
.metric-card-value,
.metric-value,
.stat-card-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.04em;
  line-height: 1.1;
  word-break: keep-all;
  overflow-wrap: anywhere;
  flex-grow: 1;
  display: flex;
  align-items: flex-end;
  white-space: nowrap;
}

/* Meta / contexto */
.metric-card__meta,
.metric-card-change,
.metric-change,
.stat-card-meta {
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--s1);
  color: var(--c-text-muted);
  margin-top: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.metric-card__meta.up,
.metric-card-change.up,
.metric-change.positive,
.stat-card-meta.positive { color: var(--c-success); }

.metric-card__meta.down,
.metric-card-change.down { color: var(--c-danger); }

.metric-card__meta.neutral,
.metric-card-change.neutral { color: var(--c-text-muted); }


/* ──────────────────────────────────────────
   BADGES / STATUS
   ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

/* Status variants */
.badge-draft     { background: #F1F5F9; color: #64748B; }
.badge-sent      { background: var(--c-info-bg); color: var(--c-info); }
.badge-viewed    { background: var(--c-accent-bg); color: var(--c-accent); }
.badge-accepted  { background: var(--c-success-bg); color: var(--c-success); }
.badge-refused   { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-revision  { background: var(--c-warning-bg); color: #B45309; }
.badge-expired   { background: #F8FAFC; color: #94A3B8; border: 1px solid var(--c-border); }
.badge-converted { background: var(--c-primary-bg); color: var(--c-primary); }
.badge-converted-os { background: #14532d; color: #dcfce7; }
.badge-open      { background: var(--c-info-bg); color: var(--c-info); }
.badge-scheduled { background: var(--c-accent-bg); color: var(--c-accent); }
.badge-executing { background: var(--c-warning-bg); color: #B45309; }
.badge-done      { background: var(--c-success-bg); color: var(--c-success); }
.badge-cancelled { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-waiting   { background: #FFF7ED; color: #C2410C; }
.badge-pro       { background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); color: white; }
.badge-free      { background: var(--c-bg-alt); color: var(--c-text-secondary); }
.badge-neutral   { background: var(--c-bg-alt); color: var(--c-text-secondary); border: 1px solid var(--c-border); }
.badge-category  { background: var(--c-primary-bg); color: var(--c-primary); }
.badge-global    { background: var(--c-accent-bg); color: var(--c-accent); }
.badge-company   { background: var(--c-success-bg); color: var(--c-success); }

/* ──────────────────────────────────────────
   FORM INPUTS
   ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.card-body > .form-group + .form-group,
.editor-section-body > .form-group + .form-group,
.form-row + .form-group,
.form-row-2 + .form-group,
.form-group + .form-row,
.form-group + .form-row-2 {
  margin-top: var(--s4);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
}

.form-label-optional {
  font-weight: 400;
  color: var(--c-text-muted);
  font-size: var(--text-xs);
  margin-left: var(--s1);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 42px;
  padding: 0 var(--s4);
  background: white;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: var(--text-sm);
  font-family: var(--font);
  transition: all var(--t-fast);
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--c-text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-bg);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--c-bg);
  color: var(--c-text-muted);
  cursor: not-allowed;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 3px var(--c-danger-bg);
}

.form-textarea {
  height: auto;
  min-height: 100px;
  padding: var(--s3) var(--s4);
  resize: vertical;
  line-height: 1.6;
}

.form-textarea-lg {
  min-height: 160px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s3) center;
  padding-right: var(--s10);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--c-danger);
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s4);
}

.form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.input-group {
  display: flex;
  align-items: center;
}

.input-group .form-input {
  border-radius: var(--r-md) 0 0 var(--r-md);
  border-right: none;
}

.input-group-addon {
  height: 42px;
  padding: 0 var(--s4);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-left: none;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Input with icon */
.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .form-input {
  padding-left: var(--s10);
}

.input-icon {
  position: absolute;
  left: var(--s3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Toggle / Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--c-border-strong);
  border-radius: var(--r-full);
  transition: background var(--t-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t-fast);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
  background: var(--c-primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--s3);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--c-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  cursor: pointer;
}

/* Radio group */
.radio-cards {
  display: grid;
  gap: var(--s3);
}

.radio-card {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-fast);
}

.radio-card:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
}

.radio-card.selected {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
}

.radio-card input { accent-color: var(--c-primary); }

/* ──────────────────────────────────────────
   TABLES
   ────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border);
  background: white;
  box-shadow: var(--shadow-sm);
}

.content-card,
.table-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.table-card {
  overflow-x: auto;
}

.desktop-table {
  display: block;
}

.mobile-cards,
.mobile-list {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

thead {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

thead th {
  padding: var(--s3) var(--s5);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr {
  border-bottom: 1px solid var(--c-border);
  transition: background var(--t-fast);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--c-bg);
}

tbody td {
  padding: var(--s4) var(--s5);
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  vertical-align: middle;
}

.td-main {
  color: var(--c-text);
  font-weight: 600;
}

.td-num {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.td-actions {
  display: flex;
  align-items: center;
  gap: var(--s1);
  justify-content: flex-end;
}

.action-btns {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s1);
  white-space: nowrap;
}

.empty-row {
  text-align: center;
  color: var(--c-text-muted);
  padding: var(--s10) var(--s5);
}

.cards-grid,
.catalog-grid,
.template-grid,
.modelos-grid,
.stats-grid,
.plan-grid,
.help-grid,
.help-categories,
.contact-cards {
  display: grid;
  gap: var(--s5);
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.template-grid,
.modelos-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: var(--s6);
}

.stat-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--s5);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.stat-label {
  color: var(--c-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: var(--s2);
}

.stat-value {
  color: var(--c-text);
  font-size: var(--text-2xl);
  font-weight: 850;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.stat-delta {
  margin-top: var(--s2);
  font-size: var(--text-xs);
  font-weight: 650;
}

.stat-delta.positive { color: var(--c-success); }
.stat-delta.negative { color: var(--c-danger); }
.stat-delta.neutral { color: var(--c-text-muted); }

.detail-header,
.client-profile-header {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--s6);
  box-shadow: var(--shadow-sm);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s5);
}

.info-grid {
  display: grid;
  gap: var(--s3);
}

.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--c-border);
}

.info-row:last-child {
  border-bottom: 0;
}

.info-label {
  color: var(--c-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.document-shell,
.doc-public-wrapper {
  width: min(100% - 2rem, 920px);
  margin: var(--s8) auto;
}

.document-card,
.doc-a4,
.doc-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.form-shell,
.form-container {
  width: min(100%, 860px);
}

.form-container .card,
.editor-section,
.settings-section {
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}

.settings-grid,
.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--s6);
  align-items: start;
}

.timeline,
.progress-tracker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: var(--s3);
}

.progress-step {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  min-width: 0;
  color: var(--c-text-muted);
  text-align: center;
}

.progress-step-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
}

.progress-step.completed .progress-step-icon,
.progress-step.active .progress-step-icon {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}

.progress-step-label {
  color: var(--c-text);
  font-size: var(--text-sm);
  font-weight: 700;
}

.progress-step-line {
  display: none;
}

.progress-step-line.completed {
  background: var(--c-primary);
}

.checklist-list,
.checklist-view {
  display: grid;
  gap: var(--s3);
}

.checklist-item,
.checklist-view-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}

.checklist-view-text.checked {
  color: var(--c-text-muted);
  text-decoration: line-through;
}

.progress-bar-wrapper {
  height: 10px;
  background: var(--c-bg);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar-wrapper .progress-bar {
  height: 100%;
  background: var(--c-primary);
  border-radius: inherit;
}

/* ──────────────────────────────────────────
   AVATARS
   ────────────────────────────────────────── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar-md { width: 40px; height: 40px; font-size: var(--text-base); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-xl); }
.avatar-xl { width: 72px; height: 72px; font-size: var(--text-2xl); }

/* ──────────────────────────────────────────
   MODALS
   ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  backdrop-filter: blur(4px);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: white;
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--t-bounce);
  overflow: hidden;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s6) var(--s6) var(--s4);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-text);
  flex: 1;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--c-bg-alt);
  color: var(--c-text);
}

.modal-body {
  padding: var(--s6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s3);
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
}

/* ──────────────────────────────────────────
   DRAWER
   ────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: var(--z-modal);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
  backdrop-filter: blur(2px);
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: white;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--t-slow);
  z-index: calc(var(--z-modal) + 1);
}

.drawer-overlay.open .drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  padding: var(--s5) var(--s6);
  border-bottom: 1px solid var(--c-border);
  gap: var(--s4);
  flex-shrink: 0;
}

.drawer-title {
  font-size: var(--text-lg);
  font-weight: 700;
  flex: 1;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s6);
}

.drawer-footer {
  padding: var(--s4) var(--s6);
  border-top: 1px solid var(--c-border);
  display: flex;
  gap: var(--s3);
  flex-shrink: 0;
}

/* ──────────────────────────────────────────
   TABS
   ────────────────────────────────────────── */
.tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 2px solid var(--c-border);
}

.tab-item {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s5);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
}

.tab-item:hover {
  color: var(--c-text);
}

.tab-item.active {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
}

.tab-item svg, .tab-item [data-lucide] { width: 15px; height: 15px; }

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Pill Tabs */
.tabs-pill {
  display: flex;
  background: var(--c-bg);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 2px;
  border: none;
}

.tabs-pill .tab-item {
  border-radius: var(--r-full);
  border: none;
  margin: 0;
  padding: var(--s2) var(--s5);
}

.tabs-pill .tab-item.active {
  background: white;
  color: var(--c-text);
  box-shadow: var(--shadow-sm);
}

/* ──────────────────────────────────────────
   ACCORDION
   ────────────────────────────────────────── */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--c-border);
  background: white;
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s5) var(--s6);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  transition: background var(--t-fast);
}

.accordion-trigger:hover {
  background: var(--c-bg);
}

.accordion-trigger-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
}

.accordion-icon {
  width: 18px;
  height: 18px;
  color: var(--c-text-muted);
  flex-shrink: 0;
  transition: transform var(--t-fast);
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-slow), padding var(--t-slow);
}

.accordion-item.open .accordion-content {
  max-height: 1000px;
}

.accordion-body {
  padding: 0 var(--s6) var(--s5);
  color: var(--c-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
}

/* ──────────────────────────────────────────
   STEPPER
   ────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
}

.stepper-item {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.stepper-item:last-child {
  flex: none;
}

.stepper-step {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--s2);
  flex-shrink: 0;
}

.stepper-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  border: 2px solid var(--c-border);
  background: white;
  color: var(--c-text-muted);
  transition: all var(--t-base);
}

.stepper-circle svg, .stepper-circle [data-lucide] { width: 16px; height: 16px; }

.stepper-item.active .stepper-circle,
.stepper-item.current .stepper-circle {
  border-color: var(--c-primary);
  background: var(--c-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}

.stepper-item.current .stepper-circle {
  background: white;
  color: var(--c-primary);
}

.stepper-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-text-muted);
  white-space: nowrap;
  text-align: center;
}

.stepper-item.active .stepper-label,
.stepper-item.current .stepper-label {
  color: var(--c-primary);
}

.stepper-line {
  flex: 1;
  height: 2px;
  background: var(--c-border);
  margin-top: -18px;
  transition: background var(--t-base);
}

.stepper-line.done {
  background: var(--c-primary);
}

/* ──────────────────────────────────────────
   SKELETON / LOADING
   ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--c-bg) 25%,
    var(--c-border) 50%,
    var(--c-bg) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--r-md);
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  border-radius: var(--r-sm);
}

.skeleton-title {
  height: 22px;
  border-radius: var(--r-sm);
}

.skeleton-avatar {
  border-radius: 50%;
}

/* ──────────────────────────────────────────
   EMPTY STATE
   ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s16) var(--s8);
  gap: var(--s4);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--c-bg-alt);
  border-radius: var(--r-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s2);
}

.empty-state-icon svg, .empty-state-icon [data-lucide] {
  width: 36px;
  height: 36px;
  color: var(--c-text-muted);
}

.empty-state-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  max-width: 360px;
  line-height: 1.7;
}

/* ──────────────────────────────────────────
   DOCUMENT PREVIEW
   ────────────────────────────────────────── */
.doc-preview-wrapper {
  background: var(--c-bg-alt);
  border-radius: var(--r-xl);
  padding: var(--s6);
  display: flex;
  justify-content: center;
  min-height: 600px;
  overflow-y: auto;
}

.doc-preview {
  background: white;
  width: 100%;
  max-width: 680px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.doc-preview-header {
  padding: var(--s8) var(--s10);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s6);
}

.doc-preview-logo {
  width: 72px;
  height: 72px;
  border-radius: var(--r-lg);
  background: var(--c-primary-bg);
  border: 2px solid var(--c-primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--c-primary);
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.doc-preview-company-name {
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--c-text);
}

.doc-preview-company-info {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  line-height: 1.6;
}

.doc-preview-doc-info {
  text-align: right;
}

.doc-preview-doc-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.doc-preview-doc-num {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-top: var(--s1);
}

.doc-preview-banner {
  height: 6px;
}

.doc-preview-section {
  padding: var(--s6) var(--s10);
}

.doc-preview-section + .doc-preview-section {
  border-top: 1px solid var(--c-border);
}

.doc-preview-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--s3);
}

.doc-items-table {
  width: 100%;
  border-collapse: collapse;
}

.doc-items-table th {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-text-muted);
  text-align: left;
  padding: var(--s2) var(--s3);
  background: var(--c-bg);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.doc-items-table td {
  padding: var(--s3);
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  border-bottom: 1px solid var(--c-border);
  white-space: normal;
}

.doc-items-table tr:last-child td { border-bottom: none; }

.doc-total-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--s2);
  padding: var(--s4) var(--s10);
  background: var(--c-bg);
}

.doc-total-row {
  display: flex;
  gap: var(--s6);
  font-size: var(--text-sm);
  align-items: center;
}

.doc-total-label {
  color: var(--c-text-muted);
  font-weight: 500;
  min-width: 100px;
  text-align: right;
}

.doc-total-value {
  font-weight: 700;
  color: var(--c-text);
  min-width: 100px;
  text-align: right;
}

.doc-total-row.grand-total .doc-total-label,
.doc-total-row.grand-total .doc-total-value {
  font-size: var(--text-xl);
  color: var(--c-primary);
  font-weight: 800;
}

.doc-accept-btn {
  display: flex;
  justify-content: center;
  padding: var(--s6) var(--s10);
}

.doc-sign-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s8);
  padding: var(--s6) var(--s10);
}

.doc-sign-box {
  border-top: 2px solid var(--c-text);
  padding-top: var(--s3);
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  text-align: center;
}

/* ──────────────────────────────────────────
   STATS / FUNNEL
   ────────────────────────────────────────── */
.funnel-cards {
  display: flex;
  gap: var(--s3);
  overflow-x: auto;
  padding-bottom: var(--s2);
}

.funnel-card {
  flex-shrink: 0;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  min-width: 120px;
  cursor: pointer;
  transition: all var(--t-fast);
}

.funnel-card:hover {
  border-color: var(--c-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.funnel-card-count {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.04em;
}

.funnel-card-label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  font-weight: 600;
  margin-top: var(--s1);
}

/* ──────────────────────────────────────────
   QUICK ACTION CARDS
   ────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--s4);
}

.quick-action-card {
  background: white;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--s5);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.quick-action-card:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-icon svg, .quick-action-icon [data-lucide] {
  width: 22px;
  height: 22px;
}

.quick-action-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
}

[data-theme="dark"] .quick-action-card {
  background: #111c2f;
  border-color: #273449;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .quick-action-card:hover {
  background: #0f1a2d;
  border-color: #2f5e75;
}

/* ──────────────────────────────────────────
   ACTIVITY FEED
   ────────────────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--c-border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon svg, .activity-icon [data-lucide] {
  width: 16px;
  height: 16px;
}

.activity-info {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  line-height: 1.5;
}

.activity-text strong {
  color: var(--c-text);
  font-weight: 600;
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* ──────────────────────────────────────────
   UPLOAD AREA
   ────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--s10) var(--s8);
  text-align: center;
  cursor: pointer;
  transition: all var(--t-fast);
  background: var(--c-bg);
}

.upload-area:hover,
.upload-area.dragging {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
}

.upload-icon {
  width: 52px;
  height: 52px;
  background: var(--c-bg-alt);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--s4);
}

.upload-icon svg, .upload-icon [data-lucide] {
  width: 24px;
  height: 24px;
  color: var(--c-text-muted);
}

.upload-title {
  font-weight: 700;
  color: var(--c-text);
  font-size: var(--text-base);
}

.upload-hint {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  margin-top: var(--s2);
}

/* ──────────────────────────────────────────
   IMAGE GALLERY
   ────────────────────────────────────────── */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s3);
}

.image-gallery-item {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  position: relative;
  aspect-ratio: 4/3;
}

.image-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-gallery-item-remove {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  width: 24px;
  height: 24px;
  background: rgba(239,68,68,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast);
}

.image-gallery-item:hover .image-gallery-item-remove {
  opacity: 1;
}

/* ──────────────────────────────────────────
   PROGRESS BAR
   ────────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--c-bg-alt);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: var(--r-full);
  transition: width var(--t-slow);
}

.progress-bar-fill.accent { background: var(--c-accent); }
.progress-bar-fill.warning { background: var(--c-warning); }
.progress-bar-fill.success { background: var(--c-success); }

/* ──────────────────────────────────────────
   PRICE SUMMARY BOX
   ────────────────────────────────────────── */
.price-summary {
  background: var(--c-bg);
  border-radius: var(--r-lg);
  padding: var(--s5) var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  border: 1px solid var(--c-border);
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}

.price-row .label {
  color: var(--c-text-secondary);
  font-weight: 500;
}

.price-row .value {
  font-weight: 600;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.price-row .value.discount {
  color: var(--c-success);
}

.price-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s3);
  border-top: 2px solid var(--c-border);
}

.price-total-row .label {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-text);
}

.price-total-row .value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: -0.04em;
}

/* ──────────────────────────────────────────
   CANVAS SIGNATURE
   ────────────────────────────────────────── */
.signature-canvas-wrapper {
  border: 2px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  background: white;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  touch-action: none;
  cursor: crosshair;
  display: block;
}

.signature-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  font-size: var(--text-sm);
  pointer-events: none;
  transition: opacity var(--t-fast);
}

/* ──────────────────────────────────────────
   ITEM LINE (orçamento)
   ────────────────────────────────────────── */
.item-line {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s5);
  transition: border-color var(--t-fast);
}

.item-line:hover {
  border-color: var(--c-border-strong);
}

.item-line-header {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.item-line-drag {
  color: var(--c-text-muted);
  cursor: grab;
  flex-shrink: 0;
}

.item-line-name {
  flex: 1;
  font-weight: 600;
  color: var(--c-text);
  font-size: var(--text-sm);
}

.item-line-remove {
  color: var(--c-text-muted);
  cursor: pointer;
  transition: color var(--t-fast);
  flex-shrink: 0;
}

.item-line-remove:hover { color: var(--c-danger); }

.item-line-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--s3);
  align-items: end;
}

.item-line-total {
  font-weight: 700;
  color: var(--c-text);
  font-size: var(--text-base);
  padding: var(--s2) 0;
}

/* ──────────────────────────────────────────
   PLAN CARDS
   ────────────────────────────────────────── */
.plan-card {
  background: white;
  border: 2px solid var(--c-border);
  border-radius: var(--r-2xl);
  padding: var(--s8);
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  position: relative;
  transition: all var(--t-base);
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.plan-card.featured {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-primary);
}

.plan-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-primary);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--s1) var(--s4);
  border-radius: var(--r-full);
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.plan-name {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: var(--s1);
}

.plan-price-value {
  font-size: var(--text-4xl);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--c-text);
}

.plan-price-period {
  font-size: var(--text-sm);
  color: var(--c-text-muted);
  font-weight: 500;
}

.plan-features {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  flex: 1;
}

.plan-feature {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
}

.plan-feature svg, .plan-feature [data-lucide] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--c-success);
}

.plan-feature.disabled {
  color: var(--c-text-muted);
}

.plan-feature.disabled svg, .plan-feature.disabled [data-lucide] {
  color: var(--c-border-strong);
}

/* ────────────────────────────────────────────────────────────
   ALIASES E CLASSES FALTANDO — Compatibilidade HTML gerado
   ──────────────────────────────────────────────────────────── */

/* sidebar-badge = alias de sidebar-item-badge */
.sidebar-badge {
  margin-left: auto;
  background: var(--c-primary);
  color: white;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--r-full);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* badge-warning (igual a badge-revision) */
.badge-warning { background: var(--c-warning-bg); color: #B45309; }

/* badge-pending */
.badge-pending { background: var(--c-warning-bg); color: #B45309; }

/* .input, .label, .select — aliases curtos para formulários */
.input {
  width: 100%;
  height: 42px;
  padding: 0 var(--s4);
  background: white;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: var(--text-sm);
  font-family: var(--font);
  transition: all var(--t-fast);
  appearance: none;
}

.input::placeholder { color: var(--c-text-muted); }

.input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-bg);
}

.input:disabled {
  background: var(--c-bg);
  color: var(--c-text-muted);
  cursor: not-allowed;
}

textarea.input {
  height: auto;
  min-height: 100px;
  padding: var(--s3) var(--s4);
  resize: vertical;
  line-height: 1.6;
}

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s3) center;
  padding-right: var(--s10);
  cursor: pointer;
}

.label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--s2);
}

/* text-danger utility */
.text-danger { color: var(--c-danger); }
.text-primary { color: var(--c-primary); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-muted   { color: var(--c-text-muted); }
.text-xs      { font-size: var(--text-xs); }
.text-sm      { font-size: var(--text-sm); }
.text-base    { font-size: var(--text-base); }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }
.w-full       { width: 100%; }
.flex-1       { flex: 1; }
.mt-6         { margin-top: var(--s6); }
.mb-6         { margin-bottom: var(--s6); }
.mt-2         { margin-top: var(--s2); }
.mt-3         { margin-top: var(--s3); }
.mt-4         { margin-top: var(--s4); }
.mb-2         { margin-bottom: var(--s2); }
.flex         { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-2        { gap: var(--s2); }
.gap-3        { gap: var(--s3); }
.text-center  { text-align: center; }
.cursor-pointer { cursor: pointer; }

.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
  flex-wrap: wrap;
}

.filters-bar .pill-tabs {
  flex: 1 1 auto;
}

.filters-bar .input {
  max-width: 360px;
  flex: 1 1 260px;
}

.pill-tabs {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 4px;
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow-x: auto;
}

.pill-tab {
  min-height: 32px;
  padding: 0 var(--s3);
  border-radius: var(--r-md);
  color: var(--c-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--t-fast);
}

.pill-tab:hover {
  background: var(--c-bg);
  color: var(--c-text);
}

.pill-tab.active {
  background: var(--c-primary);
  color: white;
  box-shadow: var(--shadow-primary);
}

/* Dark mode: filter controls (desktop + mobile) */
[data-theme="dark"] .input {
  background: #111c2f;
  border-color: #273449;
  color: #e2e8f0;
}

[data-theme="dark"] .input::placeholder {
  color: #94a3b8;
}

[data-theme="dark"] .input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.22);
}

[data-theme="dark"] .pill-tabs {
  background: #111c2f;
  border-color: #273449;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.26);
}

[data-theme="dark"] .pill-tab {
  color: #cbd5e1;
}

[data-theme="dark"] .pill-tab:hover {
  background: #0f1a2d;
  color: #e2e8f0;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s4);
}

.radio-group {
  display: flex;
  gap: var(--s3);
  flex-wrap: wrap;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 38px;
  padding: 0 var(--s4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: white;
  cursor: pointer;
}

.radio-label {
  font-size: var(--text-sm);
  font-weight: 600;
}

.onboarding-stepper {
  width: min(100%, 760px);
  margin: 0 auto var(--s6);
}

.stepper-progress-track {
  height: 6px;
  background: rgba(15, 118, 110, .12);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: var(--s4);
}

.stepper-progress-fill {
  height: 100%;
  background: var(--c-primary);
  border-radius: inherit;
}

.stepper-items {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s3);
}

.stepper-line {
  display: none;
}

.stepper-item {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  color: var(--c-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: center;
}

.stepper-item-circle {
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
}

.stepper-item.current .stepper-item-circle,
.stepper-item.completed .stepper-item-circle {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: white;
}

.onboarding-content {
  width: min(100%, 760px);
  margin: 0 auto;
}

.onboarding-card {
  padding: var(--s6);
}

.onboarding-card-header {
  padding: 0 0 var(--s5);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--c-border);
}

.onboarding-card-title {
  font-size: var(--text-2xl);
  font-weight: 850;
  letter-spacing: -.03em;
}

.onboarding-card-desc {
  color: var(--c-text-secondary);
  margin-top: var(--s2);
}

.onboarding-nav {
  width: min(100%, 760px);
  margin: var(--s5) auto 0;
  display: flex;
  justify-content: space-between;
  gap: var(--s3);
}

.segment-grid,
.color-picker-grid,
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s3);
}

.segment-btn,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 42px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: white;
  color: var(--c-text);
  font-weight: 650;
}

.segment-btn.active {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
  color: var(--c-primary);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: var(--s4);
  align-items: stretch;
}

/* quick-action card */
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 118px;
  padding: var(--s4);
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-base);
  text-decoration: none;
  text-align: center;
}

.quick-action-card:hover {
  border-color: var(--c-primary);
  background: var(--c-primary-bg);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-action-icon svg, .quick-action-icon [data-lucide] {
  width: 22px;
  height: 22px;
}

.quick-action-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.25;
}

.quick-action-desc {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  line-height: 1.4;
}

/* activity-item */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s4);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--c-border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon svg, .activity-icon [data-lucide] {
  width: 16px;
  height: 16px;
}

.activity-info { flex: 1; min-width: 0; }
.activity-text { font-size: var(--text-sm); color: var(--c-text); line-height: 1.5; }
.activity-time { font-size: var(--text-xs); color: var(--c-text-muted); margin-top: var(--s1); }

/* mobile-doc-card */
.mobile-doc-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.mobile-doc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
}

.mobile-doc-card-client {
  font-weight: 700;
  color: var(--c-text);
  font-size: var(--text-sm);
}

.mobile-doc-card-title {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  margin-top: 2px;
}

.mobile-doc-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-doc-card-value {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.mobile-doc-card-meta {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}

.mobile-doc-card-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

/* metrics-grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s5);
}

@media (min-width: 1400px) {
  .metrics-grid { grid-template-columns: repeat(6, 1fr); }
}

/* doc-a4 base styles */
.doc-a4 {
  background: white;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.doc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s8);
  padding: var(--s8);
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-hover) 100%);
  color: white;
}

.doc-company-logo {
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--text-xl);
  color: white;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

.doc-company-name {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: white;
}

.doc-company-info {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.75);
  margin-top: 2px;
}

.doc-company { display: flex; align-items: flex-start; gap: var(--s4); }

.doc-meta { text-align: right; flex-shrink: 0; }
.doc-type { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.7); }
.doc-number { font-size: var(--text-2xl); font-weight: 900; letter-spacing: -0.04em; color: white; }
.doc-date { color: rgba(255,255,255,0.7); margin-top: 2px; }

.doc-client-section {
  padding: var(--s6) var(--s8);
  background: var(--c-primary-bg);
  border-bottom: 1px solid var(--c-primary-border);
}

.doc-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: var(--s3);
}

.doc-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s6) 0;
}

.doc-items-table th {
  padding: var(--s3) var(--s4);
  background: var(--c-bg);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}

.doc-items-table td {
  padding: var(--s4);
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}

.doc-items-table tr:last-child td { border-bottom: none; }

.doc-totals {
  padding: var(--s6) var(--s8);
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
}

.doc-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s2) 0;
  font-size: var(--text-sm);
  color: var(--c-text-secondary);
}

.doc-total-final {
  padding-top: var(--s4);
  border-top: 2px solid var(--c-border);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.02em;
  margin-top: var(--s3);
}

.doc-total-final span:last-child { color: var(--c-primary); }

.doc-conditions {
  padding: var(--s5) var(--s8);
  border-top: 1px solid var(--c-border);
}

.doc-footer-block {
  padding: var(--s5) var(--s8);
  background: var(--c-primary-bg);
  border-top: 2px solid var(--c-primary-border);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--c-text-muted);
}

/* editor section (orcamento-novo) */
.editor-section {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--s4);
  overflow: hidden;
  transition: box-shadow var(--t-base);
}

.editor-section:hover { box-shadow: var(--shadow-sm); }

.editor-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s5) var(--s6);
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast);
}

.editor-section-header:hover { background: var(--c-bg); }

.editor-section-title {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-text);
}

.editor-section-title [data-lucide], .editor-section-title svg {
  width: 18px; height: 18px; color: var(--c-primary); flex-shrink: 0;
}

.accordion-icon {
  width: 18px; height: 18px; color: var(--c-text-muted);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}

.editor-section.collapsed .accordion-icon {
  transform: rotate(-90deg);
}

.editor-section-body {
  padding: 0 var(--s6) var(--s6);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.editor-section.collapsed .editor-section-body {
  display: none;
}

/* editor layout */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--s6);
  align-items: start;
}

.editor-form-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: var(--s20);
}

.editor-preview-sticky {
  position: sticky;
  top: calc(var(--topbar-height) + var(--s4));
  max-height: calc(100vh - var(--topbar-height) - var(--s8));
  overflow-y: auto;
}

/* editor bottom bar */
.editor-bottom-bar {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  background: white;
  border-top: 1px solid var(--c-border);
  padding: var(--s4) var(--s6);
  display: flex;
  align-items: center;
  gap: var(--s4);
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}

.editor-totals {
  display: flex;
  align-items: center;
  gap: var(--s6);
  flex: 1;
}

.editor-total-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.editor-total-label {
  font-size: var(--text-xs);
  color: var(--c-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.editor-total-value {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.editor-total-value.primary { color: var(--c-primary); }

@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .editor-bottom-bar {
    left: 0;
  }
}

/* ── Action Sheet (Bottom Drawer — Mobile) ────────────────── */
.action-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 500;
  animation: as-fade-in 0.2s ease;
}
.action-sheet-backdrop.open {
  display: block;
}
@keyframes as-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.action-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 24px 24px 0 0;
  z-index: 501;
  padding-bottom: max(env(safe-area-inset-bottom), 12px);
  max-height: 82vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
}
.action-sheet.open {
  transform: translateY(0);
}

[data-theme="dark"] .action-sheet {
  background: #1E293B;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
}

.action-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  margin: 12px auto 8px;
  flex-shrink: 0;
}

.action-sheet-title {
  padding: 4px 1.25rem 0.75rem;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--c-border);
}

.action-sheet-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--c-text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
  min-height: 52px;
}
.action-sheet-item:hover,
.action-sheet-item:active {
  background: var(--c-bg);
}
.action-sheet-item svg,
.action-sheet-item [data-lucide] {
  width: 20px;
  height: 20px;
  color: var(--c-text-muted);
  flex-shrink: 0;
}
.action-sheet-item.danger { color: var(--c-danger); }
.action-sheet-item.danger svg,
.action-sheet-item.danger [data-lucide] { color: var(--c-danger); }

.action-sheet-sep {
  height: 1px;
  background: var(--c-border);
  margin: 4px 0;
}

/* ── Mobile Card Actions Button ─────────────────────────────
   Hidden on desktop, shown on mobile via responsive.css      */
.mobile-card-actions-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: none;
  border: none;
  color: var(--c-text-muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.mobile-card-actions-btn:hover {
  background: var(--c-bg-alt);
  color: var(--c-text);
}
.mobile-card-actions-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* ── Doc Sticky Actions Bar (Detail Pages — Mobile) ─────────
   Hidden on desktop, shown on mobile via responsive.css      */
.doc-sticky-actions {
  display: none;
}
.doc-sticky-actions .btn {
  gap: var(--s2);
}
