:root {
  color-scheme: light;
  --aloe-ink: #16233b;
  --aloe-muted: #667085;
  --aloe-surface: #ffffff;
  --aloe-canvas: #f6f3ec;
  --aloe-accent: #b84a22;
  --aloe-border: #e6e1d8;
  --aloe-error: #a52222;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--aloe-ink); background: var(--aloe-canvas); }
a { color: inherit; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); }

.eyebrow {
  margin-bottom: .65rem;
  color: var(--aloe-accent);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth-page { min-height: 100vh; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.auth-card, .content-card {
  width: min(100%, 42rem);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 1px solid var(--aloe-border);
  border-radius: 1.5rem;
  background: var(--aloe-surface);
  box-shadow: 0 1rem 3rem rgb(22 35 59 / 8%);
}
.auth-card form { display: grid; gap: 1rem; margin-top: 1.5rem; }
label { display: grid; gap: .45rem; font-weight: 700; }
input {
  width: 100%;
  min-height: 3rem;
  padding: .7rem .85rem;
  border: 1px solid #cfd4dc;
  border-radius: .8rem;
  background: #fff;
  color: inherit;
  font: inherit;
}
select {
  width: 100%; min-height: 3rem; padding: .7rem .85rem; border: 1px solid #cfd4dc;
  border-radius: .8rem; background: #fff; color: inherit; font: inherit;
}
textarea { width: 100%; padding: .7rem .85rem; border: 1px solid #cfd4dc; border-radius: .8rem; background: #fff; color: inherit; font: inherit; resize: vertical; }
input:focus { outline: 3px solid rgb(184 74 34 / 18%); border-color: var(--aloe-accent); }

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: var(--aloe-accent); color: #fff; }
.button.secondary { border-color: var(--aloe-border); background: #fff; }
.button.full { width: 100%; }
.button.danger { border-color: #f1c5c5; background: #fff5f5; color: var(--aloe-error); }
.error-banner { padding: .8rem 1rem; border-radius: .75rem; background: #fff0f0; color: var(--aloe-error); }
.notice { padding: .8rem 1rem; border-radius: .75rem; }
.notice.success { background: #eaf8f1; color: #16623c; }

.panel-main { width: min(100% - 2rem, 72rem); margin: 0 auto; padding: 2rem 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head h1 { margin-bottom: 0; }
.content-card { width: 100%; }
.content-card + .content-card { margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.actions.compact { margin-top: .8rem; }
.actions form { margin: 0; }
.panel-main.wide { width: min(100% - 2rem, 90rem); }
.workspace-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.workspace-nav a { padding: .65rem .9rem; border: 1px solid var(--aloe-border); border-radius: 999px; background: #fff; text-decoration: none; font-weight: 750; }
.workspace-nav a[aria-current="page"] { border-color: var(--aloe-accent); background: var(--aloe-accent); color: #fff; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.data-grid, .metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .85rem; }
.data-item, .metric-grid article { padding: 1rem; border: 1px solid var(--aloe-border); border-radius: 1rem; background: #fff; }
.data-item h3 { margin: 0 0 .35rem; }
.metric-grid { margin-bottom: 1rem; }
.metric-grid article { display: grid; gap: .2rem; }

/* Restored full Aloe shell: keep the migrated screens visually aligned with
   the original client/admin interface without restoring the legacy runtime. */
.aloe-restored-workspace {
  width: min(100%, 92rem);
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2rem);
}
.aloe-restored-workspace > .section-head:first-child {
  margin: 0 0 1.5rem;
}
.aloe-restored-workspace .content-card,
.aloe-restored-workspace .metric-grid article {
  border-color: color-mix(in srgb, var(--aloe-border) 80%, transparent);
  box-shadow: 0 16px 42px rgb(24 33 51 / 7%);
}
.aloe-restored-workspace .content-card {
  border-radius: 1.35rem;
}
.aloe-restored-workspace .data-item {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.aloe-restored-workspace .data-item:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--aloe-accent) 32%, var(--aloe-border));
  box-shadow: 0 14px 32px rgb(24 33 51 / 8%);
}
.aloe-restored-workspace .workspace-nav-global { display: none; }
.aloe-restored-workspace .metric-grid article strong { font-family: "Playfair Display", Georgia, serif; font-size: 2rem; }
@media (max-width: 760px) {
  .aloe-restored-workspace { padding: 1rem .85rem 2rem; }
  .aloe-restored-workspace .content-card { padding: 1.15rem; border-radius: 1rem; }
}
.metric-grid strong { font-size: 2rem; }
.metric-grid span, .data-item p { color: var(--aloe-muted); }
.inline-form, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); align-items: end; gap: .8rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--aloe-border); }
.form-grid .button { justify-self: start; }
.tag { display: inline-flex; padding: .35rem .65rem; border-radius: 999px; background: #eaf8f1; color: #16623c; font-weight: 750; }
.table-wrap { overflow-x: auto; }
.auth-separator { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; color: var(--aloe-muted); }
.auth-separator::before, .auth-separator::after { content: ""; flex: 1; height: 1px; background: var(--aloe-border); }
.auth-foot { margin: 1rem 0 0; text-align: center; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem; border-bottom: 1px solid var(--aloe-border); text-align: left; vertical-align: middle; }
th { color: var(--aloe-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.diagnostic { overflow: auto; max-height: 24rem; padding: 1rem; border-radius: .9rem; background: #101828; color: #e6edf7; font-size: .78rem; }
.detail-grid, .settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .85rem; }
.detail-grid div { padding: .9rem; border-radius: .9rem; background: var(--aloe-canvas); }
.detail-grid dt { color: var(--aloe-muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.detail-grid dd { margin: .35rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.offer-stack, .choice-list { display: grid; gap: .7rem; margin: 1rem 0; }
.offer-row { display: flex; justify-content: space-between; gap: 1rem; padding-top: .7rem; border-top: 1px solid var(--aloe-border); }
.offer-row div { display: grid; gap: .25rem; }
.offer-row small { color: var(--aloe-muted); }
.choice-list label { display: flex; align-items: center; gap: .65rem; padding: .75rem; border: 1px solid var(--aloe-border); border-radius: .8rem; }
.choice-list input { width: 1.1rem; min-height: 1.1rem; }
.field-wide { grid-column: 1 / -1; }

@media (max-width: 42rem) {
  .section-head { align-items: flex-start; flex-direction: column; }
  .section-head .button { width: 100%; }
  .actions { flex-direction: column; }
  .actions .button { width: 100%; }
  .card-head { flex-direction: column; }
  .inline-form, .form-grid { grid-template-columns: 1fr; }
  .offer-row { flex-direction: column; }
}
