/* ═══════════════════════════════════════
   SafeAI — Dashboard CSS
═══════════════════════════════════════ */

/* ── 대시보드 레이아웃 ── */
.dash-body {
  background: #0b1120;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ════════════════════════════════════════
   SIDEBAR
════════════════════════════════════════ */
.dash-sidebar {
  width: 240px;
  background: #111827;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.dash-sidebar::-webkit-scrollbar { width: 4px; }
.dash-sidebar::-webkit-scrollbar-track { background: transparent; }
.dash-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.ds-top {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ds-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc;
}
.ds-logo .logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.ds-close {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
}

.ds-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  padding: 20px 18px 6px;
}

.ds-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}
.ds-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.ds-link:hover {
  color: #f1f5f9;
  background: rgba(255,255,255,0.05);
}
.ds-link.active {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  font-weight: 600;
}
.ds-link i { font-size: 0.9rem; width: 18px; text-align: center; }
.ds-link span { flex: 1; }
.ds-badge {
  background: #ef4444;
  color: white;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
}

.ds-bottom {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.ds-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}
.ds-avatar {
  width: 34px; height: 34px;
  background: rgba(59,130,246,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #60a5fa;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.ds-user-info { flex: 1; }
.ds-user-name  { display: block; font-size: 0.82rem; font-weight: 700; color: #f1f5f9; }
.ds-user-role  { display: block; font-size: 0.7rem; color: #64748b; }
.ds-user > a   { color: #475569; font-size: 0.9rem; transition: color 0.2s; }
.ds-user > a:hover { color: #60a5fa; }

/* ════════════════════════════════════════
   MAIN AREA
════════════════════════════════════════ */
.dash-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── 탑바 ── */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,17,32,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dtb-left { display: flex; align-items: center; gap: 12px; }
.dtb-menu {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
}
.dtb-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #475569;
}
.dtb-breadcrumb i { font-size: 0.65rem; }
.dtb-breadcrumb .active-bc { color: #f1f5f9; font-weight: 600; }

.dtb-right { display: flex; align-items: center; gap: 12px; }
.dtb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 7px 14px;
}
.dtb-search i { color: #475569; font-size: 0.82rem; }
.dtb-search input {
  background: none;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-size: 0.82rem;
  width: 180px;
  font-family: 'Noto Sans KR', sans-serif;
}
.dtb-search input::placeholder { color: #475569; }

.dtb-date {
  font-size: 0.78rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.dtb-bell {
  position: relative;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
}
.bell-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #0b1120;
}
.dtb-avatar {
  color: #60a5fa;
  font-size: 1.6rem;
  cursor: pointer;
}

/* ── 콘텐츠 ── */
.dash-content { padding: 28px 28px 48px; flex: 1; }
.dash-page { display: none; }
.dash-page.active { display: block; }

/* ── 페이지 헤더 ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title { font-size: 1.5rem; font-weight: 800; color: #f8fafc; margin-bottom: 4px; }
.page-sub   { font-size: 0.82rem; color: #64748b; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn-dash-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white; border: none;
  padding: 9px 18px; border-radius: 9px;
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
}
.btn-dash-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-dash-outline {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.12);
  padding: 9px 18px; border-radius: 9px;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
}
.btn-dash-outline:hover {
  border-color: #3b82f6;
  color: #60a5fa;
  background: rgba(59,130,246,0.06);
}

/* ════════════════════════════════════════
   KPI CARDS
════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
}
.kpi-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.kpi-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.kpi-icon-wrap.blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.kpi-icon-wrap.green  { background: rgba(16,185,129,0.15); color: #34d399; }
.kpi-icon-wrap.orange { background: rgba(245,158,11,0.15); color: #fbbf24; }
.kpi-icon-wrap.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.kpi-icon-wrap.red    { background: rgba(239,68,68,0.15);  color: #f87171; }
.kpi-icon-wrap.teal   { background: rgba(20,184,166,0.15); color: #2dd4bf; }

.kpi-body { flex: 1; }
.kpi-val {
  font-size: 2rem; font-weight: 900;
  color: #f8fafc; line-height: 1;
  margin-bottom: 3px;
}
.kpi-val-dec { font-size: 1.9rem; font-weight: 900; color: #f8fafc; line-height: 1; margin-bottom: 3px; }
.kpi-label { font-size: 0.72rem; color: #64748b; }

.kpi-trend {
  font-size: 0.7rem; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 99px;
  width: fit-content;
}
.kpi-trend.up   { background: rgba(16,185,129,0.1); color: #34d399; }
.kpi-trend.down { background: rgba(59,130,246,0.1); color: #60a5fa; }
.kpi-trend.danger { background: rgba(239,68,68,0.1); color: #f87171; }

/* ════════════════════════════════════════
   CHARTS
════════════════════════════════════════ */
.chart-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.chart-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.2s;
}
.chart-card:hover { border-color: rgba(255,255,255,0.1); }
.chart-card.wide { grid-column: span 2; }

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.chart-title { font-size: 0.9rem; font-weight: 700; color: #f1f5f9; margin-bottom: 2px; }
.chart-sub   { font-size: 0.72rem; color: #64748b; }
.chart-legend { display: flex; align-items: center; font-size: 0.72rem; color: #64748b; }
.cl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.cl-dot.blue  { background: #3b82f6; }
.cl-dot.green { background: #10b981; }

/* ════════════════════════════════════════
   BOTTOM GRID
════════════════════════════════════════ */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
}

/* ── 데이터 테이블 ── */
.table-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}
.tc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tc-header h3 { font-size: 0.9rem; font-weight: 700; color: #f1f5f9; display: flex; align-items: center; gap: 8px; }
.tc-more {
  font-size: 0.78rem; color: #3b82f6;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 4px; font-family: 'Noto Sans KR', sans-serif;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table thead tr { background: rgba(255,255,255,0.02); }
.data-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: #cbd5e1;
  white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table.full-table { font-size: 0.8rem; }

/* 등급 배지 */
.grade-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 0.8rem; font-weight: 800;
}
.grade-badge.s { background: rgba(16,185,129,0.15); color: #34d399; }
.grade-badge.a { background: rgba(59,130,246,0.15); color: #60a5fa; }
.grade-badge.b { background: rgba(245,158,11,0.15); color: #fbbf24; }
.grade-badge.c { background: rgba(249,115,22,0.15); color: #fb923c; }
.grade-badge.d { background: rgba(239,68,68,0.15); color: #f87171; }

/* 상태 배지 */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 600;
}
.status-badge.complete  { background: rgba(16,185,129,0.1); color: #34d399; }
.status-badge.action    { background: rgba(239,68,68,0.1); color: #f87171; }
.status-badge.progress  { background: rgba(245,158,11,0.1); color: #fbbf24; }
.status-badge.pending   { background: rgba(100,116,139,0.1); color: #94a3b8; }

.action-btns { display: flex; gap: 6px; }
.action-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #94a3b8; border-radius: 6px;
  padding: 4px 10px; font-size: 0.72rem;
  cursor: pointer; font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
}
.action-btn:hover { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.3); color: #60a5fa; }
.action-btn.red:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); color: #f87171; }

/* ── 알림 카드 ── */
.alert-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}
.alert-count {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
}
.alert-list { padding: 8px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 12px;
  transition: border-color 0.2s;
  cursor: pointer;
}
.alert-item:hover { border-color: rgba(255,255,255,0.1); }
.alert-item.critical { border-left: 3px solid #ef4444; }
.alert-item.high     { border-left: 3px solid #f59e0b; }
.alert-item.medium   { border-left: 3px solid #3b82f6; }
.alert-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.alert-site { font-size: 0.82rem; font-weight: 700; color: #f1f5f9; }
.alert-lvl  { font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.alert-lvl.critical { background: rgba(239,68,68,0.15); color: #f87171; }
.alert-lvl.high     { background: rgba(245,158,11,0.15); color: #fbbf24; }
.alert-lvl.medium   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.alert-issue { font-size: 0.78rem; color: #94a3b8; margin-bottom: 8px; line-height: 1.5; }
.alert-meta { display: flex; justify-content: space-between; align-items: center; }
.alert-time { font-size: 0.68rem; color: #475569; }
.alert-action-btn {
  font-size: 0.7rem; font-weight: 600;
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 6px; padding: 3px 10px;
  cursor: pointer; font-family: 'Noto Sans KR', sans-serif;
}

/* ════════════════════════════════════════
   SITES PAGE
════════════════════════════════════════ */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.site-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px 20px;
  transition: all 0.2s;
  cursor: pointer;
}
.site-card:hover {
  border-color: rgba(59,130,246,0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}
.site-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.site-name   { font-size: 0.9rem; font-weight: 700; color: #f1f5f9; margin-bottom: 2px; }
.site-type   { font-size: 0.72rem; color: #64748b; }
.site-score  { font-size: 1.8rem; font-weight: 900; color: #f8fafc; text-align: right; line-height: 1; }
.site-score-label { font-size: 0.68rem; color: #64748b; }
.site-bars { margin-bottom: 12px; }
.site-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.site-bar-label { font-size: 0.68rem; color: #64748b; width: 70px; flex-shrink: 0; }
.site-bar-track { flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.site-bar-fill  { height: 100%; border-radius: 2px; transition: width 1s ease; }
.site-bar-val   { font-size: 0.7rem; color: #94a3b8; width: 28px; text-align: right; flex-shrink: 0; }
.site-footer { display: flex; justify-content: space-between; align-items: center; }
.site-date  { font-size: 0.72rem; color: #475569; }

/* ════════════════════════════════════════
   INSPECTION STATS
════════════════════════════════════════ */
.insp-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.insp-stat {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.is-num { font-size: 1.8rem; font-weight: 900; line-height: 1; }
.is-num.green  { color: #34d399; }
.is-num.orange { color: #fbbf24; }
.is-num.muted  { color: #64748b; }
.is-num.red    { color: #f87171; }
.is-label { font-size: 0.78rem; color: #64748b; }

/* ════════════════════════════════════════
   ALERTS DETAIL
════════════════════════════════════════ */
.alerts-detail-grid { display: flex; flex-direction: column; gap: 12px; }
.alert-detail-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 20px;
  transition: all 0.2s;
}
.alert-detail-card:hover { border-color: rgba(255,255,255,0.1); }
.alert-detail-card.critical { border-left: 4px solid #ef4444; }
.alert-detail-card.high     { border-left: 4px solid #f59e0b; }
.alert-detail-card.medium   { border-left: 4px solid #3b82f6; }
.adc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.adc-icon.red    { background: rgba(239,68,68,0.15); color: #f87171; }
.adc-icon.orange { background: rgba(245,158,11,0.15); color: #fbbf24; }
.adc-icon.blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.adc-body h4 { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; margin-bottom: 6px; }
.adc-body p  { font-size: 0.83rem; color: #94a3b8; line-height: 1.6; margin-bottom: 8px; }
.adc-tags    { display: flex; flex-wrap: wrap; gap: 6px; }
.adc-tag     { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: #64748b; padding: 2px 8px; border-radius: 99px; font-size: 0.7rem; }
.adc-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.adc-level   { font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.adc-level.critical { background: rgba(239,68,68,0.15); color: #f87171; }
.adc-level.high     { background: rgba(245,158,11,0.15); color: #fbbf24; }
.adc-level.medium   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.adc-time { font-size: 0.7rem; color: #475569; }

/* ════════════════════════════════════════
   REPORTS PAGE
════════════════════════════════════════ */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.report-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
}
.report-card:hover {
  border-color: rgba(59,130,246,0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.3);
}
.report-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; margin-bottom: 16px;
}
.report-icon.blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.report-icon.purple { background: rgba(139,92,246,0.15); color: #a78bfa; }
.report-icon.green  { background: rgba(16,185,129,0.15); color: #34d399; }
.report-icon.orange { background: rgba(245,158,11,0.15); color: #fbbf24; }
.report-icon.teal   { background: rgba(20,184,166,0.15); color: #2dd4bf; }
.report-icon.red    { background: rgba(239,68,68,0.15);  color: #f87171; }
.report-card h3 { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; margin-bottom: 8px; }
.report-card p  { font-size: 0.82rem; color: #64748b; line-height: 1.65; margin-bottom: 18px; }
.report-footer  { display: flex; align-items: center; gap: 8px; }
.report-tag {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  color: #64748b; padding: 3px 9px; border-radius: 99px; font-size: 0.7rem; font-weight: 600;
}
.btn-report {
  margin-left: auto;
  background: rgba(59,130,246,0.1); color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 8px; padding: 5px 14px;
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-family: 'Noto Sans KR', sans-serif;
}

/* ════════════════════════════════════════
   SETTINGS PAGE
════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.settings-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 24px;
}
.settings-card h3 {
  font-size: 0.95rem; font-weight: 700; color: #f1f5f9;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.settings-card h3 i { color: #3b82f6; }

/* 슬라이더 */
.setting-item { margin-bottom: 16px; }
.setting-item label { display: block; font-size: 0.82rem; color: #94a3b8; margin-bottom: 6px; }
.range-wrap { display: flex; align-items: center; gap: 10px; }
.dash-range {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; outline: none;
}
.dash-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #3b82f6; cursor: pointer;
}
.range-val { font-size: 0.78rem; font-weight: 700; color: #3b82f6; min-width: 34px; text-align: right; }

/* 토글 */
.toggle-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.toggle-item > div strong { display: block; font-size: 0.85rem; color: #f1f5f9; margin-bottom: 2px; }
.toggle-item > div p { font-size: 0.75rem; color: #64748b; }
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.1); border-radius: 22px;
  transition: 0.3s;
}
.slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .slider { background: #3b82f6; }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* 연동 */
.integration-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.int-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
}
.int-icon.naver  { background: rgba(3,199,90,0.15); color: #03c75a; }
.int-icon.teams  { background: rgba(100,130,246,0.15); color: #6464f6; }
.int-icon.kakao  { background: rgba(254,220,0,0.15); color: #fee302; }
.int-icon.email  { background: rgba(59,130,246,0.15); color: #60a5fa; }
.int-info { flex: 1; }
.int-info strong { display: block; font-size: 0.82rem; color: #f1f5f9; }
.int-info p { font-size: 0.72rem; color: #64748b; }
.int-status { font-size: 0.7rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: rgba(100,116,139,0.1); color: #64748b; }
.int-status.connected { background: rgba(16,185,129,0.1); color: #34d399; }

/* ════════════════════════════════════════
   USERS TABLE
════════════════════════════════════════ */
.role-badge {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 600;
}
.role-badge.admin   { background: rgba(139,92,246,0.15); color: #a78bfa; }
.role-badge.manager { background: rgba(59,130,246,0.15); color: #60a5fa; }
.role-badge.viewer  { background: rgba(100,116,139,0.1); color: #94a3b8; }
.user-status { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; }
.user-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.user-status.active  { color: #34d399; }
.user-status.active::before { background: #34d399; }
.user-status.inactive { color: #64748b; }
.user-status.inactive::before { background: #64748b; }

/* ════════════════════════════════════════
   MODAL
════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  width: 100%; max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-header h2 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-header h2 i { color: #3b82f6; }
.modal-close {
  background: none; border: none; color: #64748b; font-size: 1rem;
  cursor: pointer; padding: 4px; transition: color 0.2s;
}
.modal-close:hover { color: #f1f5f9; }
.modal-body  { padding: 20px 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* 폼 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.82rem; color: #94a3b8; margin-bottom: 6px; }
.required { color: #ef4444; }
.form-control {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px; padding: 9px 12px; color: #f1f5f9; font-size: 0.85rem;
  outline: none; font-family: 'Noto Sans KR', sans-serif;
  transition: border-color 0.2s;
}
.form-control:focus { border-color: #3b82f6; background: rgba(59,130,246,0.05); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; }
.checkbox-group {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.cb-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: #94a3b8; cursor: pointer;
}
.cb-item input { accent-color: #3b82f6; }

/* AI 데모 */
.ai-demo-box {
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
  animation: fadeInUp 0.4s ease;
}
.ai-demo-header {
  font-size: 0.85rem; font-weight: 700; color: #60a5fa;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
}
.air-label { font-size: 0.75rem; color: #94a3b8; width: 90px; flex-shrink: 0; }
.ai-result-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.air-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.air-fill { height: 100%; border-radius: 3px; }
.air-score { font-size: 0.75rem; font-weight: 600; color: #f1f5f9; width: 50px; text-align: right; flex-shrink: 0; }
.ai-total {
  font-size: 0.85rem; color: #f1f5f9;
  margin-top: 12px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.ai-total strong { font-size: 1.1rem; color: #60a5fa; }
.ai-suggest {
  font-size: 0.78rem; color: #94a3b8; line-height: 1.6;
  background: rgba(16,185,129,0.05); border: 1px solid rgba(16,185,129,0.1);
  border-radius: 8px; padding: 10px 12px;
}
.ai-suggest i { color: #34d399; margin-right: 4px; }

/* ════════════════════════════════════════
   SELECT
════════════════════════════════════════ */
.dash-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px; padding: 8px 12px;
  color: #f1f5f9; font-size: 0.82rem;
  cursor: pointer; outline: none;
  font-family: 'Noto Sans KR', sans-serif;
}

/* ════════════════════════════════════════
   TOAST
════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 18px;
  min-width: 240px; max-width: 320px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; color: #f1f5f9;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
.toast.out { animation: toastOut 0.3s ease both; }
.toast i { font-size: 1rem; flex-shrink: 0; }
.toast.success i { color: #34d399; }
.toast.error   i { color: #f87171; }
.toast.info    i { color: #60a5fa; }
.toast.warning i { color: #fbbf24; }

@keyframes toastIn  { from { opacity:0; transform: translateX(40px) scale(0.9); } to { opacity:1; transform: translateX(0) scale(1); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0); } to { opacity:0; transform: translateX(40px); } }
@keyframes fadeInUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .chart-card.wide { grid-column: span 2; }
}
@media (max-width: 1024px) {
  .dash-sidebar {
    transform: translateX(-100%);
  }
  .dash-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .ds-close { display: flex; }
  .dash-main { margin-left: 0; }
  .dtb-menu { display: flex; }
  .settings-grid { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card.wide { grid-column: span 1; }
  .reports-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .checkbox-group { grid-template-columns: 1fr; }
  .dtb-search { display: none; }
  .dash-content { padding: 16px 16px 40px; }
  .adc-actions { display: none; }
  .alert-detail-card { grid-template-columns: auto 1fr; }
  .sites-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; }
}

/* ════════════════════════════════════════
   ADDITIONAL / MISSING STYLES
════════════════════════════════════════ */

/* select option 배경 (다크 테마) */
select.form-control option,
.dash-select option {
  background: #1e293b;
  color: #f1f5f9;
}

/* 대시보드 body font */
.dash-body {
  font-family: 'Noto Sans KR', sans-serif;
}

/* 사이드바 open 오버레이 (모바일) */
@media (max-width: 1024px) {
  .dash-sidebar.open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
  }
}

/* 빠른 접근 버튼 */
.btn-dash-primary:active,
.btn-dash-outline:active {
  transform: scale(0.97);
}

/* 심사 목록 테이블 – 스크롤 가능하게 */
.table-card { overflow-x: auto; }
.full-table { min-width: 900px; }

/* 사이트별 점수 % 텍스트 정렬 수정 */
.site-bar-val { text-align: right; font-size: 0.68rem; }

/* grade-badge 크기 조정 – 사이트 카드 내부 */
.site-card .grade-badge {
  width: 26px; height: 26px;
  font-size: 0.75rem;
}

/* 알림 상세 카드 – 모바일에서 adc-actions 복구 */
@media (max-width: 768px) {
  .adc-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    grid-column: 1 / -1;
  }
  .alert-detail-card {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
}

/* 검색창 – 모바일에서 좁게 */
@media (max-width: 768px) {
  .dtb-search { display: flex; }
  .dtb-search input { width: 120px; }
  .dtb-date { display: none; }
}

/* 보고서 미리보기 스크롤 */
#reportPreviewBody {
  max-height: 500px;
  overflow-y: auto;
}

/* 체크박스 라벨 포인터 */
.cb-item { user-select: none; }

/* 심사 통계 바 flex wrap */
.insp-stats { flex-wrap: wrap; }
.insp-stat  { flex: 1; min-width: 100px; }

/* 빈 상태 표시 공통 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: #475569;
  text-align: center;
}
.empty-state i { font-size: 2.4rem; margin-bottom: 14px; color: #334155; }
.empty-state h3 { color: #64748b; font-size: 1rem; margin-bottom: 6px; }
.empty-state p  { font-size: 0.82rem; }

/* 위험 알림 페이지 – 배경 컬러 보정 */
.alert-detail-card.critical { background: rgba(239,68,68,0.03); }
.alert-detail-card.high     { background: rgba(245,158,11,0.03); }
.alert-detail-card.medium   { background: rgba(59,130,246,0.03); }

/* 모달 스크롤 내부 패딩 */
.modal-box::-webkit-scrollbar { width: 4px; }
.modal-box::-webkit-scrollbar-track { background: transparent; }
.modal-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* 차트 타이틀 폰트 패밀리 */
.chart-title, .chart-sub { font-family: 'Noto Sans KR', sans-serif; }

/* 로딩 오버레이 – body 추가 시 중앙 정렬 */
#loadingOverlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(11,17,32,0.93);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
.loading-spinner {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; color: #60a5fa; font-size: 0.9rem; font-weight: 600;
}
.loading-spinner i { font-size: 2.4rem; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 페이지 전환 부드럽게 */
.dash-page { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
