/* ==========================================================================
   culture-platform 관리자 테마
   - styles.html 에서 부트스트랩 다음에 불러온다.
   - 색·모서리·글꼴은 :root 변수만 바꾸면 전체에 반영된다.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+KR:wght@400;500;600;700&display=swap');

:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-soft: #fafbfc;
    --ink: #15171c;
    --body: #4a4f5a;
    --muted: #666c78;
    --line: #e4e6eb;
    --field: #8b909c;
    --accent: #2f45d6;
    --accent-hover: #2638b8;
    --accent-soft: #e9ecfd;
    --ok: #17694a;
    --ok-bg: #e5f4ec;
    --warn: #7a4f00;
    --warn-bg: #fbf0d9;
    --danger: #b3261e;
    --danger-bg: #fbe9e7;
    --thumb: #eceef2;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --shadow-card: 0 1px 2px rgba(21, 23, 28, 0.06), 0 0 0 1px var(--line);
    --font: 'IBM Plex Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

/* ---------- 기본 ---------- */
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--body);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
label { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 전체 틀: 사이드바 + 본문 ---------- */
#wrapper { display: flex; min-height: 100vh; }
#content-wrapper { flex: 1 1 auto; min-width: 0; }
#content { min-height: 100vh; }

.side {
    flex: 0 0 232px;
    width: 232px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: inherit; }
.side-brand:hover { color: inherit; }
.side-brand-mark {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
}
.side-brand-name { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 20px; }
.side-brand-role { font-size: 12px; line-height: 16px; color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
    display: flex; align-items: center;
    min-height: 44px; padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--body); font-size: 14px; font-weight: 500;
}
.side-link:hover { background: var(--bg); color: var(--ink); }
.side-link.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* 파일 목록: 미리보기 이미지 + 파일 이름 */
.file-area .file-list .fileBox .fileInfo { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.file-area .file-list .fileBox .fileThumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--thumb); }
.file-area .file-list { max-height: 360px; }
.field-hint + .field-hint { display: block; margin-top: 4px; }
.translate-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.translate-row .field-hint { margin: 0; }
.side-visit { width: 100%; margin: 4px 0 12px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-foot form { margin: 0; }
.side-foot .btn { width: 100%; }

@media (max-width: 900px) {
    #wrapper { flex-direction: column; }
    .side { position: static; width: 100%; flex-basis: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .side-nav { flex-direction: row; flex-wrap: wrap; }
    .side-foot { flex-direction: row; margin-top: 0; }
    .side-foot > * { flex: 1; }
}

/* ---------- 페이지 ---------- */
.page { padding: 40px; max-width: 1480px; box-sizing: border-box; }
@media (max-width: 900px) { .page { padding: 24px 16px; } }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-title { margin: 0; font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.page-sub { margin: 4px 0 0; color: var(--body); }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.page-back { display: inline-block; margin-bottom: 8px; font-size: 13px; font-weight: 600; }

/* 카드(흰 패널) */
.card-panel { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card-panel.pad { padding: 24px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.card-title { margin: 0 0 16px; font-size: 17px; line-height: 24px; font-weight: 700; color: var(--ink); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.table-wrap { overflow-x: auto; }

/* 칩(필터) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center;
    min-height: 36px; padding: 0 14px;
    border: 0; border-radius: 999px;
    background: var(--bg); color: var(--body);
    font: 600 13px var(--font); cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.is-on { background: var(--ink); color: #fff; }

/* 상태 배지 */
.badge-ok, .badge-warn, .badge-info {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--accent-soft); color: var(--accent); }

/* 검색창 */
.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-row .form-control, .search-row .form-select { width: auto; min-width: 140px; flex: 0 1 240px; }
.search-row label { margin: 0; font-size: 13px; font-weight: 600; white-space: nowrap; }
.card-head .search-row { flex-wrap: nowrap; }
@media (max-width: 700px) { .card-head .search-row { flex-wrap: wrap; } }

/* 폼 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.field-hint { font-size: 12px; color: var(--muted); }
.req { color: var(--danger); }
.form-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.form-cols > .col-main { flex: 3 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.form-cols > .col-side { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* 이미지 자리 */
.thumb { background: var(--thumb); border-radius: var(--radius-sm); object-fit: cover; }

/* ---------- 부트스트랩 덮어쓰기 ---------- */
.btn {
    min-height: 44px; padding: 0 18px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: var(--radius-md);
    font: 600 14px var(--font); white-space: nowrap;
    box-shadow: none !important;
}
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: 8px; font-size: 13px; }
.btn-primary, .btn-primary:focus { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover, .btn-primary:active { background: var(--accent-hover) !important; border-color: var(--accent-hover) !important; color: #fff !important; }
.btn-secondary, .btn-secondary:focus, .btn-light { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover, .btn-secondary:active, .btn-light:hover { background: var(--bg) !important; border-color: var(--line) !important; color: var(--ink) !important; }
.btn-dark, .btn-dark:focus { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-info, .btn-info:focus, .btn-warning, .btn-warning:focus { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent) !important; }
.btn-info:hover, .btn-warning:hover { background: #dce1fb !important; border-color: #dce1fb !important; }
.btn-danger, .btn-danger:focus { background: var(--surface); border-color: var(--line); color: var(--danger); }
.btn-danger:hover, .btn-danger:active { background: var(--danger-bg) !important; border-color: var(--danger-bg) !important; color: var(--danger) !important; }
.btn-text { min-height: 36px; padding: 0 12px; background: transparent; border: 0; color: var(--accent); }
.btn-text.danger { color: var(--danger); }

.form-control, .form-select, select.form-control {
    min-height: 44px; padding: 0 14px;
    border: 1px solid var(--field); border-radius: var(--radius-md);
    background-color: var(--surface); color: var(--ink);
    font: 400 14px var(--font);
}
textarea.form-control { padding: 12px 14px; line-height: 22px; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 69, 214, 0.18); }
.form-control::placeholder { color: var(--muted); }
.form-control:disabled, .form-control[readonly] { background: var(--bg); color: var(--body); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; }

.table { margin: 0; color: var(--body); font-variant-numeric: tabular-nums; --bs-table-bg: transparent; --bs-table-striped-bg: transparent; --bs-table-hover-bg: #f7f8fa; }
.table > thead > tr > th {
    padding: 10px 12px; background: var(--surface-soft) !important;
    border: 0; border-bottom: 1px solid var(--line);
    font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.table > tbody > tr > td, .table > tbody > tr > th {
    padding: 10px 12px; vertical-align: middle;
    border: 0 !important; border-top: 1px solid var(--line) !important;
    font-weight: 400; color: var(--body); box-shadow: none;
}
.table > tbody > tr:first-child > td, .table > tbody > tr:first-child > th { border-top: 0 !important; }
.table > tbody > tr[onclick] { cursor: pointer; }
.table > tbody > tr[onclick]:hover > * { background: #f7f8fa; }
.table label { margin: 0; cursor: inherit; color: inherit; }
.table .cell-strong, .table .cell-strong label { font-weight: 600; color: var(--ink); }

.pagination { margin: 0; gap: 6px; justify-content: flex-end; }
.pagination .page-link {
    min-width: 36px; height: 36px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--radius-sm) !important;
    background: transparent; color: var(--body);
    font-weight: 600; cursor: pointer; box-shadow: none;
}
.pagination .page-link:hover { background: var(--bg); color: var(--ink); }
.pagination .page-link.active { background: var(--accent); color: #fff; }
.pagination .page-item.disabled .page-link { color: #b9bdc7; background: transparent; }

.modal-content { border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(21, 23, 28, 0.25); font-family: var(--font); }
.modal-header, .modal-footer { border-color: var(--line); padding: 18px 24px; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.modal-header .close { background: transparent !important; border: 0; font-size: 24px; line-height: 1; color: var(--muted); }

/* 파일 업로드 (기존 클래스 유지) */
.file-area { width: 100%; height: auto; min-height: 120px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.file-area .file-list { height: auto; max-height: 220px; padding: 0; }
.btn-upload {
    width: 100%; height: 96px;
    background: var(--surface-soft); border: 1.5px dashed var(--field); border-radius: 14px;
    color: var(--body); font-weight: 600;
}
.btn-upload:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.spinner { border-top-color: var(--accent); }

/* ---------- 로그인 ---------- */
.login { min-height: 100vh; display: flex; flex-wrap: wrap; }
.login-intro {
    flex: 1 1 420px; box-sizing: border-box; padding: 56px;
    background: var(--ink); color: #c4c8d0;
    display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.login-intro h1 { margin: 0; font-size: 40px; line-height: 54px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.login-intro p { margin: 16px 0 0; font-size: 16px; line-height: 26px; max-width: 400px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; color: #fff; }
.login-brand .side-brand-mark { background: #fff; color: var(--ink); }
.login-note { font-size: 12px; color: #9aa0ab; }
/* 로그인 화면 왼쪽: 흐르는 THE REAL (밝은 바탕, 먹색·빨강) */
.login-flow { position: relative; overflow: hidden; padding: 0; background: #f6f5f2; color: #3a3a3a; }
.flow-tilt { position: absolute; left: -60%; top: 50%; width: 220%; display: flex; flex-direction: column; gap: 18px; transform: translateY(-50%) rotate(-39deg); }
.flow-row { display: flex; width: max-content; white-space: nowrap; font-size: clamp(48px, 6.2vw, 96px); line-height: 1; font-weight: 700; letter-spacing: 0.02em; }
.flow-row span { padding-right: 0.6em; }
.flow-row.to-left { animation: flow-left var(--flow-time, 60s) linear infinite; }
.flow-row.to-right { animation: flow-right var(--flow-time, 60s) linear infinite; }
.flow-row.ink { color: #3a3a3a; }
.flow-row.red { color: #c8202f; }
.flow-row.line { color: transparent; -webkit-text-stroke: 1.5px rgba(58, 58, 58, 0.6); }
.flow-row.soft { color: rgba(58, 58, 58, 0.18); }
.flow-note { position: absolute; left: 24px; bottom: 20px; padding: 6px 10px; border-radius: 8px; background: #f6f5f2; color: #5f5e5a; }
@keyframes flow-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes flow-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
/* 움직임 줄이기를 켠 사용자에게는 멈춘 상태로 보여준다 */
@media (prefers-reduced-motion: reduce) { .flow-row { animation: none; } }
/* 좁은 화면(로그인 폼 위로 올라갈 때)에서는 띠처럼 낮게 */
@media (max-width: 860px) { .login-flow { flex-basis: 100%; min-height: 220px; } .flow-tilt { gap: 12px; } }
.login-form-wrap { flex: 1 1 420px; box-sizing: border-box; padding: 56px 24px; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; box-sizing: border-box; padding: 36px 32px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-card); }
.login-card h2 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.login-card .lead-text { margin: 6px 0 28px; }
.login-card .field + .field { margin-top: 16px; }
.login-card .form-control { min-height: 48px; font-size: 15px; }
.login-card .btn { width: 100%; min-height: 52px; margin-top: 24px; font-size: 16px; }
.login-error { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--danger-bg); color: var(--danger); font-size: 13px; font-weight: 600; }
.login-help { margin: 20px 0 0; padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg); font-size: 13px; line-height: 20px; }
