@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');

:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #101828;
  --muted: #5f6b7a;
  --border: #d7dee8;
  --soft: #edf2f7;
  --primary: #0f5f56;
  --primary-strong: #0a443d;
  --ring: rgba(15, 95, 86, 0.16);
  --surface-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --surface-shadow-hover: 0 2px 6px rgba(16, 24, 40, 0.05);
  --sidebar-bg: #0d141d;
  --sidebar-bg-2: #111a24;
  --sidebar-text: #f8fafc;
  --sidebar-muted: #94a3b8;
  --sidebar-border: rgba(148, 163, 184, 0.12);
  --sidebar-active: rgba(255, 255, 255, 0.08);
  --sidebar-width: 200px;
  --sidebar-collapsed-width: 72px;
  --drawer-width: min(44rem, 100vw);
}

[data-theme="dark"] {
  --bg: #0b1117;
  --card: #111822;
  --text: #f8fafc;
  --muted: #9aa6b2;
  --border: #223041;
  --soft: #151d27;
  --primary: #2a8f82;
  --primary-strong: #22766c;
  --ring: rgba(42, 143, 130, 0.2);
  --surface-shadow: 0 0 0 1px rgba(148, 163, 184, 0.08);
  --surface-shadow-hover: 0 0 0 1px rgba(148, 163, 184, 0.12);
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

h1, h2, h3, h4, h5, h6, .font-serif {
  font-family: 'Manrope', sans-serif;
  letter-spacing: -0.02em;
  font-weight: 600;
}

b, strong {
  font-weight: 600;
}

.font-bold,
.font-extrabold,
.font-black {
  font-weight: 600 !important;
}

body.app-shell {
  background: var(--bg);
}

body.auth-shell {
  background: var(--bg);
}

body.auth-shell .sidebar,
body.auth-shell .app-header,
body.auth-shell .drawer {
  display: none !important;
}

body.auth-shell > .flex.min-h-screen {
  min-height: 100dvh;
}

html[data-drawer-open="true"] body {
  overflow: hidden;
}

body.app-shell > .flex.min-h-screen {
  min-height: 100dvh;
}

.app-shell__backdrop {
  display: none;
}

.panel {
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: none;
  box-shadow: none;
  border-radius: 8px;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.page-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title {
  font-size: clamp(1.55rem, 1.8vw, 1.95rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.page-lead {
  max-width: 72ch;
  font-size: 0.96rem;
  line-height: 1.6;
  color: var(--muted);
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.section-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

.detail-grid {
  display: grid;
  gap: 1rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}

.detail-actions > a,
.detail-actions > form {
  flex: 0 0 auto;
  min-width: 0;
}

.detail-actions > form {
  margin: 0;
}

.detail-actions--stretch > a,
.detail-actions--stretch > form {
  flex: 1 1 11rem;
}

.detail-actions > form > .btn-primary,
.detail-actions > form > .btn-secondary,
.detail-actions > form > .btn-ghost,
.detail-actions > form > .btn-danger {
  width: 100%;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.form-actions > a,
.form-actions > form {
  flex: 0 0 auto;
  min-width: 0;
}

.form-actions > form {
  margin: 0;
}

.form-actions > form > .btn-primary,
.form-actions > form > .btn-secondary,
.form-actions > form > .btn-ghost,
.form-actions > form > .btn-danger {
  width: 100%;
}

.detail-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-item {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--soft);
  border-radius: 8px;
  padding: 1rem 1.05rem;
}

.detail-item.border-dashed {
  border-style: dashed;
}

.empty-state {
  align-items: center;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1.25rem;
}

.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}

.empty-state__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-value {
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.list-card {
  display: block;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: none;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.list-card:hover {
  background: var(--soft);
  border-color: var(--border);
}

.list-card__title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}

.list-card__meta {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.dashboard-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}

.dashboard-metrics__primary {
  grid-column: span 1;
}

.dashboard-metrics__wide {
  grid-column: span 1;
}

.metric-card__eyebrow {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}

.metric-card__value {
  margin-top: 0.25rem;
  font-size: clamp(1.15rem, 1.2vw, 1.45rem);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.metric-card__note {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 5.95rem;
  padding: 0.82rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--soft);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.quick-action-card svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primary);
}

.quick-action-card:hover {
  background: var(--card);
}

.pending-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.82rem 0;
}

.pending-row:first-child {
  padding-top: 0;
}

.pending-row:last-child {
  padding-bottom: 0;
}

.pending-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--soft);
}

.pending-row__icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

.pending-row__icon--danger {
  color: #e46b62;
}

.pending-row__icon--info {
  color: #4f8dd6;
}

.pending-row__icon--warning {
  color: #d9852f;
}

.pending-row__title {
  font-size: 0.87rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.pending-row__description {
  margin-top: 0.15rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--muted);
}

.panel-soft {
  border: 1px solid var(--border);
  background: var(--soft);
  backdrop-filter: none;
  border-radius: 8px;
  box-shadow: none;
}

.metric-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  min-height: 7.25rem;
  padding: 0.92rem 0.82rem 0.8rem !important;
  border-top: 1px solid var(--border) !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.metric-card:hover {
  border-color: var(--border);
}

.metric-card__badge,
.stat-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--soft);
  border-radius: 8px;
  color: var(--primary);
}

.metric-card__badge--emerald {
  background: rgba(15, 95, 86, 0.08);
  border-color: rgba(15, 95, 86, 0.12);
  color: var(--primary);
}

