/* ====== 기본 스타일 (반형, 라이트 테마) ====== */
:root {
    --bg: #0b1020;
    --card: #121a33;
    --text: #e8eeff;
    --muted: #9fb0ffcc;
    --accent: #7aa2ff;
    --accent-2: #a1ffda;
    --danger: #ff6b6b;
    --ok: #56d364;
    --border: #2a375f;
    --chip: #1a2444;
    --chip-2: #10233b;
    --warn: #ffcc66;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Apple SD Gothic Neo,
        Noto Sans KR, Helvetica, Arial;
    background: linear-gradient(180deg, #0b1020 0%, #0d1530 100%);
    color: var(--text);
}
header {
    color: #000000 !important;
}
.wrap a {
    color: var(--accent);
}
.wrap {
    margin: 0 auto;
    padding: 24px;
}
.title {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.title h1 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.2px;
}
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.grid {
    display: grid;
    gap: 12px;
}
@media (min-width: 900px) {
    .grid-2 {
        grid-template-columns: 1.5fr 1fr;
    }
}
.row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: end;
}
label {
    font-size: 12px;
    color: var(--muted);
}
input[type="text"],
input[type="datetime-local"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 12px !important;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0f1730;
    color: var(--text);
    outline: none;
}
.btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0f1730;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.02s ease;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn.primary {
    background: linear-gradient(90deg, #6b8bff 0%, #54ffd2 100%);
    color: #001229;
    border: none;
    font-weight: 700;
}
.btn.ghost {
    background: transparent;
}
.btn.warn {
    background: #2b1a00;
    border-color: #7a4b00;
    color: #ffd480;
}
.btn.danger {
    background: #2b0000;
    border-color: #7a0000;
    color: #ffb3b3;
}
.spacer {
    flex: 1;
}
.muted {
    color: var(--muted);
    font-size: 12px;
}
.tips {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}
.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.chip {
    background: var(--chip);
    border: 1px solid var(--border);
    color: #ccdcff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}
.badge {
    background: var(--chip-2);
    color: #9be9ff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border);
}
.table-wrap {
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 900px;
    background: #0f1730;
}
th,
td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    vertical-align: top;
}
th {
    position: sticky;
    top: 0;
    background: #0f1730;
    text-align: left;
    font-weight: 600;
}
th.sortable {
    cursor: pointer;
}
th.sortable .arrow {
    font-size: 11px;
    opacity: 0.7;
}
.desc,
.desc-full {
    white-space: pre-wrap;
} /* line-height:1.5 }*/
.desc {
    max-height: 3.8em;
    overflow: hidden;
}
.toggle-more {
    color: var(--accent-2);
    cursor: pointer;
    font-size: 12px;
}
.empty {
    text-align: center;
    padding: 40px 12px;
    color: var(--muted);
}
.toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin: 12px 0;
}
.right {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}
.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: #001a2a;
    color: #dff6ff;
    border: 1px solid #0b2e4a;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    display: none;
    max-width: 360px;
}
.toast.show {
    display: block;
    animation: fade 0.2s ease;
}
@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #2b3e6e;
    border-top-color: #8fdcff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.detail {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(560px, 100%);
    background: var(--card);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.2s ease;
    z-index: 50;
    overflow: auto;
    padding: 18px;
}
.detail.show {
    transform: none;
}
.kvs {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 6px 12px;
    font-size: 14px;
}
.kvs div:nth-child(odd) {
    color: var(--muted);
}
.small {
    font-size: 12px;
}
.footer {
    margin: 18px 0 80px;
}
/* 모바일 드 전환 (아주 좁은 폭서) */
@media (max-width: 640px) {
    .table-wrap {
        border: none;
    }
    table {
        min-width: 0;
    }
    th:nth-child(n + 5),
    td:nth-child(n + 5) {
        display: none;
    } /* 너무 많은 컬 축소 */
}

/* ====== 모달 스타일 (키 발급 안내) ====== */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.modal.show {
    display: flex;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.modal-dialog {
    position: relative;
    width: min(720px, 92vw);
    max-height: 80vh;
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    padding: 16px;
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header h3 {
    margin: 0;
    font-size: 18px;
}
.modal-body {
    margin-top: 10px;
    line-height: 1.6;
    font-size: 14px;
    color: var(--text);
}
.modal-body ol {
    padding-left: 20px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}
