/* =========================================================
   더왈츠앤조이피아 근태관리 — 공통 스타일
   iPad 세로모드 우선 · iOS/iPadOS 디자인 언어
   ========================================================= */

/* ---------------- 1. 기본 변수 ---------------- */
:root {
  --bg: #f2f2f7;
  --bg-elevated: #ffffff;
  --bg-grouped: #ffffff;
  --bg-inset: #f2f2f7;
  --bg-header: rgba(242, 242, 247, 0.78);

  --label: #0b0b0f;
  --label-2: #3c3c43;
  --label-3: rgba(60, 60, 67, 0.6);
  --label-4: rgba(60, 60, 67, 0.32);

  --separator: rgba(60, 60, 67, 0.12);
  --separator-strong: rgba(60, 60, 67, 0.2);

  --blue: #0a6cff;
  --blue-soft: rgba(10, 108, 255, 0.12);
  --green: #1fa94b;
  --green-soft: rgba(31, 169, 75, 0.13);
  --orange: #e8850c;
  --orange-soft: rgba(232, 133, 12, 0.14);
  --red: #e0332f;
  --red-soft: rgba(224, 51, 47, 0.12);
  --purple: #7b4bff;
  --gold: #b98a3e;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 1px rgba(16, 24, 40, 0.03);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.07), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 -8px 40px rgba(16, 24, 40, 0.16);
  --shadow-btn: 0 4px 14px rgba(10, 108, 255, 0.28);
  --shadow-btn-green: 0 4px 14px rgba(31, 169, 75, 0.26);

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --tabbar-h: 74px;
  --content-max: 880px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --bg-elevated: #1c1c1e;
    --bg-grouped: #1c1c1e;
    --bg-inset: #2c2c2e;
    --bg-header: rgba(11, 11, 13, 0.76);

    --label: #f5f5f7;
    --label-2: #e5e5ea;
    --label-3: rgba(235, 235, 245, 0.6);
    --label-4: rgba(235, 235, 245, 0.3);

    --separator: rgba(235, 235, 245, 0.13);
    --separator-strong: rgba(235, 235, 245, 0.22);

    --blue: #3b8bff;
    --blue-soft: rgba(59, 139, 255, 0.18);
    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.16);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.16);
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.16);
    --purple: #bf5af2;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 22px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 -8px 40px rgba(0, 0, 0, 0.6);
    --shadow-btn: 0 4px 14px rgba(59, 139, 255, 0.24);
    --shadow-btn-green: 0 4px 14px rgba(48, 209, 88, 0.2);
  }
}

/* ---------------- 2. 리셋 ---------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--label);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.2;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  letter-spacing: inherit;
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

a { color: var(--blue); text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--blue-soft);
  outline-offset: 2px;
  border-radius: 8px;
}

.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;
}

/* ---------------- 3. 레이아웃 ---------------- */
.app-shell {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 22px calc(40px + env(safe-area-inset-bottom));
}

@media (max-width: 560px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  body { font-size: 16px; }
}

/* 상단 고정 헤더 (iPadOS 대형 타이틀) */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-header);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  padding-top: env(safe-area-inset-top);
}

.app-header.is-scrolled {
  border-bottom-color: var(--separator);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.app-header__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px 22px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}

