/* ============================================================
 * common.css — 업무지원 시스템 공통 스타일
 * 전면 재작성 (2026-06)
 * 기존 2,756줄 → 정리·통합·중복 제거
 * ============================================================ */

/* 한글 글꼴은 글자 범위별로 잘게 나뉜 버전(dynamic subset)을 쓴다. 통짜 버전은 굵기마다 800KB 가까이 받아야 했는데,
   이 버전은 화면에 실제로 나온 글자 묶음만 받는다. 버전을 고정해 CDN 캐시를 오래 쓰게 한다. */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.css");

/* ─────────────────────────────────────────────────────────────
 * 1. 디자인 토큰
 * ───────────────────────────────────────────────────────────── */
:root {
  /* 색상 — 브랜드 */
  --navy:          #0b1630;
  --navy-soft:     #13203f;
  --navy-muted:    #1e3260;
  --blue:          #2f6df6;
  --blue-soft:     #eaf1ff;
  --blue-mid:      #dbeafe;

  /* 색상 — 배경 */
  --bg:            #f0f2f5;
  --surface:       #ffffff;
  --surface-soft:  #f8fafc;
  --surface-hover: #f4f7fb;

  /* 색상 — 텍스트 */
  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #9ca3af;
  --text-disabled:  #d1d5db;

  /* 색상 — 테두리 */
  --border:        #e5e7eb;
  --border-soft:   #f3f4f6;
  --border-input:  #d1d5db;
  --border-focus:  #2f6df6;

  /* 색상 — 시맨틱 */
  --success-bg:    #f0fdf4;
  --success-text:  #166534;
  --success-border:#bbf7d0;

  --warning-bg:    #fffbeb;
  --warning-text:  #92400e;
  --warning-border:#fde68a;

  --info-bg:       #eff6ff;
  --info-text:     #1e40af;
  --info-border:   #bfdbfe;

  --danger-bg:     #fef2f2;
  --danger-text:   #991b1b;
  --danger-border: #fecaca;

  /* 색상 — 상태 뱃지 */
  --status-inuse-bg:      #f0fdf4;
  --status-inuse-text:    #166534;
  --status-inuse-border:  #bbf7d0;

  --status-repair-bg:     #fff7ed;
  --status-repair-text:   #9a3412;
  --status-repair-border: #fed7aa;

  --status-inspect-bg:    #eff6ff;
  --status-inspect-text:  #1e40af;
  --status-inspect-border:#bfdbfe;

  --status-stored-bg:     #f9fafb;
  --status-stored-text:   #374151;
  --status-stored-border: #e5e7eb;

  --status-disposed-bg:   #fef2f2;
  --status-disposed-text: #991b1b;
  --status-disposed-border:#fecaca;

  /* 반경 */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-2xl:8px;

  /* 그림자 */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-modal:0 20px 60px rgba(0,0,0,0.16), 0 8px 16px rgba(0,0,0,0.06);

  /* 타이포 */
  --font-base: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-base: 13px;
  --fs-md:   14px;
  --fs-lg:   15px;
  --fs-xl:   16px;
  --fs-2xl:  18px;
  --fs-3xl:  20px;
  --fs-4xl:  24px;

  /* 간격 */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;

  /* 레이아웃 */
  --container-max: 1280px;
  --content-pad:   24px;

  /* 트랜지션 */
  --transition: 0.15s ease;
}

/* ─────────────────────────────────────────────────────────────
 * 2. 리셋 & 베이스
 * ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }


/* 한글이 단어 중간에서 줄바꿈되지 않게(예: "스/캔본") 띄어쓰기 단위로 줄을 바꾼다.
   띄어쓰기 없이 아주 긴 문자열(주소, 파일명 등)은 칸을 넘치지 않게 필요할 때만 끊는다. */
html { word-break: keep-all; overflow-wrap: break-word; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-base);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }

/* ─────────────────────────────────────────────────────────────
 * 3. 레이아웃
 * ───────────────────────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.page-shell {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--content-pad) var(--sp-8);
}

.grid   { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.full-col { grid-column: 1 / -1; }
.two-col  { grid-column: span 2; }
.is-hidden { display: none !important; }

/* ─────────────────────────────────────────────────────────────
 * 4. 카드
 * ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.card-body {
  padding: var(--sp-5);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

/* ─────────────────────────────────────────────────────────────
 * 5. 타이포그래피
 * ───────────────────────────────────────────────────────────── */
