:root {
  --fit-ink: #17202a;
  --fit-muted: #5c6875;
  --fit-line: #d9e0e7;
  --fit-bg: #f5f7fa;
  --fit-panel: #ffffff;
  --fit-primary: #2563eb;
  --fit-primary-dark: #1d4ed8;
  --fit-danger-bg: #fff1f2;
  --fit-danger-border: #fecdd3;
  --fit-danger-text: #9f1239;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fit-ink);
  background: var(--fit-bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--fit-primary);
}

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

button {
  min-height: 44px;
  border: 1px solid var(--fit-primary);
  border-radius: 7px;
  padding: 0 16px;
  color: #fff;
  background: var(--fit-primary);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--fit-primary-dark);
}

button:disabled {
  border-color: var(--fit-line);
  color: #98a2b3;
  background: #f2f4f7;
  cursor: not-allowed;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--fit-primary);
  border-radius: 7px;
  margin-top: 20px;
  padding: 0 16px;
  color: #fff;
  background: var(--fit-primary);
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  color: #fff;
  background: var(--fit-primary-dark);
}

button.secondary {
  color: var(--fit-primary);
  background: #fff;
}

button.secondary:hover {
  color: #fff;
  background: var(--fit-primary);
}

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

button.danger-button:hover {
  color: #fff;
  border-color: var(--fit-danger-text);
  background: var(--fit-danger-text);
}

button:disabled:hover {
  border-color: var(--fit-line);
  color: #98a2b3;
  background: #f2f4f7;
}

label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--fit-line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
}

textarea {
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--fit-primary);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

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

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--fit-primary);
  font-weight: 800;
}

.brand-mark-light {
  color: var(--fit-ink);
  background: #fff;
}

.brand-name {
  font-weight: 800;
}

.brand-name-light {
  color: #fff;
}

.muted {
  color: var(--fit-muted);
}

.muted-light {
  color: rgba(255, 255, 255, 0.7);
}

.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
  min-height: 100vh;
}

.login-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 48px;
  color: #fff;
  background:
    linear-gradient(rgba(20, 29, 38, 0.74), rgba(20, 29, 38, 0.68)),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1400&q=80");
  background-position: center;
  background-size: cover;
}

.login-aside h1 {
  max-width: 720px;
  margin: 80px 0 16px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.login-aside p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.15rem;
}

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

.aside-stats div {
  border-left: 2px solid rgba(255, 255, 255, 0.45);
  padding-left: 14px;
}

.aside-stats strong,
.aside-stats span {
  display: block;
}

.aside-stats span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.88rem;
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px;
  background: #fff;
}

.auth-card {
  width: min(100%, 430px);
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 28px;
  background: var(--fit-panel);
  box-shadow: 0 12px 30px rgba(23, 32, 42, 0.06);
}

.auth-card h2 {
  margin: 28px 0 8px;
  font-size: 1.9rem;
}

.auth-card button {
  width: 100%;
  margin-top: 20px;
}

.secondary-form button {
  margin-top: 10px;
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--fit-muted);
  text-align: center;
}

.dev-link {
  display: grid;
  gap: 8px;
  overflow-wrap: anywhere;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-top: 18px;
  padding: 12px;
  color: #1e3a8a;
  background: #eff6ff;
}

.mobile-brand {
  display: none;
}

.alert {
  border: 1px solid var(--fit-danger-border);
  border-radius: 8px;
  padding: 12px;
  color: var(--fit-danger-text);
  background: var(--fit-danger-bg);
}

.notice {
  max-width: 900px;
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 12px 14px;
  font-weight: 700;
}

.auth-notice {
  max-width: none;
  margin-top: 16px;
}

.notice.success {
  border-color: #bfdbfe;
  color: #1e3a8a;
  background: #eff6ff;
}

