/* Licence-specific content layout. Surfaces and controls come from ui.css. */
.licenses-page {
  min-width: 0;
}

.license-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 16px;
}

.license-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

.license-card {
  overflow-wrap: anywhere;
}

.license-card h3 {
  margin: 12px 0;
}

.license-card h3 span {
  display: block;
  margin-top: 4px;
  color: var(--ui-accent);
  font-size: 12px;
}

.license-card p {
  margin: 12px 0;
}

.license-journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.license-activity { margin: 18px 0; padding: 16px; border: 1px solid var(--ui-line); border-radius: 14px; }
.license-activity h4 { margin: 0 0 12px; font-size: 14px; font-weight: 750; }
.license-activity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.license-activity-grid > div { min-width: 0; }
.license-activity-grid span { display: block; color: var(--ui-muted); font-size: 12px; }
.license-activity-grid strong { display: block; margin-top: 5px; font-size: 15px; overflow-wrap: anywhere; }
.license-activity-grid small { font-size: 11px; font-weight: 500; color: var(--ui-muted); }
.license-short-link { color: var(--ui-accent); text-decoration: underline; }

.license-journey-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--ui-line);
  border-radius: 14px;
  background: rgba(15, 23, 42, .35);
}

.license-journey-step.current { border-color: var(--ui-accent); }
.license-journey-step.future { opacity: .65; }
.license-journey-number {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ui-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.license-journey-step.done .license-journey-number { background: #059669; }
.license-journey-step h4 { margin: 0; font-size: 14px; font-weight: 700; }
.license-journey-step p { margin: 4px 0 0; font-size: 13px; color: var(--ui-muted); }
.license-journey-step time { display: block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--ui-accent); }

.license-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
  font-size: 14px;
}

.license-card dt {
  color: var(--ui-muted);
}

.license-card dd {
  text-align: right;
}

.license-card details {
  padding: 16px 0;
  border-top: 1px solid var(--ui-line);
}

.license-card summary {
  cursor: pointer;
  font-weight: 600;
}

.license-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.license-catalog-card {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.5vw, 32px);
  border-radius: 24px;
  background: radial-gradient(circle at 92% 0%, rgba(var(--ui-rgb), .25), transparent 45%), linear-gradient(145deg, rgba(var(--ui-rgb), .13), var(--ui-end));
  box-shadow: var(--ui-shadow), 0 20px 45px rgba(0, 0, 0, .12);
}

.license-product-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.license-product-top .ui-badge { border-radius: 999px; }
.license-product-icon { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid rgba(var(--ui-rgb), .55); border-radius: 16px; background: rgba(var(--ui-rgb), .18); color: var(--ui-accent); font-size: 29px; line-height: 1; }
.license-catalog-card .ui-card-title { margin: 8px 0 0; font-size: clamp(28px, 3vw, 38px); line-height: 1.15; letter-spacing: -.035em; }
.license-public-intro { max-width: 1100px; margin: 0 0 22px; color: var(--ui-text); line-height: 1.6; }
.license-public-intro p + p { margin-top: 9px; color: var(--ui-muted); }
.license-catalog-card .license-catalog-lead { margin: 12px 0 18px; font-size: 17px; font-weight: 650; color: var(--ui-text); }
.license-product-price { margin: 0 0 22px !important; padding: 13px 16px; border: 1px solid rgba(var(--ui-rgb), .35); border-radius: 12px; background: rgba(var(--ui-rgb), .1); color: var(--ui-text); font-size: 15px; font-weight: 750; }
.license-catalog-details { display: grid; gap: 22px; margin-bottom: 28px; }
.license-catalog-details section { min-width: 0; }
.license-catalog-details h4 { margin: 0 0 10px; font-size: 13px; font-weight: 750; color: var(--ui-accent); text-transform: uppercase; letter-spacing: .06em; }
.license-catalog-details p { margin: 0; color: var(--ui-muted); line-height: 1.55; }
.license-catalog-details ul { margin: 0; padding: 0; list-style: none; color: var(--ui-text); line-height: 1.55; }
.license-catalog-details li { position: relative; padding-left: 26px; }
.license-catalog-details li::before { content: '✓'; position: absolute; left: 0; color: var(--ui-accent); font-weight: 800; }
.license-catalog-details li + li { margin-top: 12px; }
.license-product-cta { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: auto; width: 100%; text-align: center; }
.license-public-cta { margin-top: 20px; }

