/* ═══════════════════════════════════════════
   BSN케어 전용 확장 스타일
   common.css(building0-v2) 위 레이어
   ═══════════════════════════════════════════ */

:root {
  --radius-card: 10px;
  --sidebar-w: 240px;
  --good: #10b981;
  --warn: #f59e0b;
  --info: #1d6fab;
}
body.dark { --good: #34d399; --warn: #fbbf24; --info: #60a5fa; }

/* ── SF Symbols 스타일 아이콘 ── */
.ic {
  display: inline-block;
  width: 18px; height: 18px;
  fill: currentColor;
  vertical-align: -3px;
  flex-shrink: 0;
}
.ic.sm { width: 14px; height: 14px; vertical-align: -2px; }
.ic.lg { width: 22px; height: 22px; vertical-align: -4px; }
.ic.xl { width: 28px; height: 28px; }

/* ── 버튼 스타일 통일 (common.css 재정의) ── */
.btn, .btn-primary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
  box-sizing: border-box;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(29,111,171,.25), 0 0 0 1px rgba(29,111,171,.08) inset;
}
.btn-primary:hover:not(:disabled) {
  background: #175a8c;
  box-shadow: 0 3px 8px rgba(29,111,171,.35), 0 0 0 1px rgba(29,111,171,.1) inset;
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(29,111,171,.25); }
.btn-primary svg { color: #fff; }

.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text);
  font-weight: 500;
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-surface);
}
.btn-outline svg { color: currentColor; }

/* 작은 크기 variant */
.btn-sm, .btn.btn-sm, .btn-primary.btn-sm, .btn-outline.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* 다크 모드 primary 보정 (--accent가 밝아지지 않음, 그림자만 완화) */
body.dark .btn-primary {
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 0 0 1px rgba(96,165,250,.2) inset;
}
body.dark .btn-primary:hover:not(:disabled) {
  background: #2587c9;
  box-shadow: 0 4px 10px rgba(37,135,201,.4), 0 0 0 1px rgba(96,165,250,.25) inset;
}

/* ── 인증 오버레이 ── */
.auth-ov {
  position: fixed; inset: 0;
  z-index: 200;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-ov.hide { display: none; }
.auth-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  width: 100%;
  max-width: 400px;
  padding: 32px 28px;
}
.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.auth-brand p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.auth-tabs {
  display: flex; gap: 4px;
  background: var(--bg-header);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 8px;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.auth-tab.on {
  background: var(--bg-surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.auth-field { margin-bottom: 12px; position: relative; }
.auth-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.auth-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,111,171,.15);
}
.auth-field .ic-prefix {
  position: absolute;
  left: 12px; top: 33px;
  color: var(--text-muted);
  pointer-events: none;
}
.auth-btn {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  background: var(--primary);
  color: var(--bg);
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.auth-btn:hover { background: var(--primary-hover); }
.auth-btn.secondary {
  background: var(--bg-header);
  color: var(--text);
}
.auth-msg {
  margin-top: 12px;
  font-size: 12px;
  text-align: center;
  min-height: 16px;
}
.auth-msg.err { color: var(--danger); }
.auth-msg.ok { color: var(--good); }
.auth-form { display: none; }
.auth-form.on { display: block; }

.auth-otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 20px 0 4px;
}
.auth-otp-grid input {
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font-family: inherit;
}
.auth-otp-grid input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,111,171,.15);
}
.auth-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

.auth-status { text-align: center; padding: 20px 0; }
.auth-status-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-header);
  color: var(--text-secondary);
}
.auth-status-icon.err { background: var(--danger-bg); color: var(--danger); }
.auth-status-icon.ok { background: rgba(16,185,129,.12); color: var(--good); }
.auth-status-icon .ic { width: 32px; height: 32px; vertical-align: 0; }
.auth-status h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.auth-status p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.auth-status .auth-email { margin-top: 10px; font-size: 12px; color: var(--text-muted); }

