/* --------------------------------------------------------------------------
 * 근태관리 — 출퇴근 · 휴가 · 근무표 · 관리 화면
 * 근무 유형 색(shift-*)은 상태 색 토큰을 옅게 섞어 라이트 · 다크에서 같이 읽힌다.
 * -------------------------------------------------------------------------- */
.form-section-title {
    margin-top: 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--ln);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--tx-muted);
}
.min-width-0 {
    min-width: 0;
}

.shift-info { --shift: var(--st-info-fill); --shift-text: var(--st-info); }
.shift-success { --shift: var(--st-success-fill); --shift-text: var(--st-success); }
.shift-warning { --shift: var(--st-warning-fill); --shift-text: var(--st-warning); }
.shift-danger { --shift: var(--st-danger-fill); --shift-text: var(--st-danger); }
.shift-purple { --shift: #7c3aed; --shift-text: #6d28d9; }
.shift-secondary { --shift: var(--tx-faint); --shift-text: var(--tx-muted); }
.shift-none { --shift: transparent; --shift-text: var(--tx); }
@media (prefers-color-scheme: dark) {
    .shift-purple { --shift-text: #c4b5fd; }
}
[data-bs-theme="dark"] .shift-purple { --shift-text: #c4b5fd; }

.shift-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.625rem;
    height: 1.375rem;
    padding: 0 0.25rem;
    border-radius: 4px;
    background: color-mix(in srgb, var(--shift) 18%, var(--sf-card));
    color: var(--shift-text);
    font-size: 0.75rem;
    font-weight: 700;
}

/* 결재 기안 · 보기의 연동 칸 */
.link-box {
    padding: 0.875rem 1rem;
    border: 1px solid var(--ln);
    border-radius: 0.5rem;
    background: var(--sf-inset);
}
.link-box-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 0.625rem;
}
.link-balance {
    font-size: 0.8125rem;
    color: var(--tx-muted);
}
.link-balance strong {
    color: var(--tx-strong);
}
.link-unit {
    width: 100%;
    max-width: 26rem;
}
.link-summary {
    display: grid;
    grid-template-columns: 4rem 1fr;
    gap: 0.25rem 0.75rem;
    font-size: 0.875rem;
}
.link-summary dt {
    font-weight: 400;
    color: var(--tx-muted);
}
.link-summary dd {
    margin: 0;
}

/* 출퇴근 */
.clock-now {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--tx-strong);
    font-variant-numeric: tabular-nums;
}
.clock-schedule {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.clock-chip {
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: var(--brand-accent);
    color: var(--brand-ink);
    font-size: 0.75rem;
    font-weight: 700;
}
.clock-chip.is-off {
    background: var(--sf-raised);
    color: var(--tx-muted);
}
.clock-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.clock-times > div {
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--sf-inset);
}
.clock-times dt {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--tx-muted);
}
.clock-times dd {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.clock-button {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    font-weight: 600;
}

.week-meter {
    position: relative;
    height: 0.75rem;
    border-radius: 999px;
    background: var(--sf-raised);
    overflow: hidden;
}
.week-meter > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--hospital-blue);
}
.week-meter.is-warn > span {
    background: var(--st-warning-fill);
}
.week-meter.is-over > span {
    background: var(--st-danger-fill);
}
.week-meter > i {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--tx-faint);
}
.week-meter.is-thin {
    height: 0.375rem;
    margin-top: 0.375rem;
}
.week-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 1rem 0 0;
}
.week-breakdown dt {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--tx-muted);
}
.week-breakdown dd {
    margin: 0;
    font-weight: 600;
}
.attendance-table tr.is-today > * {
    background: color-mix(in srgb, var(--brand-accent) 12%, var(--sf-card));
}
.attendance-table tr.is-rest td {
    color: var(--tx-muted);
}

/* 내 휴가 */
.leave-summary-main {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tx-strong);
}
.leave-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 0.75rem 0 0;
}
.leave-summary-grid dt {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--tx-muted);
}
.leave-summary-grid dd {
    margin: 0;
    font-weight: 600;
}
.leave-profile {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.375rem 0.75rem;
    font-size: 0.875rem;
}
.leave-profile dt {
    font-weight: 400;
    color: var(--tx-muted);
}
.leave-profile dd {
    margin: 0;
}
.ledger-table td {
    font-size: 0.8125rem;
}
.promotion-card {
    border-color: var(--st-danger-fill);
    box-shadow: inset 4px 0 0 var(--st-danger-fill);
}
.promotion-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}
.promotion-dates input[type="date"] {
    width: 10rem;
}
.promotion-second {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}
.promotion-second-who {
    display: flex;
    flex-direction: column;
    min-width: 14rem;
}

