@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
  /* ── INNOSPACE CI (공식 컬러) ── */
  --ci-deep:    #03428E;   /* Tech Deep Blue */
  --ci-trust:   #0083CA;   /* Trust Blue */
  --ci-cyan:    #1AA3E0;   /* 다크 서피스 하이라이트 */
  --ci-gradient: linear-gradient(90deg, #03428E 0%, #0083CA 60%, #1AA3E0 100%);

  /* ── 다크 테마 (기본) — INNOSPACE LMS ── */
  --bg:        #05070D;
  --surface:   #0C1220;
  --border:    #1D2740;
  --border-light:#2B3A5C;
  --border2:   #1D2740;
  --navy:      #03428E;
  --navy2:     #1AA3E0;
  --blue-lt:   #03428E;
  --text:      #EEF3FB;
  --text2:     #AFB9CC;
  --text3:     #6B7690;
  --red:       #FF5A5F; --red-bg: rgba(255,90,95,.12); --red-bd: rgba(255,90,95,.3);
  --amber:     #F2B84B; --amber-bg: rgba(242,184,75,.12); --amber-bd: rgba(242,184,75,.3);
  --blue:      #0083CA; --blue-bg: rgba(0,131,202,.12); --blue-bd: rgba(0,131,202,.3);
  --gray:      #6B7690; --gray-bg: rgba(107,118,144,.1); --gray-bd: #1D2740;
  --green:     #3DDC97; --green-bg: rgba(61,220,151,.12); --green-bd: rgba(61,220,151,.3);
  --purple:    #a855f7; --purple-bg: rgba(168,85,247,.12);
  --green-dim: rgba(61,220,151,.12);
  --red-dim:   rgba(255,90,95,.12);
  --blue-dim:  rgba(0,131,202,.12);
  --purple-dim:rgba(168,85,247,.12);
  --nav-h: 56px;
  --sidebar-w: 52px;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,.45), 0 2px 6px rgba(3,66,142,.25);
  --shadow-glow: 0 0 0 1px rgba(26,163,224,.35), 0 0 24px rgba(26,163,224,.25);

  /* ── Motion ── */
  --ease: cubic-bezier(.2,.8,.2,1);
  --dur-micro: 120ms;
  --dur-base: 220ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Noto Sans KR', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* ── LOGIN ── */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #03428E 0%, #0083CA 50%, #1AA3E0 100%);
}
.login-card {
  background: rgba(12,18,32,.42); border-radius: 14px; padding: 2rem 2.25rem;
  width: min(380px, 90vw); box-shadow: 0 24px 48px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: .5rem; }
.logo-mark-login {
  font-family: 'Space Mono', 'Noto Sans KR', monospace; font-size: 14px; font-weight: 700;
  background: linear-gradient(90deg, #0083CA, #1AA3E0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  border: 1px solid rgba(26,163,224,.3); padding: 6px 12px; border-radius: 6px;
}
.login-title { font-size: 18px; font-weight: 700; }
.login-sub   { font-size: 12px; color: var(--text2); }
.login-campaign { font-size: 12px; color: var(--text3); margin-bottom: 1.5rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.form-group  { margin-bottom: 1rem; }
.form-label  { font-size: 12px; font-weight: 600; color: var(--text2); display: block; margin-bottom: 5px; }
.login-id-field {
  position: relative;
}
.login-id-field .form-input {
  padding-right: 140px;
}
.login-id-suffix {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: rgba(255,255,255,.34);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .12s, visibility .12s;
}
.login-id-field .form-input:not(:placeholder-shown) + .login-id-suffix {
  opacity: 0;
  visibility: hidden;
}
.form-input  {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border2);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  background-color: var(--surface);
  color: var(--text);
}
.form-input:focus { outline: none; border-color: var(--navy2); box-shadow: 0 0 0 3px rgba(26,163,224,.15); }
.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23aaa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  background-attachment: scroll;
  color: var(--text);
  border: 1px solid var(--border2);
  padding: 9px 32px 9px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.form-select:focus {
  outline: none;
  border-color: var(--navy2);
  box-shadow: 0 0 0 3px rgba(26,163,224,.15);
}
.login-error { font-size: 12px; color: var(--red); min-height: 18px; margin-bottom: .5rem; }
.login-hint  { font-size: 11px; color: var(--text3); margin-top: .75rem; text-align: center; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--ci-gradient); color: #fff; border: none;
  padding: 10px 18px; border-radius: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: transform var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
  box-shadow: 0 4px 12px rgba(0,131,202,.25);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(0,131,202,.35); }
.btn-primary:active { transform: scale(0.98); }
.btn-full { width: 100%; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border2); color: var(--text2);
  padding: 7px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit;
  transition: all var(--dur-micro) var(--ease);
}
.btn-ghost:hover { border-color: var(--ci-cyan); color: var(--ci-cyan); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); padding: 7px 14px; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: inherit; transition: all var(--dur-micro) var(--ease); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(5,7,13,0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo-group { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  font-family: 'Space Mono', 'Noto Sans KR', monospace; font-size: 12px; font-weight: 700;
  background: linear-gradient(90deg, #0083CA, #1AA3E0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  border: 1px solid rgba(26,163,224,.3); padding: 3px 10px; border-radius: 4px;
}
.logo-name    { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; }
.logo-divider { color: rgba(255,255,255,.3); }
.logo-sub     { font-size: 11px; color: rgba(255,255,255,.5); font-weight: 300; }
.topbar-tabs  { display: flex; gap: 1px; flex: 1; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.topbar-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  padding: 6px 13px; border: none; background: transparent; border-radius: 4px;
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,.55);
  cursor: pointer; transition: all var(--dur-micro) var(--ease); white-space: nowrap; font-family: inherit;
}
.nav-tab:hover  { color: #fff; background: rgba(255,255,255,.06); }
.nav-tab.active { color: #fff; background: rgba(26,163,224,.15); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.campaign-chip { font-size: 11px; padding: 3px 10px; border-radius: 20px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.65); }
.d-day-chip {
  font-family: 'Space Mono', 'Noto Sans KR', monospace; font-size: 11px; font-weight: 700;
  color: #FFC7C9; background: rgba(255,90,95,.12); padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,90,95,.25);
  letter-spacing: .06em;
}
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; color: rgba(255,255,255,.7); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: rgba(0,131,202,.2);
  border: 1px solid rgba(26,163,224,.4); display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 700; color: #1AA3E0;
}
.logout-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.6);
  border-radius: 5px; padding: 2px 8px; font-size: 13px; cursor: pointer;
}
.logout-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── LAYOUT ── */
:root { --sidebar-collapsed: 52px; --sidebar-expanded: 200px; }

