:root {
    --ink: #09111f;
    --ink-soft: #132238;
    --paper: #fffaf0;
    --paper-deep: #f3e1b7;
    --white: #ffffff;
    --muted: #9daec4;
    --text: #f6fbff;
    --charcoal: #172033;
    --teal: #22c7b8;
    --teal-deep: #118c83;
    --gold: #f6b34b;
    --rose: #e85c75;
    --line: rgba(255, 255, 255, 0.16);
    --panel: rgba(14, 28, 44, 0.66);
    --panel-strong: rgba(18, 34, 53, 0.84);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.2);
    --radius: 8px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(118deg, rgba(7, 14, 26, 0.98), rgba(13, 38, 47, 0.96) 44%, rgba(35, 29, 55, 0.94) 74%, rgba(42, 25, 35, 0.98)),
        #09111f;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.ambient-field {
    position: fixed;
    inset: -25%;
    z-index: -1;
    background:
        linear-gradient(132deg, rgba(34, 199, 184, 0.2), transparent 34%, rgba(246, 179, 75, 0.12) 62%, rgba(232, 92, 117, 0.16)),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 62px);
    filter: blur(42px);
    opacity: 0.72;
    animation: ambientShift 18s ease-in-out infinite alternate;
}

.site-shell {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    justify-content: center;
    width: min(1140px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 20px;
}

.site-footer {
    flex: 0 0 auto;
    width: min(1140px, calc(100% - 40px));
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0 28px;
    text-align: center;
}

.site-footer p {
    margin: 0;
    color: rgba(246, 251, 255, 0.68);
    font-size: 0.84rem;
    font-weight: 750;
    letter-spacing: 0.02em;
}

.hero-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    width: 100%;
    gap: 40px;
    align-items: center;
    min-height: 0;
}

.hero-copy {
    max-width: 680px;
}

.eyebrow,
.panel-kicker {
    margin: 0 0 12px;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 680px;
    margin-bottom: 20px;
    font-size: 4.8rem;
    line-height: 0.98;
    letter-spacing: 0;
}

.subheading {
    max-width: 600px;
    margin-bottom: 32px;
    color: rgba(246, 251, 255, 0.78);
    font-size: 1.13rem;
    line-height: 1.7;
}

.glass-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055)),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.access-card {
    position: relative;
    padding: 36px;
    overflow: hidden;
    max-width: 420px;
    justify-self: end;
}

.access-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.2), transparent 36%, rgba(34, 199, 184, 0.12)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0.82;
    pointer-events: none;
}

.access-card > * {
    position: relative;
    z-index: 1;
}

.access-card h2,
.modal-card h2,
.admin-login h1,
.admin-panel h1 {
    margin-bottom: 9px;
    font-size: 2.18rem;
    line-height: 1.05;
    letter-spacing: 0;
}

.access-card p,
.modal-card p,
.admin-login p,
.admin-panel p {
    color: rgba(246, 251, 255, 0.72);
    line-height: 1.7;
}

.step-track {
    display: grid;
    grid-template-columns: auto minmax(28px, 1fr) auto minmax(28px, 1fr) auto;
    align-items: center;
    gap: 10px;
    max-width: 680px;
    margin: 0 0 26px;
}

.step-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: rgba(246, 251, 255, 0.56);
    transition: color 180ms ease, transform 180ms ease;
}

.step-item span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 800;
}

.step-item strong {
    font-size: 0.86rem;
    line-height: 1.25;
}

.step-item.is-active,
.step-item.is-complete {
    color: var(--text);
    transform: translateY(-1px);
}

.step-item.is-active span {
    border-color: rgba(34, 199, 184, 0.72);
    background: linear-gradient(135deg, var(--teal), var(--teal-deep));
    box-shadow: 0 12px 30px rgba(34, 199, 184, 0.28);
}

.step-item.is-complete span {
    border-color: rgba(246, 179, 75, 0.7);
    background: linear-gradient(135deg, var(--gold), #d8812f);
}

.step-line {
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.42));
}

.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trust-row span {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(246, 251, 255, 0.78);
    font-size: 0.83rem;
}

label {
    display: block;
    margin-bottom: 7px;
    color: rgba(246, 251, 255, 0.82);
    font-size: 0.84rem;
    font-weight: 800;
}