.metric-card__badge--blue {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.metric-card__badge--orange {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.metric-card__badge--purple {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

.metric-card__badge--teal {
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

.metric-card__badge svg,
.stat-card__badge svg {
  width: 0.88rem;
  height: 0.88rem;
}

.metric-card::before {
  content: none;
}

.metric-card__top {
  align-items: flex-start;
  gap: 0.7rem;
}

.metric-card__title {
  margin: 0;
  padding: 0;
  color: var(--muted);
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 2.2rem);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  overflow: visible;
  font-size: 0.62rem;
  line-height: 1.25;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  display: block;
}

.hero-glow {
  position: relative;
}

.hero-glow::after {
  display: none;
}

.nav-item {
  display: block;
  border-radius: 0;
  padding: 0.8rem 1rem;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: rgba(15, 95, 86, 0.08);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--primary);
}

.input,
.select,
.textarea,
input[type="search"],
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="file"] {
  width: 100%;
  border-radius: 8px !important;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.3rem 0.20rem;
  font-size: 0.83rem;
  color: var(--text);
  outline: none;
  min-height: 2.03rem;
  line-height: 1.25;
  transition: border-color 0.18s ease, outline-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.input:focus,
.select:focus,
.textarea:focus,
input[type="search"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="file"]:focus {
  border-color: var(--primary-strong);
  outline: 1px solid rgba(15, 95, 86, 0.12);
  outline-offset: 0;
  background: #fff;
  box-shadow: none;
}

textarea.textarea,
textarea {
  min-height: 7rem;
  resize: vertical;
}

input[type="file"] {
  padding: 0.45rem 0.75rem;
}

input[type="file"]::file-selector-button {
  margin-right: 0.85rem;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-weight: 600;
}

.tab-link {
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.tab-link.active {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.03rem;
  padding: 0.42rem 0.82rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

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

.btn-primary,
.btn-secondary {
  min-height: 2.03rem;
}

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

.btn-secondary {
  border-color: var(--border);
  background: var(--card);
  color: var(--text);
}

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

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

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

.btn-danger {
  border-color: rgba(153, 27, 27, 0.18);
  background: rgba(153, 27, 27, 0.06);
  color: #8f1d1d;
}

.btn-danger:hover {
  background: rgba(153, 27, 27, 0.12);
}

.btn-compact {
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.btn-compact:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.34rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  width: fit-content;
}

.status-badge--success {
  background: rgba(22, 163, 74, 0.2);
  color: #15803d;
}

.status-badge--neutral {
  background: #e6eaee;
  color: #344054;
}

.status-badge--warning {
  background: rgba(199, 163, 86, 0.2);
  color: #b0893e;
}

.status-badge--info {
  border-color: #cfd8e3;
  background: #dbe4ec;
  color: #243447;
}

.rounded-3xl,
.rounded-\[2rem\],
.rounded-2xl {
  border-radius: 8px !important;
}

.rounded-xl {
  border-radius: 8px !important;
}

.rounded-full {
  border-radius: 8px !important;
}

.rounded-lg,
.rounded-md,
.rounded-sm {
  border-radius: 8px !important;
}

.input,
.select,
.textarea,
input[type="search"],
input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="file"] {
  border-radius: 8px !important;
}

.sidebar {
  border-radius: 0 !important;
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  border-top: 0 !important;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease, flex-basis 0.2s ease;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-color: var(--sidebar-border);
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
  overscroll-behavior: contain;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.34);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(16, 24, 40, 0.26);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--drawer-width);
  max-width: 100vw;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: none;
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

html[data-drawer-size="agency"] {
  --drawer-width: min(46rem, 100vw);
}

html[data-drawer-size="template"] {
  --drawer-width: min(54rem, 100vw);
}

html[data-drawer-size="template"] .drawer__body {
  overflow: hidden;
}

.drawer__nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.drawer__back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.drawer__back-button:hover,
.drawer__back-button:focus-visible {
  color: var(--primary);
}

.drawer__back-button:focus-visible {
  outline: none;
}

.drawer__back-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.1rem 1.2rem calc(1.25rem + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

html[data-drawer-open="true"] .drawer {
  pointer-events: auto;
}

html[data-drawer-open="true"] .drawer__backdrop {
  opacity: 1;
}

html[data-drawer-open="true"] .drawer__panel {
  transform: translateX(0);
}

.drawer-form-shell {
  width: 100%;
}

.agency-drawer-shell {
  display: flex;
  height: 100%;
  min-height: 100%;
}

.agency-drawer-shell--standalone {
  width: 100%;
}

.agency-drawer {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 100%;
  gap: 0;
  background: var(--card);
  color: var(--text);
}

.agency-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 0.9rem;
  border-bottom: 1px solid var(--border);
}

.agency-drawer__identity {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

.agency-drawer__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(15, 95, 86, 0.14);
  background: rgba(15, 95, 86, 0.09);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.agency-drawer__heading {
  min-width: 0;
}

.agency-drawer__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.agency-drawer__title {
  min-width: 0;
  font-size: 1.08rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.agency-drawer__subtitle {
  margin-top: 0.22rem;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--muted);
}

.agency-drawer__avatar--contract svg {
  width: 1.1rem;
  height: 1.1rem;
}

.agency-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.agency-drawer__close svg {
  width: 0.95rem;
  height: 0.95rem;
}

.agency-drawer__close:hover,
.agency-drawer__close:focus-visible {
  border-color: var(--border);
  background: var(--soft);
  color: var(--text);
  outline: none;
}

.agency-drawer__tabs {
  display: flex;
  gap: 0.9rem;
  padding-top: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.agency-drawer__tab {
  position: relative;
  padding: 0.5rem 0 0.85rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.agency-drawer__tab.is-active {
  color: var(--primary);
}

.agency-drawer__tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
}

.agency-drawer__scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: 1rem;
  padding-bottom: 0.2rem;
}

.agency-drawer__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 0.8rem;
}

.agency-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.agency-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.agency-section__header--users {
  align-items: center;
  justify-content: flex-end;
}

.agency-section__action {
  margin-left: auto;
}

.agency-section__action-icon {
  width: 0.92rem;
  height: 0.92rem;
}

.agency-section__eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.agency-section__title {
  margin-top: 0.2rem;
  font-size: 0.98rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.agency-section__summary-label {
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.agency-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.72rem;
}

.agency-info-field {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  min-width: 0;
}

.agency-info-field--wide {
  grid-column: 1 / -1;
}

.agency-info-field__label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.agency-info-field__value {
  min-width: 0;
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.32;
  word-break: break-word;
  color: var(--text);
}

.agency-summary-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 0.85rem 0.9rem 0.95rem;
}

.agency-summary-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.agency-edit-action__icon {
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
}

.agency-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  border-top: 1px solid var(--border);
}

.agency-summary-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.95rem 0.85rem 0.15rem;
  text-align: center;
}

.agency-summary-stat + .agency-summary-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.9rem;
  bottom: 0.85rem;
  width: 1px;
  background: var(--border);
}

.agency-summary-stat:first-child {
  padding-left: 0.35rem;
}

.agency-summary-stat:last-child {
  padding-right: 0.35rem;
}

.agency-summary-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 999px;
  border: 1px solid var(--soft);
  background: rgba(15, 95, 86, 0.06);
  color: var(--primary);
  margin-top: 0;
}

.agency-summary-stat__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.agency-summary-stat__value {
  font-size: clamp(1.15rem, 1.05vw, 1.45rem);
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.agency-summary-stat__label {
  font-size: 0.74rem;
  line-height: 1.2;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.agency-card-list {
  display: grid;
  gap: 0.75rem;
}

.agency-property-card,
.agency-contract-card,
.agency-user-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  border: none;
  border-radius: 8px;
  background: var(--card);
  padding: 0.4rem 0;
}

.agency-user-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.72rem;
  padding: 0.75rem 0.85rem;
}

.agency-contract-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
}

.agency-property-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem;
}

.agency-property-card__thumb,
.agency-contract-card__icon,
.agency-user-card__avatar,
.agency-history-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(15, 95, 86, 0.14);
  background: rgba(15, 95, 86, 0.09);
  color: var(--primary);
}

.agency-property-card__thumb {
  border-radius: 12px;
  background: var(--soft);
}

.agency-property-card__thumb,
.agency-user-card__avatar {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.agency-user-card__avatar {
  width: 2.3rem;
  height: 2.3rem;
}

.agency-property-card__thumb svg,
.agency-contract-card__icon svg,
.agency-user-card__avatar svg,
.agency-history-item__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.agency-property-card__body,
.agency-contract-card__body,
.agency-user-card__body {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 0.18rem;
}

.agency-property-card__body {
  cursor: pointer;
}

.agency-user-card__body {
  gap: 0.14rem;
}

.agency-contract-card__body {
  gap: 0.14rem;
}

.agency-property-card__body {
  gap: 0.14rem;
}

.agency-property-card__title-link,
.agency-contract-card__title-link,
.agency-user-card__title-link {
  display: inline-flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  text-decoration: none;
}

.agency-property-card__title-link {
  display: grid;
  gap: 0.08rem;
  width: 100%;
}

.agency-property-card__title,
.agency-contract-card__title,
.agency-user-card__title {
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.agency-contract-card__code {
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.agency-property-card__meta,
.agency-property-card__submeta,
.agency-contract-card__meta,
.agency-contract-card__period,
.agency-user-card__meta,
.agency-user-card__submeta,
.agency-history-item__description,
.agency-history-item__actor {
  font-size: 0.74rem;
  line-height: 1.3;
  color: var(--muted);
}

.agency-contract-card__meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.agency-property-card__meta,
.agency-property-card__submeta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.agency-property-card__status,
.agency-contract-card__status {
  flex: 0 0 auto;
  padding-top: 0;
  align-self: center;
}

.agency-property-card .agency-card-menu {
  align-self: center;
}

.agency-contract-card__period {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
}

.agency-contract-card__period-separator {
  color: var(--muted);
}

.agency-contract-card__period span:not(.agency-contract-card__period-separator) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.agency-user-card__topline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: wrap;
}

.agency-user-card__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 95, 86, 0.16);
  background: rgba(15, 95, 86, 0.09);
  color: var(--primary);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.24rem 0.46rem;
  white-space: nowrap;
}