.notice.error {
  border-color: var(--fit-danger-border);
  color: var(--fit-danger-text);
  background: var(--fit-danger-bg);
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--fit-line);
  padding: 0 24px;
  background: #fff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--fit-line);
  border-radius: 999px;
  padding: 0 10px;
  color: #344054;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.pill.status-good {
  border-color: #bfdbfe;
  color: #1e40af;
  background: #eff6ff;
}

.pill.status-attention {
  border-color: var(--fit-danger-border);
  color: var(--fit-danger-text);
  background: var(--fit-danger-bg);
}

.avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--fit-primary);
  font-weight: 800;
}

.layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  border-right: 1px solid var(--fit-line);
  padding: 16px;
  background: #fff;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar a {
  min-height: 42px;
  border-radius: 7px;
  padding: 11px 14px;
  color: #344054;
  text-decoration: none;
  font-weight: 700;
}

.sidebar a.active,
.sidebar a:hover {
  color: var(--fit-primary-dark);
  background: #eaf1ff;
}

.content {
  padding: 28px;
}

.page-title {
  max-width: 760px;
  margin-bottom: 24px;
}

.page-title h1 {
  margin: 0 0 6px;
}

.page-title p {
  margin: 0;
  color: var(--fit-muted);
}

.grid {
  display: grid;
  gap: 18px;
}

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

.card {
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(23, 32, 42, 0.06);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.settings-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  align-items: start;
}

.account-products-grid,
.product-management {
  margin-top: 18px;
}

.security-stack {
  align-items: start;
}

.security-stack .summary-card {
  grid-column: 1 / -1;
  position: static;
}

