/* ---------- Korean webfonts (Naver Hangeul CDN) ----------
   나눔스퀘어 네오 — headers, brand, app bar (display)
   나눔바른고딕   — body text (long content, readable)
   `font-display: swap` so text shows in fallback first, then upgrades. */
@font-face {
  font-family: 'NanumSquareNeo'; font-style: normal; font-weight: 300; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-aLt.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-aLt.ttf')  format('truetype');
}
@font-face {
  font-family: 'NanumSquareNeo'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-bRg.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-bRg.ttf')  format('truetype');
}
@font-face {
  font-family: 'NanumSquareNeo'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-cBd.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-cBd.ttf')  format('truetype');
}
@font-face {
  font-family: 'NanumSquareNeo'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-dEb.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-dEb.ttf')  format('truetype');
}
@font-face {
  font-family: 'NanumSquareNeo'; font-style: normal; font-weight: 900; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-eHv.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareNeo/NanumSquareNeoTTF-eHv.ttf')  format('truetype');
}

@font-face {
  font-family: 'NanumBarunGothic'; font-style: normal; font-weight: 200; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumBarunGothicL/NanumBarunGothicWebUltraLight.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumBarunGothicL/NanumBarunGothicWebUltraLight.ttf')  format('truetype');
}
@font-face {
  font-family: 'NanumBarunGothic'; font-style: normal; font-weight: 300; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumBarunGothicL/NanumBarunGothicWebLight.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumBarunGothicL/NanumBarunGothicWebLight.ttf')  format('truetype');
}
@font-face {
  font-family: 'NanumBarunGothic'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumBarunGothic/NanumBarunGothicWeb.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumBarunGothic/NanumBarunGothicWeb.ttf')  format('truetype');
}
@font-face {
  font-family: 'NanumBarunGothic'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumBarunGothic/NanumBarunGothicWebBold.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/NanumBarunGothic/NanumBarunGothicWebBold.ttf')  format('truetype');
}