@media (max-width: 560px) {
  .app-header__inner { padding-left: 16px; padding-right: 16px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.brand__mark {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #2a3a68, #101a33);
  color: #f4e3bd;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.03em;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

@media (prefers-color-scheme: dark) {
  .brand__mark { background: linear-gradient(150deg, #3a4a7a, #1a2440); }
}

.brand__text { min-width: 0; }

.brand__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__sub {
  font-size: 12.5px;
  color: var(--label-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.035em;
  padding: 18px 22px 4px;
  max-width: var(--content-max);
  margin: 0 auto;
}

@media (max-width: 560px) {
  .page-title { font-size: 29px; padding-left: 16px; padding-right: 16px; }
}

.page-sub {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 22px 18px;
  font-size: 14.5px;
  color: var(--label-3);
}

@media (max-width: 560px) {
  .page-sub { padding-left: 16px; padding-right: 16px; }
}

/* ---------------- 4. 공통 컴포넌트 ---------------- */
.icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  color: var(--label-2);
  transition: transform 0.16s var(--ease), background 0.16s ease;
}

.icon-btn:active { transform: scale(0.93); }
.icon-btn svg { width: 21px; height: 21px; }

.icon-btn--tint {
  background: var(--blue-soft);
  color: var(--blue);
  box-shadow: none;
}

.card {
  background: var(--bg-grouped);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card--pad { padding: 18px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--sm { gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt-24 { margin-top: 24px; }
.mt-16 { margin-top: 16px; }

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--label-3);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 4px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-label__action {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  text-transform: none;
  letter-spacing: -0.01em;
}

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--bg-inset);
  color: var(--label);
  transition: transform 0.15s var(--ease), filter 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:active:not(:disabled) { transform: scale(0.97); filter: brightness(0.96); }

.btn svg { width: 19px; height: 19px; flex: 0 0 auto; }

.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn--success {
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow-btn-green);
}

.btn--danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn--tint {
  background: var(--blue-soft);
  color: var(--blue);
}

.btn--ghost {
  background: transparent;
  color: var(--blue);
  box-shadow: none;
}

.btn--block { display: flex; width: 100%; }
.btn--lg { min-height: 58px; font-size: 18px; border-radius: 17px; }
.btn--sm { min-height: 40px; padding: 0 15px; font-size: 14.5px; border-radius: 11px; }

.btn:disabled {
  opacity: 0.42;
  box-shadow: none;
  cursor: not-allowed;
}

/* 배지 / 칩 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--bg-inset);
  color: var(--label-3);
  white-space: nowrap;
}

.badge--working { background: var(--green-soft); color: var(--green); }
.badge--done { background: var(--blue-soft); color: var(--blue); }
.badge--idle { background: var(--bg-inset); color: var(--label-3); }
.badge--warn { background: var(--orange-soft); color: var(--orange); }
.badge--danger { background: var(--red-soft); color: var(--red); }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.dot--pulse { animation: pulse 1.9s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

/* 아바타 */
.avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  background: var(--blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  user-select: none;
}

.avatar--sm { width: 38px; height: 38px; font-size: 14px; }
.avatar--lg { width: 68px; height: 68px; font-size: 24px; }

/* 세그먼트 컨트롤 */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg-inset);
  gap: 2px;
  width: 100%;
}

.segmented__btn {
  flex: 1;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--label-2);
  transition: background 0.18s var(--ease), color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

.segmented__btn[aria-selected='true'],
.segmented__btn.is-active {
  background: var(--bg-elevated);
  color: var(--label);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.09);
}

@media (prefers-color-scheme: dark) {
  .segmented__btn[aria-selected='true'],
  .segmented__btn.is-active { background: #48484a; }
}

/* 검색 필드 */
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--bg-inset);
  color: var(--label-3);
}

.search svg { width: 18px; height: 18px; flex: 0 0 auto; }

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: var(--label);
}

.search input::placeholder { color: var(--label-4); }

/* 폼 요소 */
.field { display: flex; flex-direction: column; gap: 7px; }

.field__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--label-3);
  padding-left: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: var(--bg-inset);
  color: var(--label);
  font-size: 16.5px;
  outline: none;
  transition: border-color 0.16s ease, background 0.16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--blue);
  background: var(--bg-elevated);
}

.textarea { min-height: 82px; resize: vertical; line-height: 1.5; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
  padding-right: 42px;
}

.input[type='time'] { font-variant-numeric: tabular-nums; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 460px) {
  .form-grid { grid-template-columns: 1fr; }
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 8px 0 4px;
}

.pin-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--label-4);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s var(--ease);
}

.pin-dot.is-filled {
  background: var(--label);
  border-color: var(--label);
  transform: scale(1.1);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 340px;
  margin: 0 auto;
}

.keypad__key {
  height: 62px;
  border-radius: 50%;
  background: var(--bg-inset);
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: transform 0.12s var(--ease), background 0.14s ease;
}

.keypad__key:active { transform: scale(0.94); background: var(--separator-strong); }
.keypad__key--ghost { background: transparent; font-size: 16px; color: var(--blue); font-weight: 600; }

/* 토글 스위치 */
.switch {
  position: relative;
  width: 52px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--separator-strong);
  transition: background 0.22s ease;
  padding: 0;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s var(--ease);
}

