:root {
  --ink: #241522;
  --muted: #756574;
  --paper: #fbf7f4;
  --surface: #ffffff;
  --surface-soft: #fff3fa;
  --brand: #620052;
  --brand-deep: #2b1129;
  --teal: #620052;
  --teal-deep: #2b1129;
  --coral: #a83272;
  --gold: #c59a4b;
  --accent: #12656b;
  --line: rgba(98, 0, 82, 0.14);
  --shadow: 0 24px 80px rgba(43, 17, 41, 0.18);
}

:root[data-theme="dark"] {
  --ink: #f7edf5;
  --muted: #cebccd;
  --paper: #130d14;
  --surface: #211421;
  --surface-soft: #2b1729;
  --brand: #f2a4db;
  --brand-deep: #080509;
  --teal: #d95cad;
  --teal-deep: #0e0910;
  --coral: #f07bbd;
  --gold: #d9b66a;
  --accent: #64c7c0;
  --line: rgba(255, 235, 250, 0.14);
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background 180ms ease, color 180ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.site-header.hidden {
  display: none;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  color: #fff;
  background: linear-gradient(180deg, rgba(4, 18, 20, 0.78), rgba(4, 18, 20, 0));
}

.brand,
.site-header nav,
.hero-actions,
.hero-metrics,
.chat-topbar,
.composer,
.panel-header,
.cta-section {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo-wrap,
.auth-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(98, 0, 82, 0.16);
  border-radius: 8px;
  background: #fff;
}

.brand-logo-wrap {
  width: 120px;
  height: 42px;
  padding: 4px 8px;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

.auth-logo-wrap {
  width: 168px;
  height: 68px;
  margin-bottom: 20px;
  padding: 6px 12px;
  box-shadow: 0 16px 34px rgba(98, 0, 82, 0.14);
}

.auth-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

.site-header nav {
  gap: clamp(14px, 3vw, 30px);
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  font-weight: 600;
}

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

.header-action {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.header-action.subtle {
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  position: relative;
  min-height: 92vh;
  overflow: hidden;
  color: #fff;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(31, 7, 31, 0.9) 0%, rgba(98, 0, 82, 0.66) 44%, rgba(31, 7, 31, 0.14) 100%),
    linear-gradient(180deg, rgba(31, 7, 31, 0.14), rgba(31, 7, 31, 0.52));
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, 92vw);
  padding: 156px clamp(22px, 6vw, 72px) 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f4b9df;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 640px;
  margin-top: 42px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  line-height: 1.6;
}

.button {
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
}

.button,
.icon-button,
.send-button {
  display: inline-flex;
  align-items: center;
  border: 0;
  cursor: pointer;
}

.button svg,
.icon-button svg,
.send-button svg,
.panel-header svg,
.feature-grid svg,
.security-grid svg {
  width: 20px;
  height: 20px;
}

.primary {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 14px 34px rgba(98, 0, 82, 0.28);
}

.secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.secondary.on-light {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border: 1px solid var(--line);
}

.text-button {
  min-height: 42px;
  color: var(--brand);
  background: transparent;
  box-shadow: none;
}

.text-button:hover {
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 34px;
}

.wide {
  width: 100%;
}

.hero-metrics {
  flex-wrap: wrap;
  gap: 10px;
}

.hero-metrics span {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.1);
}

section:not(.hero) {
  padding: clamp(64px, 9vw, 112px) clamp(18px, 5vw, 72px);
}

.product-band {
  background: var(--surface-soft);
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(1060px, 100%);
  margin: 0 auto 24px;
}

.flow-grid article {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 16px 46px rgba(98, 0, 82, 0.1);
}

.flow-grid svg {
  width: 22px;
  height: 22px;
  color: var(--coral);
}

.flow-grid strong {
  font-size: 1.05rem;
}

.flow-grid span {
  color: var(--muted);
  line-height: 1.5;
}

.preview-shell,
.login-preview-card {
  display: grid;
  width: min(1060px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-shell {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 24px;
  padding: 24px;
}

.preview-shell.image-only {
  display: block;
  overflow: hidden;
  padding: 0;
  background: transparent;
}

.preview-shell.image-only .preview-copy,
.preview-shell.image-only .chat-preview {
  display: none;
}

.preview-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

.preview-copy {
  align-self: center;
}

.preview-copy h3 {
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1.1;
}

.preview-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.chat-preview {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 78%, transparent), color-mix(in srgb, var(--surface) 88%, transparent)),
    var(--surface);
}

.login-band {
  background: color-mix(in srgb, var(--brand) 9%, var(--paper));
}

.login-preview-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 32px;
}

