:root {
    --bg: #f2f4f3;
    --bg-accent: #e8eeeb;
    --panel: #ffffff;
    --line: #d2ddd7;
    --text: #0f172a;
    --muted: #5f6470;
    --brand: #0b6f3b;
    --brand-strong: #085a30;
    --accent: #f28a2e;
    --ok-bg: #dff3e7;
    --ok-text: #0f6a38;
    --bad-bg: #fee2e2;
    --bad-text: #991b1b;
    --warn-bg: #fff1dc;
    --warn-text: #8b4a12;
    --shadow: 0 22px 44px -30px rgba(15, 23, 42, 0.48);
}

* { box-sizing: border-box; }

html { font-family: "Palatino Linotype"; }
*, *::before, *::after { font-family: inherit; }
button, input, select, textarea, code, pre, kbd, samp { font-family: inherit; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(1000px 500px at -10% -10%, #e2f2e9 0%, transparent 55%),
        radial-gradient(900px 500px at 110% 0%, #fff0df 0%, transparent 55%),
        linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 48%, #ecf1ee 100%);
    font-family: inherit;
}

.page {
    width: min(960px, 92vw);
    margin: 5vh auto;
}

.shell {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.shell-narrow {
    max-width: 560px;
    margin: 0 auto;
}

.hero {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.brand-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #dde5e1;
}

.brand-logo {
    display: block;
    width: min(320px, 80%);
    height: auto;
}

.kicker {
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
}

h1 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    line-height: 1.15;
    font-family: inherit;
}

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

.form-wrap {
    margin-top: 18px;
    background: #f8fbf9;
    border: 1px solid #d8e6de;
    border-radius: 16px;
    padding: 14px;
}

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

.stack-form {
    display: grid;
    gap: 10px;
}

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

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

.field-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    border: 1px solid #bed3c6;
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 15px;
    outline: none;
    background: #ffffff;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11, 111, 59, 0.16);
}

.btn-primary {
    border: none;
    border-radius: 12px;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, #139153 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 100%);
}

.notice {
    margin-top: 16px;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff5ea;
    border: 1px solid #f8d3a9;
    color: #8b4a12;
}

.result {
    margin-top: 18px;
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    display: grid;
    gap: 12px;
}

.result h2 {
    margin: 0;
    font-size: 1.3rem;
    font-family: inherit;
}

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

.item {
    background: #f7faf8;
    border: 1px solid #dde6e1;
    border-radius: 12px;
    padding: 10px 12px;
}

.item .label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #647073;
    margin-bottom: 4px;
    font-weight: 700;
}

.item .value {
    font-size: 14px;
    word-break: break-word;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 700;
    font-size: 13px;
}

.badge.valid { background: var(--ok-bg); color: var(--ok-text); }
.badge.expired { background: var(--bad-bg); color: var(--bad-text); }
.badge.revoked { background: var(--warn-bg); color: var(--warn-text); }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dce5df;
}

.topbar-meta {
    font-size: 14px;
    color: #4b5560;
}

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

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

.nav-link {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid #c9d8cf;
    background: #f7faf8;
    color: #3e4b46;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.nav-link.active {
    background: #e6f4ed;
    border-color: #9cccb1;
    color: #0b6f3b;
}

.link {
    color: var(--brand-strong);
    text-decoration: none;
    font-weight: 700;
}

.btn-secondary {
    border: 1px solid #c9d8cf;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #3e4b46;
    background: #f7faf8;
    text-decoration: none;
}

.btn-secondary:hover {
    background: #eef5f1;
    border-color: #9fb6a8;
}

.btn-warn {
    border-color: #f1a24e;
    background: #fff4e7;
    color: #8b4a12;
}

.btn-safe {
    border-color: #38a169;
    background: #edf8f1;
    color: #0f6a38;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4b5560;
    font-size: 14px;
    margin-top: 4px;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.helper {
    margin: 0;
    color: #667175;
    font-size: 12px;
}

.footer-note {
    margin-top: 16px;
    color: #667175;
    font-size: 12px;
}

.table-wrap {
    margin-top: 18px;
    border: 1px solid #d7e2dc;
    border-radius: 14px;
    overflow-x: auto;
    background: #ffffff;
}

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

.data-table th,
.data-table td {
    border-bottom: 1px solid #dfe7e2;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    font-size: 15px;
}

.data-table th {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5a6468;
    background: #f7faf8;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form {
    margin: 0;
}

@media (max-width: 720px) {
    .page { margin: 3vh auto; }
    .shell { padding: 18px; border-radius: 18px; }
    .row-form { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .btn-primary { width: 100%; }
    .grid { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .topbar-right { width: 100%; flex-direction: column; align-items: flex-start; gap: 10px; }
    .nav-links { flex-wrap: wrap; }
}