.switch[aria-checked='true'] { background: var(--green); }
.switch[aria-checked='true']::after { transform: translateX(20px); }

/* 토스트 */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 40px);
  max-width: 440px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 16px;
  background: rgba(28, 28, 30, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.32s var(--ease);
  text-align: center;
}

.toast--success { background: rgba(23, 128, 57, 0.96); }
.toast--error { background: rgba(190, 37, 33, 0.96); }
.toast svg { width: 19px; height: 19px; flex: 0 0 auto; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 시트(모달) */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.36);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}

.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 110;
  width: 100%;
  max-width: 620px;
  transform: translate(-50%, 100%);
  transition: transform 0.38s var(--ease);
  background: var(--bg-elevated);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet.is-open { transform: translate(-50%, 0); }

.sheet__handle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--separator-strong);
  margin: 10px auto 0;
  flex: 0 0 auto;
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px 12px;
  flex: 0 0 auto;
}

.sheet__title { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.sheet__sub { font-size: 13.5px; color: var(--label-3); margin-top: 2px; }
.sheet__body { padding: 4px 22px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet__foot {
  padding: 12px 22px 20px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--separator);
  flex: 0 0 auto;
}

.sheet__foot .btn { flex: 1; }

@media (min-width: 700px) {
  .sheet {
    bottom: 24px;
    border-radius: 24px;
    max-height: 88dvh;
    padding-bottom: 0;
  }
  .sheet.is-open { transform: translate(-50%, 0); }
}

/* 빈 상태 */
.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--label-3);
}

.empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--bg-inset);
  color: var(--label-4);
}

.empty__icon svg { width: 30px; height: 30px; }
.empty__title { font-size: 17px; font-weight: 700; color: var(--label-2); margin-bottom: 6px; }
.empty__text { font-size: 14.5px; line-height: 1.5; }

/* ---------------- 5. 출퇴근 화면 ---------------- */
.clock-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #21314f 0%, #131c30 60%, #0d1420 100%);
  border-radius: var(--radius-xl);
  padding: 24px 24px 22px;
  color: #fff;
  box-shadow: var(--shadow-md);
}

@media (prefers-color-scheme: dark) {
  .clock-hero { background: linear-gradient(150deg, #1d2a45 0%, #141b2a 100%); }
}

.clock-hero::after {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 227, 189, 0.22), transparent 68%);
  pointer-events: none;
}

.clock-hero__time {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  line-height: 1.02;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.clock-hero__time small {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.6;
}

.clock-hero__date {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.66);
  margin-top: 8px;
  letter-spacing: -0.01em;
}

.clock-hero__stats {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-stat {
  flex: 1 1 0;
  min-width: 92px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 11px 13px;
}

.hero-stat__k {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.01em;
}

.hero-stat__v {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 22px 0 14px;
}

/* 근무자 행 */
.emp-list { display: flex; flex-direction: column; gap: 11px; }

.emp-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: var(--bg-grouped);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), box-shadow 0.18s ease;
  cursor: pointer;
}

.emp-row:active { transform: scale(0.994); }

.emp-row.is-working {
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--green);
}

.emp-row__main { flex: 1; min-width: 0; }

.emp-row__name {
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.emp-row__part {
  font-size: 13px;
  color: var(--label-3);
  font-weight: 500;
  margin-top: 1px;
}

.emp-row__meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
  font-size: 13px;
  color: var(--label-3);
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}

.emp-row__meta b {
  font-weight: 700;
  color: var(--label-2);
}

.emp-row__actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.punch-btn {
  min-width: 84px;
  height: 46px;
  padding: 0 15px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.14s var(--ease), filter 0.14s ease, background 0.16s ease;
}

.punch-btn:active:not(:disabled) { transform: scale(0.95); }
.punch-btn svg { width: 16px; height: 16px; }

.punch-btn--in { background: var(--blue-soft); color: var(--blue); }
.punch-btn--out { background: var(--green-soft); color: var(--green); }

