@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #eef3f8;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: #ffffff;
  --line: rgba(21, 36, 52, 0.1);
  --line-strong: rgba(21, 36, 52, 0.14);
  --ink: #17304a;
  --muted: #617689;
  --blue: #1f76bd;
  --blue-strong: #105f9d;
  --blue-soft: #e9f2fb;
  --green: #2fa36e;
  --green-soft: #e6f6ee;
  --orange: #f28a1a;
  --orange-soft: #fff1df;
  --danger-soft: #fbe9e4;
  --danger-text: #a24f39;
  --success-soft: #ecf9f1;
  --success-text: #26734c;
  --shadow: 0 22px 54px rgba(21, 36, 52, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(47, 163, 110, 0.12), transparent 28rem),
    radial-gradient(circle at top right, rgba(31, 118, 189, 0.12), transparent 24rem),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
  font-family: inherit;
}

.page {
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.hidden {
  display: none !important;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.subtle,
.selection-card span,
.empty-panel,
.table-empty,
.payload-copy {
  color: var(--muted);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.status-card {
  margin-bottom: 18px;
  transition: border-color 140ms ease, background 140ms ease;
}

.status-card p {
  margin: 0;
}

.status-card.is-error {
  background: #fff7f4;
  border-color: rgba(162, 79, 57, 0.24);
}

.status-card.is-success {
  background: #f2fcf7;
  border-color: rgba(38, 115, 76, 0.24);
}

.auth-panel {
  max-width: 760px;
}

.panel-header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  margin-bottom: 18px;
}

.compact-header {
  margin-bottom: 14px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 6px;
}

.stack {
  display: grid;
  gap: 14px;
}

.stack.compact {
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.inline-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-toggle input {
  width: auto;
  margin: 0;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(21, 36, 52, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--ink);
  background: #fbfdff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(31, 118, 189, 0.4);
  box-shadow: 0 0 0 4px rgba(31, 118, 189, 0.12);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-strong) 100%);
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, opacity 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.button-secondary,
.button-ghost,
.scope-chip,
.history-tab {
  background: #eef3f8;
  color: var(--ink);
  box-shadow: none;
}

.button-ghost {
  padding: 9px 14px;
}

.workspace-header {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.utility-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(202, 210, 218, 0.68);
  border: 1px solid rgba(112, 129, 144, 0.18);
}

.utility-meta,
.utility-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.utility-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green) 0%, #20865a 100%);
}

.utility-copy,
.utility-label {
  color: #30475f;
  font-size: 0.92rem;
}

.brand-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--green) 0%, #1b8a80 100%);
}

.brand-strip h1 {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
}

.brand-copy {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-strong) 100%);
  box-shadow: var(--shadow);
}

.nav-link {
  flex: 1 1 220px;
  min-width: 200px;
  border-radius: 0;
  padding: 16px 18px;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: none;
  border-bottom: 4px solid transparent;
}

.nav-link:hover {
  transform: none;
  filter: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border-bottom-color: var(--orange);
}

.context-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
}

.context-card {
  display: grid;
  gap: 8px;
  min-height: 100%;
}

.context-card strong,
.selection-card strong {
  font-size: 1.02rem;
}

.selection-card {
  display: grid;
  gap: 6px;
}

.workspace-main {
  display: block;
}

.workspace-section {
  display: none;
  animation: sectionFade 180ms ease;
}

.workspace-section.is-active {
  display: block;
}

@keyframes sectionFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.summary-grid,
.quick-grid,
.meta-grid {
  display: grid;
  gap: 14px;
}

.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-card,
.quick-card,
.meta-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(21, 36, 52, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  font-family: "Space Grotesk", "Manrope", sans-serif;
}