.agency-user-card__submeta {
  display: flex;
  align-items: center;
  gap: 0.24rem;
}

.agency-user-card__submeta-label {
  color: var(--muted);
}

.agency-user-card__submeta-value {
  color: var(--text);
}

.agency-card-menu {
  position: relative;
  flex: 0 0 auto;
}

.agency-card-menu > summary {
  list-style: none;
}

.agency-card-menu > summary::-webkit-details-marker {
  display: none;
}

.agency-card-menu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.agency-card-menu__trigger svg {
  width: 0.95rem;
  height: 0.95rem;
}

.agency-card-menu__trigger:hover,
.agency-card-menu__trigger:focus-visible,
.agency-card-menu[open] .agency-card-menu__trigger {
  border-color: rgba(15, 95, 86, 0.24);
  background: var(--card);
  color: var(--text);
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.agency-card-menu__menu,
.agency-drawer__more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 5;
  min-width: 10rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--surface-shadow-hover);
}

.agency-drawer__more {
  position: relative;
  flex: 1 1 0;
}

.agency-drawer__more > summary {
  list-style: none;
}

.agency-drawer__more > summary::-webkit-details-marker {
  display: none;
}

.agency-drawer__more-menu {
  left: 0;
  right: 0;
  top: auto;
  bottom: calc(100% + 0.35rem);
  min-width: 13rem;
}

.agency-card-menu__menu a,
.agency-drawer__more-menu a {
  display: block;
  border-radius: 8px;
  padding: 0.58rem 0.72rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.25;
}

.agency-card-menu__menu a:hover,
.agency-card-menu__menu a:focus-visible,
.agency-drawer__more-menu a:hover,
.agency-drawer__more-menu a:focus-visible {
  background: var(--soft);
  outline: none;
}

.agency-history {
  position: relative;
  display: grid;
  gap: 0.2rem;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.agency-history::before {
  content: "";
  position: absolute;
  left: 0.84rem;
  top: 0.82rem;
  bottom: 0.72rem;
  width: 1px;
  background: var(--border);
}

.agency-history__group-label {
  margin: 0.8rem 0 0.45rem 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.agency-history-item {
  position: relative;
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 2rem) minmax(0, 1fr);
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.42rem 0;
  border-radius: 10px;
  transition: background-color 0.16s ease;
}

.agency-history-item:hover {
  background: var(--soft);
}

.agency-history-item__track {
  display: flex;
  justify-content: center;
  width: 1.25rem;
  padding-top: 0.92rem;
}

.agency-history-item__dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--card);
}

.agency-history-item__body {
  min-width: 0;
}

.agency-history-item__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.agency-history-item__icon {
  position: relative;
  z-index: 1;
  width: 2.15rem;
  height: 2.15rem;
  margin-top: 0.02rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 95, 86, 0.12);
  background: rgba(15, 95, 86, 0.08);
}

.agency-history-item__icon svg {
  width: 0.98rem;
  height: 0.98rem;
}

.agency-history-item__content {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.agency-history-item__title {
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.agency-history-item__description {
  line-height: 1.35;
}

.agency-history-item__actor {
  margin-top: 0.06rem;
  font-size: 0.73rem;
  color: var(--muted);
}

.agency-history-item__meta {
  flex: 0 0 auto;
  padding-top: 0.08rem;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.agency-drawer__footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  padding-bottom: 0.1rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--card);
}

.agency-drawer__footer--single {
  justify-content: flex-end;
}

.agency-drawer__footer-action {
  flex: 1 1 0;
  min-width: 0;
}

.agency-drawer__footer-action--single {
  flex: 0 0 auto;
}

.agency-drawer__footer-action--primary {
  flex: 1.45 1 0;
}

.agency-drawer__footer-action--secondary {
  flex: 0.72 0 0;
}

.agency-drawer__footer-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
}

.agency-drawer__footer-icon--chevron {
  width: 0.82rem;
  height: 0.82rem;
}

.agency-drawer__footer-action--secondary {
  justify-content: space-between;
}

.contract-summary-grid,
.contract-document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
}

.contract-variable-panel {
  display: grid;
  gap: 1.25rem;
}

.contract-variable-sections-overview {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 1rem;
}

.contract-variable-sections-overview__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.contract-variable-sections-overview__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.contract-variable-section-card {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 0.85rem 0.9rem;
  text-align: left;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.contract-variable-section-card:hover,
.contract-variable-section-card:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--soft));
  transform: translateY(-1px);
}

.contract-variable-section-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.contract-variable-section-card__title {
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.contract-variable-section-card__meta {
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.contract-wizard {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 1rem;
}

.contract-wizard__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.contract-wizard__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.contract-wizard__guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.contract-wizard__guide-card {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 3%, var(--soft));
  padding: 0.8rem 0.9rem;
}

.contract-wizard__guide-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.contract-wizard__guide-meta {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.contract-wizard__step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 0.85rem 0.95rem;
  text-align: left;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.contract-wizard__step:hover,
.contract-wizard__step:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--soft));
  transform: translateY(-1px);
}

.contract-wizard__step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--primary-strong);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

