/* =========================================================
   관리자 화면 스타일 - 공개 사이트와 같은 네이비 톤
   ========================================================= */

:root {
    --a-navy: #0f2a4a;
    --a-navy-2: #163a63;
    --a-blue: #2f6fb3;
    --a-blue-soft: #e9f1fb;
    --a-ink: #1c2733;
    --a-ink-2: #3d4a5c;
    --a-muted: #6b7686;
    --a-muted-2: #98a2b3;
    --a-line: #e3e8ef;
    --a-line-2: #eef1f5;
    --a-bg: #f6f8fb;
    --a-paper: #ffffff;
    --a-danger: #c8102e;
    --a-ok: #1f8a4c;
    --a-font: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont,
    "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body.admin {
    margin: 0;
    background: var(--a-bg);
    font-family: var(--a-font);
    color: var(--a-ink);
    line-height: 1.6;
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 3px solid rgba(47, 111, 179, .4); outline-offset: 2px; }

.admin-layout { display: flex; min-height: 100vh; }

/* ---------- 사이드바 (딥 네이비) ---------- */

.admin-side {
    width: 240px;
    flex: none;
    background: var(--a-navy);
    color: #fff;
    padding: 24px 0 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;           /* 모바일 주소창 높이 변화 대응 */
    overflow: hidden;         /* 메뉴가 길어져도 배경 밖으로 삐져나오지 않게 */
}

.admin-side__logo {
    padding: 4px 24px 22px;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    margin-bottom: 14px;
}

.admin-side__logo span {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .62);
    margin-top: 2px;
}

.admin-nav {
    display: flex; flex-direction: column; gap: 2px;
    padding: 0 12px 12px;
    flex: 1 1 auto;
    min-height: 0;            /* flex 자식이 줄어들 수 있게 — 없으면 overflow 가 동작하지 않음 */
    overflow-y: auto;         /* 하위 메뉴가 펼쳐져 창보다 길어지면 메뉴 영역만 스크롤 */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.25) transparent;
}
.admin-nav::-webkit-scrollbar { width: 6px; }
.admin-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 3px; }

.admin-nav a {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.admin-nav a:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.admin-nav a.is-active { background: #fff; color: var(--a-navy); }

.admin-subnav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 6px;
    padding-left: 14px;
    border-left: 2px solid rgba(255, 255, 255, .14);
    margin-left: 18px;
}

.admin-subnav a {
    padding: 8px 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .7);
    border-radius: 8px;
}

.admin-subnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-subnav a.is-active { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; }

.admin-side__foot {
    flex: none;               /* 항상 사이드바 맨 아래 고정 */
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    background: var(--a-navy);
    display: grid;
    gap: 4px;
}

.admin-side__foot a,
.admin-side__foot button {
    display: block;
    padding: 5px 0;
    background: none;
    border: 0;
    text-align: left;
    color: rgba(255, 255, 255, .7);
    font-size: 13.5px;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}

.admin-side__foot a:hover, .admin-side__foot button:hover { color: #fff; }

/* ---------- 본문 ---------- */

.admin-main { flex: 1; padding: 34px 40px 64px; min-width: 0; }

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

.admin-head h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--a-navy);
    margin: 0;
}

.admin-head h2 { color: var(--a-navy); }
.admin-head p { margin: 4px 0 0; color: var(--a-muted); font-size: 14px; }

.a-card {
    background: var(--a-paper);
    border: 1px solid var(--a-line);
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 20px;
}

.a-card h2 { color: var(--a-navy); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }

.stat {
    background: var(--a-paper);
    border: 1px solid var(--a-line);
    border-radius: 16px;
    padding: 22px 24px;
}

.stat .label { font-size: 13px; color: var(--a-muted); }

.stat .value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--a-navy);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.stat .value em { font-style: normal; font-size: 15px; color: var(--a-muted-2); font-weight: 600; margin-left: 2px; }

/* ---------- 테이블 ---------- */

.a-table-wrap { overflow-x: auto; }

table.a-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 720px; }

table.a-table th {
    text-align: left;
    font-size: 12.5px;
    color: var(--a-muted);
    font-weight: 700;
    letter-spacing: .02em;
    padding: 12px 14px;
    border-bottom: 1px solid var(--a-line);
    white-space: nowrap;
    background: var(--a-bg);
}

table.a-table th:first-child { border-radius: 8px 0 0 8px; }
table.a-table th:last-child { border-radius: 0 8px 8px 0; }

table.a-table td {
    padding: 14px;
    border-bottom: 1px solid var(--a-line-2);
    vertical-align: middle;
}