.layout {
  display: flex;
  height: calc(100vh - var(--nav-h));
  margin-top: var(--nav-h);
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-collapsed);
  background: #0C1220;
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 0;
  gap: 2px;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .22s cubic-bezier(.4,0,.2,1);
  z-index: 100;
  position: relative;
}
/* 비고정(hover) 모드 */
.sidebar:not([data-pinned="true"]):hover { width: var(--sidebar-expanded); }
/* 고정 모드 */
.sidebar[data-pinned="true"] { width: var(--sidebar-expanded); }

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-item.active {
  border-left-color: var(--ci-cyan);
  background: rgba(26,163,224,.15);
  color: #fff;
}
.sidebar-pin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  opacity: .55;
  transition: opacity .15s;
  font-size: 12px;
  color: var(--text2);
}
.sidebar-pin-btn:hover { opacity: 1; }
.sidebar[data-pinned="true"] .sidebar-pin-btn { opacity: 1; color: var(--ci-cyan); }
.si-icon  { font-size: 16px; flex-shrink: 0; }
.si-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.65); opacity: 0; transition: opacity .18s; white-space: nowrap; }
.sidebar-l2-item.sidebar-subitem {
  padding-left: 42px !important;
}
.sidebar-l2-item.sidebar-subitem-level-2 {
  padding-left: 48px !important;
}
.sidebar-l2-item.sidebar-subitem .si-icon {
  transform: scale(.86);
  opacity: .72;
}
.sidebar-l2-item.sidebar-subitem-level-2 .si-icon {
  transform: scale(.78);
  opacity: .62;
}
.sidebar-l2-item.sidebar-subitem .si-label {
  font-size: 11.5px;
  color: rgba(255,255,255,.58);
}
.sidebar:not([data-pinned="true"]):hover .si-label,
.sidebar[data-pinned="true"] .si-label { opacity: 1; }
.sidebar-sep { width: 80%; height: 1px; background: rgba(255,255,255,.1); margin: 5px auto; flex-shrink: 0; }
/* 사이드바는 테마 무관하게 항상 다크 배경 유지 */
[data-theme="light"] .sidebar-item:hover { background: rgba(255,255,255,.08); }
[data-theme="light"] .sidebar-item.active { background: rgba(26,163,224,.2); }

/* ── MAIN WRAP + TAB BAR ── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  /* 사이드바가 fixed로 빠져도 main-wrap이 전체폭 유지 */
  width: 100%;
}

.tab-bar-wrap {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#sidebar-toggle-btn {
  display: none; /* 데스크탑에서는 숨김 — 모바일(@media)에서만 활성화 */
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 100%;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  color: var(--text2);
  font-size: 17px;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
#sidebar-toggle-btn:hover {
  background: var(--bg);
  color: var(--text);
}
#sidebar-toggle-btn.active {
  background: var(--blue-bg);
  color: var(--navy2);
}

.tab-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 8px;
  flex: 1;
  min-height: 36px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all .15s;
  user-select: none;
  flex-shrink: 0;
  border-radius: 4px 4px 0 0;
  margin-top: 3px;
  position: relative;
}
.tab-item:hover { color: var(--ci-cyan); background: var(--bg); }
.tab-item.active {
  color: var(--ci-cyan);
  border-bottom-color: var(--ci-cyan);
  background: rgba(26,163,224,.08);
  font-weight: 600;
}
.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  color: var(--text3);
  transition: all .12s;
  margin-left: 2px;
}
.tab-close:hover { background: var(--border); color: var(--red); }

/* ── MAIN CONTENT ── */
.main {
  flex: 1;
  overflow-y: auto;   /* JS에서 내부스크롤 페이지 시 hidden으로 전환 */
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── 페이지 전환 ── */
.page { display: none; }
.page.active { display: block; }

/* 내부 스크롤 모드: JS가 data-inner-scroll 속성 부여 */
.page.active[data-inner-scroll] {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}


/* WBS 내부스크롤: data-inner-scroll으로 통합 */

/* ── PAGE HEADER ── */
.page-header  { margin-bottom: 18px; }
.page-title   { font-size: 20px; font-weight: 700; }
.page-meta    { font-size: 11px; color: var(--text3); margin-top: 3px; font-family: 'Space Mono', 'Noto Sans KR', monospace; }

/* ── PHASE GATE ── */
.phase-gate {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.phase-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); margin-bottom: 10px; }
.phase-track { display: flex; align-items: center; }
.phase-node  { display: flex; flex-direction: column; align-items: center; position: relative; flex: 1; }
.phase-node::after { content:''; position:absolute; top:14px; left:50%; width:100%; height:2px; }
.phase-node:last-child::after { display:none; }
.phase-node.done::after   { background: var(--green); }
.phase-node.active::after { background: linear-gradient(90deg, var(--navy2), var(--border)); }
.phase-node.future::after { background: var(--border); }
.phase-node.launch::after { display:none; }
.phase-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; z-index: 1; position: relative;
}
.phase-node.done   .phase-circle { background: var(--green-bg);  border: 2px solid var(--green);  color: var(--green); }
.phase-node.active .phase-circle { background: var(--blue-bg);   border: 2px solid var(--navy2);  color: var(--navy2); animation: pulse 2s infinite; }
.phase-node.future .phase-circle { background: var(--gray-bg);   border: 2px solid var(--border2); color: var(--text3); }
.phase-node.launch .phase-circle { background: var(--red-bg);    border: 2px solid var(--red);    color: var(--red); }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(26,163,224,.3)} 50%{box-shadow:0 0 0 6px rgba(26,163,224,0)} }
.phase-name { font-size: 10px; color: var(--text3); margin-top: 5px; text-align: center; white-space: nowrap; }
.phase-node.done .phase-name   { color: var(--green); }
.phase-node.active .phase-name { color: var(--navy2); }
.phase-node.launch .phase-name { color: var(--red); }
.phase-date { font-size: 9px; color: var(--text3); font-family: 'Space Mono', 'Noto Sans KR', monospace; }

/* ── STAT GRID ── */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:2px; }
.stat-card.blue::before   { background: var(--ci-gradient); }
.stat-card.green::before  { background: var(--green); }
.stat-card.amber::before  { background: var(--amber); }
.stat-card.purple::before { background: var(--purple); }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); margin-bottom: 8px; font-weight: 600; }
.stat-val   { font-family: 'Space Mono', 'Noto Sans KR', monospace; font-size: 28px; font-weight: 700; line-height: 1; }
.stat-card.blue   .stat-val { color: var(--navy2); }
.stat-card.green  .stat-val { color: var(--green); }
.stat-card.amber  .stat-val { color: var(--amber); }
.stat-card.purple .stat-val { color: var(--purple); }
.stat-sub  { font-size: 10px; color: var(--text3); margin-top: 5px; }
.stat-bar  { height: 3px; background: var(--border); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 2px; }
.stat-card.blue   .stat-bar-fill { background: var(--navy2); }
.stat-card.green  .stat-bar-fill { background: var(--green); }
.stat-card.amber  .stat-bar-fill { background: var(--amber); }
.stat-card.purple .stat-bar-fill { background: var(--purple); }

