@font-face {
  font-family: "Source Sans Pro";
  src: url("/assets/brand/Fontes/SourceSansPro-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans Pro";
  src: url("/assets/brand/Fontes/SourceSansPro-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans Pro";
  src: url("/assets/brand/Fontes/SourceSansPro-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --fg-default: #1f2328;
  --fg-muted: #3e5d5e;
  --fg-subtle: #567475;
  --fg-on-emphasis: #ffffff;

  --canvas-default: #ffffff;
  --canvas-subtle: #f3f8f8;
  --canvas-inset: #e8f1f1;

  --border-default: #c7dddd;
  --border-muted: #d6e6e6;
  --border-strong: #709798;

  --brand-500: #74b4b5;
  --brand-600: #709798;
  --brand-700: #48877f;

  --accent-emphasis: var(--brand-700);
  --success-emphasis: #1a7f37;
  --warning-emphasis: #9a6700;
  --danger-emphasis: #cf222e;

  --accent-subtle: #e5f2f2;
  --success-subtle: #dafbe1;
  --warning-subtle: #fff8c5;
  --danger-subtle: #ffebe9;
  --label-info-bg: #ddf4ff;

  --btn-primary-bg: var(--brand-700);
  --btn-primary-hover: var(--brand-600);
  --btn-primary-active: #3d756e;
  --btn-default-bg: #f6f8fa;
  --btn-default-hover: #eff2f5;
  --btn-default-active: #e6eaef;

  --font-family-base: "Source Sans Pro", "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 12px;
  --font-size-md: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 24px;
  --line-height-tight: 20px;
  --line-height-title: 24px;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 16px;
  --space-8: 20px;
  --space-9: 24px;

  --radius-sm: 5px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-pill: 100px;

  --shadow-soft: 0 1px 0 rgba(27, 31, 36, 0.04);
  --shadow-resting: var(--shadow-soft);
  --shadow-raised: 0 8px 24px rgba(140, 149, 159, 0.2);
  --font-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, "Liberation Mono", monospace;

  /* Legacy aliases */
  --bg: var(--canvas-subtle);
  --panel: var(--canvas-default);
  --text: var(--fg-default);
  --muted: var(--fg-muted);
  --line: var(--border-default);
  --brand: var(--btn-primary-bg);
  --brand-2: var(--btn-primary-hover);
  --danger: var(--danger-emphasis);
  --color-status-danger: var(--danger-emphasis);
  --color-status-success-text: var(--success-emphasis);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  color: var(--fg-default);
  background: #f3f8f8;
  font-size: var(--font-size-md);
  line-height: var(--line-height-tight);
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--fg-default);
}

h1 {
  font-size: clamp(1.4rem, 2.3vw, 1.8rem);
  line-height: var(--line-height-title);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-title);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--font-size-md);
  line-height: var(--line-height-tight);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-7);
  padding: var(--space-8) var(--space-9);
  min-height: 64px;
  border-bottom: 1px solid var(--border-default);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar p {
  margin: var(--space-2) 0 0;
  color: var(--fg-muted);
}

.brand-copy {
  display: grid;
  gap: var(--space-1);
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(116, 180, 181, 0.12);
  color: var(--accent-emphasis);
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}

.brand-head {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.brand-logo {
  width: auto;
  height: 72px;
  flex-shrink: 0;
  object-fit: contain;
}

.status-chip {
  margin-top: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 30px;
  border-radius: var(--radius-pill);
  padding: 4px 12px 4px 10px;
  font-size: var(--font-size-xs);
  line-height: 18px;
  border: 1px solid;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 6px 16px rgba(31, 35, 40, 0.05);
}

.status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
  flex: 0 0 auto;
}

.chip-producao {
  background: #e6f6ea;
  color: var(--success-emphasis);
  border-color: #95d8a6;
}

.chip-andamento {
  background: #fff2c8;
  color: var(--warning-emphasis);
  border-color: #d4a72c;
}

