:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(74, 144, 226, 0.14), transparent 32rem),
    radial-gradient(circle at 100% 10%, rgba(123, 97, 255, 0.1), transparent 28rem),
    #f4f7fb;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 40px auto;
}

.panel {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(30, 41, 59, 0.12);
}

.topbar,
.hero,
.section-heading,
.select-row,
footer {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  padding: 24px 30px;
  border-bottom: 1px solid #e8edf5;
}

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

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 13px);
  gap: 3px;
  padding: 11px;
  border-radius: 13px;
  background: linear-gradient(145deg, #0f6cbd, #5145cd);
  box-shadow: 0 8px 18px rgba(15, 108, 189, 0.25);
}

.brand-mark span {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: white;
}

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

h1 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 8px;
  font-size: 23px;
  letter-spacing: -0.025em;
}

.eyebrow {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.is-connected {
  color: #087a55;
  background: #e9fbf3;
}

.status-pill.is-required {
  color: #9a6700;
  background: #fff7dc;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

.hero {
  justify-content: space-between;
  gap: 24px;
  padding: 36px 30px 28px;
  background: linear-gradient(115deg, #f8fbff, #f7f5ff);
}

.hero p {
  max-width: 640px;
  margin-bottom: 0;
  color: #64748b;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, #0f6cbd, #3155b7);
  box-shadow: 0 8px 18px rgba(15, 108, 189, 0.22);
}

.button-secondary {
  color: #25324a;
  border-color: #d5deea;
  background: white;
}

.button-secondary:hover {
  border-color: #aab9cc;
  background: #f8fafc;
}

.button-danger {
  color: white;
  background: #c9362b;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 30px 30px;
  background: linear-gradient(115deg, #f8fbff, #f7f5ff);
}

.info-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 18px rgba(51, 65, 85, 0.05);
}

.info-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  font-weight: 800;
}

.subscription-icon {
  color: #7c3aed;
  background: #f1eafe;
}

.account-icon {
  color: #0f6cbd;
  background: #e7f3ff;
}

.tenant-icon {
  color: #087a55;
  background: #e9fbf3;
}

.info-card div {
  min-width: 0;
}

.info-label {
  display: block;
  margin-bottom: 4px;
  color: #708096;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.info-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  padding: 30px;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 19px;
}

.tenant-count {
  padding: 6px 10px;
  border: 1px solid #dfe6ef;
  border-radius: 999px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
}

.tenant-picker {
  padding: 18px;
  border: 1px solid #e1e7f0;
  border-radius: 14px;
  background: #fbfcfe;
}

.tenant-picker label {
  display: block;
  margin-bottom: 9px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.select-row {
  gap: 10px;
}

.tenant-picker select {
  width: 100%;
  min-height: 42px;
  padding: 8px 38px 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #243047;
  background: white;
  outline: none;
}

.tenant-picker select:focus {
  border-color: #0f6cbd;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.12);
}

.empty-state {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px dashed #c9d5e4;
  border-radius: 14px;
  color: #475569;
  background: #fbfcfe;
}

.empty-state p {
  margin: 4px 0 0;
  color: #718096;
}

.empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #0f6cbd;
  background: #e7f3ff;
  font-size: 20px;
}

.inline-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: #0f6cbd;
  font-size: 13px;
  font-weight: 600;
}

.capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.capabilities span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #334155;
  background: #eef2f7;
  font-size: 12px;
}

.danger {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #ffc9c4;
  border-left: 4px solid #c9362b;
  border-radius: 12px;
  background: #fff6f5;
}

.approval-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #d8e2ef;
  border-radius: 16px;
  background: #f8fbff;
}

.approval-panel > p {
  color: #64748b;
  line-height: 1.5;
}

.approval-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: #3155b7;
  background: #e8efff;
  font-size: 12px;
  font-weight: 800;
}

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

.approval-panel label {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.approval-panel input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #172033;
  background: white;
  outline: none;
}

.approval-panel input:focus {
  border-color: #0f6cbd;
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.12);
}

.approval-preview {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #d9e3f0;
  border-radius: 12px;
  background: white;
}

.approval-preview dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.approval-preview dl div {
  min-width: 0;
}

.approval-preview dt {
  color: #718096;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.approval-preview dd {
  overflow-wrap: anywhere;
  margin: 3px 0 0;
  font-size: 13px;
}

.approval-phrase {
  margin: 14px 0 10px;
}

.approval-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.danger code {
  display: block;
  margin: 12px 0;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
}

.bulk-progress,
output {
  display: block;
  margin-top: 18px;
}

progress {
  width: 100%;
  margin-top: 8px;
}

footer {
  justify-content: center;
  gap: 20px;
  padding: 16px 30px;
  border-top: 1px solid #edf1f6;
  color: #8491a4;
  font-size: 11px;
}

footer span::before {
  content: "✓";
  margin-right: 5px;
  color: #0b8f63;
  font-weight: 800;
}

.loading {
  display: grid;
  min-height: 100vh;
  place-content: center;
  place-items: center;
  color: #64748b;
}

.loading span {
  width: 34px;
  height: 34px;
  border: 3px solid #dbe5f0;
  border-top-color: #0f6cbd;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loading p {
  margin-top: 12px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    margin: 10px auto;
  }

  .panel {
    border-radius: 17px;
  }

  .topbar,
  .hero,
  .section-heading,
  .select-row,
  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  .hero,
  .workspace {
    padding: 22px;
  }

  .status-pill {
    align-self: flex-start;
  }

  .overview-grid {
    grid-template-columns: 1fr;
    padding: 0 22px 22px;
  }

  .button {
    width: 100%;
  }

  .tenant-count {
    align-self: flex-start;
  }

  .approval-fields,
  .approval-preview dl {
    grid-template-columns: 1fr;
  }
}
