/* ICAM Abacus — global colourful informative admin change forms */

body.change-form.icam-change-form #content-main form > .flex.flex-col {
  gap: 1.25rem;
}

/* ── Overview hero (centre, meet, etc.) ─────────────────────────────────── */
.icam-change-form .icam-overview-shell,
.icam-change-form .mps-overview-shell {
  width: 100%;
  margin: 0 0 0.25rem;
}

.icam-change-form .icam-overview,
.icam-change-form .mps-overview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.icam-change-form .icam-hero,
.icam-change-form .mps-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(15rem, 0.9fr);
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  border-radius: calc(var(--admin-radius) * 1.15);
  border: 1px solid color-mix(in oklch, var(--admin-primary), white 72%);
  background:
    radial-gradient(
      ellipse 80% 120% at 100% 0%,
      color-mix(in oklch, var(--admin-primary), white 78%) 0%,
      transparent 55%
    ),
    linear-gradient(
      135deg,
      color-mix(in oklch, var(--admin-primary), white 88%) 0%,
      #ffffff 42%,
      color-mix(in oklch, var(--admin-accent-soft), white 35%) 100%
    );
  box-shadow:
    0 1px 0 color-mix(in oklch, white, transparent 25%) inset,
    0 12px 32px -18px color-mix(in oklch, var(--admin-primary), transparent 55%);
  overflow: hidden;
  position: relative;
}

@media (max-width: 900px) {
  .icam-change-form .icam-hero,
  .icam-change-form .mps-hero {
    grid-template-columns: 1fr;
  }
}

.icam-change-form .icam-hero__eyebrow,
.icam-change-form .mps-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: color-mix(in oklch, var(--admin-primary), white 82%);
  color: var(--admin-primary);
}

.icam-change-form .icam-hero__title,
.icam-change-form .mps-hero__title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--admin-foreground);
  line-height: 1.2;
}

.icam-change-form .icam-hero__lead,
.icam-change-form .mps-hero__lead {
  margin: 0;
  color: var(--admin-muted-fg);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 42rem;
}

.icam-change-form .icam-hero__card,
.icam-change-form .mps-hero__card {
  position: relative;
  z-index: 1;
  padding: 0.95rem 1rem;
  border-radius: calc(var(--admin-radius) * 0.95);
  border: 1px solid color-mix(in oklch, var(--admin-border), white 25%);
  background: color-mix(in oklch, white, transparent 8%);
  backdrop-filter: blur(6px);
}

.icam-change-form .icam-hero__card-title,
.icam-change-form .mps-hero__card-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--admin-muted-fg);
}

.icam-change-form .icam-stat-grid,
.icam-change-form .mps-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.65rem;
}

.icam-change-form .icam-stat,
.icam-change-form .mps-stat {
  padding: 0.75rem 0.85rem;
  border-radius: calc(var(--admin-radius) * 0.85);
  border: 1px solid var(--admin-border);
  background: white;
  box-shadow: var(--admin-card-shadow);
}

.icam-change-form .icam-stat__value,
.icam-change-form .mps-stat__value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--admin-primary);
  line-height: 1.1;
}

.icam-change-form .icam-stat__label,
.icam-change-form .mps-stat__label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--admin-muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.icam-change-form .icam-kv,
.icam-change-form .mps-kv {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.icam-change-form .icam-kv dt,
.icam-change-form .mps-kv dt {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-muted-fg);
}

.icam-change-form .icam-kv dd,
.icam-change-form .mps-kv dd {
  margin: 0.1rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--admin-foreground);
}

.icam-change-form .icam-status,
.icam-change-form .mps-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.icam-change-form .icam-status--ok,
.icam-change-form .mps-status-chip--ok {
  background: color-mix(in oklch, #16a34a, white 82%);
  color: #166534;
}

.icam-change-form .icam-status--warn,
.icam-change-form .mps-status-chip--warn {
  background: color-mix(in oklch, #d97706, white 82%);
  color: #92400e;
}

.icam-change-form .icam-status--muted,
.icam-change-form .mps-status-chip--muted {
  background: color-mix(in oklch, var(--admin-muted-fg), white 82%);
  color: var(--admin-muted-fg);
}

.icam-change-form .icam-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.icam-change-form .icam-hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--admin-primary), white 65%);
  background: var(--admin-primary);
  color: #fff !important;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none !important;
  cursor: pointer;
}

.icam-change-form .icam-hero__btn--ghost {
  background: white;
  color: var(--admin-primary) !important;
}

/* ── Colourful fieldset cards ───────────────────────────────────────────── */
.icam-change-form fieldset.module {
  overflow: hidden;
  border: 1px solid var(--admin-border) !important;
  background: white !important;
  box-shadow: var(--admin-card-shadow) !important;
}

.icam-change-form fieldset.module::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--icam-section-accent, var(--admin-primary)),
    color-mix(in oklch, var(--icam-section-accent, var(--admin-primary)), white 35%)
  );
}

.icam-change-form fieldset.module:nth-of-type(6n + 1) {
  --icam-section-accent: var(--admin-primary);
}

.icam-change-form fieldset.module:nth-of-type(6n + 2) {
  --icam-section-accent: #0ea5e9;
}

.icam-change-form fieldset.module:nth-of-type(6n + 3) {
  --icam-section-accent: #8b5cf6;
}

