/* NARAN — 공식 인스타그램 톤 (올리브 그린 + 크림 베이지) */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  /* 공식 BI 컬러 */
  --bg: #f9f8f4;             /* IVORY (Pantone) */
  --bg-soft: #f3f0e7;
  --surface: #ffffff;
  --surface-soft: #fbfaf5;
  --ink: #2d3520;            /* 진한 올리브 텍스트 */
  --ink-soft: #5a6b48;
  --ink-mute: #9ba48d;
  --line: #e6e3d6;
  --line-soft: #efece1;

  /* NARAN 공식 GREEN — Pantone 576C #789c4c */
  --naran-green: #789c4c;    /* 메인 (BI 공식) */
  --naran-green-dark: #5d7a36;
  --naran-green-mid: #95b66b;
  --naran-green-light: #bdd098;
  --naran-green-pale: #e1ead0;

  --accent: var(--naran-green);
  --accent-dark: var(--naran-green-dark);
  --danger: #c47878;

  --radius: 6px;              /* 큰 컨테이너 */
  --radius-sm: 4px;           /* 작은 요소 */
  --radius-block: 5px;        /* 퍼즐 블록 (로고 굴곡 기준) */
  --shadow: 0 1px 3px rgba(46,58,31,0.04), 0 6px 24px rgba(120,156,76,0.08);
  /* 퍼즐 블록 그림자: 종이가 겹친 듯한 다중 레이어 */
  --shadow-block:
    3px 3px 0 var(--naran-green-pale),
    6px 6px 0 var(--surface-soft),
    0 8px 24px rgba(120,156,76,0.10);
  --shadow-block-hover:
    4px 4px 0 var(--naran-green-light),
    8px 8px 0 var(--naran-green-pale),
    0 12px 32px rgba(120,156,76,0.18);
}

/* 퍼즐 블록 배경 패턴 (옅게) */
.app::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, var(--naran-green-pale) 0%, transparent 1.2%),
    radial-gradient(circle at 70% 60%, var(--naran-green-pale) 0%, transparent 1.2%),
    radial-gradient(circle at 85% 15%, var(--naran-green-pale) 0%, transparent 1.0%);
  background-size: 240px 240px, 320px 320px, 200px 200px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.app > * { position: relative; z-index: 1; }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

a { color: var(--naran-green-dark); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.7; }

/* ===== NARAN SVG 로고 ===== */
.naran-logo-svg {
  display: inline-block;
  vertical-align: middle;
}

