/* ============================================================
   dw.css — 대원 현장관리 공유 디자인 토큰
   모든 페이지에서 <link rel="stylesheet" href="dw.css"> 로 포함
   ============================================================ */

/* ── Pretendard 폰트 ── */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css");

:root {
  /* ── 배경 (쿨그레이) ── */
  --bg:        #eef0f3;
  --bg-2:      #f5f6f8;
  --surface:   #ffffff;
  --surface-2: #f7f8fa;
  --line:      #e3e6ea;
  --line-2:    #eceef1;

  /* ── 텍스트 ── */
  --ink:   #182331;
  --ink-2: #43505f;
  --ink-3: #6c7889;
  --ink-4: #9aa4b2;

  /* ── 네이비 (포인트) ── */
  --navy:      #1f3a5f;
  --navy-deep: #16293f;
  --navy-700:  #274b78;
  --navy-600:  #2f5d92;
  --navy-soft: #eaf0f7;
  --navy-soft2:#dde7f2;
  --navy-line: #c6d6e8;

  /* ── 상태 색상 ── */
  --st-intake:   #5b7ba6;  --st-intake-bg:   #eef2f8;  --st-intake-line:   #dbe5f0;
  --st-estimate: #b0843a;  --st-estimate-bg: #f7f1e4;  --st-estimate-line: #ece0c6;
  --st-material: #3f8f8a;  --st-material-bg: #e8f3f1;  --st-material-line: #cfe7e3;
  --st-work:     #6a6ab0;  --st-work-bg:     #eeedf8;  --st-work-line:     #dedcf0;
  --st-done:     #4b8a5f;  --st-done-bg:     #e9f3ec;  --st-done-line:     #d3e8da;

  --danger:    #c0544b;  --danger-bg: #f8ebe9;  --danger-line: #f0d4d0;
  --warn:      #c08a2e;  --warn-bg:   #f9f1df;

  /* ── 반경 ── */
  --r-sm: 7px;
  --r:    11px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* ── 그림자 ── */
  --sh-1: 0 1px 2px rgba(22,41,63,.06), 0 1px 1px rgba(22,41,63,.04);
  --sh-2: 0 2px 8px rgba(22,41,63,.07), 0 1px 2px rgba(22,41,63,.05);
  --sh-3: 0 10px 30px rgba(22,41,63,.14), 0 3px 10px rgba(22,41,63,.08);
}

/* ── 베이스 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Pretendard Variable", Pretendard,
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

/* ── 스크롤바 ── */
*::-webkit-scrollbar        { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb  { background: #c8cfd8; border-radius: 8px; }
*::-webkit-scrollbar-track  { background: transparent; }

/* ── 공통 버튼 ── */
.dw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; cursor: pointer; border: none;
  transition: background .14s, box-shadow .14s, transform .06s;
}
.dw-btn:active { transform: translateY(.5px); }
.dw-btn-primary   { background: var(--navy);    color: #fff; box-shadow: var(--sh-1); }
.dw-btn-primary:hover { background: var(--navy-deep); }
.dw-btn-secondary { background: var(--surface); color: var(--navy);  border: 1px solid var(--navy-line); }
.dw-btn-secondary:hover { background: var(--navy-soft); }
.dw-btn-ghost     { background: transparent;    color: var(--ink-2); }
.dw-btn-ghost:hover { background: rgba(31,58,95,.07); }
.dw-btn-danger    { background: var(--danger);  color: #fff; }
.dw-btn-warn      { background: var(--warn);    color: #fff; }

/* ── 공통 카드 ── */
.dw-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}

/* ── 배지 ── */
.dw-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: -.1px;
}
.dw-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* ── 포커스 ── */
:focus-visible { outline: 2px solid var(--navy-600); outline-offset: 2px; border-radius: 4px; }

/* ── 섹션 라벨 ── */
.dw-sec-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .2px;
}
.dw-sec-label .bar { width: 3px; height: 13px; background: var(--navy); border-radius: 2px; }

/* ── 진입 애니메이션 ── */
@media (prefers-reduced-motion: no-preference) {
  .fade-up { animation: _fadeUp .35s cubic-bezier(.22,.7,.3,1) both; }
  @keyframes _fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ════════════════════════════════════════════════════════════
   모바일 고정 상단 헤더  (.dw-header)
   · 모든 페이지 <body> 바로 아래 삽입
   · <body class="dw-body"> 로 상단 패딩 자동 적용
   · 880px 이상 데스크톱에서는 자동으로 숨김
   ════════════════════════════════════════════════════════════ */
.dw-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 54px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 14px; gap: 10px;
  box-shadow: 0 1px 8px rgba(22,41,63,.07);
}
.dw-brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(155deg, var(--navy-700), var(--navy-deep));
  display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 800; letter-spacing: -.3px;
  box-shadow: 0 2px 6px rgba(22,41,63,.3);
}
.dw-brand-name { font-size: 14px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; white-space: nowrap; }
.dw-page-sep   { width: 1px; height: 16px; background: var(--line); flex-shrink: 0; }
.dw-page-name  { font-size: 13px; font-weight: 700; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-header-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dw-hbtn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 11px; border-radius: var(--r-sm);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  border: none; cursor: pointer; white-space: nowrap;
  transition: background .14s;
}
.dw-hbtn-primary { background: var(--navy); color: #fff; }
.dw-hbtn-primary:hover { background: var(--navy-deep); }
.dw-hbtn-ghost  { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.dw-hbtn-ghost:hover  { background: var(--navy-soft); color: var(--navy); }

/* 헤더 높이만큼 body 상단 패딩 */
.dw-body { padding-top: 54px !important; }

/* 데스크톱: 헤더 숨김, 기존 top-bar 사용 */
@media (min-width: 880px) {
  .dw-header { display: none; }
  .dw-body   { padding-top: 0 !important; }
}