.chip-planejado {
  background: #e2f0ff;
  color: var(--accent-emphasis);
  border-color: #9fc8ea;
}

.chip-cancelado {
  background: #ffe3e3;
  color: var(--danger-emphasis);
  border-color: #e5a6b0;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.user-badge {
  background: var(--canvas-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  padding: 1px 10px;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
  color: var(--fg-muted);
}

.auth-wrap {
  min-height: calc(100vh - 86px);
  display: grid;
  place-items: center;
  padding: var(--space-8);
}

.auth-card {
  width: min(460px, 100%);
  background: var(--canvas-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: grid;
  gap: var(--space-5);
  box-shadow: var(--shadow-soft);
}

.auth-card p {
  margin: 0;
  color: var(--fg-muted);
}

.account-grid {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.auth-error {
  color: var(--danger-emphasis);
  font-size: var(--font-size-md);
  font-weight: 500;
}

.muted-small {
  color: var(--fg-muted);
  font-size: var(--font-size-sm);
}

.admin-modules {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-5);
}

.admin-module {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--canvas-default);
  box-shadow: var(--shadow-soft);
}

.admin-module .status {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
  margin-top: var(--space-3);
  border: 1px solid;
  font-weight: var(--font-weight-semibold);
}

.admin-module .status.producao {
  background: var(--success-subtle);
  color: var(--success-emphasis);
  border-color: #95d8a6;
}

.admin-module .status.andamento {
  background: var(--warning-subtle);
  color: var(--warning-emphasis);
  border-color: #d4a72c;
}

.admin-module .status.planejado {
  background: var(--accent-subtle);
  color: var(--accent-emphasis);
  border-color: #96d0ff;
}

.admin-module .meta {
  margin-top: var(--space-4);
  color: var(--fg-muted);
  font-size: var(--font-size-sm);
}

.admin-module .meta a {
  color: var(--accent-emphasis);
  text-decoration: none;
}

.admin-module .meta a:hover {
  text-decoration: underline;
}

.admin-links {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.admin-rules {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-5);
}

.admin-rule-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--canvas-default);
  box-shadow: var(--shadow-soft);
}

.admin-rule-card h3 {
  margin-bottom: var(--space-5);
}

.admin-rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.admin-rule-table th,
.admin-rule-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-muted);
}

.admin-rule-table th {
  color: var(--fg-muted);
  font-weight: var(--font-weight-semibold);
  background: var(--canvas-subtle);
}

.admin-rule-table tbody tr:last-child td {
  border-bottom: none;
}

.sidebar-toggle {
  display: none;
}

.layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-9);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--space-7);
  align-items: start;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

.sidebar-nav {
  position: sticky;
  top: calc(var(--space-8) + 4px);
  border: 1px solid var(--border-default);
  border-radius: calc(var(--radius-lg) + 2px);
  padding: var(--space-6);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: var(--space-4);
}

.sidebar-nav h2 {
  color: var(--fg-muted);
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}

.sidebar-links {
  display: grid;
  gap: var(--space-3);
}

.sidebar-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  color: var(--fg-default);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.sidebar-link:hover {
  border-color: var(--border-default);
  background: var(--canvas-subtle);
}

.sidebar-link.is-active {
  background: rgba(116, 180, 181, 0.16);
  border-color: rgba(112, 151, 152, 0.34);
  color: var(--accent-emphasis);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-muted);
}

.sidebar-note {
  margin: 0;
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 18px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  z-index: 19;
}

.panel {
  background: var(--canvas-default);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-7);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: rgba(116, 180, 181, 0.7);
}

.panel > h2 {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-muted);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-muted);
}

.panel-kicker {
  display: inline-block;
  margin-bottom: var(--space-2);
  color: var(--fg-subtle);
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}