.page-title {
  font-size: var(--fs-4xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.page-desc,
.sub-text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.55;
}

.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.required     { color: #dc2626; }

/* ─────────────────────────────────────────────────────────────
 * 6. 버튼
 * ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-input);
  background: var(--surface);
  color: var(--text-primary);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: #b0b8c4;
}

.btn:active { transform: scale(0.98); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn i { font-size: 15px; }

/* 버튼 변형 */
.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-primary:hover {
  background: var(--navy-soft);
  border-color: var(--navy-soft);
  color: #fff;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}
.btn-warning:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

.btn-blue {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-blue:hover {
  background: #2460e0;
  border-color: #2460e0;
  color: #fff;
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.btn-success {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text-primary);
  border-color: transparent;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 42px;
  padding: 0 20px;
  font-size: var(--fs-md);
}

.btn-card-action {
  height: 30px;
  padding: 0 10px;
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────────────────────────
 * 7. 폼 요소
 * ───────────────────────────────────────────────────────────── */

/* 공통 인풋/셀렉트 기반 */
.input,
.form-input,
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="search"],
select.input,
textarea.input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.input:hover,
.form-input:hover,
.form-control:hover,
.form-select:hover {
  border-color: #9ca3af;
}

.input:focus,
.form-input:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

.input::placeholder,
.form-input::placeholder { color: var(--text-muted); }

/* select 화살표 */
select.input,
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

/* textarea */
textarea.input,
.textarea {
  height: auto;
  min-height: 80px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.55;
}

/* 작은 인풋 */
.input-sm,
.input--sm {
  height: 28px;
  padding: 0 8px;
  font-size: var(--fs-sm);
}

/* 커스텀 날짜 입력 (연/월/일 3분할) — mountCustomDateInput()(assets/js/core/utils.js)이 만드는 마크업 */
.cdate-wrap {
  display: inline-flex;
  width: auto;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
  cursor: text;
  box-sizing: border-box;
}
.cdate-wrap.cdate-disabled {
  background: var(--surface-soft, #f8fafc);
  cursor: not-allowed;
}
/* [추가 수정] mountCustomDateInput()이 만드는 span은 항상 class="input cdate-wrap ..."로
   생성되는데(계약서/양식 등 .input 폼필드 옆에 나란히 놓일 때 34px로 높이를 맞추기 위한
   의도적인 설계다), 검색창 상단의 조회기간 필터바(sh-actionbar 등)에서는 원래 옆에 있던
   검색어 입력칸이 28px(일부는 30px)라서 날짜 박스만 유독 커 보이는 문제가 있었다.
   이 앱 전체에서 "조회기간 필터바" 성격의 컨테이너 클래스는 아래 목록으로 전부 28px(또는
   30px) 표준을 쓰고 있어서, 그 안에 들어간 .cdate-wrap만 표준 높이로 다시 맞춰준다. */
.sh-actionbar .cdate-wrap,
.afr-actionbar .cdate-wrap,
.m-actionbar .cdate-wrap,
.pr-actionbar .cdate-wrap,
.po-actionbar .cdate-wrap,
.m-filter-bar .cdate-wrap,
.task-search-bar .cdate-wrap {
  height: 28px !important;
}
.lp-filter .cdate-wrap { height: 32px !important; }
.us-toolbar .cdate-wrap,
.us-entry-head .cdate-wrap {
  height: 30px !important;
}
/* [주의] common.css 위쪽의 "input[type=text] {...}" 같은 전역 규칙은 element+attribute 선택자라
   특정도가 (0,1,1)이라, 클래스 선택자 하나짜리(.cdate-seg, 특정도 (0,1,0))로는 순서와 무관하게
   못 이긴다. 반드시 .cdate-wrap을 앞에 붙인 후손 선택자((0,2,0))로 특정도를 더 높여서 덮어쓴다.
   [추가 수정] sh-actionbar(검색바) 안에 이 컴포넌트를 넣은 화면에서는
   ".sh-actionbar input[type=text]"가 element+class+attribute로 특정도 (0,2,1)이라, 위의 (0,2,0)
   규칙보다 더 세서 flex:1/min-width:0이 그대로 적용되어 연/월/일 칸이 1글자 폭으로 짜부라지는
   문제가 있었다(예: "2026-08-21"이 "2-0-2"처럼 보임). flex/width/min-width에 !important를 붙여서
   어떤 페이지의 후속 CSS가 끼어들어도 항상 이 컴포넌트가 의도한 크기를 유지하도록 했다. */
/* [추가 수정] 텍스트(연/월/일 숫자)와 달력 아이콘(.cdate-cal-btn, 16px 정사각 박스)이
   align-items:center로만 맞춰져 있으면, <input>의 브라우저 기본 줄높이가 아이콘 박스 높이(16px)와
   달라서 육안으로 살짝 위/아래로 어긋나 보인다. line-height/height를 아이콘과 정확히 같은
   16px으로 맞춰서 숫자와 아이콘의 세로 중심이 픽셀 단위로 일치하도록 했다. */
.cdate-wrap .cdate-seg {
  width: auto !important;
  height: 16px !important;
  line-height: 16px !important;
  min-width: 0 !important;
  border: none !important;
  outline: none !important;
  background: transparent;
  padding: 0 !important;
  font-size: inherit !important;
  color: inherit;
  font-family: inherit;
  text-align: center;
  flex: 0 0 auto !important;
}
.cdate-wrap .cdate-seg::placeholder { color: var(--text-muted); }
/* [수정 2026-11] 연·월·일 칸 사이 간격과 마지막 칸~달력 아이콘 간격이 서로 달라 보이던 문제.
   예전에는 연도 칸(3.2em)과 월·일 칸(2em) 안에서 숫자 양옆 빈 공간이 칸마다 달라 "-" 양쪽 간격이
   들쭉날쭉했고, 넓은 칸에서는 아이콘만 오른쪽 끝으로 밀려 있었다.
   - 숫자 폭을 고르게(tabular-nums) 하고, 각 칸 = 글자 수 + 양옆 같은 여유(0.35ch)로 잡아 간격을 통일
   - 내용은 왼쪽부터 붙이고, 달력 아이콘은 항상 오른쪽 끝(좁은 칸에서는 일 칸과 5px 띄움)
   - 빈 칸 안내는 브라우저 기본 날짜칸과 같은 "연도-월-일"(글자 폭이 고르게 보임) */
.cdate-wrap .cdate-seg { font-variant-numeric: tabular-nums; }
.cdate-wrap .cdate-y { width: 4.7ch !important; }
.cdate-wrap .cdate-m,
.cdate-wrap .cdate-d { width: 2.7ch !important; }
.cdate-wrap { gap: 0 !important; padding: 0 9px 0 7px !important; justify-content: flex-start; }
.cdate-wrap .cdate-sep { margin: 0 2px; }
.cdate-wrap .cdate-d { margin-right: 5px !important; }
.cdate-wrap .cdate-cal-btn { margin-left: auto; }

/* 달력 팝업 아이콘 — 세그먼트들 오른쪽 끝에 붙는 작은 버튼. 실제 값 반영에는 관여하지 않고
   숨겨둔 .cdate-picker-proxy(type=date)의 showPicker()만 트리거한다. */
.cdate-wrap .cdate-cal-btn {
  flex: 0 0 auto; margin-left: auto; padding: 0; width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--text-muted, #9ca3af);
  cursor: pointer; border-radius: 3px;
}
/* [추가 수정] line-height/height를 숫자 칸과 똑같이 16px로 맞춰도 육안으로는 여전히 어긋나
   보인다는 피드백이 있었다 — 헤드리스 브라우저로 실제 렌더링된 픽셀을 측정해보니, 두 박스의
   CSS 높이는 정확히 일치하지만(둘 다 세로 중심 y=82px) 숫자 글리프의 잉크 중심은 그 중심보다
   위로, 아이콘 폰트 글리프의 잉크 중심은 그 중심보다 아래로 치우쳐 있어서(서로 다른 폰트의
   내부 여백 차이) 실제로는 약 1.2~1.3px 어긋나 보였다. transform으로 그 차이만큼 아이콘을
   위로 보정해서 두 잉크 중심이 같은 줄에 놓이도록 했다. */
.cdate-wrap .cdate-cal-btn i { font-size: 13px; display: inline-block; transform: translateY(-1.3px); }
.cdate-wrap .cdate-cal-btn:hover { color: var(--text-secondary, #374151); background: var(--surface-soft, #f1f5f9); }
.cdate-wrap .cdate-cal-btn:disabled { cursor: not-allowed; opacity: .4; pointer-events: none; }
.cdate-wrap .cdate-picker-proxy {
  position: absolute; width: 0; height: 0; padding: 0; margin: 0; border: none; opacity: 0; pointer-events: none;
}
.cdate-sep { color: #9ca3af; flex-shrink: 0; line-height: 16px; }

/* form-field: 라벨 + 인풋 세트 */
.form-field,
.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label,
.field-group label,
.form-field label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-help {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

/* form-group: 여러 form-field 묶음 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
}

.form-grid {
  display: grid;
  gap: var(--sp-3);
}

/* form-section: 폼 내 섹션 구분 */
.form-section {
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-soft);
}
.form-section:first-child { padding-top: 0; border-top: none; }

.form-section-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-3);
}

/* form-actions: 폼 하단 버튼 영역 */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-soft);
  margin-top: var(--sp-4);
}

/* 에러 상태 */
.is-invalid .input,
.is-invalid .form-input,
.is-field-error .input {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10);
}

.field-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--blue);
}

.form-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.form-tab.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ─────────────────────────────────────────────────────────────
 * 8. 테이블
 * ───────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  font-size: var(--fs-base);
}