/* 근무표 */
.roster-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.roster-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
}
.roster-scroll {
    max-height: 70vh;
}
.roster-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
    min-width: 100%;
}
.roster-table th,
.roster-table td {
    padding: 0.125rem;
    border-right: 1px solid var(--ln-soft);
    border-bottom: 1px solid var(--ln-soft);
    text-align: center;
    white-space: nowrap;
}
.roster-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    min-width: 2.25rem;
    padding: 0.25rem 0.125rem;
    background: var(--sf-raised);
    font-weight: 600;
    color: var(--tx);
}
.roster-table thead th span,
.roster-table thead th small {
    display: block;
    line-height: 1.2;
}
.roster-table thead th small {
    font-size: 0.625rem;
    font-weight: 400;
    color: var(--tx-muted);
}
.roster-table thead th.is-sunday,
.roster-table thead th.is-sunday small {
    color: var(--st-danger);
}
.roster-table thead th.is-saturday,
.roster-table thead th.is-saturday small {
    color: var(--st-info);
}
.roster-table thead th.is-today,
.roster-table thead th.is-today small {
    background: var(--brand-accent);
    color: var(--brand-ink);   /* 요일(small)도 — 흐린 회색이 파란 바탕에 묻혔다. 일 · 토 · 공휴일 색보다 먼저 */
}
.roster-table .roster-name {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 7rem;
    padding: 0.25rem 0.5rem;
    background: var(--sf-card);
    text-align: left;
    font-weight: 600;
    color: var(--tx-strong);
}
.roster-table thead .roster-name {
    z-index: 3;
    background: var(--sf-raised);
}
.roster-table .roster-name small {
    margin-left: 0.25rem;
    font-weight: 400;
    color: var(--tx-muted);
}
.roster-table .roster-sum {
    min-width: 2rem;
    background: var(--sf-inset);
    font-weight: 600;
}
.roster-table tfoot th,
.roster-table tfoot td {
    background: var(--sf-inset);
    color: var(--tx-muted);
    font-weight: 600;
}
/* 내 줄 — 위아래 파란 선 + 옅은 파랑 바탕 + 이름 칸 왼쪽 파란 막대.
   칸은 근무 선택 상자 · 꼬리표가 거의 덮어 바탕만으로는 안 보인다 — 선이 가로줄을 긋는다(오늘 칸도 선은 이어짐).
   이름 칸은 옆으로 밀어도 붙어 있으므로 불투명하게 섞는다. */
.roster-table tr.is-me > th,
.roster-table tr.is-me > td:not(.is-today) {
    background: color-mix(in srgb, var(--theme-primary) 12%, var(--sf-card));
}
.roster-table tr.is-me > td.roster-sum {
    background: color-mix(in srgb, var(--theme-primary) 12%, var(--sf-inset));
}
.roster-table tr.is-me > * {
    box-shadow: inset 0 2px 0 var(--theme-primary), inset 0 -2px 0 var(--theme-primary);
}
.roster-table tr.is-me > .roster-name {
    box-shadow: inset 3px 0 0 var(--theme-primary), inset 0 2px 0 var(--theme-primary), inset 0 -2px 0 var(--theme-primary);
    color: var(--theme-primary);
}
.roster-cell {
    position: relative;
}
.roster-cell.is-today {
    background: color-mix(in srgb, var(--brand-accent) 14%, var(--sf-card));
}
.roster-cell.has-warning::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    border-style: solid;
    border-width: 0 7px 7px 0;
    border-color: transparent var(--st-danger-fill) transparent transparent;
}
.roster-select {
    width: 2.25rem;
    height: 1.625rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 4px;
    background: color-mix(in srgb, var(--shift) 18%, var(--sf-card));
    color: var(--shift-text);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    text-align-last: center;
    appearance: none;
    cursor: pointer;
}
.roster-select.shift-none {
    background: transparent;
    border-color: var(--ln-soft);
}
.roster-select:focus {
    outline: 2px solid var(--brand-accent);
    outline-offset: 0;
}
.roster-leave {
    position: absolute;
    left: 1px;
    bottom: 1px;
    padding: 0 2px;
    border-radius: 2px;
    background: var(--st-info-fill);
    color: #fff;
    font-size: 0.5625rem;
    line-height: 1.2;
}