.panel-intro {
  margin: var(--space-2) 0 0;
  max-width: 62ch;
  color: var(--fg-muted);
  font-size: var(--font-size-md);
}

.full-width {
  grid-column: 1 / -1;
}

.form-grid {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
  align-items: start;
}

.form-section-title {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-2);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-muted);
}

.form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.form-section-title strong {
  font-size: 13px;
  line-height: 18px;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.01em;
}

.form-section-title span {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 18px;
}

.form-preview {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: #eef6f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.form-preview-head {
  display: grid;
  gap: var(--space-2);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-muted);
}

.form-preview-head strong {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-preview-head span {
  color: var(--fg-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
}

.form-preview-body {
  margin-top: var(--space-5);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-5);
  padding-top: var(--space-2);
  margin-top: var(--space-2);
  border-top: 1px solid var(--border-muted);
}

.form-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
  font-weight: 500;
  color: var(--fg-default);
}

.form-card-field {
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: calc(var(--radius-lg) + 2px);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.form-card-field-wide {
  grid-column: 1 / -1;
}

.split-toggle-wrap {
  display: grid;
  gap: var(--space-3);
}

.split-checkbox {
  margin-top: 0;
}

.form-grid-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.field-label-text {
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}

.field-meta {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
}

.checkbox-label {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: calc(var(--radius-lg) + 2px);
  background: rgba(255, 255, 255, 0.84);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  min-height: 32px;
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  background: var(--canvas-default);
  color: var(--fg-default);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input::placeholder {
  color: var(--fg-subtle);
}

input:hover,
select:hover {
  border-color: var(--border-strong);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid var(--accent-emphasis);
  outline-offset: 2px;
}

.btn {
  appearance: none;
  border: 1px solid rgba(27, 31, 36, 0.15);
  border-radius: var(--radius-md);
  background: var(--btn-primary-bg);
  color: var(--fg-on-emphasis);
  min-height: 32px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: var(--font-size-md);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-soft);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.btn:hover {
  background: var(--btn-primary-hover);
}

.btn:active {
  background: var(--btn-primary-active);
}

.btn:disabled {
  background: var(--canvas-subtle);
  color: var(--fg-subtle);
  border-color: var(--border-default);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--btn-default-bg);
  color: var(--fg-default);
  border: 1px solid rgba(27, 31, 36, 0.15);
}

.btn-secondary:hover {
  background: var(--btn-default-hover);
}

.btn-secondary:active {
  background: var(--btn-default-active);
}

.btn-danger {
  background: #fff5f5;
  color: var(--danger-emphasis);
}

.btn-danger:hover {
  background: var(--danger-subtle);
}

.btn-small {
  min-height: 28px;
  padding: 3px 12px;
  font-size: var(--font-size-sm);
}

.cards {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-5);
}

.card {
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: var(--space-6);
  background: #ffffff;
}

.card .value {
  margin-top: var(--space-4);
  font-size: var(--font-size-xl);
  line-height: 28px;
  letter-spacing: -0.02em;
  font-weight: var(--font-weight-bold);
}

.card .meta {
  margin-top: var(--space-1);
  color: var(--fg-muted);
  font-size: var(--font-size-sm);
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  align-items: center;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-muted);
}

.filters {
  margin-top: var(--space-6);
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: calc(var(--radius-lg) + 2px);
  background: #eef6f6;
}

.filters input,
.filters select {
  min-width: 100%;
}

.filter-field {
  display: grid;
  gap: var(--space-2);
  min-width: 180px;
  flex: 1 1 180px;
}

.filter-field span {
  color: var(--fg-subtle);
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: var(--font-weight-bold);
}

.filter-search {
  flex: 2 1 280px;
}

.results-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(112, 151, 152, 0.24);
  background: rgba(116, 180, 181, 0.12);
  color: var(--accent-emphasis);
  font-size: 12px;
  line-height: 18px;
  font-weight: var(--font-weight-bold);
}