.data-table th,
.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: var(--surface-soft); }

.data-table .th-center,
.data-table td.center { text-align: center; }

.data-table .th-right,
.data-table td.right { text-align: right; }

/* ─────────────────────────────────────────────────────────────
 * 9. 뱃지 & 상태
 * ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
  background: var(--surface-soft);
  color: var(--text-secondary);
  border-color: var(--border);
}

.badge-blue   { background: var(--info-bg);    color: var(--info-text);    border-color: var(--info-border); }
.badge-green  { background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.badge-yellow { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-border); }
.badge-red    { background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger-border); }
.badge-navy   { background: var(--navy);       color: #fff;                border-color: var(--navy); }

/* 상태 뱃지 (장비) */
.status-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-badge.is-in-use {
  background: var(--status-inuse-bg);
  color: var(--status-inuse-text);
  border-color: var(--status-inuse-border);
}
.status-badge.is-repairing {
  background: var(--status-repair-bg);
  color: var(--status-repair-text);
  border-color: var(--status-repair-border);
}
.status-badge.is-inspecting {
  background: var(--status-inspect-bg);
  color: var(--status-inspect-text);
  border-color: var(--status-inspect-border);
}
.status-badge.is-stored {
  background: var(--status-stored-bg);
  color: var(--status-stored-text);
  border-color: var(--status-stored-border);
}
.status-badge.is-disposed {
  background: var(--status-disposed-bg);
  color: var(--status-disposed-text);
  border-color: var(--status-disposed-border);
}