.contract-wizard__step-body {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.contract-wizard__step-title {
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.contract-wizard__step-meta {
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
  word-break: break-word;
}

.contract-wizard__step.is-active {
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

.contract-wizard__step.is-complete {
  border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
  background: color-mix(in srgb, var(--primary) 4%, var(--soft));
}

.contract-wizard__stage {
  scroll-margin-top: 1rem;
}

.contract-section-nav {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 0.9rem 1rem;
}

.contract-section-nav__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.contract-section-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.contract-section-nav__item {
  display: grid;
  gap: 0.1rem;
  min-width: min(13rem, 100%);
  flex: 1 1 13rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 0.8rem 0.9rem;
  text-align: left;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.contract-section-nav__item:hover,
.contract-section-nav__item:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--soft));
  transform: translateY(-1px);
}

.contract-section-nav__label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.contract-section-nav__meta {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.contract-variable-tabs {
  margin-top: -0.15rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.contract-variable-tabs::-webkit-scrollbar {
  height: 8px;
}

.contract-variable-tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
}

.contract-variable-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 0.3rem;
}

.agency-drawer__tab.is-active .contract-variable-tab-count {
  background: var(--soft);
  color: var(--primary-strong);
}

.contract-variable-tab-panels {
  display: grid;
  gap: 1rem;
}

.contract-variable-tab-panel {
  display: grid;
  gap: 1rem;
}

.contract-variable-tab-panel[hidden] {
  display: none !important;
}

.contract-variable-panel__summary,
.contract-variable-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.contract-variable-summary__item {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.contract-variable-summary__value {
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.contract-variable-callout {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 0.9rem 1rem;
}

.contract-variable-callout__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.contract-variable-callout__body {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.contract-variable-group {
  display: grid;
  gap: 0.85rem;
  scroll-margin-top: 1rem;
}

.contract-variable-grid {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contract-variable-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  align-content: start;
}

.contract-variable-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}

.contract-variable-field__label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.contract-variable-help {
  position: relative;
  flex: 0 0 auto;
}

.contract-variable-help > summary {
  list-style: none;
}

.contract-variable-help > summary::-webkit-details-marker {
  display: none;
}

.contract-variable-help__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.contract-variable-help__trigger svg {
  width: 0.95rem;
  height: 0.95rem;
}

.contract-variable-help__trigger:hover,
.contract-variable-help[open] > .contract-variable-help__trigger,
.contract-variable-help:focus-within > .contract-variable-help__trigger {
  color: var(--primary-strong);
  background: var(--soft);
  border-color: var(--border);
}

.contract-variable-help__panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 0.45rem 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: min(20rem, 72vw);
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--surface-shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.15rem);
  transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
  pointer-events: none;
}

.contract-variable-help:hover .contract-variable-help__panel,
.contract-variable-help[open] .contract-variable-help__panel,
.contract-variable-help:focus-within .contract-variable-help__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.contract-variable-help__section {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.contract-variable-help__section--full {
  grid-column: 1 / -1;
}

.contract-variable-help__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.contract-variable-help__value {
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.contract-variable-field__meta {
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
  word-break: break-word;
}

.contract-variable-field__helper {
  margin-top: 0.05rem;
}

.contract-variable-field__input {
  background: var(--card);
}

.contract-variable-field__textarea {
  min-height: 7rem;
  resize: vertical;
}

.contract-variable-field__input--currency,
.contract-variable-field__input--date,
.contract-variable-field__input--cpf,
.contract-variable-field__input--cnpj,
.contract-variable-field__input--cep,
.contract-variable-field__input--phone,
.contract-variable-field__input--rg,
.contract-variable-field__input--number {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.contract-diff-summary {
  display: grid;
  gap: 0.9rem;
}

.contract-diff-summary__row {
  display: grid;
  gap: 0.3rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
}

.contract-diff-summary__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.contract-diff-summary__values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.contract-diff-summary__old {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.78;
}

.contract-diff-summary__arrow {
  color: var(--muted);
}

.contract-diff-summary__new {
  color: var(--text);
  font-weight: 600;
}

.contract-summary-item {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.contract-summary-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.contract-summary-value {
  min-width: 0;
  font-size: 0.94rem;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

.contract-summary-value .status-badge {
  padding: 0.3rem 0.55rem;
  font-size: 0.68rem;
}

.ticket-drawer__section {
  margin-top: 1.2rem;
}

.ticket-drawer__section--data {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.ticket-drawer__section--data > .flex.justify-end.mt-5 {
  display: none !important;
}

.ticket-drawer__section-head {
  display: none !important;
}

.ticket-drawer__section--conversation {
  padding-top: 0;
  border-top: 0 !important;
}

.ticket-drawer__data-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}

.ticket-drawer__data-item {
  min-width: 0;
  display: grid;
  gap: 0.22rem;
}

.ticket-drawer__data-item--wide {
  grid-column: 1 / -1;
}

.ticket-drawer__messages {
  display: grid;
  gap: 0.75rem;
}

.ticket-message {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 0.9rem 1rem;
}

.ticket-message__topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.ticket-message__sender {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.ticket-message__meta {
  flex: 0 0 auto;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.ticket-message__body {
  margin-top: 0.45rem;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
}

.ticket-drawer__reply {
  margin-top: 1rem;
  padding-top: 0;
  border-top: 0;
}

.ticket-drawer__reply .form-field + .form-field {
  margin-top: 0.7rem;
}

.ticket-drawer__reply .btn-primary {
  margin-top: 0.95rem;
}

.drawer-form__title {
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.drawer-form__eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.drawer-form__subtitle {
  margin-top: 0.2rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}

.auth-title {
  font-size: 1.25rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.drawer-form__panel {
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.drawer-form__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}

.drawer-form__header .btn-ghost {
  align-self: flex-start;
}

.settings-page-shell {
  width: 100%;
}

.settings-page-panel {
  width: min(100%, 48rem);
  margin: 0 auto;
}

.settings-page__header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 1rem;
}

.settings-page__form {
  display: grid;
  gap: 1rem;
}

.settings-page__controls {
  display: grid;
  gap: 0.9rem;
  align-items: end;
}

.settings-page__field {
  gap: 0.3rem;
}

.settings-page__actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.settings-page__actions .btn-primary {
  min-width: 11rem;
}

.settings-page__integration {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--soft);
}

.settings-page__integration-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.settings-page__integration-eyebrow {
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.settings-page__integration-form {
  display: grid;
  gap: 0.85rem;
}

.settings-page__field--wide {
  width: 100%;
}

.settings-page__integration-actions {
  display: flex;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .settings-page__controls {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .settings-page__integration-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
}

.template-drawer {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-height: 100%;
  height: 100%;
}

.template-drawer__header {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.template-drawer__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.template-drawer__status {
  display: inline-flex;
  align-items: center;
}

.template-drawer__header-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.template-drawer__header-actions .status-badge {
  white-space: nowrap;
}

.template-drawer__top-actions {
  margin-top: 0.95rem;
  justify-content: flex-end;
}

.template-drawer__meta-grid {
  margin-top: 0.95rem;
}

.template-drawer__section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  align-items: start;
}

.template-drawer__section-grid--lists {
  align-items: start;
}

.template-drawer__card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
  padding: 0.95rem;
}

.template-drawer__card-head {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.template-drawer__card-head--row {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.template-drawer__form {
  display: grid;
  gap: 0.78rem;
}

.template-drawer__form--compact {
  gap: 0.72rem;
}

.template-drawer__inline-field .input {
  max-width: 9rem;
}

.template-drawer__check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.template-drawer__list-item {
  background: var(--card);
}

.template-drawer__list {
  display: grid;
  gap: 0.7rem;
}

.template-drawer__card--list .empty-state {
  margin-top: 0;
}

.template-drawer__hero {
  display: grid;
  gap: 0.8rem;
}

.template-drawer__tabs {
  margin-top: 0.9rem;
}

.template-drawer__tab-panels {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-color: var(--primary) var(--soft);
  scrollbar-width: thin;
  padding-right: 0.25rem;
  margin-right: -0.25rem;
}

.template-drawer__tab-panel {
  min-height: 0;
  padding-bottom: 0.25rem;
}

.template-drawer__tab-panels::-webkit-scrollbar {
  width: 10px;
}

.template-drawer__tab-panels::-webkit-scrollbar-track {
  background: var(--soft);
  border-radius: 999px;
}

.template-drawer__tab-panels::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 65%, var(--soft));
  border-radius: 999px;
  border: 2px solid var(--soft);
}

.template-drawer-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.template-drawer__meta-item {
  min-height: 6.2rem;
  padding: 0.95rem 1rem;
}

.template-drawer__summary-stack {
  display: grid;
  gap: 0.75rem;
}

.template-drawer__summary-item {
  min-height: 5rem;
  padding: 0.85rem 0.95rem;
}

@media (max-width: 1023px) {
  .template-drawer__section-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .template-drawer__inline-field .input {
    max-width: none;
  }
}

.list-filter-bar .form-field {
  gap: 0.28rem;
}

.list-filter-bar .form-label {
  font-size: 0.76rem;
  line-height: 1.05;
}

.list-filter-bar .input,
.list-filter-bar .select {
  min-height: 2.08rem;
  padding: 0.34rem 0.74rem;
  font-size: 0.88rem;
  line-height: 1;
}

.list-filter-bar .btn-primary,
.list-filter-bar .btn-secondary,
.list-filter-bar .btn-ghost,
.list-filter-bar .btn-danger,
.list-filter-bar .btn-compact,
.btn-primary--soft {
  min-height: 2.03rem;
  padding: 0.42rem 0.82rem;
  font-size: 0.82rem;
}

.list-filter-bar .agencies-search-actions {
  min-height: 2.03rem;
}

.agencies-filter-panel {
  background: var(--soft);
}

.agencies-filter-panel,
.agencies-table-panel {
  border-color: var(--soft);
}

.agencies-search-panel {
  background: var(--card);
  border-color: var(--soft);
}

.agencies-search-grid {
  display: grid;
  gap: 0.9rem;
  align-items: end;
}

.agencies-search-field {
  gap: 0.28rem;
}

.agencies-search-field .form-label {
  font-size: 0.76rem;
  line-height: 1.05;
}

.agencies-search-field .input,
.agencies-search-field .select {
  min-height: 2.08rem;
}

.agencies-search-input {
  position: relative;
  display: block;
}

.agencies-search-input svg {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  width: 1rem;
  height: 1rem;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.agencies-search-input .input {
  padding-left: 2.35rem;
}

.agencies-search-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.agencies-new-button {
  white-space: nowrap;
}

.agencies-kpis {
  display: grid;
  gap: 0.9rem;
}

.agencies-kpi-card {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-height: 7rem;
  padding: 1rem 1rem;
  border: 1px solid var(--soft);
  background: var(--card);
  border-radius: 8px;
  box-shadow: none;
}

.agencies-kpi-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--primary);
}

.agencies-kpi-card__icon svg {
  width: 1.38rem;
  height: 1.38rem;
}

.agencies-kpi-card__icon--emerald {
  background: rgba(15, 95, 86, 0.08);
  border-color: rgba(15, 95, 86, 0.12);
}

.agencies-kpi-card__icon--green {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.agencies-kpi-card__icon--red {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.agencies-kpi-card__body {
  min-width: 0;
}

.agencies-kpi-card__value {
  font-size: clamp(1.25rem, 1.2vw, 2rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.agencies-kpi-card__label {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--muted);
}

.agencies-kpi-card__note {
  margin-top: 0.16rem;
  font-size: 0.75rem;
  line-height: 1.35;
  font-weight: 600;
}

.agencies-kpi-card__note--success {
  color: #15803d;
}

.agencies-kpi-card__note--danger {
  color: #dc2626;
}

.agencies-table-panel {
  overflow-x: auto;
  overflow-y: visible;
}

.agencies-table {
  table-layout: fixed;
}

.agencies-col-agency { width: 27%; }
.agencies-col-responsible { width: 18%; }
.agencies-col-city { width: 15%; }
.agencies-col-activity { width: 17%; }
.agencies-col-status { width: 10%; }
.agencies-col-actions { width: 6%; }

.agencies-table thead th {
  white-space: nowrap;
  vertical-align: middle;
}

.agencies-table thead .table-actions-col {
  text-align: center;
}

.agencies-table tbody td {
  vertical-align: middle;
}

.table-actions-col {
  width: 4.25rem;
  text-align: center;
  vertical-align: middle;
}

.agency-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.agency-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 95, 86, 0.12);
  background: rgba(15, 95, 86, 0.08);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.agency-identity__body {
  min-width: 0;
  display: grid;
  gap: 0.16rem;
}

.agency-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.agency-subtext {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--muted);
}

.agency-activity {
  display: grid;
  gap: 0.28rem;
  max-width: 11rem;
}

.agency-activity__item {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text);
}

.agency-activity__item svg {
  width: 0.92rem;
  height: 0.92rem;
  flex: 0 0 auto;
  color: var(--muted);
}

.agency-actions {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.agency-actions__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.agency-actions__trigger svg {
  width: 0.95rem;
  height: 0.95rem;
}

.agency-actions__trigger:hover,
.agency-actions__trigger:focus-visible {
  border-color: rgba(15, 95, 86, 0.28);
  background: var(--soft);
  color: var(--text);
}

.agency-actions__trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.agency-actions.is-open .agency-actions__trigger {
  border-color: var(--primary);
  background: var(--soft);
  color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.agency-actions.is-open {
  z-index: 40;
}

.agency-actions__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.4rem);
  z-index: 60;
  min-width: 10.25rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--surface-shadow-hover);
}

.agency-actions[data-open-direction="down"] .agency-actions__menu {
  top: calc(100% + 0.4rem);
  bottom: auto;
}

.agency-actions__menu a {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.2;
}

.agency-actions__menu a:hover {
  background: var(--soft);
}

.agency-actions__menu a:focus-visible {
  outline: none;
  background: var(--soft);
  box-shadow: 0 0 0 2px var(--ring);
}

.agencies-footer {
  padding: 0 0.25rem;
  text-align: left;
}

.agencies-page .table-shell {
  overflow: visible;
  box-shadow: none;
}

@media (min-width: 768px) {
  .agencies-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .agencies-search-grid {
    grid-template-columns: minmax(0, 2.25fr) repeat(2, minmax(0, 0.95fr)) auto;
  }

  .agencies-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .agencies-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.agencies-filter .form-field {
  gap: 0.22rem;
}

.agencies-filter .form-label {
  font-size: 0.75rem;
  line-height: 1.05;
}

.agencies-filter .input,
.agencies-filter .select {
  min-height: 2.2rem;
  padding: 0.34rem 0.74rem;
  font-size: 0.88rem;
  line-height: 1;
}

.form-field,
.form-field-inline {
  display: grid;
  gap: 0.35rem;
}

.form-field {
  align-content: start;
}

.drawer-form__panel .form-field {
  gap: 0.3rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475467;
  letter-spacing: 0.015em;
}

.form-help {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: var(--text);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--primary);
}

.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-left-width: 3px;
  background: var(--card);
}

.flash__dot {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.25rem;
  border-radius: 8px;
  background: var(--border);
}

.flash__content {
  min-width: 0;
  line-height: 1.45;
}

.flash--success .flash__dot {
  background: var(--primary);
}

.flash--warning .flash__dot {
  background: #b0893e;
}

.flash--error .flash__dot {
  background: #b42318;
}

.timeline__dot {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.25rem;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--primary);
}

.section-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-subtext {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.dashboard-body {
  align-items: start;
}

.dashboard-main-column,
.dashboard-side-column {
  min-width: 0;
  width: 100%;
}

.dashboard-table-shell thead th {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.dashboard-table-shell tbody td {
  padding-top: 0.82rem;
  padding-bottom: 0.82rem;
}

.dashboard-contracts-table {
  table-layout: fixed;
  width: 100%;
}

.dashboard-contracts-col-title { width: 28%; }
.dashboard-contracts-col-property { width: 17%; }
.dashboard-contracts-col-agency { width: 18%; }
.dashboard-contracts-col-status { width: 17%; }
.dashboard-contracts-col-updated { width: 20%; }

.dashboard-contracts-table thead th,
.dashboard-contracts-table tbody td {
  white-space: nowrap;
}

.table-status-col {
  text-align: center;
  vertical-align: middle;
}

.table-status-col .status-badge {
  margin-inline: auto;
}

.template-variables-table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
}

.template-variables-table th:nth-child(1),
.template-variables-table td:nth-child(1) {
  width: 23%;
}

.template-variables-table th:nth-child(2),
.template-variables-table td:nth-child(2) {
  width: 20%;
}

.template-variables-table th:nth-child(3),
.template-variables-table td:nth-child(3) {
  width: 11%;
}

.template-variables-table th:nth-child(4),
.template-variables-table td:nth-child(4) {
  width: 15%;
}

.template-variables-table th:nth-child(5),
.template-variables-table td:nth-child(5) {
  width: 11%;
}

.template-variables-table th:nth-child(6),
.template-variables-table td:nth-child(6) {
  width: 12%;
}

.template-variables-table th:nth-child(7),
.template-variables-table td:nth-child(7) {
  width: 8%;
}

.template-variables-table-shell {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 95, 86, 0.28) transparent;
}

.template-variables-table-shell::-webkit-scrollbar {
  height: 0.45rem;
}

.template-variables-table-shell::-webkit-scrollbar-track {
  background: transparent;
}

.template-variables-table-shell::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(15, 95, 86, 0.28);
}

.template-variables-table-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 95, 86, 0.42);
}

@media (max-width: 1100px) {
  .template-variables-table {
    min-width: 0;
    table-layout: auto;
  }

  .template-variables-table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .template-variables-table-shell table,
  .template-variables-table-shell thead,
  .template-variables-table-shell tbody,
  .template-variables-table-shell tr,
  .template-variables-table-shell th,
  .template-variables-table-shell td {
    display: block;
    width: 100%;
  }

  .template-variables-table-shell thead {
    display: none;
  }

  .template-variables-table-shell tbody tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    overflow: hidden;
  }

  .template-variables-table-shell tbody td {
    display: flex;
    justify-content: space-between;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 0.72rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }

  .template-variables-table-shell tbody td:last-child {
    border-bottom: 0;
  }

  .template-variables-table-shell tbody td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .template-variables-table-shell tbody td > * {
    text-align: right;
  }

  .template-variables-table-shell tbody td[data-label="Variável"],
  .template-variables-table-shell tbody td[data-label="Rótulo"],
  .template-variables-table-shell tbody td[data-label="Origem"],
  .template-variables-table-shell tbody td[data-label="Campo vinculado"],
  .template-variables-table-shell tbody td[data-label="Seção"] {
    display: grid;
    gap: 0.25rem;
  }

  .template-variables-table-shell tbody td[data-label="Variável"]::before,
  .template-variables-table-shell tbody td[data-label="Rótulo"]::before,
  .template-variables-table-shell tbody td[data-label="Origem"]::before,
  .template-variables-table-shell tbody td[data-label="Campo vinculado"]::before,
  .template-variables-table-shell tbody td[data-label="Seção"]::before {
    flex: 1 1 auto;
    max-width: none;
  }

  .template-variables-table-shell tbody td[data-label="Variável"] > *,
  .template-variables-table-shell tbody td[data-label="Rótulo"] > *,
  .template-variables-table-shell tbody td[data-label="Origem"] > *,
  .template-variables-table-shell tbody td[data-label="Campo vinculado"] > *,
  .template-variables-table-shell tbody td[data-label="Seção"] > * {
    text-align: left;
  }
}

.table-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.table-sort-link:hover {
  color: var(--text);
}

.table-sort-link--center {
  justify-content: center;
  width: 100%;
}

.table-sort-indicator {
  font-size: 0.68rem;
  line-height: 1;
  color: var(--muted);
}

.table-sort-link[aria-sort="ascending"] .table-sort-indicator,
.table-sort-link[aria-sort="descending"] .table-sort-indicator {
  color: var(--primary);
}

.dashboard-contracts-table tbody td[data-label="Contrato"],
.dashboard-contracts-table tbody td[data-label="Imóvel"],
.dashboard-contracts-table tbody td[data-label="Imobiliária"],
.dashboard-contracts-table tbody td[data-label="Últ. alteração"] {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-contracts-status {
  text-align: center;
  vertical-align: middle;
}

.dashboard-contracts-table thead th {
  vertical-align: middle;
}

.dashboard-contracts-status__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.dashboard-contracts-status .status-badge {
  margin-inline: auto;
  min-width: 6.8rem;
  align-self: center;
}

.dashboard-table-shell tbody tr:last-child td {
  border-bottom-color: transparent;
}

.dashboard-timeline .space-y-4 {
  gap: 0;
}

.dashboard-timeline .space-y-4 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.7rem !important;
}

.dashboard-timeline .flex.gap-4.rounded-xl {
  gap: 0.9rem;
  padding: 0.95rem 1rem;
}

.dashboard-timeline .timeline__dot {
  margin-top: 0.22rem;
}

.dashboard-shortcuts-grid {
  gap: 0.75rem;
}

.dashboard-shortcuts-grid .quick-action-card {
  min-height: 6.1rem;
}

.dashboard-pending-panel {
  width: 100%;
}

.dashboard-shortcuts-panel {
  max-width: 100%;
}

.dashboard-main-column > .panel,
.dashboard-side-column > .panel {
  width: 100%;
}

@media (max-width: 767px) {
  .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-actions--stretch {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-actions > a,
  .detail-actions > form {
    width: 100%;
  }

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

  .form-actions > a,
  .form-actions > form {
    width: 100%;
  }

  .page-title {
    font-size: 1.45rem;
  }

  .detail-grid--two,
  .detail-grid--four,
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .contract-variable-panel__summary,
  .contract-variable-summary,
  .contract-variable-grid {
    grid-template-columns: 1fr;
  }

  .contract-wizard__steps {
    grid-template-columns: 1fr;
  }

  .contract-wizard__guide {
    grid-template-columns: 1fr;
  }

  .contract-variable-sections-overview__grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics__primary,
  .dashboard-metrics__wide {
    grid-column: auto;
  }

  .list-card {
    padding: 0.9rem;
  }

  .metric-card__value {
    font-size: 1.05rem;
  }

  .drawer__panel {
    width: 100vw;
    border-left: 0;
  }

  .drawer__body {
    padding: 0.8rem 0.85rem calc(0.9rem + env(safe-area-inset-bottom));
  }

  .agency-drawer-shell--standalone {
    max-width: 25rem;
    margin: 0.45rem auto;
    padding: 0 0.45rem;
  }

  .agency-drawer-shell--standalone .agency-drawer {
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--surface-shadow-hover);
    overflow: hidden;
  }

  .agency-drawer-shell--standalone .agency-drawer__header,
  .agency-drawer-shell--standalone .agency-drawer__tabs,
  .agency-drawer-shell--standalone .agency-drawer__scroll,
  .agency-drawer-shell--standalone .agency-drawer__footer {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .agency-drawer-shell--standalone .agency-drawer__identity {
    gap: 0.6rem;
  }

  .agency-drawer-shell--standalone .agency-drawer__title-row {
    flex-wrap: nowrap;
    gap: 0.32rem;
  }

  .agency-drawer-shell--standalone .agency-drawer__title {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .agency-drawer-shell--standalone .agency-drawer__subtitle {
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .agency-drawer-shell--standalone .agency-drawer__scroll {
    padding-top: 0.9rem;
  }

  .agency-property-card {
    gap: 0.55rem;
    padding: 0.72rem 0.75rem;
  }

  .agency-property-card__thumb {
    width: 2.5rem;
    height: 2.5rem;
  }

  .agency-property-card__title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .agency-property-card__meta,
  .agency-property-card__submeta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .agency-property-card .status-badge {
    padding: 0.26rem 0.48rem;
    font-size: 0.64rem;
  }

  .agency-property-card .agency-card-menu__trigger {
    width: 1.85rem;
    height: 1.85rem;
  }

  .agency-drawer__footer {
    flex-direction: column;
  }

  .agency-drawer__footer-action {
    width: 100%;
  }

  .agency-drawer__footer-action--single {
    width: auto;
  }

  .agency-info-grid {
    grid-template-columns: 1fr;
  }

  .contract-summary-grid,
  .contract-document-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .contract-variable-panel__summary {
    grid-template-columns: 1fr;
  }

  .agency-summary-stat {
    padding: 0.08rem 0;
  }

  .agency-history-item__topline {
    flex-direction: column;
  }

  .drawer-form__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .drawer-form__header .btn-ghost {
    width: auto;
  }

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

  .drawer-form__title {
    font-size: 1.15rem;
  }

  .ticket-drawer__data-grid {
    grid-template-columns: 1fr;
  }

  .ticket-message__topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger {
    width: 100%;
  }

  .btn-compact {
    width: auto;
  }

  .drawer-form__panel {
    padding: 0.95rem;
  }

  .tab-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .panel p,
  .page-lead {
    font-size: 0.92rem;
  }

  [data-drawer-size="agency"] .agency-drawer__footer,
  html[data-drawer-size="agency"] .agency-drawer__footer {
    flex-direction: row;
  }

  [data-drawer-size="agency"] .agency-drawer__footer-action,
  html[data-drawer-size="agency"] .agency-drawer__footer-action {
    width: auto;
  }

  [data-drawer-size="agency"] .agency-drawer__footer-action--primary,
  html[data-drawer-size="agency"] .agency-drawer__footer-action--primary {
    flex: 1.5 1 0;
  }

  [data-drawer-size="agency"] .agency-drawer__footer-action--secondary,
  html[data-drawer-size="agency"] .agency-drawer__footer-action--secondary {
    flex: 0.85 0 0;
  }

  .agency-drawer__avatar {
    width: 2.05rem;
    height: 2.05rem;
    font-size: 0.66rem;
  }

  .agency-drawer__title {
    font-size: 0.96rem;
  }

  .agency-drawer__subtitle {
    font-size: 0.68rem;
  }

  .agency-drawer__tabs {
    gap: 0.65rem;
  }

  .agency-drawer__tab {
    font-size: 0.68rem;
  }

  .agency-info-grid {
    gap: 0.72rem;
  }

  .agency-info-field {
    gap: 0.1rem;
  }

  .agency-info-field__label {
    font-size: 0.62rem;
    letter-spacing: 0.09em;
  }

  .agency-info-field__value {
    font-size: 0.91rem;
    line-height: 1.3;
  }

  .agency-summary-card {
    padding: 0.75rem 0.75rem 0.8rem;
    border-radius: 8px;
  }

  .agency-section__header--summary {
    gap: 0.5rem;
  }

  .agency-section__summary-label {
    font-size: 0.78rem;
  }

  .agency-summary-stats {
    border-top: 1px solid var(--border);
  }

  .agency-summary-stat {
    gap: 0.3rem;
    padding: 0.85rem 0.45rem 0.1rem;
  }

  .agency-summary-stat__icon {
    width: 2.25rem;
    height: 2.25rem;
  }

  .agency-summary-stat__value {
    font-size: 1.02rem;
  }

  .agency-summary-stat__label {
    font-size: 0.67rem;
  }

  .contract-variable-callout {
    padding: 0.8rem 0.85rem;
  }

  .contract-variable-field__head {
    gap: 0.45rem;
  }
}

@media (max-width: 1024px) {
  html[data-drawer-size="agency"] .drawer__panel {
    width: min(420px, 100vw);
  }

  html[data-drawer-size="template"] .drawer__panel {
    width: min(40rem, 100vw);
  }
}

html[data-drawer-size="agency"] .drawer__body {
  overflow: hidden;
}

html[data-drawer-size="template"] .drawer__body {
  overflow: hidden;
}

@media (min-width: 768px) and (max-width: 1279px) {
  .detail-grid--four,
  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metrics__primary,
  .dashboard-metrics__wide {
    grid-column: auto;
  }
}

@media (min-width: 1280px) {
  .dashboard-metrics {
    gap: 0.6rem;
  }
}

@media (max-width: 1279px) {
  .header-search {
    display: none;
  }
}

html[data-sidebar-collapsed="true"] {
  --sidebar-width: var(--sidebar-collapsed-width);
}

html[data-sidebar-collapsed="true"] .sidebar {
  width: var(--sidebar-collapsed-width);
  flex-basis: var(--sidebar-collapsed-width);
}

.sidebar__header,
.sidebar__footer,
.sidebar__nav {
  transition: padding 0.2s ease, gap 0.2s ease, justify-content 0.2s ease;
}

.sidebar__header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1rem;
  flex: 0 0 auto;
}

.sidebar__nav {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.55rem 0.45rem 0.35rem;
  overflow: hidden;
}

.sidebar__footer {
  flex: 0 0 auto;
  padding: 0.7rem 0.5rem 0.8rem;
}

.sidebar__section {
  display: grid;
  gap: 0.32rem;
}

.sidebar__section-label {
  padding: 0 0.7rem;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.sidebar__brand-text,
.sidebar__footer-label,
.sidebar__link-label,
.sidebar__toggle-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.18s ease, max-width 0.18s ease, margin 0.18s ease;
}

.sidebar__icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  color: currentColor;
  fill: none;
}

.sidebar__icon *,
.sidebar__toggle-icon * {
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg-2);
  color: var(--sidebar-text);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.sidebar__action {
  min-height: 2.35rem;
  width: 100%;
}

.sidebar__toggle:hover {
  background: var(--sidebar-active);
}

.sidebar__toggle-icon--expand {
  display: none;
}

.sidebar__toggle[data-state="collapsed"] .sidebar__toggle-icon--collapse {
  display: none;
}

.sidebar__toggle[data-state="collapsed"] .sidebar__toggle-icon--expand {
  display: inline-flex;
}

.sidebar__nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.54rem 0.7rem;
  color: var(--sidebar-muted);
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 0.82rem;
  line-height: 1.15;
  min-width: 0;
}

.sidebar__nav-item:hover,
.sidebar__nav-item.active {
  background: rgba(19, 105, 70, 0.78);
  color: var(--sidebar-text);
  border-color: rgba(45, 160, 123, 0.16);
  box-shadow: inset 2px 0 0 #2ea07d;
}

.sidebar__nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(148, 163, 184, 0.08);
}

