/* ==============================================================================
   DISTRIHUB SUBSCRIPTION & LICENSE STYLES (ANNUAL BILLING & COMPACT DENSITY)
   ============================================================================== */

.license-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 20px;
}

/* Topbar */
.license-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.license-title {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.license-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.45;
}

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

/* Alert Notification Banners */
.license-banner {
  display: none;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.45;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.license-banner.visible {
  display: flex;
}

.license-banner.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.license-banner.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.license-banner.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.license-banner.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.license-banner-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
}

.license-banner-content {
  flex: 1;
}

.license-banner-close {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

.license-banner-close:hover {
  opacity: 1;
}

/* Spinner */
.dh-spin {
  animation: dhSpin 1s linear infinite;
  display: inline-block;
}

@keyframes dhSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Active Subscription Hero Card */
.active-sub-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
  box-shadow: 0 2px 4px -1px rgba(15, 23, 42, 0.04);
}

.active-sub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 14px;
}

.active-sub-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.active-sub-plan-name {
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-pill.active {
  background: #dcfce7;
  color: #15803d;
}

.status-pill.expired {
  background: #fee2e2;
  color: #b91c1c;
}

.active-sub-meta {
  font-size: 12px;
  color: #64748b;
}

.active-sub-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #475569;
  font-size: 11.5px;
}

/* Quota & Usage Grid — 5 Equal Columns on Desktop */
.quota-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .quota-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .quota-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.quota-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 84px;
}

.quota-box-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  gap: 6px;
  line-height: 1.3;
}

.quota-box-val {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.quota-box-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* Feature Capability Pills */
.feature-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.app-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.app-access-badge.enabled {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.app-access-badge.disabled {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

/* Available Plans Section */
.plans-section-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.plans-section-subtitle {
  font-size: 12.5px;
  color: #64748b;
  margin: 0 0 16px 0;
}

/* Plans Grid — Strict 4 columns on wide screens, 2 on medium, 1 on mobile */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 1023px) {
  .plans-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .plans-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Plan Card */
.dh-plan-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.dh-plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -3px rgba(15, 23, 42, 0.08);
}

.dh-plan-card.current {
  border: 2px solid #2563eb;
  box-shadow: 0 6px 16px -3px rgba(37, 99, 235, 0.15);
}

.current-plan-indicator {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Four Theme Styles */
.dh-plan-card.theme-slate {
  border-top: 3px solid #64748b;
}
.dh-plan-card.theme-teal {
  border-top: 3px solid #0d9488;
}
.dh-plan-card.theme-blue {
  border-top: 3px solid #2563eb;
}
.dh-plan-card.theme-violet {
  border-top: 3px solid #7c3aed;
}

.plan-card-header {
  margin-bottom: 12px;
}

.plan-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.plan-code-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}

.theme-slate .plan-code-badge { background: #f1f5f9; color: #475569; }
.theme-teal .plan-code-badge { background: #ccfbf1; color: #0f766e; }
.theme-blue .plan-code-badge { background: #dbeafe; color: #1e40af; }
.theme-violet .plan-code-badge { background: #ede9fe; color: #6d28d9; }

.plan-discount-pill {
  background: #fef3c7;
  color: #92400e;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #fde68a;
  letter-spacing: 0.02em;
}

.plan-name {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}

.launch-offer-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #facc15;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.plan-pricing-container {
  margin-bottom: 8px;
}

.plan-strike-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.plan-price-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.plan-discount-tag {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 2px;
}

.plan-price-val {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.plan-price-strike {
  font-size: 13.5px;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 600;
}

.plan-price-period {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.plan-gst-note {
  font-size: 11px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  margin-top: 4px;
  margin-bottom: 6px;
  line-height: 1.35;
}

.plan-gst-note strong {
  color: #0f172a;
  font-weight: 700;
}

.plan-renewal-note {
  font-size: 10.5px;
  color: #d97706;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.3;
}

.plan-unconfirmed-note {
  font-size: 11px;
  color: #b45309;
  background: #fffbeb;
  border: 1px dashed #fde68a;
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-weight: 600;
}

.plan-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
  min-height: 32px;
}

/* Add-on Workstation Selector */
.plan-addon-wrapper {
  margin-top: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.plan-addon-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 4px;
}

.plan-addon-select {
  width: 100%;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.plan-addon-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Limits List */
.plan-limits-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px 0;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  font-size: 12px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.plan-limits-item {
  display: flex;
  align-items: center;
  gap: 7px;
}

.plan-limits-item.highlight {
  font-weight: 600;
  color: #0f172a;
}

.plan-limits-icon {
  width: 15px;
  height: 15px;
  color: #10b981;
  flex-shrink: 0;
}

.plan-limits-icon.disabled {
  color: #cbd5e1;
}

.provisional-tag {
  font-size: 10px;
  font-style: normal;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}

/* Footer & Action Buttons */
.plan-card-footer {
  margin-top: auto;
  padding-top: 8px;
}

.btn-plan-action {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-plan-action.primary {
  background: #2563eb;
  color: #ffffff;
}

.btn-plan-action.primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-plan-action.theme-teal-btn {
  background: #0d9488;
  color: #ffffff;
}
.btn-plan-action.theme-teal-btn:hover:not(:disabled) {
  background: #0f766e;
}

.btn-plan-action.theme-blue-btn {
  background: #2563eb;
  color: #ffffff;
}
.btn-plan-action.theme-blue-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-plan-action.theme-violet-btn {
  background: #7c3aed;
  color: #ffffff;
}
.btn-plan-action.theme-violet-btn:hover:not(:disabled) {
  background: #6d28d9;
}

.btn-plan-action.secondary {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-plan-action.secondary:hover:not(:disabled) {
  background: #f1f5f9;
}

.btn-plan-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .license-page {
    padding: 12px;
  }
  .license-topbar {
    flex-direction: column;
    gap: 10px;
  }
}