/* 태그 */
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ─────────────────────────────────────────────────────────────
 * 10. 메시지 & 알림
 * ───────────────────────────────────────────────────────────── */
.message-box {
  display: none;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  line-height: 1.5;
  border: 1px solid transparent;
  margin-bottom: var(--sp-4);
}

.message-box.info    { display: block; background: var(--info-bg);    color: var(--info-text);    border-color: var(--info-border); }
.message-box.success { display: block; background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.message-box.error   { display: block; background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger-border); }
.message-box.warning { display: block; background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-border); }

/* ─────────────────────────────────────────────────────────────
 * 11. 빈 상태
 * ───────────────────────────────────────────────────────────── */
.empty-state,
.empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: var(--sp-6);
  text-align: center;
  border: 1px dashed var(--border-input);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  color: var(--text-muted);
}

.empty-state i { font-size: 32px; margin-bottom: var(--sp-3); }

.empty-state-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
}

.empty-state-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────
 * 12. KPI 카드
 * ───────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: var(--sp-3);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-4);
}

.kpi-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: var(--sp-2);
}

.kpi-value {
  font-size: var(--fs-4xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* ─────────────────────────────────────────────────────────────
 * 13. 페이지 헤더 (기존 topbar — Shell SPA에서는 숨겨짐)
 * ───────────────────────────────────────────────────────────── */
.top-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 14px var(--sp-5);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.top-brand-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.top-brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #22c55e, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}

.top-brand-texts {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.top-brand-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.top-brand-sub {
  font-size: var(--fs-md);
  color: var(--text-secondary);
}

.top-brand-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* portal-page 공통 topbar */
.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.portal-top-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
  flex-wrap: wrap;
}

.portal-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-input);
  background: var(--surface);
  color: var(--text-primary);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  text-decoration: none;
}

.portal-header-btn:hover {
  background: var(--surface-hover);
  border-color: #9ca3af;
}

.portal-header-btn--primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.portal-header-btn--primary:hover {
  background: var(--navy-soft);
  border-color: var(--navy-soft);
  color: #fff;
}

.portal-header-btn--secondary {
  background: var(--surface);
  color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────────
 * 14. 포털 레이아웃
 * ───────────────────────────────────────────────────────────── */
.portal-section       { margin-top: var(--sp-6); }
.portal-section-kicker {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}
.portal-section-title { font-size: var(--fs-3xl); font-weight: 700; }
.portal-section-desc  { font-size: var(--fs-base); color: var(--text-secondary); margin-top: 4px; }

.portal-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.portal-group-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}

/* 포털 앱 그리드 */
.portal-app-grid,
.portal-app-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: var(--sp-3);
}

.portal-app-card-compact {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.portal-app-card-compact:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.portal-app-card-compact--muted { opacity: 0.5; }
.portal-app-card-compact--disabled { cursor: not-allowed; opacity: 0.4; }

.portal-app-card-compact__icon {
  font-size: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.portal-app-card-compact__title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.portal-app-card-compact__fav {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  transition: color var(--transition);
  line-height: 1;
  flex-shrink: 0;
}
.portal-app-card-compact__fav:hover { color: #f59e0b; }
.portal-app-card-compact__fav--active { color: #f59e0b; }

.portal-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
}

.portal-intro {
  display: grid;
  grid-template-columns: minmax(0,1.4fr) minmax(260px,380px);
  gap: var(--sp-4);
  align-items: stretch;
  margin-top: var(--sp-5);
}

.portal-intro-main,
.portal-profile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: var(--sp-5);
}

.portal-profile-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.portal-profile-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.portal-user-name { font-size: var(--fs-2xl); font-weight: 700; color: var(--text-primary); }
.portal-user-sub  { font-size: var(--fs-base); color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }
.portal-user-box  { margin-left: auto; text-align: right; }

/* portal-page-compact (기존 호환) */
.portal-page-compact .portal-top-actions-compact {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.portal-page-compact .portal-header-userline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  white-space: nowrap;
}
.portal-page-compact .portal-header-username { color: var(--text-primary); font-weight: 700; }
.portal-page-compact .portal-header-usersep  { color: var(--border-input); }
.portal-page-compact .portal-section-head--compact {
  margin-bottom: var(--sp-4);
}
.portal-page-compact .portal-section-head--compact > div {
  position: relative;
  padding-left: 14px;
}
.portal-page-compact .portal-section-head--compact > div::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 4px;
  background: var(--blue);
}
.portal-page-compact .portal-section-head--compact .portal-section-title {
  font-size: var(--fs-4xl);
  letter-spacing: -0.02em;
}

/* ─────────────────────────────────────────────────────────────
 * 15. 검색 / 필터 영역
 * ───────────────────────────────────────────────────────────── */
.search-bar,
.search-main-row {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.search-keyword-wrap   { flex: 1 1 180px; min-width: 0; }
.search-keyword-group  { flex: 1 1 180px; min-width: 0; }
.search-select         { min-width: 100px; }
.search-date-input     { width: 140px; }
.search-range-sep      { font-size: var(--fs-sm); color: var(--text-muted); padding-bottom: 7px; }
.search-reset-btn      { flex-shrink: 0; }
.search-result-head    { margin-top: var(--sp-3); }

/* 필터 칩 */
.filter-chip {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-input);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-chip:hover { background: var(--surface-hover); border-color: #9ca3af; }
.filter-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.search-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.search-filter-block { margin-top: var(--sp-4); }
.search-action-block {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--border);
}
.search-block-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
  display: block;
}

/* 필터 액션 영역 */
.filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}
.filter-actions-left,
.filter-actions-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ─────────────────────────────────────────────────────────────
 * 16. 페이지네이션
 * ───────────────────────────────────────────────────────────── */
