:root {
  --color-canvas: #ffffff;
  --color-surface: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-sidebar: #f3f6fa;
  --color-ink: #142a43;
  --color-ink-soft: #29435f;
  --color-text: #142a43;
  --color-muted: #607188;
  --color-line: #dce4ee;
  --color-accent: #4b9df8;
  --color-primary: #175fc1;
  --color-accent-dark: #155b9e;
  --color-accent-soft: #eaf3ff;
  --color-blue-soft: #eaf3ff;
  --color-success: #227447;
  --color-success-soft: #e8f5ed;
  --color-warning: #9a5d08;
  --color-warning-soft: #fff5df;
  --color-danger: #b42318;
  --color-danger-soft: #fdefed;
  --color-teal: #176b73;
  --color-teal-soft: #e6f5f6;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --sidebar-width: 216px;
  color: var(--color-text);
  background: var(--color-canvas);
  font-family: -apple-system, BlinkMacSystemFont;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--color-text);
  background: var(--color-canvas);
  font-size: 14px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--color-primary);
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 120ms ease;
}
.skip-link:focus { transform: translateY(0); }

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 12px 16px;
  border-right: 1px solid var(--color-line);
  background: var(--color-sidebar);
}

.brand {
  display: flex;
  align-items: center;
  min-height: 52px;
  gap: 10px;
  margin: 0 8px 22px;
  color: var(--color-ink);
  text-decoration: none;
}
.brand-type {
  color: #25343f;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.08em;
  line-height: 1;
}
.brand-type span { color: var(--color-accent); }
.brand-copy { display: grid; gap: 1px; min-width: 0; }
.brand-copy strong { color: var(--color-ink); font-size: 13px; line-height: 1.1; }
.brand-copy small { color: var(--color-muted); font-size: 12px; line-height: 1.25; white-space: nowrap; }

.main-nav { display: grid; gap: 2px; }
.nav-group-label {
  margin: 16px 10px 5px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}
.nav-group-label:first-child { margin-top: 0; }
.main-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-ink-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: color 120ms ease, background 120ms ease;
}
.nav-icon { flex: 0 0 18px; width: 18px; height: 18px; color: #71808d; }
.main-nav a:hover { color: var(--color-accent-dark); background: var(--color-accent-soft); }
.main-nav a[aria-current="page"] { color: var(--color-accent-dark); background: var(--color-accent-soft); }
.main-nav a[aria-current="page"] .nav-icon { color: var(--color-primary); }

.environment-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: auto 8px 0;
  padding: 12px 10px;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
}
.environment-card .signal {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--color-accent);
}
.environment-card strong, .environment-card small { display: block; }
.environment-card strong { color: var(--color-ink-soft); font-size: 12px; line-height: 1.35; }
.environment-card small { margin-top: 2px; font-size: 12px; line-height: 1.35; }

main { min-width: 0; }
.topbar, .view { width: min(100%, 1480px); margin-inline: auto; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  gap: 20px;
  padding: 22px clamp(24px, 3vw, 36px) 14px;
}
.eyebrow {
  margin: 0 0 2px;
  color: var(--color-accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: var(--color-ink); font-size: clamp(24px, 2.3vw, 28px); letter-spacing: -0.035em; line-height: 1.15; }
h2 { margin: 0; color: var(--color-ink); font-size: clamp(20px, 1.9vw, 24px); letter-spacing: -0.025em; line-height: 1.22; }
h3 { margin: 0; color: var(--color-ink); font-size: 15px; line-height: 1.35; }

.topbar-actions, .identity-actions, .cluster, .form-actions, .list-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.topbar-actions { justify-content: flex-end; }
.identity-actions { justify-content: flex-end; }
.identity-actions .button { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-status { color: var(--color-muted); font-size: 13px; }
.api-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: var(--color-muted);
  background: var(--color-surface);
  font-size: 12px;
  white-space: nowrap;
}
.api-indicator span { width: 7px; height: 7px; border-radius: 50%; background: var(--color-warning); }
.api-indicator[data-state="online"] span { background: var(--color-success); }
.api-indicator[data-state="offline"] span { background: var(--color-danger); }

.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.button { gap: 8px; padding: 10px 14px; color: #fff; background: var(--color-primary); }
.button:hover { background: var(--color-accent-dark); }
.button.accent { background: var(--color-primary); }
.button.secondary, .icon-button { border-color: var(--color-line); color: var(--color-ink-soft); background: var(--color-surface); }
.button.secondary:hover, .icon-button:hover { border-color: #b7c7d6; color: var(--color-primary); background: var(--color-surface-soft); }
.button.ghost { color: var(--color-accent-dark); background: transparent; }
.button.ghost:hover { background: var(--color-accent-soft); }
.button.danger { color: var(--color-danger); background: var(--color-danger-soft); }
.button.danger:hover { color: #8f1e15; background: #fbdeda; }
.button.small { min-height: 36px; padding: 7px 10px; font-size: 13px; }
.button:disabled, .icon-button:disabled { cursor: not-allowed; opacity: 0.55; }
.icon-button { flex: 0 0 44px; width: 44px; padding: 0; }
.icon-button svg { width: 19px; height: 19px; }

.view { padding: 8px clamp(24px, 3vw, 36px) 56px; }
.stack { display: grid; gap: 20px; }
.stack.tight { gap: 12px; }
.cluster { justify-content: flex-start; }
.spread { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.muted { color: var(--color-muted); }
.small-text { font-size: 12px; }
.page-intro, .home-heading { display: grid; gap: 4px; padding: 2px 0; }
.page-intro p, .home-heading p { max-width: 780px; margin: 0; color: var(--color-muted); }
.home-heading h2 { font-size: 24px; }
.local-environment-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 0;
  border-block: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 12px;
}
.local-environment-note strong { color: var(--color-ink-soft); }

.panel, .card, .editor-surface, .form-section, .settings-section, .collection-view {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.panel, .editor-surface, .form-section, .settings-section { padding: clamp(16px, 2vw, 24px); }
.panel-header, .section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-line);
}
.panel-header p, .section-heading p { margin: 5px 0 0; color: var(--color-muted); font-size: 13px; line-height: 1.45; }
.card { padding: 16px; }
.card p { margin: 5px 0 0; }
.card .card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; color: var(--color-muted); font-size: 12px; }

.today-overview, .journey-grid, .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.today-overview > *, .journey-grid > *, .card-grid > * { min-width: 0; }
.metrics-strip, .finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.metrics-strip > *, .finance-metric {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--color-line);
}
.metrics-strip > *:last-child, .finance-metric:last-child { border-right: 0; }
.metrics-strip span, .metrics-strip small, .finance-metric > span, .finance-metric > small { display: block; color: var(--color-muted); font-size: 12px; line-height: 1.35; }
.metrics-strip strong, .finance-metric > strong { display: block; margin-top: 7px; color: var(--color-ink); font-size: clamp(18px, 1.8vw, 23px); font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.metrics-strip small, .finance-metric > small { margin-top: 5px; }
.finance-metric.warning { background: var(--color-warning-soft); }
.finance-metric.danger { background: var(--color-danger-soft); }

.quick-actions { display: flex; flex-wrap: wrap; gap: 0; border-block: 1px solid var(--color-line); }
.quick-action {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 10px 14px;
  border-right: 1px solid var(--color-line);
  color: var(--color-accent-dark);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.quick-action:hover { background: var(--color-accent-soft); }
.quick-action:last-child { border-right: 0; }
.journey-card {
  display: grid;
  align-content: start;
  min-height: 144px;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: var(--color-surface);
  text-decoration: none;
}
.journey-card:hover { border-color: #b7d7fa; background: #fbfdff; }
.journey-card .journey-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: var(--radius-sm); color: var(--color-accent-dark); background: var(--color-accent-soft); font-size: 14px; font-weight: 800; }
.journey-card h3 { margin-top: 8px; }
.journey-card p { margin: 0; color: var(--color-muted); font-size: 13px; }
.journey-card strong { margin-top: auto; color: var(--color-accent-dark); font-size: 12px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.toolbar .grow { flex: 1 1 240px; }
.toolbar .field { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-10 { grid-column: span 10; }
.span-11 { grid-column: span 11; }
.span-12 { grid-column: span 12; }
.field { display: grid; min-width: 0; gap: 6px; margin: 0; }
.field > label, .field > span { color: var(--color-ink-soft); font-size: 13px; font-weight: 700; line-height: 1.35; }
.field small { color: var(--color-muted); font-size: 12px; line-height: 1.4; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid #cbd6e0;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.35;
}
select { cursor: pointer; }
textarea { min-height: 96px; resize: vertical; }
input[type="date"], input[type="datetime-local"], input[type="time"] { min-width: 10.5rem; max-width: 100%; }
input[type="color"] { flex: 0 0 48px; width: 48px; min-width: 48px; height: 44px; padding: 3px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--color-primary);
}
input:hover, select:hover, textarea:hover { border-color: #9db4c8; }
input:focus, select:focus, textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(75, 157, 248, 0.25); outline: 0; }
input:read-only, textarea:read-only { color: var(--color-muted); background: var(--color-surface-soft); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--color-danger); }
.required::after { content: " *"; color: var(--color-danger); }
.checkbox, .option-list label {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  padding: 0;
  color: var(--color-ink-soft);
  font-size: 14px;
}
.checkbox input, .option-list input { width: 18px; }
.form-actions { justify-content: flex-end; padding-top: 4px; }
.inline-form { display: grid; grid-template-columns: minmax(150px, 1fr) auto; gap: 8px; }
.subform { padding: 16px; border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: var(--color-surface-soft); }
.subform legend { padding: 0 5px; color: var(--color-ink-soft); font-size: 13px; font-weight: 700; }

.creation-disclosure, .column-picker {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}
.creation-disclosure > summary, .column-picker > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.creation-disclosure[open] > summary, .column-picker[open] > summary { border-bottom: 1px solid var(--color-line); color: var(--color-ink); }
.creation-disclosure > :not(summary), .column-picker > :not(summary) { margin: 16px; }
.column-picker > p { color: var(--color-muted); font-size: 12px; }
.option-list { display: grid; gap: 0; border-top: 1px solid var(--color-line); }
.option-list label { padding: 8px 0; border-bottom: 1px solid var(--color-line); }
.option-list label:last-child { border-bottom: 0; }

.list, .data-list, .finance-installment-list, .finance-installment-cards {
  display: grid;
  gap: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.list-row, .finance-installment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 16px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--color-line);
  background: transparent;
}
.list-row:last-child, .finance-installment-row:last-child { border-bottom: 0; }
.list-row h3 { font-size: 15px; }
.list-row p { margin: 3px 0 0; color: var(--color-muted); font-size: 13px; }
.list-row-actions { justify-content: flex-end; }
.compact-list .list-row, .compact-row { padding-block: 10px; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border: 1px solid var(--color-line); border-radius: var(--radius-sm); overflow: hidden; }
.detail-grid > div { min-width: 0; padding: 12px; border-right: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); background: var(--color-surface); }
.detail-grid > div:nth-child(2n) { border-right: 0; }
.detail-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
.detail-grid dt { color: var(--color-muted); font-size: 12px; font-weight: 700; }
.detail-grid dd { margin: 4px 0 0; color: var(--color-text); font-size: 14px; line-height: 1.45; white-space: pre-wrap; }

.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; color: var(--color-accent-dark); background: var(--color-blue-soft); font-size: 12px; font-weight: 700; line-height: 1.2; }
.badge.success { color: var(--color-success); background: var(--color-success-soft); }
.badge.warning { color: var(--color-warning); background: var(--color-warning-soft); }
.badge.danger { color: var(--color-danger); background: var(--color-danger-soft); }
.badge.neutral { color: var(--color-muted); background: #eff3f6; }

.empty-state, .loading-state, .error-state, .success-state, .sync-state {
  display: grid;
  min-height: 144px;
  place-items: center;
  padding: 24px;
  border: 1px dashed #bdcbd7;
  border-radius: var(--radius-md);
  color: var(--color-muted);
  background: var(--color-surface-soft);
  font-size: 14px;
  text-align: center;
}
.empty-state strong, .error-state strong { display: block; margin-bottom: 4px; color: var(--color-ink); }
.error-state { border-color: #e4b3ae; color: var(--color-danger); background: var(--color-danger-soft); }
.success-state { border-color: #b7dbc4; color: var(--color-success); background: var(--color-success-soft); }
.sync-state { border-color: #b4d9da; color: var(--color-teal); background: var(--color-teal-soft); }
.loading-state::before { content: ""; width: 22px; height: 22px; border: 3px solid #cfdae4; border-top-color: var(--color-primary); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-tabs, .finance-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-line);
  scrollbar-width: thin;
}
.section-tabs a, .finance-tabs a {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 12px 12px 9px;
  border-bottom: 3px solid transparent;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.section-tabs a:hover, .finance-tabs a:hover { color: var(--color-accent-dark); background: var(--color-surface-soft); }
.section-tabs a.current, .finance-tabs a.current { border-color: var(--color-primary); color: var(--color-primary); }
.stepper { display: flex; flex-wrap: wrap; gap: 0; padding: 0; border: 1px solid var(--color-line); border-radius: var(--radius-sm); list-style: none; overflow: hidden; }
.stepper li { flex: 1 1 120px; padding: 9px 10px; border-right: 1px solid var(--color-line); color: var(--color-muted); background: var(--color-surface); font-size: 12px; font-weight: 700; text-align: center; }
.stepper li:last-child { border-right: 0; }
.stepper li.current { color: var(--color-primary); background: var(--color-accent-soft); }

.finance-area { min-width: 0; }
.finance-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-line);
}
.finance-intro h2 { color: var(--color-ink); }
.finance-intro p:last-child { max-width: 720px; margin: 5px 0 0; color: var(--color-muted); line-height: 1.5; }
.finance-installment-row { grid-template-columns: auto minmax(150px, 1fr) minmax(150px, 1fr) auto; align-items: end; }
.finance-installment-row > strong { align-self: center; color: var(--color-ink); font-size: 13px; }

.report-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--color-line); border-radius: var(--radius-md); overflow: hidden; }
.report-columns > * { min-width: 0; padding: 14px; border-right: 1px solid var(--color-line); }
.report-columns > *:last-child { border-right: 0; }
.report-table-wrap { overflow: auto; border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface); }
.report-table { width: 100%; min-width: 620px; border-collapse: collapse; color: var(--color-text); text-align: left; }
.report-table th, .report-table td { padding: 11px 13px; border-bottom: 1px solid var(--color-line); vertical-align: top; font-size: 13px; line-height: 1.4; white-space: pre-wrap; }
.report-table th { position: sticky; top: 0; z-index: 1; color: var(--color-ink-soft); background: var(--color-surface-soft); font-size: 12px; font-weight: 700; }
.report-table tbody tr:last-child td { border-bottom: 0; }