.login-preview-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-heading {
  width: min(1060px, 100%);
  margin: 0 auto 34px;
}

.section-heading.narrow {
  width: min(780px, 100%);
  text-align: center;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.03;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.12rem;
}

.chat-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 22px;
  width: min(1280px, 100%);
  margin: 0 auto;
}

.chat-layout.no-company-reports {
  grid-template-columns: 240px minmax(0, 1fr);
}

[hidden] {
  display: none !important;
}

.system-chat {
  width: 100%;
}

#chatPanel.active {
  width: 100%;
}

#chatPanel.active .chat-layout {
  height: calc(100vh - 188px);
  min-height: 560px;
}

.chat-surface,
.conversation-panel,
.insight-panel,
.feature-grid article,
.security-grid div,
.role-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chat-surface {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.conversation-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 18px;
  overflow: hidden;
}

.conversation-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.conversation-actions .button {
  width: 100%;
  justify-content: center;
  padding-inline: 12px;
}

.conversation-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.conversation-item {
  display: flex;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  overflow: hidden;
}

.conversation-item:hover,
.conversation-item.active {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.conversation-open {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 5px;
  padding: 12px;
  color: inherit;
  text-align: left;
}

.conversation-item strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.conversation-delete {
  display: inline-flex;
  width: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-left: 1px solid var(--line);
}

.conversation-delete:hover {
  color: var(--coral);
  background: color-mix(in srgb, var(--coral) 12%, var(--surface));
}

.conversation-delete svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-topbar {
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
}

.chat-topbar span,
.panel-header span,
.signal-list dt,
.security-grid span,
.feature-grid p,
.cta-section p {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--brand) 11%, var(--surface));
}

.status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2da66f;
}

.messages {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 22px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 72%, transparent), color-mix(in srgb, var(--surface) 86%, transparent)),
    var(--surface);
}

.message {
  max-width: 74%;
  border-radius: 8px;
  padding: 14px 16px;
  line-height: 1.48;
}

.message.assistant {
  align-self: flex-start;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.thinking-message {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 700;
}

.thinking-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.thinking-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.34;
  animation: thinkingPulse 1.05s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes thinkingPulse {
  0%,
  80%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--teal);
}

.composer {
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.composer input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  outline: none;
}

.composer input:focus {
  border-color: color-mix(in srgb, var(--brand) 58%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent);
}

.icon-button,
.send-button {
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 8px;
}

.icon-button {
  color: var(--teal);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}

.icon-button.active {
  color: #fff;
  background: var(--teal);
}

.send-button {
  color: #fff;
  background: var(--teal-deep);
}

.insight-panel {
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
}

.panel-header {
  gap: 12px;
  margin-bottom: 24px;
}

.panel-header svg,
.feature-grid svg,
.security-grid svg {
  color: var(--coral);
}

.signal-list {
  display: grid;
  gap: 16px;
  margin: 0;
}

.signal-list div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.signal-list dt {
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-list dd {
  margin: 0;
  font-weight: 800;
}

.mini-chart {
  display: grid;
  height: 160px;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 10px;
  margin-top: 26px;
}

.mini-chart span {
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--coral), var(--gold));
}

.data-section,
.access-section {
  background: var(--paper);
}

.feature-grid,
.security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: min(1060px, 100%);
  margin: 0 auto;
}

.feature-grid article,
.security-grid div {
  padding: 24px;
}

.feature-grid p,
.security-grid span {
  line-height: 1.55;
}

.security-section {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), #3d1538);
}

.security-section .section-heading h2 {
  color: #fff;
}

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

