:root {
  --system-blue-950: #07172f;
  --system-blue-900: #0a2142;
  --system-blue-800: #113a6a;
  --system-blue-700: #1b548d;
  --system-gold: #d5a331;
  --system-gold-soft: #fff6dc;
  --system-text: #151922;
  --system-muted: #5d6879;
  --system-line: #e4e9f0;
  --system-soft: #f7f9fb;
  --system-warm: #fffaf0;
  --system-white: #ffffff;
  --system-radius-sm: 8px;
  --system-radius-md: 14px;
  --system-radius-lg: 22px;
  --system-shadow: 0 18px 44px rgba(8, 26, 52, 0.08);
  --system-container: 1160px;
}

* {
  box-sizing: border-box;
}

body.admin-page,
body.admin-login-page {
  margin: 0;
  color: var(--system-text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  background: var(--system-soft);
}

body.system-page {
  background: linear-gradient(180deg, var(--system-white), #fffdf8 560px);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

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

.system-section {
  padding: 86px 0;
}

.system-hero {
  padding: 82px 0 72px;
  background:
    radial-gradient(circle at 80% 10%, rgba(213, 163, 49, 0.14), transparent 32%),
    linear-gradient(180deg, #fffdf8, #f7f9fb);
  border-bottom: 1px solid rgba(229, 220, 198, 0.62);
}

.system-hero-compact {
  padding: 68px 0;
}

.system-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.42fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.system-hero h1,
.system-form h2,
.system-copy-card h2,
.admin-page h1,
.admin-card h2,
.login-card h1 {
  margin: 0 0 14px;
  color: var(--system-blue-950);
  line-height: 1.08;
  letter-spacing: 0;
}

.system-hero h1 {
  max-width: 790px;
  font-size: clamp(2.28rem, 4.5vw, 4rem);
}

.system-hero p {
  max-width: 720px;
  margin: 0 0 22px;
  color: #314056;
  font-size: 1.08rem;
}

.system-eyebrow,
.admin-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--system-blue-800);
  font-size: 0.82rem;
  font-weight: 850;
}

.system-eyebrow::before {
  width: 32px;
  height: 2px;
  content: "";
  background: var(--system-gold);
}

.system-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--system-white);
  background: var(--system-blue-900);
}

.btn-secondary,
.btn-outline {
  color: var(--system-blue-900);
  background: var(--system-white);
  border-color: rgba(17, 58, 106, 0.18);
}

.btn-whatsapp {
  color: var(--system-white);
  background: #1f9d55;
}

.system-trust-card,
.system-copy-card,
.system-form,
.admin-card,
.metric-card,
.login-card {
  background: var(--system-white);
  border: 1px solid rgba(229, 220, 198, 0.82);
  border-radius: var(--system-radius-lg);
  box-shadow: var(--system-shadow);
}

.system-trust-card {
  display: grid;
  gap: 10px;
  padding: 28px;
}

.system-trust-card strong {
  color: var(--system-blue-950);
  font-size: 1.08rem;
}

.system-trust-card a {
  color: var(--system-blue-800);
  font-weight: 850;
  text-decoration: none;
}

.system-trust-card span,
.system-copy-card p,
.form-help,
.admin-card p,
.metric-card p,
.login-card p {
  color: var(--system-muted);
}

.system-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.58fr) minmax(520px, 1fr);
  gap: clamp(28px, 5vw, 62px);
  align-items: start;
}

.system-copy-card {
  position: sticky;
  top: 104px;
  padding: clamp(28px, 3.4vw, 40px);
}

.system-list {
  display: grid;
  gap: 11px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.system-list li {
  position: relative;
  padding-left: 26px;
  color: var(--system-muted);
}

.system-list li::before {
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 9px;
  height: 9px;
  content: "";
  background: var(--system-gold);
  border-radius: 50%;
}

.system-form {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 3.4vw, 40px);
}

.system-centered {
  max-width: 720px;
}

.voucher-form {
  max-width: 620px;
  margin-inline: auto;
}

.form-intro {
  padding-bottom: 4px;
}

.form-intro p {
  margin: 0;
  color: var(--system-muted);
}

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

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

.field label {
  color: var(--system-blue-950);
  font-size: 0.92rem;
  font-weight: 800;
}

.field label span {
  color: var(--system-muted);
  font-weight: 650;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  color: var(--system-text);
  background: #fcfdff;
  border: 1px solid var(--system-line);
  border-radius: var(--system-radius-sm);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea {
  min-height: 126px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--system-blue-700);
  box-shadow: 0 0 0 4px rgba(27, 84, 141, 0.12);
}

.voucher-input {
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--system-radius-md);
}

.alert ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.alert-success {
  color: #164f39;
  background: rgba(36, 139, 91, 0.1);
  border: 1px solid rgba(36, 139, 91, 0.18);
}

.alert-error {
  color: #8a321f;
  background: rgba(213, 80, 49, 0.1);
  border: 1px solid rgba(213, 80, 49, 0.18);
}

.application-form {
  max-width: 980px;
  margin-inline: auto;
}

.application-section {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 24px;
  margin: 0;
  background: rgba(247, 249, 251, 0.72);
  border: 1px solid rgba(229, 234, 240, 0.92);
  border-radius: var(--system-radius-md);
}

