/* 작업일정표 웹 — 글래스·그라데이션·애니메이션 UI (한글 주석) */
:root {
  --bg: #0b1220;
  --bg-soft: #111b2e;
  --card: rgba(255, 255, 255, 0.92);
  --card-glass: rgba(255, 255, 255, 0.78);
  --border: rgba(148, 163, 184, 0.35);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-hover: #1d4ed8;
  --today: #f59e0b;
  --cell-memo: #f1f5f9;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
}

.app-body,
.login-body {
  position: relative;
  overflow-x: hidden;
}

/* 배경 오브 애니메이션 (한글 주석) */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: orbFloat 14s ease-in-out infinite;
}

.orb-1 {
  width: 320px;
  height: 320px;
  background: #3b82f6;
  top: -80px;
  left: -60px;
}

.orb-2 {
  width: 280px;
  height: 280px;
  background: #8b5cf6;
  bottom: 10%;
  right: -40px;
  animation-delay: -4s;
}

.orb-3 {
  width: 220px;
  height: 220px;
  background: #06b6d4;
  top: 40%;
  left: 35%;
  animation-delay: -8s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -18px) scale(1.08); }
}

/* 등장 애니메이션 (한글 주석) */
.fx-rise {
  animation: riseIn 0.7s var(--ease) both;
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glass-panel {
  position: relative;
  z-index: 1;
  background: var(--card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow);
}

.top {
  padding: 1.1rem 1.25rem 1rem;
  margin: 0.75rem 0.75rem 0;
  border-radius: var(--radius);
}

.top h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.brand-kicker,
.month-kicker,
.list-kicker,
.login-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hint {
  margin: 0.55rem 0 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.hint-accent {
  color: var(--accent);
  font-weight: 600;
}

.hint.data-path {
  margin-bottom: 0.75rem;
  word-break: break-all;
  font-size: 0.78rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.25s ease;
}

.status.ok { color: #059669; }
.status.err { color: #dc2626; }

.btn {
  padding: 0.48rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #6d28d9);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.95);
}

.glow-btn {
  position: relative;
  overflow: hidden;
}

.glow-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.glow-btn:hover::after {
  transform: translateX(120%);
}

.btn.icon-btn {
  min-width: 42px;
  padding-inline: 0.65rem;
}

.btn.sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
}

.btn.full {
  width: 100%;
  padding: 0.72rem;
  font-size: 1rem;
}

.top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-pill {
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  margin: 0.65rem 0.75rem 0;
  border-radius: var(--radius);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.month-title-wrap {
  flex: 1;
  min-width: 8rem;
}

.month-nav h2 {
  margin: 0.1rem 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.today-btn {
  margin-left: auto;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0.55rem 1rem 0.35rem;
  max-width: 1100px;
  margin: 0.65rem auto 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  border-radius: 12px;
  position: relative;
  z-index: 1;
}

.weekdays .sun { color: #dc2626; }
.weekdays .sat { color: #2563eb; }

.glass-strip {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 0.35rem 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.day-list-wrap {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 0.75rem 1.5rem;
  position: relative;
  z-index: 1;
}

.list-head h3 {
  margin: 0.15rem 0 0.65rem;
  font-size: 1.05rem;
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.day-card {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s ease;
  animation: cardIn 0.45s var(--ease) both;
}

.day-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.35);
}

.day-card.today {
  border-color: var(--today);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35), 0 12px 28px rgba(245, 158, 11, 0.12);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.day-card-head {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.day-card-memo {
  font-size: 0.78rem;
  color: #78350f;
  background: #fde68a;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.25rem 0.45rem;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.day-card-empty {
  font-size: 0.78rem;
  color: #94a3b8;
  font-style: italic;
}

.day-card-lines {
  margin: 0;
  padding-left: 1rem;
}

.day-card-lines li {
  font-size: 0.8rem;
  line-height: 1.35;
  margin-bottom: 3px;
  white-space: pre-line;
  word-break: break-word;
}

.cell {
  min-height: 120px;
  max-height: min(28vh, 240px);
  height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 7px 7px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 날짜·메모는 고정, 공사 목록만 스크롤 (한글 주석) */
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s ease;
  animation: cardIn 0.4s var(--ease) both;
}

.cell:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.3);
}

.cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  min-height: 0;
  pointer-events: none;
  box-shadow: none;
  animation: none;
}

.cell.today {
  border-color: var(--today);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}

.cell-num {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 3px;
}

.cell-num-dow {
  font-size: 0.72em;
  font-weight: 650;
  opacity: 0.85;
  letter-spacing: -0.02em;
}

.cell-num.sun,
.cell-num.holiday { color: #dc2626; }
.cell-num.sat { color: #2563eb; }

.cell-memo {
  font-size: 0.68rem;
  color: #78350f;
  background: #fde68a;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 2px 5px;
  margin-bottom: 3px;
  max-height: 2.4em;
  overflow: hidden;
  font-weight: 700;
}

.cell-lines {
  font-size: 0.72rem;
  color: var(--text);
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto; /* 날짜별 공사 목록 스크롤 (한글 주석) */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  max-height: none;
  margin: 0;
  padding: 0 2px 0 0;
}

.cell-lines::-webkit-scrollbar {
  width: 6px;
}
.cell-lines::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.55);
  border-radius: 6px;
}
.cell-lines::-webkit-scrollbar-track {
  background: transparent;
}

/* 달력 날짜 칸 하단 공사순번 입력 (한글 주석) */
.cell-gno-add {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin-top: 4px;
  padding-top: 2px;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}
.cell-gno-btn {
  flex: 0 0 auto;
  min-width: 1.35rem;
  padding: 0 4px;
  font-size: 0.68rem;
  line-height: 1.1;
}
.cell-gno-inp {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.04);
  color: inherit;
  min-height: 1.45rem;
}
.cell-gno-inp:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.65);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.day-card-gno {
  margin-top: 0.45rem;
}
.day-card-gno .cell-gno-inp {
  font-size: 0.82rem;
  min-height: 1.8rem;
  padding: 0.3rem 0.45rem;
}

.cell-lines li {
  margin: 0 0 2px 0;
  padding: 0;
  list-style: none;
  white-space: pre-line;
  word-break: break-word;
  line-height: 1.25;
}

.cell-lines li.cell-work-item {
  margin: 0 0 4px 0;
  padding: 3px 5px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.cell-lines li.cell-work-item:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.08);
}

.cell-lines li.cell-work-item.is-selected {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.12);
}

/* 팀별 글자색 — PC 작업일정표.py _달력_팀_글자색 과 동일 (한글 주석) */
.cell-lines .cell-work-item,
.day-card-lines li,
.item-list li[data-team] {
  font-weight: 650;
}
.cell-lines .cell-work-item .cell-work-line,
.day-card-lines li,
.item-list li[data-team] {
  color: inherit;
}

.cell-lines .cell-work-item[data-team*="가선1"],
.day-card-lines li[data-team*="가선1"],
.item-list li[data-team*="가선1"] {
  color: #c0392b;
  border-left: 3px solid #c0392b;
}
.cell-lines .cell-work-item[data-team*="가선2"],
.day-card-lines li[data-team*="가선2"],
.item-list li[data-team*="가선2"] {
  color: #e67e22;
  border-left: 3px solid #e67e22;
}
.cell-lines .cell-work-item[data-team="가선팀"],
.day-card-lines li[data-team="가선팀"],
.item-list li[data-team="가선팀"] {
  color: #2980b9;
  border-left: 3px solid #2980b9;
}
.cell-lines .cell-work-item[data-team="가선&건주"],
.day-card-lines li[data-team="가선&건주"],
.item-list li[data-team="가선&건주"] {
  color: #4338ca;
  border-left: 3px solid #4338ca;
}
.cell-lines .cell-work-item[data-team*="건주"],
.day-card-lines li[data-team*="건주"],
.item-list li[data-team*="건주"] {
  color: #27ae60;
  border-left: 3px solid #27ae60;
}
/* 가선&건주 가 건주 규칙에 덮이지 않도록 재지정 (한글 주석) */
.cell-lines .cell-work-item[data-team="가선&건주"],
.day-card-lines li[data-team="가선&건주"],
.item-list li[data-team="가선&건주"] {
  color: #4338ca;
  border-left-color: #4338ca;
}
.cell-lines .cell-work-item[data-team="관계자회의"],
.day-card-lines li[data-team="관계자회의"],
.item-list li[data-team="관계자회의"] {
  color: #8e44ad;
  border-left: 3px solid #8e44ad;
}
.cell-lines .cell-work-item[data-team*="지중"],
.day-card-lines li[data-team*="지중"],
.item-list li[data-team*="지중"] {
  color: #57534e;
  border-left: 3px solid #57534e;
}
.cell-lines .cell-work-item[data-team*="조류"],
.day-card-lines li[data-team*="조류"],
.item-list li[data-team*="조류"] {
  color: #7c3aed;
  border-left: 3px solid #7c3aed;
}
.cell-lines .cell-work-item[data-team*="투개방"],
.day-card-lines li[data-team*="투개방"],
.item-list li[data-team*="투개방"] {
  color: #0d9488;
  border-left: 3px solid #0d9488;
}
.cell-lines .cell-work-item[data-team*="기타"],
.day-card-lines li[data-team*="기타"],
.item-list li[data-team*="기타"] {
  color: #64748b;
  border-left: 3px solid #94a3b8;
}
.cell-lines .cell-work-item.is-free-memo {
  color: #b45309;
  border-left: 3px solid #d97706;
  background: rgba(251, 191, 36, 0.2);
}

/* 모달 (한글 주석) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: min(560px, 94vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--card);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  z-index: 50;
  opacity: 0;
  transition: transform 0.28s var(--ease), opacity 0.28s ease;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal.hidden,
.modal-backdrop.hidden {
  display: none;
}

.modal.modal-day {
  width: min(1180px, 98vw);
  max-height: 92vh;
}

.modal-day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
}

.modal-day-head h3 {
  margin: 0 0 0.2rem;
}

.modal-day-head .insp-date {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.modal h3 {
  margin: 0 0 0.75rem;
  font-size: 1.08rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.field span {
  font-size: 0.85rem;
  font-weight: 600;
}

.field textarea,
.inp,
.login-form input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.95);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea:focus,
.inp:focus,
.login-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.field.tight { margin-bottom: 0.5rem; }
.inp.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; }

.modal-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.day-split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1rem;
  align-items: start;
}

.day-left, .day-right { min-width: 0; }

.subhead {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0.5rem 0 0.35rem;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(280px, 36vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.item-list li {
  padding: 0.45rem 0.55rem;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.item-list li:hover { background: #e2e8f0; }
.item-list li.selected { background: #dbeafe; font-weight: 600; }

.item-list li.item-sep {
  color: #94a3b8;
  font-size: 0.72rem;
  cursor: default;
  user-select: none;
}

.row-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.panel-free.hidden,
.panel-work.hidden { display: none; }

.adv-json { margin-top: 0.75rem; font-size: 0.85rem; }
.adv-json summary { cursor: pointer; color: var(--muted); }

/* ─── 로그인 화면 (한글 주석) ─── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--card-glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 2rem 1.65rem 1.5rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.login-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.65rem;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.4);
  animation: pulseBadge 2.8s ease-in-out infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.login-card h1 {
  margin: 0;
  font-size: 1.65rem;
  text-align: center;
  letter-spacing: -0.03em;
}

.login-sub {
  margin: 0.45rem 0 1.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.login-form .field {
  display: block;
  margin-bottom: 0.85rem;
}

.login-form .field span {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-weight: 600;
}

.login-err {
  min-height: 1.25rem;
  margin: 0 0 0.5rem;
}

.login-chips {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.login-foot {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}

/* 로그인 버튼 로딩 (한글 주석) */
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.btn.loading .btn-text { display: none; }
.btn.loading .btn-spinner { display: block; }
.btn.loading { pointer-events: none; opacity: 0.85; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-card.shake {
  animation: shake 0.45s ease;
}

/* 루트 로그인/회원가입 탭 (한글 주석) */
.portal-card {
  max-width: 440px;
}

.portal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
  padding: 0.3rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
}

.portal-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.55rem 0.4rem;
  border-radius: 10px;
  cursor: pointer;
}