/* ===== LOGIN ===== */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--naran-green-light) 0%, transparent 70%);
  top: -150px; right: -150px;
  filter: blur(60px);
  opacity: 0.55;
}
.login-wrap::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--naran-green-pale) 0%, transparent 70%);
  bottom: -120px; left: -120px;
  filter: blur(60px);
  opacity: 0.7;
}
.login-box {
  position: relative;
  background: var(--surface);
  padding: 56px 44px 44px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: 400px;
  border: 1px solid var(--line-soft);
}
.login-box .logo-wrap {
  text-align: center;
  margin-bottom: 8px;
}
.login-box h1 {
  margin: 18px 0 0;
  font-size: 30px;
  letter-spacing: 8px;
  font-weight: 300;
  color: var(--naran-green-dark);
  text-align: center;
}
.login-box h1::after {
  content: '';
  display: block;
  width: 32px; height: 1px;
  background: var(--naran-green-mid);
  margin: 18px auto 0;
}
.login-box .subtitle {
  color: var(--ink-mute);
  margin: 16px 0 36px;
  font-size: 11px;
  text-align: center;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 500;
}
.login-box label {
  display: block;
  font-size: 10.5px;
  color: var(--ink-mute);
  margin-bottom: 8px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
}
.login-box input {
  width: 100%;
  padding: 13px 0;
  border: none;
  border-bottom: 1.5px solid var(--line);
  font-size: 14px;
  margin-bottom: 24px;
  background: transparent;
  transition: border-color 0.2s;
  font-family: inherit;
  color: var(--ink);
}
.login-box input:focus {
  outline: none;
  border-bottom-color: var(--naran-green);
}
.login-box button {
  width: 100%;
  padding: 15px;
  background: var(--naran-green);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  font-family: inherit;
}
.login-box button:hover {
  background: var(--naran-green-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(127,168,79,0.25);
}
.flash {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.flash.danger { background: #fef0ee; color: var(--danger); }
.flash.success { background: var(--naran-green-pale); color: var(--naran-green-dark); }

/* ===== LAYOUT ===== */
.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 246px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 26px 0 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  padding: 4px 24px 24px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
}
.sidebar-logo .logo-mark-img {
  width: 150px;
  height: 94px;       /* 1240x776 비율 고정 → layout shift 0 */
  max-width: 100%;
  display: block;
  aspect-ratio: 1240/776;
}
.sidebar-logo .logo-text {
  text-align: center;
  width: 100%;
}
.sidebar-logo .logo-text .brand {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--naran-green-dark);
  line-height: 1;
  padding-left: 6px; /* letter-spacing 보정 */
}
.sidebar-logo .logo-text .sub {
  display: block;
  font-size: 8.5px;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 3px;
  margin-top: 7px;
  text-transform: uppercase;
  padding-left: 3px;
}
/* 브랜드 태그라인 — 아트의 "마음의 퍼즐을 맞추다" */
.sidebar-logo .logo-text .tagline {
  display: block;
  font-size: 10px;
  color: var(--naran-green-mid);
  letter-spacing: 0.5px;
  margin-top: 9px;
  font-weight: 500;
}

/* 로그인 페이지 로고 */
.login-box .logo-wrap {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo-img {
  width: 200px;
  height: auto;
  display: inline-block;
}

.nav { flex: 1; padding: 0 14px; overflow-y: auto; }
.nav-section {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-mute);
  letter-spacing: 1.5px;
  padding: 14px 16px 6px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: var(--ink-soft);
  font-size: 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  transition: background 0.13s, color 0.13s;
  letter-spacing: -0.01em;
  position: relative;
}
.nav-item:hover {
  background: var(--surface-soft);
  color: var(--naran-green-dark);
  text-decoration: none;
}
/* active — 채도 높은 알약 대신 차분한 페일그린 + 좌측 퍼즐 블록 탭 */
.nav-item.active {
  background: var(--naran-green-pale);
  color: var(--naran-green-dark);
  font-weight: 600;
  box-shadow: none;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px;
  background: var(--naran-green-dark);
  border-radius: 0 2px 2px 0;
}
.nav-item .icon {
  margin-right: 12px;
  width: 18px;
  display: inline-flex;
  justify-content: center;
  font-size: 14px;
}

.sidebar-bottom {
  padding: 14px 22px 18px;
  font-size: 10.5px;
  color: var(--ink-mute);
  letter-spacing: 0.3px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
.sidebar-bottom a {
  color: var(--ink-mute);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.main {
  flex: 1;
  padding: 40px 48px;
  overflow-x: auto;
  max-width: 100%;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 22px;
  position: relative;
}
.page-header::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 60px; height: 4px;
  background: var(--naran-green);
  border-radius: 4px;
}
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 68px;
  width: 12px; height: 4px;
  background: var(--naran-green-light);
  border-radius: 4px;
}
.page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-title .icon {
  font-size: 22px;
  margin-right: 10px;
  opacity: 0.85;
}

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}
.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-block);
  padding: 22px 22px 22px 26px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  box-shadow: 3px 3px 0 var(--naran-green-pale);   /* 공통 퍼즐 오프셋 시그니처 */
  cursor: pointer;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 14px; right: 14px;
  width: 13px; height: 13px;
  background: var(--naran-green);
  border-radius: 3px;
  opacity: 0.35;
  transition: all 0.2s;
}
.stat-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--naran-green-light);
  border-color: var(--naran-green-light);
}
.stat-card:hover::before {
  opacity: 1;
  transform: rotate(45deg);
}
.stat-card .icon {
  font-size: 20px;
  margin-bottom: 14px;
  opacity: 0.75;
  display: block;
}
.stat-card .label {
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 500;
}
.stat-card .value {
  font-size: 30px;
  font-weight: 300;
  color: var(--naran-green-dark);
  letter-spacing: -0.02em;
}