/* ── PANEL ── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-title  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); }
.panel-action { font-size: 11px; color: var(--navy2); cursor: pointer; background: var(--blue-bg); border: 1px solid var(--blue-bd); padding: 3px 9px; border-radius: 5px; }
.panel-action:hover { background: var(--navy2); color: #fff; }

/* ── GRIDS ── */
.content-grid   { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 14px; }
.content-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── BADGES / CHIPS ── */
.badge { font-family: 'Space Mono', monospace; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; letter-spacing: .06em; }
.badge-done    { background: var(--green-bg); color: var(--green);   border: 1px solid var(--green-bd); }
.badge-wip     { background: var(--amber-bg); color: var(--amber);   border: 1px solid var(--amber-bd); }
.badge-review  { background: var(--blue-bg);  color: var(--navy2);   border: 1px solid var(--blue-bd); }
.badge-pending { background: var(--purple-bg); color: var(--purple); border: 1px solid #ddd6fe; }
.badge-delivered { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd); }
.badge-shipped { background: var(--blue-bg); color: var(--navy2); border: 1px solid var(--blue-bd); }
.badge-customs { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }
.badge-preparing { background: var(--gray-bg); color: var(--gray); border: 1px solid var(--gray-bd); }
.badge-issue   { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-bd); }
.badge-failed  { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-bd); }
.badge-planned { background: var(--gray-bg); color: var(--gray); border: 1px solid var(--gray-bd); }
.badge-active  { background: var(--blue-bg); color: var(--navy2); border: 1px solid var(--blue-bd); }
.badge-delayed { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }
.badge-open    { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-bd); }
.badge-monitoring { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }
.badge-closed  { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd); }
.badge-critical { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-bd); }
.badge-warning  { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }
.badge-info     { background: var(--blue-bg); color: var(--navy2); border: 1px solid var(--blue-bd); }
.badge-normal   { background: var(--gray-bg); color: var(--gray); border: 1px solid var(--gray-bd); }
.badge-admin    { background: var(--navy); color: #fff; }
.badge-member   { background: var(--gray-bg); color: var(--gray); border: 1px solid var(--gray-bd); }

.sev-label { font-size: 10px; font-weight: 700; }
.sev-critical { color: var(--red); } .sev-warning { color: var(--amber); }
.sev-info { color: var(--navy2); } .sev-normal { color: var(--gray); }

/* ── MILESTONE LIST ── */
.ms-list { display: flex; flex-direction: column; }
.ms-item { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.ms-item:not(:last-child) .ms-line { position:absolute; left:10px; top:22px; width:1px; height:calc(100% - 10px); }
.ms-dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display:flex; align-items:center; justify-content:center; font-size: 10px; font-weight: 700; z-index: 1; }
.ms-item.done   .ms-dot { background: var(--green-bg); border: 2px solid var(--green); color: var(--green); }
.ms-item.done   .ms-line { background: var(--green); opacity: .3; }
.ms-item.active .ms-dot { background: var(--blue-bg); border: 2px solid var(--navy2); color: var(--navy2); animation: pulse 2s infinite; }
.ms-item.active .ms-line { background: var(--border); }
.ms-item.future .ms-dot { background: var(--gray-bg); border: 2px solid var(--border2); color: var(--text3); }
.ms-item.future .ms-line { background: var(--border); }
.ms-item.launch .ms-dot { background: var(--red-bg); border: 2px solid var(--red); color: var(--red); }
.ms-content { flex: 1; }
.ms-name { font-size: 12px; font-weight: 600; }
.ms-item.done .ms-name   { color: var(--text2); }
.ms-item.active .ms-name { color: var(--text); }
.ms-item.future .ms-name { color: var(--text3); }
.ms-item.launch .ms-name { color: var(--red); }
.ms-date { font-size: 10px; color: var(--text3); font-family: 'Space Mono', 'Noto Sans KR', monospace; margin-top: 1px; }
.ms-chip { display: inline-block; margin-top: 3px; font-size: 9px; padding: 2px 8px; border-radius: 99px; }
.ms-item.done   .ms-chip { background: var(--green-bg); color: var(--green); }
.ms-item.active .ms-chip { background: var(--blue-bg);  color: var(--navy2); }
.ms-item.future .ms-chip { background: var(--gray-bg);  color: var(--text3); border: 1px solid var(--border); }
.ms-item.launch .ms-chip { background: var(--red-bg);   color: var(--red); }

/* ── DOCUMENT ROWS ── */
.doc-filter { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-filter-btn { font-size: 11px; padding: 3px 10px; border-radius: 5px; border: 1px solid var(--border); background: transparent; color: var(--text2); cursor: pointer; transition: all .15s; }
.doc-filter-btn.active { background: var(--blue-bg); color: var(--navy2); border-color: var(--blue-bd); }
.doc-section { margin-bottom: 10px; }
.doc-section-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; background: var(--bg); border-radius: 6px; margin-bottom: 4px; }
.doc-section-name { font-size: 11px; font-weight: 600; color: var(--text2); }
.doc-section-prog { font-size: 10px; color: var(--text3); font-family: 'Space Mono', 'Noto Sans KR', monospace; }
.doc-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px 5px 20px; border-radius: 5px; font-size: 11px; color: var(--text2); margin-bottom: 2px; cursor: pointer; transition: all .1s; }
.doc-row:hover { background: var(--bg); color: var(--text); }
.doc-row-left { display: flex; align-items: center; gap: 8px; }

/* ── RISK ROWS ── */
.risk-list { display: flex; flex-direction: column; gap: 8px; }
.risk-row  { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: all .15s; }
.risk-row:hover { border-color: var(--navy2); background: var(--blue-bg); }
.risk-bar { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.risk-bar.high { background: var(--red); }
.risk-bar.mid  { background: var(--amber); }
.risk-bar.low  { background: var(--green); }
.risk-body { flex: 1; min-width: 0; }
.risk-title  { font-size: 12px; font-weight: 600; color: var(--text); }
.risk-desc   { font-size: 10px; color: var(--text3); margin-top: 2px; }
.risk-owner  { font-size: 10px; padding: 2px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text2); white-space: nowrap; }

/* ── ACTIVITY ── */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-row  { display: flex; gap: 10px; align-items: flex-start; }
.av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--blue-bg); color: var(--navy2); border: 1px solid var(--blue-bd); }
.activity-text  { font-size: 11px; color: var(--text2); line-height: 1.5; }
.activity-text strong { color: var(--text); }
.activity-time  { font-size: 10px; color: var(--text3); font-family: 'Space Mono', 'Noto Sans KR', monospace; margin-top: 2px; }

