/**
 * Entitlement — Zyareo Phase 9B
 * Lease status · ModuleLicense products · activate/renew.
 * Prefixed body.ent / .ent-*. Runtime authority = ModuleLicense (not Starter/Growth labels).
 */

body.ent {
  color: var(--zy-text);
}

body.ent .ops-main > .muted {
  max-width: 46rem;
  line-height: var(--zy-leading-normal);
}

body.ent .ent-purpose {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  margin: 0 0 var(--zy-space-4);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-md);
  background: var(--zy-emerald-soft);
  color: var(--zy-emerald-deep);
  font-size: var(--zy-text-xs);
  font-weight: var(--zy-weight-semibold);
  letter-spacing: var(--zy-tracking-wide);
  text-transform: uppercase;
}

body.ent .ent-note {
  margin: 0 0 var(--zy-space-4);
  padding: var(--zy-space-3);
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-md);
  background: var(--zy-gold-soft);
  color: var(--zy-warning);
  font-size: var(--zy-text-sm);
  max-width: 46rem;
}

body.ent .ent-layout {
  display: grid;
  gap: var(--zy-space-5);
  grid-template-columns: 1fr;
  align-items: start;
  margin-top: var(--zy-space-4);
}

@media (min-width: 768px) {
  body.ent .ent-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ent .ent-layout > .ops-card:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1280px) {
  body.ent .ent-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.ent .ent-layout > .ops-card:nth-child(3) {
    grid-column: auto;
  }
}

body.ent .ops-card {
  background: var(--zy-white);
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-lg);
  box-shadow: var(--zy-shadow-sm);
  padding: var(--zy-space-4);
  min-width: 0;
}

body.ent .ops-card h2 {
  margin: 0 0 var(--zy-space-3);
  font-size: var(--zy-text-lg);
  font-weight: var(--zy-weight-semibold);
  color: var(--zy-charcoal);
}

body.ent .ops-card h3 {
  margin: var(--zy-space-4) 0 var(--zy-space-2);
  font-size: var(--zy-text-sm);
  font-weight: var(--zy-weight-semibold);
  letter-spacing: var(--zy-tracking-wide);
  text-transform: uppercase;
  color: var(--zy-emerald-deep);
}

body.ent .ops-card h3:first-of-type {
  margin-top: var(--zy-space-2);
}

body.ent .ent-form {
  display: grid;
  gap: var(--zy-space-3);
}

body.ent .ent-form label {
  display: grid;
  gap: var(--zy-space-1);
  font-size: var(--zy-text-sm);
  font-weight: var(--zy-weight-medium);
  color: var(--zy-charcoal);
}

body.ent .ent-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--zy-text-sm);
  min-height: 6rem;
  padding: 0.75rem;
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-md);
  background: var(--zy-white);
  color: var(--zy-text);
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}

body.ent .ent-form textarea:focus {
  outline: none;
  border-color: var(--zy-emerald);
  box-shadow: var(--zy-focus-ring);
}

body.ent .ent-form .btn,
body.ent .ops-actions .btn {
  min-height: 2.75rem;
  min-width: 8rem;
}

body.ent .ent-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  margin: 0 0 var(--zy-space-3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--zy-radius-md);
  font-size: var(--zy-text-xs);
  font-weight: var(--zy-weight-semibold);
  letter-spacing: var(--zy-tracking-wide);
  text-transform: uppercase;
  background: var(--zy-neutral-soft);
  color: var(--zy-neutral);
}

body.ent .ent-badge.tone-ok {
  background: var(--zy-success-soft);
  color: var(--zy-success);
}

body.ent .ent-badge.tone-warn {
  background: var(--zy-warning-soft);
  color: var(--zy-warning);
}

body.ent .ent-badge.tone-danger {
  background: var(--zy-error-soft);
  color: var(--zy-error);
}

body.ent .ent-badge.tone-muted {
  background: var(--zy-neutral-soft);
  color: var(--zy-neutral);
}

body.ent #status-title {
  margin: 0 0 var(--zy-space-2);
  font-size: var(--zy-text-xl);
  font-weight: var(--zy-weight-semibold);
  color: var(--zy-charcoal);
}

body.ent .ent-meta {
  display: grid;
  grid-template-columns: minmax(7rem, auto) minmax(0, 1fr);
  gap: var(--zy-space-2) var(--zy-space-3);
  margin: var(--zy-space-4) 0 0;
  font-size: var(--zy-text-sm);
}

body.ent .ent-meta dt {
  margin: 0;
  color: var(--zy-text-muted);
  font-weight: var(--zy-weight-medium);
}

body.ent .ent-meta dd {
  margin: 0;
  word-break: break-word;
  color: var(--zy-charcoal);
}

body.ent #status-card.tone-danger {
  border-color: color-mix(in srgb, var(--zy-error) 40%, var(--zy-border));
  background: color-mix(in srgb, var(--zy-error-soft) 35%, var(--zy-white));
}

body.ent #status-card.tone-warn {
  border-color: color-mix(in srgb, var(--zy-warning) 40%, var(--zy-border));
  background: color-mix(in srgb, var(--zy-warning-soft) 40%, var(--zy-white));
}

body.ent #status-card.tone-ok {
  border-color: color-mix(in srgb, var(--zy-success) 35%, var(--zy-border));
}

body.ent .ent-module-list {
  list-style: none;
  margin: 0 0 var(--zy-space-4);
  padding: 0;
  display: grid;
  gap: var(--zy-space-2);
  font-size: var(--zy-text-sm);
}

body.ent .ent-module-list li {
  margin: 0;
  padding: var(--zy-space-3);
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-md);
  background: var(--zy-white);
  border-left: 3px solid var(--zy-border-strong);
  word-break: break-word;
}

body.ent #modules-active li {
  border-left-color: var(--zy-success);
  background: var(--zy-success-soft);
}

body.ent #modules-inactive li {
  border-left-color: var(--zy-border-strong);
  background: var(--zy-ivory);
  color: var(--zy-text-muted);
}

body.ent .tiny {
  font-size: var(--zy-text-xs);
  color: var(--zy-text-muted);
}

body.ent #post-activate {
  margin-top: var(--zy-space-5);
  padding: var(--zy-space-3);
  border: 1px solid var(--zy-border);
  border-radius: var(--zy-radius-md);
  background: var(--zy-emerald-soft);
  max-width: 46rem;
}

@media (max-width: 640px) {
  body.ent .ent-meta {
    grid-template-columns: 1fr;
    gap: var(--zy-space-1);
  }

  body.ent .ent-meta dt {
    margin-top: var(--zy-space-2);
  }

  body.ent .ent-meta dt:first-child {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ent * {
    transition: none !important;
    animation: none !important;
  }
}