.code-control {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 22px;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    outline: none;
    background: rgba(5, 11, 22, 0.5);
    color: var(--white);
    padding: 14px 15px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

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

input::placeholder,
textarea::placeholder {
    color: rgba(246, 251, 255, 0.38);
}

input:focus,
textarea:focus {
    border-color: rgba(34, 199, 184, 0.82);
    background: rgba(5, 11, 22, 0.6);
    box-shadow: 0 0 0 4px rgba(34, 199, 184, 0.14);
}

.phone-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    background: rgba(5, 11, 22, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.phone-control:focus-within {
    border-color: rgba(34, 199, 184, 0.82);
    background: rgba(5, 11, 22, 0.6);
    box-shadow: 0 0 0 4px rgba(34, 199, 184, 0.14);
}

.phone-prefix {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0 13px 0 15px;
    color: rgba(246, 251, 255, 0.72);
    font-weight: 850;
}

.phone-control input {
    border: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: transparent;
    box-shadow: none;
}

.phone-control input:focus {
    background: transparent;
    box-shadow: none;
}

.primary-button,
.secondary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border: 0;
    border-radius: var(--radius);
    padding: 13px 20px;
    color: var(--white);
    font-size: 0.92rem;
    font-weight: 850;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.primary-button {
    background: linear-gradient(135deg, #2dd9ca, #12958c);
    box-shadow: 0 16px 34px rgba(18, 149, 140, 0.28);
}

.secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.105);
}

.ghost-button {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.035);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
    transform: translateY(-2px);
}

.primary-button:hover {
    box-shadow: 0 20px 42px rgba(18, 149, 140, 0.36);
}

button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none !important;
}

.form-message {
    min-height: 22px;
    margin: 10px 0 0;
    color: #ffd3dc !important;
    font-size: 0.92rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 160ms ease;
}

.form-message.is-visible {
    opacity: 1;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(5, 10, 20, 0.72);
    backdrop-filter: blur(14px);
}

.modal-card {
    position: relative;
    width: min(680px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(20, 38, 57, 0.97), rgba(30, 30, 49, 0.97)),
        var(--panel-strong);
    box-shadow: var(--shadow);
    padding: 32px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

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

.field-wide {
    grid-column: 1 / -1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.certificate-stage {
    padding: 42px 0 8px;
}

.success-copy {
    max-width: 760px;
    margin-bottom: 24px;
}

.success-copy h2 {
    margin-bottom: 8px;
    font-size: 2.65rem;
    line-height: 1.08;
}

.success-copy p {
    color: rgba(246, 251, 255, 0.72);
}

.certificate-wrap {
    overflow-x: auto;
    padding: 12px 2px 26px;
}

.certificate {
    --certificate-template-image: none;
    position: relative;
    width: min(1040px, 100%);
    min-width: min(100%, 650px);
    aspect-ratio: 1.414 / 1;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 16% 18%, rgba(246, 179, 75, 0.28), transparent 24%),
        radial-gradient(circle at 82% 28%, rgba(34, 199, 184, 0.18), transparent 28%),
        linear-gradient(135deg, #fffdf7, var(--paper) 52%, #f4e8ce);
    color: #172033;
    box-shadow: 0 28px 66px rgba(0, 0, 0, 0.32);
}

.certificate.has-template {
    background:
        linear-gradient(rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03)),
        var(--certificate-template-image) center / 100% 100% no-repeat,
        #ffffff;
    border-radius: 0;
}

.certificate-template-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    pointer-events: none;
}

.certificate.has-template .certificate-template-image {
    display: block;
}

.certificate-pattern {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(45deg, rgba(23, 32, 51, 0.035) 0 1px, transparent 1px 13px),
        linear-gradient(90deg, rgba(232, 92, 117, 0.12), transparent 35%, rgba(34, 199, 184, 0.12));
    pointer-events: none;
}

.certificate.has-template .certificate-pattern {
    display: none;
}

.certificate-template-fields {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    color: #080d15;
    pointer-events: none;
}

.template-participant-name,
.template-completion-date,
.template-certificate-id {
    position: absolute;
    display: block;
    text-align: center;
    text-wrap: balance;
}

.template-participant-name {
    left: 50%;
    top: 44.2%;
    width: 68%;
    transform: translate(-50%, -50%);
    color: #05070b;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.1rem, 5.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.04;
    overflow-wrap: anywhere;
}

