:root {
  color-scheme: light;
  --bg: #f8f7f3;
  --surface: #ffffff;
  --surface-2: #f2eee8;
  --ink: #181a20;
  --muted: #717171;
  --line: #e4ded6;
  --line-strong: #d3cbc2;
  --brand: #e4013a;
  --brand-strong: #b8002f;
  --accent: #264d3d;
  --warn: #b7791f;
  --danger: #dc3545;
  --ok: #264d3d;
  --sidebar: #e4013a;
  --sidebar-soft: rgba(255, 255, 255, 0.14);
  --shadow: 0 16px 36px rgba(24, 26, 32, 0.12);
  --radius: 8px;
  --topbar-height: 76px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: 0 0 276px;
  flex-direction: column;
  height: 100vh;
  padding: 18px 14px;
  color: #f6faf9;
  background: var(--sidebar);
  border-right: 1px solid rgba(184, 0, 47, 0.35);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 20px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--brand);
  background: #ffffff;
  border-radius: 7px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand span,
.sidebar-footer {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section + .nav-section {
  margin-top: 18px;
}

.nav-section-title {
  display: block;
  padding: 8px 10px 4px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  text-align: left;
}

.nav-button svg,
button svg,
.search-field svg,
.inline-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}

.nav-button:hover,
.nav-button.active {
  color: #ffffff;
  background: var(--sidebar-soft);
}

.nav-button.active {
  color: var(--brand);
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 8px 20px rgba(184, 0, 47, 0.2);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.main-area {
  min-width: 0;
  flex: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: auto minmax(190px, 1fr) minmax(240px, 430px) auto;
  align-items: center;
  gap: 18px;
  height: var(--topbar-height);
  padding: 0 clamp(16px, 3vw, 34px);
  background: rgba(248, 247, 243, 0.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.tenant-mode {
  background: #ffffff;
}

.tenant-mode .app-shell {
  background: #ffffff;
}

.tenant-mode .sidebar {
  flex-basis: 188px;
  height: calc(100vh - 16px);
  margin: 8px 0 8px 12px;
  padding: 8px 10px;
  border-radius: 4px;
  border-right: 0;
  box-shadow: 0 3px 10px rgba(184, 0, 47, 0.12);
}

.tenant-mode .brand {
  display: grid;
  gap: 8px;
  padding: 8px 4px 24px;
}

.tenant-mode .brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 4px;
}

.tenant-mode .brand strong,
.tenant-mode .brand span {
  display: none;
}

.tenant-mode .nav-list {
  gap: 6px;
}

.tenant-mode .nav-button {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 0.95rem;
  font-weight: 700;
}

.tenant-mode .nav-button svg {
  width: 16px;
  height: 16px;
}

.tenant-mode .sidebar-footer {
  justify-items: end;
  padding-inline: 4px;
}

.tenant-mode .sidebar-footer > div {
  display: none;
}

.tenant-mode .sidebar-footer .ghost-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: #ffffff;
  background: transparent;
  border-color: transparent;
  font-size: 0;
}

.tenant-mode .sidebar-footer .ghost-button svg {
  width: 20px;
  height: 20px;
}

.tenant-mode .main-area {
  background: #ffffff;
}

.tenant-mode .topbar {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  height: 104px;
  padding: 24px 28px 0;
  background: #ffffff;
  border-bottom: 0;
  backdrop-filter: none;
}

.tenant-mode .menu-button,
.tenant-mode .search-field {
  display: none;
}

.tenant-mode .topbar-title .eyebrow {
  display: none;
}

.tenant-mode .topbar-title h1 {
  margin: 0;
  color: var(--brand);
  font-size: 2.05rem;
  font-weight: 850;
  line-height: 1.1;
}

.tenant-mode .user-chip {
  min-width: 126px;
  justify-content: flex-end;
  padding: 0;
  background: transparent;
  border: 0;
}

.tenant-mode .user-chip .status-dot {
  display: none;
}

.tenant-mode .user-chip strong {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.tenant-mode .user-chip small {
  color: var(--ink);
  text-align: right;
  font-size: 0.82rem;
}

.tenant-mode .logout-button {
  width: auto;
  min-width: 72px;
  padding: 0 10px;
  color: var(--brand);
  background: #ffffff;
  border-color: var(--brand);
  font-weight: 800;
  gap: 6px;
}

.tenant-mode .logout-button:hover {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.tenant-mode .content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 34px 24px 44px 24px;
  background: #ffffff;
}

.menu-button {
  display: none;
}

.topbar-title h1 {
  margin: 3px 0 0;
  font-size: clamp(1.1rem, 1.5vw, 1.55rem);
  line-height: 1.15;
  letter-spacing: 0;
}

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

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 196px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-chip strong,
.user-chip small {
  display: block;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 0.86rem;
}

.user-chip small {
  color: var(--muted);
  font-size: 0.76rem;
}

.logout-button {
  width: auto;
  min-width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0 8px;
  color: var(--brand);
  background: var(--surface-2);
  border-color: var(--line);
  gap: 6px;
}

.logout-label {
  line-height: 1;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(38, 77, 61, 0.13);
}

.content {
  width: min(100%, 1520px);
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 34px) 44px;
}

body.auth-mode .sidebar,
body.auth-mode .topbar {
  display: none;
}

body.auth-mode .app-shell {
  display: block;
}

body.auth-mode .main-area {
  min-height: 100vh;
}

body.auth-mode .content {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.72fr);
  background: var(--bg);
}

.login-art {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 100vh;
  gap: 36px;
  padding: clamp(28px, 6vw, 76px);
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(228, 1, 58, 0.22), transparent 36%),
    #181a20;
}

.login-art::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

.login-art > * {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 900;
}

.login-brand strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.login-copy {
  max-width: 720px;
}

.login-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 620px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  line-height: 1.6;
}

.login-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.login-flow span {
  display: grid;
  min-height: 82px;
  align-content: space-between;
  padding: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 4px solid var(--stage-color);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  animation: loginStepIn 520ms ease both;
  animation-delay: var(--delay);
}

.login-flow i {
  color: rgba(255, 255, 255, 0.56);
  font-style: normal;
  font-size: 0.72rem;
}

