/* ==========================================================================
   Dowork 디자인 시스템
   업무 관리 도구의 관행을 정면으로 실행한다. 기준선은 Linear(밀도·절제),
   Notion(읽기 편한 타이포), Jira/Asana(상태·담당자·기한이 전면),
   Google 캘린더(날짜·시간의 표준 문법).
   키보드 중심 조작은 요구하지 않는다 — 모든 기능이 마우스만으로 도달 가능하다.

   사용 장면: 사무실 형광등 아래, 모니터 한쪽에 하루 종일 띄워두고 수시로 흘끗 본다.
   → 라이트 테마. 중성색 바탕에 상태만 색으로.

   외부 폰트·CDN 을 쓰지 않는다 (컨테이너 안에서 오프라인으로 떠야 한다).
   ========================================================================== */

/* --- 토큰 ---------------------------------------------------------------- */

:root {
  /* 바탕과 면 */
  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-surface-sunken: #fafbfc;
  --c-surface-hover: #f4f5f7;
  --c-surface-active: #eceef2;

  /* 선 */
  --c-line: #e5e7ec;
  --c-line-strong: #d2d6de;

  /* 글자 — 흰 바탕 대비 확보 */
  --c-text: #14171c;        /* 16.4:1 */
  --c-text-2: #565d6b;      /* 6.6:1  */
  --c-text-3: #697180;      /* 4.9:1 흰 바탕 / 4.7:1 가라앉은 면 */

  /* 액센트 */
  --c-accent: #4a58c8;
  --c-accent-hover: #3d4ab0;
  --c-accent-active: #343f96;
  --c-accent-soft: #eef0fb;
  --c-accent-line: #c9cff0;

  /* 상태 — 배경은 옅게, 글자는 진하게(대비 확보) */
  --c-neutral-fg: #4b5563;
  --c-neutral-bg: #eef0f3;
  --c-neutral-line: #dcdfe5;

  --c-info-fg: #1f5fa9;
  --c-info-bg: #e8f1fb;
  --c-info-line: #c5dcf3;

  --c-warn-fg: #94620a;
  --c-warn-bg: #fdf3d9;
  --c-warn-line: #f0dfae;

  --c-ok-fg: #17683c;
  --c-ok-bg: #e4f4ea;
  --c-ok-line: #bfe3cd;

  --c-danger-fg: #b02a2a;
  --c-danger-bg: #fdeaea;
  --c-danger-line: #f4c9c9;

  /* 간격 — 4px 기준 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* 모서리 */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-pill: 999px;

  /* 그림자 — 오프셋과 부드러운 블러를 함께 갖는다 */
  --sh-sm: 0 1px 2px rgba(16, 20, 28, 0.06), 0 1px 1px rgba(16, 20, 28, 0.04);
  --sh-md: 0 4px 12px rgba(16, 20, 28, 0.08), 0 1px 3px rgba(16, 20, 28, 0.06);
  --sh-lg: 0 14px 36px rgba(16, 20, 28, 0.14), 0 3px 10px rgba(16, 20, 28, 0.08);

  /* 치수 */
  --sidebar-w: 232px;
  --topbar-h: 56px;

  /* 움직임 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur: 200ms;

/* 브랜드 — logo/dowork_logo.png 의 D 와 상승 화살표에서 뽑았다.
     제품 UI 의 중성 팔레트와 별개로, 로고를 쓰는 자리(마크·로그인)에서만 쓴다. */
  --brand-navy: #12243f;
  --brand-navy-deep: #123a63;
  /* --brand-navy 를 아래로 늘린 두 단. 브랜드 어두운 면(로그인)의 바탕이다. */
  --brand-ink: #0c1a30;
  --brand-ink-deep: #070f1c;
  --brand-blue: #1b5fae;
  --brand-blue-deep: #12356b;
  --brand-blue-press: #17538f;
  --brand-sky: #2ec5ff;
  --brand-sky-press: #14a8e8;
  --brand-cyan: #1aa7e8;
  --brand-teal: #17c9b8;
  --brand-shadow: rgba(16, 38, 74, 0.16);
  --brand-shadow-soft: rgba(16, 38, 74, 0.08);
  --brand-glow: rgba(20, 80, 160, 0.24);
  --brand-line: rgba(26, 95, 174, 0.26);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Segoe UI", "Noto Sans KR", "Malgun Gothic", system-ui,
    sans-serif;
  /* 숫자도 같은 글꼴을 쓴다. 자리를 맞추는 일은 tabular-nums 가 하지 별도
     고정폭 글꼴이 하지 않는다 — 글꼴이 갈리면 표 안에서 숫자만 튀어 보인다. */
  --font-num: var(--font);
}

