/* MLB 매니저 — 데이터 위주 화면용 최소 스타일 (외부 폰트·라이브러리 없음) */
:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --text: #1d2330;
    --muted: #6b7385;
    --line: #e2e5eb;
    --accent: #1f5fbf;
    --accent-weak: #e8f0fb;
    --ok: #1b7a3c;
    --err: #b3261e;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171d;
        --card: #1c2028;
        --text: #e4e7ec;
        --muted: #9199a8;
        --line: #2c323d;
        --accent: #6ea4f0;
        --accent-weak: #1f2b3d;
        --ok: #5cc285;
        --err: #f08a82;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
}

body.center { display: grid; place-items: center; min-height: 100vh; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; }

.top {
    display: flex; align-items: center; gap: 1.5rem;
    padding: .6rem 1rem; background: var(--card); border-bottom: 1px solid var(--line);
    /* 스크롤해도 상단 메뉴가 따라옴 */
    position: sticky; top: 0; z-index: 20;
}
.top .brand { font-weight: 700; color: var(--text); }
.top nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; flex: 1; }
.top .logout { margin-left: auto; }

.page { max-width: 1200px; margin: 0 auto; padding: 1rem; }

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    padding: 1rem; margin-bottom: 1rem;
}
.card.narrow { width: min(360px, 92vw); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.divisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.divisions.wide { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }
/* 대시보드 순위: 3지구씩 위(AL)·아래(NL). 좁은 화면은 1열 */
.divisions.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .divisions.three { grid-template-columns: 1fr; } }
/* 그리드 안에서 한 줄 전체 폭을 쓰는 카드 */
.grid > .wide { grid-column: 1 / -1; }
table.series td { white-space: nowrap; }
table.series { width: auto; }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row { display: flex; gap: .5rem; align-items: center; }
.stack { display: grid; gap: .6rem; }
.stack label { display: grid; gap: .2rem; }

.muted { color: var(--muted); }
.small { font-size: .8rem; font-weight: normal; }
.big { font-size: 1.15rem; font-weight: 600; margin: .2rem 0; }
.strong { font-weight: 700; }
.ok { color: var(--ok); }
.err { color: var(--err); }

input, select, button, .button {
    font: inherit; padding: .4rem .6rem; border-radius: 6px;
    border: 1px solid var(--line); background: var(--card); color: var(--text);
}
button, .button { cursor: pointer; display: inline-block; }
button.primary, .button.primary { background: var(--accent); color: #fff; border-color: var(--accent); padding: .55rem 1.1rem; }
button.danger { color: var(--err); }
button.link { border: none; background: none; color: var(--muted); padding: 0; }
button[disabled] { opacity: .5; cursor: wait; }

table { border-collapse: collapse; width: 100%; }
table.compact td, table.compact th { padding: .2rem .4rem; }
table.data { margin-bottom: 1rem; font-size: 13px; }
table.data th, table.data td { padding: .3rem .45rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td.muted { white-space: normal; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 600; padding-bottom: .25rem; }
tr.mine td { background: var(--accent-weak); font-weight: 600; }
tr.current td { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 600; }
table.line { width: auto; margin-bottom: 1rem; }
table.line td, table.line th { padding: .2rem .5rem; text-align: center; }

.tabs { display: flex; gap: .25rem; margin: .75rem 0; }
.tabs a { padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

pre.report { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Consolas, "Malgun Gothic", monospace;
    margin: 0; max-height: 28rem; overflow: auto; }

button.mini { padding: .1rem .45rem; font-size: 12px; }
form.moves { gap: .25rem; flex-wrap: nowrap; }

fieldset.plain { border: none; padding: 0; margin: 0; min-width: 0; }
fieldset.plain[disabled] { opacity: .55; }
.card.err { border-color: var(--err); }
.card ul { margin: .3rem 0; padding-left: 1.2rem; }

.htmx-request button.primary { opacity: .6; }

/* 선수 데이터베이스 */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; margin-bottom: .8rem; }
.filters fieldset { border: 1px solid var(--line); border-radius: 6px; padding: .5rem .7rem; margin: 0; min-width: 0;
    display: grid; gap: .4rem; align-content: start; }
.filters legend { font-weight: 600; font-size: 12px; color: var(--muted); padding: 0 .3rem; }
.filters label { display: flex; align-items: center; gap: .35rem; font-size: 13px; flex-wrap: wrap; }
.filters input.n { width: 4.8rem; }
.row.wrap { flex-wrap: wrap; gap: .2rem .6rem; }
label.chk { gap: .2rem; }
button.link.sort { color: var(--muted); font-weight: 600; font-size: 12px; text-decoration: none; }
button.link.sort:hover { color: var(--accent); }