.table-stage {
  margin-top: var(--space-5);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border-default);
  border-radius: calc(var(--radius-lg) + 2px);
  background: var(--canvas-default);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--canvas-default);
}

thead th {
  background: var(--canvas-subtle);
  color: var(--fg-muted);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  position: sticky;
  top: 0;
  z-index: 1;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-muted);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
  white-space: nowrap;
}

tbody tr:hover {
  background: #f1f8f8;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-state {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: var(--space-7);
  border: 1px dashed var(--border-default);
  border-radius: calc(var(--radius-lg) + 2px);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.empty-state p {
  margin: 0;
  color: var(--fg-muted);
}

.actions-col {
  width: 168px;
}

td.actions {
  white-space: normal;
}

td .status-chip {
  margin-top: 0;
}

.cell-client {
  min-width: 320px;
}

.cell-chip {
  min-width: 150px;
}

.cell-chip .table-pill {
  max-width: 100%;
}

.cell-number-head,
.cell-number {
  text-align: right;
}

.table-metric {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.table-metric strong {
  font-size: 13px;
  line-height: 18px;
  font-weight: var(--font-weight-bold);
  color: var(--fg-default);
}

.table-metric span {
  color: var(--fg-subtle);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.02em;
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.premium-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 30px;
  padding: 4px 12px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(112, 151, 152, 0.22);
  font-size: 11px;
  line-height: 16px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 6px 16px rgba(31, 35, 40, 0.04);
}

.premium-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.status-active {
  color: #0f6b34;
  background: #e6f6ea;
  border-color: #9fd8b0;
}

.status-paused {
  color: #8a5c06;
  background: #fff2c8;
  border-color: #e1c164;
}

.status-cancelled {
  color: #98313d;
  background: #ffe3e3;
  border-color: #e5a6b0;
}

.status-exempt {
  color: #5a4a00;
  background: #fff7dd;
  border-color: #e6d58f;
}

.status-generic {
  color: var(--accent-emphasis);
  background: #e2f0ff;
  border-color: #9fc8ea;
}

.client-identity {
  display: grid;
  gap: var(--space-3);
  min-width: 260px;
}

.client-identity-name {
  display: block;
  font-size: var(--font-size-md);
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.01em;
}

.client-identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.client-group-chip,
.table-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid rgba(112, 151, 152, 0.22);
  background: rgba(255, 255, 255, 0.96);
  color: var(--fg-muted);
  font-size: 11px;
  line-height: 16px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 6px 16px rgba(31, 35, 40, 0.04);
}

.client-group-chip {
  color: var(--fg-subtle);
}

.split-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  border: 1px solid #c8d8f5;
  background: #edf2ff;
  color: #404b8c;
  font-size: 11px;
  line-height: 16px;
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
}

.split-chip-opportunity {
  border-color: #b7dcc6;
  background: #e7f7ee;
  color: #1c6b3a;
}

.service-pill {
  border-color: rgba(112, 151, 152, 0.4);
  background: var(--accent-subtle);
  color: var(--accent-emphasis);
}

.service-pill-paused {
  border-color: rgba(154, 103, 0, 0.3);
  background: var(--warning-subtle);
  color: var(--warning-emphasis);
}

.service-lines {
  display: grid;
  gap: var(--space-3);
}

.service-line {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
}

.service-line select,
.service-line input {
  width: 100%;
}

.service-lines-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.finance-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .service-line {
    grid-template-columns: 1fr 1fr;
  }
}

.tier-pill {
  gap: var(--space-2);
}

.tier-a-plus {
  color: #0f5c58;
  background: #dff1f1;
  border-color: #8ecbcc;
}

.tier-a {
  color: #1d567b;
  background: #e3effd;
  border-color: #9dc3e8;
}

.tier-b {
  color: #86560c;
  background: #fff0cc;
  border-color: #e8ca85;
}