.pagination-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-5) 0; /* margin-top만 있으면 버튼 위쪽엔 여백이 생기지만 아래쪽은
                             카드 바닥 테두리에 그대로 붙어버린다 — 위아래 대칭으로 패딩을 준다 */
  flex-wrap: wrap;
  min-height: 72px; /* 비어있어도(1페이지뿐이라 버튼이 없을 때도) 항상 이 높이를 차지해야
                        그리드 컨테이너의 가용 높이가 페이지 수와 무관하게 일정해진다.
                        (안 그러면 조회 결과가 여러 페이지로 늘어나는 순간 그리드 박스가
                        갑자기 줄어들면서 이미 계산된 pageSize와 어긋나 스크롤/컬럼폭 문제가 생김) */
  box-sizing: border-box;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.pagination-btn:hover { background: var(--surface-hover); }
.pagination-btn.is-active {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info-text);
}
.pagination-btn:disabled { opacity: 0.4; cursor: default; }

/* ─────────────────────────────────────────────────────────────
 * 17. 모달
 * ───────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.modal-container {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  line-height: 1;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface-soft); color: var(--text-primary); }

.modal-body {
  padding: var(--sp-5);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
  flex-shrink: 0;
}

.modal-footer .btn { min-width: 80px; }

.modal-feedback {
  display: none;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  margin-bottom: var(--sp-3);
}
.modal-feedback.is-success { display: block; background: var(--success-bg); color: var(--success-text); border-color: var(--success-border); }
.modal-feedback.is-error   { display: block; background: var(--danger-bg);  color: var(--danger-text);  border-color: var(--danger-border); }

/* ─────────────────────────────────────────────────────────────
 * 18. 스켈레톤
 * ───────────────────────────────────────────────────────────── */
.skeleton,
.sk {
  position: relative;
  overflow: hidden;
  background: #e9ecef;
  border-radius: var(--radius-sm);
}
.skeleton::after,
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  animation: skeleton-sweep 1.4s ease infinite;
}
@keyframes skeleton-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.sk-text-sm { height: 12px; margin-bottom: 6px; border-radius: var(--radius-xs); }
.sk-badge   { height: 20px; width: 60px; border-radius: var(--radius-sm); }

/* ─────────────────────────────────────────────────────────────
 * 19. 글로벌 로딩
 * ───────────────────────────────────────────────────────────── */
#globalLoading {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
#globalLoading.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}
#globalLoading .global-loading__dialog {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-8);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-modal);
  min-width: 260px;
  text-align: center;
}
/* 진행률 표시 — JS(utils.js)가 .global-loading__bar를 만들어 끼워 넣는다. 기존 스피너 마크업은 숨김.
 * 윈도우 11 진행 막대 느낌: 가는 회색 선(바탕) 위로 둥근 파란 막대가 차오른다. 장식 애니메이션 없음.
 * 구성: [문구 ........ 퍼센트] / [막대]. 숫자는 퍼센트 하나만 보인다. */
#globalLoading { background: rgba(0, 0, 0, 0.20); backdrop-filter: none; }
#globalLoading .global-loading__spinner { display: none; }
#globalLoading .global-loading__dialog {
  align-items: stretch;
  text-align: left;
  width: 380px;
  max-width: calc(100vw - 40px);
  gap: 0;
  padding: 18px 20px 20px;
  background: #fbfbfb;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
}
/* JS가 막대를 만들기 전(스크립트 로드 전)에도 빈 팝업이 보이지 않도록 하는 임시 선 */
#globalLoading .global-loading__dialog:not(:has(.global-loading__bar))::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 16px;
  background: #8a8a8a;
}
#globalLoading .global-loading__bar { display: flex; flex-direction: column; gap: 14px; width: 100%; }
#globalLoading .global-loading__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
#globalLoading .global-loading__text {
  font-size: 14px;
  font-weight: 600;
  color: #1b1b1b;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#globalLoading .global-loading__pct {
  flex: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: #5f5f5f;
  font-variant-numeric: tabular-nums;
  min-width: 3em;
  text-align: right;
}
#globalLoading .global-loading__pct small { font-size: inherit; font-weight: inherit; margin-left: 1px; }
/* 바탕: 가운데 1px 회색 선 */
#globalLoading .global-loading__track {
  position: relative;
  height: 4px;
  background: linear-gradient(#8a8a8a, #8a8a8a) center / 100% 1px no-repeat;
  overflow: visible;
}
/* 채움: 둥근 파란 막대(윈도우 11 강조색) */
#globalLoading .global-loading__fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: #005fb8;
  transition: width 0.3s cubic-bezier(.2,.8,.3,1);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────────
 * 20. 인포 타일 / 가이드
 * ───────────────────────────────────────────────────────────── */