.portal-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.portal-panel.is-hidden {
  display: none !important;
}

.portal-check {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.45rem;
}

.portal-check input {
  width: auto;
  margin-top: 0.2rem;
}

.portal-check span {
  font-weight: 500;
  color: var(--text);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* 반응형 (한글 주석) */
@media (max-width: 900px) {
  .day-split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .top, .month-nav {
    margin-inline: 0.5rem;
    padding: 0.85rem;
  }

  .top h1 { font-size: 1.15rem; }
  .hint { font-size: 0.8rem; }

  .weekdays,
  .calendar-grid {
    display: none;
  }

  .day-list-wrap {
    display: block;
    padding-inline: 0.5rem;
  }

  .modal.modal-day {
    width: calc(100vw - 12px);
    max-width: none;
    max-height: 92vh;
  }
}

@media (max-width: 480px) {
  .toolbar .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .month-nav { gap: 0.35rem; }
  .month-nav .btn { padding: 0.35rem 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 확장 기능 바 */
.feature-bar { flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; align-items: center; }
.field-inline { display: inline-flex; align-items: center; gap: 0.3rem; color: #cbd5e1; font-size: 0.85rem; }
.field-inline input, .field-inline select {
  min-height: 32px; border-radius: 8px; border: 1px solid #334155;
  background: #0f172a; color: #e2e8f0; padding: 0.2rem 0.45rem; max-width: 160px;
}
.file-btn { position: relative; overflow: hidden; cursor: pointer; display: inline-flex; align-items: center; }
.feature-panel { margin: 0.75rem 0; padding: 0.85rem 1rem; }
.feature-panel .list-head { display: flex; justify-content: space-between; align-items: center; }
.feature-panel .stats-body,
.feature-panel .work-detail-dl dd {
  color: var(--text);
}
.feature-panel .work-detail-dl dt {
  color: #64748b;
}
.stats-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.stats-table th, .stats-table td { border: 1px solid rgba(148,163,184,.3); padding: 0.35rem 0.5rem; text-align: left; }
.week-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.55rem; }
.week-day { padding: 0.65rem; border-radius: 10px; border: 1px solid rgba(148,163,184,.25); background: rgba(15,23,42,.45); }
.week-day h4 { margin: 0 0 0.35rem; font-size: 0.9rem; color: #e2e8f0; }
.week-memo { color: #fcd34d; font-size: 0.82rem; }
.search-hit { padding: 0.45rem 0; border-bottom: 1px solid rgba(148,163,184,.2); }
.cell-drag { cursor: grab; }
.cell.drop-target { outline: 2px solid #38bdf8; outline-offset: -2px; background: rgba(56,189,248,.12); }
body.role-viewer .feature-bar .file-btn,
body.role-viewer #btnSave,
body.role-viewer #btnRecur { opacity: 0.45; pointer-events: none; }
@media print {
  .feature-bar, .top-actions, .toolbar, .feature-panel .btn { display: none !important; }
}

/* portal-diagram-hide-v2 */
/* 로그인 화면: 계통도 관련 UI 전부 숨김 (한글 주석) */
.login-body .btn-top-diagram,
.login-body .diagram-quick-banner,
.login-body .btn-diagram-quick,
.login-body .portal-notice-auth,
.login-body #btnTopDiagram,
.login-body #bannerQuickDiagram,
.login-body #btnQuickDiagram,
.login-body #portalAuthNotice,
body.login-body a[href*="/diagram"],
body.login-body [id*="Diagram"],
body.login-body [class*="diagram"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* 로그인 화면: 구버전 캐시에 남은 계통도 배너·버튼 강제 숨김 (한글 주석) */
.login-body .btn-top-diagram,
.login-body .diagram-quick-banner,
.login-body .btn-diagram-quick,
.login-body .portal-notice-auth,
.login-body #btnTopDiagram,
.login-body #bannerQuickDiagram,
.login-body #btnQuickDiagram,
.login-body #portalAuthNotice,
body.login-body a[href*="/diagram"],
body.login-body [id*="Diagram"],
body.login-body [class*="diagram"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