.tier-c {
  color: #6a4b0f;
  background: #ffe7c7;
  border-color: #ebc48e;
}

.tier-d,
.tier-generic {
  color: #4d5765;
  background: #eef2f6;
  border-color: #c8d1db;
}

.owner-pill {
  gap: var(--space-3);
  padding-left: 6px;
  padding-right: 12px;
}

.owner-pill-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 0 3px rgba(255, 255, 255, 0.6);
}

.owner-hilton {
  color: #454a99;
  background: #eceeff;
  border-color: #c1c8ff;
}

.owner-hilton .owner-pill-avatar {
  background: #6670df;
}

.owner-bruna {
  color: #8a2f6b;
  background: #fee8f5;
  border-color: #efbcde;
}

.owner-bruna .owner-pill-avatar {
  background: #c65198;
}

.owner-vinicius {
  color: #7a4c12;
  background: #ffedd6;
  border-color: #eccb9d;
}

.owner-vinicius .owner-pill-avatar {
  background: #cf8c2f;
}

.owner-generic {
  color: #3e5d5e;
  background: #e9f2f2;
  border-color: #bfd6d6;
}

.owner-generic .owner-pill-avatar {
  background: #5e8e8f;
}

.feedback-error {
  color: var(--danger-emphasis) !important;
}

.feedback-success {
  color: var(--success-emphasis) !important;
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    padding: var(--space-7);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid-split {
    grid-template-columns: 1fr;
  }

  .topbar {
    justify-content: space-between;
    align-items: center;
    padding: var(--space-7);
  }

  .brand-head {
    width: 100%;
    align-items: center;
    gap: var(--space-4);
  }

  .brand-logo {
    height: 56px;
  }

  .brand-copy {
    width: 100%;
  }

  .user-bar {
    width: 100%;
    justify-content: space-between;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-self: flex-start;
  }

  .sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 320px);
    max-width: 100%;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    transform: translateX(-104%);
    transition: transform 0.2s ease;
    z-index: 20;
    overflow-y: auto;
  }

  body.sidebar-open .sidebar-nav {
    transform: translateX(0);
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-buttons {
    width: 100%;
  }

  .form-buttons .btn {
    flex: 1 1 0;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .cell-number-head,
  .cell-number {
    text-align: left;
  }

  .table-metric {
    justify-items: start;
  }

  .table-actions {
    justify-content: flex-start;
  }
}

/* Visão executiva — saúde da carteira */
.card-success {
  background: var(--success-subtle);
  border-color: var(--success-emphasis);
}

.card-success .value {
  color: var(--success-emphasis);
}

.card-danger {
  background: var(--danger-subtle);
  border-color: var(--danger-emphasis);
}

.card-danger .value {
  color: var(--danger-emphasis);
}

.card-warning {
  background: var(--warning-subtle);
  border-color: var(--warning-emphasis);
}

.card-warning .value {
  color: var(--warning-emphasis);
}

.exec-details {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-5);
}

.exec-detail-card {
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: var(--space-6);
  background: var(--canvas-default);
}

.exec-detail-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-md);
}

.exec-row {
  display: grid;
  grid-template-columns: minmax(90px, 150px) 1fr auto;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-muted);
}

.exec-row:last-of-type {
  border-bottom: none;
}

.exec-row-label {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exec-row-value {
  font-size: var(--font-size-sm);
  color: var(--fg-muted);
  white-space: nowrap;
}

.exec-bar-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--canvas-inset);
  overflow: hidden;
}

.exec-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--brand-700);
}

.exec-bar-warning {
  background: var(--warning-emphasis);
}

.exec-bar-danger {
  background: var(--danger-emphasis);
}

.exec-alert {
  margin: var(--space-5) 0 0;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.exec-alert-danger {
  background: var(--danger-subtle);
  color: var(--danger-emphasis);
}

.exec-alert-warning {
  background: var(--warning-subtle);
  color: var(--warning-emphasis);
}