table.a-table tr:hover td { background: #fafbfd; }
table.a-table strong { color: var(--a-navy); }

.tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--a-line-2);
    color: var(--a-ink-2);
}

.tag--on { background: #e4f6e9; color: var(--a-ok); }
.tag--off { background: var(--a-line-2); color: var(--a-muted-2); }
.tag--new { background: var(--a-blue-soft); color: var(--a-blue); }
.tag--accent { background: var(--a-navy); color: #fff; }

/* ---------- 폼 ---------- */

.a-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.a-field { display: flex; flex-direction: column; gap: 7px; }
.a-field--full { grid-column: 1 / -1; }
.a-field label { font-size: 13px; font-weight: 700; color: var(--a-ink-2); }

.a-field input[type="text"],
.a-field input[type="number"],
.a-field input[type="date"],
.a-field input[type="password"],
.a-field select,
.a-field textarea {
    width: 100%;
    font-family: inherit;
    font-size: 14.5px;
    padding: 11px 13px;
    border: 1px solid var(--a-line);
    border-radius: 10px;
    background: var(--a-paper);
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}

.a-field textarea { resize: vertical; min-height: 120px; line-height: 1.7; }

.a-field input:focus, .a-field select:focus, .a-field textarea:focus {
    outline: none;
    border-color: var(--a-blue);
    box-shadow: 0 0 0 3px rgba(47, 111, 179, .15);
}

.a-field .hint { font-size: 12.5px; color: var(--a-muted-2); }

.a-check { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--a-ink-2); }
.a-check input { width: 17px; height: 17px; accent-color: var(--a-navy); }

.a-actions { display: flex; gap: 10px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--a-line-2); }

.a-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.a-btn--primary { background: var(--a-navy); color: #fff; }
.a-btn--primary:hover { background: var(--a-navy-2); }
.a-btn--accent { background: var(--a-navy); color: #fff; }
.a-btn--accent:hover { background: var(--a-navy-2); }
.a-btn--ghost { background: var(--a-paper); border-color: var(--a-line); color: var(--a-ink-2); }
.a-btn--ghost:hover { border-color: var(--a-navy); color: var(--a-navy); }
.a-btn--danger { background: var(--a-paper); border-color: #f3c6ce; color: var(--a-danger); }
.a-btn--danger:hover { background: #fdecef; }
.a-btn--sm { padding: 7px 14px; font-size: 13px; }

.a-alert {
    background: #e4f6e9;
    color: var(--a-ok);
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 20px;
}

.a-empty { padding: 60px 20px; text-align: center; color: var(--a-muted-2); }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.inline-form select, .inline-form input[type="text"] {
    padding: 8px 11px;
    border: 1px solid var(--a-line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
}

.inline-form input[type="text"] { min-width: 160px; }

/* ---------- 이미지 업로드 필드 ---------- */

.upload-field { display: flex; flex-direction: column; gap: 8px; }
.upload-field__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload-field__row input[type="text"] { flex: 1; min-width: 200px; }
.upload-field input[type="file"] { display: none; }
.upload-field .upload-status { font-size: 12.5px; color: var(--a-muted); }

.upload-preview {
    max-width: 320px;
    max-height: 200px;
    border-radius: 10px;
    border: 1px solid var(--a-line);
    object-fit: cover;
    background: var(--a-bg);
}

/* ---------- Quill 에디터 ---------- */

.editor-wrap { border: 1px solid var(--a-line); border-radius: 10px; overflow: hidden; background: var(--a-paper); }
.editor-wrap .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--a-line); background: var(--a-bg); }
.editor-wrap .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 15.5px; }
.editor-wrap .ql-editor { min-height: 480px; line-height: 1.8; padding: 22px 26px; color: var(--a-ink); }
.editor-wrap .ql-editor img { max-width: 100%; border-radius: 8px; }
.editor-wrap .ql-editor h2 { font-size: 1.5em; margin: 1.2em 0 .5em; color: var(--a-navy); }
.editor-wrap .ql-editor h3 { font-size: 1.25em; margin: 1.1em 0 .45em; color: var(--a-navy); }
.editor-wrap .ql-editor blockquote { border-left: 4px solid var(--a-blue); color: var(--a-ink-2); background: var(--a-blue-soft); }
.editor-wrap .ql-snow .ql-picker-label:hover, .editor-wrap .ql-snow .ql-picker-item:hover,
.editor-wrap .ql-snow button:hover .ql-stroke, .editor-wrap .ql-snow button.ql-active .ql-stroke { stroke: var(--a-blue); }
.editor-wrap .ql-snow button:hover .ql-fill, .editor-wrap .ql-snow button.ql-active .ql-fill { fill: var(--a-blue); }

/* ---------- 로그인 ---------- */

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(180deg, #f6f8fb 0%, #e9f1fb 100%);
    font-family: var(--a-font);
    color: var(--a-ink);
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--a-paper);
    border: 1px solid var(--a-line);
    border-radius: 20px;
    padding: 40px 36px;
    box-shadow: 0 24px 60px rgba(15, 42, 74, .12);
}

.login-box h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; color: var(--a-navy); margin: 0 0 6px; }
.login-box p.sub { color: var(--a-muted); font-size: 14px; margin: 0 0 26px; }
.login-box .a-field { margin-bottom: 14px; }