.icam-change-form fieldset.module:nth-of-type(6n + 4) {
  --icam-section-accent: #059669;
}

.icam-change-form fieldset.module:nth-of-type(6n + 5) {
  --icam-section-accent: #d97706;
}

.icam-change-form fieldset.module:nth-of-type(6n + 6) {
  --icam-section-accent: #db2777;
}

.icam-change-form fieldset.module h2,
.icam-change-form fieldset.module summary h2 {
  color: var(--admin-foreground) !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
}

.icam-change-form fieldset.module .text-subtle,
.icam-change-form fieldset.module .leading-relaxed.text-subtle {
  padding: 0.55rem 0.85rem 0;
  margin-bottom: 0.35rem !important;
  border-left: 3px solid color-mix(in oklch, var(--icam-section-accent, var(--admin-primary)), white 45%);
  background: color-mix(in oklch, var(--icam-section-accent, var(--admin-primary)), white 92%);
  border-radius: 0 calc(var(--admin-radius) * 0.65) calc(var(--admin-radius) * 0.65) 0;
  color: color-mix(in oklch, var(--admin-foreground), var(--admin-muted-fg) 25%) !important;
  font-size: 0.82rem !important;
  line-height: 1.5 !important;
}

.icam-change-form .tab-wrapper fieldset.module::before {
  display: none;
}

.icam-change-form [x-data*="activeFieldsetTab"] {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: hidden;
  background: white;
  box-shadow: var(--admin-card-shadow);
}

.icam-change-form [x-data*="activeFieldsetTab"] nav {
  background: linear-gradient(
    180deg,
    color-mix(in oklch, var(--admin-accent-soft), white 40%) 0%,
    white 100%
  ) !important;
}

.icam-change-form [x-data*="activeFieldsetTab"] nav a.active {
  background: white !important;
  font-weight: 800 !important;
}

.icam-change-form .inline-group {
  border-radius: var(--admin-radius) !important;
  border: 1px solid var(--admin-border) !important;
  overflow: hidden;
  box-shadow: var(--admin-card-shadow) !important;
}

.icam-change-form .inline-group h2,
.icam-change-form .inline-group .inline-heading {
  background: color-mix(in oklch, var(--admin-accent-soft), white 35%) !important;
  font-weight: 800 !important;
}

.icam-change-form .submit-row,
.icam-change-form footer .submit-row {
  border-radius: var(--admin-radius) !important;
  border: 1px solid var(--admin-border) !important;
  box-shadow: var(--admin-card-shadow) !important;
  background: linear-gradient(
    180deg,
    white 0%,
    color-mix(in oklch, var(--admin-accent-soft), white 55%) 100%
  ) !important;
}

/* Delete / danger actions — soft red fill, white label */
#submit-row a.bg-red-500,
#submit-row a.bg-red-600,
#submit-row a.bg-red-700,
#submit-row a[class*="bg-red-"],
a.bg-red-500,
a.bg-red-600,
a.bg-red-700,
button.bg-red-500,
button.bg-red-600,
button.bg-red-700,
a[href*="/delete/"].bg-red-600,
a[href*="/delete/"][class*="bg-red-"] {
  background: var(--admin-danger, oklch(0.64 0.12 22)) !important;
  background-image: none !important;
  border-color: var(--admin-danger-border, oklch(0.58 0.11 22)) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px -6px color-mix(in oklch, var(--admin-danger, oklch(0.64 0.12 22)), transparent 45%) !important;
}

#submit-row a.bg-red-500:link,
#submit-row a.bg-red-500:visited,
#submit-row a.bg-red-500:hover,
#submit-row a.bg-red-500:focus,
#submit-row a.bg-red-600:link,
#submit-row a.bg-red-600:visited,
#submit-row a.bg-red-600:hover,
#submit-row a.bg-red-600:focus,
#submit-row a.bg-red-700:link,
#submit-row a.bg-red-700:visited,
#submit-row a.bg-red-700:hover,
#submit-row a.bg-red-700:focus,
a[href*="/delete/"][class*="bg-red-"]:link,
a[href*="/delete/"][class*="bg-red-"]:visited,
a[href*="/delete/"][class*="bg-red-"]:hover,
a[href*="/delete/"][class*="bg-red-"]:focus {
  color: #ffffff !important;
}

#submit-row a[class*="bg-red-"]:hover,
a.bg-red-500:hover,
a.bg-red-600:hover,
a.bg-red-700:hover,
button.bg-red-500:hover,
button.bg-red-600:hover,
button.bg-red-700:hover,
a[href*="/delete/"][class*="bg-red-"]:hover {
  background: var(--admin-danger-hover, oklch(0.58 0.12 22)) !important;
  color: #ffffff !important;
}

/* Force white on icons/labels nested inside danger / primary submit controls */
#submit-row a[class*="bg-red-"] :is(span, i, svg, .material-symbols-outlined),
#submit-row a.bg-primary-600 :is(span, i, svg, .material-symbols-outlined),
#submit-row button.bg-primary-600 :is(span, i, svg, .material-symbols-outlined),
#submit-row input[type="submit"].default,
#submit-row input[type="submit"].bg-primary-600,
.icam-change-form .submit-row input[type="submit"],
.icam-change-form .submit-row a[class*="bg-red-"],
.icam-change-form .submit-row a.bg-primary-600 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