.security-grid div {
  display: grid;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.security-grid span {
  color: rgba(255, 255, 255, 0.72);
}

.role-table {
  width: min(1060px, 100%);
  margin: 0 auto;
  overflow: hidden;
  box-shadow: none;
}

.role-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.role-row:last-child {
  border-bottom: 0;
}

.role-row span:first-child {
  font-weight: 800;
}

.role-row.head {
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--teal-deep);
}

.cta-section {
  justify-content: space-between;
  gap: 28px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
}

.cta-section div {
  max-width: 760px;
}

.cta-section h2 {
  margin-bottom: 14px;
}

.cta-section p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.76);
}

.auth-view,
.system-view {
  min-height: 100vh;
}

.auth-view.active {
  display: block;
}

.auth-shell {
  min-height: 100vh;
  padding: clamp(24px, 5vw, 56px);
  background:
    linear-gradient(90deg, rgba(43, 17, 41, 0.95), rgba(98, 0, 82, 0.74)),
    url("./assets/edivan-hero.png") center / cover;
}

.back-link,
.logout-button,
.system-nav button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  cursor: pointer;
}

.back-link {
  color: #fff;
  background: transparent;
  font-weight: 800;
}

.back-link svg,
.logout-button svg,
.system-nav svg,
.auth-badges svg {
  width: 18px;
  height: 18px;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
  width: min(1060px, 100%);
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  color: #fff;
}

.register-shell {
  min-height: 100vh;
}

.register-card {
  display: grid;
  gap: 24px;
  width: min(1180px, 100%);
  margin: 28px auto 0;
  color: #fff;
}

.register-intro {
  width: min(760px, 100%);
}

.register-intro h1 {
  max-width: 760px;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
}

.register-intro p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.06rem;
  line-height: 1.65;
}

.registration-grid {
  display: grid;
  grid-template-columns: minmax(280px, 560px);
  gap: 18px;
}

.account-type-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px;
  width: min(760px, 100%);
}

.account-type-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.account-type-card:hover,
.account-type-card.active {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.18);
}

.account-type-card svg {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.account-type-card span {
  display: grid;
  gap: 5px;
}

.account-type-card strong {
  font-size: 0.98rem;
}

.account-type-card small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.84rem;
  line-height: 1.45;
}

.registration-form {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 22px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
}

.registration-form.hidden {
  display: none;
}

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

.confirmation-form {
  width: min(560px, 100%);
}

.registration-grid > #companyUserForm {
  display: none;
}

.registration-form label,
.company-user-form label,
.file-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.registration-form input,
.registration-form select,
.company-user-form input,
.company-user-form select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.company-user-form {
  display: grid;
  gap: 14px;
}

.company-user-form > .panel-title {
  display: none;
}

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

.registration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.registration-status {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 14px 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.registration-status:empty {
  display: none;
}

.registration-status[data-state="success"] {
  background: rgba(45, 166, 111, 0.24);
}

.registration-status[data-state="error"] {
  background: rgba(185, 52, 86, 0.28);
}

.auth-copy h1 {
  max-width: 680px;
  font-size: clamp(3rem, 8vw, 6.5rem);
}

.auth-copy p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.06rem;
  line-height: 1.65;
}

.auth-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.auth-badges span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.1);
}

.login-form {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 24px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
}

.recovery-form {
  margin-top: 14px;
  gap: 12px;
  padding: 18px;
}

.compact-title {
  margin-bottom: 2px;
}

.compact-title h3 {
  font-size: 1.05rem;
}

.recovery-confirm-fields {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.login-form input,
.login-form select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle.active {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.system-view.active {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--paper);
}

.system-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  color: #fff;
  background: var(--teal-deep);
}

.system-sidebar .brand {
  color: #fff;
}

.system-nav {
  display: grid;
  gap: 8px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-sub {
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

.nav-sub.nested {
  padding-left: 18px;
}

.nav-sub button {
  min-height: 38px;
  padding: 9px 10px;
  font-size: 0.88rem;
}

.system-nav button,
.logout-button {
  width: 100%;
  border-radius: 8px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  text-align: left;
}

.system-nav button.active,
.system-nav button:hover,
.logout-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.logout-button {
  margin-top: auto;
}

.chat-workspace {
  padding: clamp(16px, 3vw, 30px);
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(1060px, 100%);
  margin: 0 auto 14px;
}

.workspace-header h2 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.2;
  font-weight: 800;
}

.workspace-header .eyebrow {
  margin-bottom: 4px;
  font-size: 0.68rem;
}

.session-user {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface);
  text-align: right;
}

