:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: #f4f4f4;
  background: #0b0b0b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #0b0b0b;
}

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

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid #262626;
  background: #111;
}

.brand {
  font-weight: 800;
  font-size: 21px;
  margin-bottom: 28px;
}

.brand span { color: #ffd21c; }

.nav a {
  display: block;
  padding: 10px 12px;
  margin: 3px 0;
  border-radius: 8px;
  color: #bbb;
}

.nav a:hover {
  color: #fff;
  background: #1c1c1c;
}

.main {
  padding: 30px;
  overflow: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.ready {
  color: #83df9a;
  font-size: 13px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.card,
.panel {
  border: 1px solid #292929;
  background: #141414;
  border-radius: 12px;
}

.card {
  padding: 18px;
}

.card small {
  color: #888;
  display: block;
  margin-bottom: 8px;
}

.card strong {
  font-size: 27px;
}

.panel {
  overflow: hidden;
}

.panel h2 {
  margin: 0;
  padding: 18px;
  font-size: 17px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 12px 14px;
  border-top: 1px solid #252525;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #888;
  font-weight: 600;
}

td {
  color: #ddd;
}

.login {
  width: 360px;
  margin: 15vh auto 0;
  padding: 28px;
  border: 1px solid #292929;
  border-radius: 14px;
  background: #141414;
}

.login h1 {
  margin-top: 0;
}

input {
  width: 100%;
  padding: 12px;
  margin: 7px 0 14px;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 8px;
  color: white;
}

button {
  border: 0;
  border-radius: 8px;
  background: #ffd21c;
  color: #111;
  font-weight: 700;
  padding: 11px 15px;
  cursor: pointer;
}

.error {
  color: #ff8c8c;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   Commerce Studio v1.1
   ========================================================= */

.environment {
  position: absolute;
  bottom: 22px;
  left: 18px;
}

.sidebar {
  position: relative;
}

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

.inline-form {
  display: inline;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
}

.badge.test {
  color: #ffd21c;
  background: rgba(255,210,28,.10);
  border: 1px solid rgba(255,210,28,.30);
}

.badge.production {
  color: #8ce99a;
  background: rgba(140,233,154,.10);
  border: 1px solid rgba(140,233,154,.25);
}

.badge.status {
  color: #ddd;
  background: #242424;
  border: 1px solid #333;
}

.badge.status.active,
.badge.status.paid,
.badge.status.succeeded {
  color: #8ce99a;
  border-color: rgba(140,233,154,.30);
  background: rgba(140,233,154,.08);
}

.badge.status.past-due,
.badge.status.failed {
  color: #ffb86b;
  border-color: rgba(255,184,107,.30);
  background: rgba(255,184,107,.08);
}

.badge.status.canceled,
.badge.status.revoked {
  color: #ff8c8c;
  border-color: rgba(255,140,140,.30);
  background: rgba(255,140,140,.08);
}

.notice {
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 10px;
}

.test-notice {
  background: rgba(255,210,28,.07);
  border: 1px solid rgba(255,210,28,.25);
  color: #d6d6d6;
}

.test-notice strong {
  color: #ffd21c;
  margin-right: 8px;
}

.service-panel {
  max-width: 700px;
  margin-top: 24px;
}

.service-row {
  display: flex;
  justify-content: space-between;
  padding: 13px 18px;
  border-top: 1px solid #252525;
}

.service-ok {
  color: #83df9a;
}

.service-bad {
  color: #ff8c8c;
}

.search-form {
  display: flex;
  gap: 10px;
  max-width: 650px;
  margin-bottom: 20px;
}

.search-form input {
  margin: 0;
}

.entity-link {
  color: #ffd21c;
}

.entity-link:hover {
  text-decoration: underline;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #292929;
  border-radius: 12px;
  background: #141414;
}

.detail-header h2 {
  margin: 0 0 9px 0;
}

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

.detail-item {
  padding: 15px;
  background: #141414;
  border: 1px solid #292929;
  border-radius: 10px;
  overflow: hidden;
}

.detail-item span {
  display: block;
  color: #888;
  font-size: 12px;
  margin-bottom: 7px;
}

.detail-item strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.section-title {
  margin-top: 28px;
  font-size: 18px;
}

.empty {
  padding: 24px;
  color: #888;
}

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

/* =========================================================
   Commerce Studio v1.2
   ========================================================= */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.layout {
  width: 100%;
  min-width: 0;
}

.main {
  min-width: 0;
  width: 100%;
}

.panel {
  max-width: 100%;
  overflow-x: auto;
}

table {
  min-width: 720px;
}

.cards {
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(175px, 1fr)
    );
}

.metric-primary {
  border-color:
    rgba(255,210,28,.35);
}

.metric-primary strong {
  color: #ffd21c;
}

.metric-section-title {
  margin:
    10px 0 12px;
  color: #9b9b9b;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.production-notice {
  background:
    rgba(140,233,154,.06);
  border:
    1px solid
    rgba(140,233,154,.22);
  color: #d6d6d6;
}

.production-notice strong {
  color: #8ce99a;
  margin-right: 8px;
}

.filter-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 16px;
}

.filter-tab {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid #303030;
  color: #999;
}

.filter-tab:hover {
  color: #fff;
  background: #171717;
}

.filter-tab.active {
  color: #111;
  background: #ffd21c;
  border-color: #ffd21c;
  font-weight: 800;
}

.result-summary {
  color: #888;
  font-size: 12px;
  margin-bottom: 10px;
}

.small-value {
  font-size: 18px !important;
}

.customer-kpis {
  margin-bottom: 18px;
}

.timeline {
  overflow: hidden;
}

.timeline-row {
  display: grid;
  grid-template-columns:
    14px minmax(0,1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid #252525;
}

.timeline-row:first-child {
  border-top: 0;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #777;
}

.timeline-dot.payment {
  background: #83df9a;
}

.timeline-dot.subscription {
  background: #ffd21c;
}

.timeline-dot.access {
  background: #79b8ff;
}

.timeline-dot.warning {
  background: #ff8c8c;
}

.timeline-content {
  min-width: 0;
}

.timeline-content strong,
.timeline-content span {
  display: block;
}

.timeline-content span {
  margin-top: 3px;
  color: #888;
  font-size: 12px;
}

.timeline-row time {
  color: #777;
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .main {
    padding: 20px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .timeline-row {
    grid-template-columns:
      12px minmax(0,1fr);
  }

  .timeline-row time {
    grid-column: 2;
  }
}

/* =========================================================
   Commerce Studio v1.3
   ========================================================= */

.dashboard-columns {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.readiness-panel,
.service-panel {
  max-width: none;
  margin-top: 0;
}

.readiness-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  border-top: 1px solid #252525;
}

.readiness-badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  white-space: nowrap;
}

.readiness-badge.ready {
  color: #8ce99a;
  background: rgba(140,233,154,.08);
  border: 1px solid rgba(140,233,154,.28);
}

.readiness-badge.candidate {
  color: #ffd21c;
  background: rgba(255,210,28,.08);
  border: 1px solid rgba(255,210,28,.30);
}

.readiness-badge.not_verified {
  color: #aaa;
  background: rgba(180,180,180,.07);
  border: 1px solid #383838;
}

.readiness-badge.attention {
  color: #ff8c8c;
  background: rgba(255,140,140,.08);
  border: 1px solid rgba(255,140,140,.30);
}

.audit-event {
  color: #ffd21c;
  font-weight: 700;
}

td small {
  color: #888;
}

@media (max-width: 1050px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Payment Provider Registry
   ========================================================= */

.provider-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.provider-card {
  padding: 18px;
  background: #141414;
  border: 1px solid #2c2c2c;
  border-radius: 12px;
}

.provider-card.primary {
  border-color: rgba(255,210,28,.40);
}

.provider-card.secondary {
  border-color: rgba(121,184,255,.30);
}

.provider-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.provider-card h3 {
  margin: 0 0 3px;
  font-size: 20px;
}

.provider-code {
  color: #777;
  font-size: 12px;
}

.provider-role {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.provider-role.primary {
  color: #ffd21c;
  border: 1px solid rgba(255,210,28,.35);
}

.provider-role.secondary {
  color: #79b8ff;
  border: 1px solid rgba(121,184,255,.30);
}

.provider-role.neutral {
  color: #aaa;
  border: 1px solid #383838;
}

.provider-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #242424;
  font-size: 13px;
}

.provider-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
}

.provider-capabilities span {
  padding: 5px 8px;
  border-radius: 7px;
  background: #1b1b1b;
  font-size: 11px;
}

.provider-capabilities .yes {
  color: #8ce99a;
}

.provider-capabilities .no {
  color: #777;
}

.provider-footer {
  margin-top: 16px;
  color: #888;
  font-size: 12px;
}

.provider-policy {
  margin-bottom: 20px;
}