.punch-btn--in.is-primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-btn); }
.punch-btn--out.is-primary { background: var(--green); color: #fff; box-shadow: var(--shadow-btn-green); }

.punch-btn:disabled {
  background: var(--bg-inset);
  color: var(--label-4);
  box-shadow: none;
  cursor: default;
}

@media (max-width: 560px) {
  .emp-row { flex-wrap: wrap; padding: 14px; gap: 12px; }
  .emp-row__main { flex: 1 1 calc(100% - 66px); }
  .emp-row__actions { flex: 1 1 100%; }
  .punch-btn { flex: 1; min-width: 0; height: 44px; }
}

/* 근무 중 카드 (진행 중) */
.live-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--green-soft);
  border: 1.5px solid rgba(31, 169, 75, 0.26);
}

.live-card__time {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--green);
}

/* 기록 타임라인 */
.tl { position: relative; padding-left: 4px; }

.tl__item {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--separator);
}

.tl__item:last-child { border-bottom: 0; }

.tl__rail {
  flex: 0 0 auto;
  width: 62px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tl__time {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tl__end { font-size: 12.5px; color: var(--label-3); font-variant-numeric: tabular-nums; }

.tl__body { flex: 1; min-width: 0; padding-top: 1px; }
.tl__name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.02em; }
.tl__sub { font-size: 12.5px; color: var(--label-3); margin-top: 2px; }

/* ---------------- 6. 관리자 · 캘린더 ---------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi {
  background: var(--bg-grouped);
  border-radius: 17px;
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}

.kpi__k { font-size: 12px; font-weight: 600; color: var(--label-3); letter-spacing: 0.01em; }
.kpi__v {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.kpi__sub { font-size: 11.5px; color: var(--label-3); margin-top: 2px; }

.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 14px;
}

.month-nav__title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.cal { padding: 4px 6px 8px; }

.cal__dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.cal__dow span {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--label-3);
  padding: 6px 0;
  letter-spacing: 0.02em;
}

.cal__dow span:first-child { color: var(--red); }
.cal__dow span:last-child { color: var(--blue); }

.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal__cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 15.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--label);
  background: transparent;
  transition: background 0.14s ease, transform 0.14s var(--ease);
  min-height: 44px;
}

.cal__cell:active { transform: scale(0.94); }
.cal__cell--pad { color: var(--label-4); font-weight: 500; }

.cal__cell--today {
  color: var(--blue);
  font-weight: 800;
  box-shadow: inset 0 0 0 1.5px var(--blue);
}

.cal__cell--selected {
  background: var(--blue);
  color: #fff;
  box-shadow: none;
  font-weight: 800;
}

.cal__cell--sun { color: var(--red); }
.cal__cell--sat { color: var(--blue); }
.cal__cell--selected.cal__cell--sun,
.cal__cell--selected.cal__cell--sat { color: #fff; }

.cal__dots {
  display: flex;
  gap: 2.5px;
  height: 5px;
  align-items: center;
  justify-content: center;
}

.cal__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.cal__cell--selected .cal__dot { background: rgba(255, 255, 255, 0.9); }

.cal__count {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--blue);
  opacity: 0.85;
}

.cal__cell--selected .cal__count { color: #fff; }

/* 기록 리스트(관리자) */
.rec-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
  background: var(--bg-grouped);
  transition: background 0.14s ease;
}

.rec-item:last-child { border-bottom: 0; }
.rec-item:active { background: var(--bg-inset); }
.rec-item__main { flex: 1; min-width: 0; }

.rec-item__name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.rec-item__times {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--label-2);
  flex-wrap: wrap;
}

.rec-item__times .arrow { color: var(--label-4); font-size: 11px; }

.rec-item__dur {
  font-size: 14px;
  font-weight: 700;
  color: var(--label);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rec-item__memo {
  font-size: 12.5px;
  color: var(--label-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rec-item__actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.chip-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--bg-inset);
  color: var(--label-2);
  transition: transform 0.14s var(--ease), background 0.14s ease;
}

.chip-btn:active { transform: scale(0.92); }
.chip-btn svg { width: 17px; height: 17px; }
.chip-btn--danger { color: var(--red); background: var(--red-soft); }

/* 근무자 관리 행 */
.emp-admin {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--separator);
  background: var(--bg-grouped);
}

.emp-admin:last-child { border-bottom: 0; }
.emp-admin.is-inactive { opacity: 0.55; }
.emp-admin__main { flex: 1; min-width: 0; }

