:root {
  --bg: #f4f7f4;
  --panel: #ffffff;
  --ink: #17211b;
  --muted: #64706a;
  --line: #dbe3dd;
  --accent: #286f5a;
  --accent-2: #f2b84b;
  --danger: #b33a3a;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto 48px; min-width: 0; }
.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  z-index: 2;
}
.brand { font-weight: 800; text-decoration: none; letter-spacing: 0; }
nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
nav a, .tenant-link, .tab {
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 650;
}
h1 { font-size: clamp(2rem, 5vw, 4.8rem); line-height: .98; margin: 0 0 18px; letter-spacing: 0; }
h2 { font-size: 1.2rem; margin: 0 0 16px; }
h3 { margin: 0; }
.hero {
  min-height: calc(100vh - 104px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: center;
  gap: 40px;
  padding: 54px 0 80px;
}
.lead { font-size: 1.22rem; color: var(--muted); max-width: 680px; }
.eyebrow { text-transform: uppercase; font-size: .78rem; letter-spacing: .08em; color: var(--accent); font-weight: 800; }
.hero-panel, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 14px 40px rgba(23, 33, 27, .06);
}
.hero-panel { min-height: 320px; display: flex; flex-direction: column; justify-content: center; }
.big-symbol { color: var(--accent-2); font-size: 5rem; line-height: 1; }
.actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.small { min-height: 34px; padding: 0 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.section, .page-head { padding: 34px 0 20px; }
.tenant-list, .reward-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.narrow { width: min(520px, 100%); margin: 54px auto; }
.form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 9px 11px;
  font: inherit;
  font-size: 16px;
  background: #fff;
}
textarea { min-height: 86px; resize: vertical; }
.error { background: #fff3f3; color: var(--danger); border: 1px solid #f0c5c5; padding: 12px; border-radius: 8px; }
.muted { color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.3fr); gap: 18px; align-items: start; margin: 18px 0; }
.grid.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kid-card {
  background: var(--kid-bg);
  border: 1px solid color-mix(in srgb, var(--accent), white 70%);
  border-radius: 8px;
  padding: 18px;
}
.kid-card div { display: flex; align-items: center; gap: 10px; }
.kid-card strong { display: block; margin-top: 14px; font-size: 1.6rem; color: var(--accent); }
.shape { color: var(--accent); font-size: 1.8rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.num { text-align: right; font-weight: 800; }
.actions-cell { width: 150px; }
.inline-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.inline-actions form { margin: 0; }
.link-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 34px;
  padding: 6px 10px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
}
.link-button.danger { color: var(--danger); border-color: #f0c5c5; background: #fff7f7; }
.swatch { display: inline-block; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); }
.reward { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 16px; display: grid; gap: 8px; }
.reward span { color: var(--accent); font-weight: 850; }
.reward p { margin: 0; color: var(--muted); }
.kid-hero {
  min-height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.kid-hero h1 span { color: var(--kid-accent, var(--accent)); }
.kid-shape { margin: 0; color: var(--kid-accent, var(--accent)); font-size: 5rem; line-height: 1; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab.active { background: var(--kid-accent, var(--accent)); border-color: var(--kid-accent, var(--accent)); color: #fff; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  main {
    width: 100%;
    padding: 0 12px;
    margin: 0 auto 32px;
  }
  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 16px 12px;
  }
  .brand { font-size: 1.25rem; }
  nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
    gap: 8px;
  }
  nav a, .tenant-link, .tab {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 8px;
    font-size: .95rem;
    text-align: center;
    overflow-wrap: anywhere;
  }
  .hero, .split { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 32px 0; gap: 20px; }
  .hero-panel { min-height: 220px; }
  .lead { font-size: 1rem; }
  .section, .page-head { padding: 24px 0 12px; }
  h1 {
    font-size: clamp(1.9rem, 9vw, 2.4rem);
    line-height: 1.05;
    margin-bottom: 14px;
  }
  h2 { font-size: 1.1rem; }
  .hero-panel, .panel {
    padding: 16px;
    box-shadow: 0 8px 24px rgba(23, 33, 27, .05);
  }
  .split { gap: 14px; margin: 12px 0; }
  .split > *, .panel, .form, .reward, .kid-card { min-width: 0; max-width: 100%; }
  .grid.cards, .tenant-list, .reward-grid { grid-template-columns: 1fr; }
  .kid-card { padding: 14px; }
  .kid-card strong { font-size: 1.35rem; }
  .actions { margin-top: 18px; gap: 8px; }
  .actions .button, .form > .button {
    width: 100%;
  }
  .narrow {
    width: 100%;
    margin: 24px auto;
  }
  input, select, textarea {
    min-height: 44px;
    padding: 10px 12px;
  }
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    font-size: .9rem;
    -webkit-overflow-scrolling: touch;
  }
  th, td { padding: 9px 6px; }
  .actions-cell { width: auto; min-width: 146px; }
  .inline-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .link-button {
    min-height: 32px;
    padding: 5px 9px;
    font-size: .85rem;
  }
  .kid-hero { min-height: 240px; }
  .kid-shape { font-size: 4rem; }
}
