/* css/base.css — quality_dashboard.html <style> 에서 분리(2026-10-03). 링크 순서 1/7 */
  /* ── 기본 리셋 ── */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', sans-serif;   /* IBM Plex 링크 제거(미사용) 2026-10-12 */
    background: #fafbfc; color: #16211f; font-size: 14px;
    height: 100vh; overflow: hidden;
    -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
  }

  /* ── 전체 레이아웃 ── */
  .app { display: flex; flex-direction: row; height: 100vh; overflow: hidden; }

  /* ── 사이드바 (세로) ── */
  .sidebar {
    width: 216px; flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e7edee;
    display: flex; flex-direction: column; align-items: stretch;
    height: 100vh;
    overflow-y: auto; overflow-x: hidden;
    position: relative; z-index: 10;
    padding: 12px 10px; gap: 2px;
  }
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
  .sidebar-logo {
    padding: 4px 8px 14px; flex-shrink: 0;
    display: flex; flex-direction: column;
  }
  .sidebar-logo .brand {
    font-size: 11px; color: #8a999f;
    letter-spacing: 0.3px; margin-bottom: 2px;
  }
  .sidebar-logo .title {
    font-size: 17px; font-weight: 600; color: #182a31;
    letter-spacing: -0.02em;
  }
  .sidebar-logo .title span { color: #0e9aae; }

  .sidebar-section { display: flex; flex-direction: column; align-items: stretch; padding: 0; gap: 1px; }
  .sidebar-section + .sidebar-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid #eef3f4; }
  .sidebar-section-label {
    display: block; font-size: 10.5px; font-weight: 600;
    color: #8a999f; padding: 2px 12px 5px; letter-spacing: 0.4px;
  }
  .nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 12px; margin: 0; color: #4a5c63;
    cursor: pointer; font-size: 13px; font-weight: 500;
    border: none; background: none; width: 100%; text-align: left;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    border-radius: 8px;
  }
  .nav-item:hover { background: #f2f7f8; color: #182a31; }
  .nav-item.active { background: #e8f6f8; color: #0a7a8a; font-weight: 600; box-shadow: inset 3px 0 0 #17A2B8; }
  /* 하위 메뉴 (예: 품질사고 관리대장 > 공정별 사고) */
  .nav-sub {
    margin-left: 16px; padding-left: 14px; font-size: 12.5px;
    border-left: 2px solid #d7e6e9; border-radius: 0 8px 8px 0;
    color: #4a5c63;
  }
  .nav-sub .nav-icon { font-size: 14px; }
  .nav-sub.active { border-left-color: #17A2B8; }
  .nav-icon { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }

  /* ── 접이식 상위 메뉴 (품질 핵심지표) ── */
  .nav-parent .nav-caret { margin-left: auto; font-size: 14px; color: #9aa6a6; transition: transform 0.18s; }
  .nav-parent[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
  .nav-parent[aria-expanded="true"] { background: #f2f7f8; color: #182a31; font-weight: 600; }
  .nav-parent.has-active { color: #0a7a8a; }
  .core-sub { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; }
  .core-sub.collapsed { display: none; }

  /* ── 메인 영역 ── */
  .main-area {
    flex: 1; min-width: 0; min-height: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
  }

  /* ── 상단 바 ── */
  .topbar { display: none; }
  .topbar-title {
    font-size: 15px; font-weight: 600; color: #1d1d1f;
    letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
  }
  .topbar-meta {
    font-size: 12px; color: #86868b;
    white-space: nowrap; flex-shrink: 0;
  }

  /* ── 콘텐츠 영역 ── */
  .content {
    flex: 1; padding: 24px 28px;
    overflow-y: auto; overflow-x: hidden;
    min-height: 0;
  }

  /* ── 탭 ── */
  .tab { display: none; }
  .tab.active { display: block; }

  /* ── 메트릭 카드 ── */
  .metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 20px;
  }
  .metric {
    background: #fff; border: 1px solid #cfdadd;
    border-left: 3px solid #17A2B8;
    border-radius: 12px; padding: 18px 20px;
    box-shadow: none;
    min-width: 0; overflow: hidden;
    transition: border-color 0.18s ease;
  }
  .metric:hover { border-color: #cfe6ea; }
  .metric .label { font-size: 11.5px; color: #6b7a7a; margin-bottom: 7px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .metric .value { font-size: 27px; font-weight: 700; color: #16211f; white-space: nowrap; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
  .metric .sub { font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sub.up { color: #d70015; }
  .sub.down { color: #248a3d; }
  .sub.neutral { color: #86868b; }

  /* ── 스킨A KPI 요약: 강조 히어로 카드 + 상태 뱃지 + 진행바 ── */
  .metric.hero { background: linear-gradient(135deg,#17A2B8,#0f7f90); border: none; }
  .metric.hero .label { color: rgba(255,255,255,0.85); }
  .metric.hero .value { color: #ffffff; }
  .metric.hero .sub { color: rgba(255,255,255,0.9); }
  .kpi-pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-bottom: 9px; letter-spacing: 0; }
  .kpi-pill.good { background: #e6f5ee; color: #12996a; }
  .kpi-pill.warn { background: #fdf0e6; color: #bd6a22; }
  .kpi-pill.crit { background: #fbeaea; color: #c0392b; }
  .metric.hero .kpi-pill { background: rgba(255,255,255,0.2); color: #fff; }
  .kpi-prog { height: 5px; border-radius: 3px; background: #eef2f2; margin-top: 12px; overflow: hidden; }
  .kpi-prog > i { display: block; height: 100%; border-radius: 3px; background: #12996a; }
  .metric.hero .kpi-prog { background: rgba(255,255,255,0.25); }
  .metric.hero .kpi-prog > i { background: #fff; }

  /* ── 핵심지표 화면 통일: 각 화면 요약 첫 카드를 히어로로 ── */
  #nccost-metrics .metric:first-child,
  #erp-metrics .metric:first-child,
  #analysis-metrics .metric:first-child,
  #worker-metrics .metric:first-child {
    background: linear-gradient(135deg,#17A2B8,#0f7f90) !important;
    border: none !important;
  }
  #nccost-metrics .metric:first-child .label,
  #erp-metrics .metric:first-child .label,
  #analysis-metrics .metric:first-child .label,
  #worker-metrics .metric:first-child .label,
  #nccost-metrics .metric:first-child .value,
  #erp-metrics .metric:first-child .value,
  #analysis-metrics .metric:first-child .value,
  #worker-metrics .metric:first-child .value,
  #nccost-metrics .metric:first-child .value span,
  #erp-metrics .metric:first-child .value span,
  #analysis-metrics .metric:first-child .value span,
  #worker-metrics .metric:first-child .value span,
  #nccost-metrics .metric:first-child .sub,
  #erp-metrics .metric:first-child .sub,
  #analysis-metrics .metric:first-child .sub,
  #worker-metrics .metric:first-child .sub {
    color: #ffffff !important;
  }

  /* ── 핵심지표 5화면 요약 카드 규격 통일 (폭·높이·숫자크기) ── */
  #kpi-summary, #erp-metrics, #analysis-metrics, #worker-metrics {
    grid-template-columns: repeat(auto-fill, minmax(184px, 208px)) !important;
    gap: 12px !important;
  }
  #kpi-summary .metric, #erp-metrics .metric,
  #analysis-metrics .metric, #worker-metrics .metric {
    min-height: 108px !important;
    padding: 15px 17px !important;
    display: flex !important; flex-direction: column !important;
  }
  #kpi-summary .metric .value, #erp-metrics .metric .value,
  #analysis-metrics .metric .value, #worker-metrics .metric .value {
    font-size: 25px !important; font-weight: 700 !important; margin-top: auto;
  }
  #kpi-summary .metric .value span, #erp-metrics .metric .value span,
  #analysis-metrics .metric .value span, #worker-metrics .metric .value span {
    font-size: 13px !important;
  }
  #kpi-summary .metric .label, #erp-metrics .metric .label,
  #analysis-metrics .metric .label, #worker-metrics .metric .label {
    font-size: 11.5px !important; margin-bottom: 4px;
  }

  /* ── 2칸 그리드 ── */
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
  @media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
  @media (max-width: 1100px) { #core-summary-grid, #core-chart-grid, #home-chart-grid { grid-template-columns: repeat(2,1fr) !important; } }
  @media (max-width: 700px) { #core-summary-grid, #core-chart-grid, #home-chart-grid { grid-template-columns: 1fr !important; } }

  /* ── 카드 ── */
  .card {
    background: #fff; border: 1px solid #cfdadd;
    border-radius: 12px; padding: 20px;
    box-shadow: none;
    min-width: 0; overflow: hidden;
  }
  .card-title {
    font-size: 14px; font-weight: 600; color: #1d1d1f;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
    padding-left: 10px; border-left: 3px solid #17A2B8;
    display: flex; align-items: center; justify-content: space-between;
    white-space: nowrap; overflow: hidden; gap: 8px;
  }

  /* ── 대시보드 홈: 데이터 포워드 스타일 (굵은 숫자 + 카드 상단 컬러바, 아이콘 칩은 숨김) ── */
  #tab-dashboard .card { border-color: #e7e9ec; border-radius: 12px; box-shadow: none; }
  #tab-dashboard .card-title { border-left: none; padding-left: 0; font-weight: 800; }
  #tab-dashboard .dash-icon-chip { display: none; }
  #tab-dashboard .metrics .metric {
    border-color: #e7e9ec; border-left: none; border-radius: 12px; box-shadow: none;
    border-top: 4px solid #17A2B8;
  }
  #tab-dashboard .metrics .metric:nth-child(2) { border-top-color: #eb6834; }
  #tab-dashboard .metrics .metric:nth-child(3) { border-top-color: #1baf7a; }
  #tab-dashboard .metrics .metric:nth-child(4) { border-top-color: #eda100; }
  #tab-dashboard .metrics .metric .value { font-size: 32px; font-weight: 800; }
  #tab-dashboard .metrics .metric .label { font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: 11px; }
  #tab-dashboard .section-title { font-weight: 800; }
  #dash-refresh-btn { background: #14181d; color: #fff; border: none; border-radius: 9px; padding: 7px 15px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
  #dash-refresh-btn:hover { background: #262b32; }
  .dash-icon-chip {
    width: 26px; height: 26px; border-radius: 8px; background: #e8f6f8;
    display: inline-flex; align-items: center; justify-content: center;
    color: #0a7a8a; flex-shrink: 0; font-size: 15px;
  }

  /* ── 문서 관리 ── */
  .doc-filter {
    padding: 6px 15px; border: 1px solid #d2d2d7; border-radius: 980px;
    background: #fff; color: #424245; font-size: 12px; cursor: pointer;
    transition: all 0.15s;
  }
  .doc-filter.active { background: #17A2B8; color: #fff; border-color: #17A2B8; }
  .doc-filter:hover:not(.active) { background: #f5f5f7; }
  .btn-blue {
    padding: 7px 16px; background: #17A2B8; color: #fff;
    border: none; border-radius: 980px; font-size: 12px; cursor: pointer;
    transition: background 0.15s;
  }
  .btn-blue:hover { background: #138496; }
  .doc-card {
    background: #fff; border: 1px solid #e7edee; border-radius: 14px;
    padding: 18px; box-shadow: 0 1px 2px rgba(24,42,49,0.04);
    display: flex; flex-direction: column; gap: 10px; min-width: 0;
  }
  .doc-card-icon { font-size: 32px; line-height: 1; }
  .doc-card-name { font-size: 13px; font-weight: 600; color: #1d1d1f; word-break: break-all; }
  .doc-card-meta { font-size: 11px; color: #86868b; }
  .doc-card-actions { display: flex; gap: 8px; margin-top: 4px; }
  .doc-btn-open {
    flex: 1; padding: 6px 0; background: #e3f1fd; color: #17A2B8;
    border: none; border-radius: 8px; font-size: 12px; cursor: pointer;
  }
  .doc-btn-open:hover { background: #d2e7fc; }
  .doc-btn-del {
    padding: 6px 12px; background: #ffe5e3; color: #d70015;
    border: none; border-radius: 8px; font-size: 12px; cursor: pointer;
  }
  .doc-btn-del:hover { background: #ffd6d3; }


  /* Shared starting positions across the quality indicator pages. */
  .core-page-header {
    /* 핵심지표 하위 화면 공통 헤더: 제목행 32 / 설명행 20 / 연도행 30 / 기간행 34 — 모든 화면에서 카드 시작 위치가 같아진다 */
    box-sizing: border-box; padding-bottom: 12px;
    display: grid; grid-template-rows: 32px 20px 32px 32px; row-gap: 8px; align-content: start;
    min-height: 152px;
  }
  .core-page-header.cph-2rows { grid-template-rows: 32px 20px; min-height: 0; padding-bottom: 8px; }
  .core-page-header > .cph-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
  .core-page-header > .cph-title .section-title { font-size: 17px; font-weight: 700; line-height: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .core-page-header > .cph-title .cph-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .core-page-header > .cph-desc { font-size: 12px; color: #86868b; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .core-page-header > .cph-desc b { color: #59676d; font-weight: 600; }
  .core-page-header > .cph-years { display: flex; gap: 4px; align-items: flex-end; border-bottom: 2px solid #e5e5e0; height: 30px; }
  .core-page-header > .cph-years .claim-year-btn { padding: 4px 11px; }
  .core-page-header > .cph-period { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; font-size: 12.5px; color: #555; overflow-x: auto; }
  .core-page-header > .cph-period select { border: 1px solid #d2d2d7; border-radius: 7px; padding: 5px 8px; font-size: 12.5px; }
  .core-page-header > .cph-period > span[style*="inline-flex"] { flex-shrink: 0; }
  .cph-note { font-size: 12px; color: #86868b; margin: -8px 0 14px; }
  .cph-note:empty { display: none; }
  .core-page-header > :not([style*="display:none"]) { margin-top: 0 !important; margin-bottom: 0 !important; }
  .core-page-header .section-title { white-space: normal; }
  #nccost-metrics, #erp-metrics, #analysis-metrics, #worker-metrics, #kpi-summary {
    grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: 208px;
    height: 164px; margin-bottom: 20px !important; align-items: stretch;
    overflow-x: auto; overflow-y: hidden; padding-bottom: 8px;

  }
  @media (max-width: 760px) {
    .core-page-header { grid-template-rows: auto; min-height: 0; }
    .core-page-header > .cph-title, .core-page-header > .cph-period { flex-wrap: wrap; }
    .core-page-header > .cph-desc { white-space: normal; }
  }

  /* ── 테이블 ── */
  .tbl-wrap { overflow-x: auto; }
  #gajebon-table thead { position: relative; z-index: 5; }
  #gajebon-table thead th { box-shadow: inset 0 -1px #dce4e7; }

  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th {
    text-align: left; padding: 10px 12px;
    background: #fafcfc; color: #6b7a7a;
    font-weight: 600; border-bottom: 1px solid #e6ecec;
    font-size: 11.5px; letter-spacing: .02em; white-space: nowrap;
  }
  td {
    padding: 10px 12px; border-bottom: 1px solid #eef3f4;
    color: #1d1d1f; vertical-align: middle;
  }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: #f5f5f7; }

  /* ── 배지 ── */
  .badge {
    display: inline-block; padding: 3px 9px;
    border-radius: 7px; font-size: 11px; font-weight: 600;
    white-space: nowrap;
  }
  .badge-open { background: #ffe5e3; color: #d70015; }
  .badge-progress { background: #ffefd6; color: #c93400; }
  .badge-done { background: #ddf4e2; color: #248a3d; }
  .badge-pass { background: #ddf4e2; color: #248a3d; }
  .badge-fail { background: #ffe5e3; color: #d70015; }
  .badge-high { background: #ffe5e3; color: #d70015; }
  .badge-mid { background: #ffefd6; color: #c93400; }
  .badge-low { background: #e3f1fd; color: #17A2B8; }

  /* ── 폼 ── */
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  @media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
  .form-full { grid-column: 1 / -1; }
  .form-group { display: flex; flex-direction: column; gap: 4px; }
  .form-group label { font-size: 12px; color: #6e6e73; font-weight: 500; }
  .form-group input, .form-group select, .form-group textarea {
    border: 1px solid #d2d2d7; border-radius: 9px; padding: 8px 11px;
    font-size: 13px; font-family: inherit;
    background: #fff; color: #1d1d1f; outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #17A2B8; box-shadow: 0 0 0 3px rgba(23,162,184,0.15); }
  .form-group textarea { resize: vertical; min-height: 70px; }

  /* ── 버튼 ── */
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: 980px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; transition: all 0.15s;
    white-space: nowrap;
  }
  .btn-primary { background: #17A2B8; color: #fff; border-color: #17A2B8; }
  .btn-primary:hover { background: #138496; }
  .btn-secondary { background: #f5f5f7; color: #1d1d1f; border-color: transparent; }
  .btn-secondary:hover { background: #e8e8ed; }
  .btn-danger { background: #fff; color: #d70015; border-color: #f5c0bd; }
  .btn-danger:hover { background: #ffe5e3; }
  .btn-sm { padding: 5px 13px; font-size: 12px; }

  /* ── 섹션 헤더 ── */
  .section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
  }
  .section-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }

  /* ── 폼 패널 ── */
  .form-panel {
    background: #fff; border: 1px solid #e7edee;
    border-radius: 14px; padding: 22px; margin-bottom: 20px;
  }
  .form-actions { display: flex; gap: 8px; margin-top: 16px; }

  /* ── 알림 ── */
  .alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; display: none; }
  .alert-success { background: #ddf4e2; color: #248a3d; border: none; }

  /* ── 프로그레스 바 ── */
  .progress-bar { height: 6px; background: #e8e8ed; border-radius: 980px; overflow: hidden; }
  .progress-fill { height: 100%; border-radius: 980px; transition: width 0.3s; }
  .fill-green { background: #34c759; }
  .fill-amber { background: #ff9500; }
  .fill-red { background: #ff3b30; }

  /* ── NCR 상세 ── */
  .detail-row { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f0ee; }
  .detail-label { color: #888; min-width: 110px; font-size: 12px; flex-shrink: 0; }
  .detail-value { color: #1a1a1a; font-size: 13px; flex: 1; min-width: 0; word-break: break-all; }

  /* ── 차트 컨테이너 ── */
  .chart-wrap { position: relative; height: 220px; }

  /* ── 필터 바 ── */
  .filter-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
  .filter-bar input, .filter-bar select {
    padding: 7px 12px; border: 1px solid #d2d2d7;
    border-radius: 9px; font-size: 13px;
    background: #fff; outline: none;
  }
  .filter-bar input:focus, .filter-bar select:focus { border-color: #17A2B8; box-shadow: 0 0 0 3px rgba(23,162,184,0.15); }
  .filter-bar input { flex: 1; min-width: 120px; }

  /* ── 시트/연도 탭 버튼 ── */
  .gajebon-sheet-btn, .claim-year-btn, .ncr-src-btn {
    background: none; border: none; border-bottom: 2px solid transparent;
    padding: 8px 14px 9px; font-size: 13px; color: #888;
    cursor: pointer; margin-bottom: -1px; transition: all 0.15s;
    white-space: nowrap;
  }
  .gajebon-sheet-btn:hover, .claim-year-btn:hover, .ncr-src-btn:hover { color: #1d1d1f; }
  .gajebon-sheet-btn.active, .claim-year-btn.active, .ncr-src-btn.active {
    color: #17A2B8; border-bottom-color: #17A2B8; font-weight: 600;
  }

  /* ── 태그 ── */
  .tag { display: inline-block; background: #f5f5f7; color: #6e6e73; border-radius: 6px; padding: 2px 8px; font-size: 11px; white-space: nowrap; }

  /* ── 빈 상태 ── */
  .empty { text-align: center; padding: 24px; color: #bbb; font-size: 13px; }

  /* ── 아이콘 버튼 / 토글 ── */
  .icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%; border: none;
    font-size: 15px; cursor: pointer; flex-shrink: 0; transition: all 0.15s;
  }
  .icon-btn.primary { background: #17A2B8; color: #fff; }
  .icon-btn.primary:hover { background: #138496; }
  .icon-btn.ghost { background: #f5f5f7; color: #424245; }
  .icon-btn.ghost:hover { background: #e8e8ed; }
  .gj-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid #d2d2d7; background: #fff; color: #424245;
    border-radius: 980px; padding: 7px 14px; font-size: 13px;
    cursor: pointer; white-space: nowrap; transition: all 0.15s;
  }
  .gj-toggle:hover { background: #f5f5f7; }
  .gj-toggle.gj-on { background: #17A2B8; color: #fff; border-color: #17A2B8; }

  /* ── 검사 항목 행 ── */
  .insp-item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }

  /* ── 데이터 건강 표시 (탭바 오른쪽 끝, 가로 스크롤 시에도 고정) ── */
  #health-pill.hp {
    position: sticky; right: 0; margin-left: auto; align-self: center; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 9px; margin-bottom: 0;
    border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: -0.01em; cursor: pointer; user-select: none;
    background: #fff; border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 1px 2px rgba(0,0,0,0.04); white-space: nowrap;
  }
  #health-pill .hp-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }
  #health-pill .hp-time { font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; }
  #health-pill.hp-ok   { color: #1f7a4d; background: #eef8f2; border-color: #cfe9da; }
  #health-pill.hp-warn { color: #9a6700; background: #fff7e6; border-color: #f1dfb0; }
  #health-pill.hp-fail { color: #b42318; background: #fdeeec; border-color: #f5c6c0; }
  #health-pill.hp-fail .hp-dot { animation: hp-blink 1.6s ease-in-out infinite; }
  @keyframes hp-blink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
  #health-panel {
    position: fixed; z-index: 5000; width: min(440px, calc(100vw - 16px)); max-height: min(70vh, 560px); overflow: auto;
    background: #fff; border: 1px solid rgba(0,0,0,0.08); border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,0.14);
    padding: 12px 14px 10px; font-size: 12.5px; color: #1d1d1f;
  }
  #health-panel .hp-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
  #health-panel .hp-head b { font-size: 13.5px; }
  #health-panel .hp-head span { color: #6e6e73; font-size: 12px; }
  #health-panel .hp-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  #health-panel .hp-tbl th { text-align: left; font-weight: 600; color: #86868b; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid #eef0f2; }
  #health-panel .hp-tbl td { padding: 6px 6px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; font-variant-numeric: tabular-nums; }
  #health-panel .hp-tbl td i { color: #86868b; font-style: normal; font-size: 11px; }
  #health-panel .hp-tbl tr.hp-sub td { padding: 0 6px 6px 14px; color: #b42318; font-size: 11.5px; border-bottom: 1px solid #f3f4f6; }
  #health-panel .hp-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #f2f2f4; color: #6e6e73; }
  #health-panel .hp-b-ok   { background: #eef8f2; color: #1f7a4d; }
  #health-panel .hp-b-warn { background: #fff7e6; color: #9a6700; }
  #health-panel .hp-b-fail { background: #fdeeec; color: #b42318; }
  #health-panel .hp-err { margin-top: 10px; padding: 8px 10px; background: #fff8f7; border: 1px solid #f5c6c0; border-radius: 8px; }
  #health-panel .hp-err b { display: block; font-size: 11.5px; color: #b42318; margin-bottom: 4px; }
  #health-panel .hp-err > div { margin-top: 6px; }
  #health-panel .hp-err-k { font-weight: 600; }
  #health-panel .hp-err pre { margin: 3px 0 0; white-space: pre-wrap; word-break: break-all; font: 11px/1.45 Consolas, monospace; color: #5b2a26; background: #fff; border-radius: 6px; padding: 6px 8px; border: 1px solid #f5dcd8; max-height: 120px; overflow: auto; }
  #health-panel .hp-note { margin-top: 10px; padding: 8px 10px; background: #fff7e6; border-radius: 8px; color: #7a5200; font-size: 12px; }
  #health-panel .hp-foot { margin-top: 10px; font-size: 11px; color: #86868b; }
  @media (max-width: 640px) { #health-pill .hp-time { display: none; } }

  /* ── 인쇄 ── */

  /* ── 모바일 (≤900px): 사이드바는 서랍(오프캔버스)으로, 본문은 전폭 ── */
  .mobile-bar { display: none; }
  .sidebar-backdrop { display: none; }
  @media (max-width: 900px) {
    .app { height: 100dvh; }
    .sidebar {
      position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; width: 264px; max-width: 86vw;
      transform: translateX(-104%); transition: transform .22s ease;
      box-shadow: 0 0 0 rgba(0,0,0,0); z-index: 1000;
    }
    .sidebar.open { transform: none; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
    .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 999; }
    .sidebar.open ~ .sidebar-backdrop { display: block; }
    .mobile-bar {
      display: flex; align-items: center; gap: 10px; padding: 8px 12px;
      background: #fff; border-bottom: 1px solid #e7edee; position: sticky; top: 0; z-index: 20;
    }
    .mobile-bar .mnav-btn {
      width: 38px; height: 38px; border-radius: 9px; border: 1px solid #d9e2e5; background: #fff;
      display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: #1d1d1f; cursor: pointer;
    }
    .mobile-bar .mbar-title { font-size: 15px; font-weight: 700; color: #1d1d1f; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mobile-bar .mbar-sub { font-size: 11px; color: #86868b; white-space: nowrap; }
    #open-tabbar { padding: 8px 12px 0 !important; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: thin; }
    #open-tabbar > * { flex-shrink: 0; }
    .content { padding: 12px 12px 28px; }
    .card { padding: 14px; overflow-x: auto; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .tbl-wrap, .card > div[style*="overflow"] { -webkit-overflow-scrolling: touch; }
    table { font-size: 12px; }
    th, td { padding: 8px 8px; }
    canvas { max-width: 100%; }
    input, select, textarea { font-size: 14px; }
  }
  @media (max-width: 640px) {
    /* 인라인 style 로 지정된 다중 컬럼 그리드는 한 줄로 */
    .content [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .metrics { grid-template-columns: 1fr; }
    .content [style*="display:flex"], .content [style*="display: flex"] { flex-wrap: wrap; }
  }

  @media print {
    .sidebar { display: none; }
    .main-area { margin-left: 0; }
    .content { padding: 0; }
    .topbar { display: none; }
  }

  /* Readable secondary text on the light page and white cards. */
  .metric .label, .sub.neutral, .topbar-meta { color: #59676d; }
  .core-page-header { color: #46545c; }
  .core-page-header .claim-year-btn:not(.active) { color: #59676d; }
  :is(.core-page-header, .card-title, .metric:not(.hero)) :is(
    [style*="color:#aaa"], [style*="color: #aaa"],
    [style*="color:#86868b"], [style*="color: #86868b"],
    [style*="color:#888"], [style*="color: #888"]
  ) { color: #59676d !important; }


  #tab-kpi #kpi-summary, #tab-kpi .team-month-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-flow: row; grid-auto-columns: auto; gap: 16px !important;
    height: auto; min-height: 164px; overflow: visible; padding-bottom: 0; align-items: stretch;
  }
  #tab-kpi #kpi-summary .metric { padding: 18px 20px !important; }
  #tab-kpi .team-card-heading { display:flex; align-items:start; justify-content:space-between; gap:8px; min-height:36px; }
  #tab-kpi .team-card-heading .label { white-space:normal; margin:0; line-height:1.5; }
  #tab-kpi .team-card-heading .kpi-pill { flex-shrink:0; margin:0; padding:3px 7px; font-size:10px; }
  #tab-kpi #kpi-summary .value { margin-top:10px !important; margin-bottom:8px; }
  #tab-kpi #kpi-summary .sub { white-space:normal; line-height:1.5; overflow:visible; }
  #tab-kpi .team-month-card { min-height:188px; margin-bottom:0; }
  #tab-kpi .team-month-card > div:first-child { min-height:36px; }
  #tab-kpi .team-card-details, #tab-kpi .team-no-details {
    margin-top:auto; padding-top:12px; border-top:1px solid #e3e9ec; font-size:12px; color:#59676d;
  }
  #tab-kpi .team-card-details summary { cursor:pointer; color:#166c7b; font-weight:600; }
  #tab-kpi .team-detail-list { max-height:240px; overflow:auto; padding-top:10px; }
  #tab-kpi .team-detail-list > div { padding:6px 0; line-height:1.6; color:#38464c; overflow-wrap:anywhere; }
  @media (max-width:1100px) {
    #tab-kpi #kpi-summary, #tab-kpi .team-month-grid { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  }
  @media (max-width:600px) {
    #tab-kpi #kpi-summary, #tab-kpi .team-month-grid { grid-template-columns:minmax(0,1fr) !important; }
  }


  #worker-metrics { height: 122px; }
  #worker-metrics .metric { padding:18px 20px !important; justify-content:flex-start; }
  #worker-metrics .metric .label { line-height:18px; margin-bottom:0 !important; }
  #worker-metrics .metric .value {
    margin-top:12px !important; font-size:28px !important; line-height:34px;
    display:flex; align-items:baseline; gap:4px; letter-spacing:-0.03em;
  }
  #worker-metrics .metric .value .worker-unit { font-size:13px !important; font-weight:500; letter-spacing:0; }


  /* All six indicator menus share one summary-card size. */
  #nccost-metrics, #erp-metrics, #analysis-metrics, #worker-metrics,
  #tab-kpi #kpi-summary, #monthly-summary, #tab-kpi .team-month-grid {
    display:grid; grid-template-columns:repeat(auto-fill,208px) !important;
    grid-auto-flow:row; grid-auto-columns:auto; gap:12px !important;
    height:auto; min-height:0; overflow:visible; padding:0; margin-bottom:20px !important;
    align-items:stretch;
  }
  #nccost-metrics > .metric, #erp-metrics > .metric, #analysis-metrics > .metric,
  #worker-metrics > .metric, #tab-kpi #kpi-summary > .metric, #monthly-summary > .card {
    box-sizing:border-box; height:156px; min-height:156px !important;
    padding:16px !important; margin:0; display:flex !important; flex-direction:column;
    justify-content:flex-start; overflow:hidden;
  }
  #nccost-metrics .label, #erp-metrics .label, #analysis-metrics .label,
  #worker-metrics .label, #tab-kpi #kpi-summary .team-card-heading, #monthly-summary .label {
    height:30px; min-height:30px; margin:0 !important; line-height:15px;
  }
  #tab-kpi #kpi-summary .team-card-heading { gap:3px; }
  #tab-kpi #kpi-summary .team-card-heading .label { font-size:11px !important; }
  #tab-kpi #kpi-summary .team-card-heading .kpi-pill { font-size:9px; padding:3px 5px; }
  #nccost-metrics .value, #erp-metrics .value, #analysis-metrics .value,
  #worker-metrics .metric .value, #tab-kpi #kpi-summary .value, #monthly-summary .value {
    font-size:26px !important; line-height:32px; margin:8px 0 0 !important;
  }
  #nccost-metrics .sub, #erp-metrics .sub, #analysis-metrics .sub,
  #tab-kpi #kpi-summary .sub, #monthly-summary .sub {
    margin-top:6px; font-size:11px; line-height:16px; white-space:normal;
  }
  @media(max-width:520px) {
    #nccost-metrics, #erp-metrics, #analysis-metrics, #worker-metrics,
    #tab-kpi #kpi-summary, #monthly-summary, #tab-kpi .team-month-grid {
      grid-template-columns:minmax(0,1fr) !important;
    }
  }


  .metrics .metric .label,
  #nccost-metrics .metric .label, #erp-metrics .metric .label,
  #analysis-metrics .metric .label, #worker-metrics .metric .label,
  #tab-kpi #kpi-summary .team-card-heading .label, #monthly-summary .label {
    font-size:13px !important; font-weight:600; line-height:18px;
    white-space:normal; overflow:visible;
  }


  /* Larger indicator text for comfortable reading. */
  #nccost-metrics, #erp-metrics, #analysis-metrics, #worker-metrics,
  #tab-kpi #kpi-summary, #monthly-summary, #tab-kpi .team-month-grid {
    grid-template-columns:repeat(auto-fill,260px) !important;
  }
  #nccost-metrics > .metric, #erp-metrics > .metric, #analysis-metrics > .metric,
  #worker-metrics > .metric, #tab-kpi #kpi-summary > .metric, #monthly-summary > .card {
    height:190px; min-height:190px !important; padding:18px !important;
  }
  .metrics .metric .label,
  #nccost-metrics .metric .label, #erp-metrics .metric .label,
  #analysis-metrics .metric .label, #worker-metrics .metric .label,
  #tab-kpi #kpi-summary .team-card-heading .label, #monthly-summary .label {
    font-size:16px !important; font-weight:600; line-height:22px;
  }
  #nccost-metrics .label, #erp-metrics .label, #analysis-metrics .label,
  #worker-metrics .label, #tab-kpi #kpi-summary .team-card-heading, #monthly-summary .label {
    height:44px; min-height:44px;
  }
  #nccost-metrics .value, #erp-metrics .value, #analysis-metrics .value,
  #worker-metrics .metric .value, #tab-kpi #kpi-summary .value, #monthly-summary .value {
    font-size:30px !important; line-height:36px;
  }
  #nccost-metrics .sub, #erp-metrics .sub, #analysis-metrics .sub,
  #tab-kpi #kpi-summary .sub, #monthly-summary .sub {
    font-size:14px !important; line-height:20px;
  }
  #tab-kpi #kpi-summary .team-card-heading .kpi-pill { font-size:12px; padding:3px 6px; }
  @media(max-width:600px) {
    #nccost-metrics, #erp-metrics, #analysis-metrics, #worker-metrics,
    #tab-kpi #kpi-summary, #monthly-summary, #tab-kpi .team-month-grid {
      grid-template-columns:minmax(0,1fr) !important;
    }
  }

  /* ═══════════════════════════════════════════════════════════════════
     디자인 토큰 + 골격 리스킨 (2026-09-18, 3단계 A안) — 값은 design/tokens.css 와 동일하게 유지
     위의 옛 규칙을 지우지 않고 뒤에서 덮어쓴다(같은 선택자는 나중 것이 이김). 화면 내부는 이후 화면별로 다듬음.
     ═══════════════════════════════════════════════════════════════════ */
  :root {
    --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", Consolas, "D2Coding", monospace;
    --ls-tight: -0.02em; --ls-snug: -0.01em;
    --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
    --shadow-1: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
    --shadow-2: 0 4px 12px rgba(16,24,40,.08), 0 1px 3px rgba(16,24,40,.06);
    --shadow-3: 0 12px 36px rgba(16,24,40,.14);
    --gray-50:#f7f8fa; --gray-100:#eef0f3; --gray-200:#dfe3e8; --gray-300:#c5ccd3; --gray-500:#7b8794; --gray-700:#4b5563; --gray-900:#111827;
    --bg:#f4f6f8; --surface:#ffffff; --surface-2:var(--gray-50);
    --border:rgba(16,24,40,.08); --border-strong:rgba(16,24,40,.14);
    --ink:var(--gray-900); --ink-2:var(--gray-700); --ink-3:var(--gray-500); --ink-inverse:#fff;
    --brand:#17A2B8; --brand-600:#0F8A9E; --brand-700:#0B6F80; --brand-100:#E3F4F7; --brand-50:#F1FAFB;
    --good:#1F7A4D; --good-bg:#EAF6EE; --warn:#9A6700; --warn-bg:#FFF5DB; --danger:#B42318; --danger-bg:#FDECEA; --info:var(--brand-700); --info-bg:var(--brand-100);
    --s1:#17A2B8; --s2:#E8630B; --s3:#7B4EA0; --s4:#0F9D63; --s5:#D0342A; --s6:#C2870A; --s7:#1F5C99; --s8:#D9569A; --s-muted:#C5CCD3;
    --chart-grid:var(--gray-100); --chart-axis:var(--gray-200); --chart-tick:var(--gray-500); --chart-goal:var(--gray-500);
  }
  body { font-family: var(--font-sans); background: var(--bg); color: var(--ink); font-size: 13px; letter-spacing: var(--ls-snug); }
  ::selection { background: var(--brand-100); }
  .content::-webkit-scrollbar, .sidebar::-webkit-scrollbar { width: 8px; height: 8px; }
  .content::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

  /* 사이드바 */
  .sidebar { width: 232px; background: var(--surface); border-right: 1px solid var(--border); padding: 14px 12px 10px; gap: 1px; }
  /* 회사 로고(타라티피에스 부엉이, 로그인 화면과 동일 PNG) + 아래에 시스템 이름 */
  .sidebar-logo { flex-direction: column; align-items: flex-start; gap: 6px; padding: 2px 6px 14px; }
  .sidebar-logo .brand-logo { display: block; width: 118px; height: auto; margin-left: -6px; }
  .sidebar-logo .brand-text { display: flex; flex-direction: column; min-width: 0; padding-left: 2px; }
  .sidebar-logo .title { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: var(--ls-tight); line-height: 1.15; white-space: nowrap; }
  .sidebar-logo .title span { color: var(--brand-700); }
  .sidebar-logo .brand { font-size: 11px; color: var(--ink-3); letter-spacing: 0; margin: 2px 0 0; }
  .sidebar-section + .sidebar-section { margin-top: 4px; padding-top: 4px; border-top: none; }
  .sidebar-section-label { font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 12px 10px 6px; letter-spacing: .04em; }
  .nav-item { padding: 8px 10px; border-radius: var(--r-md); color: var(--ink-2); font-size: 13px; font-weight: 500; gap: 10px; }
  .nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .nav-item.active { background: var(--brand-100); color: var(--brand-700); font-weight: 600; box-shadow: none; }
  .nav-icon { color: var(--ink-3); font-size: 16px; }
  .nav-item.active .nav-icon, .nav-parent.has-active .nav-icon { color: var(--brand-700); }
  .nav-parent[aria-expanded="true"] { background: transparent; color: var(--ink); font-weight: 600; }
  .nav-parent.has-active { color: var(--brand-700); }
  .nav-parent .nav-caret { color: var(--ink-3); }
  .nav-sub { margin-left: 18px; padding-left: 14px; border-left: 2px solid var(--gray-200); border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 12.5px; color: var(--ink-2); }
  .nav-sub:hover { background: var(--surface-2); }
  .nav-sub.active { border-left-color: var(--brand); background: transparent; color: var(--brand-700); }
  #nav-logout { color: var(--danger) !important; }
  #build-stamp { color: var(--ink-3); }

  /* 모바일 바 · 탭바 */
  .mobile-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
  #open-tabbar { background: var(--surface) !important; border-bottom: 1px solid var(--border) !important; padding: 0 20px !important; height: 44px !important; gap: 4px !important; align-items: flex-end !important; }
  .otab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; font-size: 12px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; user-select: none; flex-shrink: 0; transition: color .12s; }
  .otab:hover { color: var(--ink); }
  .otab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
  .otab .otab-x { color: var(--ink-3); font-size: 15px; line-height: 1; padding: 0 2px; border-radius: 4px; }
  .otab .otab-x:hover { color: var(--danger); background: var(--danger-bg); }
  #health-pill.hp { align-self: center; margin-left: auto; box-shadow: 0 0 0 6px var(--surface); }   /* 오른쪽 끝 고정, 탭이 밀려 들어와도 알약 주변은 흰 여백 */
  #health-pill.hp::before { content: ''; position: absolute; left: -18px; top: -8px; bottom: -8px; width: 18px; background: linear-gradient(90deg, transparent, var(--surface)); pointer-events: none; }
  #health-pill.hp { position: sticky; }

  /* 콘텐츠 · 제목 */
  .content { padding: 24px 32px 40px; }
  .section-title { font-size: 20px; font-weight: 700; letter-spacing: var(--ls-tight); color: var(--ink); }
  .core-page-header > .cph-title .section-title { font-size: 20px; }
  .core-page-header > .cph-desc { color: var(--ink-3); }
  .core-page-header > .cph-years { border-bottom-color: var(--border); }
  .core-page-header .claim-year-btn:not(.active) { color: var(--ink-3); }
  .cph-note { color: var(--ink-3); }

  /* 카드 */
  .card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1); }
  .card-title { border-left: none; padding-left: 0; font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 12px; letter-spacing: var(--ls-snug); display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
  #tab-dashboard .card { border-color: var(--border); }
  #tab-dashboard .card-title, #tab-dashboard .section-title { font-weight: 600; }
  #tab-dashboard .section-title { font-weight: 700; }
  .chart-wrap { height: 210px; }
  .form-panel, .doc-card { border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }

  /* 지표 타일 (.metric): 잉크색 큰 숫자, 헤어라인 테두리, 색 띠 제거 */
  .metric { border: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px 14px; box-shadow: var(--shadow-1); }
  .metric:hover { border-color: var(--border-strong); }
  .metric .label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
  .metric .value { font-size: 28px; font-weight: 700; color: var(--ink); letter-spacing: var(--ls-tight); }
  .metric .sub { font-size: 11.5px; color: var(--ink-3); }
  .metric .sub.neutral { color: var(--ink-3); }
  .sub.up { color: var(--danger); } .sub.down { color: var(--good); }
  .kpi-pill { border-radius: var(--r-pill); padding: 2px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; line-height: 1.4; }
  .kpi-pill.good { background: var(--good-bg); color: var(--good); }
  .kpi-pill.warn { background: var(--warn-bg); color: var(--warn); }
  .kpi-pill.crit { background: var(--danger-bg); color: var(--danger); }
  .kpi-prog { height: 4px; background: var(--brand-100); } .kpi-prog > i { background: var(--brand); }
  /* 히어로(그라데이션) 카드 → 옅은 브랜드 톤 카드 + 잉크 글자 */
  .metric.hero,
  #nccost-metrics .metric:first-child, #erp-metrics .metric:first-child, #analysis-metrics .metric:first-child, #worker-metrics .metric:first-child {
    background: var(--brand-50) !important; border: 1px solid var(--brand-100) !important; box-shadow: var(--shadow-1) !important;
  }
  .metric.hero .label, #nccost-metrics .metric:first-child .label, #erp-metrics .metric:first-child .label, #analysis-metrics .metric:first-child .label, #worker-metrics .metric:first-child .label { color: var(--brand-700) !important; }
  .metric.hero .value, .metric.hero .value span, #nccost-metrics .metric:first-child .value, #erp-metrics .metric:first-child .value, #analysis-metrics .metric:first-child .value, #worker-metrics .metric:first-child .value,
  #nccost-metrics .metric:first-child .value span, #erp-metrics .metric:first-child .value span, #analysis-metrics .metric:first-child .value span, #worker-metrics .metric:first-child .value span { color: var(--ink) !important; }
  .metric.hero .sub, #nccost-metrics .metric:first-child .sub, #erp-metrics .metric:first-child .sub, #analysis-metrics .metric:first-child .sub, #worker-metrics .metric:first-child .sub { color: var(--ink-2) !important; }
  .metric.hero .kpi-pill { background: var(--brand-100); color: var(--brand-700); }
  .metric.hero .kpi-prog { background: var(--brand-100); } .metric.hero .kpi-prog > i { background: var(--brand); }
  /* 대시보드 홈 타일: 상단 색 띠 → 라벨 앞 색 점 */
  #tab-dashboard .metrics .metric { border-top: 1px solid var(--border); border-radius: var(--r-lg); }
  #tab-dashboard .metrics .metric:nth-child(2), #tab-dashboard .metrics .metric:nth-child(3), #tab-dashboard .metrics .metric:nth-child(4) { border-top-color: var(--border); }
  #tab-dashboard .metrics .metric .value { font-size: 28px; font-weight: 700; }
  #tab-dashboard .metrics .metric .label { text-transform: none; letter-spacing: var(--ls-snug); font-size: 12px; font-weight: 600; }
  #tab-dashboard .metrics .metric .label::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--s1); margin-right: 7px; vertical-align: 1px; }
  #tab-dashboard .metrics .metric:nth-child(2) .label::before { background: var(--s2); }
  #tab-dashboard .metrics .metric:nth-child(3) .label::before { background: var(--s4); }
  #tab-dashboard .metrics .metric:nth-child(4) .label::before { background: var(--s6); }
  #dash-refresh-btn.dh-btn { border-radius: var(--r-md); background: var(--surface); color: var(--ink-2); border: 1px solid var(--border-strong); padding: 0 14px; font-size: 12px; font-weight: 600; }
  #dash-refresh-btn.dh-btn:hover { background: var(--surface-2); color: var(--ink); }

  /* 핵심지표 요약 타일 (renderCoreSummary) — 시안과 동일 구조 */
  /* 핵심지표 요약 카드: 09-18 아침 버전(인라인 3열 grid, gap 14) 그대로 — 크기 규칙 추가 안 함 (형 요청) */
  .core-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px 18px; min-height: 176px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 0; min-width: 0; cursor: pointer; transition: box-shadow .15s, transform .15s; outline: none; }
  .core-tile .ct-head { font-size: 14px; font-weight: 600; color: var(--ink-2); height: 22px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; gap: 8px; }
  .core-tile .ct-head .ct-sw { width: 9px; height: 9px; }
  .core-tile .ct-val { font-size: 36px; line-height: 40px; margin-top: 14px; }
  .core-tile .ct-val small { font-size: 15px; }
  .core-tile .ct-sub { margin-top: 6px; min-height: 0; -webkit-line-clamp: 1; font-size: 13px; line-height: 18px; color: var(--ink-3); }
  .core-tile .ct-foot { margin-top: 14px; }
  .core-tile .ct-foot .badge { height: 22px; font-size: 11.5px; padding: 0 9px; }
  .core-tile .ct-go { font-size: 12px; }
  .core-tile:hover, .core-tile:focus-visible { box-shadow: var(--shadow-2); transform: translateY(-1px); }
  .core-tile .ct-head { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .core-tile .ct-sw { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
  .core-tile .ct-val { font-size: 28px; font-weight: 700; letter-spacing: var(--ls-tight); line-height: 1.05; color: var(--ink); display: flex; align-items: baseline; gap: 3px; }
  .core-tile .ct-val small { font-size: 13px; font-weight: 600; color: var(--ink-3); }
  .core-tile .ct-sub { font-size: 11px; color: var(--ink-3); line-height: 1.35; min-height: 30px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .core-tile .ct-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
  .core-tile .ct-go { font-size: 11px; color: var(--ink-3); }
  .core-tile:hover .ct-go { color: var(--brand-700); }

  /* 표 */
  table { font-size: 12.5px; }
  th { background: var(--surface-2); color: var(--ink-3); font-size: 11px; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); letter-spacing: 0; }
  td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--ink); font-variant-numeric: tabular-nums; }
  tr:hover td { background: var(--surface-2); }
  #gajebon-table thead th { box-shadow: inset 0 -1px var(--border-strong); }

  /* 배지 · 태그 · 알림 · 진행바 */
  .badge { border-radius: var(--r-pill); padding: 2px 8px; font-size: 11.5px; font-weight: 600; line-height: 1.4; }
  .badge-open, .badge-fail, .badge-high { background: var(--danger-bg); color: var(--danger); }
  .badge-progress, .badge-mid { background: var(--warn-bg); color: var(--warn); }
  .badge-done, .badge-pass { background: var(--good-bg); color: var(--good); }
  .badge-low { background: var(--info-bg); color: var(--info); }
  .tag { background: var(--surface-2); color: var(--ink-2); border-radius: var(--r-pill); font-size: 11.5px; font-weight: 600; padding: 2px 8px; }
  .empty { color: var(--ink-3); }
  .alert { border-radius: var(--r-md); }
  .alert-success { background: var(--good-bg); color: var(--good); }
  .progress-bar { background: var(--gray-100); }
  .fill-green { background: var(--good); } .fill-amber { background: var(--warn); } .fill-red { background: var(--danger); }

  /* 폼 · 버튼 */
  .form-group label { color: var(--ink-2); font-weight: 600; font-size: 12px; }
  .form-group input, .form-group select, .form-group textarea, .filter-bar input, .filter-bar select, .core-page-header > .cph-period select {
    border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-family: inherit; font-size: 13px;
  }
  .form-group input:focus, .form-group select:focus, .form-group textarea:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
  .btn, .btn-blue, .doc-filter, .gj-toggle { border-radius: var(--r-md); font-weight: 600; }
  .btn-primary, .btn-blue { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
  .btn-primary:hover, .btn-blue:hover { background: var(--brand-700); border-color: var(--brand-700); }
  .btn-secondary { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); }
  .btn-secondary:hover { background: var(--gray-100); color: var(--ink); }
  .btn-danger { background: var(--surface); color: var(--danger); border-color: rgba(180,35,24,.35); }
  .btn-danger:hover { background: var(--danger-bg); }
  .doc-filter { border-color: var(--border-strong); color: var(--ink-2); font-weight: 500; }
  .doc-filter.active, .gj-toggle.gj-on { background: var(--gray-900); border-color: var(--gray-900); color: #fff; }
  .doc-filter:hover:not(.active), .gj-toggle:hover:not(.gj-on) { background: var(--surface-2); }
  .gj-toggle { border-color: var(--border-strong); color: var(--ink-2); font-weight: 500; }
  .doc-btn-open { background: var(--brand-100); color: var(--brand-700); border-radius: var(--r-sm); }
  .doc-btn-open:hover { background: #d3ecf1; }
  .doc-btn-del { background: var(--danger-bg); color: var(--danger); border-radius: var(--r-sm); }
  .icon-btn.primary { background: var(--brand-600); } .icon-btn.primary:hover { background: var(--brand-700); }
  .icon-btn.ghost { background: var(--surface-2); color: var(--ink-2); } .icon-btn.ghost:hover { background: var(--gray-100); }
  .gajebon-sheet-btn, .claim-year-btn, .ncr-src-btn { color: var(--ink-3); font-size: 12.5px; font-weight: 500; padding: 7px 12px 8px; }
  .gajebon-sheet-btn:hover, .claim-year-btn:hover, .ncr-src-btn:hover { color: var(--ink); }
  .gajebon-sheet-btn.active, .claim-year-btn.active, .ncr-src-btn.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }

  /* 모바일 */
  @media (max-width: 900px) {
    .content { padding: 12px 12px 28px; }
    #open-tabbar { padding: 0 12px !important; }
  }


  /* ═══════════════════════════════════════════════════════════════════
     ④ 디자인 통일 (2026-10-06) — 본부 포털 UI 키트(hq-portal/design/tara-portal-ui) 기준 공용 부품
     글자색 유틸 · 표 셀 유틸 · 지표 라벨 점 · 알약 세그먼트(.dh-seg 안의 옛 탭 버튼) · 배지 통일 · 머리 글자 · 작은 글자 ≥11px
     계약: scratchpad design_audit/contract.md — 이름을 바꾸지 말 것(JS 가 씀)
     ═══════════════════════════════════════════════════════════════════ */
  /* 글자색 유틸 — 인라인 color 대신. 표 셀(.dh-tbl td{color}) 규칙보다 우선하도록 !important */
  .t-neg { color: var(--danger) !important; }
  .t-pos { color: var(--good) !important; }
  .t-warn { color: var(--warn) !important; }
  .t-brand { color: var(--brand) !important; }
  .t-dim { color: var(--ink-3) !important; }
  .t-ink { color: var(--ink) !important; }
  .b { font-weight: 700; }
  .build-stamp-wrap { font-size: 11px; color: var(--ink-3); }

  /* 표 셀 유틸 (table.dh-tbl) */
  .dh-tbl td.num, .dh-tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .dh-tbl td.num { color: var(--ink); }
  .dh-tbl td.dim { color: var(--ink-3); }
  .dh-tbl td.mono { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0; color: var(--ink-2); }
  .dh-tbl td.name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
  .dh-tbl td.c, .dh-tbl th.c { text-align: center; }
  th small { font-size: 11px; font-weight: 400; color: var(--ink-3); }

  /* 지표 카드: 라벨 앞 상태 점 <span class="m-dot" style="--c:var(--danger)"></span> · 큰 숫자는 잉크색(인라인 color 무시) */
  .m-dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--c, var(--gray-300)); margin-right: 6px; vertical-align: 1px; flex: none; }
  .metric .value { color: var(--ink) !important; }

  /* 알약 세그먼트: 옛 밑줄 탭 버튼(.claim-year-btn / .gajebon-sheet-btn / .kpi-reg-tab-btn)을 <div class="dh-seg"> 로 감싸기만 하면 알약 — JS 는 .active 만 토글 */
  .dh-seg { max-width: 100%; }
  .dh-seg .claim-year-btn, .dh-seg .gajebon-sheet-btn, .dh-seg .ncr-src-btn, .dh-seg .kpi-reg-tab-btn,
  .core-page-header .dh-seg .claim-year-btn, .gj-tabs.dh-seg .claim-year-btn, .gj-tabs.dh-seg .gajebon-sheet-btn {
    border: 0; border-bottom: 0; margin: 0; background: transparent; padding: 5px 11px; border-radius: 7px;
    font-size: 12px; font-weight: 500; color: var(--ink-3); line-height: 1.35; white-space: nowrap; cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; transition: background .12s, color .12s;
  }
  .dh-seg .claim-year-btn:hover, .dh-seg .gajebon-sheet-btn:hover, .dh-seg .ncr-src-btn:hover,
  .core-page-header .dh-seg .claim-year-btn:hover, .gj-tabs.dh-seg .claim-year-btn:hover, .gj-tabs.dh-seg .gajebon-sheet-btn:hover { color: var(--ink); }
  .dh-seg .claim-year-btn.active, .dh-seg .gajebon-sheet-btn.active, .dh-seg .ncr-src-btn.active, .dh-seg button.active,
  .core-page-header .dh-seg .claim-year-btn.active, .gj-tabs.dh-seg .claim-year-btn.active, .gj-tabs.dh-seg .gajebon-sheet-btn.active {
    background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1);
  }
  .dh-seg .claim-year-btn small, .dh-seg .gajebon-sheet-btn small { font-size: 11px; font-weight: 500; color: var(--ink-3); }
  /* 연도·시트 탭 줄(.gj-tabs / .cph-years)이 세그먼트가 되면 밑줄 제거 + 가로 스크롤(시트 9개) */
  .gj-tabs.dh-seg { display: inline-flex; border-bottom: 0; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
  .gj-tabs.dh-seg::-webkit-scrollbar { display: none; }
  .core-page-header > .cph-years.dh-seg { height: auto; border-bottom: 0; justify-self: start; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .core-page-header > .cph-years.dh-seg::-webkit-scrollbar { display: none; }
  .core-page-header .dh-seg { padding: 2px; }
  #kpi-month-tabs.dh-seg, #proof-dev-btns.dh-seg { flex-wrap: wrap; }   /* 월 12개·장비 버튼은 좁으면 줄바꿈(휴대폰 가로 넘침 방지) */
  .core-page-header .dh-seg .claim-year-btn { padding: 4px 11px; }   /* 머리 행 32px 안에 들어가게 (2+1 + 24 + 1+2 = 30) */

  /* 핵심지표 7화면 머리(.core-page-header): 틀·높이(152px, 카드 y 동일)는 그대로, 글자만 .sc-head 와 같게 */
  .core-page-header { color: var(--ink-2); }
  .core-page-header > .cph-title .section-title { font-size: 20px; font-weight: 700; letter-spacing: var(--ls-tight); color: var(--ink); line-height: 32px; }
  .core-page-header > .cph-desc { font-size: 11px; color: var(--ink-3); line-height: 20px; }
  .core-page-header > .cph-desc b { color: var(--ink-2); font-weight: 600; }
  .core-page-header > .cph-period { font-size: 12px; color: var(--ink-2); }
  .core-page-header > .cph-period select.dh-select, .cph-actions .dh-select { height: 30px; padding: 0 26px 0 10px; border-radius: var(--r-md); border: 1px solid var(--border-strong); font-size: 12px; color: var(--ink-2); }
  .cph-actions .dh-btn, .cph-actions .gj-toggle { height: 30px; padding: 0 12px; font-size: 12px; }
  .dh-btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
  .cph-note { color: var(--ink-3); }

  /* 제목 옆 보조 글(연도·기준 설명): <small> 로 */
  .section-title small, .card-title small, .sc-title small, .dh-title small { font-size: 12px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; line-height: 1.2; }
  .section-header .section-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

