:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --line: #d7deea;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --danger: #dc2626;
    --success: #15803d;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}
.header {
    background: #111827;
    color: white;
    padding: 16px 0;
    margin-bottom: 24px;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.form-grid {
    display: grid;
    gap: 10px;
}
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: white;
}
.button {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none;
}
.button-secondary { background: #475569; }
.button-danger { background: var(--danger); }
.button-small { padding: 6px 10px; font-size: 12px; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-top: 12px;
}
.alert-success { background: #ecfdf5; color: var(--success); }
.alert-error { background: #fef2f2; color: var(--danger); }
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-active { background: #dbeafe; color: #1d4ed8; }
.badge-deleted { background: #fee2e2; color: #b91c1c; }
.muted, .note, .user { color: var(--muted); }
.filter-links { display: flex; gap: 8px; flex-wrap: wrap; }
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
}
.login-card {
    width: min(420px, calc(100% - 32px));
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
@media (max-width: 900px) {
    .grid-two { grid-template-columns: 1fr; }
}


.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.inline-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.inline-form input {
    min-width: 0;
}
.code-input { width: 90px; }
.name-input { width: 180px; }
.desc-input { min-width: 220px; }
.anchor-offset { scroll-margin-top: 90px; }
@media (max-width: 900px) {
    .inline-form { flex-direction: column; align-items: stretch; }
    .code-input, .name-input, .desc-input { width: 100%; }
}

.jump-links {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.button-current {
    background: #2f63d8;
}
.anchor-offset {
    scroll-margin-top: 90px;
}

.cert-table {
    width: 100%;
    table-layout: auto;
}

.cert-table th.col-type,
.cert-table td.col-type {
    white-space: nowrap;
    min-width: 140px;
}

.comment-form {
    flex-wrap: nowrap;
}

.comment-input {
    min-width: 180px;
    width: 100%;
}

.cert-table th.col-comment,
.cert-table td.col-comment {
    min-width: 160px;
    width: 160px;
}