.sidebar__nav-item.active:hover {
  background: rgba(19, 105, 70, 0.82);
  border-color: rgba(45, 160, 123, 0.2);
}

html[data-sidebar-collapsed="true"] .sidebar__header {
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0.6rem;
}

html[data-sidebar-collapsed="true"] .sidebar__brand-text,
html[data-sidebar-collapsed="true"] .sidebar__footer-label,
html[data-sidebar-collapsed="true"] .sidebar__link-label,
html[data-sidebar-collapsed="true"] .sidebar__toggle-label {
  max-width: 0;
  opacity: 0;
  margin: 0;
}

html[data-sidebar-collapsed="true"] .sidebar__user-meta {
  max-width: 0;
  opacity: 0;
  margin: 0;
  overflow: hidden;
}

html[data-sidebar-collapsed="true"] .sidebar__nav {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  overflow: hidden;
}

html[data-sidebar-collapsed="true"] .sidebar__section-label {
  max-width: 0;
  padding: 0;
  opacity: 0;
  overflow: hidden;
}

html[data-sidebar-collapsed="true"] .sidebar__nav-item {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}

html[data-sidebar-collapsed="true"] .sidebar__nav-item .sidebar__link-label {
  max-width: 0;
}

html[data-sidebar-collapsed="true"] .sidebar__footer {
  padding: 0.65rem 0.45rem 0.75rem;
}

