/* ===================================================
   건강365 (Health365) — 메인 CSS 디자인 시스템
   AMS IBP | Bootstrap 5.3.2 기반
   완전 반응형: 모바일 / 태블릿 / PC / 대형화면
   =================================================== */

/* ---------- 0. CSS 변수 ---------- */
:root {
  --h365-primary:       #1B5FAA;
  --h365-health:        #1A936F;
  --h365-teal:          #16A085;
  --h365-orange:        #E67E22;
  --h365-red:           #C0392B;
  --h365-bg:            #F0F4F8;
  --h365-sidebar-bg:    #1B3A5C;
  --h365-sidebar-hover: #234B73;
  --h365-card-bg:       #FFFFFF;
  --h365-text:          #2D3748;
  --h365-text-muted:    #6B7280;
  --h365-border:        #E2E8F0;
  --h365-shadow:        0 2px 8px rgba(0,0,0,.07);
  --h365-radius:        10px;
  --h365-gap:           14px;
  --h365-header-h:      60px;
  --h365-sidebar-w:     240px;
  --h365-touch-min:     44px;   /* 터치 최소 크기 */
}

/* ---------- 1. 기본 ---------- */
* { box-sizing: border-box; }
body {
  background: var(--h365-bg);
  font-family: 'Microsoft YaHei','Malgun Gothic','Hiragino Sans','Noto Sans JP',
               'Apple SD Gothic Neo', sans-serif;
  font-size: 16px;
  color: var(--h365-text);
  margin: 0;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--h365-primary); }

/* ---------- 2. 상단 헤더 ---------- */
.h365-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--h365-header-h);
  background: var(--h365-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.h365-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}
.h365-topbar-brand .brand-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.18);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.h365-topbar-brand .brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.h365-topbar-brand .brand-sub {
  font-size: 12px;
  opacity: 0.75;
  margin-left: 2px;
  white-space: nowrap;
}
.h365-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.h365-lang-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  min-height: var(--h365-touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.h365-lang-btn:hover {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.h365-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.9);
  font-size: 14px;
}
.h365-user-badge .user-avatar {
  width: 32px; height: 32px;
  background: var(--h365-health);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ---------- 3. 사이드바 ---------- */
.h365-sidebar {
  position: fixed;
  top: var(--h365-header-h);
  left: 0;
  width: var(--h365-sidebar-w);
  height: calc(100vh - var(--h365-header-h));
  background: var(--h365-sidebar-bg);
  overflow-y: auto;
  z-index: 900;
  padding-bottom: 20px;
  transition: transform .3s ease;
}
.h365-sidebar::-webkit-scrollbar { width: 4px; }
.h365-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

.h365-nav-group {
  padding: 16px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.45);
}
.h365-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  font-size: 15px;
  transition: all .2s;
  border-left: 3px solid transparent;
  margin: 1px 0;
  min-height: var(--h365-touch-min);
}
.h365-nav-link i {
  width: 20px;
  font-size: 15px;
  text-align: center;
  flex-shrink: 0;
}
.h365-nav-link:hover {
  background: var(--h365-sidebar-hover);
  color: #fff;
  border-left-color: var(--h365-health);
}
.h365-nav-link.active {
  background: linear-gradient(90deg, rgba(26,147,111,.35) 0%, transparent 100%);
  color: #fff;
  border-left-color: var(--h365-health);
  font-weight: 600;
}
.h365-nav-link .nav-badge {
  margin-left: auto;
  background: var(--h365-health);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
.h365-nav-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 8px 16px;
}

/* 사이드바 오버레이 (모바일) */
.h365-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 850;
  backdrop-filter: blur(2px);
}
.h365-sidebar-overlay.show { display: block; }

/* ---------- 4. 메인 콘텐츠 ---------- */
.h365-content {
  margin-left: var(--h365-sidebar-w);
  margin-top: var(--h365-header-h);
  padding: 20px;
  min-height: calc(100vh - var(--h365-header-h));
  flex: 1;
}

