/* ---------------------------------------------------------------
   Groupware — 백오피스 디자인 시스템
   --------------------------------------------------------------- */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e7e9ee;
  --border-strong: #d6dae2;
  --text: #14161a;
  --text-2: #4b5563;
  --muted: #8b93a1;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-border: #c7d2fe;

  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --info: #0369a1;
  --info-soft: #f0f9ff;

  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.16), 0 4px 12px -4px rgba(16, 24, 40, 0.08);
  --sidebar-w: 248px;

  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

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

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }

/* ------------------------------------------------------------ 레이아웃 */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar__brand--switch { cursor: pointer; transition: background .12s ease; }
.sidebar__brand--switch:hover { background: var(--surface-2); }
.sidebar__brand--switch:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.brand-chevron { color: var(--muted); flex: 0 0 auto; display: flex; }

/* 등록된 로고 이미지 / 미등록 시 이니셜 사각형 */
.logo-mark {
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.initial-mark {
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7c6ef6);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.brand-text {
  font-weight: 650; font-size: 14.5px; letter-spacing: -0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1;
}

.nav { padding: 8px 12px; overflow-y: auto; flex: 1; }
.nav__label {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 14px 10px 6px;
}
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
  margin-bottom: 1px;
}
.nav__item:hover { background: #f2f3f7; color: var(--text); }
.nav__item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav__item svg { flex: 0 0 auto; opacity: .85; }
.nav__badge {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 20px; padding: 0 7px; color: var(--muted);
}

.sidebar__footer { border-top: 1px solid var(--border); padding: 10px 12px; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  transition: background .12s ease;
}
.user-chip:hover { background: #f2f3f7; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #eceef3; color: var(--text-2);
  display: grid; place-items: center; font-weight: 650; font-size: 12.5px;
  flex: 0 0 auto;
}
.avatar--sm { width: 26px; height: 26px; font-size: 11.5px; }
.user-chip__meta { min-width: 0; flex: 1; }
.user-chip__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip__mail { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 15.5px; font-weight: 650; letter-spacing: -0.02em; }
.topbar__sub { color: var(--muted); font-size: 12.5px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { padding: 24px; width: 100%; max-width: none; }
.content--wide { max-width: none; }
/* 입력 위주 화면에서 필드가 과도하게 늘어나지 않도록 하는 보조 폭 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 980px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head__text h1 { font-size: 20px; letter-spacing: -0.03em; }
.page-head__text p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ 컴포넌트 */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.card__head h2 { font-size: 14.5px; }
.card__head p { color: var(--muted); font-size: 12.5px; }
.card__head .spacer { margin-left: auto; }
.card__body { padding: 18px; }
.card__foot { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--sidebar { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1100px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--sidebar, .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
}

.stat { padding: 16px 18px; }
.stat__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat__value { font-size: 26px; font-weight: 680; letter-spacing: -0.035em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 550; font-size: 13.5px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .06s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #c3c9d4; }
.btn:active { transform: translateY(0.5px); }
.btn--primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, .24);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--danger { color: var(--danger); border-color: #f0c7c7; background: #fff; }
.btn--danger:hover { background: var(--danger-soft); border-color: #e5a8a8; }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: #f2f3f7; border-color: transparent; }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn--lg { height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-group { display: inline-flex; gap: 6px; }

.field { margin-bottom: 14px; }
.field__label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field__hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field__row { display: flex; gap: 10px; }
.field__row > * { flex: 1; }

.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color .12s ease, box-shadow .12s ease;
  outline: none;
}
.textarea { height: auto; padding: 9px 11px; resize: vertical; min-height: 76px; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.input::placeholder { color: #a8afbb; }
.input--sm, .select--sm { height: 32px; font-size: 13px; padding: 0 8px; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93a1' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.switch-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.switch-row:last-child { border-bottom: 0; }
.switch-row__text { flex: 1; }
.switch-row__title { font-weight: 600; font-size: 13.5px; }
.switch-row__desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: 0 0 auto; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
  position: absolute; inset: 0; cursor: pointer;
  background: #d5d9e0; border-radius: 999px; transition: background .16s ease;
}
.switch__track::before {
  content: ""; position: absolute; height: 17px; width: 17px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .16s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::before { transform: translateX(17px); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: #f0f1f5; color: var(--text-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); border-color: #a7f3d0; }
.badge--warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.badge--info { background: var(--info-soft); color: var(--info); border-color: #bae6fd; }
.badge--accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.badge--muted { background: #f4f5f7; color: var(--muted); border-color: var(--border); }
.badge__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table tr.is-weekend td { background: #fcfcfd; color: var(--muted); }
.table tr.is-today td { background: var(--accent-soft); }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border-strong); }

.person { display: flex; align-items: center; gap: 9px; }
.person__name { font-weight: 600; }
.person__mail { color: var(--muted); font-size: 12px; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty__icon {
  width: 42px; height: 42px; border-radius: 12px; margin: 0 auto 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted);
}
.empty__title { font-weight: 600; color: var(--text-2); font-size: 14px; }
.empty__desc { font-size: 13px; margin-top: 3px; }

/* 플래시 */
.flash-stack { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: flash-in .22s ease;
}
.flash--success { border-left-color: var(--ok); }
.flash--error { border-left-color: var(--danger); }
.flash__body { flex: 1; min-width: 0; }
.flash__body .copy-field .input { font-family: var(--mono); font-size: 12px; }
.flash__close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; align-self: flex-start; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius);
  font-size: 13px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  margin-bottom: 14px;
}
.alert--error { background: var(--danger-soft); border-color: #fecaca; color: #991b1b; }
.alert--info { background: var(--info-soft); border-color: #bae6fd; color: #075985; }
.alert--warn { background: var(--warn-soft); border-color: #fde68a; color: #92400e; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }

/* 세그먼트 탭 */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: #f0f1f5; border-radius: 9px;
}
.segmented a {
  padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--text-2);
  transition: background .12s ease, color .12s ease;
}
.segmented a:hover { color: var(--text); }
.segmented a.is-active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }

/* 월/일 네비게이터 */
.period-nav { display: inline-flex; align-items: center; gap: 4px; }
.period-nav__value { font-weight: 650; font-size: 15px; letter-spacing: -0.02em; min-width: 118px; text-align: center; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); background: #fff; border-radius: 7px;
  cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-2); }

/* ------------------------------------------------------------ 출퇴근 카드 */

.punch {
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfe 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.punch__date { color: var(--muted); font-size: 13px; }
.punch__clock {
  font-size: 42px; font-weight: 700; letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 2px;
}
.punch__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.punch__slot {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 13px; background: var(--surface);
}
.punch__slot-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.punch__slot-value { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin-top: 1px; }
.punch__slot--filled { border-color: var(--accent-border); background: var(--accent-soft); }
.punch__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.punch__meta { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------ 인증 화면 */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 460px at 50% -10%, #eef1fe 0%, rgba(238, 241, 254, 0) 62%),
    var(--bg);
}
.auth__card {
  width: 100%; max-width: 404px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
}
.auth__brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 20px; }
.auth__title { font-size: 20px; text-align: center; letter-spacing: -0.03em; }
.auth__sub { text-align: center; color: var(--muted); font-size: 13px; margin: 5px 0 22px; }
.auth__foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth__foot a { color: var(--accent); font-weight: 600; }
.auth__legal { text-align: center; margin-top: 20px; font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------ 회사 선택 */

.logo-setting { display: flex; gap: 18px; align-items: flex-start; }
.logo-preview {
  width: 84px; height: 84px; flex: 0 0 auto;
  display: grid; place-items: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2);
}
.logo-setting__body { min-width: 0; flex: 1; }
.logo-setting__title { font-weight: 650; font-size: 15px; letter-spacing: -0.02em; }
.logo-setting__desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
@media (max-width: 620px) { .logo-setting { flex-direction: column; } }

.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.company-card {
  display: flex; align-items: center; gap: 13px;
  padding: 17px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color .12s ease, box-shadow .14s ease, transform .12s ease;
}
.company-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow); transform: translateY(-1px); }
.company-card__avatar {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 17px;
  flex: 0 0 auto;
}
.company-card--new { border-style: dashed; color: var(--muted); justify-content: center; font-weight: 600; }
.company-card--new:hover { color: var(--accent); }

/* ------------------------------------------------------------ 드롭다운 / 모달 */

.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; z-index: 40; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 5px; display: none;
}
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__menu--up { bottom: calc(100% + 6px); left: 0; right: 0; }
.dropdown__menu--down { top: calc(100% + 6px); left: 0; }
.dropdown__menu--right { top: calc(100% + 6px); right: 0; }
.dropdown__item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 6px; font-size: 13.5px; color: var(--text-2);
  cursor: pointer; width: 100%; background: none; border: 0; text-align: left;
}
.dropdown__item:hover { background: #f2f3f7; color: var(--text); }
.dropdown__item-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown__sep { height: 1px; background: var(--border); margin: 5px 2px; }

dialog.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  width: min(520px, calc(100vw - 32px));
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
dialog.modal::backdrop { background: rgba(16, 24, 40, .38); backdrop-filter: blur(2px); }
.modal__head { padding: 17px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal__head h3 { font-size: 15px; }
.modal__body { padding: 20px; max-height: 66vh; overflow-y: auto; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); }

.copy-field { display: flex; gap: 6px; }
.copy-field .input { font-family: var(--mono); font-size: 12px; }

/* ------------------------------------------------------------ 리포트 / 인쇄 */

.report-doc { background: #fff; }
.report-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 16px; border-bottom: 2px solid var(--text);
  margin-bottom: 18px;
}
.report-title { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; }
.report-sub { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.report-meta { text-align: right; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.report-person {
  display: flex; gap: 20px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 14px; font-size: 13px;
}
.report-person dt { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.report-person dd { margin: 1px 0 0; font-weight: 600; }
.report-summary { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-summary__item { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: #fff; }
.report-summary__label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.report-summary__value { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.report-sign { display: flex; justify-content: flex-end; gap: 40px; margin-top: 26px; font-size: 13px; }
.report-sign__box { text-align: center; }
.report-sign__line { width: 130px; border-bottom: 1px solid var(--border-strong); margin-top: 34px; }
.report-section { page-break-inside: auto; }
.report-section + .report-section { margin-top: 30px; page-break-before: always; }

@media (max-width: 1100px) { .report-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .sidebar, .topbar, .no-print, .flash-stack { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; border-radius: 0; }
  .card__body { padding: 0; }
  .table th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table td, .table th { padding: 5px 7px; font-size: 10.5px; }
  .badge { border: 1px solid #ccc; }
  .report-summary { grid-template-columns: repeat(7, 1fr); }
  tr { page-break-inside: avoid; }
}

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

@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 60; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ""; position: fixed; inset: 0; background: rgba(16,24,40,.35); z-index: 50;
  }
  .content { padding: 16px; }
  .punch__grid, .punch__actions { grid-template-columns: 1fr; }
}
@media (min-width: 861px) { .nav-toggle { display: none; } }

/* 연차 사용률 미터 */
.meter { height: 6px; background: #eceef3; border-radius: 999px; overflow: hidden; }
.meter__fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s ease; }
.nav__badge--alert { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }
/* 월별 근태 편집용 조밀 테이블 */
.table--compact td { padding: 6px 10px; }
.table--compact th { padding: 8px 10px; }
.table--compact .input--sm, .table--compact .select--sm { height: 30px; }

/* 근태 편집 도구막대 */
.toolbar { padding: 10px 14px; }
.toolbar__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.toolbar__row + .toolbar__row { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 10px; }
.toolbar__label { font-size: 12px; font-weight: 600; color: var(--muted); }
.toolbar__sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.toolbar__count { font-size: 12px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.toolbar__clip { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.icon-btn--xs { width: 24px; height: 24px; border-radius: 5px; }
.table--compact tbody tr:has(.rowsel:checked) { background: var(--accent-soft); }

/* 시간 텍스트 입력 칸 */
.time-cell {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: .02em;
}
.time-cell.is-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.toolbar__hint { font-size: 12px; color: var(--muted); }
.toolbar__hint code {
  font-family: var(--mono); font-size: 11.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 4px; color: var(--text-2);
}
.grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .grid--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
