/* 직원앱 PWA — 모바일 우선(single-column, 큰 탭 타깃). V2_PLAN §5.3.
   관리자 SPA 비주얼과 의도적으로 분리된 별도 제품 표면 — 프레임워크 없이 최소 톤만. */

:root {
    --brand: #2f6f4f;
    --brand-dark: #245a3f;
    --bg: #f4f6f5;
    --surface: #ffffff;
    --text: #1c2620;
    --muted: #5c6b63;
    --border: #e1e6e3;
    --nav-h: 60px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

/* 헤더 — 이름 + 현재 acting-as 매장 + (멀티스토어면) 전환 링크 */
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--brand);
    color: #fff;
    padding: 14px 18px calc(14px + env(safe-area-inset-top, 0px));
    padding-top: max(14px, env(safe-area-inset-top, 0px));
}
.app-header__greet { font-size: 17px; font-weight: 700; }
.app-header__store {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    opacity: 0.95;
}
.app-header__store-name { font-weight: 600; }
.app-header__switch {
    color: #fff;
    text-decoration: underline;
    font-size: 13px;
    padding: 4px 2px;
}

/* 본문 — 하단 탭바 높이만큼 여백 확보 */
.app-main {
    padding: 16px;
    padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px));
    max-width: 640px;
    margin: 0 auto;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}
.card__title { margin: 0 0 10px; font-size: 20px; }
.card__body { margin: 0; color: var(--muted); }

/* 큰 탭 타깃 버튼/링크 */
.btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    min-height: 44px;
}
.btn:active { background: var(--brand-dark); }

/* 매장 전환 목록 */
.store-list { list-style: none; margin: 12px 0 0; padding: 0; }
.store-list__item { margin-bottom: 10px; }
.store-list__btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    min-height: 56px;
}
.store-list__btn--current { border-color: var(--brand); background: #eef5f0; }
.store-list__badge {
    font-size: 12px;
    color: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 999px;
    padding: 2px 8px;
}

/* 하단 탭바 nav */
.app-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}
.app-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: 11px;
}
.app-nav__item--active { color: var(--brand); font-weight: 700; }
.app-nav__icon { font-size: 20px; line-height: 1; }

/* 버튼 변형 */
.btn--sm { padding: 9px 14px; font-size: 14px; min-height: 40px; }
.btn--ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn--ghost:active { background: #eef5f0; }

/* 스케줄 — 주간 이동 */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}
.week-nav__arrow {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 6px;
}
.week-nav__label { font-weight: 700; font-size: 15px; }
.week-jump { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.week-jump input[type="date"] {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
}

/* 스케줄 — 요일 섹션 */
.day-section { padding: 14px 16px; }
.day-section__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.day-section__dow { font-size: 17px; font-weight: 700; color: var(--brand); }
.day-section__date { font-size: 13px; color: var(--muted); }

.sched-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.sched-row:last-child { border-bottom: none; }
.sched-row__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.sched-row__name { font-size: 15px; font-weight: 600; }
.sched-row__status { text-align: right; }

/* 상태 배지 */
.badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.badge--muted { color: var(--muted); background: #eef0ef; }
.badge--pattern { color: #245a3f; background: #e4f0ea; }
.badge--extra { color: #1f5fa8; background: #e3edf8; }
.badge--changed { color: #9a6a00; background: #fbf0d8; }
.badge--cancelled { color: #a23b3b; background: #f8e3e3; }
.badge--open { color: #6d4bb0; background: #efe8fa; }
.badge--sub { color: #7a5a1a; background: #f5ecda; }

/* 인라인 편집 폼 */
.sched-edit { margin-top: 8px; }
.sched-edit > summary {
    cursor: pointer;
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
    list-style: none;
    padding: 4px 0;
}
.sched-edit > summary::-webkit-details-marker { display: none; }
.sched-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.sched-form label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.sched-form select,
.sched-form input[type="time"],
.sched-form input[type="date"],
.sched-form input[type="datetime-local"],
.sched-form input[type="text"] {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: var(--surface);
}
.sched-form__times { display: flex; gap: 10px; }
.sched-form__times label { flex: 1; }
.sched-form__hint { margin: 0; font-size: 12px; color: var(--muted); }
.sched-form--revert { margin-top: 8px; background: transparent; border: none; padding: 0; }

/* dev-login 테이블 */
.dev-note { font-size: 13px; }
.dev-people { width: 100%; border-collapse: collapse; margin-top: 12px; }
.dev-people th, .dev-people td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

/* 대타(오픈시프트) 게시판 */
.open-shift__row-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}
.open-shift__poster { font-size: 13px; color: var(--muted); }

/* 시간정정 — 내 요청 이력 한 행 */
.tc-req__body { margin-top: 6px; }
.tc-req__line { margin: 2px 0; font-size: 14px; }
.tc-req__reason { margin: 6px 0 2px; font-size: 13px; color: var(--muted); }
.tc-req__meta { margin: 0; font-size: 12px; color: var(--muted); }

/* 근로계약서 — 이력 한 행 */
.contract-row__body { margin-top: 6px; }
.contract-row__meta { margin: 2px 0; font-size: 13px; color: var(--muted); }
.contract-row__actions { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 근로계약서 — 약관 확인(서명 전) */
.contract-terms { margin: 12px 0 0; }
.contract-terms__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.contract-terms__row:last-child { border-bottom: none; }
.contract-terms dt { margin: 0; color: var(--muted); font-weight: 600; }
.contract-terms dd { margin: 0; text-align: right; }

/* 서명 실패 오류 배너 */
.contract-error { border-color: #d5443b; background: #fdeceb; }
.contract-error .card__body { color: #a5322b; }

/* 손서명 캔버스 — 큰 터치 타깃, 반응형 폭 */
.signature-pad {
    display: block;
    width: 100%;
    height: 200px;
    margin-top: 8px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: #fff;
    touch-action: none; /* 캔버스 위 터치가 페이지 스크롤/줌으로 새지 않게 */
    cursor: crosshair;
}
.signature-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}
.signature-actions .btn { flex: 1; text-align: center; }

/* ---------- 공지사항(P2) ---------- */
.notice-row__link { display: block; color: inherit; text-decoration: none; }
.notice-row__meta { margin: 2px 0; font-size: 13px; color: var(--muted); }
.notice-unread { color: #a23b3b; background: #f8e3e3; }
.notice-content {
    margin-top: 12px;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;   /* 평문 본문 — 줄바꿈 보존(HTML/리치에디터 없음) */
    word-break: break-word;
}
.notice-form textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    font: inherit;
    padding: 8px;
    box-sizing: border-box;
}
.notice-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
