:root {
  --surface-base: #ffffff;
  --surface-alt: #f5f7fb;
  --surface-overlay: #f9fbff;
  --border-subtle: rgba(15, 23, 42, 0.12);
  --text-primary: #1f2937;
  --text-secondary: #52606d;
  --text-inverse: #ffffff;
  --brand-500: #1a73e8;
  --brand-600: #0f4cbd;
  --success-500: #0f9d58;
  --warning-400: #facc15;
  --danger-500: #ef4444;
  --radius-sm: 8px;
  --radius-md: 14px;
  --shadow-soft: 0 18px 42px -25px rgba(15, 23, 42, 0.45);
  --layout-width: min(1440px, 100%);
  --transition: 180ms ease-in-out;
}

body[data-theme="dark"] {
  --surface-base: #1f2937;
  --surface-alt: #121a2c;
  --surface-overlay: #162132;
  --border-subtle: rgba(148, 163, 184, 0.25);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --shadow-soft: 0 26px 48px -24px rgba(6, 12, 24, 0.85);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--surface-alt);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
}

a {
  color: var(--brand-500);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover,
a:focus-visible {
  color: var(--brand-600);
}

main,
header,
footer {
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.1rem, 3vw, 2.6rem);
}

h2 {
  font-size: clamp(1.6rem, 2.2vw, 2rem);
}

h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
}

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

.text-center {
  text-align: center;
}

.text-primary {
  color: var(--brand-500);
}

.layout-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  background: var(--surface-overlay);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 16px 32px -24px rgba(15, 23, 42, 0.35);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar__inner {
  width: var(--layout-width);
  margin: 0 auto;
  padding: 0.9rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.brand-logo img {
  height: 40px;
  width: auto;
}

.brand-logo span {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .brand-logo span {
    display: none;
  }
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-overlay);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: all 0.3s ease;
  position: absolute;
}

.nav-toggle span:nth-child(1) {
  top: 12px;
}

.nav-toggle span:nth-child(2) {
  top: 19px;
}

.nav-toggle span:nth-child(3) {
  top: 26px;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(26, 115, 232, 0.1);
  border-color: rgba(26, 115, 232, 0.3);
  color: var(--brand-600);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 19px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 19px;
  transform: rotate(-45deg);
}

.primary-nav {
  margin: 0;
}

.primary-nav ul {
  display: flex;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition);
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  color: var(--brand-600);
  background: rgba(26, 115, 232, 0.12);
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bar-actions__desktop {
  display: inline-flex;
}

.nav-divider {
  display: none;
}

.nav-mobile-only {
  display: none;
}