.session-user span {
  display: block;
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.session-user strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-panel {
  display: none;
  width: min(1160px, 100%);
  margin: 0 auto;
}

.system-panel.active {
  display: block;
}

.hidden {
  display: none !important;
}

.onboarding-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(16px, 3vw, 24px);
  background:
    linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: var(--shadow);
}

.onboarding-band h3,
.panel-title h3,
.placeholder-panel h3 {
  margin-bottom: 8px;
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  line-height: 1.12;
}

.onboarding-band p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.94rem;
  line-height: 1.6;
}

.onboarding-steps,
.guidance-grid,
.dashboard-grid,
.dashboard-layout {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

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

.onboarding-steps article,
.guidance-grid article,
.metric-card,
.evolution-panel,
.emotion-panel,
.care-panel,
.placeholder-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 46px rgba(98, 0, 82, 0.08);
}

.onboarding-steps article {
  display: grid;
  gap: 10px;
  padding: 18px;
}

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

.guidance-grid article {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
}

.guidance-grid strong {
  display: block;
  margin-bottom: 4px;
}

.guidance-grid span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.48;
}

.onboarding-steps svg,
.guidance-grid svg,
.metric-card svg,
.placeholder-panel svg {
  width: 22px;
  height: 22px;
  color: var(--coral);
  flex: 0 0 22px;
}

.onboarding-steps span,
.metric-card span,
.panel-title span,
.emotion-list span,
.care-panel dt,
.care-panel dd,
.placeholder-panel p {
  color: var(--muted);
}

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

.metric-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.dashboard-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.85fr);
  align-items: stretch;
}

.evolution-panel {
  grid-row: span 2;
}

.evolution-panel,
.emotion-panel,
.care-panel,
.settings-panel,
.placeholder-panel {
  padding: 22px;
}

.wide-settings-panel {
  grid-column: 1 / -1;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-title .eyebrow {
  margin-bottom: 8px;
}

.panel-title span {
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
}

.evolution-chart {
  display: grid;
  height: 280px;
  grid-template-columns: repeat(7, minmax(22px, 1fr));
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-soft) 70%, transparent), color-mix(in srgb, var(--surface) 90%, transparent)),
    var(--surface);
}

.evolution-chart span {
  min-height: 32px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--teal), var(--coral));
}

.evolution-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

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

.evolution-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--coral);
}

.evolution-legend span:nth-child(2) i {
  background: var(--teal);
}

.evolution-legend span:nth-child(3) i {
  background: var(--gold);
}

.emotion-list {
  display: grid;
  gap: 12px;
}

.emotion-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.emotion-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.emotion-list strong {
  color: var(--teal);
}

.care-panel dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.care-panel div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.care-panel div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.care-panel dt {
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.care-panel dd {
  margin: 0;
  font-weight: 800;
}

.placeholder-panel {
  display: grid;
  min-height: 320px;
  align-content: center;
  justify-items: start;
}

.placeholder-panel p {
  max-width: 620px;
  margin-bottom: 0;
  line-height: 1.6;
}

.settings-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.companies-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
}

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

.management-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.management-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  font-weight: 800;
}

.management-tabs button.active,
.management-tabs button:hover {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.settings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 46px rgba(98, 0, 82, 0.08);
}

.settings-panel .panel-title svg {
  width: 24px;
  height: 24px;
  color: var(--coral);
}

.settings-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.settings-field select,
.settings-field input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

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

.profile-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.profile-list div {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.profile-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--teal);
  font-weight: 800;
  text-align: right;
}

.company-filter-bar {
  display: grid;
  max-width: 260px;
  margin-bottom: 14px;
}