.login-err {
    background: #fdecef;
    color: var(--a-danger);
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 18px;
}

.login-back { display: block; text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--a-muted); text-decoration: none; }
.login-back:hover { color: var(--a-navy); }

/* ---------- 반응형 ---------- */

@media (max-width: 900px) {
    .admin-layout { flex-direction: column; }
    .admin-side { width: 100%; height: auto; position: static; padding: 16px 0; overflow: visible; }
    .admin-side__logo { padding-bottom: 14px; margin-bottom: 10px; }
    .admin-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
    .admin-subnav { flex-direction: row; border-left: 0; margin: 0; padding-left: 0; }
    .admin-nav a { white-space: nowrap; }
    .admin-side__foot { display: flex; gap: 16px; padding: 12px 24px 12px; }
    .admin-main { padding: 24px 20px 50px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .a-form-grid { grid-template-columns: 1fr; }
}

.a-alert--error { background: #fdecef; color: var(--a-danger); }

/* ---------- 안내/경고 박스 ---------- */

.a-notice {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.65;
    margin-bottom: 4px;
}

.a-notice strong { display: block; margin-bottom: 2px; }

.a-notice--warn {
    background: #fff8e1;
    border: 1px solid #f1dd9a;
    color: #6b4e00;
}

/* ---------- 차량 관리: 노출 설정 · 기아 추천 차량 고르기 ---------- */

.a-card__title { font-size: 17px; font-weight: 800; margin: 0 0 6px; }
.a-card__desc { font-size: 13.5px; color: var(--a-muted-2); margin: 0 0 20px; line-height: 1.7; }
.a-card__desc .tag { margin-left: 6px; vertical-align: middle; }
.a-card__subtitle { font-size: 15px; font-weight: 800; margin: 28px 0 12px; color: var(--a-ink-2); }
.a-empty--sm { padding: 26px 16px; font-size: 14px; }

.a-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.a-tabs a {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--a-line);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--a-ink-2);
    background: var(--a-paper);
}
.a-tabs a:hover { border-color: var(--a-navy); color: var(--a-navy); }
.a-tabs a.is-active { background: var(--a-navy); border-color: var(--a-navy); color: #fff; }

.kia-thumb { width: 96px; height: 54px; object-fit: contain; display: block; }

.kia-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kia-pick {
    border: 1px solid var(--a-line);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--a-paper);
}
.kia-pick.is-picked { border-color: var(--a-ok); background: #f3fbf5; }
.kia-pick__thumb { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.kia-pick__thumb img { width: 100%; height: 100%; object-fit: contain; }
.kia-pick__body { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.kia-pick__body strong { font-size: 14.5px; }
.kia-pick__body span { color: var(--a-muted-2); font-size: 12.5px; }
.kia-pick form button { width: 100%; }
.kia-pick .tag { align-self: flex-start; }
.a-card__title .tag { margin-left: 8px; vertical-align: middle; font-size: 11.5px; }

/* ---------- 사이트 정보 > 연락처: 위치 선택 지도 ---------- */
.map-picker { border: 1px solid var(--a-line); border-radius: 12px; overflow: hidden; }
.map-picker__map { width: 100%; height: 340px; background: var(--a-line-2); }
.map-picker__map--error { display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--a-danger); font-size: 13.5px; line-height: 1.7; }
.map-picker__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; background: var(--a-paper); border-top: 1px solid var(--a-line); }
.map-picker__q { flex: 1; min-width: 220px; padding: 8px 10px; border: 1px solid var(--a-line); border-radius: 8px; font: inherit; font-size: 13.5px; }
.map-picker__bar .hint { flex-basis: 100%; }
.map-picker__note { padding: 8px 12px; font-size: 13px; font-weight: 600; background: var(--a-paper); border-top: 1px solid var(--a-line-2); }
