:root {
  --ink: #13241d;
  --muted: #64736c;
  --soft: #87958e;
  --line: #d8e1dc;
  --line-strong: #bfcdc6;
  --canvas: #f4f7f5;
  --paper: #ffffff;
  --paper-soft: #f8faf8;
  --forest: #063f2e;
  --forest-deep: #073525;
  --forest-soft: #174d39;
  --mint: #dff0e7;
  --mint-soft: #eef8f2;
  --red: #a2443c;
  --amber: #9b6b1d;
  --shadow: 0 20px 55px rgba(12, 35, 26, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

.admin-shell {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 252px;
  min-height: 100vh;
  flex-direction: column;
  overflow-y: auto;
  color: #eef8f3;
  background:
    radial-gradient(circle at top left, rgba(148, 201, 169, 0.13), transparent 34rem),
    linear-gradient(180deg, var(--forest) 0%, var(--forest-deep) 100%);
}

.brand {
  display: flex;
  min-height: 92px;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  text-decoration: none;
}

.brand span,
.brand strong,
.brand small,
.brand em {
  display: block;
}

.brand strong {
  max-width: 12rem;
  color: #f7fbf8;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.75px;
  line-height: 1;
}

.brand small {
  margin-top: 7px;
  color: rgba(225, 242, 233, 0.72);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.brand em {
  max-width: 13rem;
  margin-top: 4px;
  color: rgba(225, 242, 233, 0.72);
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.admin-nav {
  display: grid;
  gap: 4px;
  padding: 8px 12px 18px;
}

.nav-module-label {
  margin: 0 13px 7px;
  color: rgba(225, 242, 233, 0.58);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.admin-nav-item {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  min-height: 52px;
  gap: 17px;
  padding: 10px 13px;
  border: 0;
  border-radius: 9px;
  color: rgba(236, 247, 241, 0.74);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  transition:
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.admin-nav-item span {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(225, 242, 233, 0.26);
  border-radius: 6px;
  color: rgba(244, 251, 247, 0.9);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
}

.admin-nav-item:hover {
  transform: translateX(2px);
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.admin-nav-item.active {
  color: var(--forest-deep);
  background: var(--mint);
  box-shadow: none;
}

.admin-nav-item.active span {
  border-color: rgba(6, 63, 46, 0.18);
  color: var(--forest-deep);
  background: rgba(255, 255, 255, 0.72);
}

.privacy-note {
  display: flex;
  gap: 11px;
  margin: auto 20px 12px;
  padding: 17px 4px 0;
  border: 0;
  border-top: 1px solid rgba(224, 240, 231, 0.3);
  border-radius: 0;
  background: transparent;
}

.privacy-note strong {
  display: block;
  color: #effaf4;
  font-size: 10px;
  font-weight: 650;
}

.privacy-note p {
  margin: 5px 0 0;
  color: rgba(225, 242, 233, 0.62);
  font-size: 9px;
  line-height: 1.45;
}

.privacy-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  background: #8bd0a8;
  box-shadow: 0 0 0 6px rgba(139, 208, 168, 0.13);
}

.back-link {
  margin: 0 20px 12px;
  padding: 8px 4px;
  border-radius: 8px;
  color: rgba(225, 242, 233, 0.7);
  font-size: 10px;
  text-decoration: none;
}

.back-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.admin-product-signature {
  margin: 0 24px 21px;
  color: rgba(225, 242, 233, 0.54);
  font-size: 9px;
  line-height: 1.45;
}

.admin-product-signature strong,
.admin-product-signature span,
.admin-product-signature small {
  display: block;
  overflow-wrap: anywhere;
}

.admin-product-signature strong {
  color: rgba(225, 242, 233, 0.76);
  font-weight: 780;
}

.admin-product-signature span {
  margin-top: 8px;
}

.admin-product-signature small {
  color: rgba(225, 242, 233, 0.5);
  font-size: 8px;
}

.admin-mobile-signature {
  display: none;
}

.admin-main {
  min-height: 100vh;
  margin-left: 252px;
}

.login-view {
  display: grid;
  min-height: 100vh;
  padding: 32px;
  place-items: center;
}

.login-card {
  width: min(430px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 5px 0 8px;
  color: var(--forest-deep);
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.8px;
  line-height: 1.08;
}

.login-card > p:not(.eyebrow) {
  margin: 0 0 24px;
  color: var(--muted);
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  color: #43584f;
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card input {
  width: 100%;
  height: 48px;
  padding: 10px 13px;
  border: 1px solid #c8d4ce;
  border-radius: 12px;
  outline: none;
}

.login-card input:focus {
  border-color: #729681;
  box-shadow: 0 0 0 4px rgba(75, 128, 97, 0.11);
}

.login-card button,
.sso-panel a,
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.login-card button {
  width: 100%;
  margin-top: 14px;
  color: #fff;
  background: var(--forest-soft);
}

.login-card button:hover,
.sso-panel a:hover,
.button:hover {
  transform: translateY(-1px);
}

.login-card > small {
  display: block;
  margin-top: 15px;
  color: var(--soft);
  font-size: 0.78rem;
  text-align: center;
}

.form-error {
  margin: 9px 0 0 !important;
  color: var(--red) !important;
  font-size: 0.82rem !important;
}

.sso-panel {
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid #edf0ee;
  text-align: center;
}

.sso-panel span {
  display: block;
  margin-bottom: 10px;
  color: #8b9892;
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sso-panel a {
  width: 100%;
  color: var(--forest-deep);
  background: #fff;
  border-color: #cbd5d0;
}

.sso-panel small {
  display: block;
  margin-top: 10px;
  color: var(--soft);
  font-size: 0.78rem;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 92px;
  padding: 17px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
}

.eyebrow {
  margin: 0;
  color: #71877b;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.admin-topbar h1,
.view-heading h2,
.data-card h3 {
  margin: 0;
  color: var(--forest-deep);
  letter-spacing: -0.055em;
}

.admin-topbar h1 {
  max-width: 380px;
  margin-top: 4px;
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#last-updated,
.view-heading p,
.card-heading p {
  color: var(--muted);
}

#last-updated {
  margin: 9px 0 0;
  font-size: 10px;
}

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

.button.secondary,
button.secondary {
  color: #29483a;
  background: #fff;
  border-color: #c7d3cd;
  box-shadow: 0 8px 22px rgba(10, 34, 25, 0.04);
}

.button.ghost,
button.ghost {
  color: #64746d;
  background: transparent;
}

.admin-content {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 32px 40px 52px;
}

.privacy-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid #c6e2d1;
  border-radius: 10px;
  color: #315144;
  background: var(--mint-soft);
  font-size: 10px;
}

.privacy-banner strong {
  font-weight: 850;
}

.privacy-banner span {
  color: var(--muted);
}

.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 26px;
}

.view-heading h2 {
  margin-top: 0;
  font-size: 36px;
  font-weight: 750;
  letter-spacing: -1.1px;
  line-height: 1.1;
}

.view-heading p {
  max-width: 780px;
  margin: 0;
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.summary-grid article {
  min-height: 104px;
  padding: 20px 24px;
  border-right: 1px solid #edf0ee;
}

.summary-grid article:nth-child(4n) {
  border-right: 0;
}

.summary-grid article:nth-child(n + 5) {
  border-top: 1px solid #edf0ee;
}

.summary-grid span,
.summary-grid small,
.summary-grid strong {
  display: block;
}

.summary-grid span {
  color: #263a31;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.summary-grid strong {
  margin: 4px 0 2px;
  color: var(--forest-deep);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1;
  overflow-wrap: anywhere;
}

.summary-grid small {
  color: #8b9892;
  font-size: 9px;
}

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

.section-card {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(12, 35, 26, 0.05);
  cursor: pointer;
  text-align: left;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.section-card:hover,
.section-card.active {
  transform: translateY(-2px);
  border-color: #9fc6b1;
  box-shadow: 0 18px 40px rgba(12, 35, 26, 0.09);
}

.section-card span,
.section-card strong,
.section-card small {
  display: block;
}

.section-card span {
  color: var(--forest-deep);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0;
}

.section-card strong {
  width: fit-content;
  max-width: 100%;
  margin-top: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #336f53;
  background: var(--mint-soft);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.section-card small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

.data-card {
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.full-page-card {
  min-height: 260px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid #edf0ee;
}

.card-heading h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.25px;
  line-height: 1.2;
}

.card-heading p {
  margin: 8px 0 0;
}

.draft-note {
  margin: 0;
  padding: 14px 28px;
  border-bottom: 1px solid #edf0ee;
  color: #775722;
  background: #fff8ea;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #edf0ee;
  text-align: left;
  vertical-align: top;
}

th {
  padding: 12px 13px;
  color: #66766e;
  background: #f1f7f4;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  max-width: 280px;
  padding: 13px;
  color: #24372f;
  font-size: 11px;
  overflow-wrap: anywhere;
  word-break: normal;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.compact-table table {
  min-width: 980px;
}

.compact-table td,
.compact-table th {
  max-width: 220px;
}

.editable-cell {
  white-space: nowrap;
}

.money-prefix {
  display: inline-flex;
  width: 1.2rem;
  justify-content: center;
  color: var(--muted);
  font-weight: 780;
}

.pricing-input {
  width: 8rem;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #c7d4ce;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.pricing-input:focus {
  border-color: #729681;
  box-shadow: 0 0 0 4px rgba(75, 128, 97, 0.1);
}

.detail-card {
  padding-bottom: 12px;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.detail-list dt,
.detail-list dd {
  margin: 0;
  padding: 17px 28px;
  border-bottom: 1px solid #edf0ee;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  color: var(--ink);
  font-weight: 820;
  overflow-wrap: anywhere;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 760;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #60a17e;
  box-shadow: 0 0 0 5px rgba(96, 161, 126, 0.12);
}

.outcome {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: capitalize;
}

.outcome.success {
  color: #397055;
  background: var(--mint-soft);
}

.outcome.error {
  color: #8b3229;
  background: #fff0ed;
}

.error-code {
  color: var(--red);
}

.empty-state {
  margin: 0;
  padding: 42px 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .admin-sidebar {
    position: static;
    width: 100%;
    min-height: 0;
    overflow: visible;
  }

  .brand {
    min-height: 62px;
    padding: 0 24px;
  }

  .brand strong {
    max-width: none;
    font-size: 19px;
  }

  .brand small,
  .brand em {
    max-width: none;
  }

  .admin-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 22px 14px;
    scroll-padding-inline: 22px;
  }

  .nav-module-label,
  .privacy-note,
  .back-link,
  .admin-product-signature {
    display: none;
  }

  .admin-nav-item {
    min-width: max-content;
    grid-template-columns: 27px minmax(0, max-content);
    min-height: 40px;
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 11px;
  }

  .admin-nav-item span {
    width: 27px;
    height: 27px;
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-topbar {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    min-height: 0;
    padding: 22px 30px;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .admin-content {
    padding: 28px 30px 50px;
  }

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

  .summary-grid article:nth-child(4n) {
    border-right: 1px solid #edf0ee;
  }

  .summary-grid article:nth-child(2n) {
    border-right: 0;
  }

  .summary-grid article:nth-child(n + 3) {
    border-top: 1px solid #edf0ee;
  }

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

  .admin-mobile-signature {
    display: block;
    padding: 18px 30px 32px;
    color: #68776f;
    font-size: 8px;
    line-height: 1.55;
  }

  .admin-mobile-signature strong,
  .admin-mobile-signature span {
    display: block;
    overflow-wrap: anywhere;
  }

  .admin-mobile-signature strong {
    color: var(--forest-deep);
    font-weight: 820;
  }
}

@media (max-width: 720px) {
  .brand {
    min-height: 56px;
    padding: 0 18px;
  }

  .brand strong {
    font-size: 17px;
  }

  .admin-nav {
    padding-inline: 16px;
  }

  .admin-nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    min-width: 90px;
    gap: 6px;
    text-align: center;
  }

  .admin-nav-item span {
    display: none;
  }

  .login-view,
  .admin-topbar,
  .admin-content {
    padding-inline: 18px;
  }

  .login-card {
    padding: 26px;
  }

  .summary-grid,
  .section-card-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid article,
  .summary-grid article:nth-child(2n),
  .summary-grid article:nth-child(4n) {
    border-right: 0;
  }

  .summary-grid article:not(:last-child) {
    border-bottom: 1px solid #edf0ee;
  }

  .privacy-banner,
  .view-heading,
  .card-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
  }

  .button,
  .header-actions button {
    flex: 1 1 150px;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .detail-list dt {
    padding-bottom: 4px;
    border-bottom: 0;
    font-weight: 760;
  }

  .detail-list dd {
    padding-top: 0;
  }

  th,
  td {
    padding: 13px 14px;
  }
}