.h365-page-hdr { margin-bottom: 18px; }
.h365-page-hdr h4 {
  font-size: 22px;
  font-weight: 700;
  color: var(--h365-text);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.h365-page-hdr h4 i { color: var(--h365-health); }
.h365-page-hdr .page-sub {
  font-size: 14px;
  color: var(--h365-text-muted);
}
.h365-breadcrumb {
  font-size: 13px;
  color: var(--h365-text-muted);
  margin-bottom: 12px;
}
.h365-breadcrumb a { color: var(--h365-primary); text-decoration: none; }

/* ---------- 5. 그리드 ---------- */
.h365-row {
  display: flex;
  gap: var(--h365-gap);
  margin-bottom: var(--h365-gap);
}
.h365-row:last-child { margin-bottom: 0; }
.h365-col-1 { flex: 1; min-width: 0; }
.h365-col-2 { flex: 2; min-width: 0; }
.h365-col-3 { flex: 3; min-width: 0; }
.h365-col-4 { flex: 4; min-width: 0; }
.h365-col-full { width: 100%; }

/* ---------- 6. 카드 ---------- */
.h365-card {
  background: var(--h365-card-bg);
  border-radius: var(--h365-radius);
  box-shadow: var(--h365-shadow);
  overflow: hidden;
}
.h365-card-hdr {
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  border-radius: var(--h365-radius) var(--h365-radius) 0 0;
}
.h365-card-hdr i { font-size: 15px; }
.h365-card-body   { padding: 16px; }
.h365-card-body-0 { padding: 0; }

.h365-hdr-blue   { background: #1e88e5; color: #fff; }
.h365-hdr-green  { background: #1A936F; color: #fff; }
.h365-hdr-teal   { background: #16A085; color: #fff; }
.h365-hdr-orange { background: #E67E22; color: #fff; }
.h365-hdr-red    { background: #C0392B; color: #fff; }
.h365-hdr-dark   { background: #1B3A5C; color: #fff; }
.h365-hdr-purple { background: #8E24AA; color: #fff; }
.h365-hdr-gray   { background: #546E7A; color: #fff; }

/* ---------- 7. KPI 카드 ---------- */
.h365-kpi {
  background: var(--h365-card-bg);
  border-radius: var(--h365-radius);
  box-shadow: var(--h365-shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.h365-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.h365-kpi-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.h365-kpi-icon.blue   { background: #EBF5FB; color: #1B5FAA; }
.h365-kpi-icon.green  { background: #E8F8F5; color: #1A936F; }
.h365-kpi-icon.orange { background: #FEF9E7; color: #E67E22; }
.h365-kpi-icon.red    { background: #FDEDEC; color: #C0392B; }
.h365-kpi-icon.teal   { background: #E8F8F5; color: #16A085; }
.h365-kpi-icon.purple { background: #F5EEF8; color: #8E24AA; }
.h365-kpi-info { flex: 1; min-width: 0; }
.h365-kpi-val {
  font-size: 28px;
  font-weight: 800;
  color: var(--h365-text);
  line-height: 1.1;
}
.h365-kpi-lbl {
  font-size: 13px;
  color: var(--h365-text-muted);
  margin-top: 2px;
}
.h365-kpi-trend {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  display: inline-block;
}
.h365-kpi-trend.up   { background: #E8F8F5; color: #1A936F; }
.h365-kpi-trend.down { background: #FDEDEC; color: #C0392B; }
.h365-kpi-trend.flat { background: #F4F6F7; color: #7F8C8D; }

/* ---------- 8. 테이블 ---------- */
.h365-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.h365-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 600px; /* 모바일에서 가로 스크롤 */
}
.h365-table thead tr {
  background: #F8FAFC;
  border-bottom: 2px solid var(--h365-border);
}
.h365-table th {
  padding: 10px 12px;
  font-weight: 600;
  color: var(--h365-text-muted);
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.h365-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #F0F4F8;
  vertical-align: middle;
  color: var(--h365-text);
}
.h365-table tbody tr:hover { background: #F8FAFC; }
.h365-table tbody tr:last-child td { border-bottom: none; }
.h365-table .col-code { font-weight: 700; color: #C0392B; font-size: 13px; }

/* ---------- 9. 배지 ---------- */
.h365-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.h365-badge-normal  { background: #E8F8F5; color: #1A936F; border: 1px solid #D4EFDF; }
.h365-badge-warning,
.h365-badge-warn    { background: #FEF9E7; color: #D68910; border: 1px solid #FAE5A0; }
.h365-badge-danger  { background: #FDEDEC; color: #C0392B; border: 1px solid #F5B7B1; }
.h365-badge-info    { background: #EBF5FB; color: #1B5FAA; border: 1px solid #AED6F1; }
.h365-badge-gray    { background: #F4F6F7; color: #6B7280; border: 1px solid #E2E8F0; }
.h365-badge-oriental{ background: #FDF2E9; color: #784212; border: 1px solid #F0B27A; }

/* ---------- 10. 통계 배지 ---------- */
.h365-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ---------- 11. 폼 ---------- */
.h365-form label {
  font-size: 14px;
  font-weight: 600;
  color: var(--h365-text-muted);
  margin-bottom: 5px;
  display: block;
}
.h365-form .form-control,
.h365-form .form-select {
  font-size: 15px;
  border: 1.5px solid var(--h365-border);
  border-radius: 7px;
  padding: 10px 12px;
  transition: border-color .2s, box-shadow .2s;
  color: var(--h365-text);
  width: 100%;
  min-height: var(--h365-touch-min);
}
.h365-form .form-control:focus,
.h365-form .form-select:focus {
  border-color: var(--h365-health);
  box-shadow: 0 0 0 3px rgba(26,147,111,.12);
  outline: none;
}
.h365-form .form-text {
  font-size: 13px;
  color: var(--h365-text-muted);
}
.required-mark { color: #C0392B; margin-left: 2px; }

/* ---------- 12. 버튼 ---------- */
.btn-h365-primary {
  background: var(--h365-health);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--h365-touch-min);
  text-decoration: none;
  white-space: nowrap;
}
.btn-h365-primary:hover {
  background: #148A68;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,147,111,.3);
}
.btn-h365-secondary {
  background: #F4F6F7;
  color: var(--h365-text);
  border: 1.5px solid var(--h365-border);
  padding: 10px 20px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--h365-touch-min);
  text-decoration: none;
  white-space: nowrap;
}
.btn-h365-secondary:hover {
  background: #E8ECEF;
  color: var(--h365-text);
}
.btn-h365-oriental {
  background: linear-gradient(135deg, #784212, #B7770D);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--h365-touch-min);
  white-space: nowrap;
}
.btn-h365-oriental:hover { opacity: .9; transform: translateY(-1px); color: #fff; }

/* ---------- 13. 업로드 ---------- */
.h365-upload-zone {
  border: 2.5px dashed #CBD5E0;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  transition: all .2s;
  cursor: pointer;
  background: #FAFCFF;
}
.h365-upload-zone:hover,
.h365-upload-zone.drag-over { border-color: var(--h365-health); background: #F0FDF9; }
.h365-upload-zone .upload-icon { font-size: 48px; color: #CBD5E0; margin-bottom: 12px; display: block; }
.h365-upload-zone:hover .upload-icon { color: var(--h365-health); }
.h365-upload-zone .upload-title { font-size: 15px; font-weight: 600; color: var(--h365-text); margin-bottom: 6px; }
.h365-upload-zone .upload-sub { font-size: 12px; color: var(--h365-text-muted); }

/* ---------- 14. 카메라 뷰 ---------- */
.h365-camera-view {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.h365-camera-view video,
.h365-camera-view canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.h365-camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  color: #fff;
}
.h365-camera-guide {
  width: 70%;
  aspect-ratio: 1;
  border: 2.5px solid rgba(26,147,111,.8);
  border-radius: 50%;
  position: absolute;
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(26,147,111,.6); }
  70%  { box-shadow: 0 0 0 15px rgba(26,147,111,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,147,111,0); }
}

/* ---------- 15. 맥박 ---------- */
.h365-pulse-display {
  background: linear-gradient(135deg, #1B3A5C, #1A936F);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.h365-pulse-display::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,.05) 0%, transparent 60%);
  animation: pulse-bg 3s ease-in-out infinite;
}
@keyframes pulse-bg {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.1); opacity: 1; }
}
.h365-pulse-num { font-size: 64px; font-weight: 900; line-height: 1; position: relative; }
.h365-pulse-unit { font-size: 18px; opacity: .8; }
.h365-pulse-label { font-size: 13px; opacity: .7; margin-top: 6px; }
.h365-pulse-status {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  background: rgba(255,255,255,.2);
}
.h365-ecg-line { height: 60px; width: 100%; overflow: hidden; margin: 12px 0; }
.h365-ecg-svg { animation: ecg-scroll 2s linear infinite; }
@keyframes ecg-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ---------- 16. 결과 카드 ---------- */
.h365-result-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--h365-shadow);
  overflow: hidden;
}
.h365-result-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #1A936F, #16A085);
  color: #fff;
}
.h365-result-header .result-title { font-size: 16px; font-weight: 700; }
.h365-result-header .result-date  { font-size: 12px; opacity: .8; margin-top: 2px; }
.h365-result-body { padding: 20px; }
.h365-item-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #F0F4F8;
  gap: 10px;
  flex-wrap: wrap;
}
.h365-item-row:last-child { border-bottom: none; }
.h365-item-name { width: 130px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--h365-text); }
.h365-item-val  { font-size: 14px; font-weight: 700; min-width: 70px; text-align: right; }
.h365-item-val.normal  { color: #1A936F; }
.h365-item-val.warning { color: #D68910; }
.h365-item-val.danger  { color: #C0392B; }
.h365-item-bar { flex: 1; min-width: 60px; height: 8px; background: #F0F4F8; border-radius: 4px; overflow: hidden; }
.h365-item-bar-fill { height: 100%; border-radius: 4px; transition: width .8s ease; }
.h365-item-bar-fill.normal  { background: linear-gradient(90deg, #1A936F, #2ECC71); }
.h365-item-bar-fill.warning { background: linear-gradient(90deg, #E67E22, #F0B429); }
.h365-item-bar-fill.danger  { background: linear-gradient(90deg, #C0392B, #E74C3C); }
.h365-item-ref { font-size: 11px; color: var(--h365-text-muted); min-width: 90px; text-align: right; }

/* 오행 */
.h365-ohang { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.h365-ohang-item {
  flex: 1;
  min-width: 70px;
  text-align: center;
  padding: 14px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.h365-ohang-item .oh-symbol { font-size: 24px; margin-bottom: 4px; }
.h365-ohang-item .oh-name   { font-weight: 700; font-size: 13px; }
.h365-ohang-item .oh-score  { font-size: 11px; opacity: .8; }
.oh-wood  { background: #EAF5EA; color: #1E8449; }
.oh-fire  { background: #FDEDEC; color: #C0392B; }
.oh-earth { background: #FEF9E7; color: #9A7D0A; }
.oh-metal { background: #F2F3F4; color: #566573; }
.oh-water { background: #EBF5FB; color: #1B5FAA; }

/* ---------- 17. 페이지네이션 ---------- */
.h365-pagination { display: flex; justify-content: center; gap: 4px; padding: 16px; flex-wrap: wrap; }
.h365-page-btn {
  width: 36px; height: 36px;
  border: 1.5px solid var(--h365-border);
  background: #fff;
  border-radius: 7px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  color: var(--h365-text);
}
.h365-page-btn:hover { border-color: var(--h365-health); color: var(--h365-health); }
.h365-page-btn.active { background: var(--h365-health); border-color: var(--h365-health); color: #fff; font-weight: 700; }

/* ---------- 18. 빈 상태 ---------- */
.h365-empty { text-align: center; padding: 48px 20px; color: var(--h365-text-muted); }
.h365-empty i { font-size: 48px; opacity: .3; display: block; margin-bottom: 12px; }
.h365-empty p { font-size: 15px; margin: 0; }

/* ---------- 19. 로딩 ---------- */
.h365-analyzing { text-align: center; padding: 40px; }
.h365-analyzing .spin-icon {
  font-size: 40px; color: var(--h365-health);
  animation: spin 1.5s linear infinite;
  display: block; margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.h365-analyzing .analyzing-text { font-size: 16px; font-weight: 600; color: var(--h365-text); }
.h365-analyzing .analyzing-sub  { font-size: 13px; color: var(--h365-text-muted); margin-top: 4px; }
.h365-progress-bar {
  height: 6px; background: var(--h365-border);
  border-radius: 3px; overflow: hidden; margin-top: 16px;
}
.h365-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--h365-health), var(--h365-teal));
  border-radius: 3px;
  animation: progress-wave 2s ease-in-out infinite;
}
@keyframes progress-wave {
  0%   { width: 10%; }
  50%  { width: 80%; }
  100% { width: 10%; }
}

/* ---------- 20. 상태 도트 ---------- */
.h365-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.h365-status-dot.online  { background: #1A936F; animation: blink 2s infinite; }
.h365-status-dot.offline { background: #C0392B; }
.h365-status-dot.warn    { background: #E67E22; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ---------- 21. 모달 ---------- */
.modal-content { border: none; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.modal-header  { border-bottom: 1px solid #F0F4F8; padding: 16px 20px; }
.modal-title   { font-size: 15px; font-weight: 700; }
.modal-footer  { border-top: 1px solid #F0F4F8; padding: 12px 20px; }

/* ---------- 22. 토스트 ---------- */
.h365-toast-container { position: fixed; top: 70px; right: 20px; z-index: 9999; }
.h365-toast {
  background: #fff; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 12px 16px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; min-width: 260px; max-width: 90vw;
  animation: slideIn .3s ease;
  border-left: 4px solid var(--h365-health);
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- 23. 유틸리티 ---------- */
.text-health   { color: var(--h365-health)  !important; }
.text-primary  { color: var(--h365-primary) !important; }
.bg-health     { background: var(--h365-health) !important; }
.border-health { border-color: var(--h365-health) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-11  { font-size: 11px !important; }
.fs-12  { font-size: 12px !important; }
.fs-13  { font-size: 13px !important; }
.fs-14  { font-size: 14px !important; }
.gap-8  { gap: 8px !important; }
.gap-14 { gap: 14px !important; }
.flex-1 { flex: 1; }


/* ====================================================
   ★★★ 반응형 (Responsive) — 완전 구현
   PC(1200+) / 태블릿가로(992~1199) / 태블릿세로(768~991)
   모바일가로(576~767) / 모바일세로(~575)
   ==================================================== */

/* ── 태블릿 가로 (992px ~ 1199px) ── */
@media (max-width: 1199px) {
  :root {
    --h365-sidebar-w: 210px;
  }
  .h365-kpi-val { font-size: 22px; }
  .h365-topbar-brand .brand-sub { display: none; }
}

/* ── 태블릿 세로 (768px ~ 991px) ── */
@media (max-width: 991px) {
  :root {
    --h365-sidebar-w: 200px;
    --h365-gap: 12px;
  }
  /* KPI 4개 → 2×2 */
  .h365-row.kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .h365-row.kpi-row .h365-col-1 {
    flex: none;
    width: 100%;
  }
  /* 3컬럼 → 2컬럼 */
  .h365-row.cols-3 {
    flex-wrap: wrap;
  }
  .h365-row.cols-3 .h365-col-1 {
    flex: 0 0 calc(50% - 6px);
  }
  .h365-content { padding: 16px; }
  .h365-page-hdr h4 { font-size: 18px; }
}

/* ── 모바일 (~ 767px) — 사이드바 오버레이 방식 ── */
@media (max-width: 767px) {
  :root {
    --h365-gap: 10px;
  }

  body {
    font-size: 14px;
  }

  /* 사이드바: 숨김 → 햄버거 토글 */
  .h365-sidebar {
    transform: translateX(-100%);
    width: 260px;
    z-index: 1050;
  }
  .h365-sidebar.open {
    transform: translateX(0);
  }

  /* 콘텐츠: 사이드바 여백 제거 */
  .h365-content {
    margin-left: 0;
    padding: 12px;
  }

  /* 모든 row → 세로 스택 */
  .h365-row,
  .h365-row.kpi-row,
  .h365-row.cols-3 {
    flex-direction: column;
    display: flex;
  }
  .h365-col-1, .h365-col-2, .h365-col-3, .h365-col-4 {
    flex: none !important;
    width: 100% !important;
  }
  .h365-row.kpi-row {
    display: flex;
    flex-direction: column;
  }

  /* KPI 수치 */
  .h365-kpi-val { font-size: 24px; }
  .h365-kpi     { padding: 14px; }

  /* 페이지 헤더 */
  .h365-page-hdr h4 { font-size: 17px; }
  .h365-page-hdr .page-sub { font-size: 12px; }

  /* 테이블: 가로 스크롤 */
  .h365-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .h365-table { min-width: 500px; }

  /* 헤더 우측: 사용자명 숨김 */
  .h365-user-badge span { display: none; }
  .h365-topbar-brand .brand-name { font-size: 16px; }

  /* 언어버튼: 이모지만 표시 */
  .h365-lang-btn { padding: 5px 8px; font-size: 15px; }

  /* 폼 버튼: 전체 너비 */
  .h365-form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .h365-form-actions .btn-h365-primary,
  .h365-form-actions .btn-h365-secondary {
    width: 100%;
    justify-content: center;
  }

  /* 맥박 수치 */
  .h365-pulse-num { font-size: 52px; }

  /* 토스트 */
  .h365-toast-container { right: 10px; left: 10px; }
  .h365-toast { min-width: auto; }

  /* 오행 차트: 3개씩 */
  .h365-ohang-item { min-width: 60px; }

  /* 카드 헤더 */
  .h365-card-hdr { font-size: 13px; height: auto; min-height: 42px; padding: 8px 14px; }
}

/* ── 소형 모바일 (~ 575px) ── */
@media (max-width: 575px) {
  .h365-topbar { padding: 0 12px; }
  .h365-topbar-brand .brand-sub { display: none; }
  .h365-topbar-brand .brand-name { font-size: 15px; }

  .h365-content { padding: 10px; }
  :root { --h365-gap: 8px; }

  /* KPI 가로 2개 배치 (모바일에서도 2열 유지) */
  .h365-row.kpi-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .h365-row.kpi-row .h365-col-1 {
    width: auto !important;
  }
  .h365-kpi { padding: 12px; gap: 10px; }
  .h365-kpi-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
  .h365-kpi-val  { font-size: 20px; }
  .h365-kpi-lbl  { font-size: 11px; }
  .h365-kpi-trend { font-size: 10px; }

  /* 페이지 제목 */
  .h365-page-hdr h4 { font-size: 15px; }
  .h365-page-hdr .page-sub { display: none; }

  /* 테이블 */
  .h365-table { font-size: 12px; }
  .h365-table th, .h365-table td { padding: 8px 10px; }

  /* 업로드 영역 */
  .h365-upload-zone { padding: 24px 16px; }
  .h365-upload-zone .upload-icon { font-size: 36px; }

  /* 맥박 */
  .h365-pulse-num { font-size: 44px; }
  .h365-pulse-display { padding: 20px; }

  /* 카드 바디 */
  .h365-card-body { padding: 12px; }

  /* 버튼 */
  .btn-h365-primary,
  .btn-h365-secondary,
  .btn-h365-oriental { padding: 9px 16px; font-size: 13px; }
}

/* ── 프린트 ---------- */
@media print {
  .h365-topbar, .h365-sidebar, .h365-sidebar-overlay { display: none !important; }
  .h365-content { margin: 0 !important; padding: 0 !important; }
  .h365-card { box-shadow: none !important; border: 1px solid #ddd; }
}