.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; width: min(380px, calc(100vw - 32px)); gap: 8px; }
.toast { padding: 12px 14px; border-radius: var(--radius-sm); color: #fff; background: var(--color-ink); font-size: 13px; line-height: 1.4; }
.toast.error { background: var(--color-danger); }
.toast.success { background: var(--color-success); }

dialog, .auth-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  color: var(--color-text);
  background: var(--color-surface);
}
dialog::backdrop, .auth-dialog::backdrop { background: rgba(24, 37, 46, 0.34); }
.auth-dialog h2 { margin-bottom: 6px; }
.auth-dialog p { margin: 0; line-height: 1.5; }
.auth-view { width: min(100%, 440px); margin: max(32px, 8vh) auto 0; }
.auth-view .panel, .auth-panel { padding: 28px; }
.app-shell:has(.auth-view) { grid-template-columns: 1fr; }
.app-shell:has(.auth-view) .sidebar, .app-shell:has(.auth-view) .topbar { display: none; }
.app-shell:has(.auth-view) .view { display: grid; min-height: 100vh; align-content: start; padding-top: 1px; }

.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.hidden { display: none !important; }

@media (max-width: 1050px) {
  :root { --sidebar-width: 208px; }
  .today-overview, .journey-grid, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-strip, .finance-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics-strip > *:nth-child(3n), .finance-metric:nth-child(3n) { border-right: 0; }
  .metrics-strip > *:nth-child(-n + 3), .finance-metric:nth-child(-n + 3) { border-bottom: 1px solid var(--color-line); }
  .report-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-columns > *:nth-child(2n) { border-right: 0; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; z-index: 50; display: block; width: 100%; height: auto; padding: 10px 16px 8px; border-right: 0; border-bottom: 1px solid var(--color-line); }
  .brand { min-height: 40px; margin: 0 0 6px; }
  .brand-copy small { font-size: 11px; }
  .main-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: thin; }
  .nav-group-label { flex: 0 0 auto; margin: 0 4px 0 8px; font-size: 10px; }
  .main-nav a { flex: 0 0 auto; min-height: 40px; padding: 8px 10px; font-size: 13px; }
  .main-nav a:first-of-type { margin-left: 0; }
  .nav-icon { display: none; }
  .environment-card { display: none; }
  .topbar { align-items: flex-start; min-height: 0; padding: 18px 16px 10px; }
  .topbar-actions { align-items: flex-start; justify-content: flex-start; }
  .identity-actions { justify-content: flex-start; }
  .identity-actions .button { max-width: 260px; }
  .api-indicator { display: none; }
  .view { padding: 8px 16px 48px; }
  .today-overview, .journey-grid, .card-grid, .report-columns { grid-template-columns: 1fr; }
  .metrics-strip, .finance-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-strip > *, .finance-metric { border-right: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
  .metrics-strip > *:nth-child(2n), .finance-metric:nth-child(2n) { border-right: 0; }
  .metrics-strip > *:last-child, .finance-metric:last-child { border-bottom: 0; }
  .metrics-strip > *:nth-child(-n + 3), .finance-metric:nth-child(-n + 3) { border-bottom: 1px solid var(--color-line); }
  .quick-actions { display: grid; grid-template-columns: 1fr; }
  .quick-action { border-right: 0; border-bottom: 1px solid var(--color-line); }
  .quick-action:last-child { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .span-1, .span-2, .span-3, .span-4, .span-5, .span-6, .span-7, .span-8, .span-9, .span-10, .span-11, .span-12 { grid-column: auto; }
  .list-row, .finance-installment-row { grid-template-columns: 1fr; align-items: stretch; }
  .list-row-actions { justify-content: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div, .detail-grid > div:nth-child(2n) { border-right: 0; border-bottom: 1px solid var(--color-line); }
  .detail-grid > div:last-child { border-bottom: 0; }
  .panel-header, .section-heading, .spread, .finance-intro { flex-direction: column; align-items: stretch; }
  .panel-header .button { width: 100%; }
  .finance-installment-row > strong { align-self: auto; }
  .report-columns > * { border-right: 0; border-bottom: 1px solid var(--color-line); }
  .report-columns > *:last-child { border-bottom: 0; }
  .toast-region { right: 16px; bottom: 16px; }
  .auth-view { margin-top: 32px; }
}

@media (max-width: 420px) {
  .topbar { flex-direction: column; gap: 12px; }
  .topbar-actions { width: 100%; }
  .inline-form { grid-template-columns: 1fr; }
  .form-actions .button { width: 100%; }
}

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

/* UI-R2: workspace visual system */
:root {
  --color-canvas: #ffffff;
  --color-surface: #ffffff;
  --color-surface-soft: #f4f7fb;
  --color-sidebar: #f3f6fa;
  --color-ink: #142a43;
  --color-ink-soft: #29435f;
  --color-text: #142a43;
  --color-muted: #607188;
  --color-line: #dce4ee;
  --color-primary: #175fc1;
  --color-accent-dark: #175fc1;
  --color-accent-soft: #e5effc;
  --color-blue-soft: #e5effc;
  --radius-sm: 5px;
  --radius-md: 5px;
  --radius-lg: 5px;
  --sidebar-width: 216px;
  font-family: -apple-system, BlinkMacSystemFont;
}

body { background: #ffffff; font-size: 14px; }
.sidebar { padding: 20px 10px 14px; background: #f3f6fa; }
.brand { min-height: 44px; gap: 7px; margin: 0 8px 20px; }
.brand-angle { flex: 0 0 14px; width: 14px; height: 14px; color: var(--color-primary); }
.brand-type { color: var(--color-ink); font-size: 19px; font-weight: 800; letter-spacing: -0.075em; }
.brand-type span { color: #4b9df8; }
.brand-copy { gap: 0; }
.brand-copy small { color: var(--color-muted); font-size: 10px; font-weight: 700; letter-spacing: 0.045em; text-transform: uppercase; }
.main-nav { gap: 1px; }
.main-nav a { min-height: 38px; padding: 8px 10px 8px 8px; border-left: 2px solid transparent; border-radius: 0; color: var(--color-ink-soft); }
.main-nav a:hover { color: var(--color-primary); background: #eaf2fc; }
.main-nav a[aria-current="page"] { border-left-color: var(--color-primary); color: var(--color-primary); background: #e5effc; }
.nav-icon { flex-basis: 18px; width: 18px; height: 18px; }
.nav-group-label { margin: 14px 10px 4px; }
.environment-card { margin-inline: 8px; padding: 9px 2px 0; font-size: 11px; }
.environment-card strong, .environment-card small { font-size: 11px; }

.topbar, .view { width: min(100%, 1440px); }
.topbar { min-height: 88px; gap: 16px; padding: 16px 32px 12px; }
.view { padding: 8px 32px 48px; }
h1 { font-size: clamp(30px, 2.35vw, 32px); font-weight: 650; letter-spacing: -0.035em; }
h2 { font-size: clamp(18px, 1.55vw, 20px); font-weight: 600; letter-spacing: -0.022em; }
h3 { font-size: 14px; font-weight: 650; }
.page-intro, .home-heading { gap: 5px; padding: 0; }
.page-intro p, .home-heading p { margin: 0; }
.panel-header h2::before, .section-heading h2::before, .home-section-heading h2::before, .home-resource-header h2::before {
  display: block; width: 28px; height: 2px; margin: 0 0 8px; background: var(--color-primary); content: "";
}

.identity-actions { flex-wrap: nowrap; min-width: 0; }
.identity-actions .button { max-width: none; white-space: normal; }
.identity-actions .button:has(.identity-context) { justify-content: flex-start; width: min(260px, 34vw); min-width: 0; padding-block: 7px; }
.identity-context { display: grid; min-width: 0; text-align: left; line-height: 1.2; }
.identity-context strong, .identity-context span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-context strong { color: var(--color-ink); font-size: 13px; font-weight: 750; }
.identity-context span { margin-top: 2px; color: var(--color-muted); font-size: 11px; }

.panel, .editor-surface, .form-section, .settings-section, .collection-view {
  padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.panel { gap: 16px; }
.panel-header, .section-heading { padding: 0 0 12px; border-bottom-color: var(--color-line); }
.card { padding: 14px 0; border: 0; border-bottom: 1px solid var(--color-line); border-radius: 0; background: transparent; }
.list, .data-list, .finance-installment-list, .finance-installment-cards { gap: 0; border: 0; border-radius: 0; background: transparent; }
.list-row, .finance-installment-row { padding: 13px 0; border: 0; border-bottom: 1px solid var(--color-line); background: transparent; }
.list-row:last-child, .finance-installment-row:last-child { border-bottom: 0; }
.empty-state { min-height: 68px; place-items: start; padding: 12px 0; border: 0; border-radius: 0; background: transparent; text-align: left; }
.loading-state, .success-state, .sync-state { min-height: 72px; padding: 12px 0; border: 0; border-radius: 0; background: transparent; text-align: left; }
.state-content { display: grid; justify-items: start; }
.state-action { display: flex; margin-top: 8px; }

.home-overview { display: grid; gap: 22px; }
.home-heading { padding-bottom: 2px; }
.home-date { color: var(--color-muted) !important; font-size: 12px; font-variant-numeric: tabular-nums; }
.home-heading .home-lede, .home-heading p:last-child { color: var(--color-ink-soft); font-size: 16px; font-weight: 600; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; border: 0; }
.quick-action { min-height: 44px; padding: 10px 14px; border: 1px solid var(--color-line); border-radius: 5px; color: var(--color-primary); background: #ffffff; }
.quick-action:last-child { border-right: 1px solid var(--color-line); }
.quick-action:hover { border-color: #a6c6ed; background: #f7fbff; }
.quick-action.primary { border-color: var(--color-primary); color: #ffffff; background: var(--color-primary); }
.quick-action.primary:hover { background: #104d9f; }
.home-dashboard { display: grid; gap: 28px; }
.home-finance { display: grid; gap: 12px; }
.home-section-heading, .home-resource-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--color-line); }
.home-resource-header p { margin: 4px 0 0; }
.metrics-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); border: 0; border-block: 1px solid var(--color-line); border-radius: 0; background: transparent; }
.metrics-strip > *, .finance-metric { padding: 14px 16px; border-right: 1px solid var(--color-line); }
.metrics-strip strong, .finance-metric > strong { margin-top: 6px; font-size: clamp(28px, 2vw, 32px); line-height: 1.1; white-space: nowrap; }
.finance-metric.warning, .finance-metric.danger { background: transparent; }
.finance-metric.warning > span::before, .finance-metric.danger > span::before { margin-right: 6px; font-size: 10px; content: "●"; }
.finance-metric.warning > span::before { color: var(--color-warning); }
.finance-metric.danger > span::before { color: var(--color-danger); }
.finance-metric.warning > strong { color: var(--color-warning); }
.finance-metric.danger > strong { color: var(--color-danger); }
.home-workspace { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); gap: 28px; }
.home-agenda, .home-pending { min-width: 0; }
.home-pending { display: grid; gap: 24px; }
.home-workspace .collection-view { display: grid; gap: 0; }

form.form-section, .editor-surface { width: min(100%, 1040px); }
.form-section, .editor-surface, .subform { padding: 0; border: 0; border-radius: 0; background: transparent; }
.form-grid { gap: 16px; }
.field { gap: 5px; }
.field > label, .field > span { color: var(--color-ink-soft); font-size: 12px; font-weight: 700; }
input, select, textarea { min-height: 44px; border-color: #bfcede; border-radius: 5px; background: #f4f7fb; }
input:focus, select:focus, textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(23, 95, 193, 0.24); }
input[type="date"], input[type="datetime-local"], input[type="time"] { min-width: 220px; }
input[name="quantity"], input[name="lineQuantity"] { min-width: 88px; }
input[inputmode="decimal"] { min-width: 136px; }
.checkbox, .option-list label { min-height: 44px; }
.form-actions { padding-top: 16px; border-top: 1px solid var(--color-line); }
.creation-disclosure, .column-picker { border: 0; border-top: 1px solid var(--color-line); border-radius: 0; background: transparent; }
.creation-disclosure > summary, .column-picker > summary { min-height: 44px; padding: 11px 0; color: var(--color-primary); }
.creation-disclosure > summary::before { margin-right: 6px; content: "＋"; }
.creation-disclosure > .creation-content, .column-picker > :not(summary) { margin: 0; padding: 16px 0 0; border-top: 1px solid var(--color-line); }
.creation-disclosure[open] .form-section > .section-heading, .creation-disclosure[open] .form-section > h2:first-child, .creation-disclosure[open] .form-section > h3:first-child { display: none; }
.detail-grid, .report-columns, .report-table-wrap { border-radius: 0; }
.section-tabs, .finance-tabs { gap: 10px; }

.auth-view { width: min(400px, calc(100vw - 32px)); margin: auto; }
.app-shell:has(.auth-view) .view { align-content: center; padding: 32px 16px; }
.auth-view .panel, .auth-panel { padding: 28px 0; border: 0; border-top: 2px solid var(--color-primary); border-radius: 0; background: #ffffff; }

@media (max-width: 1050px) {
  .metrics-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics-strip > *:nth-child(3n), .finance-metric:nth-child(3n) { border-right: 0; }
  .metrics-strip > *:nth-child(-n + 3), .finance-metric:nth-child(-n + 3) { border-bottom: 1px solid var(--color-line); }
}

@media (max-width: 760px) {
  .sidebar { position: static; z-index: auto; padding: 10px 16px 8px; }
  .brand { margin: 0 0 6px; }
  .main-nav { overflow-x: auto; }
  .nav-group-label { display: none; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 14px 16px 8px; }
  .topbar-actions { justify-content: space-between; }
  .view { padding: 8px 16px 40px; }
  .identity-actions .button:has(.identity-context) { width: min(260px, calc(100vw - 132px)); }
  .quick-actions { gap: 8px; }
  .quick-action { flex: 1 1 auto; }
  .home-workspace { grid-template-columns: 1fr; gap: 24px; }
  .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-strip > *, .finance-metric { padding: 12px; border-right: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
  .metrics-strip > *:nth-child(2n), .finance-metric:nth-child(2n) { border-right: 0; }
  .metrics-strip > *:last-child, .finance-metric:last-child { border-bottom: 0; }
  input[type="date"], input[type="datetime-local"], input[type="time"] { min-width: 0; }
  .form-section, .editor-surface, .subform { min-width: 0; }
}

@media (max-width: 420px) {
  .topbar-actions { align-items: flex-start; }
  .quick-action { flex-basis: 100%; }
  .home-section-heading, .home-resource-header { gap: 10px; }
}

/* UI-R2: superfície operacional contínua */
:root {
  --color-canvas: #ffffff;
  --color-surface: #ffffff;
  --color-surface-soft: #f4f7fb;
  --color-sidebar: #f3f6fa;
  --color-ink: #142a43;
  --color-ink-soft: #30465f;
  --color-text: #142a43;
  --color-muted: #607188;
  --color-line: #dce4ee;
  --color-primary: #175fc1;
  --color-accent: #4b9df8;
  --color-accent-dark: #175fc1;
  --color-accent-soft: #e5effc;
  --color-blue-soft: #e5effc;
  --radius-sm: 5px;
  --radius-md: 5px;
  --sidebar-width: 216px;
  font-family: -apple-system, BlinkMacSystemFont;
}

body {
  background: #ffffff;
  font-size: 14px;
}

.app-shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }

.sidebar {
  padding: 18px 10px 14px;
  background: #f3f6fa;
}

.brand {
  min-height: 46px;
  gap: 7px;
  margin: 0 8px 18px;
}

.brand-angle {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

.brand-type {
  color: var(--color-ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.075em;
}

.brand-type span { color: #4b9df8; }
.brand-copy { gap: 0; }
.brand-copy strong {
  color: var(--color-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.15;
}
.brand-copy small { color: var(--color-muted); font-size: 10px; line-height: 1.15; }

.main-nav { gap: 1px; }
.nav-group-label { margin: 15px 8px 4px; font-size: 10px; }
.main-nav a {
  min-height: 38px;
  padding: 8px 8px;
  border-left: 2px solid transparent;
  border-radius: 0;
  font-size: 13px;
  font-weight: 650;
}
.main-nav a:hover { color: var(--color-primary); background: transparent; }
.main-nav a[aria-current="page"] {
  border-left-color: var(--color-primary);
  color: var(--color-primary);
  background: #e5effc;
}
.nav-icon { flex-basis: 18px; width: 18px; height: 18px; }
.environment-card { margin: auto 8px 0; padding: 9px 2px 0; }
.environment-card strong, .environment-card small { font-size: 11px; }

.topbar, .view { width: min(100%, 1440px); }
.topbar {
  min-height: 88px;
  max-height: 88px;
  padding: 15px clamp(16px, 2.5vw, 32px) 12px;
}
.view { padding: 8px clamp(16px, 2.5vw, 32px) 48px; }
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase; }
h1 {
  font-size: clamp(30px, 2.25vw, 32px);
  font-weight: 650;
  letter-spacing: -0.035em;
}
h2 { font-size: clamp(18px, 1.45vw, 20px); font-weight: 600; }
h3 { font-size: 14px; }

.identity-actions { min-width: 0; flex-wrap: nowrap; }
.identity-actions .button {
  min-width: 0;
  max-width: 260px;
  padding-block: 6px;
  overflow: hidden;
  text-align: left;
  white-space: normal;
}
.identity-context { display: grid; min-width: 0; gap: 1px; text-align: left; }
.identity-context strong, .identity-context span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity-context strong { color: var(--color-ink); font-size: 13px; font-weight: 750; }
.identity-context span { color: var(--color-muted); font-size: 11px; font-weight: 500; }

.button, .icon-button { border-radius: 5px; font-weight: 700; }
.button { background: var(--color-primary); }
.button.secondary, .icon-button { border-color: var(--color-line); background: #ffffff; }
.button.ghost { color: var(--color-primary); }

.stack { gap: 22px; }
.page-intro, .home-heading { gap: 5px; padding: 0; }
.page-intro h2::before, .panel-header h2::before, .section-heading h2::before, .home-section-heading h2::before, .home-resource-header h2::before {
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 8px;
  background: #4b9df8;
  content: "";
}

.panel, .card, .editor-surface, .form-section, .settings-section, .collection-view {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.panel, .editor-surface, .form-section, .settings-section { padding: 0; }
.panel { gap: 16px; }
.panel-header, .section-heading {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--color-line);
}
.card { padding: 14px 0; border-bottom: 1px solid var(--color-line); }
.card:last-child { border-bottom: 0; }

.home-overview, .home-dashboard { display: grid; gap: 22px; }
.home-heading { padding-top: 2px; }
.home-heading p { margin: 0; color: var(--color-muted); }
.home-heading .home-date { color: var(--color-ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
}
.quick-action {
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--color-line);
  border-radius: 5px;
  color: var(--color-primary);
  background: #ffffff;
}
.quick-action:last-child { border-right: 1px solid var(--color-line); }
.quick-action.primary { border-color: var(--color-primary); color: #ffffff; background: var(--color-primary); }
.quick-action.primary:hover { background: #124e9f; }
.home-finance { display: grid; gap: 12px; }
.home-section-heading, .home-resource-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
}
.home-section-heading h2, .home-resource-header h2 { margin: 0; }
.home-resource-header p { margin: 4px 0 0; }
.metrics-strip, .finance-summary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 0;
  border-block: 1px solid var(--color-line);
  border-radius: 0;
  background: transparent;
}
.metrics-strip > *, .finance-metric {
  padding: 13px 14px;
  border-right: 1px solid var(--color-line);
  background: transparent !important;
}
.metrics-strip strong, .finance-metric > strong {
  margin-top: 6px;
  font-size: clamp(28px, 2.1vw, 32px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1.05;
  white-space: nowrap;
}
.finance-metric.warning > span::before, .finance-metric.danger > span::before {
  display: inline-block;
  margin-right: 5px;
  font-size: 9px;
  vertical-align: 1px;
  content: "●";
}
.finance-metric.warning > span::before { color: var(--color-warning); }
.finance-metric.danger > span::before { color: var(--color-danger); }
.finance-metric.warning > strong { color: var(--color-warning); }
.finance-metric.danger > strong { color: var(--color-danger); }
.home-workspace { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); gap: 28px; }
.home-agenda, .home-pending { min-width: 0; }
.home-pending { display: grid; gap: 22px; }
.collection-view { display: grid; gap: 0; }
.home-workspace .list { margin-top: 0; }

.list, .data-list, .finance-installment-list, .finance-installment-cards {
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.list-row, .finance-installment-row {
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid var(--color-line);
  background: transparent;
}
.list-row:last-child, .finance-installment-row:last-child { border-bottom: 0; }
.empty-state, .loading-state, .error-state, .success-state, .sync-state {
  min-height: 68px;
  place-items: start;
  padding: 13px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.error-state { color: var(--color-danger); }
.success-state { color: var(--color-success); }
.state-action { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.form-section, .editor-surface { width: min(100%, 1040px); }
.form-grid { gap: 14px; }
.field { gap: 5px; }
.field > label, .field > span { font-size: 12px; font-weight: 700; }
input, select, textarea {
  min-height: 44px;
  border-color: #bfcede;
  border-radius: 5px;
  background: #f4f7fb;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(23, 95, 193, 0.22);
}
input[type="date"], input[type="datetime-local"], input[type="time"] { min-width: 220px; }
input[name="quantity"], input[name="lineQuantity"] { min-width: 88px; }
input[inputmode="decimal"] { min-width: 136px; }
.subform {
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--color-line);
  border-radius: 0;
  background: transparent;
}
fieldset.subform, .subform fieldset { min-width: 0; }
.form-actions {
  padding: 16px 0 0;
  border-top: 1px solid var(--color-line);
}

.creation-disclosure, .column-picker {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.creation-disclosure > summary, .column-picker > summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--color-primary);
}
.creation-disclosure > summary::before { margin-right: 6px; content: "+"; }
.creation-disclosure[open] > summary, .column-picker[open] > summary { border-bottom: 1px solid var(--color-line); color: var(--color-ink); }
.creation-disclosure > .creation-content, .column-picker > :not(summary) {
  margin: 0;
  padding: 16px 0 0;
}
.creation-disclosure[open] .form-section > .section-heading,
.creation-disclosure[open] .form-section > h2:first-child,
.creation-disclosure[open] .form-section > h3:first-child { display: none; }

.detail-grid, .report-columns, .report-table-wrap {
  border-color: var(--color-line);
  border-radius: 0;
  background: transparent;
}
.section-tabs, .finance-tabs { gap: 0; }
.section-tabs a, .finance-tabs a { padding-inline: 12px; }

.auth-view { width: min(400px, calc(100vw - 32px)); margin: auto; }
.app-shell:has(.auth-view) .view { align-content: center; padding: 32px 16px; }
.auth-view .auth-panel {
  padding: 28px 0 0;
  border-top: 3px solid var(--color-primary);
  background: #ffffff;
}

@media (max-width: 1050px) {
  :root { --sidebar-width: 208px; }
  .metrics-strip, .finance-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics-strip > *:nth-child(3n), .finance-metric:nth-child(3n) { border-right: 0; }
  .metrics-strip > *:nth-child(-n + 3), .finance-metric:nth-child(-n + 3) { border-bottom: 1px solid var(--color-line); }
}

@media (max-width: 760px) {
  .sidebar { position: static; padding: 10px 16px 8px; }
  .brand { margin-bottom: 5px; }
  .main-nav { gap: 2px; overflow-x: auto; }
  .nav-group-label { display: none; }
  .main-nav a { flex: 0 0 auto; border-left: 0; border-bottom: 2px solid transparent; }
  .main-nav a[aria-current="page"] { border-left-color: transparent; border-bottom-color: var(--color-primary); }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    max-height: none;
    padding: 14px 16px 10px;
  }
  .topbar-actions { justify-content: space-between; }
  .identity-actions { max-width: calc(100vw - 110px); }
  .identity-actions .button { max-width: 260px; }
  .view { padding: 8px 16px 40px; }
  .home-workspace { grid-template-columns: 1fr; gap: 22px; }
  .home-pending { gap: 22px; }
  .metrics-strip, .finance-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics-strip > *, .finance-metric { border-right: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
  .metrics-strip > *:nth-child(2n), .finance-metric:nth-child(2n) { border-right: 0; }
  .metrics-strip > *:nth-child(-n + 3), .finance-metric:nth-child(-n + 3) { border-bottom: 1px solid var(--color-line); }
  .metrics-strip > *:last-child, .finance-metric:last-child { border-bottom: 0; }
  .quick-actions { gap: 8px; }
  .quick-action { flex: 1 1 auto; justify-content: center; }
  .home-section-heading, .home-resource-header { align-items: flex-start; }
  .form-section, .editor-surface { width: 100%; }
  input[type="date"], input[type="datetime-local"], input[type="time"] { min-width: 0; }
  .subform { padding-inline: 0; }
}

@media (max-width: 420px) {
  .topbar { display: grid; }
  .topbar-actions { width: 100%; }
  .identity-actions { max-width: calc(100vw - 96px); }
  .quick-action { flex-basis: 100%; }
}

/* UI-R2: superfície operacional contínua */
body { background: #ffffff; }

.topbar, .view { width: min(100%, 1440px); }
.sidebar { padding: 20px 10px 14px; background: #f3f6fa; }
.brand { min-height: 48px; gap: 7px; margin: 0 8px 20px; }
.brand-angle { flex: 0 0 17px; width: 17px; height: 17px; color: var(--color-primary); }
.brand-type { color: var(--color-ink); font-size: 20px; font-weight: 800; letter-spacing: -0.075em; }
.brand-copy { gap: 2px; padding-left: 3px; border-left: 1px solid #c6d4e3; }
.brand-copy strong { color: var(--color-ink-soft); font-size: 9px; font-weight: 800; letter-spacing: 0.09em; line-height: 1.1; }
.brand-copy small { color: var(--color-muted); font-size: 11px; }

.main-nav { gap: 1px; }
.nav-group-label { margin: 14px 10px 4px; font-size: 10px; letter-spacing: 0.07em; }
.main-nav a { min-height: 38px; padding: 8px 8px; border-left: 2px solid transparent; border-radius: 0; font-size: 13px; font-weight: 650; }
.main-nav a:hover { background: #eaf1f9; }
.main-nav a[aria-current="page"] { border-left-color: var(--color-primary); color: var(--color-primary); background: #e5effc; }
.environment-card { margin: auto 8px 0; padding: 10px 2px 0; }
.environment-card strong { font-size: 11px; }
.environment-card small { font-size: 11px; }

.topbar { min-height: 88px; gap: 18px; padding: 16px clamp(16px, 2.5vw, 32px) 12px; border-bottom: 1px solid var(--color-line); }
.view { padding: 24px clamp(16px, 2.5vw, 32px) 56px; }
.eyebrow { color: var(--color-primary); font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
h1 { font-size: clamp(30px, 2.25vw, 32px); font-weight: 650; letter-spacing: -0.035em; }
h2 { font-size: clamp(18px, 1.5vw, 20px); font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: 14px; font-weight: 650; }

.identity-actions { min-width: 0; }
.identity-actions .button { max-width: 260px; min-width: 0; align-items: flex-start; justify-content: flex-start; overflow: visible; text-align: left; white-space: normal; }
.identity-context { display: grid; min-width: 0; gap: 1px; }
.identity-context strong, .identity-context span { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }
.identity-context strong { color: var(--color-ink); font-size: 13px; font-weight: 750; }
.identity-context span { color: var(--color-muted); font-size: 11px; font-weight: 500; }
.identity-status { font-size: 12px; }
.api-indicator { border: 0; border-radius: 0; background: transparent; }

.button, .icon-button { border-radius: 4px; font-size: 13px; font-weight: 700; }
.button { background: var(--color-primary); }
.button.secondary, .icon-button { border-color: #bfcede; background: #ffffff; }
.button.ghost { color: var(--color-primary); }

.stack { gap: 24px; }
.stack.tight { gap: 12px; }
.page-intro { gap: 6px; padding: 0 0 14px; border-bottom: 1px solid var(--color-line); }
.page-intro p { font-size: 14px; }
.panel, .editor-surface, .form-section, .settings-section, .collection-view {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.panel, .editor-surface, .form-section, .settings-section { max-width: 1040px; }
.panel-header, .section-heading { gap: 12px; padding: 0 0 12px; border-bottom-color: var(--color-line); }
.panel-header h2, .section-heading h2, .home-section-heading h2, .home-resource-header h2 { display: grid; gap: 7px; }
.panel-header h2::before, .section-heading h2::before, .home-section-heading h2::before, .home-resource-header h2::before {
  width: 28px;
  height: 2px;
  background: var(--color-primary);
  content: "";
}
.panel-header p, .section-heading p { margin-top: 3px; }
.card { padding: 14px 0; border: 0; border-bottom: 1px solid var(--color-line); border-radius: 0; }

.list, .data-list, .finance-installment-list, .finance-installment-cards {
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.list-row, .finance-installment-row { padding: 13px 0; border-right: 0; border-left: 0; border-top: 0; border-radius: 0; }
.list-row:first-child, .finance-installment-row:first-child { border-top: 1px solid var(--color-line); }
.list-row p { margin-top: 2px; }
.list-row-actions { gap: 6px; }

.empty-state, .loading-state, .error-state, .success-state, .sync-state {
  justify-content: start;
  min-height: 72px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--color-line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.empty-state > div, .loading-state > div, .error-state > div, .success-state > div, .sync-state > div { max-width: 640px; }
.empty-state strong, .error-state strong { margin-bottom: 2px; }
.error-state { color: var(--color-danger); }
.success-state { color: var(--color-success); }
.sync-state { color: var(--color-teal); }
.state-action { display: flex; flex-wrap: wrap; justify-content: flex-start; margin-top: 10px; }

.creation-disclosure, .column-picker { border: 0; border-radius: 0; background: transparent; }
.creation-disclosure > summary, .column-picker > summary { min-height: 44px; padding: 10px 0; color: var(--color-primary); }
.creation-disclosure > summary::before { margin-right: 7px; color: var(--color-primary); content: "+"; font-size: 19px; font-weight: 500; line-height: 0; }
.creation-disclosure[open] > summary, .column-picker[open] > summary { border-bottom: 1px solid var(--color-line); }
.creation-disclosure > :not(summary), .column-picker > :not(summary) { margin: 0; padding: 16px 0 0; }
.creation-disclosure .form-section { border-top: 0; }

.form-section, .editor-surface { width: min(100%, 1040px); }
.form-grid { gap: 14px 16px; }
.field { gap: 5px; }
.field > label, .field > span { color: var(--color-ink-soft); font-size: 12px; font-weight: 700; }
input, select, textarea { border-color: #bfcede; border-radius: 5px; background: #f4f7fb; }
input:hover, select:hover, textarea:hover { border-color: #90adc9; }
input:focus, select:focus, textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(23, 95, 193, 0.24); }
input:read-only, textarea:read-only { background: #f4f7fb; }
input[type="date"], input[type="datetime-local"], input[type="time"] { min-width: 220px; }
input[name="lineQuantity"], input[name="quantity"] { min-width: 88px; }
input[inputmode="decimal"] { min-width: 136px; }
.checkbox, .option-list label { min-height: 44px; }
.form-actions { padding-top: 16px; border-top: 1px solid var(--color-line); }
.subform { padding: 16px 0 0; border: 0; border-top: 1px solid var(--color-line); border-radius: 0; background: transparent; }
fieldset.subform { min-width: 0; }
.subform legend { padding: 0; }

.section-tabs, .finance-tabs { gap: 0; }
.section-tabs a, .finance-tabs a { min-height: 42px; padding-inline: 12px; }
.settings-section > .page-intro { margin-bottom: 0; }

.home-overview { display: grid; gap: 22px; }
.home-heading { display: grid; gap: 4px; padding: 0; }
.home-heading p { max-width: none; margin: 0; color: var(--color-ink-soft); font-size: 16px; font-weight: 550; }
.home-heading .home-date { color: var(--color-muted); font-size: 12px; font-weight: 650; letter-spacing: 0.02em; text-transform: uppercase; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; border: 0; }
.quick-action { min-height: 44px; padding: 10px 14px; border: 1px solid #bfcede; border-radius: 4px; color: var(--color-primary); background: #ffffff; font-size: 13px; }
.quick-action:last-child { border-right: 1px solid #bfcede; }
.quick-action:hover { border-color: var(--color-primary); background: #f4f8fd; }
.quick-action.primary { border-color: var(--color-primary); color: #ffffff; background: var(--color-primary); }
.quick-action.primary:hover { background: #124d9e; }
.home-dashboard { display: grid; gap: 26px; }
.home-finance { display: grid; gap: 12px; max-width: none; }
.home-section-heading, .home-resource-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--color-line); }
.home-resource-header h2 { font-size: 18px; }
.home-resource-header p { margin: 3px 0 0; }
.home-finance .metrics-strip { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border: 0; border-block: 1px solid var(--color-line); border-radius: 0; background: transparent; }
.home-finance .metrics-strip > * { padding: 14px 16px; border-right: 1px solid var(--color-line); }
.home-finance .metrics-strip > *:first-child { padding-left: 0; }
.home-finance .metrics-strip > *:last-child { border-right: 0; }
.home-finance .metrics-strip strong { margin-top: 6px; font-size: clamp(28px, 2.15vw, 32px); line-height: 1.06; white-space: nowrap; }
.home-finance .finance-metric.warning, .home-finance .finance-metric.danger { background: transparent; }
.home-finance .finance-metric.warning > span::before, .home-finance .finance-metric.danger > span::before { display: inline-block; width: 6px; height: 6px; margin: 0 5px 1px 0; border-radius: 50%; content: ""; }
.home-finance .finance-metric.warning > span::before { background: var(--color-warning); }
.home-finance .finance-metric.danger > span::before { background: var(--color-danger); }
.home-workspace { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); gap: 28px; align-items: start; }
.home-pending { display: grid; gap: 24px; }
.home-agenda, .home-pending { min-width: 0; }
.home-agenda .collection-view, .home-pending .collection-view { display: grid; gap: 0; }
.home-agenda .empty-state, .home-pending .empty-state { min-height: 64px; }
.local-environment-note { padding: 8px 0; }

.report-columns, .report-table-wrap, .detail-grid { border-radius: 0; }
.report-columns { border-inline: 0; }
.report-table-wrap { border-inline: 0; }

.auth-view { width: min(100%, 400px); margin: auto; }
.app-shell:has(.auth-view) .view { align-content: center; padding: 32px 16px; }
.auth-view .panel, .auth-panel { max-width: 400px; padding: 28px 0 0; border-top: 3px solid var(--color-primary); background: #ffffff; }
.auth-view .form-actions { margin-top: 6px; }

@media (max-width: 1050px) {
  .home-finance .metrics-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-finance .metrics-strip > *:nth-child(3n) { border-right: 0; }
  .home-finance .metrics-strip > *:nth-child(-n + 3) { border-bottom: 1px solid var(--color-line); }
}

@media (max-width: 760px) {
  .sidebar { position: static; padding: 10px 16px 8px; }
  .main-nav { overflow-x: auto; }
  .nav-group-label { display: none; }
  .main-nav a { border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; }
  .main-nav a[aria-current="page"] { border-bottom-color: var(--color-primary); background: #e5effc; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 0; max-height: none; padding: 14px 16px 10px; }
  .topbar-actions { grid-column: 1 / -1; justify-content: space-between; }
  .identity-actions .button { max-width: min(260px, calc(100vw - 132px)); }
  .view { padding: 18px 16px 44px; }
  .home-finance .metrics-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-finance .metrics-strip > * { padding: 12px 10px; border-right: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
  .home-finance .metrics-strip > *:first-child { padding-left: 0; }
  .home-finance .metrics-strip > *:nth-child(2n) { border-right: 0; }
  .home-finance .metrics-strip > *:last-child { border-bottom: 0; }
  .home-finance .metrics-strip > *:nth-child(-n + 3) { border-bottom: 1px solid var(--color-line); }
  .home-finance .metrics-strip strong { font-size: clamp(24px, 8vw, 30px); }
  .home-workspace { grid-template-columns: 1fr; gap: 24px; }
  .home-pending { gap: 24px; }
  .home-section-heading, .home-resource-header { align-items: flex-start; }
  .quick-actions { gap: 8px; }
  .quick-action { flex: 1 1 180px; justify-content: center; }
  input[type="date"], input[type="datetime-local"], input[type="time"] { min-width: 0; }
  .form-section, .editor-surface { width: 100%; }
  .subform { padding-inline: 0; }
}

@media (max-width: 420px) {
  .topbar { grid-template-columns: 1fr; }
  .topbar-actions { gap: 6px; }
  .identity-actions .button { max-width: calc(100vw - 116px); }
  .home-heading p { font-size: 15px; }
  .quick-action { flex-basis: 100%; }
}

/* gerenc.ia empresa: organização operacional baseada na referência observada. */
:root { --color-primary: #14222c; --color-accent-dark: #253f50; --color-canvas: #f7f8fa; --color-sidebar: #f0f1f3; --sidebar-width: 224px; font-family: Arial, Helvetica, sans-serif; }
body { background: var(--color-canvas); }
.product-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 54px; padding: 0 22px; color: #fff; background: #101e28; }
.product-brand { flex: 0 0 182px; color: #fff; font-size: 27px; line-height: 1; font-weight: 400; letter-spacing: -1.3px; text-decoration: none; white-space: nowrap; }
.product-brand span { color: #88c9e8; }
.product-brand small { font-size: 11px; letter-spacing: 0; margin-left: 3px; }
.product-environment { margin-left: auto; color: #c6d4df; font-size: 12px; }
.menu-toggle { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 4px; color: #fff; background: transparent; font-size: 23px; }
.menu-toggle:hover { background: #2b3b47; }
.app-shell { min-height: calc(100vh - 54px); }
.sidebar { top: 54px; height: calc(100vh - 54px); padding: 20px 8px 14px; overflow-y: auto; background: var(--color-sidebar); }
.workspace-name { padding: 12px 10px 22px; color: #34444f; font-size: 15px; font-weight: 600; }
.workspace-name small { display: block; margin-top: 4px; color: var(--color-muted); font-size: 11px; font-weight: 400; }
.main-nav a { min-height: 39px; font-size: 13px; font-weight: 400; border-radius: 3px; color: #535d64; }
.main-nav a[aria-current="page"] { border-left-color: #243846; color: #14222c; background: #dcdee1; font-weight: 600; }
.main-nav a[aria-current="page"] .nav-icon { color: #243846; }
.topbar { width: 100%; min-height: 70px; padding: 13px 22px; background: #fff; }
.topbar .eyebrow { font-weight: 400; font-size: 10px; color: #77858f; letter-spacing: 0; }
h1 { font-size: 24px; font-weight: 400; letter-spacing: 0; }
h2 { font-size: 19px; font-weight: 500; letter-spacing: 0; }
.view { width: 100%; padding: 24px 22px 52px; }
.panel, .form-section, .editor-surface, .settings-section { max-width: none; background: #fff; padding: 20px; border: 1px solid #dfe4e8; border-radius: 4px; }
.panel-header h2::before, .section-heading h2::before { display: none; }
.panel-header, .section-heading { align-items: center; }
.stack { gap: 20px; }
.button.accent, .button:not(.ghost):not(.secondary):not(.danger) { background: #14222c; border-color: #14222c; }
.button.accent:hover, .button:not(.ghost):not(.secondary):not(.danger):hover { background: #293e4d; }
.button.ghost { color: #294b63; background: transparent; }
.button.secondary { color: #273b49; background: #fff; }
.toolbar { gap: 10px; padding: 14px; background: #f7f8fa; border: 1px solid #e2e6ea; border-radius: 3px; }
.toolbar .field { min-width: 120px; }
.toolbar input[type="date"] { min-width: 135px; }
input, select, textarea { background: #fff; border-color: #cbd3da; }
.form-block { min-width: 0; margin: 0; padding: 18px; border: 1px solid #e0e5e9; border-radius: 3px; }
.form-block legend { padding: 0 7px; color: #283d4b; font-size: 15px; font-weight: 600; }
.form-tabs { display: flex; overflow-x: auto; gap: 0; border-bottom: 1px solid #cbd3da; }
.form-tabs .button { flex: 0 0 auto; min-height: 42px; padding: 10px 20px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: #69737b; }
.form-tabs .button[aria-selected="true"] { color: #172d3b; border-bottom-color: #253f50; background: #f3f5f7; }
.form-tab-panel { padding-top: 14px; }
.data-table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid #dce2e7; border-radius: 3px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.data-table th { padding: 13px 12px; border-bottom: 1px solid #dce2e7; color: #34424b; background: #f4f5f7; font-size: 12px; font-weight: 600; white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid #e0e5e9; vertical-align: middle; color: #46535d; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:nth-child(even) { background: #f6f7f9; }
.data-table tbody tr:hover { background: #edf3f7; }
.record-name { min-width: 160px; font-weight: 600; color: #203d50 !important; }
.cell-note { display: block; margin-top: 4px; color: #73818c; font-size: 11px; font-weight: 400; }
.money-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 132px; }
.table-actions .button.small { min-height: 31px; padding: 5px 8px; font-size: 11px; }
.data-table .badge { min-height: 20px; padding: 3px 7px; border-radius: 3px; font-size: 11px; }
.sale-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 26px; padding: 16px 20px; background: #f3f6f8; border: 1px solid #dce4e9; }
.sale-summary dt { margin-bottom: 4px; color: #6c7a84; font-size: 12px; }
.sale-summary dd { margin: 0; color: #142a3b; font-size: 20px; font-variant-numeric: tabular-nums; }
.line-subtotal { display: block; padding-top: 8px; text-align: right; color: #4d6575; font-size: 12px; }
.navigation-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }
.navigation-collapsed .sidebar { display: none; }
/* Medidas e cores conferidas na captura de 13/10/2026, viewport 814 × 417. */
@font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/source-sans-pro-400.ttf') format('truetype'); }
@font-face { font-family: 'Source Sans Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/source-sans-pro-600.ttf') format('truetype'); }
:root { --sidebar-width: 240px; --color-primary: #0f1921; --color-ink: #262b2f; --color-text: #262b2f; --color-ink-soft: #555; --color-muted: #6b6b6b; --color-line: #d9dee2; --color-canvas: #f8f8f8; --color-sidebar: #f2f2f2; font-family: 'Source Sans Pro', sans-serif; }
.product-bar { height: 50px; gap: 0; padding: 0; background: #0f1921; }
.product-brand { flex: 0 0 240px; padding-left: 20px; font-size: 30px; letter-spacing: -1px; }
.product-brand small { font-size: 11px; }
.menu-toggle { width: 44px; height: 50px; border-radius: 0; font-size: 25px; font-weight: 400; }
.product-environment { margin: 0 16px 0 auto; padding: 4px 7px; border-radius: 3px; background: #4b555b; color: #fff; font-size: 11px; }
.product-bar .identity-actions { gap: 5px; padding-right: 10px; }
.product-bar .identity-actions .button { min-height: 30px; max-width: 150px; padding: 4px 8px; color: #fff; border: 0; background: #4b555b; font-size: 11px; font-weight: 400; }
.product-bar .identity-context strong { font-size: 11px; color: #fff; font-weight: 400; }
.product-bar .identity-context > span { display: none; }
.product-bar .identity-actions .button.ghost { background: transparent; }
.app-shell { min-height: calc(100vh - 50px); }
.sidebar { top: 50px; height: calc(100vh - 50px); padding: 0 8px 14px; border-right: 1px solid #d9dee2; }
.workspace-name { display: flex; flex: 0 0 176px; flex-direction: column; align-items: center; justify-content: center; height: 176px; padding: 20px 8px; margin: 0; text-decoration: none; background: #f2f2f2; }
.workspace-name strong { font-size: 30px; font-weight: 600; color: #0f1921; letter-spacing: -1px; }
.workspace-name strong span { color: #378ec2; }
.workspace-name small { margin-top: 0; font-size: 12px; color: #555; }
.main-nav { display: block; flex: 0 0 auto; }
.main-nav a, .nav-section summary, .unavailable-menu { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 10px 12px; color: #555; font-size: 15px; font-weight: 400; line-height: 20px; border: 0; border-radius: 3px; }
.nav-section summary { cursor: pointer; list-style: none; }
.nav-section summary::-webkit-details-marker { display: none; }
.nav-section summary::after { content: '›'; margin-left: auto; color: #999; font-size: 17px; }
.nav-section[open] summary::after { content: '⌄'; }
.nav-section:has([aria-current='page']) summary { color: #0f1921; font-weight: 600; }
.menu-symbol { width: 16px; flex: 0 0 16px; text-align: center; font-size: 17px; color: #888; }
.nav-section a { padding-left: 32px; min-height: 32px; font-size: 14px; }
.main-nav a[aria-current='page'] { color: #0f1921; background: #d7d8d9; border: 0; font-weight: 600; }
.main-nav a[aria-current='page'] .menu-symbol { color: #0f1921; }
.main-nav a:hover, .nav-section summary:hover { background: #e6e6e6; color: #0f1921; }
.environment-card { display: none; }
.topbar { height: 55px; min-height: 55px; max-height: none; padding: 15px 20px 10px; gap: 10px; background: #fafafa; border-bottom: 1px solid #eee; }
.topbar h1 { margin: 0; font-size: 24px; line-height: 29px; font-weight: 400; color: #262b2f; }
main:has([data-view='sales']) .topbar h1::before { content: ''; display: inline-block; width: 24px; height: 22px; margin-right: 4px; vertical-align: -2px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23262b2f'%3E%3Cpath d='M1 2h3l2.4 12H20l3-10H5l-.4-2H1zm6 14h13v2H7zm1 3a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm11 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.topbar-actions { gap: 5px; }
.api-indicator { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.topbar-actions .icon-button { min-height: 25px; width: 25px; flex-basis: 25px; border: 0; background: transparent; color: #888; }
.topbar-actions .icon-button svg { width: 15px; height: 15px; }
.view { padding: 19px 15px 40px; background: #f8f8f8; }
.button, .icon-button { min-height: 37px; padding: 6px 12px; font-size: 16px; font-weight: 400; line-height: 23px; border-radius: 4px; }
.button.accent, .button:not(.ghost):not(.secondary):not(.danger) { background: #0f1921; border-color: #0f1921; }
.button.secondary { color: #0f1921; border-color: #0f1921; background: #fff; }
.sales-list { gap: 16px; }
.sales-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px; }
.add-symbol { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; color: #0f1921; background: #fff; border-radius: 50%; font-size: 14px; font-weight: 600; line-height: 14px; }
.sales-actions .button { gap: 4px; }
.sales-filters { display: contents; }
.sales-filters summary { list-style: none; cursor: pointer; }
.sales-filters summary::-webkit-details-marker { display: none; }
.sales-filters .toolbar { flex-basis: 100%; width: 100%; margin-top: 10px; }
.sales-filters:not([open]) .toolbar { display: none; }
.sales-list .data-table-wrap { border-radius: 4px; border-color: #d9dee2; background: #fff; }
.sales-list .data-table { min-width: 1000px; font-size: 12px; line-height: 17px; }
.sales-list .data-table th { height: 42px; padding: 12px; background: #f6f6f6; color: #262b2f; font-size: 12px; font-weight: 600; border: 1px solid #d9dee2; border-top: 0; }
.sales-list .data-table td { height: 53px; padding: 12px; color: #262b2f; border: 1px solid #d9dee2; }
.sales-list .data-table th:first-child, .sales-list .data-table td:first-child { border-left: 0; width: 50px; min-width: 50px; }
.sales-list .data-table th:nth-child(2), .sales-list .data-table td:nth-child(2) { width: 259px; min-width: 259px; }
.sales-list .data-table th:nth-child(3), .sales-list .data-table td:nth-child(3) { width: 82px; min-width: 82px; white-space: nowrap; }
.sales-list .data-table th:nth-child(4), .sales-list .data-table td:nth-child(4) { width: 82px; min-width: 82px; white-space: nowrap; }
.sales-list .table-actions { flex-wrap: nowrap; min-width: max-content; }
.sales-list .table-actions .button { min-height: 26px; padding: 3px 6px; font-size: 11px; line-height: 18px; white-space: nowrap; }
.sales-list .data-table tbody tr:nth-child(even) { background: #f3f3f3; }
.sales-list .data-table tbody tr:hover { background: #ddd; }
.sale-number { font-weight: 400; }
.sale-customer a { color: #0f1921; text-transform: uppercase; text-decoration: underline; }
.sales-list .data-table .badge { min-height: 18px; padding: 2px 5px; font-size: 10px; line-height: 12px; font-weight: 600; border: 1px solid currentColor; border-radius: 3px; background: #f6f6f6; }
.sales-list .badge::before { content: ''; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.sales-list .badge:has(span)::before { display: none; }
.sales-list .badge.success { color: #008000; }
.sales-list .badge.warning { color: #000; background: #ffa500; }
.sales-list .badge:not(.success):not(.warning):not(.danger):not(.neutral) { color: #0086bb; background: #eff7fb; }
.sales-list .data-table .badge > span { width: 6px !important; height: 6px !important; }
.result-count { margin: 0; font-size: 12px; color: #777; }
@media (max-width: 760px) {
  .product-bar { height: 50px; padding-inline: 16px; gap: 8px; }
  .product-brand { flex: 0 1 auto; font-size: 24px; }
  .product-environment { font-size: 10px; }
  .sidebar { position: static; height: auto; padding: 8px 12px; }
  .workspace-name, .environment-card { display: none; }
  .topbar { padding: 14px 16px; }
  .view { padding: 16px 12px 40px; }
  .panel, .form-section, .editor-surface, .settings-section { padding: 15px; }
  .panel-header, .section-heading { flex-wrap: wrap; }
  .data-table { min-width: 750px; }
  .form-tabs .button { padding-inline: 16px; }
  .form-block { padding: 14px; }
}

/* Clientes, 13/10/2026: medidas lidas nas capturas clientes.png e cliente-novo.png (janela 1440 × 900). */
.product-bar .identity-actions { display: flex; align-items: center; gap: 0; margin-left: auto; padding-right: 17px; }
.header-shortcut { display: grid; place-items: center; width: 41px; height: 50px; padding: 0; border: 0; color: #fff; background: transparent; text-decoration: none; cursor: pointer; }
.header-shortcut svg { width: 16px; height: 16px; }
.header-shortcut:disabled { cursor: default; opacity: 0.9; }
.header-shortcut:not(:disabled):hover { background: #24313b; }
.avatar-wrap { position: relative; margin-left: 9px; }
.header-avatar { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: #262b2f; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.avatar-menu { position: absolute; right: 0; top: 40px; z-index: 50; display: grid; min-width: 200px; padding: 6px 0; border: 1px solid #d9dee2; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16); }
.avatar-menu[hidden] { display: none; }
.avatar-menu-identity { padding: 8px 14px 10px; border-bottom: 1px solid #eee; }
.avatar-menu-identity strong, .avatar-menu-identity span { display: block; color: #262b2f; font-size: 13px; font-weight: 600; }
.avatar-menu-identity span { color: #777; font-weight: 400; }
.avatar-menu a, .avatar-menu button { padding: 8px 14px; border: 0; color: #262b2f; background: transparent; font: inherit; font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.avatar-menu a:hover, .avatar-menu button:hover { background: #f2f2f2; }
.product-environment { display: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; }
.topbar > div:first-child { flex: 1 1 auto; }
.page-breadcrumb { display: flex; align-items: center; gap: 7px; color: #777; font-size: 12px; white-space: nowrap; }
.page-breadcrumb a { color: #777; text-decoration: none; }
.page-breadcrumb a:hover { color: #0f1921; text-decoration: underline; }
.page-breadcrumb .crumb-home::before { content: '⌂'; margin-right: 6px; color: #555; font-size: 14px; }
.page-breadcrumb strong { color: #262b2f; font-weight: 600; }
.page-breadcrumb .crumb-separator { color: #999; }
.topbar:has(.page-breadcrumb:not(:empty)) .topbar-actions { display: none; }
#page-title[data-route='customers'][data-mode='list']::before { content: ''; display: inline-block; width: 24px; height: 24px; margin-right: 6px; vertical-align: -2px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23262b2f'%3E%3Ccircle cx='9' cy='9' r='4'/%3E%3Cpath d='M1 22c0-4.4 3.6-8 8-8s8 3.6 8 8z'/%3E%3Ccircle cx='16.5' cy='4' r='3'/%3E%3Cpath d='M14 10.5a7 7 0 0 1 9 5.5h-5a10 10 0 0 0-4-5.5z'/%3E%3C/svg%3E") center / contain no-repeat; }

.nav-cadastros { position: relative; }
.nav-cadastros > a, .nav-cadastros > .nav-sub { margin-left: 0; padding-left: 32px; min-height: 34px; font-size: 14px; }
.nav-cadastros > a::before, .nav-cadastros > .nav-sub::before { content: ''; position: absolute; left: 20px; width: 1px; height: 34px; background: #ddd; }
.nav-cadastros > .nav-sub { position: relative; color: #888; cursor: default; }
.nav-cadastros .menu-symbol svg { width: 14px; height: 14px; vertical-align: -2px; }
.nav-chevron { margin-left: auto; color: #999; font-size: 17px; }
.nav-cadastros > a:not([aria-current='page']) { color: #888; }

.customers-list { gap: 16px; }
.customers-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.customers-toolbar .button[disabled] { opacity: 1; cursor: default; }
.customer-search { display: flex; align-items: stretch; gap: 0; }
.customer-search .view-toggle { width: 40px; min-height: 37px; margin-right: 5px; padding: 0; justify-content: center; border-color: #ccc; color: #0f1921; }
.customer-search .view-toggle svg, .search-dark svg { width: 16px; height: 16px; }
.customer-search input { width: 238px; min-height: 37px; padding: 6px 12px; border: 1px solid #ccc; border-radius: 4px 0 0 4px; font-size: 15px; }
.customer-search .search-dark { width: 40px; min-height: 37px; padding: 0; justify-content: center; border-radius: 0; background: #0f1921; color: #fff; }
.customer-search .search-dark:last-child { margin-left: 4px; border-radius: 4px; }
.customer-search .search-dark[disabled] { opacity: 1; cursor: default; }
.customers-list .data-table-wrap { border-radius: 4px; border-color: #d9dee2; background: #fff; }
.customers-list .data-table { min-width: 900px; font-size: 13px; line-height: 17px; }
.customers-list .data-table th { height: 46px; padding: 12px; background: #fff; color: #262b2f; font-size: 13px; font-weight: 600; border: 1px solid #d9dee2; border-top: 0; }
.customers-list .data-table td { height: 53px; padding: 12px; color: #262b2f; border: 1px solid #d9dee2; }
.customers-list .data-table th:first-child, .customers-list .data-table td:first-child { border-left: 0; width: 36.3%; }
.customers-list .data-table th:nth-child(5) { width: 17%; }
.customers-toolbar { margin-top: 2px; margin-bottom: 2px; }
.customers-list .data-table th:last-child, .customers-list .data-table td:last-child { border-right: 0; width: 117px; text-align: center; }
.customers-list .data-table th:nth-child(3), .customers-list .data-table td:nth-child(3) { width: 111px; text-align: center; }
.customers-list .data-table td:nth-child(5) { white-space: nowrap; }
.customers-list .record-name { font-weight: 400; color: #262b2f !important; text-transform: uppercase; }
.customers-list .data-table tbody tr:nth-child(even) { background: #f3f3f3; }
.customers-list .data-table tbody tr:hover { background: #e9e9e9; }
.row-icon-actions { display: inline-flex; gap: 5px; }
.row-icon { display: grid; place-items: center; width: 28px; height: 26px; padding: 0; border: 1px solid #e3e3e3; border-radius: 3px; color: #0f1921; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); cursor: pointer; }
.row-icon svg { width: 13px; height: 13px; }
.row-icon:hover:not(:disabled) { background: #f2f2f2; }
.row-icon.danger { color: #d9534f; }
.row-icon:disabled { cursor: not-allowed; opacity: 0.75; }

.app-shell:has(.customer-form) { grid-template-columns: minmax(0, 1fr); }
.app-shell:has(.customer-form) .sidebar { display: none; }
.customer-form { gap: 16px; }
.customer-cards { gap: 16px; }
.ref-card { border: 1px solid #e3e3e3; border-radius: 4px; background: #fff; }
.ref-card-header { padding: 16px 20px 14px; border-bottom: 1px solid #e3e3e3; background: #f6f6f6; border-radius: 4px 4px 0 0; }
.ref-card-header h2 { margin: 0; color: #262b2f; font-size: 20px; font-weight: 400; line-height: 26px; }
.ref-card-header h2 strong { font-weight: 600; }
.ref-card-icon { display: inline-block; width: 18px; margin-right: 4px; color: #555; font-size: 15px; text-align: center; }
.ref-card-header p { margin: 6px 0 0; color: #555; font-size: 11px; line-height: 14px; }
.ref-card-body { display: grid; gap: 14px; padding: 20px 20px 20px; }
.ref-card .form-grid { column-gap: 30px; row-gap: 14px; }
.ref-card .field > label { color: #555; font-size: 13px; font-weight: 400; }
.ref-card .field > label.required::after { content: ' *'; color: #d9534f; }
.ref-card input, .ref-card select, .ref-card textarea { min-height: 37px; border: 1px solid #ccc; border-radius: 3px; font-size: 15px; }
.ref-card input:not([type='checkbox']), .ref-card select { height: 37px; min-height: 37px; padding: 6px 12px; }
.ref-card .field { gap: 5px; }
.ref-card .field-unsaved input, .ref-card .field-unsaved select, .ref-card input:disabled { color: #999; background: #eee; cursor: not-allowed; }
.ref-card .field-unsaved > label::after { content: ' ·'; color: #bbb; }
.city-uf { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 6px; }
.ref-note { margin: 0; color: #777; font-size: 12px; }
.ref-add { justify-self: start; gap: 4px; border-color: #0f1921; }
.ref-add[disabled] { opacity: 0.6; cursor: not-allowed; }
.add-symbol.dark { color: #fff; background: #0f1921; }
.check-inline { display: flex; align-items: center; gap: 6px; min-height: 37px; margin-top: 20px; color: #999; font-size: 13px; }
.photo-slot { display: grid; place-items: center; width: 120px; height: 120px; border: 1px solid #e3e3e3; border-radius: 3px; color: #bbb; background: #f6f6f6; font-size: 48px; }
.customer-form-actions { justify-content: flex-start; gap: 6px; }
@media (max-width: 760px) {
  .page-breadcrumb { display: none; }
  .customer-search { width: 100%; }
  .customer-search input { flex: 1 1 auto; width: auto; min-width: 0; }
  .ref-card .form-grid > [class^='span-'] { grid-column: span 12; }
  .header-shortcut { width: 34px; }
}