.card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-block);
  padding: 26px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 3px 3px 0 var(--naran-green-pale);
}
.card::after {
  content: '';
  position: absolute;
  top: -1.5px; right: 18px; width: 28px; height: 6px;
  background: var(--naran-green);
  border-radius: 0 0 6px 6px;
}
.card h3 {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--naran-green-dark);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.card-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ===== TABLE ===== */
.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.simple-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--ink-mute);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.simple-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
.simple-table tr:last-child td { border-bottom: none; }
.simple-table tr:hover td { background: var(--surface-soft); }

/* ===== BUTTONS ===== */
.btn {
  padding: 9px 20px;
  border-radius: 5px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.15s;
  font-family: inherit;
  position: relative;
}
.btn:active { transform: translate(1px, 1px); }
.btn:hover {
  border-color: var(--naran-green);
  color: var(--naran-green-dark);
  background: var(--surface-soft);
}
.btn.primary {
  background: var(--naran-green);
  color: white;
  border-color: var(--naran-green);
}
.btn.primary:hover {
  background: var(--naran-green-dark);
  border-color: var(--naran-green-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(127,168,79,0.25);
}
.btn.danger { color: var(--danger); border-color: var(--line); }
.btn.danger:hover { background: #fef0ee; border-color: var(--danger); color: var(--danger); }

/* ===== TABULATOR ===== */
.tabulator {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-block);
  background: var(--surface);
  font-family: inherit;
  box-shadow: 3px 3px 0 var(--naran-green-pale);
}
.tabulator .tabulator-header {
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.tabulator .tabulator-col {
  background: transparent;
  border-right: 1px solid var(--line-soft);
}
.tabulator .tabulator-col-title {
  color: var(--ink-mute);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 0;
}
.tabulator-row {
  border-bottom: 1px solid var(--line-soft);
}
.tabulator-row.tabulator-row-even { background: transparent; }
.tabulator-row:hover { background: var(--surface-soft) !important; }
.tabulator-row .tabulator-cell {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ink);
  border-right: 1px solid var(--line-soft);
}
.tabulator .tabulator-footer {
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}
.tabulator .tabulator-paginator label,
.tabulator .tabulator-page {
  font-size: 12px;
  color: var(--ink-soft);
}
.tabulator .tabulator-page.active {
  background: var(--naran-green) !important;
  border-color: var(--naran-green) !important;
  color: white !important;
}

/* ===== SEARCH ===== */
.search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.search-box input,
.toolbar input[type="search"],
input[type="search"] {
  flex: 1;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 13px;
  background: var(--surface);
  font-family: inherit;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.search-box input:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--naran-green);
  box-shadow: 0 0 0 4px rgba(127,168,79,0.1);
}
.patient-card { cursor: pointer; }
.patient-detail-section { margin-top: 28px; }
.patient-detail-section h4 {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--naran-green-dark);
  margin: 20px 0 12px;
}

/* ===== CALENDAR ===== */
.fc {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  font-family: inherit !important;
}
.fc .fc-toolbar-title {
  font-size: 18px !important;
  font-weight: 400 !important;
  letter-spacing: -0.01em;
  color: var(--naran-green-dark);
}
.fc .fc-button-primary {
  background: var(--naran-green);
  border-color: var(--naran-green);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 5px;
  font-weight: 500;
}
.fc .fc-button-primary:hover,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--naran-green-dark);
  border-color: var(--naran-green-dark);
}
.fc-event {
  /* background·border 색상은 이벤트 인라인 스타일에서 옴 — 여기서 강제 안 함 */
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
}
.fc-day-today { background: var(--naran-green-pale) !important; }
.fc-col-header-cell {
  background: var(--surface-soft);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}
