:root {
  color-scheme: light;
  --ink: #17352f;
  --ink-soft: #55706a;
  --surface: #ffffff;
  --surface-soft: #f3f8f6;
  --line: #dce8e4;
  --cyan: #27b4df;
  --green: #6cc67e;
  --lime: #bed31f;
  --shadow: 0 24px 70px rgb(12 67 63 / 22%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e9f4f0;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.screen {
  min-height: 100vh;
}

.screen-login {
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 78% 12%, rgb(214 238 37 / 74%), transparent 30rem),
    radial-gradient(circle at 20% 90%, rgb(31 176 229 / 82%), transparent 34rem),
    linear-gradient(145deg, #62c1b2 4%, #76c77f 50%, #b8d51e 100%);
}

.login-card {
  width: min(100%, 27rem);
  padding: clamp(1.85rem, 7vw, 2.5rem);
  border: 1px solid rgb(255 255 255 / 70%);
  border-radius: 1.5rem;
  background: rgb(255 255 255 / 97%);
  box-shadow: var(--shadow);
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  text-decoration: none;
}

.login-card > .brand {
  width: 100%;
  justify-content: center;
}

.company-logo {
  display: block;
  width: 5.65rem;
  height: auto;
}

.product-name {
  padding-left: 0.8rem;
  border-left: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.login-copy {
  margin: 2.35rem auto 1.65rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #248f83;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.65rem;
  font-size: clamp(2rem, 9vw, 3.15rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.login-copy h1 {
  max-width: 20ch;
  margin: 0 auto;
  font-size: clamp(1.55rem, 6vw, 2rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.login-copy > p:last-child,
.project-description {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.code-control {
  position: relative;
  width: min(100%, 18rem);
  margin: 0 auto 1.1rem;
}

.code-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.72rem;
}

.code-slot {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1.5px solid #9ba8a4;
  border-radius: 0.42rem;
  background: #fff;
  color: var(--ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: clamp(2rem, 10vw, 2.75rem);
  font-weight: 750;
  line-height: 1;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.code-input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  cursor: text;
  opacity: 0;
}

.code-input:focus + .code-slots .code-slot.is-active {
  border-color: #1488b8;
  box-shadow: 0 0 0 4px rgb(39 180 223 / 18%);
}

.code-input[aria-invalid="true"] + .code-slots .code-slot {
  border-color: #c94a57;
  background: #fff8f8;
}

.error-message {
  margin: -0.25rem 0 1rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.error-message {
  color: #a62e3b;
  font-weight: 700;
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 3.3rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #153b59;
  box-shadow: none;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 650;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.primary-button:not(:disabled):hover {
  box-shadow: 0 10px 24px rgb(21 59 89 / 22%);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.screen-project {
  padding: clamp(1.25rem, 4vw, 3rem) clamp(1.25rem, 6vw, 5rem) 4rem;
  background:
    radial-gradient(circle at 100% 0, rgb(190 211 31 / 20%), transparent 26rem),
    linear-gradient(180deg, #f8fbfa 0%, #eaf4f1 100%);
}

.project-header,
.project-intro,
.screen-project > section {
  width: min(100%, 68rem);
  margin-right: auto;
  margin-left: auto;
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-compact .company-logo {
  width: 5.2rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: #287c73;
  cursor: pointer;
  font-weight: 750;
}

.text-button:hover {
  text-decoration: underline;
}

.project-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(4rem, 11vw, 7.5rem) 0 clamp(3rem, 7vw, 5rem);
}

.project-intro h1 {
  max-width: 13ch;
  font-size: clamp(2.7rem, 8vw, 6rem);
}

.project-intro h1:focus {
  outline: none;
}

.project-description {
  max-width: 42rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.project-status,
.content-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.project-status {
  padding: 0.65rem 0.85rem;
  background: #dff3e8;
  color: #216c55;
}

.section-heading {
  margin-bottom: 1.25rem;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  letter-spacing: -0.035em;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.content-card {
  display: block;
  min-height: 13rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: var(--surface);
  box-shadow: 0 12px 35px rgb(22 71 64 / 7%);
}

.content-card-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.content-card-link:hover {
  border-color: #8bcfc5;
  box-shadow: 0 18px 42px rgb(22 71 64 / 13%);
  transform: translateY(-2px);
}

.content-card-link:focus-visible {
  outline: 3px solid rgb(47 184 205 / 35%);
  outline-offset: 3px;
}

.content-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.content-icon {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border-radius: 0.85rem;
  background: linear-gradient(145deg, #e3f7f4, #eef6cf);
  color: #217c73;
  font-size: 1.2rem;
  font-weight: 850;
}

.content-status {
  padding: 0.42rem 0.65rem;
  background: #e4f4eb;
  color: #216c55;
}

.content-status.pending {
  background: #f3f1e4;
  color: #746a2f;
}

.content-status.admin {
  background: #17211d;
  color: #ffffff;
}

.content-card h3 {
  margin: 2rem 0 0.55rem;
  font-size: 1.2rem;
}

.content-card p {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.content-card .admin-note {
  margin-top: 1rem;
  color: #287c73;
  font-size: 0.82rem;
  font-weight: 750;
}

.content-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.content-action-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0.58rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: transparent;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 760;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.content-action-button.is-primary {
  border-color: #6ab7ad;
  color: #176d65;
}

.content-action-button.is-secondary {
  color: var(--ink-soft);
}

.content-action-button:hover {
  border-color: #8bcfc5;
  background: #f7fcfb;
}

.content-action-button:focus-visible {
  outline: 3px solid rgb(47 184 205 / 35%);
  outline-offset: 3px;
}

.content-card-performance {
  grid-column: span 2;
  min-height: 18rem;
}

.content-card-performance h3 {
  margin-top: 1.5rem;
}

.performance-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.performance-metric {
  min-width: 0;
}

.performance-metric dt {
  min-height: 2.3em;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.15;
}

.performance-metric dd {
  min-height: 2.5rem;
  margin: 0.35rem 0 0;
  color: var(--ink);
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
}

.performance-metric dd[data-metric="completionRate"] {
  font-size: clamp(1.5rem, 3.4vw, 2.05rem);
  white-space: nowrap;
}

.performance-progress {
  width: 100%;
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #dce9e5;
}

.performance-progress-value {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2b9a75;
  transition: width 220ms ease;
}

.performance-day-chart {
  display: flex;
  height: 4.25rem;
  align-items: flex-end;
  gap: clamp(0.12rem, 0.45vw, 0.3rem);
  margin-top: 0.9rem;
  padding: 0.25rem 0 0;
  border-bottom: 1px solid #bcd8d1;
}

.performance-day-chart[hidden] {
  display: none;
}

.performance-day-bar {
  position: relative;
  flex: 1 1 0;
  height: var(--bar-height);
  min-width: 0.16rem;
  max-width: 0.8rem;
  border-radius: 0.16rem 0.16rem 0 0;
  background: #2fb8cd;
  cursor: help;
  transition: background-color 140ms ease, height 220ms ease;
}

.performance-day-bar:hover,
.performance-day-bar:focus-visible {
  background: #197d91;
  outline: none;
}

.performance-day-bar.is-zero {
  background: #cdded9;
}

.performance-day-bar.is-zero:hover,
.performance-day-bar.is-zero:focus-visible {
  background: #759b92;
}

.performance-day-bar::after {
  position: absolute;
  z-index: 5;
  bottom: calc(100% + 0.45rem);
  left: 50%;
  width: max-content;
  max-width: 11rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.3rem;
  background: #17211d;
  color: #ffffff;
  content: attr(data-tooltip);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.2rem);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.performance-day-bar[data-tooltip-align="start"]::after {
  left: 0;
  transform: translate(0, 0.2rem);
}

.performance-day-bar[data-tooltip-align="end"]::after {
  right: 0;
  left: auto;
  transform: translate(0, 0.2rem);
}

.performance-day-bar:hover::after,
.performance-day-bar:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.performance-day-bar[data-tooltip-align="start"]:hover::after,
.performance-day-bar[data-tooltip-align="start"]:focus-visible::after,
.performance-day-bar[data-tooltip-align="end"]:hover::after,
.performance-day-bar[data-tooltip-align="end"]:focus-visible::after {
  transform: translate(0, 0);
}

.performance-footer {
  display: flex;
  min-height: 2.4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
}

.content-card .performance-message {
  color: #45645c;
  font-size: 0.8rem;
}

.performance-refresh {
  min-height: 2.35rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #9bc9bf;
  border-radius: 0.45rem;
  background: #f5fbf9;
  color: #216c62;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
}

.performance-refresh:hover:not(:disabled) {
  border-color: #4ca58f;
  background: #eaf7f3;
}

.performance-refresh:focus-visible {
  outline: 3px solid rgb(47 184 205 / 35%);
  outline-offset: 2px;
}

.performance-refresh:disabled {
  cursor: wait;
  opacity: 0.55;
}

.content-status.live {
  background: #dff3e8;
  color: #216c55;
}

.content-status.error {
  background: #f7e7e2;
  color: #914a35;
}

.content-card-performance.is-loading .performance-metrics,
.content-card-performance.is-loading .performance-progress,
.content-card-performance.is-loading .performance-day-chart {
  opacity: 0.58;
}

@media (max-width: 52rem) {
  .content-card-performance {
    grid-column: span 1;
  }

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

@media (max-width: 38rem) {
  .project-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.2rem;
  }

  .brand-compact .product-name {
    display: none;
  }

  .performance-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.admin-shell {
  min-height: 100vh;
  padding: clamp(1.25rem, 4vw, 3rem) clamp(1.25rem, 6vw, 5rem) 4rem;
  background:
    radial-gradient(circle at 100% 0, rgb(190 211 31 / 18%), transparent 26rem),
    linear-gradient(180deg, #f8fbfa 0%, #eaf4f1 100%);
}

.admin-header,
.admin-hero,
.admin-section {
  width: min(100%, 68rem);
  margin-right: auto;
  margin-left: auto;
}

.admin-hero {
  padding: clamp(4rem, 10vw, 6.5rem) 0 clamp(2rem, 6vw, 3.5rem);
}

.admin-hero h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 8vw, 6rem);
}

.admin-hero p:not(.eyebrow) {
  max-width: 44rem;
  color: var(--ink-soft);
  line-height: 1.55;
}

.admin-section {
  margin-top: 1.5rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--surface);
  box-shadow: 0 18px 46px rgb(12 67 63 / 10%);
}

.admin-table {
  display: grid;
  gap: 0.5rem;
}

.admin-row {
  display: grid;
  grid-template-columns: 7rem 9rem minmax(10rem, 1fr) minmax(12rem, 1.3fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #fbfefd;
}

.admin-row-head {
  color: var(--ink-soft);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-pill {
  display: inline-flex;
  width: fit-content;
  padding: 0.35rem 0.55rem;
  border-radius: 0.55rem;
  color: #ffffff;
  background: var(--ink);
  font-size: 1.05rem;
  letter-spacing: 0.14em;
}

.admin-row-actions {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  justify-content: flex-start;
}

.admin-row-actions a {
  color: var(--accent);
  font-weight: 850;
  text-decoration: none;
}

.small-danger-button {
  background: #fff3f1;
  border: 1px solid #f2b7ae;
  border-radius: 999px;
  color: #9c2f23;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0.42rem 0.72rem;
}

.small-danger-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.admin-form {
  display: grid;
  grid-template-columns: 8rem minmax(12rem, 1fr) 12rem auto;
  gap: 0.8rem;
  align-items: end;
}

.admin-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 750;
}

.admin-form input,
.admin-form select {
  min-height: 3rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: #ffffff;
  color: var(--ink);
}

.code-result {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #f8fcfb;
}

.code-result code {
  display: inline-flex;
  padding: 0.3rem 0.45rem;
  border-radius: 0.45rem;
  background: #e8f4f0;
}

.muted-line {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

@media (max-width: 48rem) {
  .admin-row,
  .admin-form {
    grid-template-columns: 1fr;
  }
}