/* Pretendard 를 컨테이너 안에 담아 쓴다. CDN 을 부르지 않는다 — 오프라인에서
   떠야 하고, 사용자 PC 에 설치돼 있는지에 화면이 좌우되면 안 된다.
   가변 글꼴 한 벌(2MB)이 45~920 굵기를 전부 덮는다. SIL OFL 1.1,
   전문은 static/fonts/LICENSE.txt. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

/* --- 기본 --------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.011em;
  text-wrap: balance;
}

h1 {
  font-size: 20px;
  line-height: 1.3;
}
h2 {
  font-size: 15px;
  line-height: 1.4;
}
h3 {
  font-size: 13px;
  line-height: 1.4;
  color: var(--c-text-2);
}

p {
  margin: 0;
}

a {
  color: var(--c-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-num);
  font-size: 0.92em;
  background: var(--c-surface-active);
  padding: 1px 5px;
  border-radius: var(--r-sm);
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::placeholder {
  color: var(--c-text-3);
}

/* 숫자·시각은 자리가 흔들리지 않아야 한다 */
.num,
time,
td.num,
.tabular {
  font-variant-numeric: tabular-nums;
}

/* --- 앱 셸 -------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* 사이드바 */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border-right: 1px solid var(--c-line);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: var(--topbar-h);
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--c-line);
  flex: none;
}

.sidebar__brand-mark {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--c-accent);
}

.sidebar__brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.navlink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px var(--sp-3);
  border-radius: var(--r-md);
  color: var(--c-text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--dur-fast), color var(--dur-fast);
}

.navlink:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
  text-decoration: none;
}

.navlink[aria-current="page"] {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-weight: 600;
}

.navlink svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.9;
}

.sidebar__foot {
  flex: none;
  padding: var(--sp-3);
  border-top: 1px solid var(--c-line);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.sidebar__user {
  min-width: 0;
  flex: 1;
}

.sidebar__user-name {
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-sub {
  font-size: 11.5px;
  color: var(--c-text-3);
}

/* 상단바 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-line);
}

.topbar__title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar__spacer {
  flex: 1;
}

.topbar__search {
  position: relative;
  width: min(340px, 38vw);
}

.topbar__search svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--c-text-3);
  pointer-events: none;
}

.topbar__search input[type="search"] {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 34px;
  cursor: pointer;
}

.sidebar__toggle {
  display: none;
}

/* 인증이 꺼진 채 떠 있을 때의 경고 칩 — 조용히 열려 있는 것보다 낫다 */
#auth-off-chip {
  flex: none;
  height: 24px;
  gap: 4px;
}
#auth-off-chip:hover {
  text-decoration: none;
  filter: brightness(0.97);
}
#auth-off-chip svg {
  width: 13px;
  height: 13px;
}
#auth-off-chip::before {
  display: none;
}

/* 내용 영역 */
.content {
  min-width: 0;
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.page-head__text {
  min-width: 0;
  flex: 1;
}

.page-head p {
  color: var(--c-text-2);
  margin-top: var(--sp-1);
  max-width: 68ch;
}

.page-head__actions {
  display: flex;
  gap: var(--sp-2);
  flex: none;
}

/* --- 패널 --------------------------------------------------------------- */

.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  min-width: 0;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-line);
  min-height: 44px;
}

.panel__head h2 {
  flex: none;
}

.panel__head-spacer {
  flex: 1;
}

.panel__body {
  padding: var(--sp-4);
}

.panel__body--flush {
  padding: 0;
}

.panel__foot {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--c-line);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* --- 버튼 --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast),
    box-shadow var(--dur-fast);
  box-shadow: var(--sh-sm);
}

.btn:hover {
  background: var(--c-surface-hover);
}
.btn:active {
  background: var(--c-surface-active);
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn--primary {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
}
.btn--primary:active {
  background: var(--c-accent-active);
}

.btn--ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--c-text-2);
}
.btn--ghost:hover {
  background: var(--c-surface-hover);
  color: var(--c-text);
}

.btn--danger {
  color: var(--c-danger-fg);
  border-color: var(--c-danger-line);
  background: var(--c-surface);
}
.btn--danger:hover {
  background: var(--c-danger-bg);
}

.btn--sm {
  height: 27px;
  padding: 0 9px;
  font-size: 12.5px;
}
.btn--sm svg {
  width: 13px;
  height: 13px;
}

.btn--icon {
  width: 32px;
  padding: 0;
}
.btn--icon.btn--sm {
  width: 27px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.is-busy {
  color: transparent;
  position: relative;
  pointer-events: none;
}
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  color: var(--c-text-2);
  animation: spin 620ms linear infinite;
}
.btn--primary.is-busy::after {
  color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- 폼 ----------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field > label,
.label {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--c-text-2);
}

.field__hint {
  font-size: 12px;
  color: var(--c-text-3);
}

.field__error {
  font-size: 12px;
  color: var(--c-danger-fg);
}

input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

textarea {
  height: auto;
  min-height: 96px;
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
}

