  :root {
    --bg: #f3f6fb;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --line: #e2e8f0;
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --primary-soft: #edf4ff;
    --text: #122033;
    --muted: #5e6d82;
    --success: #1e9d68;
    --success-soft: #eafaf2;
    --warning: #d79627;
    --warning-soft: #fff4dc;
    --danger: #d95454;
    --danger-soft: #feeaea;
    --shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    --sidebar: #0f172a;
    --sidebar-soft: #111d32;
    --sidebar-muted: #94a3b8;
  }

  * { box-sizing: border-box; }
  html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Gothic A1", "Malgun Gothic", "Segoe UI", sans-serif;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
  }

  body {
    min-height: 100vh;
  }

  button, input, select {
    font: inherit;
  }

  .layout {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
  }

  .sidebar {
    width: 224px;
    flex: none;
    background: var(--sidebar);
    color: #f8fbff;
    padding: 22px 14px;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }

  .brand {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 6px 8px 18px;
    color: #f8fbff;
  }

  .nav-group { margin-bottom: 18px; }

  .sidebar-title {
    font-size: 11px;
    color: var(--sidebar-muted);
    padding: 0 8px 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #dfeaf8;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  .nav-item.active {
    background: rgba(255,255,255,0.07);
    color: #ffffff;
    border-color: rgba(148, 163, 184, 0.15);
  }

  .nav-item .icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7da7ff;
    box-shadow: 0 0 0 4px rgba(125,167,255,0.18);
    flex: none;
  }

  .nav-item:disabled {
    cursor: not-allowed;
    color: var(--sidebar-muted);
    opacity: 0.65;
  }

  .nav-item:disabled .icon {
    background: var(--sidebar-muted);
    box-shadow: none;
  }

  .nav-item-soon {
    margin-left: auto;
    flex: none;
    font-size: 10px;
    font-weight: 700;
    color: var(--sidebar-muted);
    background: rgba(148, 163, 184, 0.12);
    padding: 2px 6px;
    border-radius: 999px;
  }

  .region-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .region-nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #dfeaf8;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }

  .region-nav-item:hover { background: rgba(255,255,255,0.04); }
  .region-nav-item.active {
    background: rgba(255,255,255,0.07);
    border-color: rgba(148, 163, 184, 0.15);
    color: #ffffff;
  }

  .region-nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .region-nav-count {
    flex: none;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--sidebar-muted);
    background: rgba(148,163,184,0.12);
    padding: 2px 8px;
    border-radius: 999px;
  }

  .region-nav-item.active .region-nav-count {
    background: rgba(255,255,255,0.08);
    color: #f8fbff;
  }

  .page {
    flex: 1;
    min-width: 0;
    /* 아주 넓은 모니터에서 표·카드가 끝까지 늘어지지 않게 가운데로 모아요 */
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px 28px 32px;
  }

  h1 {
    margin: 0;
    white-space: nowrap;
    font-size: 30px;
    letter-spacing: -0.04em;
    line-height: 1.18;
  }

  .subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
    max-width: 56ch;
    line-height: 1.6;
  }

  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 4px;
  }

  .topbar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 13px;
    color: var(--muted);
  }

  .role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--primary-strong);
    font-weight: 700;
    box-shadow: var(--shadow);
  }

  .save-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex: none;
  }

  .save-dot.synced { background: var(--success); }
  .save-dot.syncing,
  .save-dot.loading { background: var(--warning); animation: pulse 1.1s ease-in-out infinite; }
  .save-dot.error,
  .save-dot.setup-needed { background: var(--danger); }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
  }

  .refresh-btn {
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
  }

  .setup-banner {
    background: var(--warning-soft);
    border: 1px solid var(--warning);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(87, 94, 119, 0.04);
  }

  .setup-banner p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.5;
  }

  .setup-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .setup-row input,
  .settings-actions input,
  #search-input,
  .toolbar-filters select,
  #update-range-input,
  .login-input,
  #upload-company-input {
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    padding: 0 12px;
    font-size: 14px;
    font-family: inherit;
  }

  .setup-row input { flex: 1 1 320px; }

  .settings-card,
  .table-card,
  .card,
  .mini-card,
  .login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
  }

  .mini-card { padding: 18px; }
  .mini-card h3 { margin: 0 0 12px; font-size: 17px; }

  .side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .side-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
  }
  .side-item:last-child { border-bottom: none; }

  .task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
  }
  .task-item:last-child { border-bottom: none; }

  .main-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.1fr;
    gap: 18px;
    margin-bottom: 20px;
  }

  .settings-card {
    padding: 18px 18px 16px;
    margin-bottom: 18px;
  }

  .settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }

  .settings-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
  }

  .settings-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 11px;
    font-weight: 700;
  }

  .settings-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
  }

  .settings-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  .settings-actions input[type="number"] { width: 90px; }
  .settings-actions input[type="date"] { width: 180px; }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
  }

  .stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 18px 18px 16px;
  }

  .stat-card.wide { grid-column: 1 / -1; }

  .stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
  }

  .stat-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1.1;
  }

  .stat-value.small {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: normal;
    color: var(--text);
  }

  .stat-unit {
    margin-left: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: normal;
  }

  .progress {
    height: 8px;
    background: #edf2f7;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
  }

  .progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #63a4ff);
  }

  .progress-bar.success { background: linear-gradient(90deg, var(--success), #35c087); }

  .chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }

  .chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 12.5px;
    font-weight: 700;
  }

  .chip.muted { background: var(--panel-soft); color: var(--muted); }

  /* 이슈 심각도 미터: 정상/주의/경고/문제 비율을 한 줄로 보여줘요. 색은 테이블의
     .flag-badge와 같은 토큰을 그대로 써서 화면 전체에서 같은 색이 같은 뜻을 갖게 해요. */
  .severity-meter {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
    background: #edf2f7;
  }

  .severity-seg { height: 100%; }
  .severity-seg.normal { background: var(--success); }
  .severity-seg.caution { background: var(--warning); }
  .severity-seg.alert,
  .severity-seg.issue { background: var(--danger); }

  /* 세션 현황 — 회차별 완료율 추이. 회차가 순차적으로 진행되며 값이 바뀌는 데이터라
     막대 대신 라인+영역 차트로 표현해요(1회차→N회차로 이어지는 하나의 선). */
  .session-chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
  .session-chart-gridline { stroke: var(--line); stroke-width: 1; }
  .session-chart-tick { fill: var(--muted); font-size: 10px; }
  .session-trend-line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .session-trend-area { fill: rgba(37, 99, 235, 0.08); }
  .session-trend-dot { fill: var(--primary); stroke: var(--panel); stroke-width: 2; r: 3; transition: r 0.12s ease; }
  .session-trend-dot.end, .session-trend-dot.stuck { r: 5; }
  .session-trend-hit { fill: transparent; cursor: pointer; }
  .session-trend-crosshair { stroke: var(--line); stroke-width: 1; opacity: 0; pointer-events: none; transition: opacity 0.1s ease; }
  .session-chart-value-label { fill: var(--text); font-size: 12px; font-weight: 700; }

  .chart-tooltip {
    position: fixed;
    z-index: 60;
    background: #101828;
    color: #fff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 10px));
    transition: opacity 0.1s ease;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.25);
    white-space: nowrap;
  }
  .chart-tooltip.visible { opacity: 1; }

  /* ---- 표 셀 보정: 기존 렌더 함수들이 이미 내보내고 있던 클래스인데 스타일이 없었어요 ---- */
  td.center, th.center { text-align: center; }

  .sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--panel);
  }

  thead th.sticky-col {
    z-index: 5;
    background: var(--panel-soft);
  }

  /* td에 display:flex를 주면 그 칸만 vertical-align:middle이 안 먹혀서 다른 칸(협약일자·
     폴더NC·권역)과 세로 기준선이 어긋나 보여요 — 그래서 flex 대신 일반 표 셀 정렬(inline-block
     + vertical-align)로 정렬해요. */
  .company-cell > .readonly-text,
  .company-cell > .cell-input.company-input {
    vertical-align: middle;
  }

  /* 기업명이 길면 줄바꿈되면서 그 행만 유독 높아져서 표 전체가 들쭉날쭉해 보이는 문제 —
     한 줄로 말줄임(ellipsis) 처리해서 모든 행 높이를 균일하게 맞춰요. 필요하면 title
     속성(브라우저 기본 툴팁)으로 전체 이름을 볼 수 있어요. */
  .company-cell > .readonly-text {
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .company-cell > .cell-input.company-input {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .company-cell > .example-badge {
    vertical-align: middle;
    margin-left: 6px;
  }

  .cell-input {
    width: 100%;
    min-width: 70px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    padding: 0 8px;
    font-size: 13.5px;
    font-family: inherit;
  }

  .cell-input:hover { border-color: var(--line); background: var(--panel-soft); }
  .cell-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--panel);
    box-shadow: 0 0 0 3px var(--primary-soft);
  }

  .cell-input.cell-narrow { min-width: 56px; width: 64px; }
  .cell-input.company-input { min-width: 140px; font-weight: 700; }

  /* 알림 센터 작성 영역 — 표 셀용 .cell-input과 달리 항상 테두리가 보이는 일반 입력 필드예요. */
  .compose-input, .compose-textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
  }
  .compose-input:focus, .compose-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
  }
  .compose-input { height: 42px; }
  .compose-textarea { min-height: 160px; line-height: 1.6; resize: vertical; }

  /* .cell-input(취합현황 편집칸)과 높이·좌우 여백을 그대로 맞춰서, 입력칸이 없는
     자료제출 탭의 행도 취합현황 탭과 똑같은 간격으로 보이게 해요. */
  .readonly-text {
    display: inline-flex;
    align-items: center;
    height: 32px;
    line-height: 32px;
    padding: 0 8px;
    color: var(--text);
    font-size: 13.5px;
  }

  .company-cell > .readonly-text {
    font-weight: 700;
  }

  .mini-gauge { display: flex; align-items: center; gap: 8px; min-width: 92px; }
  .mini-gauge-track { flex: 1; height: 6px; background: #edf2f7; border-radius: 999px; overflow: hidden; }
  .mini-gauge-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #63a4ff); }
  .mini-gauge-label { font-size: 12px; font-weight: 700; color: var(--muted); width: 34px; text-align: right; }

  .toggle-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: transparent;
    font-weight: 800;
    font-size: 13px;
  }

  .toggle-view.on { background: var(--success-soft); border-color: var(--success); color: var(--success); }
  .toggle-view.complete.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-strong); }

  /* 취합현황의 .toggle-view(읽기전용 체크 아이콘)와 크기·정렬을 통일해요 — 클릭 가능하다는
     점만 다르고 생김새는 같게. */
  .upload-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: transparent;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
  }

  .upload-toggle.available { border-color: #bcd4ff; background: var(--primary-soft); }
  .upload-toggle.on { background: var(--success-soft); border-color: var(--success); color: var(--success); }
  .upload-toggle:hover:not(:disabled) { filter: brightness(0.97); }
  .upload-toggle.disabled,
  .upload-toggle:disabled { cursor: not-allowed; opacity: 0.5; }

  /* 업로드 체크박스 밑에 체크된 날짜를 작게 보여줘요(예: "09.30 등록"). */
  .upload-check-date {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: var(--success);
    font-weight: 600;
  }

  .folder-link {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
  }

  .folder-link:hover { background: var(--primary-soft); border-color: #bcd4ff; }
  .folder-link-empty { color: var(--muted); font-size: 13px; }

  .example-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--warning-soft);
    color: var(--warning);
    flex: none;
  }

  .delete-btn {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 8px;
    cursor: pointer;
  }

  .delete-btn:hover { background: var(--danger-soft); border-color: var(--danger); }

  .empty-row td { text-align: center; padding: 40px 12px; color: var(--muted); font-size: 14px; }

  .sortable-th { cursor: pointer; user-select: none; }
  .sortable-th:hover { color: var(--primary-strong); }
  .sort-indicator { margin-left: 4px; font-size: 10px; }

  .col-date { width: 108px; }
  .col-folder { width: 88px; }
  .col-region { width: 104px; min-width: 104px; }
  .col-company { width: 220px; }
  .col-session { width: 62px; }
  .col-doc { width: 92px; }
  .col-progress { width: 130px; }
  .col-complete { width: 66px; }
  .col-flag { width: 84px; }
  .col-remark { min-width: 170px; }
  .col-email { width: 200px; min-width: 200px; }
  .col-drive-link { width: 60px; }
  .col-actions { width: 56px; }

  .toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
  }

  .toolbar-search { flex: 1 1 220px; min-width: 180px; max-width: 420px; }
  /* 관리 버튼 묶음은 오른쪽으로 — 줄이 넘치면 다음 줄 오른쪽에 붙어요 */
  .toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
  .toolbar-filters { display: flex; flex-wrap: wrap; gap: 8px; }
  #search-input { width: 100%; }
  .toolbar-filters select, #update-range-input { min-width: 120px; }

  .btn {
    height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease;
  }

  .btn:hover { filter: brightness(0.98); }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; }

  .btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
  }

  .btn-primary:hover { background: var(--primary-strong); }

  .btn-ghost,
  .btn-secondary {
    background: var(--panel);
    border-color: var(--line);
    color: var(--text);
  }

  .table-card {
    overflow: hidden;
    border-radius: 14px;
  }

  .table-wrap {
    overflow: auto;
    max-height: 68vh;
  }

  table {
    width: 100%;
    min-width: 1360px;
    border-collapse: collapse;
    font-size: 13.5px;
  }

  thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }

  tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
  }

  tbody tr:hover td { background: rgba(37,99,235,0.015); }

  .table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
  }

  #row-count-label { font-size: 13px; color: var(--muted); }

  .login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg);
    z-index: 50;
  }

  .login-screen[hidden] { display: none; }

  /* ── 대시보드 그래프 ── */
  .chart-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-bottom: 18px; }
  .chart-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
  .chart-card.chart-wide { grid-column: 1 / -1; }
  .chart-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
  .chart-head h3 { margin: 0; font-size: 16px; }
  .chart-sub { font-size: 12.5px; color: var(--muted); }
  .chart-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 24px 0; }

  /* 세로 막대 */
  .col-chart { position: relative; padding-left: 34px; }
  .col-grid { position: absolute; left: 0; right: 0; top: 18px; height: 170px; pointer-events: none; }
  .col-grid span { position: absolute; left: 0; width: 100%; border-bottom: 1px solid #edf0f4; font-size: 11px; color: #8a94a3; line-height: 1; transform: translateY(50%); padding-right: 6px; }
  .col-grid span:last-child { border-bottom-color: #c9d1dc; }
  .col-items { position: relative; display: flex; align-items: stretch; gap: 2px; }
  .col-item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; outline: none; border-radius: 8px; cursor: default; }
  .col-item:hover, .col-item:focus-visible { background: rgba(37, 99, 235, 0.05); }
  .col-item:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
  .col-plot { position: relative; width: 100%; height: 170px; margin-top: 18px; display: flex; justify-content: center; align-items: flex-end; }
  .col-bar { width: 24px; max-width: 70%; border-radius: 4px 4px 0 0; }
  .col-item.is-doc .col-bar { opacity: 0.55; }
  .col-value { position: absolute; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--text); }
  .col-label { margin-top: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  /* 가로 막대 */
  .hbar-chart { display: grid; gap: 4px; }
  .hbar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 44px; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; outline: none; }
  .hbar-row:hover, .hbar-row:focus-visible { background: rgba(37, 99, 235, 0.05); }
  .hbar-row:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
  .hbar-label { font-size: 13.5px; font-weight: 700; display: flex; flex-direction: column; line-height: 1.3; }
  .hbar-n { font-size: 11.5px; font-weight: 500; color: var(--muted); }
  .hbar-track { height: 16px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
  .hbar-bar { height: 100%; border-radius: 0 4px 4px 0; }
  .hbar-value { font-size: 13px; font-weight: 700; text-align: right; }

  /* 이슈 누적 막대 */
  .stack-bar { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; background: var(--panel); }
  .stack-seg { min-width: 4px; outline: none; }
  .stack-seg:first-child { border-radius: 4px 0 0 4px; }
  .stack-seg:last-child { border-radius: 0 4px 4px 0; }
  .stack-seg:only-child { border-radius: 4px; }
  .stack-seg:hover, .stack-seg:focus-visible { filter: brightness(0.92); }
  .chart-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 13px; }
  .legend-item { display: inline-flex; align-items: center; gap: 6px; }
  .legend-swatch { width: 18px; height: 18px; border-radius: 5px; color: #fff; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
  .legend-text { color: var(--text); }
  .legend-pct { color: var(--muted); font-size: 12px; }

  .chart-tip { position: fixed; z-index: 100; pointer-events: none; background: #122033; color: #fff; font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(15,23,42,0.18); max-width: 280px; }

  .col-label .lbl-short { display: none; }

  @media (max-width: 1100px) {
    .chart-grid { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 520px) {
    .col-label .lbl-long { display: none; }
    .col-label .lbl-short { display: inline; }
    .col-chart { padding-left: 26px; }
    .chart-card { padding: 16px 14px; }
    .hbar-row { grid-template-columns: 70px minmax(0, 1fr) 40px; gap: 8px; }
  }

  /* 드라이브 이름 점검 카드 */
  .naming-card {
    background: var(--warning-soft);
    border: 1px solid #f3dca8;
    border-radius: 14px;
    padding: 12px 16px;
  }
  .naming-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  .naming-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 14px; }
  .naming-title strong { color: #9a6a12; }
  .naming-summary { font-size: 13px; color: var(--muted); }
  .naming-toggle { height: 32px; padding: 0 12px; font-size: 13px; }
  .naming-body { margin-top: 12px; display: grid; gap: 14px; font-size: 13px; }
  .naming-rules { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; line-height: 1.7; }
  .naming-rules code { background: var(--panel-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }
  .naming-section h4 { margin: 0 0 6px; font-size: 13px; }
  .naming-section p.naming-hint { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }
  .naming-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; max-height: 260px; overflow: auto; }
  .naming-list li { padding: 8px 12px; border-bottom: 1px solid var(--line); line-height: 1.5; word-break: break-all; }
  .naming-list li:last-child { border-bottom: none; }
  .naming-list .naming-path { color: var(--muted); }
  .naming-list .naming-company { font-weight: 700; }
  .naming-list .naming-files { color: var(--text); }
  .naming-more { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
  /* hidden 속성이 display:flex 같은 규칙에 덮여서 열람 계정에도 관리자 메뉴가 보이던 문제 방지 */
  [hidden] { display: none !important; }

  .login-card {
    width: 100%;
    max-width: 340px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .login-card h2 {
    margin: 0 0 2px;
    font-size: 19px;
    font-weight: 800;
  }

  .login-sub {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--muted);
  }

  .login-input { width: 100%; }
  .login-submit { margin-top: 4px; }
  .login-error { margin: 2px 0 0; font-size: 13px; color: var(--danger); }

  .flag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 700;
    padding: 5px 9px;
    font-size: 12px;
  }

  /* 관리자 전용 이슈 상태 수동 지정 select — 기존 읽기 전용 배지와 같은 모양으로 보이게.
     select는 브라우저마다 inline-flex를 제대로 안 따라서(세로 높이가 제각각이라 표 안에서
     줄이 들쭉날쭉해 보임), flex 대신 고정 height·line-height로 직접 정렬해요. */
  select.flag-badge {
    display: inline-block;
    height: 26px;
    line-height: 24px;
    padding: 0 8px;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
    appearance: auto;
  }

  .flag-badge.is-override {
    box-shadow: inset 0 0 0 1.5px currentColor;
  }

  .flag-badge.flag-none { background: var(--panel-soft); color: var(--muted); }
  .flag-badge.flag-caution { background: var(--warning-soft); color: var(--warning); }
  .flag-badge.flag-alert { background: var(--danger-soft); color: var(--danger); }
  .flag-badge.flag-issue { background: var(--danger-soft); color: var(--danger); }

  @media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .main-grid { grid-template-columns: 1fr; }
  }

  @media (max-width: 900px) {
    .layout { flex-direction: column; min-height: 0; }
    .sidebar { width: 100%; position: static; height: auto; overflow-y: visible; }
    .page { padding: 20px 16px 48px; max-width: none; }
    .toolbar-search { max-width: none; }
    .toolbar-actions { margin-left: 0; }
    .region-nav { flex-direction: row; flex-wrap: wrap; }
    .region-nav-item { width: auto; }
    .topbar { display: block; }
    .topbar-status { margin-top: 12px; justify-content: flex-start; }
  }

  @media (max-width: 760px) {
    .stats-grid { grid-template-columns: 1fr; }

    /* 자료 제출(업로드현황) 표를 가로 스크롤 대신 카드 목록으로 보여줘요 — 이 탭은
       협력사 담당자가 휴대폰으로 볼 가능성이 높아서 별도로 신경 썼어요.
       취합현황(관리자용 대형 편집 표)은 그대로 두고 이 클래스가 붙은 표에만 적용돼요. */
    .table-wrap { max-height: none; }
    table.upload-view { display: block; width: 100%; min-width: 0; }
    table.upload-view thead { display: none; }
    table.upload-view tbody { display: block; width: 100%; }
    table.upload-view tr {
      display: flex;
      flex-direction: column;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: var(--shadow);
      padding: 14px;
      margin-bottom: 12px;
    }
    table.upload-view tr.empty-row { display: block; padding: 0; border: none; box-shadow: none; }
    table.upload-view td {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      border-bottom: 1px dashed var(--line);
      padding: 9px 0;
      font-size: 13.5px;
    }
    table.upload-view td::before {
      content: attr(data-label);
      color: var(--muted);
      font-weight: 600;
      font-size: 12px;
      flex: none;
    }
    /* 기업명 칸을 카드 맨 위 제목처럼: sticky 해제하고 라벨 없이 굵게 */
    table.upload-view td.sticky-col {
      position: static;
      order: 1;
      border-bottom: 1px solid var(--line);
      padding-bottom: 12px;
      margin-bottom: 2px;
    }
    table.upload-view td.sticky-col::before { display: none; }
    table.upload-view td.sticky-col .readonly-text { font-size: 16px; font-weight: 800; color: var(--text); }
    table.upload-view td:nth-child(3) { order: 2; } /* 권역 */
    table.upload-view td:nth-child(1) { order: 3; } /* 협약일자 */
    table.upload-view td:nth-child(2) { order: 4; } /* 폴더NC */
    table.upload-view td:nth-child(n+5):not(:last-child) { order: 10; } /* 회차·계획서·보고서 체크 항목들 */
    table.upload-view td:last-child {
      order: 99;
      border-bottom: none;
      border-top: 1px solid var(--line);
      padding-top: 12px;
      margin-top: 2px;
      font-weight: 700;
    }
    table.upload-view .upload-toggle { width: 36px; height: 36px; font-size: 15px; }
  }