.template-completion-date {
    left: 45%;
    top: 57%;
    width: 20%;
    transform: translateY(-50%);
    color: #05070b;
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-size: clamp(0.64rem, 1.28vw, 1.12rem);
    font-weight: 700;
    line-height: 1.1;
    text-align: left;
    white-space: nowrap;
}

.template-certificate-id {
    left: 32.2%;
    top: 78.5%;
    width: 23%;
    transform: translate(-50%, -50%);
    color: #05070b;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: clamp(0.52rem, 1.08vw, 0.88rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.certificate-border {
    position: absolute;
    inset: clamp(18px, 3vw, 34px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    border: 2px solid rgba(23, 32, 51, 0.72);
    outline: 1px solid rgba(246, 179, 75, 0.78);
    outline-offset: -10px;
    padding: clamp(22px, 4vw, 40px);
}

.certificate-header,
.certificate-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.certificate-brandline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.certificate-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.certificate-logo.is-hidden {
    display: none;
}

.certificate-header span {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #14253b;
}

.certificate-header small,
.footer-label,
.signature-block span {
    color: rgba(23, 32, 51, 0.62);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.certificate-body {
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
    padding: 22px clamp(8px, 3vw, 48px);
}

.certificate-title {
    margin: 0 0 10px;
    color: #b17824;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 5rem;
    font-weight: 700;
    line-height: 0.95;
}

.certificate-intro {
    margin-bottom: 12px;
    color: rgba(23, 32, 51, 0.68);
    font-weight: 700;
}

.certificate h3 {
    max-width: 100%;
    margin: 0 0 16px;
    color: #101927;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.75rem;
    line-height: 1.02;
    overflow-wrap: anywhere;
}

.certificate-copy {
    max-width: 780px;
    margin: 0;
    color: rgba(23, 32, 51, 0.72);
    font-size: 1.05rem;
    line-height: 1.8;
}

.certificate-copy strong {
    color: #101927;
}

.certificate-footer {
    align-items: flex-end;
}

.certificate-footer > div:first-child,
.signature-block {
    display: grid;
    gap: 7px;
}

.certificate-footer strong {
    color: #101927;
}

.signature-block {
    min-width: 220px;
    padding-top: 16px;
    border-top: 2px solid rgba(23, 32, 51, 0.62);
    text-align: center;
}

.certificate-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, auto));
    justify-content: center;
    gap: 10px;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    width: min(420px, calc(100% - 36px));
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    background: rgba(12, 24, 39, 0.94);
    box-shadow: var(--shadow);
    color: var(--white);
    padding: 14px 16px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: none;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hidden {
    display: none !important;
}

.shake {
    animation: shake 360ms ease both;
}

.admin-body {
    min-height: 100vh;
    color: #172033;
    background: #f5f8fb;
}

.admin-body .ambient-field {
    display: none;
}

.admin-body .glass-panel {
    border: 1px solid #e4ebf2;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(25, 43, 64, 0.08);
    backdrop-filter: none;
}

.admin-body .admin-login h1,
.admin-body .admin-panel h1 {
    font-size: clamp(1.65rem, 2.4vw, 2.05rem);
    line-height: 1.12;
}

.admin-body .panel-kicker {
    color: #0f948b;
}

.admin-body h1,
.admin-body h2,
.admin-body h3 {
    color: #102033;
}

.admin-body .access-card p,
.admin-body .modal-card p,
.admin-body .admin-login p,
.admin-body .admin-panel p {
    color: #66768a;
}

.admin-body label {
    color: #26384c;
}

