:root {
  --ekolab-navy: #061a3d;
  --ekolab-navy-2: #0b1f4d;
  --ekolab-blue: #2d7ff9;
  --ekolab-gold: #ffb733;
  --ekolab-green: #22c55e;
  --ekolab-ink: #071735;
  --ekolab-muted: #6b7890;
  --ekolab-line: rgba(11, 31, 77, 0.14);
  --ekolab-soft: #f6f8fb;
  --ekolab-white: #ffffff;
}

.ekolab-command-shell {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(14px, 3vw, 40px);
  overflow: auto;
  background:
    linear-gradient(135deg, rgba(3, 10, 25, 0.86), rgba(11, 31, 77, 0.72)),
    rgba(4, 12, 28, 0.78);
  backdrop-filter: blur(18px);
}

.ekolab-command-panel {
  width: min(1180px, 100%);
  min-height: min(880px, calc(100vh - 48px));
  margin: auto;
  color: var(--ekolab-white);
  background:
    linear-gradient(145deg, rgba(11, 31, 77, 0.98), rgba(4, 17, 39, 0.98)),
    #071735;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(2, 10, 26, 0.42);
  overflow: hidden;
}

.ekolab-command-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.ekolab-command-topbar h2,
.ekolab-command-topbar h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(24px, 4vw, 44px);
  line-height: 1.02;
  letter-spacing: 0;
}

.ekolab-icon-button {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  cursor: pointer;
}

.ekolab-icon-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.ekolab-eyebrow {
  margin: 0 0 10px;
  color: var(--ekolab-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ekolab-command-body {
  padding: clamp(18px, 3vw, 34px);
}

.study-plan-grid,
.governance-grid {
  display: grid;
  gap: 18px;
}

.study-plan-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.study-plan-section,
.study-plan-summary,
.governance-board,
.governance-side-panel,
.governance-metric {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ekolab-ink);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  box-shadow: 0 20px 55px rgba(2, 10, 26, 0.18);
}

.study-plan-section,
.study-plan-summary,
.governance-board,
.governance-side-panel {
  padding: clamp(18px, 3vw, 28px);
}

.study-plan-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.study-plan-section h3,
.study-plan-summary h3,
.governance-board h3,
.governance-side-panel h3 {
  margin: 0;
  color: var(--ekolab-ink);
  font-size: clamp(21px, 2.4vw, 32px);
  line-height: 1.12;
  letter-spacing: 0;
}

.study-plan-section p,
.study-plan-summary p,
.governance-board p,
.governance-side-panel p,
.study-plan-preview-card p {
  color: var(--ekolab-muted);
}

.study-plan-pill,
.ekolab-tiny-notice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  color: #7a4b00;
  background: #fff2d7;
  border: 1px solid rgba(255, 183, 51, 0.34);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.study-plan-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.study-plan-fields label {
  display: grid;
  gap: 8px;
  color: var(--ekolab-ink);
  font-size: 13px;
  font-weight: 900;
}

.study-plan-fields input,
.study-plan-fields select,
.study-plan-fields textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--ekolab-ink);
  background: #ffffff;
  border: 1px solid rgba(11, 31, 77, 0.18);
  border-radius: 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(11, 31, 77, 0.03);
}

.study-plan-fields textarea {
  min-height: 110px;
  padding-block: 14px;
  resize: vertical;
}

.study-plan-fields input:focus,
.study-plan-fields select:focus,
.study-plan-fields textarea:focus {
  border-color: rgba(45, 127, 249, 0.72);
  box-shadow: 0 0 0 4px rgba(45, 127, 249, 0.12);
}

.plan-size-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
  padding: 8px;
  background: #eef4ff;
  border: 1px solid rgba(45, 127, 249, 0.14);
  border-radius: 18px;
}