.quick-grid {
  margin-top: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.quick-card h3 {
  font-size: 1.14rem;
}

.quick-open {
  justify-self: start;
}

.content-grid {
  display: grid;
  gap: 18px;
  align-items: start;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.content-grid-wide {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.detail-column {
  display: grid;
  gap: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar input {
  min-width: 240px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(21, 36, 52, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(21, 36, 52, 0.08);
  text-align: left;
  vertical-align: top;
}

thead {
  background: #f4f8fc;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: rgba(31, 118, 189, 0.04);
}

tbody tr.is-selected {
  background: rgba(31, 118, 189, 0.08);
}

.row-button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
}

.row-button:hover {
  transform: none;
  filter: none;
  color: var(--blue);
}

.row-meta {
  display: block;
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

.table-empty {
  padding: 24px 0 8px;
}

.pill,
.tag,
.scope-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.pill {
  background: #eef4f8;
  color: var(--ink);
}

.pill.success {
  background: var(--success-soft);
  color: var(--success-text);
}

.pill.warning {
  background: var(--orange-soft);
  color: #9b5d14;
}

.pill.blue {
  background: var(--blue-soft);
  color: #235a84;
}

.tag {
  background: #f3f7fb;
  color: var(--ink);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.assignment-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.assignment-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

.assignment-list,
.assignment-browser {
  display: grid;
  gap: 10px;
  min-height: 160px;
}

.assignment-item,
.assignment-option,
.empty-panel {
  border: 1px solid rgba(21, 36, 52, 0.08);
  border-radius: var(--radius-md);
  background: #f8fbfd;
  padding: 16px;
}

.assignment-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.assignment-item strong,
.assignment-option strong,
.meta-card strong {
  display: block;
  margin-bottom: 5px;
}

.assignment-actions,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assignment-option {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.toggle-card input {
  width: auto;
  margin-top: 3px;
}

.scope-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.scope-chip:hover,
.history-tab:hover {
  transform: none;
}

.scope-chip.is-active,
.history-tab.is-active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-strong) 100%);
}

.empty-panel {
  min-height: 96px;
  display: grid;
  place-items: center;
  text-align: center;
}

.detail-hero {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(21, 36, 52, 0.08);
  background:
    linear-gradient(135deg, rgba(47, 163, 110, 0.08), rgba(31, 118, 189, 0.1)),
    #ffffff;
}

.detail-hero h3 {
  margin-bottom: 6px;
  font-size: 1.3rem;
}

.detail-hero-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-grid {
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-card span {
  display: block;
  margin-top: 4px;
}

.tag-row {
  margin-top: 16px;
}

.code-chip,
.payload-copy {
  font-family: "SFMono-Regular", "Consolas", monospace;
}

.code-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 10px;
  background: #eff3f8;
  color: var(--ink);
  font-size: 0.83rem;
}

.map-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 252, 0.96) 100%);
}

.map-canvas {
  width: 100%;
  min-height: 360px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(21, 36, 52, 0.08);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(47, 163, 110, 0.08), rgba(31, 118, 189, 0.08)),
    #f4f8fb;
}

.map-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(21, 36, 52, 0.18);
  background: #f8fbfd;
  text-align: center;
  padding: 24px;
}

.map-empty p {
  margin: 0;
}

.history-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.payload-copy {
  display: block;
  max-width: 280px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
}

@media (max-width: 1260px) {
  .context-grid,
  .quick-grid,
  .content-grid,
  .content-grid-wide,
  .assignment-layout,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .brand-strip {
    align-items: flex-start;
  }

  .brand-copy {
    text-align: left;
  }
}

@media (max-width: 920px) {
  .page {
    padding: 18px 14px 42px;
  }

  .utility-strip,
  .brand-strip,
  .panel-header,
  .section-heading,
  .pager {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar {
    justify-content: stretch;
  }

  .toolbar input {
    width: 100%;
    min-width: 0;
  }

  .site-nav {
    overflow-x: auto;
  }

  .nav-link {
    min-width: 220px;
    text-align: left;
  }

  .assignment-option {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

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

  .summary-card strong {
    font-size: 1.5rem;
  }

  .quick-open,
  .pager button {
    width: 100%;
  }
}
