:root {
  color-scheme: light;
  --ink: #22312b;
  --muted: #68746d;
  --paper: #f5f5ef;
  --surface: #fffefa;
  --line: #dce1d8;
  --leaf: #36745b;
  --leaf-dark: #285640;
  --coral: #c85a3f;
  --gold: #e6b957;
  --blue: #357987;
  --soft-green: #e8f1e9;
  --soft-coral: #faeae4;
  --soft-blue: #e6f0f2;
  --shadow: 0 18px 50px rgba(34, 49, 43, .08);
  font-family: "Aptos", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(53, 121, 135, .44); outline-offset: 2px; }

.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 clamp(18px, 4vw, 64px); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px 11px 11px 4px; background: var(--leaf); color: white; font-family: Georgia, serif; font-size: 17px; font-weight: 700; }
.brand-name { font-family: Georgia, serif; font-weight: 700; font-size: 19px; letter-spacing: 0; }
.brand-name small { display: block; margin-top: 2px; color: var(--muted); font: 11px "Aptos", "Segoe UI", sans-serif; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.net-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.net-dot.live { background: var(--leaf); }

main { min-height: calc(100vh - 72px); }
.public-shell { max-width: 1320px; padding: 30px 28px 72px; margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr); align-items: center; gap: clamp(32px, 6vw, 90px); min-height: 480px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 19px; color: var(--leaf-dark); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--coral); }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { max-width: 650px; margin: 0; font: 500 clamp(42px, 5.7vw, 72px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: 0; }
.hero h1 em { color: var(--leaf); font-weight: 400; }
.hero-copy { max-width: 520px; margin: 24px 0 28px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-image-wrap { position: relative; display: grid; place-items: center; height: 420px; overflow: hidden; border-radius: 3px 96px 3px 3px; background: #dce8df; }
.certificate-sheet { position: relative; width: min(82%, 400px); min-height: 300px; padding: 24px 27px; border: 1px solid #d6d9cc; border-top: 5px solid var(--leaf); background: var(--surface); box-shadow: 14px 17px 0 rgba(34, 49, 43, .09); transform: rotate(-2deg); }
.certificate-head, .certificate-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.certificate-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px 9px 9px 3px; background: var(--leaf); color: white; font: 700 12px Georgia, serif; }
.certificate-kicker { margin: 24px 0 7px; color: var(--coral); font-size: 9px; letter-spacing: 1.7px; font-weight: 700; }
.certificate-sheet h2 { margin: 0; font: 500 27px/1.1 Georgia, serif; }
.certificate-copy { max-width: 290px; margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.certificate-rule { height: 1px; margin: 17px 0 12px; background: var(--line); }
.certificate-foot > span:first-child { color: var(--muted); font-size: 9px; line-height: 1.6; }
.certificate-foot strong { color: var(--ink); font: 11px ui-monospace, Consolas, monospace; }
.certificate-seal { display: grid; place-content: center; width: 58px; height: 58px; border: 1px solid var(--gold); border-radius: 50%; color: var(--leaf-dark); text-align: center; font: 700 13px Georgia, serif; }
.certificate-seal small { font: 7px "Aptos", "Segoe UI", sans-serif; letter-spacing: 1px; }
.image-caption { position: absolute; left: 16px; bottom: 16px; padding: 11px 15px; max-width: calc(100% - 32px); background: rgba(255, 254, 250, .94); border-left: 3px solid var(--gold); font-size: 12px; color: var(--ink); }
.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 34px; }
.trust-item { padding: 21px 22px 21px 0; }
.trust-item + .trust-item { border-left: 1px solid var(--line); padding-left: 22px; }
.trust-item strong { display: block; margin-bottom: 4px; font: 600 16px Georgia, serif; }
.trust-item span { color: var(--muted); font-size: 13px; }
.public-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; color: var(--muted); font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border: 1px solid var(--leaf); border-radius: 5px; background: var(--leaf); color: white; font-weight: 650; text-decoration: none; transition: background .16s ease, transform .16s ease; }
.btn:hover { background: var(--leaf-dark); transform: translateY(-1px); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--soft-green); border-color: var(--leaf); }
.btn-danger { background: var(--coral); border-color: var(--coral); }
.btn-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.btn:disabled { opacity: .56; cursor: wait; transform: none; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); }