.login-card {
  display: grid;
  align-self: center;
  width: min(430px, calc(100% - 40px));
  gap: 15px;
  margin: 40px auto;
  padding: clamp(24px, 5vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0;
}

.login-card p {
  margin: -6px 0 4px;
  color: var(--muted);
  line-height: 1.55;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

.login-remember {
  margin-top: -2px;
}

.password-input-wrap {
  position: relative;
  display: grid;
  width: 100%;
}

.password-input-wrap input {
  padding-right: 54px;
}

.password-toggle {
  position: absolute;
  top: 3px;
  right: 4px;
  bottom: 3px;
  display: grid;
  width: 42px;
  min-height: 0;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: #fff;
  border: 1px solid transparent;
  border-radius: 6px;
  z-index: 2;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--brand);
  background: rgba(228, 1, 58, 0.08);
  border-color: rgba(228, 1, 58, 0.16);
  outline: 0;
}

.password-toggle svg,
.password-toggle-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.link-button {
  justify-self: center;
  padding: 4px;
  color: var(--brand);
  background: transparent;
  border: 0;
  font-size: 0.86rem;
  font-weight: 800;
}

.login-note {
  padding: 12px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
}

@keyframes loginStepIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-stack {
  display: grid;
  gap: 18px;
}

.view-stack > *,
.split-grid > *,
.settings-grid > *,
.metric-grid > * {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.section-head p {
  max-width: 760px;
  margin: 4px 0 0;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.master-profile-create .button {
  flex: 0 0 auto;
}

.metric-grid {
  display: grid;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.metric-card,
.panel,
.table-panel,
.kanban-column,
.drawer,
.modal-card,
.timeline-card,
.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(24, 35, 34, 0.03);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 124px;
  padding: 16px;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.metric-card strong {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.4;
}

.metric-trend {
  width: fit-content;
  padding: 4px 7px;
  color: var(--accent);
  background: rgba(38, 77, 61, 0.11);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.metric-trend.warn {
  color: var(--warn);
  background: rgba(183, 121, 31, 0.12);
}

.metric-trend.danger {
  color: var(--danger);
  background: rgba(184, 50, 43, 0.1);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.zama-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) minmax(320px, 1.35fr);
  gap: 12px;
}

.distribution-card,
.calendar-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(24, 35, 34, 0.03);
}

.distribution-card h3,
.calendar-card h3 {
  margin: 0;
  font-size: 0.98rem;
}

.distribution-card p,
.calendar-card p {
  margin: 3px 0 0;
  color: var(--muted);
}

.distribution-list {
  display: grid;
  gap: 7px;
}

.distribution-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.distribution-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 750;
}

.calendar-modes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.calendar-modes span {
  padding: 4px 8px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar-grid strong,
.calendar-grid span {
  display: grid;
  min-height: 30px;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.calendar-grid strong {
  color: var(--muted);
}

.calendar-grid span {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.calendar-grid span.muted {
  color: var(--muted);
  opacity: 0.45;
}

.calendar-grid span.current {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.original-screen {
  align-items: start;
}

.original-screen .module-heading {
  margin: 0 0 32px;
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1.2;
}

.original-dashboard-screen {
  max-width: 1320px;
}

.original-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: min-content;
  gap: 10px;
  align-items: start;
}

.original-dashboard-reference {
  display: grid;
  align-items: start;
  min-height: 282px;
  padding: 8px 12px;
  background: #fffafd;
  border-radius: 5px;
}

.original-chart-card,
.original-calendar-card {
  display: grid;
  align-content: start;
  min-width: 0;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-radius: 5px;
  box-shadow: 2px 2px 4px rgba(24, 26, 32, 0.13);
}

.original-chart-card {
  min-height: 372px;
}

.original-chart-card.wide {
  width: min(500px, 100%);
  min-height: 265px;
}

.original-chart-card.tall {
  min-height: 414px;
}

.original-chart-card.extra-tall {
  min-height: 462px;
}

.original-chart-card.medium {
  min-height: 374px;
}

.original-chart-card h3,
.original-calendar-card h3 {
  margin: 0 0 18px;
  color: var(--brand);
  font-size: 1.18rem;
  font-weight: 500;
}

.original-chart-card p {
  margin: 0;
  font-size: 0.93rem;
}

.original-card-subtitle {
  margin: 0 0 8px 2px;
  font-size: 0.9rem;
  font-weight: 500;
}

.original-chart-blank {
  min-height: 220px;
}

.original-pie-wrap {
  display: grid;
  min-height: 245px;
  place-items: center;
  margin-top: 4px;
}

.original-pie-chart {
  position: relative;
  width: clamp(176px, 76%, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.88);
}

.original-pie-chart.donut::after {
  position: absolute;
  inset: 54px;
  content: "";
  background: #ffffff;
  border-radius: 50%;
}

.original-pie-chart.solid::after {
  display: none;
}

.original-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-top: auto;
  font-size: 0.9rem;
}

.original-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.original-legend i {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.original-bar-svg {
  width: 100%;
  height: 292px;
  margin-top: 4px;
  overflow: visible;
}

.bar-grid-line {
  stroke: #d9d9d9;
  stroke-width: 1;
}

.bar-axis {
  stroke: #c8c8c8;
  stroke-width: 1;
}

.bar-axis-label,
.bar-x-label {
  fill: #111111;
  font-size: 12px;
  font-weight: 500;
}

.original-bar {
  fill: #7bb7d1;
  stroke: #2b91ca;
  stroke-width: 2;
}

.original-calendar-card {
  grid-column: auto;
  width: auto;
  min-height: 506px;
}

.original-calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.original-calendar-toolbar .button {
  min-height: 35px;
  background: #6f8195;
  border-color: #6f8195;
}

.original-calendar-toolbar strong {
  margin-left: 2px;
  font-size: 1.05rem;
  font-weight: 500;
}

.original-calendar-nav {
  display: inline-grid;
  width: 42px;
  height: 35px;
  place-items: center;
  color: #ffffff;
  background: #294968;
  border: 0;
  border-radius: 5px;
}

.original-calendar-nav svg {
  width: 18px;
  height: 18px;
}

.original-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid #d8d8d8;
  border-left: 1px solid #d8d8d8;
}

.original-calendar-grid strong,
.original-calendar-grid span {
  display: grid;
  min-height: 53px;
  place-items: start center;
  padding-top: 6px;
  border-right: 1px solid #d8d8d8;
  border-bottom: 1px solid #d8d8d8;
  font-size: 0.83rem;
  font-weight: 500;
}

.original-calendar-grid strong {
  min-height: 24px;
  padding-top: 3px;
  color: #111111;
}

.original-calendar-grid span.current {
  color: #111111;
  background: #ffecef;
}

.original-calendar-grid span.muted {
  color: #b8b8b8;
}

.panel,
.table-panel,
.settings-card {
  padding: 18px;
}

.panel h3,
.settings-card h3,
.timeline-card h3 {
  margin: 0 0 14px;
  font-size: 0.98rem;
}

.stage-bars {
  display: grid;
  gap: 12px;
}

.stage-row {
  display: grid;
  grid-template-columns: 132px minmax(120px, 1fr) 36px;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 99px;
}

.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
}

.split-grid {
  display: grid;
  max-width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.queue-list,
.activity-list,
.compact-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-item,
.activity-item,
.compact-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 7px;
}

.queue-item strong,
.activity-item strong,
.compact-item strong {
  font-size: 0.9rem;
}

.queue-item small,
.activity-item small,
.compact-item small {
  color: var(--muted);
}

.status-pill,
.tag,
.stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.ok,
.tag.ok {
  color: var(--ok);
  background: rgba(36, 115, 68, 0.11);
}

.status-pill.warn,
.tag.warn {
  color: var(--warn);
  background: rgba(183, 121, 31, 0.13);
}

.status-pill.danger,
.tag.danger {
  color: var(--danger);
  background: rgba(184, 50, 43, 0.11);
}

.status-pill.neutral,
.tag.neutral,
.stage-pill {
  color: var(--accent);
  background: rgba(49, 87, 164, 0.1);
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.original-screen {
  gap: 0;
}

.module-heading {
  margin: 0;
  margin-bottom: 38px;
  color: #111111;
  font-size: 1.34rem;
  font-weight: 800;
  line-height: 1.2;
}

.clone-actions-row {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(220px, 280px);
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  width: 100%;
  margin-bottom: 24px;
}

.clone-actions-row .zama-add-button {
  width: 100%;
}

.clone-filter {
  min-height: 50px;
  min-width: 0;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.clone-filter label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.control.clone-filter select {
  min-height: 24px;
  padding: 0 28px 0 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  font-size: 1rem;
}

.clone-filter-stack {
  display: grid;
  gap: 8px;
}

.proposal-actions-row,
.client-actions-row {
  margin-bottom: 10px;
}

.proposal-filter-panel,
.client-filter-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.proposal-filter-panel p,
.client-filter-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.proposal-filter-grid,
.client-filter-grid {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) repeat(4, minmax(145px, 1fr)) auto;
  align-items: end;
  gap: 8px;
}

.client-filter-grid {
  grid-template-columns: minmax(210px, 1.35fr) repeat(3, minmax(145px, 1fr)) auto;
}

.proposal-filter-grid .control,
.client-filter-grid .control {
  min-width: 0;
}

.proposal-filter-grid input,
.proposal-filter-grid select,
.client-filter-grid input,
.client-filter-grid select {
  min-height: 36px;
  background: #ffffff;
}

.proposal-clear-button,
.client-clear-button {
  min-height: 36px;
  padding-inline: 13px;
}

.clone-table-panel {
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(24, 26, 32, 0.16);
}

.clone-table-panel th,
.clone-table-panel td {
  padding: 6px 8px;
  color: #111111;
  border: 1px solid #dddddd;
  font-size: 0.96rem;
  line-height: 1.2;
  vertical-align: top;
}

.clone-table-panel th {
  color: #5e5e5e;
  background: #fff0f3;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.clone-table-panel tr:hover td {
  background: #ffffff;
}

.clone-table-panel .actions {
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: nowrap;
}

.clone-table-panel th:last-child,
.clone-table-panel td:last-child {
  min-width: 190px;
}

.clone-table-panel .icon-button {
  width: 28px;
  min-height: 28px;
  color: var(--brand);
  background: transparent;
  border-color: transparent;
}

.clone-table-panel .icon-button svg {
  width: 19px;
  height: 19px;
}

.clone-table-panel .danger-icon,
.danger-icon {
  color: var(--danger);
}

.property-table {
  table-layout: fixed;
  width: 100%;
  min-width: 1740px;
}

.property-table .property-code-col {
  width: 86px;
}

.property-table .property-owner-col {
  width: 150px;
}

.property-table .property-address-col {
  width: 620px;
}

.property-table .property-condo-col {
  width: 230px;
}

.property-table .property-status-col,
.property-table .property-purpose-col {
  width: 125px;
}

.property-table .property-open-col {
  width: 90px;
}

.property-table .property-count-col {
  width: 102px;
}

.property-table .property-actions-col {
  width: 118px;
}

.property-table th,
.property-table td {
  overflow-wrap: break-word;
  text-align: left;
  vertical-align: middle;
  word-break: normal;
}

.property-table .property-code-cell,
.property-table .property-status-cell,
.property-table .property-purpose-cell,
.property-table .property-open-cell,
.property-table .property-count-cell,
.property-table .property-address-cell,
.property-table .property-condo-cell {
  white-space: nowrap;
}

.property-table .property-code-cell,
.property-table .property-count-cell {
  font-variant-numeric: tabular-nums;
}

.property-table .property-address-cell span,
.property-table .property-address-cell small {
  display: inline;
  color: inherit;
  font: inherit;
}

.property-table .property-address-cell {
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-table .property-address-cell small {
  margin: 0;
}

.property-table .property-address-cell small::before {
  content: " - ";
}

.property-table .property-condo-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

.property-table .property-owner-cell,
.property-table .property-address-cell {
  overflow-wrap: anywhere;
}

.clone-table-panel .property-table th:last-child,
.clone-table-panel .property-table td:last-child {
  width: 118px;
  min-width: 118px;
  text-align: left;
  vertical-align: middle;
}

.property-table .actions {
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
}

.property-table .table-actions-heading {
  padding: 9px 8px;
  text-align: left;
}

.property-table .property-actions-cell .actions {
  width: 100%;
}

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

.proposal-table th,
.proposal-table td {
  overflow-wrap: anywhere;
}

.proposal-table th:nth-child(1),
.proposal-table td:nth-child(1) {
  width: 8%;
}

.proposal-table th:nth-child(2),
.proposal-table td:nth-child(2) {
  width: 13%;
}

.proposal-table th:nth-child(3),
.proposal-table td:nth-child(3) {
  width: 8%;
}

.proposal-table th:nth-child(4),
.proposal-table td:nth-child(4) {
  width: 10%;
}

.proposal-table th:nth-child(5),
.proposal-table td:nth-child(5) {
  width: 14%;
}

.proposal-table th:nth-child(6),
.proposal-table td:nth-child(6) {
  width: 9%;
}

.proposal-table th:nth-child(7),
.proposal-table td:nth-child(7) {
  width: 15%;
}

.proposal-table th:nth-child(8),
.proposal-table td:nth-child(8) {
  width: 11%;
}

.proposal-table th:nth-child(9),
.proposal-table td:nth-child(9) {
  width: 12%;
  min-width: 112px;
}

.proposal-table .actions {
  gap: 2px;
  flex-wrap: wrap;
}

.proposal-table .table-column-filter input {
  min-width: 0;
  padding-inline: 6px;
}

.link-create-screen {
  max-width: 1120px;
}

.bubble-link-create-screen {
  max-width: 1060px;
}

.link-create-title-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 28px;
}

.link-create-title-row .module-heading {
  margin-bottom: 6px;
}

.link-create-title-row p {
  margin: 0;
  color: var(--muted);
}

.link-create-panel {
  padding: 16px;
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 3px;
}

.bubble-link-create-screen .link-create-panel {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.link-create-form {
  display: grid;
  gap: 12px;
}

.bubble-link-create-screen .link-create-form {
  gap: 8px;
}

.link-create-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.65fr);
  gap: 10px;
  justify-content: end;
  margin-left: auto;
  max-width: 620px;
}

.bubble-link-create-screen .link-create-toolbar {
  grid-template-columns: 232px 232px;
  gap: 2px;
  max-width: 466px;
  margin-bottom: 14px;
}

.link-create-toolbar .control {
  min-width: 0;
}

.bubble-link-create-screen .link-create-toolbar label {
  display: block;
  min-width: 0;
}

.bubble-link-create-screen .link-create-toolbar span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.bubble-link-create-screen .module-heading {
  margin: 10px 0 46px;
  color: #737373;
  font-size: 1.75rem;
  font-weight: 750;
}

.link-create-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.link-create-identification {
  grid-template-columns: minmax(120px, 0.8fr) minmax(260px, 2.4fr) minmax(150px, 0.9fr) minmax(260px, 2.4fr);
}

.bubble-link-create-screen .link-create-identification {
  max-width: 850px;
  grid-template-columns: 92px 140px 70px minmax(360px, 1fr);
  gap: 7px 12px;
  align-items: center;
}

.bubble-link-create-screen .link-create-identification .field {
  display: contents;
}

.bubble-link-create-screen .link-create-identification .field label {
  justify-self: end;
  align-self: center;
  margin: 0;
  white-space: nowrap;
}

.link-create-identification .compact-field {
  min-width: 0;
}

.link-create-identification .wide-field {
  min-width: 0;
}

.link-create-identification .wide-field:last-child {
  grid-column: span 3;
}

.bubble-link-create-screen .link-create-identification .wide-field:last-child {
  grid-column: auto;
}

.bubble-link-create-screen .link-create-checklist {
  max-width: 850px;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 8px 8px;
  margin-top: 8px;
}

.link-create-checklist .field {
  min-width: 0;
}

.bubble-link-create-screen .link-create-checklist .field {
  display: grid;
  gap: 2px;
}

.link-create-form .field label,
.link-create-form .control span {
  color: #777777;
  font-size: 0.82rem;
  font-weight: 500;
  text-transform: none;
}

.bubble-link-create-screen .link-create-form .field label {
  color: #6d6d6d;
  font-size: 0.94rem;
  font-weight: 500;
}

.link-create-form input,
.link-create-form select,
.link-create-form textarea {
  min-height: 34px;
  background: #ffffff;
  border: 1px solid #dedede;
  border-radius: 2px;
  font-size: 0.96rem;
}

.bubble-link-create-screen .link-create-form input,
.bubble-link-create-screen .link-create-form select,
.bubble-link-create-screen .link-create-form textarea {
  min-height: 30px;
  padding: 4px 8px;
  color: #555555;
  border-color: #d8d8d8;
  border-radius: 1px;
  box-shadow: inset 0 0 0 2px rgba(20, 20, 20, 0.03);
  font-size: 0.9rem;
}

.bubble-link-create-screen .link-create-toolbar select {
  width: 100%;
  min-height: 40px;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(24, 26, 32, 0.12);
  opacity: 1;
}

.link-create-form input[readonly],
.link-create-form .readonly-money {
  color: #545454;
  background: #f7f4f2;
}

.money-field {
  position: relative;
}

.money-field span {
  position: absolute;
  bottom: 8px;
  left: 10px;
  color: #777777;
  font-weight: 700;
  pointer-events: none;
}

.money-field input {
  padding-left: 36px;
  text-align: right;
}

.bubble-link-create-screen .money-field span {
  bottom: 4px;
  left: 8px;
  padding: 5px 7px;
  background: #eeeeee;
  font-weight: 500;
}

.bubble-link-create-screen .money-field input {
  padding-left: 43px;
}

.link-negotiation-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.full-field {
  display: grid;
  gap: 5px;
}

.bubble-link-create-screen .full-field {
  max-width: 850px;
  gap: 2px;
  margin-top: 8px;
}

.bubble-link-create-screen .full-field textarea {
  min-height: 76px;
  resize: vertical;
}

.link-create-actions {
  justify-content: center;
  margin-top: 10px;
}

.link-create-actions .button {
  min-width: 150px;
}

.bubble-link-create-screen .link-create-actions {
  max-width: 850px;
  margin-top: 16px;
}

.bubble-link-create-screen .link-create-actions .button {
  min-width: 124px;
  min-height: 42px;
  font-size: 1rem;
}

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

.client-table th,
.client-table td {
  overflow-wrap: anywhere;
}

.client-table th:nth-child(1),
.client-table td:nth-child(1) {
  width: 6%;
}

.client-table th:nth-child(2),
.client-table td:nth-child(2) {
  width: 14%;
}

.client-table th:nth-child(3),
.client-table td:nth-child(3) {
  width: 18%;
}

.client-table th:nth-child(4),
.client-table td:nth-child(4) {
  width: 11%;
}

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

.client-table th:nth-child(6),
.client-table td:nth-child(6) {
  width: 13%;
}

.client-table th:nth-child(7),
.client-table td:nth-child(7) {
  width: 13%;
}

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

.client-table th:nth-child(9),
.client-table td:nth-child(9) {
  width: 6%;
  min-width: 92px;
}

.client-table .actions {
  gap: 2px;
  flex-wrap: wrap;
}

.client-table .table-column-filter input {
  min-width: 0;
  padding-inline: 6px;
}

.small-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.76rem;
}

.original-kanban {
  grid-template-columns: repeat(7, minmax(235px, 1fr));
  gap: 0;
  padding-bottom: 12px;
}

.original-kanban .kanban-column {
  min-height: 560px;
  min-width: 235px;
  background: #ffffff;
  border: 1px solid #d9d9d9;
  border-right: 0;
  border-radius: 0;
  box-shadow: none;
}

.original-kanban .kanban-column:last-child {
  border-right: 1px solid #d9d9d9;
}

.original-kanban .column-head {
  min-height: 46px;
  color: #ffffff;
  background: var(--stage-color, var(--brand));
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.original-kanban .column-head strong,
.original-kanban .column-head .tag {
  color: #ffffff;
}

.original-kanban .column-head .tag {
  background: rgba(255, 255, 255, 0.18);
}

.original-kanban .stage-dot {
  background: #ffffff !important;
}

.original-kanban .column-body {
  gap: 8px;
  padding: 10px;
  background: #f8f7f5;
}

.kanban-condition {
  color: #111111;
  font-weight: 700;
}

.clone-menu-cards,
.clone-settings-nav {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.clone-menu-card,
.clone-settings-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(100%, 440px);
  min-height: 56px;
  padding: 12px 18px;
  color: var(--brand);
  background: #ffffff;
  border: 1px solid var(--brand);
  border-radius: 4px;
  font: inherit;
  font-weight: 750;
  text-align: left;
}

.clone-menu-card span,
.clone-settings-button span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.clone-menu-card > svg,
.clone-settings-button > svg {
  flex: 0 0 auto;
}

.original-settings-nav {
  gap: 8px;
  margin-top: 0;
}

.original-settings-nav .clone-settings-button {
  width: 400px;
  min-height: 52px;
  padding: 9px 13px;
  color: var(--settings-color, var(--brand));
  border-color: var(--settings-color, var(--brand));
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
}

.original-settings-nav .clone-settings-button:hover,
.original-settings-nav .clone-settings-button.active {
  background: color-mix(in srgb, var(--settings-color, var(--brand)) 7%, #ffffff);
}

.original-settings-nav .clone-settings-button span {
  gap: 14px;
}

.original-settings-nav .clone-settings-button span svg {
  width: 28px;
  height: 28px;
}

.original-settings-nav .clone-settings-button > svg {
  width: 22px;
  height: 22px;
}

.original-settings-panel {
  width: min(100%, 860px);
  margin-top: 4px;
  border-radius: 4px;
}

.auxiliary-group-grid {
  display: grid;
  gap: 14px;
}

.original-settings-item {
  display: grid;
  gap: 8px;
  align-items: start;
}

.original-settings-item.open {
  margin-bottom: 12px;
}

.original-settings-item.open .original-settings-panel {
  margin-bottom: 6px;
}

.tenant-data-panel.original-settings-panel {
  width: min(100%, 1180px);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.tenant-data-grid {
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(430px, 1.05fr);
  gap: 8px;
  align-items: start;
}

.tenant-side-stack {
  display: grid;
  gap: 8px;
}

.tenant-data-box {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--brand);
  border-radius: 3px;
}

.tenant-data-box h3 {
  margin: 0;
  color: var(--brand);
  font-size: 0.95rem;
}

.tenant-data-box p {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.tenant-box-label {
  color: #333333;
  font-size: 0.78rem;
  font-weight: 800;
}

.tenant-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tenant-logo-preview {
  display: inline-grid;
  width: 54px;
  height: 42px;
  place-items: center;
  color: #ffffff;
  background: var(--brand);
  border-radius: 3px;
  font-weight: 900;
}

.original-form-lines {
  display: grid;
  gap: 10px;
}

.tenant-data-box .field {
  gap: 4px;
}

.tenant-data-box .field label {
  color: #5d5d5d;
  font-size: 0.72rem;
  font-weight: 700;
}

.tenant-data-box .field input,
.tenant-data-box .field select,
.tenant-data-box .field textarea {
  min-height: 34px;
  padding: 6px 2px;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #767676;
  border-radius: 0;
  box-shadow: none;
}

.tenant-data-box .field input:focus,
.tenant-data-box .field select:focus,
.tenant-data-box .field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 2px 0 rgba(228, 1, 58, 0.14);
}

.tenant-data-box .input-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.tenant-data-box .input-action .ghost-button {
  min-height: 34px;
  padding-inline: 10px;
}

.icon-field {
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: end;
  column-gap: 10px;
}

.icon-field > span {
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}

.icon-field > label,
.icon-field > input {
  grid-column: 2;
}

.tenant-hours-grid {
  display: grid;
  gap: 8px;
}

.tenant-address-block {
  display: grid;
  gap: 10px;
}

.tenant-address-block > strong {
  font-size: 0.82rem;
}

.tenant-address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.tenant-address-cep,
.tenant-address-grid .field:nth-child(2) {
  grid-column: 1 / -1;
}

.tenant-data-box .field-hint {
  margin-top: 2px;
  font-size: 0.68rem;
}

.tenant-color-preview,
.tenant-visual-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
}

.tenant-color-preview span,
.tenant-visual-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.tenant-color-preview div {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.tenant-color-preview small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.tenant-color-preview i {
  display: block;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.compact-head {
  align-items: center;
}

.compact-head h3 {
  margin: 0;
}

.mini-table-wrap table {
  min-width: 520px;
  font-size: 0.76rem;
}

.mini-table-wrap th,
.mini-table-wrap td {
  padding: 6px 8px;
}

.mini-table-wrap .icon-button.small {
  width: 28px;
  min-height: 28px;
}

.danger-text {
  color: var(--danger);
}

.original-settings-actions {
  margin-top: 14px;
}

.settings-clone-screen .profile-settings-card,
.settings-clone-screen .settings-grid,
.settings-clone-screen > .settings-card {
  margin-top: 12px;
}

.control {
  display: grid;
  gap: 5px;
  min-width: 180px;
}

.control label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.control input,
.control select,
.control textarea,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
}

.control input:focus,
.control select:focus,
.control textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(228, 1, 58, 0.12);
}

.button,
.ghost-button,
.icon-button,
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 5px;
  border: 1px solid transparent;
  font-weight: 750;
  text-decoration: none;
}

.button {
  color: #fff;
  background: var(--brand);
}

.button:hover {
  background: var(--brand-strong);
}

.zama-add-button {
  width: min(430px, 100%);
  min-height: 50px;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border-color: var(--brand);
  border-radius: 5px;
  font-size: 0.95rem;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(228, 1, 58, 0.08);
}

.zama-add-button:hover {
  color: var(--brand);
  background: #fff;
  border-color: var(--brand-strong);
}

.zama-add-button svg {
  color: var(--brand);
  flex: 0 0 auto;
}

.zama-add-button svg:last-child {
  width: 25px;
  height: 25px;
}

.zama-add-button span {
  flex: 1;
  text-align: left;
}

.button.danger-button {
  background: var(--danger);
}

.button.danger-button:hover {
  background: #8f2620;
}

.button:disabled,
.ghost-button:disabled,
.icon-button:disabled,
.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost-button,
.table-action {
  color: var(--brand);
  background: #fff;
  border-color: var(--line-strong);
}

.ghost-button:hover,
.table-action:hover {
  border-color: var(--brand);
}

.ghost-button.compact,
.button.compact,
.table-action {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line-strong);
}

.icon-button.logout-button {
  width: auto;
  min-width: 74px;
  padding: 0 11px;
  color: var(--brand);
  background: #ffffff;
  border-color: var(--line-strong);
  gap: 6px;
  flex: 0 0 auto;
}

.icon-button.logout-button:hover {
  color: #ffffff;
  background: var(--brand);
  border-color: var(--brand);
}

.user-chip > div {
  min-width: 0;
}

.user-chip .logout-button svg {
  width: 17px;
  height: 17px;
}

.icon-button.menu-button {
  display: none;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(250px, 1fr));
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: calc(100vh - 230px);
  min-width: 250px;
  overflow: hidden;
  scroll-snap-align: start;
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.column-head strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
}