.toolbar input[type="search"] { width: 280px; }

.tip {
  margin-top: 16px;
  color: var(--ink-mute);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tip::before {
  content: '·';
  font-size: 20px;
  line-height: 0;
  color: var(--naran-green);
}

/* ============================================
   인수인계서 기반 9개 페이지 공통 컴포넌트
   ============================================ */

/* 페이지 헤더 + 액션 영역 */
.ph-actions { display: flex; gap: 8px; align-items: center; }
.ph-search {
  padding: 8px 12px; border: 1.5px solid var(--line);
  border-radius: 5px; font-family: inherit; font-size: 13px;
  min-width: 240px;
}
.ph-search:focus { outline: none; border-color: var(--naran-green); }

/* 카드 그리드 (vendors, voucher, supply, docs, credentials) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.kard {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-block);
  padding: 14px 16px;
  box-shadow: 3px 3px 0 var(--surface-soft);   /* 퍼즐 오프셋 블록 그림자 */
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s;
  position: relative;
}
.kard:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--naran-green-pale); border-color: var(--naran-green-light); }
.kard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.kard-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.kard-subtitle { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.kard-row { display: flex; align-items: center; gap: 6px; margin: 5px 0; font-size: 12.5px; color: var(--ink-soft); }
.kard-row .label { color: var(--ink-mute); min-width: 60px; }
.kard-row .val { color: var(--ink); flex: 1; }
.kard-actions { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.kard-btn {
  padding: 4px 10px; font-size: 11px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 4px; cursor: pointer;
  font-family: inherit; color: var(--ink-soft);
}
.kard-btn:hover { border-color: var(--naran-green); color: var(--naran-green-dark); }
.kard-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* 카드 카테고리 그룹 헤더 */
.kard-section { margin: 20px 0 10px; }
.kard-section-title {
  font-size: 12px; font-weight: 700; color: var(--naran-green-dark);
  text-transform: uppercase; letter-spacing: 1.5px;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1.5px solid var(--naran-green-pale);
  margin-bottom: 10px;
}
.kard-section-title .count { font-size: 11px; color: var(--ink-mute); font-weight: 400; }

/* 상태 뱃지 */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px;
}
.badge-NEW       { background: #eaf1dd; color: #4a6818; }
.badge-EVALUATING{ background: #fff3cd; color: #856404; }
.badge-MATCHED   { background: #c7d9ee; color: #244e85; }
.badge-SCHEDULED { background: #d4edda; color: #155724; }
.badge-CONFIRMED { background: #b1d4a8; color: #1a4814; }
.badge-COMPLETED { background: #e6e3d6; color: #6b675c; }
.badge-PENDING   { background: #fdebd0; color: #946000; }
.badge-APPROVED  { background: #c8e6c9; color: #2e7d32; }
.badge-ORDERED   { background: #b3d4fc; color: #1f4e79; }
.badge-RECEIVED  { background: #d4edda; color: #155724; }
.badge-REJECTED  { background: #f8d7da; color: #842029; }
.badge-ACTIVE    { background: #d4edda; color: #155724; }
.badge-SUSPENDED { background: #f8d7da; color: #842029; }
.badge-계약      { background: #d4edda; color: #155724; }
.badge-종료      { background: #e6e3d6; color: #6b675c; }

/* 정심바 매칭 상태 뱃지 */
.match-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 8px; margin-left: 6px; vertical-align: middle;
}
.match-name_only { background: #fff3cd; color: #856404; }
.match-ambiguous { background: #ffe0b2; color: #b00020; }
.match-unmatched { background: #cfd8dc; color: #455a64; }
.kard-title-link {
  color: inherit; text-decoration: none; font-weight: inherit;
}
.kard-title-link:hover { color: var(--naran-green-dark); text-decoration: underline; }

/* 칸반 보드 */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  min-height: 600px;
}
.kanban-col {
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 10px;
  display: flex; flex-direction: column;
  min-height: 100%;
}
.kanban-col-head {
  font-size: 11px; font-weight: 700; color: var(--ink); letter-spacing: 1px;
  padding: 6px 8px; margin-bottom: 8px;
  border-radius: 5px;
  display: flex; justify-content: space-between; align-items: center;
}
.kanban-col[data-status="NEW"] .kanban-col-head        { background: #eaf1dd; }
.kanban-col[data-status="EVALUATING"] .kanban-col-head { background: #fff3cd; }
.kanban-col[data-status="MATCHED"] .kanban-col-head    { background: #c7d9ee; }
.kanban-col[data-status="SCHEDULED"] .kanban-col-head  { background: #d4edda; }
.kanban-col[data-status="CONFIRMED"] .kanban-col-head  { background: #b1d4a8; }
.kanban-col[data-status="COMPLETED"] .kanban-col-head  { background: #e6e3d6; }
.kanban-col-cnt { background: var(--surface); padding: 1px 7px; border-radius: 8px; font-size: 11px; }
.kanban-col-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  background: var(--surface); border-radius: 6px; padding: 10px;
  border-left: 4px solid var(--naran-green);
  font-size: 12px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.kanban-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card-name { font-weight: 700; color: var(--ink); font-size: 13px; margin-bottom: 4px; }
.kanban-card-meta { font-size: 10.5px; color: var(--ink-soft); }
.kanban-card-row { margin: 2px 0; }
.kanban-card-row .lbl { color: var(--ink-mute); }

/* 진행률 바 */
.progress {
  height: 6px; background: var(--surface-soft); border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--naran-green);
  transition: width 0.3s;
}

/* D-day 뱃지 */
.dday { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.dday-urgent { background: #f8d7da; color: #842029; }
.dday-warn   { background: #fff3cd; color: #856404; }
.dday-safe   { background: #d4edda; color: #155724; }
.dday-over   { background: #6c757d; color: white; }

/* 타임라인 (contact_log) */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ''; position: absolute;
  left: 12px; top: 0; bottom: 0;
  width: 2px; background: var(--naran-green-pale);
}
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-dot {
  position: absolute; left: -24px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--naran-green); border: 3px solid var(--surface);
}
.timeline-card {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 6px; padding: 10px 14px;
}

/* 결제 정산 — 월별 그룹 + 체크박스 행 */
.recon-month {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 8px; margin-bottom: 12px; overflow: hidden;
}
.recon-month-head {
  background: var(--surface-soft); padding: 10px 14px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; cursor: pointer;
}
.recon-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px 80px 60px 60px 60px 60px 60px;
  gap: 8px; padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; align-items: center;
}
.recon-row:hover { background: var(--surface-soft); }
.recon-check {
  display: flex; justify-content: center; align-items: center;
  width: 24px; height: 24px;
}
.recon-check input { transform: scale(1.3); accent-color: var(--naran-green); cursor: pointer; }

/* 매뉴얼 — 2단 위키 */
.wiki-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; min-height: 700px; }
.wiki-side { background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 0; }
.wiki-cat { padding: 8px 14px; cursor: pointer; font-size: 12.5px; border-left: 3px solid transparent; color: var(--ink-soft); }
.wiki-cat:hover { background: var(--surface-soft); }
.wiki-cat.active { background: var(--naran-green-pale); border-left-color: var(--naran-green); color: var(--ink); font-weight: 600; }
.wiki-cat .cnt { float: right; font-size: 10px; color: var(--ink-mute); }
.wiki-main { background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; padding: 18px 24px; }
.wiki-page { padding: 8px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; cursor: pointer; }
.wiki-page:last-child { border-bottom: none; }
.wiki-page-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 5px; }
.wiki-page-body { font-size: 13px; color: var(--ink-soft); line-height: 1.6; white-space: pre-wrap; }
.wiki-page-tags { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.wiki-tag { background: var(--surface-soft); padding: 1px 7px; border-radius: 8px; font-size: 10.5px; color: var(--ink-mute); }

/* 모달 (공통) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--surface); border-radius: 8px;
  max-width: 560px; width: 90%; max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.modal-title { font-size: 17px; font-weight: 700; margin: 0 0 14px; color: var(--ink); }
.form-field { display: flex; flex-direction: column; margin-bottom: 10px; }
.form-field label { font-size: 11.5px; font-weight: 600; color: var(--ink-mute); margin-bottom: 3px; }
.form-field input, .form-field select, .form-field textarea {
  padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 5px;
  font-family: inherit; font-size: 13px;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--naran-green); }
.form-field textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* 비밀번호 마스킹 */
.masked-pw {
  font-family: monospace; cursor: pointer;
  user-select: none;
  background: var(--surface-soft); padding: 2px 8px; border-radius: 4px;
  font-size: 13px;
}
.masked-pw.revealed { background: #fff3cd; user-select: text; cursor: text; }
.copy-btn {
  padding: 2px 8px; font-size: 10.5px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 4px; cursor: pointer; font-family: inherit;
  color: var(--ink-soft);
}
.copy-btn:hover { color: var(--naran-green-dark); border-color: var(--naran-green); }

/* 빈 상태 */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--ink-mute);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; opacity: 0.5; }
.empty-state .msg { font-size: 14px; }

/* ════════════════════════════════════════════════════════════
   전역 일체화 레이어 — 모든 섹션 글씨·박스 한 스펙 강제
   (각 페이지 <style>가 naran.css를 덮으므로 !important로 통일)
   ════════════════════════════════════════════════════════════ */

/* ── 페이지 제목: 동일 크기·굵기 ── */
.page-title, .dk-title, .rcp-title, .dh h1 {
  font-size: 23px !important;
  font-weight: 600 !important;
  letter-spacing: -0.3px !important;
  color: var(--ink) !important;
}
.page-title .icon { font-size: 20px !important; }

/* ── 카드/박스: 동일 모서리 + 오프셋 그림자 (테두리 색·패딩은 보존) ── */
.card, .stat-card, .kard, .dx-card, .todo, .hero, .pp-tot, .pp-table,
.cd-info, .cd-section, .ai-card, .recon-month, .timeline-card, .vd-kpi-card,
.mini-cal, .wiki-side, .wiki-main, .dl-table, .modal-box {
  border-radius: var(--radius-block) !important;
  box-shadow: 3px 3px 0 var(--naran-green-pale) !important;
}

/* ── 섹션/카드 제목: 동일 글씨(13px/700, 비대문자) ── */
.card h3, .dx-card h3, .cd-section-head, .cd-section h3, .fu-sec h3,
.pp-sec-h h2, .sec-h h2, .kard-section-title, .vd-card h3, .cs-section h3,
.dk-pay-box .h, .dk-paid-box .h {
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* ── 본문 표·행 기본 글씨 통일 ── */
.simple-table, .pp-table, .dl-table { font-size: 13px !important; }

/* ── 글씨체 완전 통일: 전부 Pretendard (Arial·SF Mono 등 혼용 제거) ── */
* {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif !important;
}
/* 캘린더(FullCalendar) 아이콘 폰트는 복구 — 화살표 깨짐 방지 */
.fc-icon, .fc-icon::before { font-family: 'fcicons' !important; }
/* 숫자 정렬용 monospace였던 곳은 tabular-nums로 대체 (정렬 유지) */
.date, .lead, .up-time, .rcp-time, [class*="num"], td, th { font-variant-numeric: tabular-nums; }

/* ════════════════════════════════════════════════════════════
   반응형 레이어 (2026-06-08) — 휴대폰·노트북에서 화면 잘림 방지
   - 기본: 햄버거 버튼·백드롭 숨김 (데스크탑)
   - ≤1200px: 메인 여백 축소
   - ≤1024px: 우측 플로팅 패널 숨김 (보조 정보 — 좁은 화면에선 본문 우선)
   - ≤780px: 사이드바를 off-canvas 드로어로 전환 + 햄버거 노출 + 본문 풀폭
   ════════════════════════════════════════════════════════════ */
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

/* 모든 화면 공통: 박스가 뷰포트보다 넓어 통째로 잘리지 않도록 안전장치 */
img, table, pre, canvas, video, iframe { max-width: 100%; }

/* 예약관리 day(상담실별) 룸뷰: 9개 상담실이 화면폭보다 넓을 때(노트북·휴대폰) 잘리지 않고 가로 스크롤.
   reservations.html 인라인 .room-grid{overflow:hidden}을 !important로 덮어 — 템플릿(서버) 재시작 없이
   naran.css(정적) 동기화만으로 즉시 반영되게 함. 넓은 데스크탑은 1fr이 채워 스크롤바 무발생(무해). */
/* day 룸뷰: #roomView는 가로 전용 스크롤(세로는 페이지가 담당). 네이티브 스크롤바는 숨기고
   화면 하단 고정 가로 스크롤바(#roomHBar)로 조작 → 위아래 스크롤해도 항상 하단에 떠 있음. */
#roomView { overflow-x: auto !important; overflow-y: hidden !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#roomView::-webkit-scrollbar { display: none; }
.room-grid { overflow: visible !important; }

@media (max-width: 1200px) {
  .main { padding: 32px 28px; }
}

@media (max-width: 1024px) {
  /* 우측 플로팅 패널(미수납/예정/이체 등)은 좁은 화면에서 본문을 가리므로 숨김 */
  .right-panels { display: none !important; }
  .main { padding-right: 28px !important; }
  /* 보고 FAB는 우측 하단으로 (패널 자리 비었으니) */
  #repFab { right: 18px !important; }
  #repPanel { right: 18px !important; }
}

@media (max-width: 780px) {
  /* ── 햄버거 버튼 ── */
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 10px; left: 10px; z-index: 340;
    width: 44px; height: 44px;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
    border-radius: 10px; font-size: 21px; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.14);
  }
  /* ── 사이드바: 화면 밖 드로어 → 햄버거로 슬라이드 인 ── */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 252px;
    z-index: 345; transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 26px rgba(0,0,0,0.22);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.42);
    z-index: 342; display: none;
  }
  body.nav-open .nav-backdrop { display: block; }

  /* ── 본문 풀폭 + 상단에 햄버거 자리 ── */
  .main {
    padding: 62px 14px 28px !important;
    overflow-x: auto;
  }
  /* 페이지 헤더 세로 스택 (제목+액션 겹침 방지) */
  .page-header {
    flex-direction: column; align-items: flex-start;
    gap: 10px; margin-bottom: 22px; padding-bottom: 16px;
  }
  /* 넓은 표는 가로 스크롤 컨테이너로 감싸지 않은 경우에도 본문 스크롤로 처리 */
  .simple-table, .pp-table, .dl-table { display: block; overflow-x: auto; white-space: nowrap; }
  /* 2열 그리드 폼은 1열로 */
  .pay-row, .up-modal-row, .pay-card .pay-row { grid-template-columns: 1fr !important; }
  /* 모달은 화면 거의 꽉 차게 + 세로 스크롤 */
  .pay-card, .up-modal-card, .modal-box {
    width: 94vw !important; max-width: 94vw !important;
    max-height: 90vh; overflow-y: auto;
  }
  /* 보고 FAB 위치 */
  #repFab { right: 14px !important; bottom: 16px !important; }
}