/* ── TABLE ── */
.table-wrap { overflow: hidden; border-radius: 10px 10px 8px 8px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.table-wrap.scroll-x { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }

thead th { background: #03428E; color: #fff; padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 700; white-space: nowrap; letter-spacing: .04em; border-bottom: 2px solid var(--ci-cyan); }
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }
tbody tr:nth-child(even) td { background: var(--gray-bg); }
tbody tr:nth-child(even):hover td { background: var(--bg); }

/* ── WBS PROGRESS BAR ── */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar  { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; background: var(--navy2); border-radius: 99px; transition: width .3s; }
.progress-fill.done    { background: var(--green); }
.progress-fill.delayed { background: var(--amber); }
.progress-label { font-size: 11px; color: var(--text3); font-family: 'Space Mono', 'Noto Sans KR', monospace; white-space: nowrap; }

/* ── FILTER BAR ── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text2); white-space: nowrap; }
.filter-select {
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}

/* ── SCENARIO CARDS ── */
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 10px; }
.sc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow); border-left: 3px solid transparent; }
.sc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.sc-card.critical { border-left-color: var(--red); }
.sc-card.warning  { border-left-color: var(--amber); }
.sc-card.info     { border-left-color: var(--navy2); }
.sc-card.normal   { border-left-color: var(--gray); }
.sc-header { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap; }
.sc-id    { font-size: 10px; font-weight: 700; color: var(--text3); }
.sc-title { font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.sc-desc  { font-size: 12px; color: var(--text2); line-height: 1.5; margin-bottom: 8px; }
.sc-tags  { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-tag   { font-size: 10px; padding: 1px 7px; border-radius: 4px; background: var(--bg); color: var(--text2); border: 1px solid var(--border); }
.sc-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 10px; color: var(--text3); }

/* ── AIT CHECKLIST ── */
.ait-phase { margin-bottom: 14px; }
.ait-phase-title { font-size: 12px; font-weight: 700; color: var(--navy); padding: 5px 10px; background: var(--bg); border-radius: 6px; margin-bottom: 6px; }
.ait-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.ait-item:last-child { border-bottom: none; }
.ait-item select { font-size: 11px; padding: 2px 6px; border: 1px solid var(--border2); border-radius: 5px; font-family: inherit; }
.ait-item .owner { font-size: 10px; color: var(--text3); }

/* ── DRAWER ── */
.drawer-overlay { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.3); backdrop-filter: blur(2px); }
.drawer-overlay.open { display: block; }
.drawer { position: fixed; top: 0; right: -460px; bottom: 0; width: min(460px,100vw); z-index: 301; background: var(--surface); overflow-y: auto; padding: 1.5rem 1.25rem; transition: right .25s cubic-bezier(.4,0,.2,1); box-shadow: -4px 0 24px rgba(0,0,0,.1); }
.drawer.open { right: 0; }
.drawer-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; }
.drawer-id    { font-size: 10px; font-weight: 700; color: var(--text3); margin-bottom: 2px; }
.drawer-title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.drawer-close { background: var(--bg); border: 1px solid var(--border); border-radius: 50%; width: 30px; height: 30px; font-size: 13px; cursor: pointer; color: var(--text2); flex-shrink: 0; }
.drawer-close:hover { background: var(--border); }
.drawer-sec-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); border-top: 1px solid var(--border); padding-top: .75rem; margin: 1rem 0 .5rem; }

/* Step list in drawer */
.step-row  { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: none; }
.step-num  { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; background: var(--bg); color: var(--text2); border: 1px solid var(--border); margin-top: 1px; }
.step-num.crit { background: var(--red-bg); color: var(--red); border-color: var(--red-bd); }
.step-action { font-size: 12px; line-height: 1.45; font-weight: 500; }
.step-action.crit { color: var(--red); }
.step-who { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.step-who span { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--blue-bg); color: var(--navy2); }
.fts-tag { font-size: 9px; padding: 1px 5px; border-radius: 3px; background: var(--red-bg); color: var(--red); margin-left: 4px; }
.role-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 11px; border: 1px solid var(--border); margin: 3px; }
.role-chip.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.role-chip.support { background: var(--bg); color: var(--text2); }

/* ── USER MANAGEMENT ── */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 10px; }
.user-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.user-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar-lg { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: var(--blue-bg); color: var(--navy2); border: 1px solid var(--blue-bd); }
.user-name    { font-size: 14px; font-weight: 600; }
.user-team    { font-size: 11px; color: var(--text3); margin-top: 1px; }
.user-meta    { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.user-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tag { font-size: 10px; padding: 2px 7px; border-radius: 4px; background: var(--bg); color: var(--text2); border: 1px solid var(--border); }

/* ── MODAL (for edit forms) ── */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.35); backdrop-filter: blur(2px); align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: 14px; padding: 1.5rem; width: min(420px,94vw); box-shadow: 0 20px 40px rgba(0,0,0,.15); }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 1rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 1.25rem; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── RESPONSIVE: 아래 '반응형 강화' 섹션에서 통합 관리 ── */

/* ── Project selector ── */
.project-select-input {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #fff; font-size: 12px; font-weight: 600; padding: 5px 28px 5px 10px;
  border-radius: 7px; cursor: pointer; font-family: inherit; min-width: 180px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23fff' opacity='.6' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.project-select-input:focus { outline: none; border-color: rgba(255,255,255,.5); }
.project-select-input option { background: #03428E; color: #fff; }

.project-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #3DDC97; box-shadow: 0 0 6px #3DDC97;
}
.project-status-dot.planning  { background: #1AA3E0; box-shadow: 0 0 6px #1AA3E0; }
.project-status-dot.completed { background: #6B7690; box-shadow: none; }
.project-status-dot.suspended { background: #FF5A5F; box-shadow: 0 0 6px #FF5A5F; }

/* ── Personnel table check icons ── */
.check-yes { color: #16a34a; font-size: 14px; }
.check-no  { color: #d1d5db; font-size: 14px; }

/* ── Projects admin page ── */
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.project-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:4px;
}

/* ── BADGE 추가 ── */
.badge { display: inline-block; font-family: 'Space Mono', monospace; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .06em; }
.badge-done     { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-bd); }
.badge-wip      { background: var(--amber-bg);  color: var(--amber);  border: 1px solid var(--amber-bd); }
.badge-review   { background: var(--blue-bg);   color: var(--navy2);  border: 1px solid var(--blue-bd); }
.badge-pending  { background: var(--gray-bg);   color: var(--gray);   border: 1px solid var(--gray-bd); }
.badge-active   { background: var(--blue-bg);   color: var(--navy2);  border: 1px solid var(--blue-bd); }
.badge-admin    { background: var(--navy);       color: #fff;          border: 1px solid var(--navy); }
.badge-member   { background: var(--gray-bg);   color: var(--gray);   border: 1px solid var(--gray-bd); }
.badge-high,.badge-critical { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-bd); }
.badge-mid,.badge-warning   { background: var(--amber-bg);  color: var(--amber);  border: 1px solid var(--amber-bd); }
.badge-low,.badge-info      { background: var(--blue-bg);   color: var(--navy2);  border: 1px solid var(--blue-bd); }
.badge-normal   { background: var(--gray-bg);   color: var(--gray);   border: 1px solid var(--gray-bd); }
.badge-open     { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-bd); }
.badge-monitoring { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }
.badge-closed   { background: var(--gray-bg);   color: var(--gray);   border: 1px solid var(--gray-bd); }
.badge-failed   { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-bd); }

/* ── PANEL / DOC ── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-title  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.panel-action { font-size: 11px; color: var(--navy2); cursor: pointer; padding: 2px 8px; border-radius: 5px; border: 1px solid var(--blue-bd); background: var(--blue-bg); }
.panel-action:hover { background: var(--navy2); color: #fff; }
.doc-filter   { display: flex; gap: 5px; flex-wrap: wrap; }
.doc-filter-btn { font-size: 11px; padding: 4px 11px; border-radius: 6px; border: 1px solid var(--border2); background: var(--surface); color: var(--text2); cursor: pointer; transition: all .12s; font-family: inherit; }
.doc-filter-btn:hover  { border-color: var(--navy2); color: var(--navy2); }
.doc-filter-btn.active { background: var(--navy2); color: #fff; border-color: var(--navy2); }
.doc-section-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; background: var(--bg); border-radius: 6px; margin-bottom: 4px; cursor: pointer; }
.doc-section-name { font-size: 11px; font-weight: 600; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.doc-section-prog { font-size: 10px; color: var(--text3); font-family: 'Space Mono', 'Noto Sans KR', monospace; }
.doc-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-radius: 6px; font-size: 12px; color: var(--text2); cursor: pointer; transition: background .1s; }
.doc-row:hover { background: var(--bg); color: var(--text); }
.doc-row-left { display: flex; align-items: center; gap: 8px; }

/* ── CONTENT GRID ── */
.content-grid   { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }

/* ── RISK ── */
.risk-list { display: flex; flex-direction: column; gap: 8px; }
.risk-row  { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow); }
.risk-row:hover { border-color: var(--blue-bd); }
.risk-bar { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.risk-bar.high { background: var(--red); }
.risk-bar.mid  { background: var(--amber); }
.risk-bar.low  { background: var(--green); }
.risk-body { flex: 1; }
.risk-title { font-size: 12px; font-weight: 600; }
.risk-desc  { font-size: 11px; color: var(--text3); margin-top: 2px; }
.risk-owner { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); color: var(--text2); white-space: nowrap; }

/* ── ACTIVITY ── */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-row  { display: flex; gap: 10px; align-items: flex-start; }
.av { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--blue-bg); color: var(--navy2); border: 1px solid var(--blue-bd); }
.activity-text { font-size: 12px; color: var(--text2); line-height: 1.5; }
.activity-text strong { color: var(--text); }
.activity-time { font-size: 10px; color: var(--text3); margin-top: 2px; font-family: 'Space Mono', 'Noto Sans KR', monospace; }