/* 근태 설정 */
/* 설정 탭(근태 설정 · 코드 관리) — 회색 바탕에 묻히지 않게 카드와 같은 흰 띠, 고른 탭은 바닥 파란 줄 */
.settings-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 0.5rem;
    overflow-x: auto;
    border: 1px solid var(--ln);
    border-radius: 10px;
    background: var(--sf-card);
    scrollbar-width: none;
}
.settings-tab {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid transparent;
    color: var(--tx-muted);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.settings-tab:hover {
    color: var(--tx-strong);
}
.settings-tab.active {
    border-bottom-color: var(--brand-accent);
    color: var(--brand-accent);
    font-weight: 600;
}
.settings-table td {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}
.settings-table tr.is-new {
    background: var(--sf-inset);
}
.settings-table tr.is-inactive input[type="text"] {
    color: var(--tx-faint);
}
.settings-number {
    width: 4.5rem;
}
.settings-code {
    width: 4.5rem;
    font-weight: 700;
}
.report-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.report-card {
    max-width: 52rem;
}

/* 근태 설정 — 근무 시간(출근 ~ 퇴근) · 휴게를 한 줄에 좁게. */
.settings-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.settings-time {
    width: 7.5rem;
    flex: 0 0 auto;
}
.settings-break {
    width: 9.5rem;
    flex: 0 0 auto;
}
.settings-break .form-control {
    text-align: right;
}

/*
 * 전체 앱 — 그룹마다 테두리 영역 하나(fieldset), 제목(legend)은 위 테두리선 가운데에 얹혀
 * 선을 끊는다: ──── 그룹웨어 ────. 부트스트랩이 legend 에 준 float · 폭 100% 는 걷어 낸다.
 */
.app-grid-section {
    min-inline-size: 0;
    margin: 0;
    padding: 0.125rem 0.375rem 0.375rem;
    border: 1px solid var(--ln);
    border-radius: 0.75rem;
    background: var(--sf-inset);
}
.app-grid-section + .app-grid-section {
    margin-top: 0.875rem;
}
.app-grid-section > legend.app-grid-group {
    float: none;
    width: auto;
    margin: 0 auto;
    padding: 0 0.625rem;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--tx-strong);
    letter-spacing: 0.02em;
}
.app-grid-section .app-grid {
    margin-bottom: 0;
}
.app-grid-section .app-grid-item:hover,
.app-grid-section .app-grid-item.active {
    background: var(--sf-card);
}
.app-grid-panel .app-grid-section {
    padding: 0.25rem 0.75rem 0.75rem;
}
.app-grid-panel .app-grid-section + .app-grid-section {
    margin-top: 1.125rem;
}
.app-grid-panel .app-grid-section > legend.app-grid-group {
    padding: 0 0.75rem;
    font-size: 0.9375rem;
}
.app-grid-panel .offcanvas-body > .app-grid-section:first-child {
    margin-top: 0.5rem;
}

/*
 * 사이드바 구분 — 왼쪽 제목 + 폭 전체의 가는 밑줄. 누구나 쓰는 첫 묶음은 제목 없이 두고
 * 뒤 묶음(설정 · 관리자 …)만 이 줄로 가른다(config/menu.php). 권한 묶음에는 자물쇠.
 */
.side-nav .side-nav-title {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin: 1.125rem 1rem 0.375rem;
    padding: 0 0.25rem 0.375rem;
    border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    text-align: left;
}
.side-nav .side-nav-title.is-first {
    margin-top: 0.25rem;
}
.side-nav .side-nav-title > svg {
    flex: 0 0 auto;
    width: 0.875rem;
    height: 0.875rem;
}

/* 근무표 — 휴직 기간 칸은 근무를 고를 수 없다. */
.roster-cell.is-absent {
    background: repeating-linear-gradient(135deg, var(--sf-inset), var(--sf-inset) 4px, var(--sf-raised) 4px, var(--sf-raised) 8px);
}
/* 근무표 — 저장하지 않은 칸. 내 줄 · 오늘 칸 바탕보다 먼저 보이게 노란 바탕 + 선택 상자 테두리. */
.roster-table tr > td.roster-cell.is-changed {
    background: var(--st-warning-row);
}
.roster-cell.is-changed .roster-select {
    border: 2px solid var(--st-warning);
}
.roster-absent {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--tx-muted);
}
.absence-tag {
    margin-left: 0.25rem;
    padding: 0 0.375rem;
    border-radius: 4px;
    background: var(--sf-raised);
    color: var(--tx-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    vertical-align: 0.1em;
}.absence-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.absence-return {
    display: flex;
    gap: 0.375rem;
}
.absence-return .form-control {
    width: 9.5rem;
}.settings-narrow {
    max-width: 44rem;
}

