:root {
  color-scheme: light dark;

  --bg: #f4f7f5;
  --bg-tint: #e9f2ec;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --ink: #18201b;
  --muted: #5a655e;
  --line: #e3e8e4;
  --line-strong: #d3dbd5;

  --accent: #15803d;
  --accent-strong: #166534;
  --accent-soft: #eaf6ee;
  --accent-ink: #14532d;
  --link: #166534;
  --ring: rgba(21, 128, 61, 0.32);

  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-ink: #912018;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 6px 24px -8px rgba(16, 24, 40, 0.16), 0 1px 2px rgba(16, 24, 40, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1210;
    --bg-tint: #10231a;
    --surface: #161b18;
    --surface-2: #1b211d;
    --ink: #e9eeea;
    --muted: #9aa39d;
    --line: #262d28;
    --line-strong: #323a34;

    --accent: #15803d;
    --accent-strong: #1a9247;
    --accent-soft: rgba(34, 197, 94, 0.13);
    --accent-ink: #7be3a4;
    --link: #7be3a4;
    --ring: rgba(34, 197, 94, 0.4);

    --danger: #f97066;
    --danger-soft: rgba(249, 112, 102, 0.12);
    --danger-ink: #fda29b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 460px at 50% -260px, var(--bg-tint), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page > main {
  flex: 1 0 auto;
}

/* ---- Containers ---------------------------------------------------------- */

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.narrow {
  width: min(680px, calc(100% - 32px));
}

/* ---- Brand + header ------------------------------------------------------ */

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.site-header__inner {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #1c9e4f, var(--accent-strong));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), var(--shadow-sm);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

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

.brand-mark--lg svg {
  width: 30px;
  height: 30px;
}

.brand-name {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

/* ---- Typography ---------------------------------------------------------- */

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
}

h2 {
  font-size: 1.2rem;
  font-weight: 750;
}

.muted {
  color: var(--muted);
}

.lead {
  font-size: 1.06rem;
  color: var(--muted);
  margin: 0 0 4px;
}

a {
  color: var(--link);
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: currentColor;
}

/* ---- Cards / panels ------------------------------------------------------ */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

/* ---- Hero (landing) ------------------------------------------------------ */

.hero {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(40px, 9vw, 84px) 0 48px;
  text-align: center;
}

.hero .brand-mark {
  margin: 0 auto 20px;
}

.hero h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
}

.hero .lead {
  max-width: 34em;
  margin: 0 auto;
  font-size: 1.1rem;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
  text-align: left;
}

.info-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.info-card h2 {
  margin: 0;
  font-size: 1.08rem;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.info-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.info-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent-soft);
  margin-bottom: 4px;
}

.info-icon svg {
  width: 21px;
  height: 21px;
}

/* ---- Forms --------------------------------------------------------------- */

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

.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
  font-size: 0.94rem;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  accent-color: var(--accent);
}

input[type="file"] {
  padding: 8px 12px;
  cursor: pointer;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 550;
}

.checkbox-row input[type="checkbox"] {
  margin-top: 3px;
}

/* ---- Buttons ------------------------------------------------------------- */

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.96rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.13s ease, transform 0.08s ease, box-shadow 0.13s ease;
  box-shadow: var(--shadow-sm);
}

button:hover,
.btn:hover {
  background: var(--accent-strong);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

button.secondary,
.btn.ghost {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

button.secondary:hover,
.btn.ghost:hover {
  background: var(--surface-2);
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

/* ---- Notices ------------------------------------------------------------- */

.notice {
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 12px 14px;
  font-weight: 550;
}

.error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger-ink);
}

/* ---- Admin table rows ---------------------------------------------------- */

.row {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 0.8fr 0.6fr auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--surface-2);
}

/* ---- Footer -------------------------------------------------------------- */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer__inner {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  justify-content: space-between;
}

/* ---- Utilities ----------------------------------------------------------- */

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .grid,
  .hero-cards {
    grid-template-columns: 1fr;
  }

  .row,
  .topbar {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