/* ── TABLE (secondary — inherits from primary TABLE rules above) ── */

/* ── PERSONNEL SPECIFIC ── */
.stat-card.amber::before { background: var(--amber); }
.stat-card.amber .stat-val { color: var(--amber); }
.stat-bar { height: 3px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 2px; background: var(--navy2); transition: width .4s; }
.stat-card.green .stat-bar-fill  { background: var(--green); }
.stat-card.amber .stat-bar-fill  { background: var(--amber); }
.stat-card.purple .stat-bar-fill { background: var(--purple); }

/* ── PROGRESS ── */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar  { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--navy2); transition: width .4s; }
.progress-fill.done    { background: var(--green); }
.progress-fill.delayed { background: var(--red); }

/* ── 인라인 셀 편집 ── */
.inline-cell:hover { background: var(--blue-bg) !important; }
.inline-cell:hover .inline-val { text-decoration: underline; text-underline-offset: 2px; color: var(--navy2); }
.inline-edit-wrap { display: inline-flex; align-items: center; gap: 3px; }
.ic:hover { background: var(--blue-bg) !important; }
.ic:hover .ic-val { color: var(--navy2); text-decoration: underline; text-underline-offset: 2px; }
.ic-wrap { display: inline-flex; align-items: center; gap: 3px; }

/* ── AI 브리핑 스피너 ── */
.ai-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--navy2);
  border-radius: 50%;
  animation: ai-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════
   시스템 완성도 패치 — 누락 클래스 + 반응형 강화
   ══════════════════════════════════════════════════════════════════ */

/* admin-only: JS로 제어 (기본 숨김) */
.admin-only { display: none !important; }
.admin-only.visible { display: flex !important; }
.sidebar-l2-group.admin-only.visible { display: block !important; }

/* drawer-body */
.drawer-body { padding: 0 20px 20px; overflow-y: auto; flex: 1; }

/* 인라인 편집 select */
.ic-sel { font-size: 11px; padding: 2px 5px; border: 1px solid var(--navy2); border-radius: 4px; background: var(--surface); cursor: pointer; }

/* 인원 체크박스 */
.p-row-chk { width: 15px; height: 15px; cursor: pointer; accent-color: var(--navy2); }

/* 변경이력 카드 hover */
.cl-card { transition: border-color .15s, background .15s; }

/* ── 반응형 강화 ── */
@media (max-width: 1100px) {
  .topbar { padding: 0 14px; gap: 8px; }
  .logo-sub { display: none; }
  #project-selector span { display: none; }
}

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .content-grid, .content-grid-2 { grid-template-columns: 1fr; }
  .main { padding: 14px; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 10px; }
  .d-day-chip { font-size: 11px; padding: 3px 8px; }
  .user-chip #user-display { display: none; }
  .campaign-chip { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-val { font-size: 22px !important; }
  .panel { padding: 12px; }
  /* drawer: 600px 이하에서 전체폭이지만 닫혀있을 때는 right:-100vw */
  .drawer { width: 100% !important; }
  .drawer:not(.open) { right: -100vw !important; }
}

/* ── 다크/라이트 테마 ── */
[data-theme="light"] {
  --bg-base:    #F7F9FC;
  --bg-panel:   #ffffff;
  --bg-card:    #ffffff;
  --surface:    #ffffff;
  --bg:         #F7F9FC;
  --bg-hover:   #EBF0F7;
  --border:     #D1DCE8;
  --border-light:#B8CCE0;
  --border2:    #C8D8E8;
  --text:       #0B1426;
  --text2:      #3A4763;
  --text3:      #6D6E71;
  --navy:       #03428E;
  --navy2:      #0083CA;
  --blue-bg:    rgba(0,131,202,.08);
  --blue-bd:    rgba(0,131,202,.25);
  --blue-dim:   rgba(0,131,202,.06);
  --green:      #16a34a;
  --green-bg:   rgba(22,163,74,.1);
  --green-bd:   rgba(22,163,74,.25);
  --green-dim:  rgba(22,163,74,.08);
  --red:        #dc2626;
  --red-bg:     rgba(220,38,38,.08);
  --red-dim:    rgba(220,38,38,.06);
  --red-bd:     rgba(220,38,38,.25);
  --amber:      #d97706;
  --amber-bg:   rgba(217,119,6,.08);
  --amber-bd:   rgba(217,119,6,.25);
  --purple:     #7c3aed;
  --purple-dim: #ede9fe;
  --gray:       #6D6E71;
  --gray-bg:    rgba(109,110,113,.08);
  --gray-bd:    rgba(109,110,113,.2);
}