.auth-wrap { display: grid; place-items: start center; padding: 55px 20px 80px; }
.auth-panel { width: min(100%, 520px); padding: 32px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.auth-panel h1 { margin: 0 0 8px; font: 500 34px/1.12 Georgia, serif; }
.auth-panel > p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 10px 11px; border: 1px solid #cbd3ca; border-radius: 4px; background: white; color: var(--ink); }
.field textarea { min-height: 92px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #96a097; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.form-note { color: var(--muted); font-size: 12px; line-height: 1.55; }
.error-note { color: #a23f2f; font-size: 13px; }

.app-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.sidebar { padding: 28px 15px 28px 28px; border-right: 1px solid var(--line); background: #f0f1e9; }
.side-label { margin: 0 0 10px 11px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; }
.side-nav { display: grid; gap: 4px; }
.side-nav button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; padding: 9px 11px; text-align: left; border: 0; border-radius: 4px; background: transparent; color: #56625a; font-size: 13px; }
.side-nav button:hover, .side-nav button.active { color: var(--leaf-dark); background: #e2ebe1; }
.nav-symbol { width: 19px; text-align: center; font-size: 15px; }
.sidebar-bottom { margin: 32px 4px 0; padding: 15px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.5; }
.dashboard { min-width: 0; padding: clamp(22px, 4vw, 48px); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font: 500 34px/1.08 Georgia, serif; letter-spacing: 0; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.overline { margin-bottom: 10px; color: var(--coral); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; }
.panel { margin-bottom: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.panel h2 { margin: 0 0 15px; font: 600 19px Georgia, serif; }
.panel h3 { margin: 0 0 9px; font-size: 14px; }
.panel p { color: var(--muted); line-height: 1.55; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 17px; border: 1px solid var(--line); border-radius: 4px; background: white; }
.stat:nth-child(3n + 2) { background: #f4f7f1; }
.stat:nth-child(3n) { background: #f2f7f7; }
.stat span { display: block; color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 8px; font: 500 30px Georgia, serif; }
.status-banner { display: flex; align-items: flex-start; gap: 13px; padding: 16px; margin-bottom: 18px; border: 1px solid #e1c889; border-left: 4px solid var(--gold); background: #fff8e8; }
.status-banner.ok { border-color: #b7d1bb; border-left-color: var(--leaf); background: var(--soft-green); }
.status-banner.alert { border-color: #e6bbb0; border-left-color: var(--coral); background: var(--soft-coral); }
.status-banner strong { display: block; margin-bottom: 4px; }
.status-banner p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status-mark { flex: 0 0 auto; font-size: 18px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 10px; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
td { color: var(--ink); }
.pill { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 99px; background: var(--soft-green); color: var(--leaf-dark); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .45px; }
.pill.pending, .pill.pending_payment { background: #fff2d4; color: #825919; }
.pill.suspended, .pill.rejected, .pill.revoked, .pill.expired { background: var(--soft-coral); color: #9e442f; }
.pill.submitted { background: var(--soft-blue); color: #2c6570; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.toolbar .field { min-width: 180px; }
.empty { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.action-row { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
.inline-form .field { flex: 1 1 190px; }
.notice { padding: 12px 14px; border-left: 3px solid var(--blue); background: var(--soft-blue); color: #315f66; font-size: 12px; line-height: 1.5; }
.notice.warn { border-left-color: var(--gold); background: #fff8e8; color: #765b27; }

#toast { position: fixed; z-index: 20; right: 20px; bottom: 20px; width: min(420px, calc(100vw - 40px)); padding: 13px 16px; border: 1px solid var(--line); border-left: 4px solid var(--leaf); background: var(--surface); box-shadow: var(--shadow); font-size: 13px; }
#toast[hidden] { display: none; }
#toast.error { border-left-color: var(--coral); }
.loading { display: grid; place-items: center; min-height: 45vh; color: var(--muted); }
.loading-mark { width: 35px; height: 35px; margin-bottom: 12px; border: 3px solid var(--line); border-top-color: var(--leaf); border-radius: 50%; animation: turn .8s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 24px; min-height: 410px; }
  .hero-image-wrap { height: 350px; border-top-right-radius: 64px; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-label, .sidebar-bottom { display: none; }
  .side-nav { display: flex; overflow-x: auto; gap: 5px; }
  .side-nav button { flex: 0 0 auto; width: auto; }
  .dashboard { padding: 24px 20px 48px; }
}
@media (max-width: 620px) {
  .topbar { height: 64px; padding: 0 15px; }
  .brand-name { font-size: 17px; }
  .net-status { display: none; }
  main { min-height: calc(100vh - 64px); }
  .public-shell { padding: 25px 18px 48px; }
  .hero { grid-template-columns: 1fr; gap: 22px; min-height: 0; }
  .hero h1 { font-size: 45px; }
  .hero-copy { margin: 17px 0 21px; font-size: 15px; }
  .hero-image-wrap { height: 290px; border-top-right-radius: 56px; }
  .certificate-sheet { width: 84%; min-height: 260px; padding: 18px; }
  .certificate-sheet h2 { font-size: 22px; }
  .trust-row { grid-template-columns: 1fr; margin-top: 23px; }
  .trust-item, .trust-item + .trust-item { padding: 13px 0; border-left: 0; }
  .trust-item + .trust-item { border-top: 1px solid var(--line); }
  .public-footer { flex-direction: column; }
  .auth-wrap { padding: 28px 14px 50px; }
  .auth-panel { padding: 22px 18px; }
  .auth-panel h1 { font-size: 30px; }
  .form-grid, .grid-2 { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .page-heading { display: block; }
  .page-heading h1 { font-size: 29px; }
  .page-heading > .btn { margin-top: 15px; }
  .panel { padding: 16px 13px; }
  .dashboard { padding: 21px 13px 40px; }
  .side-nav button { font-size: 12px; padding: 8px 9px; }
  .side-nav button .nav-symbol { display: none; }
}