.admin-body input,
.admin-body textarea {
    border-color: #d8e3ec;
    background: #f8fbfd;
    color: #102033;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.admin-body input::placeholder,
.admin-body textarea::placeholder {
    color: #9aa8b8;
}

.admin-body input:focus,
.admin-body textarea:focus {
    border-color: rgba(18, 149, 140, 0.72);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(18, 149, 140, 0.12);
}

.admin-body .locked-date-input:disabled {
    cursor: not-allowed;
    border-color: #d8e3ec;
    background: #eef5f7;
    color: #102033;
    opacity: 1;
}

.admin-body .secondary-button {
    border: 1px solid #d8e3ec;
    background: #ffffff;
    color: #26384c;
}

.admin-body .secondary-button:hover {
    border-color: rgba(18, 149, 140, 0.4);
    background: #f4fbfa;
}

.admin-body .ghost-button {
    border: 1px solid #d8e3ec;
    background: #f8fbfd;
    color: #26384c;
}

.admin-body .ghost-button:hover {
    border-color: rgba(232, 92, 117, 0.34);
    background: #fff6f8;
    color: #9f3148;
}

.admin-body .primary-button {
    border: 1px solid #10978e;
    background: #18b7ad;
    box-shadow: 0 12px 24px rgba(18, 149, 140, 0.22);
}

.admin-body .primary-button:hover {
    background: #109d94;
    box-shadow: 0 16px 30px rgba(18, 149, 140, 0.26);
}

.admin-body .form-message {
    color: #b4233f !important;
}

.admin-shell {
    width: min(1480px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0 64px;
}

.admin-login {
    width: min(520px, 100%);
    margin: clamp(48px, 12vh, 110px) auto 0;
    padding: 38px;
}

.admin-form {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.admin-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 20px;
    padding: 24px;
    overflow: hidden;
}

.admin-sidebar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #2dd9ca, #f6b34b);
}

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

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #18b7ad;
    box-shadow: 0 12px 24px rgba(18, 149, 140, 0.2);
    color: var(--white);
    font-size: 0.85rem;
    font-weight: 900;
}

.admin-brand strong,
.admin-brand small {
    display: block;
}

.admin-brand strong {
    font-size: 1rem;
    color: #102033;
}

.admin-brand small {
    margin-top: 2px;
    color: #75869a;
    font-size: 0.78rem;
}

