:root {
  --bg: #f4f8f5;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --line: rgba(19, 76, 57, 0.12);
  --line-strong: rgba(19, 76, 57, 0.22);
  --text: #13352b;
  --muted: #5f7a6f;
  --brand: #2f8f68;
  --brand-deep: #1f6d4e;
  --brand-soft: #e7f4ed;
  --accent: #cfe5d4;
  --danger: #b54848;
  --danger-soft: #fbe8e8;
  --shadow: 0 24px 60px rgba(27, 66, 52, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(58, 183, 133, 0.18), transparent 32%),
    radial-gradient(circle at right 10% top 18%, rgba(211, 229, 216, 0.85), transparent 28%),
    linear-gradient(180deg, #f7fbf8 0%, #eef5f0 100%);
}

a {
  color: var(--brand-deep);
}

img {
  max-width: 100%;
}

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

.page-shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  padding: 24px 0 12px;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(34, 79, 61, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__logo {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 24px;
  background: white;
  padding: 10px;
  box-shadow: 0 18px 34px rgba(35, 84, 64, 0.16);
}

.brand__eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand__title {
  margin: 0;
  font-size: clamp(22px, 2.8vw, 34px);
  line-height: 1.1;
}

.brand__subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.hero {
  padding: 18px 0 48px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: stretch;
}

.hero__panel,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero__panel {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 52px);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
}

.hero__title {
  margin: 22px 0 16px;
  max-width: 12ch;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 0.97;
  letter-spacing: -0.04em;
}

.hero__lead {
  max-width: 620px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.metric {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(31, 109, 78, 0.08);
}

.metric strong {
  display: block;
  margin-bottom: 8px;
  font-size: 24px;
  color: var(--brand-deep);
}

.metric span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.form-card {
  padding: 28px;
  align-self: start;
}

.card__eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card__title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.card__text {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.stack-lg {
  display: grid;
  gap: 22px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.form-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-deep);
}

.input,
.table-search,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
.table-search:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(47, 143, 104, 0.7);
  box-shadow: 0 0 0 4px rgba(47, 143, 104, 0.12);
}

.btn,
button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, #39ad7c 100%);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(47, 143, 104, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
button:hover,
.button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(47, 143, 104, 0.28);
}

.btn--secondary,
.button-link--secondary {
  background: white;
  color: var(--brand-deep);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.btn--danger {
  background: linear-gradient(135deg, #c95d5d 0%, #ad3c3c 100%);
  box-shadow: 0 14px 24px rgba(169, 60, 60, 0.18);
}

.notice {
  padding: 16px 18px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
}

.notice--error {
  background: var(--danger-soft);
  color: #8c2f2f;
  border: 1px solid rgba(181, 72, 72, 0.14);
}

.notice--success {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 1px solid rgba(47, 143, 104, 0.16);
}

.result-card {
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fdf9 0%, #edf7f0 100%);
  border: 1px solid rgba(47, 143, 104, 0.14);
}

.result-card__code {
  margin: 8px 0 0;
  font-size: clamp(26px, 4vw, 36px);
  color: var(--brand-deep);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 26px;
}

.info-card {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

.info-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.footer-note {
  padding: 0 0 42px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.auth-shell,
.admin-shell {
  padding: 28px 0 56px;
}

.auth-card,
.admin-card {
  padding: clamp(24px, 4vw, 34px);
}

.admin-card + .admin-card {
  margin-top: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-box {
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(239,247,242,0.98) 100%);
  border: 1px solid var(--line);
}

.stat-box strong {
  display: block;
  font-size: 30px;
  color: var(--brand-deep);
}

.stat-box span {
  color: var(--muted);
  font-size: 14px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(19, 76, 57, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  background: #f2f8f4;
  color: var(--brand-deep);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.data-table tbody tr:nth-child(even) {
  background: #fbfdfb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill--success {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.status-pill--muted {
  background: #eef1ef;
  color: #5e6b65;
}

.inline-form {
  margin: 0;
}

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

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

.small-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.settings-panel {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(19, 76, 57, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

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

.settings-details {
  border-radius: 18px;
  border: 1px solid rgba(19, 76, 57, 0.12);
  background: rgba(255, 255, 255, 0.58);
}

.settings-details summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 700;
  color: var(--brand-deep);
}

.settings-details__content {
  padding: 0 20px 20px;
}

.placeholder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.placeholder-list code {
  padding: 8px 10px;
  border-radius: 10px;
  background: #f2f8f4;
  border: 1px solid rgba(19, 76, 57, 0.12);
  color: var(--brand-deep);
}

@media (max-width: 980px) {
  .hero__grid,
  .info-grid,
  .grid-2,
  .grid-3,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar__inner {
    border-radius: 28px;
    align-items: flex-start;
  }

  .hero__meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1160px);
  }

  .topbar {
    padding-top: 14px;
  }

  .topbar__inner,
  .hero__panel,
  .form-card,
  .auth-card,
  .admin-card {
    padding: 20px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand__logo {
    width: 72px;
    height: 72px;
  }

  .card__title,
  .hero__title {
    max-width: none;
  }
}
