/* =================================================================
   SecondFloor ShotManager — 공통 디자인 토큰

   * 외부 CDN 을 쓰지 않습니다 (오프라인 서버에서도 동일하게 렌더)
   * 폰트는 static/fonts 의 Noto Sans KR 을 사용합니다
   * 색: 브랜드 초록과 상태색을 분리했습니다.
     예전에는 #4CAF50 하나가 브랜드·완료·버튼·강조를 전부 겸해
     어떤 초록이 "완료"인지 화면만 보고 알 수 없었습니다.
   ================================================================= */

/* 워크시트용 폰트 — 원본과 같은 이름(Pretendard / Pretendard)으로 등록합니다.
   원본은 DB/project_ 기준 상대경로를 썼지만, 이제 워크시트가
   라우트에서 렌더되므로 /static/fonts 로 옮겼습니다. 
@font-face {
  font-family: "ntss";
  src: url("/static/fonts/NotoSans-VariableFont_wdth,wght.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "ntsskr";
  src: url("/static/fonts/NotoSansKR-VariableFont_wght.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
}*/
@font-face {
    font-family: 'Pretendard';
    src: url('/static/fonts/Pretendard-Regular.woff') format('woff2');
    font-weight: 100;
    font-display: swap;
}


:root {
  /* --- 바탕: D65 레퍼런스 모니터 기준의 푸른기 도는 중성색 --- */
  --void:   #242424;
  --haze:   #242424;
  --slab:   #242424;
  --slab-2: #242424;

  /* --- 바탕: D65 레퍼런스 모니터 기준의 푸른기 도는 중성색 --- 
  --void:   #08090B;
  --haze:   #101318;
  --slab:   #161A21;
  --slab-2: #1D222A;
  */

  /* --- 유리 --- */
  --glass-fill:  linear-gradient(140deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  --glass-fill-bright:  linear-gradient(140deg, rgba(255,255,255,.20), rgba(255,255,255,.135));
  --glass-rim:   rgba(255,255,255,.16);
  --glass-spec:  rgba(255,255,255,.24);
  --glass-blur:  22px;
  --glass-shade: 0 16px 48px rgba(0,0,0,.5);

  /* --- 브랜드 --- */
  --brand:      #3EE87F;
  --brand-deep: #16B45C;
  --brand-ink:  #04140B;

  /* --- 상태색 (브랜드와 분리) --- */
  --s-before:  #242424;
  --s-working: #4084b0;
  --s-wait:    #f8a337;
  --s-deliver: #e8c63f;
  --s-revise:  #a3dd5d;
  --s-done:    #216d3c;
  --s-hold:    #7d2c2c;
  --s-drop:    #3b3b3b;
  --s-indone:#81b29a;
  --s-inwait:#829867;
  --s-finish: #1f9b4b;

  /* --- 알림 --- */
  --ok:   #3EE87F;
  --warn: #FFB020;
  --err:  #FF4D6D;
  --info: #4CC9F0;

  /* --- 글자 --- */
  --ink:   #d2d2d2;
  --ink-2: #97A3B0;
  --ink-3: #5C6773;

  /* 원본과 동일한 폰트 구성.
       화면 전반  : Segoe UI 계열 (원본 dashboard/common/login/admin)
       워크시트   : Pretendard / Pretendard = Noto Sans + Noto Sans KR (원본 워크시트)
     숫자용 고정폭은 Segoe UI 와 짝을 이루는 Consolas 를 씁니다. */
  --sans: "Pretendard", Pretendard, Tahoma, Geneva, Verdana, "Malgun Gothic", "맑은 고딕", sans-serif;
  --sans-ws: "Pretendard", "Pretendard", "Segoe UI", Arial, sans-serif;
  --mono: Consolas, "Malgun Gothic", monospace;

  /* --- 형태 --- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --line:   rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.055);

  --ease: cubic-bezier(.22,1,.36,1);
}

/* 밝은 테마 — 낮에 사무실에서 보는 PM/프로듀서용 */
:root[data-theme="light"] {
  --void:   #EDF0F4;
  --haze:   #E3E8EE;
  --slab:   rgba(255,255,255,.55);
  --slab-2: #F5F8FB;

  --glass-fill:  linear-gradient(140deg, rgba(255,255,255,.40), rgba(255,255,255,.45));
  --glass-rim:   rgba(255,255,255,.95);
  --glass-spec:  rgba(255,255,255,1);
  --glass-shade: 0 14px 38px rgba(20,32,48,.13);

  --brand:      #0FA958;
  --brand-deep: #0B7F42;
  --brand-ink:  #FFFFFF;

  --s-before:  #363636;
  --s-working: #4084b0;
  --s-wait:    #f8a337;
  --s-deliver: #e8c63f;
  --s-revise:  #a3dd5d;
  --s-done:    #216d3c;
  --s-hold:    #7d2c2c;
  --s-drop:    #3b3b3b;
  --s-indone:#81b29a;
  --s-inwait:#829867;
  --s-finish: #1f9b4b;

  --ok: #0FA958; --warn: #C77D00; --err: #D62F4E; --info: #0E8FC4;

  --ink:   #101820;
  --ink-2: #4A5765;
  --ink-3: #7A8694;

  --line:   rgba(16,24,32,.11);
  --line-2: rgba(16,24,32,.06);
}

/* =================================================================
   리셋
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans-ws);
  background: var(--void);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(128,140,155,.35);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(128,140,155,.55); background-clip: content-box; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 숫자 정렬만 담당합니다. 폰트는 각 화면 것을 그대로 물려받습니다
   (대시보드는 Segoe UI, 워크시트는 Pretendard). */
.mono { font-variant-numeric: tabular-nums; }
.ws-tabel .mono {
  padding: 7px 8px;
}

/* =================================================================
   유리 표면
   ================================================================= */
.glass {
  position: relative;
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--glass-spec),
              inset 0 -1px 0 rgba(255,255,255,.05),
              var(--glass-shade);
}
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--glass-rim), rgba(255,255,255,.02) 42%, rgba(255,255,255,.09));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  pointer-events: none;
}