.admin-nav {
    display: grid;
    gap: 9px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    padding: 13px 14px;
    color: #506276;
    font-weight: 850;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.admin-nav a span {
    color: #d18a22;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.admin-nav a:hover,
.admin-nav a.is-active {
    border-color: rgba(18, 149, 140, 0.26);
    background: #effbf9;
    color: #102033;
    box-shadow: inset 3px 0 0 #18b7ad;
}

.sidebar-meta {
    display: grid;
    gap: 5px;
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    padding: 14px;
    background: #f7fbfc;
}

.sidebar-meta span {
    color: #7c8b9d;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-meta strong {
    color: #102033;
}

.sidebar-logout {
    margin: 0;
}

.sidebar-logout .ghost-button {
    width: 100%;
}

.admin-content {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.admin-panel {
    padding: 34px;
    overflow: hidden;
}

.admin-section {
    scroll-margin-top: 24px;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.admin-header form {
    margin: 0;
}

.admin-header .primary-button {
    min-width: 210px;
    white-space: nowrap;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.admin-actions form {
    margin: 0;
}

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

.dashboard-stat-card {
    display: grid;
    gap: 8px;
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    padding: 18px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(26, 46, 68, 0.06);
}

.dashboard-stat-card span {
    color: #75869a;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-stat-card strong {
    color: #102033;
    font-size: 1.7rem;
    line-height: 1;
}

.overview-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 16px;
    margin-top: 18px;
}

.overview-card {
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
    box-shadow: 0 14px 30px rgba(26, 46, 68, 0.06);
}

.overview-wide-card {
    margin-top: 16px;
}

.overview-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.overview-card-header h2 {
    margin: 4px 0 0;
    color: #102033;
    font-size: 1.12rem;
    line-height: 1.2;
}

.compact-button {
    min-height: 40px;
    border-radius: 11px;
    padding: 10px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
}

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

.overview-detail-grid div {
    min-height: 86px;
    border: 1px solid #e7eef5;
    border-radius: 12px;
    padding: 14px;
    background: #ffffff;
}

.overview-detail-grid dt {
    margin: 0 0 8px;
    color: #74869a;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overview-detail-grid dd {
    margin: 0;
    color: #102033;
    font-size: 0.96rem;
    font-weight: 850;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.overview-code-card {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(18, 149, 140, 0.18);
    border-radius: 14px;
    padding: 16px;
    background: #f4fbfa;
}

.overview-code-card strong {
    color: #102033;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: clamp(1.3rem, 2.8vw, 1.8rem);
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}

.overview-code-card p,
.overview-empty-card p {
    margin: 0;
    color: #617387;
    line-height: 1.5;
}

.overview-code-card .status-badge {
    justify-self: start;
}

.overview-code-card .copy-code-button {
    justify-self: start;
}

.overview-empty-card {
    border: 1px dashed #cfe0eb;
    border-radius: 14px;
    padding: 18px;
    background: #ffffff;
    color: #617387;
}

.overview-empty-card strong {
    display: block;
    margin-bottom: 6px;
    color: #102033;
}

.overview-list {
    display: grid;
    border: 1px solid #e7eef5;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
}

.overview-list-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) minmax(180px, 0.7fr);
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e7eef5;
}

.overview-list-row:last-child {
    border-bottom: 0;
}

.overview-list-row > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.overview-list-row strong {
    color: #102033;
    font-size: 0.96rem;
    overflow-wrap: anywhere;
}

.overview-list-row span,
.overview-list-row time {
    color: #617387;
    font-size: 0.86rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.overview-list-code {
    color: #0e756e !important;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-weight: 850;
}

.admin-filter-form,
.settings-form {
    display: grid;
    gap: 16px;
}

.admin-filter-form {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.32fr) minmax(150px, 0.32fr) auto;
    align-items: end;
    margin: 0 0 18px;
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    padding: 16px;
    background: #fbfdfe;
}

.filter-field label,
.settings-grid label {
    color: #5f7186;
}

.filter-actions,
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-actions .primary-button,
.filter-actions .ghost-button {
    min-height: 46px;
}

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

.settings-section-heading {
    border-top: 1px solid #e7eef5;
    margin-top: 6px;
    padding-top: 20px;
}

.settings-section-heading h2 {
    margin: 0 0 6px;
    color: #102033;
    font-size: 1.08rem;
    line-height: 1.2;
}

.settings-section-heading p:last-child,
.settings-help {
    margin: 0;
    color: #66768a;
    font-size: 0.86rem;
    line-height: 1.55;
}

.logo-upload-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    padding: 14px;
    background: #fbfdfe;
}

.logo-preview {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    border: 1px solid #d8e3ec;
    border-radius: 14px;
    background: #ffffff;
    object-fit: contain;
    color: #7c8b9d;
    font-size: 0.72rem;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.logo-preview-empty {
    padding: 8px;
}

.logo-upload-controls {
    display: grid;
    gap: 10px;
}

.settings-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #506276;
}

.settings-checkbox input {
    width: auto;
}

.settings-toggle {
    border: 1px solid #dce8ef;
    border-radius: var(--radius);
    padding: 14px;
    background: #fbfdfe;
}

.settings-toggle span {
    color: #26384c;
    font-weight: 850;
}

.success-message {
    margin: 0 0 16px;
    border: 1px solid rgba(18, 149, 140, 0.18);
    border-radius: var(--radius);
    padding: 13px 15px;
    background: #eafaf8;
    color: #0d756e;
    font-weight: 800;
}

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

.admin-stat-card {
    display: grid;
    gap: 8px;
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    padding: 16px;
    background: #fbfdfe;
    box-shadow: inset 0 1px 0 #ffffff;
}

.admin-stat-card span {
    color: #75869a;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-stat-card strong {
    color: #102033;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.generated-code-card {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(18, 149, 140, 0.2);
    border-radius: var(--radius);
    padding: 24px;
    background: #f4fbfa;
    box-shadow: inset 4px 0 0 #18b7ad;
}

.generated-code-card.is-muted {
    border-color: #e2eaf1;
    background: #fbfdfe;
    box-shadow: none;
}

.generated-code-card span,
.generated-code-card small {
    color: #6f8194;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.generated-code-card strong {
    color: #102033;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: clamp(1.45rem, 3.6vw, 2.2rem);
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}

.compact-table {
    margin-top: 14px;
}

.code-table {
    min-width: 720px;
}

.code-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 7px 11px;
    background: #e9faf8;
    color: #0e756e;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.84rem;
    font-weight: 900;
}

.status-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.status-badge.is-active {
    background: #e7faf3;
    color: #0d7a5f;
}

.status-badge.is-expired {
    background: #fff0f3;
    color: #af314a;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(26, 46, 68, 0.05);
}

.admin-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    color: #26384c;
}

