/* ============================================================
   쿠팡 서플라이어허브 자동화 — 공통 디자인 시스템 (theme.css)
   기준: index.html 홈 화면 디자인
   모든 내부 페이지는 이 파일을 <link>하고 아래 클래스를 재사용한다.
   ============================================================ */

:root {
  --surface: #f4f5f7;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2328;
  --text-muted: #6b7280;
  --accent: #2563eb;
}
* { font-family: 'Noto Sans KR', -apple-system, 'Segoe UI', sans-serif; }
body { background: var(--surface); color: var(--text); font-size: .925rem; }

/* ── 상단바 ───────────────────────────────────────────────── */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1.25rem;
}
/* page-wrap-fluid(1600px) 화면들은 상단바도 같은 폭으로 맞춰야 로고/메뉴가 좌우로 어긋나지 않는다 */
.topbar-inner.topbar-inner-fluid {
  max-width: 1600px;
}
.brand-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .78rem;
  flex: none;
}
.brand-link { display: flex; align-items: center; text-decoration: none; }
.brand-text { font-weight: 700; font-size: 1rem; color: var(--text); margin-left: .55rem; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.topbar-chip {
  background: #eef2f7; color: var(--text-muted); border-radius: 999px;
  padding: .28rem .7rem; font-size: .78rem; font-weight: 500;
}
.topbar-user { font-size: .82rem; font-weight: 600; color: var(--text); margin-right: .25rem; }
.topbar-presence {
  background: #ecfdf5; color: #047857; max-width: 320px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 브레드크럼(경량) ─────────────────────────────────────── */
.crumb-bar {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text-muted); margin-bottom: .9rem;
}
.crumb-bar a { color: var(--text-muted); text-decoration: none; }
.crumb-bar a:hover { color: var(--accent); text-decoration: underline; }
.crumb-bar .crumb-sep { color: #c9ccd1; }
.crumb-bar .crumb-current { color: var(--text); font-weight: 600; }

/* ── 공통 페이지 폭 ───────────────────────────────────────── */
.page-wrap { max-width: 1320px; margin: 0 auto; padding: 1.25rem 1.25rem 2.5rem; }
.page-wrap-fluid { max-width: 1600px; margin: 0 auto; padding: 1.25rem 1.25rem 2.5rem; }

.page-title-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: .6rem;
  margin-bottom: 1rem;
}
.page-title-row h1,
.page-title-row h5 { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--text); }
.page-desc { font-size: .8rem; color: var(--text-muted); margin: -.5rem 0 1rem; }

.section-title {
  font-size: .82rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin: 1.75rem 0 .65rem;
}
.section-title:first-child { margin-top: 0; }