.data-table {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(190px, 1.3fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) minmax(140px, 0.9fr);
  gap: 12px;
  align-items: center;
  min-width: 780px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.data-row:not(.data-head) {
  cursor: pointer;
}

.data-row:not(.data-head):hover {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.data-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-head {
  color: var(--muted);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
  cursor: default;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.company-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.company-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.company-row:hover,
.company-row.active {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.company-row span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.company-row strong,
.company-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-row small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.company-row em {
  border-radius: 999px;
  padding: 7px 9px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.company-row em[data-status="ativo"] {
  color: #17613a;
  background: rgba(45, 166, 111, 0.14);
}

.company-row em[data-status="inativo"] {
  color: #8f2d47;
  background: rgba(185, 52, 86, 0.13);
}

.company-row em[data-status="pendente"] {
  color: #8a611f;
  background: rgba(197, 154, 75, 0.18);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(19, 13, 20, 0.58);
}

.edit-modal {
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-header {
  margin-bottom: 18px;
}

.modal-close {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  cursor: pointer;
}

.modal-actions {
  flex-wrap: wrap;
  margin-top: 6px;
}

.settings-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.settings-panel.is-disabled {
  opacity: 0.72;
}

.language-summary {
  display: grid;
  gap: 14px;
}

.language-summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.language-summary div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.language-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.language-summary strong {
  color: var(--teal);
  text-align: right;
}

.admin-toolbar,
.admin-switcher,
.admin-grid {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
}

.admin-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.admin-toolbar label {
  display: grid;
  gap: 8px;
  min-width: min(360px, 100%);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-toolbar select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
}

.admin-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-switcher button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
}

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

.admin-metrics {
  width: min(1180px, 100%);
  margin: 0 auto 18px;
}

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

.admin-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 220px;
}

.admin-chart div {
  display: grid;
  grid-template-rows: 20px 1fr 20px;
  gap: 8px;
  min-width: 0;
  height: 100%;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.admin-chart strong {
  align-self: end;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--teal), var(--coral));
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

@media (max-width: 900px) {
  .site-header nav {
    display: none;
  }

  .chat-layout,
  .feature-grid,
  .security-grid,
  .flow-grid,
  .onboarding-band,
  .onboarding-steps,
  .guidance-grid,
  .dashboard-grid,
  .dashboard-layout,
  .settings-layout,
  .companies-layout,
  .admin-grid,
  .account-type-selector,
  .registration-grid,
  .form-grid,
  .preview-shell,
  .login-preview-card,
  .auth-card {
    grid-template-columns: 1fr;
  }

  #chatPanel.active .chat-layout {
    height: auto;
    min-height: 0;
  }

  .conversation-panel,
  .insight-panel {
    max-height: 360px;
  }

  .chat-surface {
    height: min(72vh, 640px);
    min-height: 520px;
  }

  .system-view.active {
    grid-template-columns: 1fr;
  }

  .system-sidebar {
    position: static;
    height: auto;
  }

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

  .role-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cta-section {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .site-header {
    position: absolute;
    padding: max(14px, env(safe-area-inset-top)) 16px 10px;
    background: transparent;
  }

  .site-header .brand {
    width: 100%;
  }

  .site-header .brand-logo-wrap {
    width: 100%;
    height: 82px;
    padding: 8px 14px;
    overflow: visible;
  }

  .site-header .brand-logo {
    object-fit: contain;
    object-position: center;
  }

  .header-action {
    display: none;
  }

  .hero {
    min-height: 100dvh;
  }

  .hero-content {
    width: 100%;
    padding: 134px 18px max(32px, env(safe-area-inset-bottom));
  }

  .hero-overlay {
    background: linear-gradient(90deg, rgba(3, 18, 19, 0.9), rgba(3, 18, 19, 0.5));
  }

  .auth-view.active,
  .system-view.active {
    min-height: 100dvh;
  }

  .auth-shell {
    min-height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  }

  .system-view.active {
    height: 100dvh;
    overflow: hidden;
  }

  .chat-workspace {
    min-height: 0;
    height: 100%;
    overflow: auto;
  }

  .message {
    max-width: 88%;
  }

  .composer {
    flex-wrap: wrap;
  }

  .composer input {
    order: -1;
    flex: 0 0 100%;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .session-user {
    width: 100%;
    text-align: left;
  }

  .system-nav {
    grid-template-columns: 1fr;
  }
}