.admin-table.code-table {
    min-width: 900px;
}

.admin-table.certificate-table {
    min-width: 1160px;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e7eef5;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    background: #f7fafc;
    color: #6c7e90;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-table td {
    color: #32455a;
    font-size: 0.9rem;
}

.admin-table tbody tr {
    background: #ffffff;
    transition: background 150ms ease;
}

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

.admin-table tbody tr:hover {
    background: #f2fbfa;
}

.admin-table td:first-child {
    color: #0e756e;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
}

.address-preview {
    display: inline-flex;
    max-width: 130px;
    border: 1px solid #d9e8ef;
    border-radius: 999px;
    padding: 6px 10px;
    background: #f6fbfc;
    color: #33475b;
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1;
    cursor: help;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.address-preview:focus {
    outline: 2px solid rgba(18, 149, 140, 0.28);
    outline-offset: 2px;
}

.copy-code-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid #cfe0eb;
    border-radius: 10px;
    padding: 8px 12px;
    background: #ffffff;
    color: #102033;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.copy-code-button:hover {
    border-color: rgba(18, 149, 140, 0.42);
    background: #f0fbfa;
    color: #0d756e;
    box-shadow: 0 8px 18px rgba(18, 149, 140, 0.1);
    transform: translateY(-1px);
}

.copy-code-button.is-copied {
    border-color: rgba(18, 149, 140, 0.34);
    background: #e7faf3;
    color: #0d7a5f;
}

.empty-state {
    border: 1px solid #e2eaf1;
    border-radius: var(--radius);
    padding: 24px;
    background: #ffffff;
    color: #66768a;
    text-align: center;
}

@keyframes ambientShift {
    from {
        transform: rotate(0deg) scale(1);
    }
    to {
        transform: rotate(8deg) scale(1.08);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-8px);
    }
    40% {
        transform: translateX(7px);
    }
    60% {
        transform: translateX(-5px);
    }
    80% {
        transform: translateX(3px);
    }
}