/* 배경 오로라 — 유리가 굴절할 대상 */
.aurora {
  position: fixed; inset: -20%;
  z-index: 0; pointer-events: none;
  filter: blur(72px) saturate(140%);
  opacity: .15;
}
.aurora i {
  position: absolute; display: block;
  border-radius: 50%; mix-blend-mode: screen;
  animation: aurora-drift 30s ease-in-out infinite;
}
.aurora i:nth-child(1) { width:44vw; height:44vw; left:1%;   top:2%;    background:#12B26B; animation-delay:0s; }
.aurora i:nth-child(2) { width:36vw; height:36vw; right:5%;  top:-6%;   background:#1E6BD6; animation-delay:-8s; }
.aurora i:nth-child(3) { width:40vw; height:40vw; left:28%;  bottom:0%; background:#5e3894; animation-delay:-16s; }
.aurora i:nth-child(4) { width:28vw; height:28vw; right:16%; bottom:6%; background:#0FA3A3; animation-delay:-24s; }
:root[data-theme="light"] .aurora { opacity: .3; }

@keyframes aurora-drift {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  33%     { transform: translate3d(5vw,-4vh,0) scale(1.12); }
  66%     { transform: translate3d(-4vw,4vh,0) scale(.92); }
}

/* =================================================================
   버튼
   ================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px;
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: background .18s var(--ease), border-color .18s, transform .18s var(--ease);
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: rgba(255,255,255,.11); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
:root[data-theme="light"] .btn:hover:not(:disabled) { background: var(--slab-2); }

.btn.primary {
  color: var(--brand-ink);
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(62,232,127,.28), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--err) 15%, transparent); }
.btn.ghost { background: transparent; }

.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  font-size: 17px; line-height: 1;
  color: var(--ink-2);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: color .18s, background .18s, transform .18s var(--ease);
}
.icon-btn:hover { color: var(--ink); background: rgba(255,255,255,.1); transform: translateY(-1px); }

.mini {
  padding: 3px 8px;
  font-size: 11px; font-weight: 500;
  /*color: var(--ink-2);*/
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  transition: color .16s, background .16s;
}
.mini:hover:not(:disabled) { color: var(--ink); background: rgba(255,255,255,.12); }
.mini:disabled { opacity: .35; cursor: not-allowed; }
.mini.danger { color: var(--err); }

/* =================================================================
   폼
   ================================================================= */
.ctl {
  padding: 7px 11px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .18s, background .18s;
}
.ctl option { color: #333; }
.ctl:hover { border-color: rgba(255,255,255,.2); }
.ctl:focus { border-color: var(--brand); background: rgba(255,255,255,.08); outline: none; }
.ctl::placeholder { color: var(--ink-3); }
:root[data-theme="light"] .ctl { background: #fff; }

.toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2);
  user-select: none; cursor: pointer;
}
.toggle input { accent-color: var(--brand); width: 15px; height: 15px; cursor: pointer; }
.toggle:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.toggle input:disabled { cursor: not-allowed; }

/* =================================================================
   상태 알약 / 칩
   ================================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  font-size: 11px; font-weight: 600;
  border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--s-before)) 17%, transparent);
  color: var(--c, var(--s-before));
  border: 1px solid color-mix(in srgb, var(--c, var(--s-before)) 34%, transparent);
}
.pill::before {
  content: ""; width: 5px; height: 5px; flex: none;
  border-radius: 50%; background: currentColor;
}

.s-before  { --c: var(--s-before); }
.s-working { --c: var(--s-working); }
.s-wait    { --c: var(--s-wait); }
.s-deliver { --c: var(--s-deliver); }
.s-revise  { --c: var(--s-revise); }
.s-done    { --c: var(--s-done); }
.s-hold    { --c: var(--s-hold); }
.s-drop    { --c: var(--s-drop); }
.s-indone    { --c: var(--s-indone); }
.s-inwait    { --c: var(--s-inwait); }
.s-finish { --c: var(--s-finish);}

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  font-size: 11.5px; font-weight: 500;
  border-radius: 999px;
  color: var(--c, var(--ink-2));
  background: color-mix(in srgb, var(--c, var(--ink-3)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--ink-3)) 28%, transparent);
}
.chip b { font-variant-numeric: tabular-nums; font-weight: 700; }

/* =================================================================
   진행 막대
   ================================================================= */
.bar {
  height: 5px; border-radius: 999px;
  background: rgba(255,255,255,.1);
  overflow: hidden;
}
:root[data-theme="light"] .bar { background: rgba(16,24,32,.1); }
.bar i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-deep), var(--brand));
  box-shadow: 0 0 10px rgba(62,232,127,.45);
  transition: width .5s var(--ease);
}

/* =================================================================
   토스트
   ================================================================= */
.toast-host {
  position: fixed; top: 18px; right: 18px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
  pointer-events: none;
}
.toast {
  padding: 11px 15px;
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  background: var(--glass-fill);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-rim);
  border-left: 3px solid var(--info);
  border-radius: var(--r-sm);
  box-shadow: var(--glass-shade);
  transform: translateX(120%);
  opacity: 0;
  transition: transform .28s var(--ease), opacity .28s;
  pointer-events: auto;
}
.toast.in { transform: translateX(0); opacity: 1; }
.toast.success { border-left-color: var(--ok); }
.toast.error   { border-left-color: var(--err); }
.toast.warning { border-left-color: var(--warn); }

/* =================================================================
   로딩
   ================================================================= */
.loading { text-align: center; padding: 24px; color: var(--ink-3); font-size: 13px; }
.spinner {
  width: 30px; height: 30px; margin: 0 auto 10px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =================================================================
   접근성
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