:root {
  --indigo: #1f6feb;       /* WittyButtonColors.Primary */
  --indigo-dark: #1857c0;
  --green: #30C458;        /* WittyButtonColors.Green */
  --green-dark: #28a94b;
  --red: #DF363B;          /* WittyButtonColors.Red */
  --red-dark: #c22a2f;
  --accent: #EC008C;       /* WittyButtonColors.Accent */
  --bg: #eef0f6;
  --card: #ffffff;
  --text: #1f2330;
  --muted: #8a90a2;
  --line: #e8eaf1;

  /* Body text: 나눔바른고딕 (readable for long content) with system fallbacks
     so anything shows immediately while the webfont swaps in. */
  --font-body: 'NanumBarunGothic', -apple-system, BlinkMacSystemFont,
               'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  /* Display: 나눔스퀘어 네오 for headings, brand, app bar, big clock. */
  --font-display: 'NanumSquareNeo', 'NanumBarunGothic', -apple-system, BlinkMacSystemFont,
                  'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}
/* Form controls don't inherit body font by default in many UAs — force it. */
input, select, textarea, button { font-family: inherit; }

/* Display font (나눔스퀘어 네오) for headers, brand, app bar, big numbers. */
.brand, .login-sub,
.appbar-title,
.profile-name,
.clock-now, .clock-date,
.placeholder-title,
.lh-title, .lh-name,
.notice-title,
.section-label,
.tab-label,
.badge,
.btn {
  font-family: var(--font-display);
}

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

.view { display: none; flex: 1; flex-direction: column; }
.view.active { display: flex; }

/* Loading */
#view-loading { align-items: center; justify-content: center; }
.spinner {
  width: 42px; height: 42px;
  border: 4px solid rgba(31, 111, 235, .15);
  border-top-color: var(--indigo);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
#view-login { position: relative; align-items: center; justify-content: center; overflow: hidden; }
.login-bg {
  position: absolute; inset: 0;
  background: var(--indigo) url("icons/bg_login.png") center/cover no-repeat;
}
.login-bg::after { content: ""; position: absolute; inset: 0; background: rgba(31, 111, 235, .55); }
.login-inner {
  position: relative; z-index: 1;
  width: 100%; padding: 0 24px;
  display: flex; flex-direction: column; align-items: center;
}
.logo { width: 96px; height: 96px; object-fit: contain; border-radius: 22px; box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.login-sub { color: rgba(255,255,255,.9); margin: 14px 0 26px; font-size: 15px; }
.login-card { width: 100%; }

.card { background: var(--card); border-radius: 18px; padding: 20px; box-shadow: 0 10px 30px rgba(31, 35, 48, .12); }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
input, select {
  width: 100%; margin-top: 6px; padding: 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--indigo); }

.btn { width: 100%; border: none; border-radius: 12px; font-size: 17px; font-weight: 700; padding: 16px; color: #fff; cursor: pointer; }
.btn.primary { background: var(--indigo); }
.btn.primary:active { background: var(--indigo-dark); }
.btn:disabled { opacity: .55; }

.error { color: var(--red); font-size: 14px; margin: 12px 0 0; text-align: center; }

/* ---------- Clock ---------- */
.appbar {
  background: var(--indigo); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 12px 14px;
}
.appbar-title { font-size: 17px; font-weight: 700; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-spacer, .appbar-action { width: 40px; }
.appbar-action { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }

/* Year chip on the appbar (used by 휴가 list). Native <select> styled to feel
   like a pill: indigo translucent fill, white text, small caret. */
.year-picker { width: 76px; margin-left: 8px; }
.year-picker select {
  width: 100%; margin: 0; padding: 6px 22px 6px 12px;
  background: rgba(255,255,255,.18); color: #fff;
  border: none; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%),
                    linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 13px) center, calc(100% - 8px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.year-picker select option { color: var(--text); background: var(--card); }

.clock-body { padding: 16px; padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }

/* profile header */
.profile { display: flex; align-items: center; gap: 12px; padding: 4px 4px 16px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--accent));
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.org-row { margin-bottom: 12px; }

/* time card */
.time-card { text-align: center; padding: 26px 20px 22px; }
.clock-now { font-size: 50px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; line-height: 1; color: rgba(31,35,48,.9); }
.clock-date { font-size: 16px; color: var(--text); margin-top: 10px; font-weight: 500; }
.tz-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.today-sched { margin-top: 14px; font-size: 14px; color: var(--indigo); background: #eef0fb; display: inline-block; padding: 7px 14px; border-radius: 999px; font-weight: 600; }
.time-status { margin: 18px 0; }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: #eef0fb; color: var(--indigo); }
.badge.in { background: #e7f8ee; color: var(--green-dark); }
.badge.out { background: #fdecec; color: var(--red-dark); }
.badge.break { background: #fff3df; color: #b87503; }
.detail { display: block; color: var(--muted); font-size: 14px; margin-top: 8px; min-height: 18px; }

.btn.punch { font-size: 20px; padding: 20px; border-radius: 12px; letter-spacing: 1px; }
.btn.punch.out { background: var(--green); }   /* clocked out -> show 출근 */
.btn.punch.out:active { background: var(--green-dark); }
.btn.punch.in { background: var(--red); }       /* working -> show 퇴근 */
.btn.punch.in:active { background: var(--red-dark); }

.msg { text-align: center; font-size: 15px; margin: 16px 0 0; padding: 12px; border-radius: 10px; }
.msg.ok { background: #e7f8ee; color: var(--green-dark); }
.msg.fail { background: #fdecec; color: var(--red-dark); }

.force-panel { margin-top: 14px; text-align: left; }
.force-panel input { margin-top: 0; }
.force-actions { display: flex; gap: 10px; margin-top: 10px; }
.force-actions .btn { padding: 13px; font-size: 15px; }
.btn.ghost { background: #eef0f6; color: var(--text); }
.btn.ghost:active { background: #e2e5ee; }
.btn.warn { background: var(--accent); }
.btn.warn:active { filter: brightness(.94); }

/* feature menu */
.menu { margin-top: 18px; background: var(--card); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 20px rgba(31,35,48,.06); }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 14px;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 16px 18px; font-size: 16px; color: var(--text); cursor: pointer; text-align: left;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #f6f7fb; }
.menu-item.disabled { color: var(--muted); cursor: default; }
.mi-icon { font-size: 18px; width: 24px; text-align: center; }
.mi-text { flex: 1; }
.mi-arrow { color: var(--muted); font-size: 20px; }
.mi-badge { font-size: 11px; font-weight: 700; color: var(--accent); background: #fde7f3; padding: 3px 8px; border-radius: 999px; }

/* ---------- Leave ---------- */
/* Tighten top so the form appears immediately under the app bar. */
#view-leave .clock-body { padding-top: 10px; }
#view-leave .card { padding: 16px 18px; }
#view-leave label { margin-bottom: 10px; }
.leave-balance { margin: -6px 0 14px; font-size: 13px; color: var(--green-dark); font-weight: 600; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.checkbox-row input { width: auto; margin: 0; }
.leave-days { margin: -6px 0 14px; font-size: 14px; color: var(--indigo); font-weight: 600; }
textarea { width: 100%; margin-top: 6px; padding: 14px; font-size: 16px; border: 1px solid var(--line); border-radius: 11px; font-family: inherit; resize: vertical; }
textarea:focus { outline: none; border-color: var(--indigo); }
/* Korean-style date field — text input shows YYYY/MM/DD,
   native date picker is invisible but opened via showPicker(). */
.date-field { position: relative; }
.date-display {
  width: 100%; margin-top: 6px; padding: 14px 44px 14px 14px;
  font-size: 16px; border: 1px solid var(--line); border-radius: 11px;
  background: #fff; color: var(--text);
  background-image: linear-gradient(45deg, transparent 50%, var(--indigo) 50%), linear-gradient(135deg, var(--indigo) 50%, transparent 50%);
  background-position: calc(100% - 22px) center, calc(100% - 15px) center;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.date-display:focus { outline: none; border-color: var(--indigo); }
.date-picker { position: absolute; left: 0; top: 6px; width: 100%; height: calc(100% - 6px); opacity: 0; pointer-events: none; }

/* Segmented toggle (일자로 / 시간) */
.seg { display: flex; background: #eef0f6; border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.seg-btn { flex: 1; border: none; background: transparent; padding: 10px; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 8px; cursor: pointer; }
.seg-btn.active { background: var(--card); color: var(--indigo); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg-btn:disabled { color: #c5c8d3; cursor: not-allowed; }

/* 4-up segments for the leave list (신청중 / 승인 / 참조 / 사용내역) */
.seg.leave-segs { margin: 4px 0 14px; }
.seg.leave-segs .seg-btn { padding: 10px 4px; font-size: 13px; }

/* Leave list cards (segmented list) */
.lc-card { background: var(--card); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 4px 14px rgba(31,35,48,.05); }
.lc-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lc-name { font-weight: 700; font-size: 15px; }
.lc-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.lc-by { color: var(--muted); font-size: 12px; margin-top: 2px; }
.lc-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; flex-shrink: 0; }
.lc-status.pending { background: #fff3df; color: #b87503; }
.lc-status.approved { background: #e7f8ee; color: var(--green-dark); }
.lc-status.rejected, .lc-status.cancelled { background: #fdecec; color: var(--red-dark); }
.lc-status.preapproved { background: #eef0fb; color: var(--indigo); }
.lc-empty { color: var(--muted); text-align: center; padding: 50px 24px; }
.lc-card.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.lc-card.tappable:active { background: #f3f4fb; }

/* Leave detail view */
.dt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.dt-title { font-weight: 700; font-size: 18px; }
.dt-days { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dt-sub { color: var(--muted); font-size: 12px; margin-top: 8px; }
.dt-grid { display: flex; gap: 12px; }
.dt-grid > div { flex: 1; }
.dt-key { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.dt-val { font-size: 14px; color: var(--text); }
.dt-purpose { font-size: 14px; color: var(--text); white-space: pre-wrap; background: #f6f7fb; border-radius: 10px; padding: 12px; }
.dt-approver { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #eef0f4; }
.dt-approver:last-child { border-bottom: none; }
.dt-approver-name { font-size: 14px; font-weight: 600; }
.dt-approver-pos { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Floating action button (휴가 신청 +) — fixed bottom-right, above the bottom bar */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom) + 96px);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--accent) 100%);
  color: #fff; font-size: 32px; line-height: 1; font-weight: 300;
  border: none; cursor: pointer;
  box-shadow: 0 8px 22px rgba(31, 111, 235, .45);
  z-index: 15;
}
.fab:active { transform: translateY(1px); }
/* On wide viewports, align FAB to the right edge of the centered #app column. */
@media (min-width: 521px) {
  .fab { right: calc(50% - 240px + 20px); }
}

.time-row { display: flex; gap: 10px; }
.time-row label { flex: 1; }

/* Section label + label-row (with attach icon) */
.section-label { font-size: 13px; color: var(--muted); font-weight: 700; margin: 14px 4px 8px; text-transform: none; }
.label-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.label-row .lbl { font-size: 13px; color: var(--muted); font-weight: 600; flex: 1; }
.icon-btn { background: #eef0fb; color: var(--indigo); border: none; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px; }
.icon-btn:active { background: #dde1f5; }

/* Chips (attachments + CC) */
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip-list:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eef0fb; color: var(--indigo); padding: 6px 4px 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; }
.chip .chip-x { background: rgba(31,111,235,.15); border: none; color: var(--indigo); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.chip .chip-x:active { background: rgba(31,111,235,.3); }

/* Approver slot: two dropdowns + remove */
.approver-slot { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.approver-slot select { margin-top: 0; flex: 1; min-width: 0; padding: 12px 10px; font-size: 14px; }
.slot-remove { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; cursor: pointer; flex: 0 0 auto; }
.slot-remove:active { color: var(--red); }

/* Add-approver button is small-ghost styled */
.btn.ghost.small { width: auto; padding: 8px 14px; font-size: 14px; margin-bottom: 12px; }

/* CC search + suggestions */
.cc-search { position: relative; margin-bottom: 14px; }
.cc-suggest { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; max-height: 220px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.1); z-index: 5; }
.cc-suggest-item { padding: 10px 14px; font-size: 14px; cursor: pointer; }
.cc-suggest-item:hover, .cc-suggest-item:active { background: #eef0fb; color: var(--indigo); }
.cc-suggest-empty { padding: 10px 14px; color: var(--muted); font-size: 13px; }

.leave-history { margin-top: 20px; }
.lh-title { font-weight: 700; font-size: 16px; margin: 4px 4px 10px; }
.lh-item { background: var(--card); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; box-shadow: 0 4px 14px rgba(31,35,48,.05); }
.lh-row { display: flex; justify-content: space-between; align-items: center; }
.lh-name { font-weight: 700; }
.lh-dates { color: var(--muted); font-size: 13px; margin-top: 4px; }
.lh-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.lh-status.pending { background: #fff3df; color: #b87503; }
.lh-status.approved { background: #e7f8ee; color: var(--green-dark); }
.lh-status.rejected, .lh-status.cancelled { background: #fdecec; color: var(--red-dark); }
.lh-empty { color: var(--muted); text-align: center; padding: 20px; }

/* ---------- Bottom tab bar (4 sections) ---------- */
.bottom-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--indigo); color: #fff;
  display: flex; align-items: stretch;
  padding: 8px 6px calc(env(safe-area-inset-bottom) + 8px);
  z-index: 20;
  box-shadow: 0 -4px 16px rgba(0,0,0,.18);
}
.tab-btn {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 8px 4px;
  color: rgba(255,255,255,.6); font-size: 11px; font-weight: 700;
  border-radius: 999px;
  margin: 0 2px;
  transition: background .15s, color .15s;
}
.tab-btn:active { background: rgba(255,255,255,.08); }
.tab-btn.active { color: #fff; background: rgba(255,255,255,.18); }
.tab-icon { font-size: 18px; line-height: 1; }
.tab-label { font-size: 11px; line-height: 1.2; }

/* Elevated center tab (홈) — floats above the bar like a FAB. */
.bottom-bar { overflow: visible; }
.tab-btn.center {
  flex: 0 0 64px;
  width: 64px; height: 64px;
  margin: -22px 6px 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(31, 111, 235, .45);
  padding: 0;
}
.tab-btn.center .tab-icon { font-size: 24px; }
.tab-btn.center .tab-label { font-size: 10px; margin-top: 1px; }
.tab-btn.center.active,
.tab-btn.center:active {
  background: linear-gradient(135deg, var(--indigo) 0%, var(--accent) 100%);
  color: #fff;
}

/* Reserve room at the bottom of every tab body so content isn't hidden. */
#view-clock .clock-body,
#view-leave .clock-body,
#view-notice .clock-body,
#view-schedule .clock-body,
#view-attendance .clock-body {
  padding-bottom: calc(env(safe-area-inset-bottom) + 88px);
}

/* ---------- 근태관리 / attendance ---------- */
.seg.att-mode { margin-bottom: 14px; }

.att-confirmed {
  background: #e7f8ee; color: var(--green-dark);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
  font-size: 13px; font-weight: 700; text-align: center;
}
.att-confirmed.unconfirmed { background: #fff3df; color: #b87503; }

/* Summary table */
.summary-table {
  background: var(--card); border-radius: 12px;
  overflow: hidden; box-shadow: 0 4px 14px rgba(31,35,48,.06);
}
.st-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--line);
  font-size: 14px;
}
.st-row.header { border-top: none; background: #f6f7fb; font-weight: 700; color: var(--muted); font-size: 12px; }
.st-row.zero { color: var(--muted); }
.st-row.total { border-top: 2px solid var(--indigo); font-weight: 800; background: #f6f7fb; }
.st-row.total .st-val { color: var(--indigo); }
.st-label { color: var(--text); }
.st-val { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Clickable rows (those with contributing days) — drill into a per-day list */
.st-row.clickable { width: 100%; background: transparent; border-left: none; border-right: none; border-bottom: none; cursor: pointer; text-align: left; }
.st-row.clickable:hover { background: #fafbfd; }
.st-row.clickable .st-caret { display: inline-block; margin-left: 6px; transition: transform .15s; color: var(--indigo); font-size: 11px; }
.st-row.clickable[aria-expanded="true"] .st-caret { transform: rotate(180deg); }
.st-detail {
  background: #fafbfd; border-top: 1px solid var(--line);
  padding: 4px 0;
}
.st-detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 32px 8px 32px; font-size: 13px;
  border-top: 1px dashed var(--line);
}
.st-detail-row:first-child { border-top: none; }
.st-detail-row.sun .st-detail-date { color: var(--red); }
.st-detail-row.sat .st-detail-date { color: var(--indigo); }
.st-detail-date { color: var(--text); }
.st-detail-hours { font-family: var(--font-display); font-weight: 700; color: var(--indigo); font-variant-numeric: tabular-nums; }
.st-detail-empty { padding: 10px 32px; color: var(--muted); font-size: 12px; }

/* Daily list rows */
.att-day {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  box-shadow: 0 3px 10px rgba(31,35,48,.05);
}
.att-day.today { border-left: 4px solid var(--indigo); }
.att-day.past { opacity: .85; }
.att-day-date { width: 44px; flex-shrink: 0; text-align: center; }
.att-day-date .d { font-family: var(--font-display); font-size: 20px; font-weight: 800; line-height: 1; }
.att-day-date .w { font-size: 11px; color: var(--muted); margin-top: 3px; font-weight: 600; }
.att-day.sat .att-day-date .w { color: var(--indigo); }
.att-day.sun .att-day-date .w { color: var(--red); }
.att-day-info { flex: 1; min-width: 0; font-size: 13px; }
.att-day-sched { color: var(--text); font-weight: 600; }
.att-day-sched.off { color: var(--muted); font-weight: 500; }
.att-day-actual { color: var(--muted); margin-top: 3px; font-size: 12px; }
.att-day-hours { flex-shrink: 0; text-align: right; }
.att-day-hours-val { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--indigo); }
.att-day-hours-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 일정 / schedule ---------- */
.sched-range { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; margin: 0 0 14px; }
.day-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(31,35,48,.05);
  border-left: 4px solid transparent;
}
.day-card.today { border-left-color: var(--indigo); background: linear-gradient(90deg, #eef0fb 0%, var(--card) 60%); }
.day-card.past { opacity: .7; }

.day-date { width: 48px; text-align: center; color: var(--text); flex-shrink: 0; }
.day-num { font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1; }
.day-dow { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }
.day-card.today .day-num,
.day-card.today .day-dow { color: var(--indigo); }
.day-card.sat .day-dow { color: var(--indigo); }
.day-card.sun .day-dow { color: var(--red); }

.day-info { flex: 1; min-width: 0; font-size: 14px; }
.day-sched { color: var(--text); font-weight: 600; }
.day-sched.off { color: var(--muted); font-weight: 500; }
.day-actual { color: var(--muted); font-size: 12px; margin-top: 4px; }

.day-status { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.day-status.today    { background: #eef0fb; color: var(--indigo); }
.day-status.upcoming { background: #eef0fb; color: var(--indigo); }
.day-status.working  { background: #e7f8ee; color: var(--green-dark); }
.day-status.done     { background: #e7f8ee; color: var(--green-dark); }
.day-status.absent   { background: #fdecec; color: var(--red-dark); }
.day-status.leave    { background: #fff3df; color: #b87503; }
.day-status.off      { background: #f1f3f7; color: var(--muted); }

.sched-loading, .sched-empty { color: var(--muted); text-align: center; padding: 40px 24px; }

/* 주간/월간 toggle */
.seg.sched-mode { margin-bottom: 14px; }

/* Monthly calendar grid */
.month-grid { background: var(--card); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(31,35,48,.06); }
.dow-header { display: grid; grid-template-columns: repeat(7, 1fr); padding: 10px 0; background: #f6f7fb; border-bottom: 1px solid var(--line); }
.dow-cell { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.dow-cell.sun { color: var(--red); }
.dow-cell.sat { color: var(--indigo); }
.month-cells { display: grid; grid-template-columns: repeat(7, 1fr); }
.day-cell {
  aspect-ratio: 1 / 1;
  border: none; background: transparent; cursor: pointer;
  padding: 6px 4px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  border-top: 1px solid var(--line);
  position: relative;
}
.day-cell:active { background: #f5f6fb; }
.day-cell.empty { visibility: hidden; cursor: default; }
.day-cell-num {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600; color: var(--text);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.day-cell.sun .day-cell-num { color: var(--red); }
.day-cell.sat .day-cell-num { color: var(--indigo); }
.day-cell.today .day-cell-num { background: var(--indigo); color: #fff; }
.day-cell.today.sun .day-cell-num,
.day-cell.today.sat .day-cell-num { color: #fff; }
.day-cell.selected .day-cell-num { background: linear-gradient(135deg, var(--indigo), var(--accent)); color: #fff; }
.day-cell.past .day-cell-num { opacity: .75; }

.day-cell-dot {
  position: absolute; bottom: 7px;
  width: 6px; height: 6px; border-radius: 50%;
}
.day-cell-dot.working,
.day-cell-dot.done    { background: var(--green); }
.day-cell-dot.leave   { background: #d98a00; }
.day-cell-dot.absent  { background: var(--red); }
.day-cell-dot.upcoming{ background: var(--indigo); opacity: .45; }

/* Selected-day detail panel (below the grid) */
.day-detail {
  background: var(--card); border-radius: 12px; padding: 14px 16px; margin-top: 14px;
  box-shadow: 0 4px 14px rgba(31,35,48,.06);
}
.day-detail-title { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.day-detail-title .day-status { font-size: 11px; padding: 4px 10px; }
.day-detail-row { color: var(--text); font-size: 14px; margin-top: 6px; }
.day-detail-row.muted { color: var(--muted); }

/* ---------- Notices (공지사항) ---------- */
.notice-card {
  background: var(--card); border-radius: 14px; margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(31,35,48,.06); overflow: hidden;
}
.notice-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; cursor: pointer; }
.notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 7px; }
.notice-card.read .notice-dot { background: transparent; border: 2px solid var(--line); box-sizing: border-box; }
.notice-head-text { flex: 1; min-width: 0; }
.notice-title { font-weight: 700; font-size: 15px; color: var(--text); line-height: 1.35; }
.notice-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.notice-caret { color: var(--muted); font-size: 14px; transition: transform .15s; }
.notice-card.open .notice-caret { transform: rotate(90deg); }
.notice-body { display: none; padding: 0 16px 16px; color: var(--text); font-size: 14px; line-height: 1.6; }
.notice-body img { max-width: 100%; height: auto; border-radius: 8px; }
.notice-body p { margin: 0 0 8px; }
.notice-card.open .notice-body { display: block; }
.notice-empty, .notice-loading { color: var(--muted); text-align: center; padding: 40px 24px; }

/* Placeholder view for sections that aren't built yet. */
.placeholder { text-align: center; padding: 60px 24px; color: var(--muted); }
.placeholder-icon { font-size: 56px; margin-bottom: 14px; }
.placeholder-title { font-size: 18px; font-weight: 700; color: var(--text); }
.placeholder-sub { font-size: 14px; margin-top: 6px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #1f2330; color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; max-width: 90%; text-align: center; z-index: 50;
}