[data-theme="light"] .topbar { background: #03428E; border-bottom-color: #021F45; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="light"] .sidebar { background: #03428E !important; }

/* Light theme form inputs */
[data-theme="light"] .form-input {
  background-color: #fff;
  border-color: #d1dce8;
  color: #1a2b3c;
}
[data-theme="light"] .form-input:focus {
  border-color: var(--ci-cyan);
  box-shadow: 0 0 0 3px rgba(26,163,224,.15);
}
[data-theme="light"] .form-input::placeholder {
  color: #7a98b0;
}

[data-theme="light"] .form-select {
  background-color: #fff;
  border-color: #d1dce8;
  color: #1a2b3c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
[data-theme="light"] .form-select:focus {
  border-color: var(--ci-cyan);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,163,224,.15);
}

/* Light theme gadget and headers */
[data-theme="light"] .gadget-header {
  background: #f8fafc;
  border-bottom-color: #d1dce8;
}

[data-theme="light"] .page-title {
  color: #1a2b3c;
}
[data-theme="light"] .page-meta {
  color: #7a98b0;
}

/* Light theme drawer */
[data-theme="light"] .drawer {
  background: #ffffff;
}
[data-theme="light"] .drawer-close {
  background: #f8fafc;
  border-color: #d1dce8;
  color: #3a5068;
}
[data-theme="light"] .drawer-close:hover {
  background: #e8eef5;
}

/* Light theme table headers */
[data-theme="light"] thead th {
  background: #03428E;
  color: #fff;
}
[data-theme="light"] .sticky-table thead th,
[data-theme="light"] .inner-scroll-table thead th {
  background: #03428E;
  color: #fff;
}

/* Light theme filter select */
[data-theme="light"] .filter-select {
  background: #fff;
  border-color: #d1dce8;
  color: #1a2b3c;
}
[data-theme="light"] .filter-select:focus {
  border-color: var(--ci-cyan);
  outline: none;
}

/* Light theme modal */
[data-theme="light"] .modal {
  background: #ffffff;
}
[data-theme="light"] .modal-overlay {
  background: rgba(0,0,0,.25);
}

/* Light theme drawer overlay */
[data-theme="light"] .drawer-overlay {
  background: rgba(0,0,0,.2);
}

/* 테마 전환 버튼 */
.theme-toggle {
  width: 32px; height: 18px;
  background: var(--border);
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background .2s;
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform .2s;
}
[data-theme="light"] .theme-toggle { background: var(--navy2); }
[data-theme="light"] .theme-toggle::after { transform: translateX(14px); }

/* ── 사이드바 그룹 레이블 & 하위 메뉴 ── */
.sidebar-group-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.3);
  padding: 8px 16px 2px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transition: opacity .18s;
}
.sidebar:not([data-pinned="true"]):hover .sidebar-group-label,
.sidebar[data-pinned="true"] .sidebar-group-label { opacity: 1; }

.sidebar-sub {
  padding-left: 22px !important;
}
.sidebar-sub .si-icon { font-size: 14px; }

/* ── 가젯 시스템 (균일 그리드) ── */
.gadget-grid-unified {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 860px) {
  .gadget-grid-unified { grid-template-columns: 1fr; }
}
.gadget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.gadget:hover { border-color: var(--border-light); }
.gadget.drag-over {
  border-color: var(--navy2);
  box-shadow: 0 0 0 2px rgba(26,163,224,.2);
}
/* 모든 가젯 동일 크기 — span 없음 */
.gadget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}
.gadget-header:active { cursor: grabbing; }
.gadget-body {
  padding: 14px 16px;
  flex: 1;
  overflow-y: auto;
}
/* S/M/L 크기 클래스 */
.gadget-body.size-small  { max-height: 160px; }
.gadget-body.size-medium { max-height: 320px; }
.gadget-body.size-large  { max-height: 520px; }

/* ── 사이드바 오버레이 ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: rgba(0,0,0,.55);
  z-index: 299;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.show { display: block; }

/* ── 햄버거 토글: 모바일에서만 슬라이드 사이드바 ── */
@media (max-width: 768px) {
  /* 모바일: 햄버거 버튼 표시 */
  #sidebar-toggle-btn {
    display: flex !important;
  }

  /* 모바일: 사이드바 기본 숨김 (슬라이드 오프스크린) */
  .sidebar {
    position: fixed !important;
    top: var(--nav-h);
    left: 0; bottom: 0;
    z-index: 300;
    width: 220px !important;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.5);
    overflow-y: auto;
  }

  /* 모바일: 열린 상태 */
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* 모바일: 사이드바 열렸을 때 라벨 표시 */
  .sidebar.mobile-open .si-label,
  .sidebar.mobile-open .sidebar-group-label {
    opacity: 1 !important;
  }

  /* 모바일: 레이아웃에서 사이드바 공간 제거 */
  #layout {
    margin-left: 0 !important;
  }
}

/* 데스크탑: mobile-hidden/mobile-open 클래스 무력화 (JS가 붙여도 무시) */
@media (min-width: 769px) {
  .sidebar.mobile-hidden,
  .sidebar.mobile-open {
    position: relative !important;
    transform: none !important;
    box-shadow: none !important;
  }
}

/* ── SVG 아이콘 사이드바 ── */
.si-icon svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255,255,255,.5);   /* 사이드바는 항상 다크 — 흰색 고정 */
  fill: currentColor;
  transition: color .15s, opacity .15s;
}
.sidebar-item:hover .si-icon svg { color: rgba(255,255,255,.9); }
.sidebar-item.active .si-icon svg { color: #1AA3E0; }  /* 활성: CI Cyan */
.sidebar-pin-btn .si-icon svg { color: rgba(255,255,255,.4); }
.sidebar-pin-btn:hover .si-icon svg { color: rgba(255,255,255,.8); }
.sidebar-group-label { color: rgba(255,255,255,.3); }  /* 그룹 레이블도 항상 밝게 */

/* 로그인 배경 텍스트 가시성 */
.login-card .login-title  { color: #e2eaf5; }
.login-card .login-sub    { color: rgba(255,255,255,.6); }
.login-card .login-campaign { color: rgba(255,255,255,.4); border-color: rgba(255,255,255,.1); }
.login-card .form-label   { color: rgba(255,255,255,.7); }
.login-card .form-input   { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; }
.login-card .form-input:focus { border-color: var(--navy2); background: rgba(255,255,255,.1); }
.login-card .form-input::placeholder { color: rgba(255,255,255,.35); letter-spacing: 1px; font-size: 12px; }
.login-card .login-hint   { color: rgba(255,255,255,.3); }
.login-card .login-error  { color: #fca5a5; }

/* ══════════════════════════════════════════════════════════════════
   내부 스크롤 페이지 공통 패턴
   — 헤더 고정 + 테이블 내부 스크롤 (엑셀 틀고정 방식)
   ══════════════════════════════════════════════════════════════════ */

/* 내부 스크롤이 필요한 페이지 공통 */
.page-scroll-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.page-scroll-wrap.active { display: flex; }

/* 고정 헤더 영역 */
.page-fixed-header {
  flex-shrink: 0;
  padding-bottom: 10px;
}

/* 스크롤 가능한 콘텐츠 영역 */
.page-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.page-scroll-body.inner-scroll-table,
.page-scroll-body table {
  /* 테이블을 스크롤 바디 안에서 자연스럽게 */
  width: 100%;
}

/* 테이블 헤더 틀고정 공통 */
.sticky-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #03428E;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 2px solid var(--ci-cyan);
  padding: 9px 12px;
  border-radius: 0;
}
.sticky-table {
  width: 100%;
  border-collapse: collapse;
}
.sticky-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.sticky-table tbody tr:hover { background: var(--bg); }

/* sticky-table 첫 컬럼 좌측 고정 (가로 스크롤 시 식별 컬럼 유지) */
.sticky-table th:first-child,
.sticky-table td:first-child {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  box-shadow: 4px 0 8px -4px rgba(0,0,0,.25);
}
.sticky-table thead th:first-child {
  background: #03428E;   /* 헤더는 CI 컬러 유지 */
  z-index: 4;            /* 헤더 ∩ 첫 컬럼 교차점 */
}
.sticky-table tbody tr:hover td:first-child { background: var(--bg); }
[data-theme="light"] .sticky-table td:first-child { background: #fff; }
[data-theme="light"] .sticky-table tbody tr:hover td:first-child { background: var(--bg); }

/* 내부 스크롤 컨테이너 (테이블 래퍼) */
.inner-scroll-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  flex: 1;
  min-height: 0;
}

/* inner-scroll-table 내부 thead — sticky + border-radius 충돌 해결 */
.inner-scroll-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #03428E;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
  border-bottom: 2px solid var(--ci-cyan);
  padding: 9px 12px;
  border-radius: 0;
}

/* ── ATTACHMENTS ─────────────────────────────────────────────── */
.attach-zone {
  border:2px dashed var(--border);border-radius:var(--radius);
  padding:14px 16px;text-align:center;cursor:pointer;
  transition:all .15s;background:var(--bg);margin-top:8px;display:block;
}
.attach-zone:hover,.attach-zone.drag-over{border-color:var(--navy2);background:var(--blue-bg);}
.attach-zone input[type=file]{display:none;}
/* ══════════════════════════════════════════════════════════════════
   2-LEVEL ACCORDION SIDEBAR
   ══════════════════════════════════════════════════════════════════ */

/* Sidebar scrollable when expanded */
.sidebar:not([data-pinned="true"]):hover,
.sidebar[data-pinned="true"] {
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar:not([data-pinned="true"]):hover::-webkit-scrollbar,
.sidebar[data-pinned="true"]::-webkit-scrollbar { width: 3px; }
.sidebar:not([data-pinned="true"]):hover::-webkit-scrollbar-thumb,
.sidebar[data-pinned="true"]::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 2px; }

/* Level-1 group header */
.sidebar-l1 {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 0 8px 8px 0;
  margin-bottom: 1px;
}
.sidebar-l1:hover { background: rgba(255,255,255,.07); }
.sidebar-l1.open {
  background: rgba(26,163,224,.12);
  border-left-color: rgba(26,163,224,.5);
}
.sidebar-l1 .si-icon { color: rgba(255,255,255,.55); transition: color .15s; }
.sidebar-l1:hover .si-icon, .sidebar-l1.open .si-icon { color: rgba(255,255,255,.9); }
.sidebar-l1 .si-icon svg { color: inherit !important; }
.sidebar-l1 .si-label {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.55);
  letter-spacing: .4px;
  text-transform: uppercase;
  transition: color .15s;
}
.sidebar-l1:hover .si-label, .sidebar-l1.open .si-label { color: rgba(255,255,255,.9); }