input[type="date"],
input[type="time"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
  padding: 0;
  color: var(--c-text);
}
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field {
  padding: 1px 2px;
  border-radius: var(--r-sm);
}
input[type="date"]::-webkit-datetime-edit-year-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="time"]::-webkit-datetime-edit-hour-field:focus,
input[type="time"]::-webkit-datetime-edit-minute-field:focus {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  outline: none;
}
/* 구분자를 옅게 해서 숫자가 먼저 읽히게 한다 */
input[type="date"]::-webkit-datetime-edit-text {
  color: var(--c-text-3);
  padding: 0 1px;
}
/* 비어 있을 때 브라우저가 채워 넣는 `yyyy. mm. dd.` 를 지운다. 고르기 전에는
   빈 칸과 달력 아이콘만 보이는 편이 훑기 좋다. 칸을 누르면 다시 나타나므로
   무엇을 넣는 자리인지 알 수 있다. `.is-empty` 는 app.js 가 붙인다.

   color 대신 opacity 를 쓴다 — 구분자(`::-webkit-datetime-edit-text`)가 제 색을
   따로 갖고 있어서 color 로는 슬래시만 남는다(실측). opacity 는 그 안쪽까지
   한 번에 덮고, 풀릴 때 원래 색 규칙이 그대로 되살아난다. */
input[type="date"].is-empty::-webkit-datetime-edit,
input[type="time"].is-empty::-webkit-datetime-edit {
  opacity: 0;
}
input[type="date"].is-empty:focus::-webkit-datetime-edit,
input[type="time"].is-empty:focus::-webkit-datetime-edit {
  opacity: 1;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.5;
  cursor: pointer;
  border-radius: var(--r-sm);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: var(--c-surface-hover);
}

/* 파일 선택 — 브라우저 기본 모양이 다른 입력과 따로 논다. 바깥 틀은 다른
   입력과 같은 면·선·높이로 맞추고, 안쪽 버튼은 `.btn` 과 같은 모양으로
   그린다. 버튼 글자("파일 선택")는 브라우저가 정하므로 건드릴 수 없다. */
input[type="file"] {
  width: 100%;
  min-width: 0;
  height: 34px;
  /* flex 로는 안쪽 버튼이 가운데로 오지 않는다 — Chrome 이 파일 입력을 flex
     컨테이너로 잡아 주지 않아서 버튼이 6px 위로 붙는다(실측). 위아래 패딩과
     줄 높이로 세운다: 테두리 1px 씩을 뺀 32px 안에서 3px + 26px + 3px. */
  padding: 3px 10px 3px 3px;
  line-height: 26px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
input[type="file"]::file-selector-button {
  height: 26px;
  margin: 0 10px 0 0;
  padding: 0 12px;
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-sm);
  background: var(--c-surface-sunken);
  color: var(--c-text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 550;
  /* 테두리 1px 씩을 뺀 24px 로 버튼 글자도 세로 가운데에 온다 */
  line-height: 24px;
  vertical-align: top;
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
input[type="file"]::file-selector-button:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-text-3);
}
input[type="file"]:hover {
  border-color: var(--c-text-3);
}
input[type="file"]:focus-visible {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}
input[type="file"]:disabled,
input[type="file"]:disabled::file-selector-button {
  cursor: not-allowed;
  background: var(--c-surface-sunken);
  color: var(--c-text-3);
}

/* --- 목록 나누기 (달 이동 · 쪽 이동) ------------------------------------- */

.monthnav {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.monthnav__label {
  min-width: 104px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.pager {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--c-line);
}
.pager__spacer {
  flex: 1;
}
.pager__count {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--c-text-2);
  min-width: 52px;
  text-align: center;
}

select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23697180' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--c-surface-sunken);
  color: var(--c-text-3);
  cursor: not-allowed;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--c-danger-line);
}
input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px var(--c-danger-bg);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  cursor: pointer;
}
.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--c-accent);
  cursor: pointer;
}

/* 라디오를 세그먼트 스위치로 (내부/외부 같은 이지선다) */
.segmented {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--c-surface-active);
  border-radius: var(--r-md);
}
.segmented label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 550;
  color: var(--c-text-2);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
  white-space: nowrap;
}
.segmented input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.segmented label:hover {
  color: var(--c-text);
}
.segmented input:checked + span {
  color: var(--c-text);
}
.segmented label:has(input:checked) {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--sh-sm);
}
.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--c-accent);
  outline-offset: 1px;
}

/* 가로로 늘어놓는 폼 줄 */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
}
.form-row > .field {
  flex: 1 1 180px;
}
.form-row > .field--narrow {
  flex: 0 1 140px;
}
.form-row > .field--wide {
  flex: 3 1 320px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--sp-3);
}

/* 필터 줄 */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-line);
  background: var(--c-surface-sunken);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.filters select,
.filters input {
  height: 30px;
  font-size: 13px;
  width: auto;
  min-width: 120px;
}
.filters .filters__spacer {
  flex: 1;
}