html[data-sidebar-collapsed="true"] .sidebar__footer-actions {
  grid-template-columns: 1fr;
}

html[data-sidebar-collapsed="true"] .sidebar__toggle {
  justify-content: center;
  gap: 0;
}

html[data-sidebar-collapsed="true"] .sidebar__user {
  justify-content: center;
  gap: 0;
}

.sidebar__footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.sidebar__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 2.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.16);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
  font-size: 0.82rem;
  font-weight: 600;
}

.sidebar__logout:hover {
  background: rgba(248, 113, 113, 0.14);
}

html[data-sidebar-collapsed="true"] .sidebar__logout {
  justify-content: center;
}

.sidebar__brand-mark {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(248, 250, 252, 0.12);
  color: #f8fafc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
}

.sidebar__brand-mark span {
  display: block;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-0.03rem);
  color: #fff;
}

.sidebar__brand-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--sidebar-text);
}

.sidebar__brand-subtitle {
  margin-top: 0.1rem;
  font-size: 0.68rem;
  line-height: 1.1;
  color: var(--sidebar-muted);
}

.sidebar__footer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg-2);
  border-radius: 8px;
}

.sidebar__user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: rgba(15, 95, 86, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

.sidebar__user-meta {
  min-width: 0;
}

.sidebar__user-name {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--sidebar-text);
}

