.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.plan-store {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.plan-card {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.plan-card.selected {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 16px 34px rgba(var(--accent-rgb), 0.16);
  transform: translateY(-2px);
}

.plan-price {
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
}

.cart-panel {
  position: sticky;
  top: 88px;
  padding: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 16px 36px var(--shadow);
}

.cart-summary {
  display: grid;
  gap: 12px;
  min-height: 110px;
  padding: 14px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 8px;
  background: var(--subtle-bg);
}

.cart-summary.empty-cart {
  place-items: center;
  color: var(--muted);
  border-style: dashed;
}

.cart-summary span,
.checkout-box span {
  color: var(--muted);
  font-size: 12px;
}

.cart-summary strong,
.checkout-box strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.cart-total {
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.checkout-box {
  padding: 12px;
  border: 1px solid rgba(52, 199, 89, 0.24);
  border-radius: 8px;
  background: rgba(52, 199, 89, 0.09);
}

.purchase-history {
  margin-top: 14px;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--subtle-bg);
  border: 1px solid var(--line-soft);
}

.metric-row b {
  margin-left: 4px;
  color: var(--ink);
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--row-bg);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.activity-row:hover {
  transform: translateX(-2px);
  border-color: rgba(var(--accent-rgb), 0.22);
}

.activity-row strong,
.activity-row span {
  display: block;
}

.activity-row > div:first-child span {
  color: var(--muted);
  margin-top: 3px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
  font-size: 12px;
}

.badge.green {
  background: var(--green-soft);
  color: var(--green);
}

.badge.red {
  background: var(--red-soft);
  color: var(--red);
}

.badge.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.subscription-configurator { display: grid; gap: 16px; min-width: 0; }
.module-picker-section, .user-count-section { padding: 14px; border: 1px solid var(--line-soft); background: var(--panel-strong); }
.annual-term-badge { padding: 5px 9px; color: var(--green); background: var(--green-soft); border: 1px solid rgba(52,199,89,.2); border-radius: 6px; font-size: 11px; font-weight: 700; }
.module-store { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.subscription-module-card { position: relative; min-width: 0; min-height: 104px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--row-bg); cursor: pointer; transition: border-color .18s ease, background-color .18s ease, transform .18s ease; }
.subscription-module-card:hover { transform: translateY(-1px); border-color: rgba(var(--accent-rgb),.3); }
.subscription-module-card.selected { border-color: var(--green); background: var(--green-soft); }
.subscription-module-card > input { position: absolute; opacity: 0; pointer-events: none; }
.module-checkmark { width: 26px; height: 26px; display: grid; place-items: center; color: transparent; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-strong); }
.subscription-module-card.selected .module-checkmark { color: #fff; border-color: var(--green); background: var(--green); }
.module-card-copy { min-width: 0; }
.module-card-copy strong, .module-card-copy small, .subscription-module-card > b small { display: block; }
.module-card-copy small { margin-top: 5px; color: var(--muted); line-height: 1.7; }
.subscription-module-card > b { color: var(--ink); text-align: left; white-space: nowrap; }
.subscription-module-card > b small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; }
.user-count-output { min-width: 100px; color: var(--green); font-size: 17px; font-weight: 800; text-align: left; }
.user-count-range { width: 100%; height: 6px; margin-top: 18px; padding: 0; accent-color: var(--green); }
.range-limits { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 10px; }
.cart-price-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-price-line strong { margin: 0; }
.cart-module-summary strong { line-height: 1.8; }
.quote-loading { place-items: center; color: var(--muted); }
.table-secondary { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.subscription-pricing-admin { display: grid; gap: 14px; }
.subscription-pricing-admin table input { min-width: 130px; }
.compact-admin-form { align-items: end; margin-bottom: 12px; }
.company-plan-form { min-width: min(760px, 78vw); }
.company-plan-modules { max-height: 330px; overflow-y: auto; padding: 2px; }
.company-plan-form .checkline span { display: grid; gap: 4px; }
.company-plan-form .checkline small, .plan-current-summary small { color: var(--muted); font-weight: 400; line-height: 1.7; }
.plan-current-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.plan-current-summary small { grid-column: 1 / -1; }

@media (max-width: 980px) {
  .purchase-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
}

@media (max-width: 680px) {
  .module-store { grid-template-columns: 1fr; }
  .module-picker-section, .user-count-section, .cart-panel { padding: 11px; }
  .subscription-module-card { grid-template-columns: 28px minmax(0, 1fr); }
  .subscription-module-card > b { grid-column: 2; text-align: right; }
  .company-plan-form { min-width: 0; width: 100%; }
}
