/* =============================================
   dashboard.css — 대시보드·목록 공통 스타일
   ============================================= */

/* ── 페이지 레이아웃 ── */
.dash-layout { display: flex; flex-direction: column; min-height: 100vh; background: #f1f5f9; }

.dash-main {
  flex: 1;
  padding: 28px 32px 40px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 768px) { .dash-main { padding: 20px 16px 32px; } }

/* ── 페이지 헤더 ── */
.dash-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.dash-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-page-title i { color: #3b82f6; }
.dash-page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── KPI 카드 그리드 ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
@media (max-width: 1024px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 2px 10px rgba(15,23,42,.06);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow .18s, transform .18s;
}
.kpi-card:hover { box-shadow: 0 6px 20px rgba(15,23,42,.1); transform: translateY(-1px); }
.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.kpi-icon.blue   { background: #dbeafe; color: #2563eb; }
.kpi-icon.green  { background: #dcfce7; color: #16a34a; }
.kpi-icon.orange { background: #ffedd5; color: #ea580c; }
.kpi-icon.purple { background: #ede9fe; color: #7c3aed; }
.kpi-icon.indigo { background: #e0e7ff; color: #4338ca; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-label {
  font-size: .75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 1.9rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}
.kpi-sub {
  font-size: .78rem;
  color: #94a3b8;
  margin-top: 4px;
}
.kpi-sub .up   { color: #16a34a; font-weight: 600; }
.kpi-sub .down { color: #dc2626; font-weight: 600; }

/* ── 차트 그리드 ── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .chart-grid, .chart-grid-3 { grid-template-columns: 1fr; }
}

.chart-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 10px rgba(15,23,42,.06);
}
.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}
.chart-card-title {
  font-size: .95rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-card-title i { color: #3b82f6; font-size: .88rem; }
.chart-period-btns { display: flex; gap: 4px; }
.chart-period-btn {
  padding: 3px 10px;
  font-size: .74rem;
  font-weight: 600;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
}
.chart-period-btn.active,
.chart-period-btn:hover { background: #1e40af; border-color: #1e40af; color: #fff; }
.chart-wrap { position: relative; }

/* ── 최근 활동 카드 ── */
.recent-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 10px rgba(15,23,42,.06);
  margin-bottom: 24px;
}
.recent-list { display: flex; flex-direction: column; gap: 0; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
  cursor: pointer;
  border-radius: 8px;
  padding: 10px 8px;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: #f8fafc; }
.recent-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.recent-dot.done  { background: #16a34a; }
.recent-dot.draft { background: #f59e0b; }
.recent-body { flex: 1; min-width: 0; }
.recent-title {
  font-size: .9rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-meta { font-size: .78rem; color: #94a3b8; margin-top: 2px; }
.recent-amount {
  font-size: .88rem;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}
.recent-status {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.recent-status.done  { background: #dcfce7; color: #16a34a; }
.recent-status.draft { background: #fef9c3; color: #a16207; }

/* ── 공통 카드 ── */
.dash-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 2px 10px rgba(15,23,42,.06);
}

/* ── 빈 상태 ── */
.dash-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}
.dash-empty i { font-size: 2.5rem; margin-bottom: 12px; display: block; }
.dash-empty p { font-size: .9rem; }

/* ──────────────────────────────────────────────
   LIST PAGE
   ────────────────────────────────────────────── */

/* 필터바 */
.list-filterbar {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 140px;
}
.filter-group label {
  font-size: .74rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.filter-group input,
.filter-group select {
  padding: 7px 11px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .88rem;
  color: #0f172a;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.filter-group input:focus,
.filter-group select:focus { border-color: #3b82f6; }
.filter-group.wide { min-width: 200px; flex: 1; }
.filter-actions { display: flex; gap: 8px; align-items: flex-end; padding-bottom: 1px; }
.filter-date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-date-range span { color: #94a3b8; font-size: .85rem; }

/* 목록 테이블 */
.list-table-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
  overflow: hidden;
}
.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.list-table thead th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  user-select: none;
}
.list-table thead th.sortable { cursor: pointer; }
.list-table thead th.sortable:hover { color: #1e40af; }
.list-table thead th .sort-icon { margin-left: 4px; opacity: .4; font-size: .75rem; }
.list-table thead th.sort-asc  .sort-icon,
.list-table thead th.sort-desc .sort-icon { opacity: 1; color: #3b82f6; }
.list-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #0f172a;
}
.list-table tbody tr:last-child td { border-bottom: none; }
.list-table tbody tr:hover td { background: #f8fafc; }
.list-table .td-addr {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #475569;
  font-size: .83rem;
}
.list-table .td-amount {
  font-weight: 700;
  color: #1e40af;
  text-align: right;
  white-space: nowrap;
}
.list-table .td-actions { display: flex; gap: 6px; }
.list-empty td {
  text-align: center;
  padding: 56px;
  color: #94a3b8;
  font-size: .9rem;
}

/* 상태 배지 */
.status-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-chip.done  { background: #dcfce7; color: #16a34a; }
.status-chip.draft { background: #fef9c3; color: #a16207; }

/* 페이지네이션 */
.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid #f1f5f9;
  background: #fff;
  border-radius: 0 0 12px 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.pagination-info { font-size: .82rem; color: #64748b; }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btn {
  min-width: 34px; height: 34px;
  padding: 0 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.pagination-btn:hover:not(:disabled) { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }
.pagination-btn.active { background: #1e40af; border-color: #1e40af; color: #fff; }
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }

/* 목록 요약 바 */
.list-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.list-summary-text { font-size: .83rem; color: #64748b; }
.list-summary-text strong { color: #0f172a; }

/* 담당자 배지 */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 2px 9px 2px 6px;
  font-size: .78rem;
  font-weight: 600;
  color: #334155;
}
.user-chip .chip-avatar {
  width: 18px; height: 18px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .62rem; color: #fff; font-weight: 700;
  flex-shrink: 0;
}
/* 성명 + 지역본부 세로 배치 */
.user-chip .chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-chip .chip-name {
  font-size: .78rem;
  font-weight: 600;
  color: #334155;
}
.user-chip .chip-region {
  font-size: .68rem;
  font-weight: 400;
  color: #64748b;
}

/* 버튼 (대시보드·목록 공통) */
.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
}
.dash-btn:active { transform: scale(.97); }
.dash-btn-primary {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: #fff;
  box-shadow: 0 2px 6px rgba(59,130,246,.25);
}
.dash-btn-primary:hover { background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.dash-btn-secondary {
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
}
.dash-btn-secondary:hover { background: #f8fafc; }
.dash-btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1.5px solid #fecaca;
}
.dash-btn-danger:hover { background: #fee2e2; }
.dash-btn-sm { padding: 5px 12px; font-size: .8rem; border-radius: 7px; }
.dash-btn-xs { padding: 3px 9px; font-size: .75rem; border-radius: 6px; }