.plan-size-option {
  min-height: 54px;
  padding: 12px 14px;
  color: var(--ekolab-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

.plan-size-option.is-selected,
.plan-size-option[aria-pressed="true"] {
  color: #061a3d;
  background: #ffffff;
  border-color: rgba(45, 127, 249, 0.22);
  box-shadow: 0 14px 30px rgba(45, 127, 249, 0.14);
}

.subject-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.subject-choice-card {
  min-height: 96px;
  padding: 15px;
  text-align: left;
  color: var(--ekolab-ink);
  background: #ffffff;
  border: 1px solid var(--ekolab-line);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.subject-choice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 127, 249, 0.34);
  box-shadow: 0 18px 34px rgba(11, 31, 77, 0.1);
}

.subject-choice-card.is-selected,
.subject-choice-card[aria-pressed="true"] {
  border-color: rgba(34, 197, 94, 0.7);
  background: linear-gradient(180deg, #ffffff, #f0fff7);
  box-shadow: 0 16px 34px rgba(34, 197, 94, 0.15);
}

.subject-choice-card.is-locked {
  opacity: 0.75;
  cursor: not-allowed;
}

.subject-choice-card strong {
  display: block;
  color: var(--ekolab-ink);
  font-size: 15px;
  line-height: 1.2;
}

.subject-choice-card span {
  display: block;
  margin-top: 8px;
  color: var(--ekolab-muted);
  font-size: 12px;
  line-height: 1.35;
}

.study-plan-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 22px -28px -28px;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), #ffffff);
  border-top: 1px solid var(--ekolab-line);
}

.ekolab-primary-button,
.ekolab-secondary-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

.ekolab-primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #123b88, var(--ekolab-blue));
  border: 0;
  box-shadow: 0 18px 36px rgba(45, 127, 249, 0.28);
}

.ekolab-secondary-button {
  color: var(--ekolab-ink);
  background: #ffffff;
  border: 1px solid var(--ekolab-line);
}

.study-plan-preview-card {
  padding: 18px;
  background: linear-gradient(160deg, #071735, #0b2c69);
  border-radius: 20px;
  color: #ffffff;
}

.study-plan-preview-card h4 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 22px;
}

.study-plan-preview-card p {
  color: rgba(255, 255, 255, 0.76);
}

.study-plan-rules {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.study-plan-rules li {
  padding: 12px 14px;
  color: var(--ekolab-ink);
  background: #f7f9fd;
  border: 1px solid var(--ekolab-line);
  border-radius: 14px;
  font-weight: 800;
}

.governance-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.governance-metric {
  padding: 18px;
}

.governance-metric span {
  color: var(--ekolab-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.governance-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ekolab-ink);
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1;
}

.governance-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.governance-table {
  display: grid;
  gap: 12px;
}

.governance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--ekolab-line);
  border-radius: 18px;
}

.governance-row h4 {
  margin: 0;
  color: var(--ekolab-ink);
  font-size: 17px;
}

.governance-row p {
  margin: 8px 0 0;
}

.governance-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.governance-row-actions button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--ekolab-ink);
  background: #ffffff;
  border: 1px solid var(--ekolab-line);
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}

.governance-row-actions button[data-action="approve"] {
  color: #0f7b3b;
  background: #effdf5;
  border-color: rgba(34, 197, 94, 0.28);
}

.governance-row-actions button[data-action="flag"] {
  color: #991b1b;
  background: #fff5f5;
  border-color: rgba(239, 68, 68, 0.22);
}

.governance-checklist {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.governance-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  color: var(--ekolab-ink);
  background: #f7f9fd;
  border: 1px solid var(--ekolab-line);
  border-radius: 14px;
  font-weight: 800;
}

.governance-audit-result {
  min-height: 54px;
  padding: 14px;
  color: #064e3b;
  background: #ecfdf5;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 14px;
  font-weight: 800;
}

.ekolab-qc-nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-top: 10px;
  padding: 10px 14px;
  color: #ffffff;
  background: rgba(45, 127, 249, 0.14);
  border: 1px solid rgba(45, 127, 249, 0.28);
  border-radius: 16px;
  font-weight: 900;
  cursor: pointer;
}

.ekolab-qc-nav:hover {
  background: rgba(45, 127, 249, 0.22);
}

@media (max-width: 980px) {
  .study-plan-grid,
  .governance-layout {
    grid-template-columns: 1fr;
  }

  .governance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subject-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ekolab-command-shell {
    padding: 0;
  }

  .ekolab-command-panel {
    min-height: 100vh;
    border-radius: 0;
  }

  .study-plan-fields,
  .subject-choice-grid,
  .governance-grid {
    grid-template-columns: 1fr;
  }

  .study-plan-actions {
    margin-inline: -18px;
    margin-bottom: -18px;
    padding-inline: 18px;
    flex-direction: column-reverse;
  }

  .ekolab-primary-button,
  .ekolab-secondary-button {
    width: 100%;
  }

  .governance-row {
    grid-template-columns: 1fr;
  }

  .governance-row-actions {
    justify-content: stretch;
  }

  .governance-row-actions button {
    flex: 1 1 120px;
  }
}