/* --- 상태 배지 ----------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-neutral-line);
  background: var(--c-neutral-bg);
  color: var(--c-neutral-fg);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge--plain::before {
  display: none;
}

.badge--info {
  background: var(--c-info-bg);
  color: var(--c-info-fg);
  border-color: var(--c-info-line);
}
.badge--warn {
  background: var(--c-warn-bg);
  color: var(--c-warn-fg);
  border-color: var(--c-warn-line);
}
.badge--ok {
  background: var(--c-ok-bg);
  color: var(--c-ok-fg);
  border-color: var(--c-ok-line);
}
.badge--danger {
  background: var(--c-danger-bg);
  color: var(--c-danger-fg);
  border-color: var(--c-danger-line);
}
.badge--accent {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  border-color: var(--c-accent-line);
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--c-surface-active);
  color: var(--c-text-2);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* 목록으로 돌아가는 링크 — 화살표는 글리프가 아니라 그린 아이콘이다 */
.page-head__text a.small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.page-head__text a.small svg {
  width: 13px;
  height: 13px;
}

/* 배지 안의 제거 버튼 */
.badge__x {
  display: inline-flex;
  align-items: center;
  border: none;
  background: none;
  padding: 0;
  margin-left: 1px;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
}
.badge__x:hover {
  opacity: 1;
}
.badge__x svg {
  width: 11px;
  height: 11px;
}

/* --- 표 ----------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-3);
  padding: 9px var(--sp-4);
  border-bottom: 1px solid var(--c-line);
  background: var(--c-surface-sunken);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

table.data td {
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--c-line);
  vertical-align: middle;
}

table.data tbody tr:last-child td {
  border-bottom: none;
}

table.data tbody tr {
  transition: background var(--dur-fast);
}

table.data tbody tr:hover {
  background: var(--c-surface-hover);
}

table.data tr.is-clickable {
  cursor: pointer;
}

table.data tr[aria-selected="true"] {
  background: var(--c-accent-soft);
}

td.shrink,
th.shrink {
  width: 1%;
  white-space: nowrap;
}

td.right,
th.right {
  text-align: right;
}

/* 표 셀 안에 글자와 나란히 놓이는 아이콘. 크기를 정해 두지 않으면
   svg 기본 크기(보통 300px)로 부풀어 파일명이 밀려난다. */
table.data td > svg {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--c-text-3);
  vertical-align: -2px;
  margin-right: 2px;
}

.cell-title {
  font-weight: 550;
  color: var(--c-text);
}

.cell-sub {
  color: var(--c-text-3);
  font-size: 12.5px;
}

.row-actions {
  display: flex;
  gap: var(--sp-1);
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--dur-fast);
}
tr:hover .row-actions,
tr:focus-within .row-actions {
  opacity: 1;
}

/* --- 탭 ----------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--c-line);
  padding: 0 var(--sp-4);
  overflow-x: auto;
}

.tab {
  position: relative;
  padding: 9px 10px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--c-text-2);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover {
  color: var(--c-text);
}

.tab[aria-selected="true"] {
  color: var(--c-accent);
}

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -1px;
  height: 2px;
  background: var(--c-accent);
}

/* --- 빈 상태 ------------------------------------------------------------- */
/* 이 제품은 데이터가 하나도 없는 상태로 시작한다. 빈 화면은 예외가 아니라
   기본값이므로 첫 번째 시민으로 다룬다. 가짜 데이터를 채워 넣지 않는다. */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-6);
  color: var(--c-text-2);
}

.empty__mark {
  width: 40px;
  height: 40px;
  color: var(--c-text-3);
  opacity: 0.75;
}

.empty__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}

.empty__text {
  font-size: 13px;
  max-width: 46ch;
  color: var(--c-text-2);
}

.empty--sm {
  padding: var(--sp-6) var(--sp-4);
  gap: var(--sp-2);
}
.empty--sm .empty__mark {
  width: 28px;
  height: 28px;
}

/* --- 대화상자 ------------------------------------------------------------ */

dialog.modal {
  padding: 0;
  border: none;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  background: var(--c-surface);
  color: var(--c-text);
  width: min(620px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
}

dialog.modal--wide {
  width: min(880px, calc(100vw - 32px));
}

dialog.modal::backdrop {
  background: rgba(18, 22, 30, 0.42);
  backdrop-filter: blur(2px);
}

dialog.modal[open] {
  animation: modal-in var(--dur) var(--ease-out);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

.modal__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-line);
}
.modal__head h2 {
  font-size: 15px;
  flex: 1;
}

.modal__body {
  padding: var(--sp-5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.modal__foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--c-line);
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  background: var(--c-surface-sunken);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
}

/* --- 알림 --------------------------------------------------------------- */

.toasts {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 260px;
  max-width: 380px;
  padding: 10px 13px;
  border-radius: var(--r-lg);
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  box-shadow: var(--sh-lg);
  font-size: 13.5px;
  pointer-events: auto;
  animation: toast-in var(--dur) var(--ease-out);
}

.toast svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
}

.toast--ok svg {
  color: var(--c-ok-fg);
}
.toast--error {
  border-color: var(--c-danger-line);
}
.toast--error svg {
  color: var(--c-danger-fg);
}