.application-section legend {
  padding: 0 8px;
  color: var(--system-blue-950);
  font-size: 1.04rem;
  font-weight: 850;
}

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

.upload-field {
  display: grid;
  gap: 8px;
  min-height: 142px;
  padding: 18px;
  cursor: pointer;
  background: var(--system-white);
  border: 1px dashed rgba(27, 84, 141, 0.3);
  border-radius: var(--system-radius-md);
}

.upload-field span {
  color: var(--system-blue-950);
  font-weight: 850;
}

.upload-field small {
  color: var(--system-muted);
}

.reference-box {
  display: inline-flex;
  padding: 12px 14px;
  color: var(--system-blue-900);
  background: var(--system-gold-soft);
  border-radius: var(--system-radius-sm);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--system-line);
  backdrop-filter: blur(14px);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--system-blue-950);
  text-decoration: none;
}

.admin-brand img,
.login-card img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 50%;
}

.admin-brand span {
  display: grid;
  line-height: 1.2;
}

.admin-brand small {
  color: var(--system-muted);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-nav a,
.table-actions button,
.table-status-form button,
.table-edit-form button,
.table-link {
  padding: 9px 12px;
  color: var(--system-blue-900);
  background: #f8fbff;
  border: 1px solid rgba(17, 58, 106, 0.12);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-nav a.active {
  color: var(--system-white);
  background: var(--system-blue-900);
}

.admin-menu-button {
  display: none;
}

.admin-shell {
  width: min(100% - 40px, 1240px);
  margin: 0 auto;
  padding: 38px 0 70px;
}

.admin-page-head {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.admin-page-head h1 {
  font-size: clamp(2rem, 3vw, 3rem);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 24px;
}

.metric-card span {
  color: var(--system-muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 12px 0 4px;
  color: var(--system-blue-950);
  font-size: 2.1rem;
  line-height: 1;
}

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

.admin-card {
  padding: clamp(22px, 3vw, 30px);
}

.admin-card-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-card-head h2 {
  font-size: 1.35rem;
}

.admin-card-head a {
  color: var(--system-blue-800);
  font-weight: 850;
  text-decoration: none;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--system-line);
}

th {
  color: var(--system-blue-950);
  font-size: 0.82rem;
}

td {
  color: var(--system-muted);
}

td strong,
td a {
  color: var(--system-blue-900);
}

td small {
  display: block;
  margin-top: 3px;
  color: #818b9a;
}

.status-badge {
  display: inline-flex;
  padding: 6px 10px;
  color: var(--system-blue-900);
  background: #eef4fb;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.status-pending,
.status-new,
.status-follow-up,
.status-contact-parent {
  color: #8a6118;
  background: rgba(213, 163, 49, 0.16);
}

.status-approved,
.status-completed,
.status-contacted,
.status-unused {
  color: #164f39;
  background: rgba(36, 139, 91, 0.1);
}

.status-disabled,
.status-closed,
.status-used {
  color: #6f7480;
  background: rgba(118, 130, 147, 0.14);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions form {
  margin: 0;
}

.table-status-form,
.table-edit-form,
.contact-stack,
.document-list,
.detail-list {
  display: grid;
  gap: 8px;
}

.table-status-form select,
.table-edit-form select,
.table-edit-form textarea {
  width: 100%;
  min-width: 150px;
  padding: 10px;
  border: 1px solid var(--system-line);
  border-radius: var(--system-radius-sm);
}

.table-edit-form textarea {
  min-height: 72px;
  resize: vertical;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(100px, 0.6fr) minmax(170px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.detail-list {
  grid-template-columns: 150px 1fr;
  margin: 0;
}

.detail-list dt {
  color: var(--system-muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  color: var(--system-blue-950);
}

.document-list a {
  display: grid;
  gap: 3px;
  padding: 14px;
  text-decoration: none;
  background: #f8fbff;
  border: 1px solid rgba(17, 58, 106, 0.1);
  border-radius: var(--system-radius-sm);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 28px;
  place-items: center;
  background:
    radial-gradient(circle at 82% 12%, rgba(213, 163, 49, 0.14), transparent 32%),
    linear-gradient(180deg, #fffdf8, #f7f9fb);
}

.login-card {
  display: grid;
  width: min(100%, 440px);
  gap: 18px;
  padding: 34px;
}

.login-return {
  color: var(--system-blue-800);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 1040px) {
  .system-hero-grid,
  .system-form-layout,
  .admin-grid-two,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .system-copy-card {
    position: static;
  }

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

  .admin-inline-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .system-section,
  .system-hero,
  .system-hero-compact {
    padding: 54px 0;
  }

  .system-hero h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .system-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .form-row,
  .upload-grid,
  .metric-grid,
  .admin-inline-form,
  .detail-list {
    grid-template-columns: 1fr;
  }

  .system-form,
  .system-copy-card,
  .system-trust-card,
  .admin-card,
  .login-card {
    padding: 22px;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .admin-menu-button {
    display: inline-flex;
    padding: 9px 12px;
    color: var(--system-blue-900);
    background: var(--system-white);
    border: 1px solid var(--system-line);
    border-radius: 999px;
    font-weight: 850;
  }

  .admin-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-nav.open {
    display: flex;
  }

  .admin-page-head,
  .admin-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-shell {
    width: min(100% - 28px, 1240px);
  }

  th,
  td {
    padding: 12px 10px;
  }
}