.info-tile {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
}
.info-tile-wide { grid-column: 1 / -1; }
.info-tile-label { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 4px; }
.info-tile-value { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); word-break: break-word; }

.guide-item {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
}
.guide-title { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.guide-text  { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.55; }

/* ─────────────────────────────────────────────────────────────
 * 21. 장비 라벨 프린트
 * ───────────────────────────────────────────────────────────── */
.device-label {
  width: 440px;
  min-height: 270px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  display: grid;
  grid-template-columns: minmax(0,1fr) 152px;
  gap: var(--sp-4);
  align-items: center;
}
.label-hospital { font-size: var(--fs-md); font-weight: 700; color: var(--navy); margin-bottom: var(--sp-2); }
.label-title    { font-size: var(--fs-4xl); font-weight: 700; color: var(--text-primary); margin-bottom: var(--sp-3); word-break: break-word; }
.label-info-block { display: flex; flex-direction: column; gap: var(--sp-2); }
.label-row      { display: grid; grid-template-columns: 72px 1fr; gap: var(--sp-2); align-items: start; }
.label-key      { font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); }
.label-value    { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); word-break: break-word; }
.label-qr-box   {
  width: 144px; min-height: 144px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-2);
}

/* ─────────────────────────────────────────────────────────────
 * 22. 어드민 레이아웃
 * ───────────────────────────────────────────────────────────── */
.admin-page-wrap,
.logs-page {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

/* ─────────────────────────────────────────────────────────────
 * 23. 페이지 히어로 (헤더 영역)
 * ───────────────────────────────────────────────────────────── */
.page-hero-simple {
  margin-bottom: var(--sp-5);
}

/* ─────────────────────────────────────────────────────────────
 * 24. 요약 카드 (summary-pill)
 * ───────────────────────────────────────────────────────────── */
.summary-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}
.summary-pill-label { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: var(--sp-1); display: block; }
.summary-pill-value { font-size: var(--fs-4xl); font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }

/* ─────────────────────────────────────────────────────────────
 * 25. 컨텍스트 칩
 * ───────────────────────────────────────────────────────────── */
.list-context-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--info-bg);
  color: var(--info-text);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
}
.list-context-chip.is-hidden { display: none; }

/* ─────────────────────────────────────────────────────────────
 * 26. 공지 모달 (portal)
 * ───────────────────────────────────────────────────────────── */
.notice-modal__close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.notice-modal__close:hover { background: var(--surface-soft); }