.toast__text {
  flex: 1;
  min-width: 0;
}
.toast__title {
  font-weight: 600;
}
.toast__detail {
  color: var(--c-text-2);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* --- 캘린더 ------------------------------------------------------------- */

.cal {
  --cal-line: var(--c-line);
}

.cal__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-line);
}

.cal__month {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  min-width: 116px;
}

.cal__nav {
  display: flex;
  gap: var(--sp-1);
}

.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--cal-line);
}

.cal__dow {
  padding: 7px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--c-text-3);
  text-align: center;
  border-bottom: 1px solid var(--cal-line);
  background: var(--c-surface-sunken);
}
.cal__dow--sun {
  color: var(--c-danger-fg);
}
.cal__dow--sat {
  color: var(--c-info-fg);
}

.cal__cell {
  min-height: 104px;
  padding: 5px 6px 7px;
  border-right: 1px solid var(--cal-line);
  border-bottom: 1px solid var(--cal-line);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  background: var(--c-surface);
}

.cal__cell:nth-child(7n + 7) {
  border-right: none;
}

.cal__cell--out {
  background: var(--c-surface-sunken);
}
.cal__cell--out .cal__daynum {
  color: var(--c-text-3);
  opacity: 0.7;
}

.cal__daynum {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--c-text-2);
  align-self: flex-start;
  padding: 1px 5px;
  border-radius: var(--r-sm);
}

/* 요일 머리글과 같은 규칙을 날짜 숫자에도 적용한다 — 일요일은 붉게,
   토요일은 푸르게. 달력의 표준 문법이다. */
.cal__cell--sun .cal__daynum {
  color: var(--c-danger-fg);
}
.cal__cell--sat .cal__daynum {
  color: var(--c-info-fg);
}
.cal__cell--out .cal__daynum,
.cal__cell--out.cal__cell--sun .cal__daynum,
.cal__cell--out.cal__cell--sat .cal__daynum {
  color: var(--c-text-3);
  opacity: 0.7;
}

/* 오늘은 숫자에 알약을 씌우는 대신 **칸 전체**를 옅게 물들인다. 훑을 때
   숫자 하나보다 면이 먼저 눈에 들어온다. 숫자 색은 요일 규칙을 그대로 둔다. */
.cal__cell--today {
  background: var(--c-accent-soft);
  box-shadow: inset 0 0 0 1px var(--c-accent-line);
}
.cal__cell--today .cal__daynum {
  color: var(--c-accent);
  font-weight: 700;
}
/* 오늘이 주말이면 요일 색을 지키되 굵기로 오늘임을 말한다. */
.cal__cell--today.cal__cell--sun .cal__daynum {
  color: var(--c-danger-fg);
}
.cal__cell--today.cal__cell--sat .cal__daynum {
  color: var(--c-info-fg);
}
/* 옅은 바탕 위에서는 항목 칩이 묻히므로 흰 면으로 되돌린다. */
.cal__cell--today .cal__item {
  background: var(--c-surface);
}

.cal__item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 5px;
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  border: none;
  background: var(--c-surface-hover);
  color: var(--c-text);
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  min-width: 0;
  transition: background var(--dur-fast);
}
.cal__item:hover {
  background: var(--c-surface-active);
}

.cal__item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal__item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: none;
  background: var(--c-text-3);
}
.cal__item--meeting::before {
  background: var(--c-info-fg);
}
.cal__item--daily_log::before {
  background: var(--c-warn-fg);
}
.cal__item--project_start::before {
  background: var(--c-ok-fg);
}

.cal__more {
  font-size: 11.5px;
  color: var(--c-text-3);
  padding: 1px 5px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.cal__more:hover {
  color: var(--c-text);
  text-decoration: underline;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  font-size: 12.5px;
  color: var(--c-text-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

/* --- 목록(현황판·일정) --------------------------------------------------- */

.stack {
  display: flex;
  flex-direction: column;
}

.rowitem {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-4);
  border-bottom: 1px solid var(--c-line);
  min-width: 0;
  text-align: left;
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--c-text);
  cursor: pointer;
  transition: background var(--dur-fast);
}
.rowitem:last-child {
  border-bottom: none;
}
.rowitem:hover {
  background: var(--c-surface-hover);
}

.rowitem__time {
  flex: none;
  width: 46px;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--c-text-2);
  font-weight: 550;
}

.rowitem__main {
  flex: 1;
  min-width: 0;
}

.rowitem__main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rowitem__title {
  font-weight: 550;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rowitem__sub {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--c-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rowitem__right {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* --- 폴더 트리 ----------------------------------------------------------- */

.tree {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: var(--sp-2);
}

.tree__node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13.5px;
  border: none;
  background: none;
  font-family: inherit;
  color: var(--c-text);
  text-align: left;
  width: 100%;
  transition: background var(--dur-fast);
}
.tree__node:hover {
  background: var(--c-surface-hover);
}
.tree__node[aria-current="true"] {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-weight: 600;
}
.tree__node svg {
  width: 15px;
  height: 15px;
  flex: none;
  opacity: 0.85;
}
.tree__node-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree__twist {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--c-text-3);
  transition: transform var(--dur-fast);
}
.tree__twist--open {
  transform: rotate(90deg);
}

/* --- 배치 유틸 ----------------------------------------------------------- */

.grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--sp-5);
  align-items: start;
}