.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--brand);
}

.column-body {
  display: grid;
  align-content: start;
  gap: 10px;
  height: 100%;
  padding: 12px;
  overflow-y: auto;
}

.kanban-column.drag-over {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(228, 1, 58, 0.18);
}

.proposal-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(20, 31, 29, 0.06);
}

.proposal-card[draggable="true"] {
  cursor: grab;
}

.proposal-card.dragging {
  opacity: 0.55;
}

.proposal-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.proposal-card h3 {
  margin: 0;
  font-size: 0.96rem;
}

.proposal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.filterable-table thead tr:first-child th {
  padding: 0;
  background: #fff2f5;
}

.table-sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 9px 10px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
}

.table-sort-button:hover,
.filterable-table th.sorted-asc .table-sort-button,
.filterable-table th.sorted-desc .table-sort-button {
  color: var(--brand);
  background: rgba(228, 1, 58, 0.08);
}

.table-sort-button i {
  position: relative;
  width: 9px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0.45;
}

.table-sort-button i::before,
.table-sort-button i::after {
  position: absolute;
  left: 0;
  width: 0;
  height: 0;
  content: "";
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.table-sort-button i::before {
  top: 0;
  border-bottom: 5px solid currentColor;
}

.table-sort-button i::after {
  bottom: 0;
  border-top: 5px solid currentColor;
}

.filterable-table th.sorted-asc .table-sort-button i::after,
.filterable-table th.sorted-desc .table-sort-button i::before {
  opacity: 0.18;
}

.table-filter-row th {
  padding: 6px 7px;
  background: #ffffff;
  border-bottom-color: var(--line-strong);
}

.table-column-filter {
  display: block;
}

.table-column-filter span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.table-column-filter input {
  width: 100%;
  min-width: 96px;
  height: 30px;
  padding: 5px 8px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: none;
  outline: 0;
}

.table-column-filter input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(228, 1, 58, 0.12);
}