/* Chevron */
.si-chevron {
  margin-left: auto;
  font-size: 9px;
  color: rgba(255,255,255,.3);
  transition: transform .22s, opacity .18s;
  opacity: 0;
  flex-shrink: 0;
}
.sidebar:not([data-pinned="true"]):hover .si-chevron,
.sidebar[data-pinned="true"] .si-chevron { opacity: 1; }
.sidebar-l1.open .si-chevron { transform: rotate(180deg); color: rgba(26,163,224,.8); }

/* Level-2 group container */
.sidebar-l2-group {
  width: 100%;
  overflow: hidden;
  max-height: 0;
  transition: max-height .28s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
  background: rgba(0,0,0,.15);
}
.sidebar-l2-group.open { max-height: 800px; }

/* Hide L2 content in collapsed mode */
.sidebar:not([data-pinned="true"]):not(:hover) .sidebar-l2-group {
  max-height: 0 !important;
  transition: none;
}

/* Level-2 item */
.sidebar-l2-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 38px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .12s;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-l2-item:hover { background: rgba(255,255,255,.06); }
.sidebar-l2-item.active {
  border-left-color: var(--ci-cyan);
  background: rgba(26,163,224,.15);
}
.sidebar-l2-item .si-icon { font-size: 14px; color: rgba(255,255,255,.45); transition: color .12s; }
.sidebar-l2-item .si-icon svg { color: inherit !important; }
.sidebar-l2-item:hover .si-icon { color: rgba(255,255,255,.85); }
.sidebar-l2-item.active .si-icon { color: #1AA3E0; }
.sidebar-l2-item .si-label { font-size: 11px; color: rgba(255,255,255,.55); font-weight: 500; transition: color .12s; }
.sidebar-l2-item:hover .si-label { color: rgba(255,255,255,.9); }
.sidebar-l2-item.active .si-label { color: #6ECBF0; font-weight: 600; }

/* Collapsed: L1 icon only — show the open group's first L2 icon as indicator */
.sidebar:not([data-pinned="true"]):not(:hover) .sidebar-l1.open {
  border-left-color: rgba(26,163,224,.6);
  background: rgba(26,163,224,.12);
}

/* ── Org Chart Styles ── */
.org-ctx-item {
  padding: 7px 14px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.org-ctx-item:hover { background: rgba(255,255,255,.06); }
.org-ctx-danger { color: var(--red); }
.org-ctx-danger:hover { background: var(--red-bg); }
.org-ctx-sep { height: 1px; background: var(--border); margin: 4px 0; }

.org-task-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  width: 100%;
  transition: border-color .15s, background .15s;
}
.org-task-input:hover { border-color: var(--border); background: var(--bg); }
.org-task-input:focus {
  outline: none;
  border-color: var(--navy2);
  background: var(--bg);
  box-shadow: 0 0 0 2px rgba(26,163,224,.15);
}

/* Light theme overrides for org chart */
[data-theme="light"] .org-ctx-item { color: var(--text); }
[data-theme="light"] .org-ctx-item:hover { background: rgba(0,0,0,.04); }
[data-theme="light"] .org-task-input:hover { background: var(--bg); }
[data-theme="light"] .org-task-input:focus { background: var(--bg); }

/* ══════════════════════════════════════════════════════════════════════
   SCENARIO GRID
   ══════════════════════════════════════════════════════════════════════ */
.scn-grid {
  --scn-fs: 11px;
  width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--scn-fs);
  font-family: 'Noto Sans KR', sans-serif;
}
.scn-grid thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--navy2, #1a2744);
  color: #c8d7f0;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 6px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.scn-grid tbody td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  font-size: inherit;
  color: var(--text);
  vertical-align: top;
  transition: background .15s;
}
.scn-grid tbody td[contenteditable="true"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  background: rgba(26,163,224,.06);
}
.scn-grid tbody td[contenteditable="true"]:hover {
  background: rgba(255,255,255,.02);
}

/* Row types */
.scn-hdr td {
  font-weight: 700 !important;
  border-top: 2px solid var(--border) !important;
  background: rgba(30,58,95,.15) !important;
}
.scn-go td {
  background: rgba(239,68,68,.1) !important;
  font-weight: 700 !important;
  border-top: 2px solid #ef4444 !important;
  border-bottom: 2px solid #ef4444 !important;
}
.scn-sep td {
  background: rgba(100,116,139,.08) !important;
  font-style: italic;
  color: var(--text3);
}
.scn-done td {
  opacity: .6;
  text-decoration: line-through;
}
.scn-done td:first-child,
.scn-done td input[type="checkbox"] {
  text-decoration: none;
  opacity: 1;
}

/* Detail row (sub-steps within a task) */
.scn-detail td {
  padding-left: 20px;
  font-size: calc(var(--scn-fs, 11px) - 1px);
  color: var(--text2);
}

/* Day separator — sticky below thead */
.scn-day-sep td {
  position: sticky;
  z-index: 15;
}

/* Category badge */
.scn-cat-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: .5px;
}