/* ── 앱 레이아웃 ── */
.app { display: none; }
.app.on { display: flex; flex-direction: column; }
.navbar-nav a.nav-item { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* ── 페이지 스위칭 ── */
.page { display: none; }
.page.on { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.care-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px;
  width: 100%;
  flex: 1;
  overflow: auto;
}
.care-container h2.page-title {
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.care-container h2.page-title .ic { color: var(--text-secondary); }

/* 액션 바 (상단 필터/버튼 줄) */
.action-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.action-bar .sp { flex: 1; }

/* ── 카드 ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card-h {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-h h3 {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 6px;
}
.card-h h3 .ic { color: var(--text-secondary); }
.card-b { padding: 18px; }
.card-b.np { padding: 0; }

/* ── 대시보드 Glance 카드 ── */
.dash-glance {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.glance {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.glance:hover { border-color: var(--accent); transform: translateY(-1px); }
.glance-head {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--text-secondary);
}
.glance-head .lbl { font-size: 12px; font-weight: 500; }
.glance-head .ic { opacity: .7; }
.glance-val {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.glance-sub { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.glance.warn .glance-val { color: var(--danger); }
.glance.ok .glance-val { color: var(--good); }

.dash-grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}

/* 이번 주 일정 리스트 */
.sch-li {
  list-style: none;
}
.sch-li li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.sch-li li:first-child { border-top: none; }
.sch-li .date {
  width: 44px;
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.sch-li .bldg {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-header);
  flex-shrink: 0;
}
.sch-li .title { flex: 1; }
.sch-li .done { color: var(--text-muted); text-decoration: line-through; }

.vac-li li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.vac-li li:first-child { border-top: none; }
.vac-li .name { flex: 1; }
.vac-li .days {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
}

/* ── 건물 탭 2분할 ── */
.bldg-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.bldg-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100dvh - 160px);
}
.bldg-search { padding: 10px; border-bottom: 1px solid var(--border); position: relative; }
.bldg-search input {
  width: 100%; height: 32px;
  padding: 0 10px 0 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.bldg-search .ic-prefix {
  position: absolute; left: 20px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.bldg-list { flex: 1; overflow: auto; }
.bldg-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  transition: background .1s;
}
.bldg-item:hover { background: var(--hover); }
.bldg-item.on { background: var(--hover); border-left: 3px solid var(--accent); padding-left: 11px; }
.bldg-item .bldg-addr {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.bldg-main {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: calc(100dvh - 160px);
}
.bldg-main-h {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.bldg-main-h .meta h2 {
  font-size: 18px; font-weight: 600; letter-spacing: -0.02em;
}
.bldg-main-h .meta .sub {
  font-size: 12px; color: var(--text-secondary); margin-top: 2px;
}
.bldg-main-h .quick { display: flex; gap: 6px; }

.sub-tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  overflow-x: auto;
}
.sub-tab {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  white-space: nowrap;
}
.sub-tab:hover { color: var(--text); }
.sub-tab.on {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.bldg-body { padding: 20px; flex: 1; overflow: auto; }
.bldg-body .section { margin-bottom: 24px; }
.bldg-body .section:last-child { margin-bottom: 0; }
.bldg-body .section-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

/* KV 테이블 (개요) */
.kv {
  display: grid;
  grid-template-columns: 120px 1fr 120px 1fr;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}
.kv > div {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.kv > div:nth-child(-n+4) { border-top: none; }
.kv > div:nth-child(4n) { border-right: none; }
.kv .k { background: var(--bg-header); color: var(--text-secondary); font-weight: 500; font-size: 12px; }
.kv .v { font-weight: 500; }

/* 일반 테이블 */
.t { width: 100%; font-size: 13px; border-collapse: collapse; }
.t thead th {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-header);
  font-size: 12px;
  white-space: nowrap;
}
.t td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.t tr:hover td { background: var(--hover); }
.t td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t td.c { text-align: center; }
.t tr:last-child td { border-bottom: none; }
.t .muted { color: var(--text-muted); }
.t .ic-btn {
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.t .ic-btn:hover { background: var(--hover); color: var(--text); }

/* 상태 점·뱃지 */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 6px;
  vertical-align: middle;
}
.dot.ok { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--danger); }
.dot.info { background: var(--info); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  background: var(--bg-header);
  color: var(--text-secondary);
}
.badge.ok { background: rgba(16,185,129,.12); color: var(--good); }
.badge.warn { background: rgba(245,158,11,.12); color: var(--warn); }
.badge.err { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: rgba(29,111,171,.12); color: var(--info); }

/* empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.empty .ic { display: block; margin: 0 auto 10px; width: 32px; height: 32px; opacity: .5; }

/* 시설·점검 카드 */
.facility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.fac-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--bg-surface);
}
.fac-card .fac-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.fac-card .fac-name { font-weight: 600; font-size: 13px; }
.fac-card .fac-expire { font-size: 11px; color: var(--text-secondary); }
.fac-card .fac-vendor { font-size: 12px; color: var(--text-secondary); }

/* 현장점검 타임라인 */
.timeline { list-style: none; position: relative; }
.timeline::before {
  content: ""; position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline li {
  position: relative;
  padding: 4px 0 14px 26px;
  font-size: 13px;
}
.timeline li::before {
  content: ""; position: absolute;
  left: 0; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent);
}
.timeline .date {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* 메모·연락처 */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* 파일 트리 */
.file-cats {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}
.file-cat {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  background: var(--bg-surface);
}
.file-cat.on { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.file-list li {
  list-style: none;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.file-list li:last-child { border-bottom: none; }
.file-list .meta { margin-left: auto; font-size: 11px; color: var(--text-muted); }

/* 일정 탭 */
.sch-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.sch-filter {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  max-height: calc(100dvh - 160px);
  overflow: auto;
}
.sch-filter h4 {
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.sch-filter .chip-row { display: flex; gap: 4px; margin-bottom: 14px; }
.sch-filter .chip {
  padding: 4px 10px; font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--bg-surface);
}
.sch-filter .chip.on { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.sch-filter .bldg-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; cursor: pointer; }

/* 캘린더 */
.cal-main {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cal-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-header);
}
.cal-toolbar h3 {
  font-size: 16px; font-weight: 600; letter-spacing: -0.02em;
  min-width: 140px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 8px 4px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.cal-dow.sun { color: var(--danger); }
.cal-dow.sat { color: var(--info); }
.cal-cell {
  min-height: 88px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}
.cal-cell:nth-child(7n+7) { border-right: none; }
.cal-cell.dim { background: var(--bg-header); color: var(--text-muted); }
.cal-cell.today .cal-d { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 6px; }
.cal-d {
  font-weight: 600;
  font-size: 11px;
  display: inline-block;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.cal-ev {
  display: block;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(29,111,171,.1);
  color: var(--info);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.cal-ev.err { background: var(--danger-bg); color: var(--danger); }
.cal-ev.warn { background: rgba(245,158,11,.12); color: var(--warn); }
.cal-ev.done { opacity: .5; text-decoration: line-through; }

/* 고정일정 리스트 */
.fixed-li li {
  list-style: none;
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
}
.fixed-li li:last-child { border-bottom: none; }
.fixed-li .day {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.fixed-li .memo { font-size: 11px; color: var(--text-muted); }

/* 만료일 */
.exp-li li {
  list-style: none;
  display: grid;
  grid-template-columns: 140px 1fr 90px 90px;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  font-size: 13px;
}
.exp-li li:last-child { border-bottom: none; }
.exp-li .cat {
  font-weight: 500;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-header);
  display: inline-block;
  width: fit-content;
}
.exp-li .dday {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.exp-li .dday.err { color: var(--danger); }
.exp-li .dday.warn { color: var(--warn); }

/* 정산 - 청구서 */
.inv-monthnav {
  display: flex; align-items: center; gap: 8px;
}
.inv-monthnav h3 { min-width: 80px; text-align: center; font-size: 15px; }

/* 공과금 안분 */
.allot-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 14px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}
.allot-head input {
  height: 36px; padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.allot-head label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; display: block; }

/* 리포트 매트릭스 */
.rpt-matrix {
  display: grid;
  grid-template-columns: 180px repeat(6, 1fr);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}
.rpt-matrix > div {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
}
.rpt-matrix .bldg-name { text-align: left; font-weight: 600; font-size: 13px; }
.rpt-matrix > div:nth-child(-n+7) { border-top: none; font-weight: 600; color: var(--text-secondary); background: var(--bg-header); }
.rpt-matrix > div:nth-child(7n) { border-right: none; }
.rpt-cell {
  cursor: pointer;
  transition: background .1s;
}
.rpt-cell:hover { background: var(--hover); }
.rpt-cell .badge { cursor: pointer; }

/* 리포트 편집 */
.rpt-edit-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
}
.rpt-sec-nav {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 8px;
  align-self: start;
}
.rpt-sec-nav li {
  list-style: none;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.rpt-sec-nav li:hover { background: var(--hover); }
.rpt-sec-nav li.on { background: var(--hover); font-weight: 600; }
.rpt-sec-nav .seq {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-header);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.rpt-sec-nav li.on .seq { background: var(--accent); color: #fff; }

.rpt-edit-main {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  display: flex; flex-direction: column;
}

/* 드라이브 */
.drive-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.drive-tree { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 8px; max-height: calc(100dvh - 160px); overflow: auto; }
.drive-tree .tree-bldg { font-weight: 600; padding: 8px 10px; font-size: 13px; }
.drive-tree .tree-cat {
  list-style: none;
  padding: 6px 10px 6px 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.drive-tree .tree-cat.on { background: var(--hover); font-weight: 600; }
.drive-main { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-card); display: flex; flex-direction: column; }

/* 폼 필드 그리드 */
.fg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.fg label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.fg input, .fg select, .fg textarea {
  width: 100%; height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.fg textarea { height: 80px; padding: 8px 10px; resize: vertical; }
.fg input:focus, .fg select:focus, .fg textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,111,171,.15);
}

/* 모달 */
.modal-bd {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
}
.modal-bd.on { display: flex; }
.modal-x {
  width: 90%;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  max-height: 86vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-x.wide { max-width: 760px; }
.modal-hd { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-hd h3 { font-size: 15px; font-weight: 600; }
.modal-bd-x { padding: 20px; overflow: auto; }
.modal-ft { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* 토스트 */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transition: all .2s;
  z-index: 300;
}
.toast.on { opacity: 1; transform: translateX(-50%); }

/* 다크 모드 미세조정 */
body.dark .cal-ev { background: rgba(96,165,250,.15); color: #60a5fa; }
body.dark .cal-ev.err { background: rgba(248,113,113,.15); color: #f87171; }
body.dark .cal-ev.warn { background: rgba(251,191,36,.15); color: #fbbf24; }
body.dark .bldg-sidebar, body.dark .bldg-main { box-shadow: 0 1px 2px rgba(0,0,0,.2); }

/* 태블릿·모바일 */
@media (max-width: 980px) {
  .dash-glance { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-2 { grid-template-columns: 1fr; }
  .bldg-layout { grid-template-columns: 1fr; }
  .bldg-sidebar { max-height: 240px; }
  .bldg-main { max-height: none; }
  .sch-layout, .drive-layout { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
  .kv > div:nth-child(-n+2) { border-top: none; }
  .kv > div:nth-child(4n) { border-right: 1px solid var(--border); }
  .kv > div:nth-child(odd) { border-right: 1px solid var(--border); }
  .kv > div:nth-child(even) { border-right: none; }
  .contacts-grid { grid-template-columns: 1fr; }
  .rpt-edit-grid { grid-template-columns: 1fr; }
  .rpt-matrix { grid-template-columns: 110px repeat(3, 1fr); overflow-x: auto; }
}
