/* 공통 디자인 R3.1(D-255). 값은 전달본 시안의 실제 계산값을 옮겼다. 강조색은 네 사이트 같은 파랑 하나, 뜻 있는 색(부족·주의·좋아짐)은 따로 둔다. */
@font-face { font-family:Pretendard; src:url('fonts/PretendardVariable.woff2') format('woff2'); font-weight:100 900; font-display:swap; }
:root { --bg:#edf0f4; --side:#172339; --side-text:#d7e2f3; --top:#2b3438; --accent:#225fd0; --accent-soft:#edf3ff; --line:#d9e1ec; --text:#29343c; --muted:#536470;
        --top-h:60px; --side-w:220px; }
* { box-sizing:border-box; }
html, body { height:100%; }
body { margin:0; font-family:Pretendard,"Malgun Gothic","맑은 고딕",system-ui,sans-serif; color:var(--text); background:var(--bg); font-size:14px; line-height:1.5; font-synthesis:none; font-variant-numeric:tabular-nums; }
button, input, select, textarea { font-family:inherit; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
input[type=checkbox], input[type=radio] { accent-color:var(--accent); }

/* 틀: 위쪽 줄 + 짙은 왼쪽 메뉴 + 본문. 본문만 스크롤하므로 모듈의 position:sticky; top:0 은 위쪽 줄 아래에 그대로 붙는다 */
.app { display:grid; grid-template-columns:var(--side-w) minmax(0,1fr); grid-template-rows:var(--top-h) minmax(0,1fr); height:100vh; height:100dvh; }
.topbar { grid-column:1 / -1; display:flex; align-items:center; gap:22px; padding:0 20px; background:var(--top); color:#fff; border-top:3px solid var(--accent); min-width:0; }
.top-brand { display:block; flex:none; }
.brand-logo { display:block; width:176px; height:auto; }
.site-switch { display:flex; gap:4px; min-width:0; }
.site-switch a { color:#fff; font-size:14px; font-weight:600; padding:9px 15px; border-radius:6px; white-space:nowrap; }
.site-switch a:hover { background:#3a4549; text-decoration:none; }
.site-switch a.selected { background:#424f54; }
.topbar a:focus-visible, .topbar button:focus-visible, .topbar summary:focus-visible, .sidebar a:focus-visible { outline-color:#fff; }
.sidebar { background:var(--side); color:var(--side-text); display:flex; flex-direction:column; padding:0 12px 24px; overflow-y:auto; min-height:0; }
.side-title { font-size:14px; font-weight:750; color:#edf3ff; padding:21px 7px 14px; }
.menu { display:flex; flex-direction:column; gap:2px; padding-top:8px; border-top:1px solid #33435e; }
.menu a { color:var(--side-text); padding:8px 11px; min-height:36px; border-radius:3px; display:flex; justify-content:space-between; align-items:center; gap:6px; font-size:13px; line-height:1.35; }
.menu a:hover { background:#28466e; color:#fff; text-decoration:none; }
.menu a.active { background:#28466e; color:#fff; font-weight:650; box-shadow:inset 3px 0 var(--accent); }
.menu a .tag { font-size:11.5px; color:#b8c8df; white-space:nowrap; }
.menu-sites { display:none; }
.who { margin-left:auto; flex:none; position:relative; font-size:13px; }
.who summary { display:flex; align-items:center; gap:8px; cursor:pointer; list-style:none; padding:4px 6px; border-radius:6px; }
.who summary::-webkit-details-marker { display:none; }
.who summary:hover { background:#3a4549; }
.who .avatar { position:relative; display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#e1e6ea; color:#35434d; font-weight:700; flex:none; }
.who .avatar.attention::after { content:""; position:absolute; right:-1px; top:-1px; width:9px; height:9px; border-radius:50%; background:#d64535; border:1px solid #fff; }
.who .who-pop { position:absolute; right:0; top:44px; z-index:90; width:220px; padding:14px; background:#fff; color:var(--text); border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 30px #22374722; display:grid; gap:8px; }
.who .who-pop strong { font-size:13px; }
.who .who-pop button { min-height:36px; padding:7px 12px; background:#fff; color:var(--text); border:1px solid #cbd4da; border-radius:2px; font-size:13px; cursor:pointer; text-align:left; }
.who .who-pop button:hover { background:#f1f4f6; }
.who .who-pop button.attention { border-color:var(--accent); color:var(--accent); font-weight:650; }
.menu-toggle { display:none; }
.main { min-width:0; min-height:0; overflow:auto; padding:14px 20px 30px; }
.crumb { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:12px; color:var(--muted); margin-bottom:8px; min-height:18px; }
.crumb a { color:var(--muted); }
.crumb .sep { color:#96a1aa; }
.view h1 { font-size:26px; font-weight:750; letter-spacing:-.8px; line-height:1.25; margin:0 0 14px; }

/* 로그인·2단계·첫 비밀번호·처음 설정: 메뉴 없는 전체 화면 */
.auth-head { display:none; }
.booting .auth-head { display:none !important; }   /* 로그인 여부를 알기 전에는 로그인 머리도 틀도 보이지 않는다 */
.auth-page .auth-head { display:flex; align-items:center; height:72px; padding:0 38px; background:#fff; border-bottom:1px solid var(--line); }
.auth-logo { display:block; width:171px; height:auto; }
.auth-head span { margin-left:14px; padding-left:14px; border-left:1px solid var(--line); font-size:14px; font-weight:650; color:var(--accent); }
.auth-page { background:#f4f6fa; }
.auth-page .app { display:block; height:auto; }
.auth-page .topbar, .auth-page .sidebar, .auth-page .crumb { display:none; }
.auth-page .main { overflow:visible; padding:42px 16px; }
.auth-page .view { width:min(620px,100%); margin:0 auto; }
.auth-page .view h1 { font-size:27px; letter-spacing:-.5px; line-height:1.35; margin-bottom:14px; }
.auth-page .card { max-width:none !important; padding:36px; border-radius:12px; box-shadow:0 10px 30px #21324908; }
.auth-page .card label { font-size:14px; color:var(--text); margin:18px 0 8px; }
.auth-page .card form > label:first-child { margin-top:0; }
.auth-page .card input:not([type=checkbox]) { min-height:44px; padding:8px 12px; }
.auth-page button.primary { width:100%; min-height:42px; margin-top:24px; }

.card { background:#fff; border:1px solid var(--line); border-radius:8px; padding:20px; max-width:520px; }
.card label { display:block; margin:10px 0 4px; color:var(--muted); font-size:12px; }
.card input { width:100%; padding:8px 10px; min-height:38px; border:1px solid #b9c6d8; border-radius:5px; font-size:14px; }
button.primary:not(.ops-btn) { margin-top:16px; background:var(--accent); color:#fff; border:1px solid var(--accent); border-radius:5px; padding:9px 16px; font-size:14px; font-weight:600; cursor:pointer; }
button.primary:not(.ops-btn):hover { filter:brightness(.95); }
button.primary:not(.ops-btn):disabled { background:#e7edf5; border-color:#c4cedd; color:#425269; cursor:not-allowed; filter:none; }
.error { color:#b3261e; margin-top:10px; font-size:13px; }
.muted { color:var(--muted); }
table { border-collapse:collapse; width:100%; background:#fff; font-size:13px; }
th, td { border:1px solid #e2e7ee; padding:8px 10px; text-align:left; }
th { background:#edf1f6; color:#53616c; font-size:12px; font-weight:600; }
tbody tr:hover { background:#f7fafb; }
.toolbar { display:flex; gap:8px; margin-bottom:12px; }
.toolbar input { padding:8px 10px; min-height:36px; border:1px solid #c6cfd6; border-radius:2px; min-width:260px; }
.placeholder { background:#fff; border:1px dashed #aebbd0; border-radius:8px; padding:28px; color:var(--muted); }
.placeholder .ops-btn { display:flex; width:max-content; margin-top:12px; }

/* 1200px 이하(시안 값): 메뉴 180, 본문 여백 16 */
@media (max-width: 1200px) {
  :root { --side-w:180px; }
  .topbar { gap:14px; padding:0 16px; }
  .brand-logo { width:138px; }
  .site-switch a { font-size:12px; padding:8px 10px; }
  .main { padding:14px 16px 30px; }
  .who .who-name { max-width:150px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
}
/* 휴대폰 폭(760px 이하): '메뉴' 버튼으로 왼쪽 메뉴를 펼친다(10-29 S3, A4). 사이트 이동은 위쪽 줄 대신 메뉴 안에 둔다. */
@media (max-width: 760px) {
  :root { --top-h:58px; --side-w:0px; }
  .app { grid-template-columns:minmax(0,1fr); }
  .topbar { padding:0 10px; gap:8px; }
  .brand-logo { width:116px; }
  .site-switch, .who .who-name { display:none; }
  .menu-toggle { display:block; flex:none; min-height:40px; padding:6px 12px; background:transparent; color:#fff; border:1px solid #78868e; border-radius:6px; font-size:14px; cursor:pointer; }
  .menu-toggle[hidden] { display:none; }
  .sidebar { display:none; position:fixed; left:0; top:var(--top-h); bottom:0; width:268px; z-index:80; box-shadow:8px 0 30px #172c3430; }
  .sidebar.open { display:flex; }
  .menu a { min-height:44px; font-size:14px; }
  .menu-sites:not(:empty) { display:flex; flex-direction:column; gap:2px; margin-top:12px; padding-top:8px; border-top:1px solid #33435e; }
  .menu-sites a { color:var(--side-text); padding:8px 11px; min-height:44px; display:flex; align-items:center; font-size:14px; }
  .main { padding:12px 12px 40px; }
  .view h1 { font-size:25px; }
  .auth-page .auth-head { height:60px; padding:0 20px; }
  .auth-logo { width:132px; }
  .auth-page .main { padding:22px 16px; }
  .auth-page .card { padding:24px 20px; }
  .auth-page .view h1 { font-size:24px; }
  .toolbar { flex-wrap:wrap; }
  .toolbar input { min-width:0; width:100%; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; transition:none !important; } }
@media print {
  html, body { height:auto; background:#fff; }
  .app { display:block; height:auto; }
  .topbar, .sidebar, .crumb, .auth-head { display:none !important; }
  .main { overflow:visible; padding:0; }
}

/* ── 메인 대시보드 ─────────────────────────────────────────────── */
.home-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; align-items:start; }
.home-panel { background:#fff; border:1px solid #dfe6ef; border-radius:8px; padding:18px 20px; min-width:0; }
.home-section-title { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:12px; }
.home-section-title h2 { font-size:17px; margin:0; }
.home-section-title .count { font-size:12px; color:var(--accent); font-weight:650; white-space:nowrap; }
.home-section-title .ops-btn { min-height:30px; padding:4px 8px; font-size:12px; }
.home-section-title .spacer { margin-left:auto; }
.home-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.home-card { display:flex; flex-direction:column; min-width:0; gap:6px; border:1px solid #dce4ef; border-radius:6px; padding:15px; background:#fff; }
.home-card .card-site { font-size:12px; font-weight:750; letter-spacing:.7px; color:#5b6b81; }
.home-card .card-label { font-size:14px; font-weight:650; }
.home-card .home-body { flex:1; font-size:13px; overflow-wrap:anywhere; }
.home-card .home-body > div { margin:2px 0; }
.home-card .home-body > div.home-lead { font-size:18px; font-weight:750; line-height:1.35; letter-spacing:-.3px; margin-bottom:6px; }
.home-card .home-small { font-size:12px; color:var(--muted); }
.home-card .home-risk { color:var(--ops-risk); font-weight:650; }
.home-card .home-warn { color:var(--ops-warn); }
.home-card .home-link { color:var(--accent); cursor:pointer; text-decoration:underline; }
.home-card .home-open { font-size:13px; margin-top:6px; align-self:flex-start; }
.home-card .site-link { display:block; margin:4px 0; font-size:14px; font-weight:650; }
.notice-row { margin-top:10px; border-top:1px solid #edf0f5; padding-top:10px; }
.notice-row summary { cursor:pointer; }
.notice-row .notice-text { white-space:pre-wrap; margin:6px 0; }
.notice-row .notice-meta { display:block; font-size:12px; color:var(--muted); padding-left:16px; margin-top:2px; font-weight:400; }
.notice-row .important-label { font-size:12px; line-height:1.4; padding:2px 5px; margin-right:6px; background:#fff0e4; color:#8b4b12; border-radius:3px; font-weight:650; }
.notice-form { margin:10px 0 0; display:grid; gap:6px; max-width:620px; }
.notice-form .ops-input { width:100%; }
.notice-form label { display:flex; gap:6px; align-items:center; font-size:13px; }
@media (min-width: 1280px) {
  .home-grid.has-notices { grid-template-columns:minmax(0,1fr) 340px; }
  .home-grid.has-notices #home-notices { grid-column:2; grid-row:1; }
  .home-grid.has-notices #home-summary { grid-column:1; grid-row:1; }
  .home-grid.has-notices .home-cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1680px) { .home-grid.has-notices .home-cards { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (max-width: 1100px) { .home-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) {
  .home-panel { padding:15px; }
  .home-cards { gap:8px; }
  .home-card { padding:12px; }
}
@media (max-width: 420px) { .home-cards { grid-template-columns:minmax(0,1fr); } }

/* ── 공통 화면 부품(R3.1 값, D-255) ──────────────────────────────
   이름 앞에 ops-를 붙여, 모듈이 이미 쓰는 .pill·.btn 등과 겹치지 않게 했다. 모듈 자체 색은 담당 방이 이 변수로 옮긴다. */
:root { --ops-ink:#29343c; --ops-line:#dfe6ef; --ops-line-strong:#cbd4da; --ops-row-line:#e2e7ee; --ops-selected:#edf3ff;
        --ops-ok:#245a3c; --ops-ok-bg:#e3efe7; --ops-warn:#8a5a00; --ops-warn-bg:#fff6e0; --ops-risk:#b3261e; --ops-risk-bg:#fdecea;
        --ops-neutral-bg:#eef1f4; --ops-edit-bg:#fffbea; --ops-required-bg:#eaf2ff; }
/* 버튼: 주 버튼은 한 화면(탭)에 하나 */
.ops-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:36px; padding:7px 13px; border:1px solid var(--ops-line-strong); border-radius:2px;
           background:#fff; color:var(--ops-ink); font:inherit; font-size:14px; font-weight:550; white-space:nowrap; cursor:pointer; }
.ops-btn:hover { background:#f1f4f6; text-decoration:none; }
.ops-btn[hidden], .ops-input[hidden] { display:none !important; }
.ops-btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
.ops-btn.primary:hover { background:var(--accent); filter:brightness(.95); }
.ops-btn.accent { border-color:var(--accent); color:var(--accent); font-weight:600; }
.ops-btn.danger { color:var(--ops-risk); }
.ops-btn:disabled { background:#e7edf5; border-color:#c4cedd; color:#425269; cursor:not-allowed; filter:none; }
.ops-btn-text { border:0; background:none; padding:0 4px; color:var(--muted); font:inherit; font-size:13px; white-space:nowrap; cursor:pointer; }
.ops-btn-text:hover { text-decoration:underline; }
.ops-btn:focus-visible, .ops-btn-text:focus-visible, .ops-chip:focus-visible, .ops-tabs [role=tab]:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
/* 화면 탭(아래 3px 선 + 강조색 굵게)과 선택 칩(옅은 파랑 + 강조색 테두리) */
.ops-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:12px; overflow-x:auto; }
.ops-tabs [role=tab] { border:0; border-bottom:3px solid transparent; background:none; padding:10px 14px; font:inherit; font-size:13px; color:var(--muted); white-space:nowrap; cursor:pointer; }
.ops-tabs [role=tab][aria-selected=true] { border-bottom-color:var(--accent); color:var(--accent); font-weight:700; }
.ops-chip { min-height:36px; padding:0 12px; border:1px solid var(--ops-line-strong); border-radius:2px; background:#fff; color:var(--ops-ink); font:inherit; font-size:13px; white-space:nowrap; cursor:pointer; }
.ops-chip[aria-pressed=true] { background:var(--ops-selected); border-color:var(--accent); color:var(--accent); font-weight:700; }
/* 표: 머리글 옅은 회색 12px, 칸 선, 숫자 오른쪽·폭 고정. 표 안 버튼·입력칸은 줄을 키우지 않게 작게 */
.ops-table { border-collapse:collapse; width:100%; background:#fff; font-size:13px; }
.ops-table th { background:#edf1f6; height:36px; font-size:12px; font-weight:600; color:#53616c; border:1px solid var(--ops-row-line); padding:0 10px; text-align:left; white-space:nowrap; }
.ops-table td { height:38px; border:1px solid var(--ops-row-line); padding:0 10px; }
.ops-table tbody tr:hover, .ops-table tbody tr.selected { background:#f7fafb; }
.ops-table .num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.ops-table .ops-btn { min-height:30px; padding:4px 8px; font-size:12px; }
.ops-table .ops-input { min-height:30px; padding:4px 6px; }
/* 상태 알약: 정상 / 주의 / 위험(위험만 빨강) / 중립 */
.ops-pill { display:inline-block; height:22px; line-height:22px; padding:0 7px; border-radius:4px; font-size:12px; font-weight:650; white-space:nowrap; }
.ops-pill.ok { background:var(--ops-ok-bg); color:var(--ops-ok); }
.ops-pill.warn { background:var(--ops-warn-bg); color:var(--ops-warn); }
.ops-pill.risk { background:var(--ops-risk-bg); color:var(--ops-risk); }
.ops-pill.neutral { background:var(--ops-neutral-bg); color:#46545f; }
/* 경고 줄·결과 안내(왼쪽 3px 선. 앞에 '주의'·'위험' 굵게는 글로 쓴다)와 저장 줄 */
.ops-notice { padding:10px 14px; background:var(--accent-soft); border-left:3px solid var(--accent); font-size:13px; line-height:1.5; margin:8px 0; }
.ops-notice.warn { background:#fff8eb; border-color:#d79b32; color:var(--ops-ink); }
.ops-notice.risk { background:var(--ops-risk-bg); border-color:var(--ops-risk); color:var(--ops-ink); }
.ops-notice b, .ops-dirty b { font-weight:700; }
.ops-dirty { display:flex; align-items:center; gap:10px; padding:12px 16px; background:#fff; border-top:2px solid var(--accent); font-size:13px; margin:8px 0; }
/* 입력칸. 필수칸은 .required(옅은 파랑) + 칸 이름 뒤 .ops-req(*), 범례는 .ops-legend. 서버 필수 검사와는 따로다 */
.ops-input { min-height:36px; padding:7px 10px; border:1px solid #c6cfd6; border-radius:2px; font:inherit; font-size:13px; background:#fff; color:var(--ops-ink); max-width:100%; }
.ops-input.edit { background:var(--ops-edit-bg); }
.ops-input.required { background:var(--ops-required-bg); }
.ops-input.num { text-align:right; font-variant-numeric:tabular-nums; }
.ops-input:focus { background:#fff; border-color:var(--accent); }
.ops-input[aria-invalid=true] { border-color:#b42318; background:#fff6f5; }
.ops-input::placeholder { color:var(--muted); }
.ops-req { color:var(--accent); font-weight:700; margin-left:2px; }
.ops-legend { display:inline-flex; align-items:center; gap:2px; font-size:12px; color:var(--muted); }
.ops-legend::before { content:"*"; color:var(--accent); font-weight:700; }
/* 핵심 숫자 카드 */
.ops-kpi { background:#fff; border:1px solid var(--line); border-radius:4px; padding:13px 15px; }
.ops-kpi .label { font-size:13px; color:var(--muted); font-weight:550; }
.ops-kpi .value { font-size:27px; font-weight:750; letter-spacing:-.5px; line-height:1.25; font-variant-numeric:tabular-nums; }
.ops-kpi .value.small { font-size:16px; }
@media (max-width: 760px) {
  .ops-btn, .ops-chip, .ops-input { min-height:44px; }
  .ops-table .ops-btn, .ops-table .ops-input { min-height:36px; }
}