@media (max-width: 900px) {
    .site-shell {
        width: min(100% - 28px, 760px);
        padding-top: 26px;
    }

    .hero-section {
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 30px;
        padding: 20px 0 20px;
    }

    h1 {
        font-size: 3.65rem;
    }

    .subheading {
        font-size: 1.08rem;
        margin-bottom: 28px;
    }

    .access-card h2,
    .modal-card h2,
    .admin-login h1,
    .admin-panel h1 {
        font-size: 2.1rem;
    }

    .success-copy h2 {
        font-size: 2.35rem;
    }

    .step-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 22px;
    }

    .step-line {
        display: none;
    }

    .step-item {
        align-items: flex-start;
        gap: 8px;
        min-height: 74px;
        border: 1px solid rgba(255, 255, 255, 0.11);
        border-radius: var(--radius);
        padding: 10px;
        background: rgba(255, 255, 255, 0.055);
    }

    .step-item span {
        width: 28px;
        height: 28px;
        font-size: 0.82rem;
    }

    .step-item strong {
        font-size: 0.76rem;
    }

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

    .access-card {
        max-width: none;
        justify-self: stretch;
    }

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

    .admin-header {
        flex-direction: column;
    }

    .admin-actions {
        justify-content: flex-start;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: relative;
        top: auto;
    }

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

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

    .overview-panel-grid {
        grid-template-columns: 1fr;
    }

    .overview-list-row {
        grid-template-columns: minmax(220px, 1fr) minmax(190px, 0.9fr);
    }

    .overview-list-row time {
        grid-column: 1 / -1;
    }

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

    .admin-header form,
    .admin-header .primary-button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .site-shell,
    .admin-shell {
        width: min(100% - 24px, 560px);
    }

    h1 {
        font-size: 2.72rem;
        line-height: 1.02;
    }

    .subheading {
        font-size: 1rem;
        line-height: 1.62;
        margin-bottom: 22px;
    }

    .trust-row {
        gap: 8px;
    }

    .trust-row span {
        font-size: 0.78rem;
        padding: 7px 10px;
    }

    .certificate-title {
        font-size: 3.4rem;
    }

    .certificate h3 {
        font-size: 2.45rem;
    }

    .certificate-copy {
        font-size: 0.92rem;
    }

    .access-card,
    .modal-card,
    .admin-login,
    .admin-panel {
        padding: 22px;
    }

    .admin-sidebar {
        padding: 18px;
    }

    .admin-nav {
        grid-template-columns: 1fr;
    }

    .admin-stat-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stat-grid,
    .overview-detail-grid,
    .settings-grid,
    .admin-filter-form,
    .logo-upload-row {
        grid-template-columns: 1fr;
    }

    .overview-card {
        padding: 16px;
    }

    .overview-card-header {
        flex-direction: column;
    }

    .overview-card-header .compact-button,
    .overview-code-card .copy-code-button {
        width: 100%;
    }

    .overview-list-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px;
    }

    .overview-list-row time {
        grid-column: auto;
    }

    .admin-stat-card,
    .generated-code-card {
        padding: 16px;
    }

    .admin-actions,
    .admin-actions .primary-button,
    .admin-actions .secondary-button,
    .filter-actions,
    .filter-actions .primary-button,
    .filter-actions .ghost-button,
    .settings-actions,
    .settings-actions .primary-button {
        width: 100%;
    }

    .admin-table.code-table {
        min-width: 780px;
    }

    .modal-actions,
    .certificate-actions {
        display: grid;
    }

    .modal-actions {
        grid-template-columns: minmax(96px, 0.75fr) minmax(0, 1.25fr);
    }

    .certificate-actions {
        grid-template-columns: 1fr;
    }

    .modal-card {
        max-height: calc(100vh - 24px);
    }

    .modal-close {
        top: 12px;
        right: 12px;
    }

    .field-grid {
        gap: 13px;
        margin-top: 18px;
    }

    input,
    textarea {
        padding: 12px 13px;
    }

    textarea {
        min-height: 82px;
    }

    .certificate-wrap {
        margin-inline: -6px;
        padding-inline: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .certificate {
        width: 650px;
        max-width: none;
        min-width: 650px;
    }

    .certificate-border {
        inset: 13px;
        outline-offset: -6px;
        padding: 16px;
    }

    .certificate-header span {
        font-size: 0.64rem;
        letter-spacing: 0.1em;
    }

    .certificate-header small,
    .footer-label,
    .signature-block span {
        font-size: 0.55rem;
        letter-spacing: 0.06em;
    }

    .certificate-body {
        padding: 8px 8px;
    }

    .certificate-title {
        margin-bottom: 5px;
        font-size: 2.35rem;
    }

    .certificate-intro {
        margin-bottom: 6px;
        font-size: 0.68rem;
    }

    .certificate h3 {
        margin-bottom: 8px;
        font-size: 1.8rem;
    }

    .certificate-copy {
        font-size: 0.68rem;
        line-height: 1.45;
    }

    .certificate-footer {
        gap: 10px;
    }

    .certificate-footer > div:first-child,
    .signature-block {
        gap: 4px;
    }

    .certificate-footer strong {
        font-size: 0.68rem;
    }

    .signature-block {
        min-width: 112px;
        padding-top: 9px;
    }
}

@media (max-width: 420px) {
    .success-copy h2 {
        font-size: 2rem;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }

    html,
    body {
        width: 297mm !important;
        height: 210mm !important;
        margin: 0 !important;
        overflow: hidden !important;
        background: #ffffff !important;
    }

    .ambient-field,
    .hero-section,
    .success-copy,
    .certificate-actions,
    .modal-backdrop,
    .toast {
        display: none !important;
    }

    .site-shell,
    .site-footer,
    #certificateSection,
    .certificate-wrap {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    #certificateSection {
        position: fixed !important;
        inset: 0 !important;
        display: grid !important;
        place-items: center !important;
        width: 297mm !important;
        height: 210mm !important;
        overflow: hidden !important;
        page-break-before: avoid !important;
        page-break-after: avoid !important;
        break-before: avoid !important;
        break-after: avoid !important;
    }

    .certificate-wrap {
        display: grid !important;
        place-items: center !important;
    }

    .certificate {
        width: 277mm !important;
        max-width: 277mm !important;
        height: auto !important;
        min-width: 0 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .certificate.has-template {
        width: 297mm !important;
        max-width: 297mm !important;
        height: 210mm !important;
    }

    .certificate.has-template .certificate-template-image {
        display: block !important;
    }
}