@media (max-width: 900px) {
  .bar-actions {
    display: none;
  }

  .nav-divider {
    display: block;
  }

  .nav-mobile-only {
    display: block;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.btn-large {
  padding: 1rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  min-height: 48px;
}

.btn-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  margin-right: 0.45rem;
  animation: button-spinner 0.7s linear infinite;
}

@keyframes button-spinner {
  to {
    transform: rotate(360deg);
  }
}

.btn-primary {
  background: var(--brand-500);
  color: var(--text-inverse);
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--brand-600);
  box-shadow: 0 6px 20px rgba(26, 115, 232, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.btn-secondary {
  background: rgba(26, 115, 232, 0.18);
  color: var(--brand-600);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(26, 115, 232, 0.26);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  color: var(--brand-600);
  border-color: rgba(26, 115, 232, 0.45);
}

.btn-success {
  background: var(--success-500);
  color: var(--text-inverse);
}

.btn-success:hover,
.btn-success:focus-visible {
  background: #0b7a44;
}

.btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.direct-billing-attachment {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.direct-billing-attachment label {
  font-weight: 600;
  color: var(--text-primary);
}

.lead-action-wrapper {
  display: inline-flex;
  position: relative;
}

.lead-action-tooltip {
  position: fixed;
  padding: 0.35rem 0.6rem;
  border-radius: 10px;
  background: var(--surface-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 1200;
}

.lead-action-tooltip.is-visible {
  opacity: 1;
}

.inactive-leads summary::after {
  content: none;
}

.app-main {
  flex: 1 1 auto;
}

.page-container {
  width: var(--layout-width);
  margin: 1.75rem auto 2.5rem;
  padding: 0 1.8rem;
}

.page-footer {
  margin-top: auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-alt);
}

.page-footer .page-container {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-subtitle {
  margin-top: 0.6rem;
  font-size: 1rem;
  color: var(--text-secondary);
}

.alert-banner {
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.3rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(251, 188, 4, 0.35);
  background: rgba(251, 188, 4, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.alert-banner__actions {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  gap: 2.25rem;
}

.md-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.75rem;
}

.md-grid__cell--span-12 {
  grid-column: span 12;
}

.md-grid__cell--span-6 {
  grid-column: span 6;
}

.md-grid__cell--span-3 {
  grid-column: span 3;
}

.md-grid__cell--span-4 {
  grid-column: span 4;
}

@media (max-width: 992px) {
  .md-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .md-grid__cell--span-6 {
    grid-column: span 8;
  }

  .md-grid__cell--span-3 {
    grid-column: span 4;
  }

  .md-grid__cell--span-4 {
    grid-column: span 4;
  }
}

@media (max-width: 720px) {
  .md-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .md-grid__cell--span-12,
  .md-grid__cell--span-6,
  .md-grid__cell--span-3,
  .md-grid__cell--span-4 {
    grid-column: span 4;
  }
}

.card--profile {
  padding: 1.85rem;
}

.card--profile .card-body {
  align-items: flex-start;
  gap: 2.5rem;
}

.avatar-badge {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.avatar-badge--brand {
  background: rgba(26, 115, 232, 0.26);
  color: var(--brand-600);
}

.avatar-badge--success {
  background: rgba(15, 157, 88, 0.28);
  color: #0b7a44;
}

.card__header {
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card__badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-600);
  background: rgba(26, 115, 232, 0.16);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.card--profile-success .card__badge {
  color: #0b7a44;
  background: rgba(15, 157, 88, 0.2);
}

.card__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.detail-list--two {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.detail-list--two .detail-list__item {
  flex-direction: row;
  align-items: flex-start;
}

@media (max-width: 640px) {
  .detail-list--two .detail-list__item {
    flex-direction: column;
    align-items: flex-start;
  }
}

 .card {
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px -25px rgba(15, 23, 42, 0.45);
}

.card-header {
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
}

.card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.card-body {
  display: flex;
  gap: 1rem;
}

.card-body__content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-list__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.detail-list__item strong {
  text-align: right;
}

.detail-list__item strong {
  text-align: right;
  display: inline-block;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(26, 115, 232, 0.16);
  color: var(--brand-600);
}

.telemetry-grid {
  display: contents;
}

.telemetry-card {
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  min-height: 280px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.telemetry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px -25px rgba(15, 23, 42, 0.45);
}

.telemetry-card--wide {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .telemetry-card--wide {
    grid-column: span 1;
  }
}

.telemetry-card__title {
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

.telemetry-card__body {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.telemetry-chart {
  width: 100%;
  min-height: 200px;
}

.telemetry-gauge-caption {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.telemetry-gauge-caption .telemetry-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--brand-600);
}

.data-panel {
  margin-top: 1.5rem;
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem 1.5rem 1.75rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-soft);
  margin-top: 1.5rem;
}

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

.table th,
.table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.lead-license-column {
  width: 9rem;
  max-width: 9rem;
}

.lead-license-column--value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-close-date-column {
  width: 8rem;
  max-width: 8rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.lead-amount-column {
  width: 10rem;
  max-width: 10rem;
}

.lead-amount-column--header {
  white-space: normal;
  overflow-wrap: anywhere;
}

.lead-amount-column--value {
  white-space: nowrap;
}

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

.table-hover tbody tr:hover {
  background: rgba(26, 115, 232, 0.12);
}


.no-data-cell {
  padding: 1.75rem 0;
}

.badge-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(26, 115, 232, 0.12);
  color: var(--brand-600);
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

.grid-badge-list,
.grid-badge-list__extra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.grid-badge-list__extra {
  display: none;
  margin-top: 0.25rem;
}

.grid-badge-list__extra.is-visible {
  display: flex;
}

.badge-toggle {
  background: none;
  border: none;
  color: var(--brand-600);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0;
  margin-top: 0.15rem;
  cursor: pointer;
}

.badge-toggle:hover,
.badge-toggle:focus-visible {
  text-decoration: underline;
}

.dx-datagrid .metric-column {
  max-width: 140px;
}

.dx-datagrid .metric-column .dx-editor-container .dx-texteditor-input {
  text-align: center;
}

.dx-datagrid .compact-column {
  max-width: 240px;
  white-space: normal;
}

.dx-datagrid .dx-header-row .dx-datagrid-text-content {
  white-space: normal;
  line-height: 1.2;
  display: block;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  height: auto;
}

.dx-datagrid .dx-row.dx-header-row > td {
  white-space: normal;
  line-height: 1.2;
  height: auto;
  padding-top: 0.75rem;
  padding-bottom: 0.65rem;
}

.dx-datagrid .metric-band .dx-datagrid-text-content,
.dx-datagrid .contract-band .dx-datagrid-text-content {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.dx-datagrid .wrap-two-lines,
.dx-datagrid .wrap-two-lines .dx-datagrid-text-content {
  white-space: normal;
}

.dx-datagrid .wrap-two-lines .dx-datagrid-text-content {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

body[data-theme="dark"] .badge-chip {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.dx-row--interactive:hover {
  background: rgba(26, 115, 232, 0.08) !important;
}

body[data-theme="dark"] .dx-row--interactive:hover {
  background: rgba(148, 163, 184, 0.15) !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 200;
}

.modal.show {
  display: flex;
}

.modal-dialog {
  width: min(720px, 100%);
  max-height: calc(100vh - 4rem);
  display: flex;
  min-height: 0;
}

.modal-dialog.modal-lg {
  width: min(980px, 100%);
}

.modal-content {
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 4rem);
  width: 100%;
  min-height: 0;
}

.modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-content > form .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.modal-content > form .modal-footer {
  flex: 0 0 auto;
}

.modal-header,
.modal-footer {
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-footer {
  border-bottom: none;
  border-top: 1px solid var(--border-subtle);
  gap: 0.75rem;
  justify-content: flex-end;
}

.modal-body {
  padding: 1.4rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.lead-form-grid {
  display: grid;
  gap: 1rem;
}

.is-hidden {
  display: none !important;
}

.lead-form-grid + .lead-form-grid {
  margin-top: 1rem;
}

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

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

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

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

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

@media (max-width: 900px) {
  .lead-form-grid--contact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-form-grid--address {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lead-form-grid--two,
  .lead-form-grid--three,
  .lead-form-grid--contact,
  .lead-form-grid--address,
  .lead-form-grid--region {
    grid-template-columns: 1fr;
  }
}

.btn-close {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
}

.btn-close:hover,
.btn-close:focus-visible {
  background: rgba(26, 115, 232, 0.14);
  color: var(--brand-600);
}

.public-shell {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface-base) 100%);
  display: flex;
  flex-direction: column;
  position: relative;
}

body[data-theme="dark"] .public-shell {
  background: linear-gradient(135deg, #121a2c 0%, #1f2937 100%);
}

.public-header {
  width: var(--layout-width);
  margin: 0 auto;
  padding: 2rem 1.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  max-width: 1200px;
}

.public-main {
  width: var(--layout-width);
  margin: 0 auto;
  padding: 2rem 1.8rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  flex: 1;
  max-width: 1200px;
}

@media (max-width: 900px) {
  .public-main {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 1.2rem;
  }
  
  .public-illustration {
    display: none;
  }
}

.public-illustration {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.public-illustration:hover {
  opacity: 0.8;
}

.public-illustration img {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
  object-fit: contain;
  opacity: 0.9;
}

body[data-theme="dark"] .public-illustration {
  opacity: 0.5;
}

body[data-theme="dark"] .public-illustration img {
  opacity: 0.8;
}

.public-content {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.login-card {
  background: var(--surface-overlay);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 480px;
  width: 100%;
  margin: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body[data-theme="dark"] .login-card {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-card__header {
  text-align: left;
}

.login-card__title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.login-card__subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
}

.login-card__body {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.login-card__description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.login-card__actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-card__footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.login-card__help-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  text-align: center;
  line-height: 1.5;
}

.login-card__help-text strong {
  color: var(--brand-600);
  font-weight: 600;
}

.login-card__alert {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #dc2626;
  font-size: 0.875rem;
}

body[data-theme="dark"] .login-card__alert {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.login-card__alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.auth-card,
.form-card,
.public-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: center;
}

.auth-card__title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: var(--text-primary);
}

.auth-card__description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

.auth-card__actions,
.form-actions {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.validation-summary {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger-500);
}

.form-control,
.form-select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-overlay);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.form-check-input {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-overlay);
  cursor: pointer;
}

.form-check-input:checked {
  background: var(--brand-500);
  border-color: var(--brand-500);
}

.form-check-input:focus-visible {
  outline: 2px solid rgba(26, 115, 232, 0.35);
  outline-offset: 2px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.documentation-header .section-subtitle {
  max-width: 760px;
  margin-inline: auto;
}

.documentation-divider {
  border: 0;
  height: 1px;
  background: var(--border-subtle);
  margin: 2rem auto;
  max-width: 960px;
}

.documentation-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.documentation-tile {
  flex-direction: column;
  align-items: stretch;
  min-height: 220px;
}

.documentation-tile__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  background: rgba(26, 115, 232, 0.16);
  color: var(--brand-600);
  flex-shrink: 0;
  margin-bottom: 0.75rem;
  align-self: flex-start;
}

.documentation-tile__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.documentation-tile__icon--image {
  background: transparent;
  border-radius: 12px;
}

.documentation-tile__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  flex: 1 1 auto;
}

.documentation-tile__link {
  margin-top: auto;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.documentation-tile__link--disabled {
  color: var(--text-secondary);
  font-weight: 600;
}

.documentation-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.documentation-back {
  align-self: flex-start;
  width: auto;
}

.documentation-frame {
  background: var(--surface-overlay);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.documentation-frame iframe {
  width: 100%;
  min-height: 640px;
  height: 75vh;
  border: 0;
}

.documentation-frame--empty {
  padding: 2rem;
  text-align: center;
}

.documentation-empty {
  text-align: center;
}

.documentation-tile--business-central .documentation-tile__icon:not(.documentation-tile__icon--image) {
  background: rgba(37, 99, 235, 0.18);
  color: #1e3a8a;
}

.documentation-tile--sage-intacct .documentation-tile__icon:not(.documentation-tile__icon--image) {
  background: rgba(15, 157, 88, 0.2);
  color: #0b7a44;
}

@media (max-width: 720px) {
  .documentation-tiles {
    grid-template-columns: 1fr;
  }

  .documentation-tile__icon {
    width: 52px;
    height: 52px;
  }

  .documentation-frame iframe {
    min-height: 520px;
  }
}

@media (max-width: 1100px) {
  .documentation-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .top-bar__inner {
    padding-inline: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .primary-nav {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  }

  .primary-nav.is-open {
    max-height: 500px;
    padding-top: 0.5rem;
  }

  .primary-nav ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    background: var(--surface-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    margin: 0;
    box-shadow: var(--shadow-soft);
  }

  .primary-nav a {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    width: 100%;
    justify-content: flex-start;
  }

  .primary-nav a.btn {
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
  }

  .nav-divider {
    display: block;
    height: 1px;
    background: var(--border-subtle);
    margin: 0.5rem 0;
    list-style: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .brand-group {
    flex: 1;
    min-width: 0;
  }

  .bar-actions {
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  .page-container {
    padding-inline: 1.2rem;
  }

  .top-bar__inner {
    padding-inline: 1rem;
  }

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

  .brand-logo img {
    height: 32px;
  }
}

@media (min-width: 901px) {
  .nav-toggle {
    display: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