.grid-side-left {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}

.col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  min-width: 0;
}

.row {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}

.muted {
  color: var(--c-text-2);
}
.dim {
  color: var(--c-text-3);
}
.small {
  font-size: 12.5px;
}
.nowrap {
  white-space: nowrap;
}
.hidden {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.divider {
  height: 1px;
  background: var(--c-line);
  border: none;
  margin: 0;
}

/* 로딩 자리 표시 */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
}
.skeleton i {
  display: block;
  height: 12px;
  border-radius: var(--r-sm);
  background: linear-gradient(
    90deg,
    var(--c-surface-active) 0%,
    var(--c-surface-hover) 50%,
    var(--c-surface-active) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton i:nth-child(2) {
  width: 72%;
}
.skeleton i:nth-child(3) {
  width: 55%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* --- 로그인 -------------------------------------------------------------
   화면을 둘로 가른다. 왼쪽은 브랜드가 말을 거는 어두운 면, 오른쪽은
   입력만 남은 밝은 면. 로고의 태그라인 WORK. TRACK. ACHIEVE. 를 한 줄씩
   마스크 뒤에서 밀어 올리고, 마지막 줄만 하늘색으로 튀어 오른 뒤 그 아래로
   상승선이 그어진다 — 로고의 화살표가 하는 일과 같다.
   모션은 들어올 때 한 번만 연주되고 멈춘다. 계속 움직이는 것은 없다. */

/* Monee와 같은 구조: body는 일반 문서 루트로 두고, 안쪽 auth-page가 인증
   Grid를 맡는다. 입력 포커스 때 브라우저가 body 자체의 Grid/스크롤 영역을
   다시 계산하지 않으므로 커스텀 브라우저에서도 페이지 표면이 고정된다. */
body.auth-root {
  height: auto;
  min-height: 100%;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--c-bg);
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(400px, 0.94fr);
  min-height: 100vh;
  background: var(--c-bg);
}

/* --- 왼쪽: 브랜드 면 --- */

.auth-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: clamp(28px, 3.6vw, 48px) clamp(28px, 5vw, 72px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 78% 14%, rgba(46, 197, 255, 0.2), transparent 21rem),
    linear-gradient(
      150deg,
      var(--brand-navy) 0%,
      var(--brand-ink) 58%,
      var(--brand-ink-deep) 100%
    );
}

/* 로고가 놓인 자리의 사선 광택 — 정지한 질감이다. 움직임은 글자가 맡는다. */
.auth-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  pointer-events: none;
  background: repeating-linear-gradient(
    72deg,
    transparent 0 116px,
    rgba(255, 255, 255, 0.03) 116px 117px,
    transparent 117px 238px
  );
}
.auth-hero > * {
  position: relative;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.auth-mark {
  width: 40px;
  height: 40px;
  flex: none;
}
/* 어두운 면 위에서는 D 자를 밝게 뒤집는다. 화살표는 원래 색 그대로 뜬다. */
.auth-mark .dw-d {
  fill: rgba(255, 255, 255, 0.93);
  animation: mark-in 720ms var(--ease-out) both;
}
.auth-mark .dw-line {
  stroke-dasharray: 78;
  stroke-dashoffset: 78;
  animation: draw-line 900ms var(--ease-out) 320ms both;
}
.auth-mark .dw-head {
  transform-origin: 50px 18px;
  animation: head-in 520ms var(--ease-out) 1100ms both;
}

@keyframes mark-in {
  from { opacity: 0; transform: translateY(8px) scale(0.94); }
}
@keyframes draw-line {
  from { stroke-dashoffset: 78; }
  to { stroke-dashoffset: 0; }
}
@keyframes head-in {
  0% { opacity: 0; transform: translate(-9px, 9px) scale(0.7); }
  70% { opacity: 1; transform: translate(2px, -2px) scale(1.06); }
  100% { opacity: 1; transform: none; }
}

.auth-brand__name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f1f6ff;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  animation: auth-rise 620ms var(--ease-out) 220ms both;
}

/* 로고 아래 남는 자리 한가운데에 앉는다 — 아래에는 아무것도 두지 않는다 */
.auth-hero__copy {
  width: fit-content;
  max-width: 100%;
  margin: auto 0;
}

.auth-hero__copy h1 {
  margin: 0;
  font-size: clamp(52px, 7.2vw, 118px);
  line-height: 0.86;
  letter-spacing: -0.055em;
  font-weight: 700;
  color: #fff;
}