.sidebar__user-role {
  margin-top: 0.15rem;
  font-size: 0.62rem;
  color: var(--sidebar-muted);
}

.app-header {
  flex: 0 0 auto;
  min-height: 4.5rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  backdrop-filter: none;
  background: var(--card);
  box-shadow: none;
}

.app-header .header-row {
  min-height: 4.5rem;
}

.app-header .header-row > .min-w-0.flex-1 {
  min-width: 0;
}

.app-header .header-row > .min-w-0.flex-1 > div:first-child {
  display: flex;
  align-items: center;
  min-height: 1.7rem;
  line-height: 1;
}

.header-search {
  min-width: 0;
}

.header-search__field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid var(--border);
  background: var(--soft);
  padding: 0.15rem 0.8rem;
  border-radius: 8px;
}

.header-search__field input[type="search"] {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 1.8rem;
  font-size: 0.88rem;
}

.header-search__field input[type="search"]:focus {
  outline: none;
  box-shadow: none;
}

.header-search__icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: var(--muted);
}

.header-actions {
  flex: 0 0 auto;
}

.header-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  min-width: 2.5rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.header-action:hover {
  background: var(--soft);
}

.header-action__icon {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
}

.header-action__badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 999px;
  background: var(--primary);
  border: 1px solid var(--card);
}