.notice-modal__dismiss {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.portal-notice-row__close {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

/* ─────────────────────────────────────────────────────────────
 * 27. 모바일 반응형
 * ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  :root {
    --content-pad: 16px;
  }

  .page-shell {
    padding: var(--sp-4) var(--sp-4) var(--sp-6);
  }

  /* topbar */
  .top-brand-bar {
    display: block;
    padding: var(--sp-4);
    border-radius: var(--radius-xl);
    margin-bottom: var(--sp-4);
  }
  .top-brand-left  { width: 100%; }
  .top-brand-title { font-size: var(--fs-xl); }
  .top-brand-sub   { display: block; margin-top: 4px; font-size: var(--fs-sm); white-space: normal; }
  .top-brand-actions,
  .portal-top-actions {
    width: 100%;
    margin-top: var(--sp-3);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
    margin-left: 0;
  }
  .top-brand-actions.top-actions--cols-1,
  .portal-top-actions.top-actions--cols-1 { grid-template-columns: 1fr; }
  .top-brand-actions.top-actions--cols-3,
  .portal-top-actions.top-actions--cols-3 { grid-template-columns: repeat(3, 1fr); }

  .portal-header-btn {
    width: 100%;
    justify-content: center;
    height: 40px;
  }

  /* 그리드 */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col { grid-column: auto; }

  /* 포털 */
  .portal-intro { grid-template-columns: 1fr; }
  .portal-app-grid,
  .portal-app-grid-compact { grid-template-columns: 1fr; }

  /* 페이지 compact topbar */
  .portal-page-compact .portal-top-actions-compact {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
  }
  .portal-page-compact .portal-header-userline {
    grid-column: 1 / -1;
    justify-content: center;
    height: 40px;
  }

  /* 모달 */
  .modal-container { max-width: 100%; max-height: 95vh; }
  .modal-footer    { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  /* form-row */
  .form-row { grid-template-columns: 1fr; }
}

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

/* ─────────────────────────────────────────────────────────────
 * 28. Shell SPA 내부 iframe 페이지 스타일
 * (URL에 ?shell=1 파라미터가 있을 때 JS로 body.in-shell 클래스 추가)
 * ───────────────────────────────────────────────────────────── */

/* topbar 숨김 */
body.in-shell .top-brand-bar,
body.in-shell .portal-topbar,
body.in-shell .portal-page > .container > .top-brand-bar {
  display: none !important;
}

/* container 상단 패딩 축소 */
body.in-shell .container,
body.in-shell .page-shell {
  padding-top: var(--sp-4);
}

/* page-shell 최대폭 해제 (iframe이 너비를 관리) */
body.in-shell .page-shell,
body.in-shell .admin-page-wrap,
body.in-shell .logs-page {
  max-width: none;
}

/* 스크롤 허용 */
body.in-shell {
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────────
 * 29. 하위 호환 변수 별칭
 * 기존 페이지별 CSS가 참조하는 구 변수명 → 새 토큰으로 매핑
 * common.css 교체 시 페이지별 CSS를 수정하지 않아도 되게 함
 * ───────────────────────────────────────────────────────────── */
:root {
  /* 테두리 */
  --border-card:   #e5e7eb;
  --border-dashed: #d1d5db;

  /* 그림자 */
  --shadow-card:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);

  /* 블루 계열 */
  --blue-50:   #eaf1ff;

  /* 통계 페이지 전용 */
  --blue-50:   #eaf1ff;
}

/* ════════════════════════════════════════════
   m-modal — 공통 모달 컴포넌트
════════════════════════════════════════════ */
.m-modal {
  display: none; position: fixed; inset: 0; z-index: 500;
  align-items: center; justify-content: center;
}
.m-modal.is-open { display: flex; }
.m-modal-backdrop { position: absolute; inset: 0; background: rgba(11,22,48,0.45); }
.m-modal-dialog {
  position: relative; z-index: 1; background: #fff; border-radius: 6px;
  max-width: calc(100vw - 32px); max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.16); border: 1px solid #e5e7eb; overflow: hidden;
}
/* width는 각 페이지 인라인 style로 지정 */
.m-modal .m-modal-dialog--wide { width: calc(100vw - 48px); max-width: 1200px; height: calc(100vh - 80px); }
.m-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #0b1630; flex-shrink: 0;
}
.m-modal-title { font-size: 13px; font-weight: 700; color: #fff; }
.m-modal-close {
  width: 24px; height: 24px; border: none; background: rgba(255,255,255,0.08);
  border-radius: 4px; color: rgba(255,255,255,0.6); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.m-modal-close:hover { background: rgba(255,255,255,0.15); color: #fff; }
.m-modal-body {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.m-modal-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 6px;
  padding: 8px 14px 10px; border-top: 1px solid #f3f4f6; background: #f8fafc; flex-shrink: 0;
}
/* signage/history.html, program-request/history.html — 상태 처리 버튼(제작접수/반려 등)을
   모달 footer의 "닫기" 버튼과 같은 줄에 배치할 때 쓰는 감싸는 div.
   [수정] display:flex인 채로 두면 이 div 자체가 m-modal-foot의 flex 아이템이 되면서
   버튼 높이가 똑같아도(28px) "닫기"와 미묘하게 다른 줄로 보이는 경우가 있었다(중첩된 flex
   컨테이너 2개의 정렬 계산이 서로 어긋남). display:contents로 이 div 자체를 레이아웃에서
   지워버려 안의 버튼들이 m-modal-foot의 "직계" flex 아이템이 되게 하면 닫기 버튼과 완전히
   동일한 정렬 기준을 쓰게 되어 어긋날 수가 없다. */
.sh-status-actions { display: contents; }
.m-field { display: flex; flex-direction: column; gap: 4px; }
.m-field label { font-size: 11px; font-weight: 600; color: #4b5563; }
.m-field input, .m-field select {
  height: 32px; border: 1px solid #d1d5db; border-radius: 4px;
  padding: 0 8px; font-size: 12px; outline: none; transition: border-color 0.15s;
  background: #fff;
}
.m-field input:focus, .m-field select:focus { border-color: #3b82f6; }
.m-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-req { color: #ef4444; }
.m-empty { padding: 32px; text-align: center; font-size: 12px; color: #9ca3af; }
/* ══════════════════════════════════════════════════════════════
   목록 화면 공통 카드 (lp-*) — 2026-11 액션바 정리 (안 2-C)
   카드 하나 안에: [상태 탭 또는 제목 | 실행 버튼] / [검색 조건 한 줄] / [표]
   - 기존 화면의 버튼·입력 id와 JS 훅(.active 클래스 등)은 그대로 두고 감싸는 구조만 바꾼다
   ══════════════════════════════════════════════════════════════ */
div.lp-page, form.lp-page {
  display: flex; flex-direction: column; height: 100vh; gap: 0;
  padding: 12px 16px 14px; box-sizing: border-box; overflow: hidden;
}
/* 탭 화면 안에 들어간 카드: 화면 틀 대신 남는 높이를 채운다 */
.lp-card.lp-fill { flex: 1; min-height: 0; }
.lp-card {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
/* 1줄: 상태 탭(또는 제목) + 오른쪽 실행 버튼 */
.lp-top {
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px;
  border-bottom: 1px solid #e5e7eb; flex-shrink: 0;
}
.lp-title { font-size: 14px; font-weight: 800; color: #111827; white-space: nowrap; }
.lp-tabs { display: flex; align-items: stretch; align-self: stretch; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.lp-tabs::-webkit-scrollbar { display: none; }
.lp-tabs > button {
  height: auto; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; color: #6b7280; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: none; transition: color 0.15s, border-color 0.15s;
}
.lp-tabs > button:hover { color: #111827; background: none; border-color: transparent; border-bottom-color: #cbd5e1; }
.lp-tabs > button.active { color: #0b1630; border-bottom-color: #0b1630; font-weight: 800; background: none; }
.lp-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lp-actions .btn, .lp-filter .btn { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 6px; }
.lp-actions .btn i, .lp-filter .btn i { font-size: 14px; }
.lp-sep { width: 1px; height: 20px; background: #e5e7eb; flex-shrink: 0; }
/* 2줄: 검색 조건 (버튼은 조회·초기화만) */
.lp-filter {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb; flex-shrink: 0;
}
.lp-filter > select, .lp-filter > input[type=text], .lp-filter > input[type=date], .lp-filter .cdate-wrap {
  height: 32px !important; border: 1px solid #d1d5db; border-radius: 6px; font-size: 12.5px; color: #374151;
  background-color: #fff; outline: none; box-sizing: border-box; flex-shrink: 0;
}
.lp-filter > select {
  padding: 0 28px 0 10px; max-width: 160px; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.lp-filter > input[type=text] { flex: 1; min-width: 160px; padding: 0 12px; }
.lp-filter > input[type=date] { width: 140px; padding: 0 10px; }
.lp-filter > select:focus, .lp-filter > input:focus { border-color: #2563eb; }
.lp-filter .lp-tilde { font-size: 12px; color: #9ca3af; flex-shrink: 0; }
/* 장비·위원회·규정 등 equipment-list.css 계열 검색 조건을 카드 안에서 같은 크기로 */
.lp-filter.eq-filter-form, form.lp-filter { flex: none; }
.lp-filter .eq-filter-select { flex: none; height: 32px; max-width: 160px; min-width: 0; padding: 0 28px 0 10px;
  border: 1px solid #d1d5db; border-radius: 6px; background-color: #fff; font-size: 12.5px; background-position: right 10px center; }
.lp-filter .eq-filter-keyword { flex: 1; min-width: 200px; }
.lp-filter .eq-filter-input { height: 32px !important; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; font-size: 12.5px !important; }
.lp-tabs .cnt { margin-left: 5px; }
/* 3줄: 표 */
.lp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.lp-body > .m-table-wrap, .lp-body > .lp-grid { flex: 1; min-height: 0; height: auto; }
@media (max-width: 1100px) {
  .lp-filter { flex-wrap: wrap; }
  .lp-filter > input[type=text] { flex-basis: 100%; order: 10; }
}
/* 카드 안의 표는 카드 테두리를 쓰므로 표 자체 테두리는 없앤다 */
.lp-body .ag-root-wrapper { border: 0 !important; border-radius: 0 !important; }
/* 검색 조건 아래 보조 줄: 안내 문구 + 선택한 항목에 대한 일괄 작업 */
.lp-sub {
  display: flex; align-items: center; gap: 8px; padding: 8px 16px; min-height: 50px; box-sizing: border-box;
  border-bottom: 1px solid #eef0f3; background: #fafbfc; font-size: 12px; color: #4b5563; flex-shrink: 0;
}
.lp-sub .btn { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 6px; }
.lp-sub .mt-hint-inline, .lp-sub #mtSum:empty + .mt-hint { border-left: 0 !important; padding-left: 0 !important; margin-left: 0 !important; }

/* ── 구조를 카드로 바꾸지 않은 화면(상세·신청·탭 안 화면 등)의 액션바도 같은 여백으로 맞춘다 ──
   각 화면이 자기 <style>에서 정의한 바(높이 44px, 위아래 7~8px, 좌우 12px)를 body 접두로 덮어써서
   위아래 10px, 좌우 16px, 버튼·입력 32px로 통일한다. */
body :is(.m-actionbar, .afr-actionbar, .sh-actionbar, .pr-actionbar, .eq-filter-bar, .m-filter-bar,
         .ap-actionbar, .det-actionbar, .us-actionbar, .task-search-bar) {
  height: auto; min-height: 54px; padding: 10px 16px; gap: 8px; box-sizing: border-box; border-radius: 10px;
}
body :is(.m-actionbar, .afr-actionbar, .sh-actionbar, .pr-actionbar, .eq-filter-bar, .m-filter-bar,
         .ap-actionbar, .det-actionbar, .us-actionbar, .task-search-bar)
  :is(.btn, select, input[type=text], input[type=date], input[type=search], input:not([type]), .cdate-wrap, .eq-filter-input) {
  height: 32px !important; box-sizing: border-box;
}
body :is(.m-actionbar, .afr-actionbar, .sh-actionbar, .pr-actionbar, .eq-filter-bar, .m-filter-bar,
         .ap-actionbar, .det-actionbar, .us-actionbar, .task-search-bar) .btn { padding: 0 13px; font-size: 12.5px; border-radius: 6px; }
body .m-card-head { min-height: 54px; padding: 10px 16px; box-sizing: border-box; }
body .m-card-head .btn { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 6px; }
body .m-card { border-radius: 10px; }
/* 카드 머리 안에 들어간 작은 필터(설정 > 부서·사용자 등)는 바 여백을 주지 않는다 */
body :is(.m-card-head, .panel-head, .lp-top) :is(.m-filter-bar, .sh-actionbar, .eq-filter-bar) {
  min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
}