.emp-admin__name {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.emp-admin__sub { font-size: 12.5px; color: var(--label-3); margin-top: 3px; }

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--separator);
  width: 100%;
  text-align: left;
  background: var(--bg-grouped);
}

.settings-row:last-child { border-bottom: 0; }
.settings-row__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  flex: 0 0 auto;
}

.settings-row__icon svg { width: 18px; height: 18px; }
.settings-row__label { flex: 1; font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.settings-row__value { font-size: 14.5px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.settings-row__chev { color: var(--label-4); display: grid; place-items: center; }
.settings-row__chev svg { width: 17px; height: 17px; }

/* 요약 테이블 */
.sum-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sum-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--label-3);
  text-align: right;
  padding: 10px 8px;
  border-bottom: 1px solid var(--separator);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.sum-table th:first-child { text-align: left; }
.sum-table td {
  font-size: 14.5px;
  padding: 12px 8px;
  text-align: right;
  border-bottom: 1px solid var(--separator);
  white-space: nowrap;
}
.sum-table td:first-child { text-align: left; font-weight: 600; }
.sum-table tr:last-child td { border-bottom: 0; }
.sum-table tbody tr { transition: background 0.14s ease; }
.sum-table tbody tr:active { background: var(--bg-inset); }

/* 차트 */
.chart-wrap { position: relative; height: 220px; padding: 4px; }

/* 관리자 잠금 화면 */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
  overflow-y: auto;
}

.lock-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.lock-card__icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #21314f, #0d1420);
  color: #f4e3bd;
  box-shadow: var(--shadow-md);
}

.lock-card__icon svg { width: 32px; height: 32px; }
.lock-card__title { font-size: 25px; font-weight: 800; letter-spacing: -0.035em; }
.lock-card__sub { font-size: 14.5px; color: var(--label-3); margin-top: 7px; line-height: 1.5; }
.lock-error {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--red);
  min-height: 20px;
  margin-top: 12px;
}

.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

/* 하단 고정 액션 */
.bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
  display: flex;
  gap: 10px;
}

/* 탭 바 (관리자) */
.tabbar {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 0px);
  z-index: 35;
  background: var(--bg-header);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  padding: 4px 22px 12px;
  max-width: var(--content-max);
  margin: 0 auto;
}

@media (max-width: 560px) {
  .tabbar { padding-left: 16px; padding-right: 16px; }
}

/* 스켈레톤 / 유틸 */
.mono { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--label-3); }
.text-sm { font-size: 13.5px; }
.text-xs { font-size: 12px; }
.hidden { display: none !important; }

/* 애니메이션 */
.fade-in { animation: fade-in 0.28s ease both; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ---------------- 헤더 액션 아이콘 ---------------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.header-action {
  width: 42px;
  height: 42px;
  transition: transform 0.16s var(--ease), background 0.16s ease, color 0.16s ease;
}

.header-action svg { width: 20px; height: 20px; }

.header-action:active {
  transform: scale(0.9);
  background: var(--blue-soft);
  color: var(--blue);
}

.header-action.is-active {
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

/* ---------------- 기본 비밀번호 경고 배너 ---------------- */
.warn-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  background: var(--orange-soft);
  border: 1.5px solid rgba(232, 133, 12, 0.34);
  animation: fade-in 0.3s ease both;
}

.warn-banner__icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
}

.warn-banner__icon svg { width: 19px; height: 19px; }

.warn-banner__title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--orange);
}

.warn-banner__text {
  font-size: 12.5px;
  color: var(--label-2);
  line-height: 1.45;
  margin-top: 2px;
}

.warn-banner__btn {
  flex: 0 0 auto;
  background: var(--orange);
  color: #fff;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13.5px;
  border-radius: 10px;
  box-shadow: none;
}

@media (max-width: 420px) {
  .header-actions { gap: 6px; }
  .header-action { width: 38px; height: 38px; }
  .header-action svg { width: 18px; height: 18px; }
  .app-header__inner { gap: 8px; }
  .warn-banner { flex-wrap: wrap; }
  .warn-banner .grow { flex: 1 1 100%; order: 3; }
}

/* 인쇄 */
@media print {
  .app-header, .tabbar, .bottom-bar, .punch-btn, .toast-wrap { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