.table-actions-heading {
  padding: 9px 10px;
}

td {
  font-size: 0.88rem;
}

tr:hover td {
  background: #fbfcfc;
}

.cell-main {
  display: grid;
  gap: 3px;
}

.cell-main strong {
  font-size: 0.9rem;
}

.cell-main small {
  color: var(--muted);
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.compact-empty {
  min-height: auto;
  margin-top: 12px;
  padding: 12px;
  font-size: 0.86rem;
  line-height: 1.45;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: stretch end;
  background: rgba(11, 22, 20, 0.38);
}

.overlay[hidden] {
  display: none;
}

.drawer {
  width: min(720px, 100vw);
  height: 100vh;
  overflow-y: auto;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  box-shadow: var(--shadow);
}

.wide-drawer {
  width: min(1040px, 100vw);
}

.drawer-head,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2,
.modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.drawer-body,
.modal-body {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.modal-shell {
  display: grid;
  width: min(720px, calc(100vw - 32px));
  place-self: center;
}

.modal-card {
  max-height: min(780px, calc(100vh - 32px));
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.clone-modal {
  width: min(500px, calc(100vw - 32px));
  background: #fffafd;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 20px 42px rgba(20, 12, 14, 0.24);
}

.clone-modal.clone-wide-modal {
  width: min(720px, calc(100vw - 32px));
}

.clone-property-modal {
  width: min(760px, calc(100vw - 32px));
}

.clone-modal .modal-head {
  align-items: center;
  padding: 26px 28px 8px;
  border-bottom: 0;
}

.clone-modal .modal-head .eyebrow {
  color: var(--brand);
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.clone-modal .modal-head h2 {
  display: none;
}

.clone-modal .modal-head .icon-button {
  width: 34px;
  min-height: 34px;
  color: var(--brand);
  background: transparent;
  border-color: transparent;
}

.clone-modal .modal-head .icon-button svg {
  width: 24px;
  height: 24px;
}

.clone-modal .modal-body {
  gap: 18px;
  padding: 18px 34px 34px;
}

.clone-modal:not(.clone-wide-modal) .form-grid {
  grid-template-columns: 1fr;
}

.clone-modal .form-helper {
  padding: 0;
  margin: 0;
  color: #4d4d4d;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.clone-modal .form-helper strong {
  display: inline-block;
  margin-bottom: 2px;
  color: #202020;
  font-size: 1rem;
  font-weight: 500;
}

.clone-modal .field {
  gap: 6px;
}

.clone-modal .field label {
  color: #303030;
  font-size: 0.94rem;
  font-weight: 500;
  text-transform: none;
}

.clone-modal .field input,
.clone-modal .field select,
.clone-modal .field textarea {
  min-height: 48px;
  padding: 8px 10px;
  color: #1d1d1f;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #777777;
  border-radius: 4px 4px 0 0;
  box-shadow: none;
}

.clone-modal .field textarea {
  min-height: 92px;
}

.clone-modal .field input:focus,
.clone-modal .field select:focus,
.clone-modal .field textarea:focus {
  border-color: var(--brand);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.clone-modal .form-section-title {
  margin-top: 10px;
  color: #202020;
  font-size: 1.04rem;
  font-weight: 800;
}

.clone-modal .input-action {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.clone-modal .input-action .icon-button {
  align-self: end;
  color: var(--brand);
  background: #ffffff;
  border-color: var(--line);
}

.clone-modal .empty-state.compact-empty {
  background: transparent;
  border-style: dashed;
}

.clone-modal .actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.clone-modal .button,
.clone-modal .ghost-button {
  min-height: 46px;
}

.clone-modal .ghost-button {
  color: var(--brand);
  background: #ffffff;
}

.clone-modal .form-tabs {
  justify-content: center;
  margin: -4px 0 12px;
}

.clone-modal .form-tabs span,
.clone-modal .form-tabs button {
  padding: 10px 14px;
  color: #111111;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(24, 26, 32, 0.12);
  cursor: pointer;
}

.clone-modal .form-tabs .active {
  border-color: #d0d0d0;
  box-shadow: 0 3px 6px rgba(24, 26, 32, 0.22);
}

.property-form-sections {
  display: grid;
  gap: 18px;
}

.property-form-section {
  display: grid;
  gap: 12px;
  scroll-margin-top: 18px;
  border-radius: 6px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.property-form-section.is-tab-target {
  background: #fff5f8;
  box-shadow: 0 0 0 8px #fff5f8;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

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

.field label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.form-section-title {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.input-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.field-hint[data-kind="ok"] {
  color: var(--ok);
}

.field-hint[data-kind="warn"] {
  color: var(--warn);
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.inline-check input {
  accent-color: var(--brand);
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-box {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 7px;
}

.info-box span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.info-box.full {
  grid-column: 1 / -1;
}

.support-banner {
  position: sticky;
  top: var(--topbar-height);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 12px 14px;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid rgba(38, 77, 61, 0.25);
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(38, 77, 61, 0.16);
}

.support-banner div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.support-banner strong,
.support-banner span {
  overflow-wrap: anywhere;
}

.support-banner span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
}

.support-banner .ghost-button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.delivery-hero,
.delivery-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.delivery-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: linear-gradient(135deg, #fff7f9 0%, #ffffff 54%, #f1f5f2 100%);
}

.delivery-hero h3,
.delivery-section h3 {
  margin: 4px 0 0;
}

.delivery-hero p,
.delivery-section p {
  margin: 5px 0 0;
  color: var(--muted);
}

.delivery-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.delivery-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.delivery-check span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--brand);
  background: #fff0f3;
  border-radius: 50%;
}

.delivery-check.done span {
  color: #ffffff;
  background: var(--ok);
}

.delivery-check strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.info-box strong {
  font-size: 0.92rem;
}

.auxiliary-grid {
  display: grid;
  gap: 12px;
}

.auxiliary-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.auxiliary-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.auxiliary-head span,
.auxiliary-card > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auxiliary-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.auxiliary-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.auxiliary-form input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
}

.auxiliary-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(228, 1, 58, 0.12);
}

.auxiliary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.catalog-spec {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.catalog-spec div,
.catalog-field-spec > div {
  min-width: 0;
  padding: 9px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.catalog-spec strong,
.catalog-spec span {
  display: block;
}

.catalog-spec strong,
.catalog-field-spec strong {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-spec span {
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.catalog-field-spec {
  display: grid;
  gap: 8px;
}

.catalog-field-spec ul {
  display: grid;
  gap: 4px;
  margin: 7px 0 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.license-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.auxiliary-chip {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 750;
}

.auxiliary-chip button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--danger);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.auxiliary-chip button:hover {
  background: rgba(220, 53, 69, 0.1);
}

.auxiliary-chip .inline-icon {
  width: 15px;
  height: 15px;
}

.checklist {
  display: grid;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 7px;
}

.check-item label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.check-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-entry {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 0 0 0 18px;
}

.timeline-entry::before {
  position: absolute;
  top: 6px;
  left: 0;
  width: 8px;
  height: 8px;
  content: "";
  background: var(--brand);
  border-radius: 99px;
}

.timeline-entry strong {
  font-size: 0.88rem;
}

.timeline-entry small {
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.settings-card {
  display: grid;
  gap: 14px;
}

.sla-grid {
  display: grid;
  gap: 9px;
}

.sla-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 80px;
  align-items: center;
  gap: 10px;
}

.permission-grid {
  display: grid;
  gap: 8px;
  min-width: 780px;
}

.permission-table-wrap {
  overflow-x: auto;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.profile-inline-check {
  min-height: 42px;
  align-items: center;
}

.profile-settings-card {
  align-content: start;
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 14px;
}

.profile-form-panel,
.profile-permission-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.profile-permission-panel {
  background: #fff;
}

.profile-permission-panel h3 {
  margin: 0;
}

.usage-permission-grid {
  display: grid;
  gap: 8px;
}

.usage-permission-item {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.usage-permission-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.usage-permission-item span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.usage-permission-item i {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--muted);
  opacity: 0.35;
}

.usage-permission-item i.active {
  color: var(--brand);
  opacity: 1;
}

.form-helper {
  padding: 10px 12px;
  margin: 0;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.form-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-tabs span {
  min-height: 32px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 850;
}

.form-tabs span:first-child {
  color: #fff;
  background: var(--brand);
}

.clone-modal .form-tabs {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.clone-modal .form-tabs span,
.clone-modal .form-tabs span:first-child,
.clone-modal .form-tabs button,
.clone-modal .form-tabs button:first-child {
  min-height: 38px;
  padding: 10px 14px;
  color: #111111;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(24, 26, 32, 0.12);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.clone-modal .form-tabs .active,
.clone-modal .form-tabs span:first-child.active,
.clone-modal .form-tabs button:first-child.active {
  border-color: #d0d0d0;
  box-shadow: 0 3px 6px rgba(24, 26, 32, 0.22);
}

.permission-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.permission-toolbar .control {
  width: min(420px, 100%);
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) repeat(4, 68px) 84px;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.permission-row.header {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.permission-row input {
  width: 18px;
  height: 18px;
  justify-self: center;
  accent-color: var(--brand);
}

.permission-row strong {
  display: grid;
  gap: 2px;
}

.permission-row strong small {
  color: var(--muted);
  font-weight: 650;
}

.wide-modal {
  width: min(920px, calc(100vw - 28px));
}

.permission-mode {
  margin-top: 6px;
}

.module-permission-grid {
  display: grid;
  gap: 7px;
  max-height: min(420px, 46vh);
  padding: 10px;
  overflow: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.module-permission-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(4, minmax(78px, 0.38fr));
  align-items: center;
  gap: 8px;
}

.module-permission-row.header {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.permission-toggle {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.permission-toggle input {
  accent-color: var(--brand);
}

.process-rail {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.process-rail li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.process-rail strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 7px;
}

.admin-hero {
  align-content: start;
}

.profile-chart {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.mini-donut {
  position: relative;
  width: 160px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
}

.mini-donut::after {
  position: absolute;
  inset: 42px;
  content: "";
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.stat-legend {
  display: grid;
  gap: 9px;
}

.legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
}

.legend-row small {
  color: var(--muted);
  font-weight: 800;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.plan-card {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.plan-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.plan-name {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.plan-price {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  padding: 3px 7px;
  color: var(--brand);
  background: rgba(228, 1, 58, 0.08);
  border: 1px solid rgba(228, 1, 58, 0.14);
  border-radius: 6px;
  font-weight: 850;
  line-height: 1.25;
  white-space: nowrap;
}

.plan-card p,
.plan-card small {
  margin: 0;
  color: var(--muted);
}

.tenant-logo {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.tenant-logo.fallback {
  color: #fff;
  background: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
}

.action-strip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-icon {
  width: 34px;
  height: 34px;
  color: var(--brand);
  background: #fff;
  border-color: var(--line);
}

.menu-chip-grid,
.menu-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.menu-chip-grid.compact {
  margin-top: 7px;
}

.menu-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 8px;
  color: #2a2d32;
  background: color-mix(in srgb, var(--chip-color, var(--brand)) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--chip-color, var(--brand)) 35%, #fff);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

.menu-chip.more {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
}

.menu-check {
  cursor: pointer;
}

.menu-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.menu-check span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.menu-check input:checked + span {
  color: #24262c;
  background: color-mix(in srgb, var(--chip-color, var(--brand)) 14%, #fff);
  border-color: color-mix(in srgb, var(--chip-color, var(--brand)) 45%, #fff);
}

.danger-action {
  color: var(--danger);
}

.master-surface {
  align-content: start;
}

.master-panel,
.master-config-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(24, 35, 34, 0.03);
}

.master-panel {
  padding: 18px;
}

.master-panel h2 {
  margin: 0 0 14px;
  font-size: 1.12rem;
}

.deliverable-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.deliverable-module-card {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.deliverable-module-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 22px rgba(10, 15, 20, 0.08);
}

.deliverable-module-card svg {
  width: 20px;
  height: 20px;
  color: var(--brand);
  fill: currentColor;
}

.deliverable-module-card strong,
.deliverable-module-card small {
  display: block;
}

.deliverable-module-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.master-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1.15fr);
  gap: 18px;
  align-items: start;
}

.saas-executive-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) repeat(2, minmax(220px, 0.65fr));
  gap: 12px;
  align-items: stretch;
}

.saas-dashboard {
  gap: 16px;
}

.saas-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 12px;
}

.saas-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(430px, 1.1fr) minmax(360px, 0.9fr);
  gap: 14px;
  align-items: stretch;
}

.saas-dashboard-grid.compact {
  grid-template-columns: minmax(360px, 0.8fr) minmax(480px, 1.2fr);
}

.saas-money-panel,
.saas-trend-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.saas-money-total {
  display: grid;
  gap: 5px;
  padding: 14px;
  color: #fff;
  background: linear-gradient(135deg, #181a20, #264d3d);
  border-radius: 8px;
}

.saas-money-total span,
.saas-money-total small {
  color: rgba(255, 255, 255, 0.75);
}

.saas-money-total strong {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1;
}

.saas-money-bars {
  display: grid;
  gap: 13px;
}

.saas-money-bar {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.saas-money-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.saas-stacked-bar {
  display: flex;
  height: 16px;
  overflow: hidden;
  background: #e6e0d8;
  border-radius: 999px;
}

.saas-stacked-bar i,
.saas-money-legend i,
.saas-chart-legend i,
.saas-mini-legend i {
  display: inline-block;
  flex: 0 0 auto;
}

.saas-stacked-bar i.ok,
.saas-money-legend i.ok {
  background: #2a9a61;
}

.saas-stacked-bar i.warn,
.saas-money-legend i.warn {
  background: #b7791f;
}

.saas-stacked-bar i.danger,
.saas-money-legend i.danger {
  background: #b8322b;
}

.saas-money-legend,
.saas-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.saas-money-legend span,
.saas-chart-legend span,
.saas-mini-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.saas-money-legend i,
.saas-chart-legend i,
.saas-mini-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.saas-chart-legend i.revenue {
  background: #e51f48;
}

.saas-chart-legend i.sales {
  background: #264d3d;
}

.saas-trend-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  min-height: 240px;
  align-items: end;
  padding: 12px 10px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.saas-trend-column {
  display: grid;
  min-width: 0;
  gap: 6px;
  text-align: center;
}

.saas-trend-bars {
  display: flex;
  height: 150px;
  align-items: end;
  justify-content: center;
  gap: 5px;
}

.saas-trend-bars span {
  width: 18px;
  min-height: 8px;
  border-radius: 6px 6px 2px 2px;
}

.saas-trend-bars .revenue {
  background: #e51f48;
}

.saas-trend-bars .sales {
  background: #264d3d;
}

.saas-trend-column strong {
  color: var(--text);
  text-transform: capitalize;
}

.saas-trend-column small {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.saas-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.saas-donut-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 0;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.saas-donut {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
}

.saas-donut::after {
  position: absolute;
  inset: 28px;
  content: "";
  background: var(--surface-2);
  border-radius: 50%;
}

.saas-mini-legend {
  display: grid;
  width: 100%;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: left;
}

.saas-mini-legend b {
  margin-left: auto;
  color: var(--text);
}

.saas-geo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.saas-rank-list {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.saas-rank-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(70px, 0.8fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.saas-rank-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.saas-rank-row b {
  color: var(--text);
}

.saas-revenue-panel {
  display: grid;
  gap: 16px;
}

.saas-revenue-strip,
.saas-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.saas-revenue-strip div {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.saas-revenue-strip span,
.saas-finance-card small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.saas-revenue-strip strong {
  font-size: 1.1rem;
}

.saas-bar-list {
  display: grid;
  gap: 10px;
}

.saas-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.saas-bar-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.saas-bar-row strong {
  white-space: nowrap;
}

.saas-finance-card {
  min-height: 112px;
}

.master-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.master-filter-row .control {
  flex: 1 1 240px;
}

.master-config-stack {
  display: grid;
  gap: 10px;
}

.master-config-card {
  overflow: hidden;
}

.master-config-head {
  display: grid;
  width: 100%;
  min-height: 58px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: var(--brand);
  background: var(--surface);
  border: 0;
  text-align: left;
  font-weight: 850;
}

.master-config-card.open .master-config-head {
  border-bottom: 1px solid var(--line);
}

.master-config-body {
  padding: 16px;
}

.master-form {
  display: grid;
  gap: 16px;
}

.form-copy {
  display: grid;
  gap: 5px;
}

.form-copy h2,
.form-copy p {
  margin: 0;
}

.form-copy p {
  color: var(--muted);
  line-height: 1.45;
}

.logo-upload-row,
.preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.preview-row {
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.table-preview {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 800;
}

.master-permission-model {
  display: grid;
  gap: 14px;
}

.permission-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-legend span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.permission-legend .inline-icon,
.permission-icons .inline-icon {
  width: 15px;
  height: 15px;
}

.master-permission-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.master-permission-table {
  min-width: 1080px;
}

.deliverable-profile-create {
  align-items: end;
}

.deliverable-profile-create .control:first-child {
  min-width: 280px;
}

.deliverable-profile-cell {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 32px;
  align-items: center;
  gap: 8px;
  min-width: 220px;
}

.deliverable-profile-name {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
}

.deliverable-profile-name:focus {
  border-color: var(--brand);
  outline: 2px solid rgba(229, 1, 58, 0.14);
  outline-offset: 1px;
}

.permission-icons {
  display: inline-flex;
  gap: 5px;
  color: var(--brand);
}

.permission-icons.editable-icons {
  gap: 4px;
}

.master-permission-button {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.master-permission-button:hover,
.master-permission-button:focus-visible {
  color: var(--brand);
  background: rgba(229, 31, 72, 0.08);
  border-color: rgba(229, 31, 72, 0.2);
  outline: none;
}

.master-permission-button:active {
  transform: scale(0.94);
}

.master-permission-button.active {
  color: var(--brand);
  background: rgba(229, 31, 72, 0.11);
  border-color: rgba(229, 31, 72, 0.24);
}

.master-permission-button span {
  display: none;
}

.module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.module-list span,
.admin-permission-summary span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-permission-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 680px;
}

.cnpj-panel {
  max-width: 760px;
}

.cnpj-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.cnpj-result {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.cnpj-result div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.cnpj-result span {
  color: var(--muted);
  font-weight: 800;
}

.cnpj-result strong {
  overflow-wrap: anywhere;
}

.finance-placeholder {
  max-width: 520px;
}

.finance-placeholder strong {
  display: block;
  margin-bottom: 4px;
}

.finance-placeholder p {
  margin: 0;
  color: var(--muted);
}

.avatar.small {
  width: 30px;
  height: 30px;
  font-size: 0.72rem;
}

.master-admin-permissions {
  max-height: min(520px, 50vh);
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.finance-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.finance-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.finance-card strong {
  font-size: 1.35rem;
}

.contract-model {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 7px;
}

.contract-model code {
  padding: 2px 5px;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.contract-preview {
  display: grid;
  gap: 10px;
  padding: 18px;
  color: #24262c;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 7px;
}

.contract-preview h3,
.contract-preview p {
  margin: 0;
}

.contract-preview p {
  line-height: 1.75;
}

.public-mode .sidebar {
  display: none;
}

.public-mode .topbar {
  grid-template-columns: minmax(0, 1fr);
}

.public-mode .menu-button,
.public-mode .search-field,
.public-mode .user-chip {
  display: none;
}

.public-mode .content {
  width: min(100%, 1120px);
  min-width: 0;
}

.client-portal {
  display: grid;
  min-height: calc(100vh - 140px);
  align-items: start;
  min-width: 0;
}

.client-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: clamp(18px, 4vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.client-panel h2 {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.client-panel p {
  margin: 6px 0 0;
  color: var(--muted);
}

.client-form {
  display: grid;
  gap: 18px;
}

.compact-client-form {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.public-link-portal {
  align-items: start;
  max-width: 100%;
  overflow-x: hidden;
}

.public-link-portal .client-panel,
.public-link-portal .client-form,
.public-link-portal .form-grid,
.public-link-portal .public-property-summary,
.public-link-portal .public-condition-grid,
.public-link-portal .public-success-state,
.public-link-portal .message-preview,
.public-link-portal .secure-access-box {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.public-property-summary,
.public-condition-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.public-property-summary div,
.public-condition-grid div,
.secure-access-box,
.message-preview,
.public-success-state {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.public-property-summary span,
.public-condition-grid span,
.secure-access-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.public-link-portal .section-head p {
  max-width: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.public-link-portal p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.public-link-portal .section-head > div {
  min-width: 0;
}

.public-address-line {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
}

.public-address-line span {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.public-address-line span + span::before {
  content: "· ";
}

.public-property-summary strong,
.public-condition-grid strong {
  overflow-wrap: anywhere;
}

.public-progress {
  display: grid;
  gap: 12px;
}

.public-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.public-stepper span {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.public-stepper i {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-style: normal;
  font-size: 0.75rem;
}

.public-stepper span.active,
.public-stepper span.done {
  color: var(--text);
}

.public-stepper span.active i,
.public-stepper span.done i {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.public-step {
  display: none;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.public-step legend {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.public-step legend strong {
  font-size: 1.05rem;
}

.public-step legend span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.public-wizard[data-current-step="1"] [data-public-step="1"],
.public-wizard[data-current-step="2"] [data-public-step="2"],
.public-wizard[data-current-step="3"] [data-public-step="3"],
.public-wizard[data-current-step="4"] [data-public-step="4"],
.public-wizard[data-current-step="5"] [data-public-step="5"] {
  display: grid;
}

.public-wizard[data-current-step="1"] [data-action="public-wizard-prev"],
.public-wizard[data-current-step="5"] [data-action="public-wizard-next"],
.public-wizard .public-submit-button {
  display: none;
}

.public-wizard[data-current-step="5"] .public-submit-button {
  display: inline-flex;
}

.secure-access-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.secure-access-box strong,
.message-preview strong,
.public-success-state h3 {
  display: block;
  margin: 0 0 4px;
}

.secure-access-box code {
  padding: 9px 12px;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.public-success-state {
  display: grid;
  gap: 8px;
}

.public-success-state p,
.message-preview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.public-success-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.public-success-list li {
  min-width: 0;
  overflow-wrap: anywhere;
}

.link-created-modal {
  max-width: 760px;
}

.message-preview {
  display: grid;
  gap: 6px;
}

.client-stage-list,
.client-doc-list {
  display: grid;
  gap: 8px;
}

.client-stage-list {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.client-stage-list span,
.client-doc-list div {
  display: grid;
  gap: 5px;
  padding: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.client-stage-list span {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.client-stage-list span.active {
  color: var(--text);
  border-color: rgba(229, 31, 72, 0.28);
}

.client-stage-list i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.client-doc-list div {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.client-doc-list small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.upload-tile {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
}

.upload-tile span {
  font-weight: 800;
}

.upload-tile small,
.accept-row {
  color: var(--muted);
}

.upload-tile input,
.accept-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.accept-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 7px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 15px;
  color: #fff;
  background: var(--sidebar);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

@media (max-width: 1260px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .saas-kpi-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .zama-summary-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .dashboard-grid,
  .settings-grid,
  .tenant-data-grid,
  .master-dashboard-grid,
  .saas-executive-grid,
  .saas-dashboard-grid,
  .saas-dashboard-grid.compact {
    grid-template-columns: 1fr;
  }

  .finance-grid,
  .saas-finance-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .public-property-summary,
  .public-condition-grid,
  .upload-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .saas-status-grid,
  .saas-geo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-art {
    min-height: auto;
    padding: 28px 20px 24px;
  }

  .login-copy h1 {
    max-width: 620px;
  }

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

  .login-flow span {
    min-height: 64px;
  }

  .login-card {
    align-self: start;
    margin-block: 22px 34px;
  }

  .sidebar {
    position: fixed;
    width: min(276px, calc(100vw - 56px));
    flex-basis: auto;
    transform: translateX(-100%);
    transition: transform 160ms ease;
  }

  body:not(.sidebar-open) .sidebar {
    display: none;
  }

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

  .icon-button.menu-button {
    display: inline-flex;
  }

  .public-mode .icon-button.menu-button {
    display: none;
  }

  .public-mode .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: auto;
    min-height: var(--topbar-height);
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .search-field {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .user-chip {
    min-width: auto;
  }

  .user-chip small {
    display: none;
  }

  .proposal-filter-grid,
  .client-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .proposal-filter-grid .control:first-child,
  .client-filter-grid .control:first-child,
  .proposal-clear-button,
  .client-clear-button {
    grid-column: 1 / -1;
  }

  .split-grid,
  .form-grid,
  .drawer-grid,
  .upload-grid,
  .zama-summary-grid,
  .saas-kpi-grid,
  .saas-revenue-strip,
  .saas-finance-grid,
  .delivery-hero,
  .delivery-checklist,
  .cnpj-search {
    grid-template-columns: 1fr;
  }

  .support-banner {
    top: 0;
    flex-direction: column;
    align-items: stretch;
  }

  .support-banner .ghost-button {
    justify-content: center;
  }

  .saas-bar-row {
    grid-template-columns: 1fr;
  }

  .saas-trend-chart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .saas-rank-row {
    grid-template-columns: minmax(0, 1fr) 56px auto;
  }

  .master-config-body {
    padding: 12px;
  }

  .module-permission-row {
    grid-template-columns: minmax(130px, 1fr) repeat(4, minmax(64px, 0.42fr));
  }

  .cnpj-result div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 680px) {
  body {
    overflow-x: hidden;
  }

  .tenant-mode .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: auto;
    min-height: 82px;
    padding: 18px 16px 8px;
  }

  .tenant-mode .menu-button {
    display: inline-flex;
  }

  .tenant-mode .topbar-title h1 {
    font-size: clamp(1.45rem, 8vw, 2rem);
    text-align: center;
  }

  .tenant-mode .user-chip {
    display: flex;
    min-width: auto;
    padding: 0;
  }

  .tenant-mode .user-chip > div,
  .tenant-mode .user-chip .status-dot {
    display: none;
  }

  .tenant-mode .content {
    padding: 26px 16px 36px;
  }

  .tenant-mode .sidebar {
    width: min(188px, calc(100vw - 32px));
    height: calc(100vh - 16px);
    margin: 8px 0 8px 8px;
  }

  .original-screen {
    gap: 0;
  }

  .module-heading {
    margin-bottom: 28px;
  }

  .original-dashboard-screen {
    max-width: none;
  }

  .original-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .original-chart-card,
  .original-chart-card.tall,
  .original-chart-card.extra-tall,
  .original-chart-card.medium,
  .original-calendar-card {
    width: 100%;
    min-height: auto;
  }

  .original-chart-blank {
    min-height: 160px;
  }

  .original-calendar-toolbar {
    flex-wrap: wrap;
  }

  .original-calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .original-settings-nav .clone-settings-button,
  .original-settings-panel {
    width: 100%;
  }

  .tenant-data-grid {
    grid-template-columns: 1fr;
  }

  .tenant-data-box {
    padding: 12px;
  }

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

  .tenant-address-grid {
    grid-template-columns: 1fr;
  }

  .tenant-address-cep,
  .tenant-address-grid .field:nth-child(2) {
    grid-column: auto;
  }

  .tenant-visual-row,
  .tenant-color-preview {
    align-items: stretch;
  }

  .clone-actions-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }

  .proposal-filter-grid,
  .client-filter-grid {
    grid-template-columns: 1fr;
  }

  .link-create-title-row,
  .link-create-toolbar,
  .link-create-grid,
  .link-create-identification {
    grid-template-columns: 1fr;
  }

  .link-create-title-row {
    display: grid;
  }

  .link-create-identification .wide-field:last-child {
    grid-column: auto;
  }

  .bubble-link-create-screen {
    max-width: none;
  }

  .bubble-link-create-screen .module-heading {
    margin: 0 0 16px;
    font-size: 1.35rem;
  }

  .bubble-link-create-screen .link-create-toolbar {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .bubble-link-create-screen .link-create-identification,
  .bubble-link-create-screen .link-create-checklist {
    max-width: none;
    grid-template-columns: 1fr;
  }

  .bubble-link-create-screen .link-create-identification .field {
    display: grid;
    gap: 4px;
  }

  .bubble-link-create-screen .link-create-identification .field label {
    justify-self: start;
  }

  .bubble-link-create-screen .full-field,
  .bubble-link-create-screen .link-create-actions {
    max-width: none;
  }

  .link-create-panel {
    padding: 12px;
  }

  .bubble-link-create-screen .link-create-panel {
    padding: 0;
  }

  .link-create-actions {
    align-items: stretch;
  }

  .proposal-filter-grid .control:first-child,
  .client-filter-grid .control:first-child,
  .proposal-clear-button,
  .client-clear-button {
    grid-column: auto;
  }

  .clone-filter {
    width: 100%;
  }

  .clone-filter-stack,
  .clone-menu-card,
  .clone-settings-button {
    width: 100%;
  }

  .original-kanban {
    grid-template-columns: repeat(7, minmax(220px, 86vw));
  }

  .login-flow {
    grid-template-columns: 1fr;
  }

  .login-flow span:nth-child(n + 5) {
    display: none;
  }

  .login-card {
    width: calc(100% - 24px);
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .user-chip {
    display: flex;
    min-width: auto;
    padding: 5px;
  }

  .user-chip .status-dot,
  .user-chip > div {
    display: none;
  }

  .logout-button {
    margin-left: 0;
  }

  .content {
    padding-inline: 12px;
  }

  .metric-grid,
  .finance-grid {
    grid-template-columns: 1fr;
  }

  .public-property-summary,
  .public-condition-grid,
  .upload-grid,
  .public-stepper {
    grid-template-columns: 1fr;
  }

  .secure-access-box {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

  .public-link-portal .section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .public-address-line {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .toolbar {
    align-items: stretch;
  }

  .actions {
    align-items: stretch;
  }

  .control,
  .toolbar .button,
  .toolbar .ghost-button {
    width: 100%;
  }

  .zama-add-button {
    width: 100%;
  }

  .actions .button,
  .actions .ghost-button {
    flex: 1 1 145px;
  }

  .actions .zama-add-button {
    flex: 1 1 100%;
  }

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

  .catalog-spec,
  .license-grid {
    grid-template-columns: 1fr;
  }

  .input-action {
    grid-template-columns: 1fr;
  }

  .input-action .ghost-button {
    width: 100%;
  }

  .auxiliary-form .button {
    width: 100%;
  }

  .panel,
  .table-panel,
  .settings-card,
  .metric-card {
    padding: 14px;
  }

  .kanban {
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 88vw);
    grid-template-columns: none;
  }

  .kanban-column {
    min-height: min(520px, calc(100vh - 190px));
    max-height: calc(100vh - 190px);
    min-width: 0;
  }

  .table-wrap {
    overflow-x: visible;
  }

  .mini-table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

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

  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
  }

  .responsive-table.filterable-table thead {
    position: static;
    width: 100%;
    height: auto;
    margin: 0 0 10px;
    padding: 0;
    overflow: visible;
    clip: auto;
    border: 0;
  }

  .responsive-table.filterable-table thead tr:first-child {
    display: none;
  }

  .responsive-table.filterable-table .table-filter-row {
    display: grid;
    gap: 7px;
    padding: 8px;
    background: #fff2f5;
    border: 1px solid var(--line);
    border-radius: 7px;
  }

  .responsive-table.filterable-table .table-filter-row th {
    display: block;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .responsive-table.filterable-table .table-filter-row th:empty {
    display: none;
  }

  .responsive-table.filterable-table .table-column-filter input {
    min-width: 0;
    height: 36px;
  }

  .responsive-table tbody {
    display: grid;
    gap: 10px;
  }

  .responsive-table tr {
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 0 rgba(24, 35, 34, 0.03);
  }

  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 4px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
  }

  .responsive-table.proposal-table th,
  .responsive-table.proposal-table td,
  .responsive-table.proposal-table th:nth-child(n),
  .responsive-table.proposal-table td:nth-child(n) {
    width: 100%;
    min-width: 0;
  }

  .responsive-table.proposal-table .actions {
    max-width: none;
    flex-wrap: wrap;
  }

  .responsive-table.client-table th,
  .responsive-table.client-table td,
  .responsive-table.client-table th:nth-child(n),
  .responsive-table.client-table td:nth-child(n) {
    width: 100%;
    min-width: 0;
  }

  .responsive-table.client-table .actions {
    max-width: none;
    flex-wrap: wrap;
  }

  .responsive-table.property-table {
    min-width: 0;
    table-layout: auto;
  }

  .responsive-table.property-table .property-address-cell,
  .responsive-table.property-table .property-condo-cell {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .responsive-table.property-table .property-address-cell span,
  .responsive-table.property-table .property-address-cell small {
    display: block;
  }

  .responsive-table.property-table .property-address-cell small::before {
    content: "";
  }

  .responsive-table td:last-child {
    border-bottom: 0;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  .responsive-table td[colspan] {
    display: block;
    padding: 0;
  }

  .responsive-table td[colspan]::before {
    display: none;
  }

  .responsive-table tr:hover td {
    background: transparent;
  }

  .responsive-table .avatar-row,
  .responsive-table .action-strip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .responsive-table td > *,
  .responsive-table .cell-main,
  .responsive-table .cell-main strong,
  .responsive-table .cell-main small,
  .responsive-table .avatar-row {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .responsive-table .table-action {
    min-height: 36px;
  }

  .drawer {
    width: 100vw;
  }

  .modal-shell {
    width: calc(100vw - 16px);
  }

  .modal-card {
    max-height: calc(100vh - 16px);
  }

  .drawer-head,
  .modal-head,
  .drawer-body,
  .modal-body {
    padding: 14px;
  }

  .stage-row {
    grid-template-columns: 92px minmax(80px, 1fr) 28px;
  }

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

  .profile-settings-grid {
    grid-template-columns: 1fr;
  }

  .profile-form-panel,
  .profile-permission-panel {
    padding: 12px;
  }

  .usage-permission-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .usage-permission-item span {
    flex-wrap: wrap;
  }

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

  .form-tabs span {
    width: 100%;
  }

  .profile-chart {
    grid-template-columns: 1fr;
  }

  .mini-donut {
    width: min(180px, 70vw);
    justify-self: center;
  }

  .permission-row {
    grid-template-columns: minmax(160px, 1fr) repeat(4, 58px) 78px;
  }

  .permission-table-wrap {
    margin-inline: -2px;
  }

  .permission-grid {
    min-width: 500px;
  }

  .module-permission-row {
    grid-template-columns: minmax(98px, 1fr) repeat(4, 36px);
    gap: 6px;
  }

  .module-permission-row.header span:not(:first-child),
  .permission-toggle span {
    display: none;
  }
}