@media (min-width: 1000px) {
  .license-grid:has(.license-catalog-card) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
}

.license-card .license-catalog-note {
  margin-top: auto;
  padding-top: 16px;
}

.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.license-feedback {
  color: var(--ui-red);
  margin-top: 12px;
}

.licenses-empty-note {
  margin: 0 0 16px;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.6;
}

.license-badge {
  display: inline-flex;
  margin-left: 8px;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.license-inline-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--ui-line);
}

.license-inline-form label {
  display: block;
  margin: 12px 0;
  font-size: 14px;
}

.license-inline-form .ui-field {
  margin-top: 8px;
}

.license-inline-form textarea {
  resize: vertical;
}

@media (max-width: 767px) {
  .license-grid {
    grid-template-columns: minmax(0,1fr);
  }
  .license-journey { grid-template-columns: minmax(0,1fr); }
  .license-activity-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .license-catalog-details { grid-template-columns: minmax(0,1fr); gap: 18px; }

}

@media (max-width: 480px) {
  .license-activity-grid { grid-template-columns: minmax(0,1fr); }
  .license-card dl {
    grid-template-columns: minmax(0,1fr);
  }

  .license-card dd {
    text-align: left;
    margin-bottom: 8px;
  }

}

/* Admin Export: one allocation mode, then only the relevant commercial fields. */
.export-allocation {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.export-allocation [hidden] {
  display: none !important;
}

.export-allocation-step {
  min-width: 0;
  padding: 18px;
  border: 1px solid #42516d;
  border-radius: 16px;
  background: #101b2dcc;
}

.export-allocation-step h3 {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 750;
  color: #e2e8f0;
}

.export-allocation-step label {
  display: block;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
}

.export-allocation-step input:not([type=checkbox]):not([type=hidden]),.export-allocation-step select,.export-allocation-step textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 7px;
  padding: 11px 12px;
  border: 1px solid #536581;
  border-radius: 10px;
  background: #1e293b;
  color: #f8fafc;
  font: inherit;
  font-size: 14px;
}

.export-allocation-step textarea {
  resize: vertical;
}

.export-allocation-step p {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: #a9b9ce;
}

.export-allocation-step button {
  padding: 11px 14px;
  border: 1px solid #536581;
  border-radius: 10px;
  background: #243957;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.export-allocation-step button:hover {
  background: #30496b;
}

.export-allocation-step .export-checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
}

.export-allocation-step .export-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: #818cf8;
}

.export-allocation-step input:focus-visible,.export-allocation-step select:focus-visible,.export-allocation-step textarea:focus-visible,.export-allocation-step button:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

.export-field-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 12px;
}

.export-allocation-step .export-billing-options {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #42516d;
}

.export-billing-options summary {
  cursor: pointer;
  color: #b6c6dd;
  font-size: 12px;
}

.export-allocation-summary {
  border-color: #7661ba;
  background: linear-gradient(145deg,#292044,#101b2d);
}

.export-allocation-summary strong {
  display: block;
  color: #ddd6fe;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.export-allocation-step :disabled {
  opacity: .65;
  cursor: not-allowed;
}

html[data-theme=light] .export-allocation-step {
  background: #f6f8fc;
  border-color: #cbd5e1;
}

html[data-theme=light] .export-allocation-step h3,html[data-theme=light] .export-allocation-step label {
  color: #24334b;
}

html[data-theme=light] .export-allocation-step p,html[data-theme=light] .export-billing-options summary {
  color: #52627a;
}

html[data-theme=light] .export-allocation-summary {
  background: #f1edfc;
  border-color: #baace5;
}

html[data-theme=light] .export-allocation-summary strong {
  color: #57368a;
}