/* 마스크가 글자를 잘라 두고, 안쪽 줄이 아래에서 올라온다 */
.hero-line-mask {
  display: block;
  overflow: hidden;
  padding: 0.08em 0.08em 0.14em 0;
  margin: -0.08em -0.08em -0.14em 0;
}
.hero-line {
  display: block;
  opacity: 0;
  transform: translate3d(0, 115%, 0);
  animation: hero-line-up 900ms var(--ease-out) both;
  will-change: transform, opacity;
}
.hero-line-mask:nth-child(1) .hero-line { animation-delay: 200ms; }
.hero-line-mask:nth-child(2) .hero-line { animation-delay: 330ms; }
.hero-line-mask:nth-child(3) .hero-line { animation-delay: 460ms; }

/* 마지막 줄만 한 번 지나쳤다 제자리로 돌아온다 */
.hero-line--accent {
  color: var(--brand-sky);
  transform-origin: left bottom;
  animation-name: hero-line-pop;
  animation-duration: 1080ms;
}

@keyframes hero-line-up {
  from { opacity: 0; transform: translate3d(0, 115%, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes hero-line-pop {
  0% { opacity: 0; transform: translate3d(0, 115%, 0) scale(0.96); }
  70% { opacity: 1; transform: translate3d(0, 0, 0) scale(1.028); }
  86% { opacity: 1; transform: translate3d(0, 0, 0) scale(0.993); }
  100% { opacity: 1; transform: none; }
}

/* 글자가 앉은 뒤 그 아래로 상승선이 그어진다 */
.hero-rule {
  display: block;
  height: 3px;
  margin-top: 20px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand-teal), var(--brand-sky));
  transform: scaleX(0);
  transform-origin: left center;
  animation: hero-rule-draw 820ms var(--ease-out) 1150ms both;
}
@keyframes hero-rule-draw {
  to { transform: scaleX(1); }
}

@keyframes auth-rise {
  to { opacity: 1; transform: none; }
}

/* --- 오른쪽: 입력 면 --- */

.auth-panel {
  display: grid;
  min-height: 100vh;
  align-content: center;
  padding: clamp(32px, 5vw, 80px);
  background: var(--c-surface);
}

.auth-form {
  width: 100%;
  max-width: 372px;
  margin: 0 auto;
}

/* 위에서부터 차례로 올라온다 — 다섯 번째 자리는 오류 문구가 쓴다 */
.auth-form > .auth-step {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  animation: auth-rise 640ms var(--ease-out) both;
}
.auth-form > .auth-step:nth-child(1) { animation-delay: 300ms; }
.auth-form > .auth-step:nth-child(2) { animation-delay: 380ms; }
.auth-form > .auth-step:nth-child(3) { animation-delay: 470ms; }
.auth-form > .auth-step:nth-child(4) { animation-delay: 560ms; }
.auth-form > .auth-step:nth-child(6) { animation-delay: 650ms; }

.auth-form h2 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--brand-navy);
}
.auth-form__sub {
  margin: 0 0 30px;
  font-size: 14px;
  color: var(--c-text-2);
}

.auth-form .field + .field {
  margin-top: var(--sp-4);
}
.auth-form .field label {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--c-text-2);
}
.auth-form .field input {
  height: 48px;
  padding: 0 14px;
  border-radius: var(--r-lg);
  background: var(--c-surface-sunken);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease,
    background var(--dur-fast) ease;
}
.auth-form .field input:hover {
  border-color: var(--c-line-strong);
  background: var(--c-surface);
}
.auth-form .field input:focus {
  border-color: var(--brand-blue);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px rgba(46, 197, 255, 0.22);
}
/* 틀린 입력은 테두리로도 보인다 — 아래 문구만으로는 어느 칸인지 알 수 없다 */
.auth-form .field input[aria-invalid="true"] {
  border-color: var(--c-danger-line);
  background: var(--c-danger-bg);
}
.auth-form .field input[aria-invalid="true"]:focus {
  border-color: var(--c-danger-fg);
  box-shadow: 0 0 0 3px rgba(176, 42, 42, 0.16);
}

.auth-error {
  margin: var(--sp-4) 0 0;
  padding: 10px 12px;
  border: 1px solid var(--c-danger-line);
  border-radius: var(--r-lg);
  background: var(--c-danger-bg);
  color: var(--c-danger-fg);
  font-size: 12.5px;
  animation: auth-error-in 320ms var(--ease-out) both;
}
@keyframes auth-error-in {
  from { opacity: 0; transform: translate3d(0, -6px, 0); }
  to { opacity: 1; transform: none; }
}

.auth-submit.btn {
  width: 100%;
  height: 50px;
  margin-top: var(--sp-6);
  border-color: transparent;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-sky));
  font-size: 14px;
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(27, 95, 174, 0.26);
  transition: transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) ease, background var(--dur-fast) ease;
}
.auth-submit.btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--brand-blue-press), var(--brand-sky-press));
  box-shadow: 0 14px 26px rgba(27, 95, 174, 0.32);
}
.auth-submit.btn:active {
  transform: translateY(0);
}