.header-action--icon {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

.app-header > input[type="search"] {
  min-height: 2rem;
  padding: 0.32rem 0.72rem;
  font-size: 0.86rem;
}

main > .mx-auto {
  min-height: 0;
}

main {
  min-height: 0;
}

.shadow-soft,
.shadow,
.shadow-sm,
.shadow-md,
.shadow-lg,
.shadow-xl,
.shadow-2xl {
  box-shadow: none !important;
}

.panel table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.panel table thead th {
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel table tbody tr {
  transition: background-color 0.18s ease;
}

.panel table tbody tr:hover {
  background: rgba(15, 95, 86, 0.035);
}

.panel table td,
.panel table th {
  border-bottom: 1px solid var(--border);
}

.panel table tbody tr:last-child td {
  border-bottom-color: transparent;
}

.table-shell table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-shell thead th {
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-shell tbody tr {
  transition: background-color 0.18s ease;
}

.table-shell tbody tr:hover {
  background: rgba(15, 95, 86, 0.035);
}

.table-shell tbody td,
.table-shell thead th {
  border-bottom: 1px solid var(--border);
}

.table-shell tbody tr:last-child td {
  border-bottom-color: transparent;
}

.table-shell {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
  .table-shell.table-cards-mobile {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-shell.table-cards-mobile table,
  .table-shell.table-cards-mobile thead,
  .table-shell.table-cards-mobile tbody,
  .table-shell.table-cards-mobile tr,
  .table-shell.table-cards-mobile th,
  .table-shell.table-cards-mobile td {
    display: block;
    width: 100%;
  }

  .table-shell.table-cards-mobile thead {
    display: none;
  }

  .table-shell.table-cards-mobile tbody tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    overflow: hidden;
  }

  .table-shell.table-cards-mobile tbody td {
    display: flex;
    justify-content: space-between;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }

  .table-shell.table-cards-mobile tbody td:last-child {
    border-bottom: 0;
  }

  .table-shell.table-cards-mobile tbody td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    max-width: 42%;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .table-shell.table-cards-mobile tbody td > * {
    text-align: right;
  }

  .table-shell.table-cards-mobile tbody td[data-label="Imóvel"],
  .table-shell.table-cards-mobile tbody td[data-label="Imobiliária"],
  .table-shell.table-cards-mobile tbody td[data-label="Contrato"],
  .table-shell.table-cards-mobile tbody td[data-label="Assunto"],
  .table-shell.table-cards-mobile tbody td[data-label="Modelo"],
  .table-shell.table-cards-mobile tbody td[data-label="Nome"],
  .table-shell.table-cards-mobile tbody td[data-label="E-mail"],
  .table-shell.table-cards-mobile tbody td[data-label="Perfil"] {
    display: grid;
    gap: 0.25rem;
  }

  .table-shell.table-cards-mobile tbody td[data-label="Imóvel"]::before,
  .table-shell.table-cards-mobile tbody td[data-label="Imobiliária"]::before,
  .table-shell.table-cards-mobile tbody td[data-label="Contrato"]::before,
  .table-shell.table-cards-mobile tbody td[data-label="Assunto"]::before,
  .table-shell.table-cards-mobile tbody td[data-label="Modelo"]::before,
  .table-shell.table-cards-mobile tbody td[data-label="Nome"]::before,
  .table-shell.table-cards-mobile tbody td[data-label="E-mail"]::before,
  .table-shell.table-cards-mobile tbody td[data-label="Perfil"]::before {
    flex: 1 1 auto;
    max-width: none;
  }

  .table-shell.table-cards-mobile tbody td[data-label="Imóvel"] > *,
  .table-shell.table-cards-mobile tbody td[data-label="Imobiliária"] > *,
  .table-shell.table-cards-mobile tbody td[data-label="Contrato"] > *,
  .table-shell.table-cards-mobile tbody td[data-label="Assunto"] > *,
  .table-shell.table-cards-mobile tbody td[data-label="Modelo"] > *,
  .table-shell.table-cards-mobile tbody td[data-label="Nome"] > *,
  .table-shell.table-cards-mobile tbody td[data-label="E-mail"] > *,
  .table-shell.table-cards-mobile tbody td[data-label="Perfil"] > * {
    text-align: left;
  }
}

.flash {
  border-left-width: 3px;
}

.flash--success {
  border-left-color: var(--primary-strong);
}

.flash--warning {
  border-left-color: #b0893e;
}

.flash--error {
  border-left-color: #b42318;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.bg-emerald-600 {
  background-color: var(--primary) !important;
}

.bg-emerald-700 {
  background-color: var(--primary-strong) !important;
}

.text-emerald-600,
.hover\:text-emerald-600:hover {
  color: var(--primary) !important;
}

.text-emerald-700 {
  color: var(--primary-strong) !important;
}

.text-emerald-900 {
  color: var(--text) !important;
}

.border-emerald-200,
.border-emerald-300 {
  border-color: var(--border) !important;
}

.bg-emerald-50,
.bg-emerald-100 {
  background-color: var(--soft) !important;
}

.focus\:border-emerald-500:focus {
  border-color: var(--primary) !important;
}

.ring-emerald-500 {
  --tw-ring-color: var(--ring) !important;
}

[data-density="compact"] .density-space { gap: 0.5rem; }
[data-density="comfortable"] .density-space { gap: 0.75rem; }
[data-density="expanded"] .density-space { gap: 1rem; }