/* ── 요약(통계) 카드 ──────────────────────────────────────── */
.stat-tile {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--tile-accent, var(--accent));
  border-radius: 10px; padding: .9rem 1.1rem; height: 100%;
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.stat-tile .stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; margin-bottom: .2rem; }
.stat-tile .stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
a.tile-link .stat-tile:hover { border-color: #c7d2fe; box-shadow: 0 3px 10px rgba(17,24,39,.07); transform: translateY(-1px); cursor: pointer; }

/* ── 바로가기 타일 ────────────────────────────────────────── */
.tile-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: .95rem 1.05rem; height: 100%;
  display: flex; gap: .7rem; align-items: flex-start;
  position: relative;
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.tile:hover { border-color: #c7d2fe; box-shadow: 0 3px 10px rgba(17,24,39,.07); transform: translateY(-1px); }
.tile-icon {
  flex: none; width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  background: var(--chip-bg, #eef2ff); color: var(--chip-fg, #4338ca);
}
.tile-title { font-weight: 600; font-size: .88rem; color: var(--text); margin-bottom: 1px; }
.tile-desc { font-size: .76rem; color: var(--text-muted); line-height: 1.35; }

/* ── 타일 설명 말풍선 (물음표 아이콘 hover) ─────────────────── */
.tile-info {
  position: absolute; top: 7px; right: 7px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #cbd5e1; color: #fff; font-size: 10px; font-weight: 700; font-style: normal;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; cursor: help; z-index: 2;
  transition: background-color .12s ease;
}
.tile-info:hover, .tile-info:focus-visible { background: #64748b; }
.tile-info .tile-info-tip {
  visibility: hidden; opacity: 0;
  position: absolute; top: 22px; right: 0;
  width: 230px; max-width: 62vw;
  background: #1f2937; color: #f8fafc; font-size: 12px; font-weight: 400;
  padding: 8px 10px; border-radius: 6px; line-height: 1.5;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  transition: opacity .12s ease;
  text-align: left; white-space: normal; pointer-events: none;
}
.tile-info:hover .tile-info-tip, .tile-info:focus-visible .tile-info-tip {
  visibility: visible; opacity: 1;
}

.c-primary   { --chip-bg: #eff6ff; --chip-fg: #2563eb; }
.c-warning   { --chip-bg: #fffbeb; --chip-fg: #b45309; }
.c-success   { --chip-bg: #ecfdf5; --chip-fg: #059669; }
.c-danger    { --chip-bg: #fef2f2; --chip-fg: #dc2626; }
.c-info      { --chip-bg: #ecfeff; --chip-fg: #0891b2; }
.c-dark      { --chip-bg: #f1f5f9; --chip-fg: #334155; }
.c-secondary { --chip-bg: #f3f4f6; --chip-fg: #4b5563; }

/* ── 툴바 / 카드 섹션 ─────────────────────────────────────── */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1.1rem; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: .5rem;
}
.panel-header h6 { margin: 0; font-size: .85rem; font-weight: 700; color: var(--text); }
.panel-body { padding: 1rem 1.1rem; }
.panel-body-tight { padding: .65rem .85rem; }

/* 필터/검색/액션 줄 (panel 재사용 alias) */
.filter-bar { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; }
.filter-bar .form-control,
.filter-bar .form-select { font-size: .82rem; }

/* ── 테이블 ───────────────────────────────────────────────── */
.table-clean thead th {
  background: #f8fafc; color: var(--text-muted); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border);
  padding: .6rem .85rem; white-space: nowrap;
}
.table-clean tbody td { padding: .65rem .85rem; font-size: .84rem; vertical-align: middle; border-bottom: 1px solid #f1f2f4; }
.table-clean tbody tr:hover { background: #fafbfc; }
.table-clean tbody tr:last-child td { border-bottom: none; }
.table-clean.table-compact thead th { padding: .5rem .65rem; font-size: .7rem; }
.table-clean.table-compact tbody td { padding: .45rem .65rem; font-size: .78rem; }
.table-clean tbody tr.row-selected { background: #eff6ff; }
.table-clean tbody tr[onclick] { cursor: pointer; }

.badge-pill-status { border-radius: 999px; font-weight: 600; font-size: 10.5px; padding: .32em .65em; }

/* ── 상세 패널(리스트+상세 레이아웃 공용) ─────────────────── */
.detail-panel {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 1rem 1.1rem;
}
.detail-panel .detail-empty { color: var(--text-muted); text-align: center; padding: 2.5rem 0; }

/* ── 빈 상태 ──────────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--text-muted); padding: 2.25rem 1rem; font-size: .85rem; }

/* ── 모달 ─────────────────────────────────────────────────── */
.modal-content { border: 1px solid var(--border); border-radius: 12px; }
.modal-header { border-bottom: 1px solid var(--border); padding: .85rem 1.1rem; }
.modal-header .modal-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.modal-body { padding: 1.1rem; }
.modal-footer { border-top: 1px solid var(--border); padding: .75rem 1.1rem; }

/* ── 기타 유틸 ────────────────────────────────────────────── */
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.toast-container-fixed { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.nowrap { white-space: nowrap; }