/* 세로로 좁아지면 브랜드 면을 위쪽 띠로 눕힌다 */
/* 위아래로 눕는다. 두 줄 모두 auto 로 두어야 내용이 길어질 때 페이지가
   자란다 — 1fr 로 두면 낮은 창에서 입력 면이 잘린다. */
@media (max-width: 1000px) {
  .auth-page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .auth-hero {
    min-height: 48vh;
    gap: var(--sp-6);
    padding-block: var(--sp-8);
  }
  .auth-hero__copy {
    margin: 0;
  }
  .auth-hero__copy h1 {
    font-size: clamp(48px, 11vw, 84px);
  }
  .auth-panel {
    min-height: auto;
    padding: var(--sp-10) var(--sp-6) var(--sp-12);
  }
}

@media (max-width: 640px) {
  .auth-hero {
    padding: var(--sp-6);
  }
}

/* 움직임을 줄여 달라고 한 사용자에게는 전부 제자리에서 보여 준다 */
@media (prefers-reduced-motion: reduce) {
  .auth-brand__name,
  .hero-line,
  .hero-rule,
  .auth-form > .auth-step,
  .auth-error,
  .auth-mark .dw-d,
  .auth-mark .dw-line,
  .auth-mark .dw-head {
    opacity: 1;
    transform: none;
    stroke-dashoffset: 0;
    animation: none;
  }
}

/* --- 반응형 ------------------------------------------------------------- */

@media (max-width: 1100px) {
  .grid-2col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .grid-side-left {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease-out);
    box-shadow: var(--sh-lg);
  }
  .sidebar[data-open="true"] {
    transform: none;
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(18, 22, 30, 0.35);
    border: none;
  }

  .sidebar__toggle {
    display: inline-flex;
  }

  .topbar {
    padding: 0 var(--sp-4);
    gap: var(--sp-2);
  }
  .topbar__search {
    width: auto;
    flex: 1;
  }
  .topbar__title {
    display: none;
  }

  .content {
    padding: var(--sp-4);
    gap: var(--sp-4);
  }

  .cal__cell {
    min-height: 76px;
    padding: 4px;
  }

  table.data th,
  table.data td {
    padding-left: var(--sp-3);
    padding-right: var(--sp-3);
  }

  .toasts {
    left: var(--sp-4);
    right: var(--sp-4);
    bottom: var(--sp-4);
  }
  .toast {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- 통합 검색 팝업 --------------------------------------------------------
   어느 화면에서든 같은 모양으로 뜬다. 모달 본문 안에서 입력이 위에 고정되고
   결과만 스크롤한다. */

.palette {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 320px;
}

.palette__field {
  position: relative;
  flex: none;
}

.palette__field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--c-text-3);
  pointer-events: none;
}

.palette__field input[type="search"] {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  font-size: 15px;
}

.palette__results {
  flex: 1;
  min-height: 0;
  max-height: 46vh;
  overflow-y: auto;
  border-top: 1px solid var(--c-line);
  padding-top: var(--sp-2);
}

.palette__hint {
  padding: var(--sp-10) var(--sp-4);
  text-align: center;
  color: var(--c-text-3);
  font-size: 13px;
  line-height: 1.6;
}

.palette__group + .palette__group {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-line);
}

.palette__group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 var(--sp-2) var(--sp-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-3);
}

.palette__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--sp-2);
  border-radius: var(--r-md);
  color: var(--c-text);
  min-width: 0;
  transition: background var(--dur-fast);
}

.palette__row:hover {
  background: var(--c-surface-hover);
  text-decoration: none;
}

/* 행 앞 아이콘. 크기를 못 박지 않으면 svg 기본 크기로 부풀어 줄을 무너뜨린다. */
.palette__row > svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--c-text-3);
}

.palette__row > .badge {
  flex: none;
}

.palette__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.palette__title {
  font-weight: 550;
  font-size: 13.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette__sub {
  font-size: 12px;
  line-height: 1.35;
  color: var(--c-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 리마인드 탭: 인프라 카드 ----------------------------------------------
   값이 한 줄을 넘지 않는 짧은 항목이라, 서로 구분만 되면 된다. */

.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: var(--sp-3);
  padding: var(--sp-4);
}

.infra-card {
  position: relative;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface-sunken);
  padding: 10px 12px;
  min-width: 0;
}

.infra-card__title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 46px;
}

.infra-card__value {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.infra-card__actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 1px;
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.infra-card:hover .infra-card__actions,
.infra-card:focus-within .infra-card__actions {
  opacity: 1;
}

/* --- 프로젝트 상세 머리의 상태 선택 ---------------------------------------
   옆의 수정 버튼과 높이를 맞춘다. 라벨을 위가 아니라 옆에 둔다. */

.head-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.head-status .label {
  white-space: nowrap;
}

.head-status select {
  height: 32px;
  width: auto;
  min-width: 106px;
}

@media print {
  .sidebar,
  .topbar,
  .row-actions,
  .toasts {
    display: none !important;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .panel {
    box-shadow: none;
  }
}
