/* ========================================================
   WellRiskKeeper - 참여기관 관리자 포털 레이아웃 (2-Column)
   (공공·보건복지 참여기관 관리자 표준 라이트 헤더 & 클린 테마)
   ======================================================== */

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 54px);
  background: #f8fafc;
}

/* ========================================================
   TOP GLOBAL NAV (Clean White Header)
   ======================================================== */
.top-nav {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-group-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.brand-group-col .brand-title {
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-group-col .brand-sub {
  color: #64748b;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-info-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #334155;
}
.nav-info-lbl {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}
.nav-info-val {
  font-size: 12px;
  color: #1e293b;
  font-weight: 500;
}
.nav-info-code {
  font-size: 11px;
  color: #64748b;
  font-family: 'SFMono-Regular', Consolas, monospace;
}
.nav-btn-refresh {
  padding: 1px 6px;
  font-size: 10.5px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: 3px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
}
.nav-btn-refresh:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.nav-link-pwa {
  font-size: 11.5px;
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-link-pwa:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ========================================================
   1. 좌측 사이드바 계층 메뉴 (Sidebar Navigation - Clean Light)
   ======================================================== */
.admin-sidebar {
  background: #f8fafc;
  color: #0f172a;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar-content {
  padding: 16px 12px;
}

.sidebar-org-badge {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 18px;
}
.sidebar-org-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.sidebar-org-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  font-family: 'SFMono-Regular', Consolas, monospace;
}

.sidebar-nav-group {
  margin-bottom: 16px;
}
.sidebar-group-title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
  padding: 0 8px;
  margin-bottom: 4px;
}

.sidebar-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #334155;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.sidebar-menu-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.sidebar-menu-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  border: 1px solid #cbd5e1;
}
.sidebar-menu-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
}
.sidebar-menu-badge.danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  background: #f1f5f9;
  font-size: 11px;
  color: #64748b;
}

/* ========================================================
   2. 우측 상세 작업 영역 (Main Content Workspace)
   ======================================================== */
.admin-main-area {
  padding: 22px 26px;
  overflow-y: auto;
}

.admin-view-pane {
  display: none;
}
.admin-view-pane.active {
  display: block;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}
.pane-title {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 3px 0;
  letter-spacing: -0.01em;
}
.pane-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  font-weight: 400;
}

/* Card Container */
.admin-card {
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  padding: 18px;
  margin-bottom: 18px;
}
.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.admin-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
}

/* KPI Cards */
.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-box {
  background: #ffffff;
  border-radius: 6px;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}
.kpi-lbl {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kpi-num {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.kpi-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  font-weight: 400;
}

/* Toolbar & Segment Filter */
.table-summary-text {
  font-size: 12.5px;
  color: #475569;
}
.seg-filter-group {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px;
  border-radius: 6px;
  gap: 2px;
}
.seg-filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg-filter-btn:hover {
  color: #0f172a;
}
.seg-filter-btn.active {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  border-color: #cbd5e1;
}

/* Form Styles */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.form-group-admin {
  margin-bottom: 12px;
}
.form-label-admin {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  margin-bottom: 5px;
}
.form-input-admin {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #1e293b;
  background: #ffffff;
  box-sizing: border-box;
  font-weight: 400;
}
.form-input-admin:focus {
  outline: none;
  border-color: #475569;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.06);
}

/* High-Density Government Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 11.5px;
  padding: 9px 12px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
  text-align: left;
}
.admin-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-weight: 400;
  vertical-align: middle;
}
.admin-table tbody tr:hover td {
  background: #f8fafc;
}

/* Refined Grade Badges */
.grade-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  text-align: center;
}
.grade-pill.critical {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.grade-pill.high {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.grade-pill.mid {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.grade-pill.clean {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Action Buttons */
.btn-primary-action {
  padding: 6px 12px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid #0f172a;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.btn-primary-action:hover {
  background: #1e293b;
}

.btn-table-action {
  padding: 4px 10px;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-table-action:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.btn-del-inspector {
  padding: 3px 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 11px;
  font-weight: 400;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-del-inspector:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Dispatch BU Cards */
.dispatch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.dispatch-card {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #ffffff;
  transition: all 0.15s ease;
}
.dispatch-card.active {
  border-color: #64748b;
  background: #f8fafc;
}
.dispatch-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}

/* Modal Drawer for Case Detail */
.admin-modal-drawer {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal-drawer.active {
  display: flex;
}
.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.admin-modal-card {
  position: relative;
  background: #ffffff;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: none;
  border: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.18s ease-out;
}
.admin-modal-header {
  padding: 13px 18px;
  background: #f8fafc;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-modal-title {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0;
}
.admin-modal-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.admin-modal-close:hover {
  color: #0f172a;
}
.admin-modal-body {
  padding: 18px;
  overflow-y: auto;
}
.admin-modal-footer {
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
}