.section-heading {
  display: flex;
  align-items: start;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.settings-form {
  margin-top: 18px;
}

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

.field-help {
  margin: 7px 0 0;
  color: var(--fit-muted);
  font-size: 0.9rem;
}

.secret-value {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-weight: 700;
}

.json-block {
  overflow-x: auto;
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
  color: #1f2937;
  background: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.summary-card {
  position: sticky;
  top: 88px;
}

.readiness-list {
  display: grid;
  gap: 16px;
}

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

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.billing-summary div {
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.overview-metrics div {
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.billing-summary strong,
.billing-summary span,
.overview-metrics strong,
.overview-metrics span {
  display: block;
}

.billing-summary strong,
.overview-metrics strong {
  font-size: 1.4rem;
}

.billing-summary span,
.overview-metrics span {
  color: var(--fit-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-overview-grid {
  margin-top: 18px;
}

.overview-actions {
  display: grid;
  gap: 10px;
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: var(--fit-line);
}

.readiness-list div {
  border-left: 3px solid #bfdbfe;
  padding-left: 14px;
}

.readiness-list strong,
.readiness-list span {
  display: block;
}

.readiness-list span {
  margin-top: 4px;
  color: var(--fit-muted);
  font-size: 0.94rem;
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  margin-top: 18px;
  padding: 22px;
  color: #1e3a8a;
  background: #eff6ff;
}

.empty-state span {
  color: var(--fit-muted);
}

.session-list {
  display: grid;
  gap: 16px;
}

.user-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.session-item {
  display: grid;
  gap: 18px;
}

.user-item {
  display: grid;
  gap: 18px;
}

.toolbar-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.toolbar-form button {
  margin: 0;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(140px, 0.7fr)) auto;
  gap: 14px;
  align-items: end;
}

.filter-grid label {
  margin-top: 0;
}

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

.secondary-link,
.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--fit-line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--fit-primary);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
}

.secondary-link:hover,
.row-action:hover {
  border-color: var(--fit-primary);
  color: #fff;
  background: var(--fit-primary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

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

.session-main h2,
.session-main p {
  margin: 0;
}

.session-main p {
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.session-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.session-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.session-meta div {
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.session-meta dt {
  color: var(--fit-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.session-meta dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-heading {
  margin: 0;
  padding: 20px;
}

.table-summary,
.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
}

.table-summary {
  border-bottom: 1px solid var(--fit-line);
}

.table-summary span {
  color: var(--fit-muted);
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--fit-line);
}

.data-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--fit-line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--fit-muted);
  background: #f8fafc;
  font-size: 0.82rem;
  font-weight: 800;
}

.data-table td strong,
.data-table td span {
  display: block;
}

.data-table td span {
  margin-top: 2px;
  color: var(--fit-muted);
  font-size: 0.9rem;
}

.data-table .pill {
  display: inline-flex;
  margin-top: 0;
}

.pagination-row {
  border-top: 1px solid var(--fit-line);
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.detail-list div {
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.detail-list dt {
  color: var(--fit-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.detail-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.danger-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--fit-danger-border);
  border-radius: 8px;
  margin-top: 20px;
  padding: 14px;
  background: var(--fit-danger-bg);
}

.danger-zone strong,
.danger-zone span {
  display: block;
}

.danger-zone span {
  color: var(--fit-danger-text);
  font-size: 0.92rem;
}

.access-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-top: 18px;
  padding: 16px;
  background: #eff6ff;
}

.access-zone strong,
.access-zone span {
  display: block;
}

.access-zone span {
  margin-top: 4px;
  color: var(--fit-muted);
  font-size: 0.92rem;
}

.table-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--fit-primary);
  background: #fff;
}

.admin-actions-card {
  margin-top: 18px;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-action {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.admin-action strong,
.admin-action span {
  display: block;
}

.admin-action span {
  min-height: 42px;
  color: var(--fit-muted);
  font-size: 0.92rem;
}

.admin-action button {
  width: 100%;
  margin-top: 4px;
}

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

.link-action {
  color: var(--fit-ink);
  text-decoration: none;
}

.link-action em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--fit-primary);
  border-radius: 7px;
  padding: 0 16px;
  color: var(--fit-primary);
  background: #fff;
  font-style: normal;
  font-weight: 700;
}

.danger-action {
  border-color: var(--fit-danger-border);
  background: var(--fit-danger-bg);
}

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

.entitlement-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.entitlement-item {
  display: grid;
  gap: 14px;
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.entitlement-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.entitlement-header strong,
.entitlement-header span {
  display: block;
}

.entitlement-header span:not(.pill) {
  margin-top: 3px;
  color: var(--fit-muted);
  font-size: 0.9rem;
}

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

.entitlement-meta div {
  border: 1px solid var(--fit-line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.entitlement-meta dt {
  color: var(--fit-muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.entitlement-meta dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.entitlement-note {
  border-top: 1px solid var(--fit-line);
  margin: 0;
  padding-top: 12px;
  color: var(--fit-muted);
}

.inline-action {
  display: flex;
  justify-content: flex-end;
}

.inline-action button {
  min-height: 38px;
}

@media (max-width: 991.98px) {
  .login-wrap,
  .layout,
  .grid.two,
  .settings-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .login-aside {
    display: none;
  }

  .mobile-brand {
    display: flex;
  }

  .login-main {
    min-height: 100vh;
    padding: 20px;
  }

  .topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    margin: 12px 0 0;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--fit-line);
  }

  .sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .sidebar a {
    flex: 0 0 auto;
  }

  .content {
    padding: 20px 14px;
  }

  .section-heading {
    display: grid;
  }

  .summary-card {
    position: static;
  }

  .form-actions button {
    width: 100%;
  }

  .toolbar-form,
  .filter-grid,
  .danger-zone,
  .access-zone,
  .admin-action-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-form button,
  .filter-actions,
  .filter-actions button,
  .filter-actions .secondary-link,
  .danger-zone button,
  .access-zone button {
    width: 100%;
  }

  .filter-actions {
    display: grid;
  }

  .session-main {
    display: grid;
  }

  .session-pills {
    justify-content: flex-start;
  }

  .session-meta,
  .billing-summary,
  .overview-metrics {
    grid-template-columns: 1fr;
  }

  .entitlement-header {
    display: grid;
  }

  .entitlement-meta {
    grid-template-columns: 1fr;
  }

  .inline-action,
  .inline-action button {
    width: 100%;
  }
}