/* Log cell */
.scn-log {
  font-family: 'Space Mono', 'Noto Sans KR', monospace;
  color: #22c55e !important;
}
.scn-log:empty::before {
  content: '클릭';
  color: var(--text3);
  opacity: .3;
  font-style: italic;
  font-family: 'Noto Sans KR', sans-serif;
}

/* Context menu items */
.scn-ctx-item {
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text);
  transition: background .12s;
}
.scn-ctx-item:hover {
  background: rgba(26,163,224,.12);
}
.scn-ctx-danger {
  color: var(--red) !important;
}
.scn-ctx-danger:hover {
  background: rgba(239,68,68,.12);
}

/* Controller cards */
.scn-ctrl-card [contenteditable]:focus {
  background: rgba(26,163,224,.06);
  border-radius: 3px;
}

/* 7-segment clock area */
#scn-world-clock svg,
#scn-countdown svg {
  filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 8px currentColor);
}

/* Light theme */
/* ── Sheet tabs (시나리오 시트 탭) ── */
.scn-sheet-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 16px 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  position: relative;
  bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}
.scn-sheet-tab:hover {
  background: rgba(26,163,224,.06);
  color: var(--text2);
}
.scn-sheet-tab.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
  border-color: var(--border);
  border-bottom: 2px solid var(--surface);
  z-index: 1;
}
.scn-sheet-tab .scn-sheet-name {
  outline: none;
  min-width: 20px;
}
.scn-sheet-tab .scn-sheet-name[contenteditable="true"] {
  border-bottom: 1px dashed var(--primary);
  background: rgba(26,163,224,.06);
  padding: 0 2px;
  border-radius: 2px;
}

[data-theme="light"] .scn-grid thead th { background: #EBF0F7; color: #03428E; }
[data-theme="light"] .scn-hdr td { background: rgba(30,58,95,.06) !important; }
[data-theme="light"] .scn-log { color: #16a34a !important; }
[data-theme="light"] #scn-clock-bar { background: #000000 !important; }
[data-theme="light"] .scn-sheet-tab.active { background: #fff; border-bottom-color: #fff; }

/* ── 출근관리 차트 드래그 선택 ── */
td.att-cell.att-selected { outline: 2px solid #3b82f6 !important; outline-offset: -2px; }
td.att-cell:hover { filter: brightness(1.15); }
#att-bulk-toolbar { animation: att-toolbar-in .2s ease; }
@keyframes att-toolbar-in { from { opacity:0; transform: translateX(-50%) translateY(12px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }

/* ══════════════════════════════════════════════════════════════════
   모바일 강화 — 좁은 화면에서 헤더/콘텐츠 컴팩트화
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 상단 2단 구조: 1단(로고/D-day/사용자) + 2단(프로젝트 선택기) */
  :root { --nav-h: 78px; }
  .topbar {
    padding: 4px 6px 0 6px !important;
    gap: 4px !important;
    height: var(--nav-h) !important;
    min-height: var(--nav-h);
    flex-wrap: wrap !important;
    transition: height .28s ease, min-height .28s ease, padding .28s ease;
    overflow: hidden;
  }
  /* 콘텐츠 영역도 같이 위로 슬라이드 */
  .layout {
    transition: margin-top .28s ease, height .28s ease;
  }

  /* 로고 매우 컴팩트 */
  .topbar .logo-group { gap: 0; flex-shrink: 0; order: 1; }
  .topbar .logo-group img:first-of-type {
    width: auto !important;
    height: 10px !important;
  }
  .topbar .logo-group img:last-of-type {
    height: 9px !important;
  }
  .topbar .logo-divider { display: none; }

  /* 우측 칩(1단 우측) */
  .topbar-right { order: 2; gap: 4px !important; flex-shrink: 0; margin-left: auto; }

  /* 프로젝트 선택기 — 2단으로 (전체 폭 차지) */
  #project-selector {
    order: 3;
    flex-basis: 100%;
    gap: 6px;
    padding: 4px 0;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,.08);
    justify-content: flex-start;
    overflow: hidden;
    max-height: 40px;
    opacity: 1;
    transition: max-height .25s ease, opacity .2s ease, margin-top .25s ease, padding .25s ease, border-color .25s ease;
  }
  #project-selector span { display: inline !important; font-size: 10px !important; color: rgba(255,255,255,.5); }
  .project-select-input {
    font-size: 12px !important;
    padding: 4px 22px 4px 10px !important;
    max-width: none !important;
    flex: 1;
    height: 26px !important;
    line-height: 1.2 !important;
  }
  .project-status-dot { width: 6px !important; height: 6px !important; }

  /* 스크롤 다운 시: --nav-h 자체를 줄여서 topbar + layout 모두 위로 올림 */
  body.proj-collapsed { --nav-h: 42px !important; }
  body.proj-collapsed .topbar {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  body.proj-collapsed #project-selector {
    max-height: 0 !important;
    opacity: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    border-top-color: transparent !important;
  }

  /* 우측 칩 컴팩트 — 사용자 이름은 모바일에서 숨김 */
  .topbar-right { gap: 6px !important; flex-shrink: 0; align-items: center; }
  .d-day-chip { font-size: 10px !important; padding: 2px 7px !important; font-weight: 600; }
  /* 테마 토글은 모바일에서 숨김 (디자인 비율이 안 맞고 D-day와 충돌) */
  .theme-toggle { display: none !important; }
  .user-chip { padding: 2px 5px !important; font-size: 10px; align-items: center; }
  .user-chip #user-display { display: none !important; }
  .logout-btn { font-size: 12px !important; padding: 2px 5px !important; }

  /* 페이지 본문 패딩 축소 */
  .main { padding: 8px !important; }
  .page-fixed-header { padding: 6px 10px !important; }
  .page-title { font-size: 15px !important; }
  .page-meta { font-size: 10px !important; line-height: 1.3; }

  /* 탭바 컴팩트 */
  .topbar-tabs { padding: 0 4px; }
  .topbar-tab {
    font-size: 11px !important;
    padding: 4px 8px !important;
    min-height: 26px;
  }

  /* 가젯 헤더 */
  .gadget-header {
    padding: 3px 6px !important;
    min-height: 28px;
    font-size: 11px;
  }
  .gadget-header > * { font-size: 10px !important; }
  .gadget-title { font-size: 11px !important; }

  /* 드로어 폼 입력 */
  .form-input, .form-select {
    font-size: 13px;
    padding: 7px 10px;
  }
  .form-label { font-size: 11px; }

  /* 버튼 컴팩트 */
  .btn-primary, .btn-ghost, .btn-secondary {
    font-size: 12px;
    padding: 6px 10px;
  }
  .btn-sm { font-size: 11px !important; padding: 4px 8px !important; }
}

/* 초소형 화면 (iPhone SE, 작은 안드로이드 등) */
@media (max-width: 380px) {
  .topbar { gap: 3px !important; padding: 4px 4px 0 4px !important; min-height: 70px; }
  .topbar .logo-group img:first-of-type { display: none; }   /* INNOSPACE 로고 숨김 */
  .project-select-input { max-width: none !important; font-size: 11px !important; }
  .d-day-chip { display: inline-flex !important; font-size: 9px !important; padding: 1px 5px !important; }
  .user-chip { padding: 1px 3px !important; }
  /* theme-toggle은 768px 이하에서 이미 hidden */
}
