/* 출석체크 — 모바일 우선 (최대 480px 기준) 스타일 */

* {
    box-sizing: border-box;
}

/* HTML hidden 속성 강제 — .modal-overlay 등 display:flex 룰이 hidden 을 override 하는 문제 차단 */
[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    background: #f4f6fb;
    color: #1a2032;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.att-layout {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 14px 96px;
}

/* ===== 헤더 ===== */
.att-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 8px 4px 14px;
}

.header-left {
    justify-self: start;
}

.header-right {
    justify-self: end;
}

.back-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 8px;
    color: #4a5572;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
}

.back-link:hover {
    background: rgba(74, 85, 114, 0.08);
}

.att-page-title {
    margin: 0;
    font-size: 18px;
    text-align: center;
}

.header-btn {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d0d6e3;
    background: #fff;
    border-radius: 8px;
    font-size: 13px;
    color: #2c3754;
    cursor: pointer;
    transition: background-color 120ms, border-color 120ms;
}

.header-btn:hover {
    background: #f0f3f9;
}

.header-btn:active {
    background: #e5eaf3;
}

/* ===== 공용 패널 ===== */
.att-panel {
    background: #fff;
    border: 1px solid #e2e7f0;
    border-radius: 14px;
    padding: 16px 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(26, 32, 50, 0.04);
}

.panel-title {
    margin: 0 0 4px;
    font-size: 16px;
}

.panel-desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7590;
}

.state-panel {
    text-align: center;
}

.state-message {
    margin: 0;
    color: #6b7590;
    font-size: 14px;
}

/* ===== 로그인 / 회원가입 ===== */
.auth-tabs {
    display: flex;
    gap: 6px;
    background: #eef1f7;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
}

.auth-tab {
    flex: 1;
    min-height: 44px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    color: #5b6580;
    cursor: pointer;
    transition: background-color 120ms, color 120ms;
}

.auth-tab.is-active {
    background: #fff;
    color: #1a2032;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(26, 32, 50, 0.08);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    color: #4a5572;
    font-weight: 600;
}

.form-input {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d0d6e3;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    color: #1a2032;
}

.form-input:focus {
    outline: 2px solid #7d9bff;
    outline-offset: 1px;
    border-color: #7d9bff;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d0d6e3;
    border-radius: 10px;
    background: #fbfcff;
    cursor: pointer;
}

.check-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    flex-shrink: 0;
    cursor: pointer;
}

.check-text {
    font-size: 14px;
    display: flex;
    flex-direction: column;
}

.check-sub {
    font-size: 12px;
    color: #6b7590;
    line-height: 1.4;
}

.primary-btn {
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: #3c5cc4;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms, opacity 120ms;
}

.primary-btn:hover {
    background: #33509f;
}

.primary-btn:active {
    background: #2c4489;
}

.primary-btn:disabled {
    background: #a8b3d0;
    cursor: not-allowed;
}

/* ===== 규칙 안내 ===== */
.rule-box {
    margin-top: 18px;
    padding: 12px 14px;
    background: #f7f9fd;
    border: 1px solid #e2e7f0;
    border-radius: 12px;
}

.rule-title {
    margin: 0 0 8px;
    font-size: 14px;
    color: #2c3754;
}

.rule-list {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #4a5572;
}

.rule-list li {
    margin-bottom: 4px;
}

.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge.on-time {
    background: #e3f2e6;
    color: #2f6b3d;
}

.badge.late {
    background: #fdf1dc;
    color: #93641a;
}

.badge.absent {
    background: #fbe4e4;
    color: #9b3a3a;
}

.badge.kkakdugi {
    background: #e8e6fb;
    color: #4f43a3;
}

/* 관리자가 손댄 기록 — 상태 뱃지와 헷갈리지 않도록 중립 회색 계열 */
.badge.adjusted {
    background: #eceff5;
    color: #5b6480;
}

/* ===== 오늘 카드 ===== */
.today-panel {
    text-align: center;
}

.today-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.today-greeting {
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    word-break: keep-all;
}

.today-clock {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: #4a5572;
    flex-shrink: 0;
}

.today-window {
    margin: 0 0 14px;
    font-size: 13px;
    color: #6b7590;
}

/* 규칙 안내는 좁은 화면에서 줄이 엉키지 않도록 줄 단위로 끊는다 */
.window-line {
    display: block;
    word-break: keep-all;
}

.check-btn {
    width: 100%;
    min-height: 60px;
    border: 0;
    border-radius: 14px;
    background: #2f9e5f;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 120ms, transform 80ms;
}

.check-btn:hover {
    background: #29874f;
}

.check-btn:active {
    transform: scale(0.985);
}

.check-btn.is-late {
    background: #d99423;
}

.check-btn.is-late:hover {
    background: #bd8018;
}

.check-btn:disabled {
    background: #c8cfdd;
    color: #6b7590;
    cursor: not-allowed;
    transform: none;
}

.check-btn.is-done:disabled {
    background: #e3f2e6;
    color: #2f6b3d;
}

.today-status {
    margin: 10px 0 0;
    font-size: 13px;
    color: #4a5572;
    min-height: 20px;
}

/* ===== 달력 ===== */
.calendar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.calendar-title {
    margin: 0;
    font-size: 16px;
}

.nav-btn {
    width: 44px;
    height: 44px;
    border: 1px solid #d0d6e3;
    background: #fff;
    border-radius: 10px;
    font-size: 20px;
    line-height: 1;
    color: #2c3754;
    cursor: pointer;
}

.nav-btn:hover {
    background: #f0f3f9;
}

.nav-btn:disabled {
    color: #b9c0d2;
    cursor: not-allowed;
}

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

.weekday-row {
    margin-bottom: 4px;
}

.weekday {
    text-align: center;
    font-size: 12px;
    color: #6b7590;
    padding: 2px 0;
}

.weekday.sun {
    color: #c05353;
}

.weekday.sat {
    color: #4a6bc0;
}

.day-cell {
    position: relative;
    min-height: 56px;
    padding: 4px 2px 3px;
    border: 1px solid #eaeef6;
    border-radius: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font: inherit;
    color: inherit;
    cursor: default;
}

.day-cell.is-blank {
    border-color: transparent;
    background: transparent;
}

.day-cell.is-clickable {
    cursor: pointer;
    background: #f6faf7;
    border-color: #d5e7db;
}

.day-cell.is-clickable:hover {
    background: #edf6f0;
}

.day-cell.is-today {
    border-color: #3c5cc4;
    box-shadow: 0 0 0 1px #3c5cc4 inset;
}

.day-cell.is-future {
    opacity: 0.45;
}

/* 관리자만 열 수 있는 빈 날짜 — 출석자가 없어도 누를 수 있음을 점선으로 알린다 */
.day-cell.is-admin-editable {
    border-style: dashed;
}

.day-cell.is-admin-editable.is-today {
    border-style: solid;
}

/* 출석하지 않는 날(일요일) — 눌러도 되는 날과 확실히 구분 */
.day-cell.is-rest {
    background: #f4f5f8;
    border-color: #e6e8ee;
}

.day-rest-mark {
    font-size: 10px;
    color: #9aa2b5;
    line-height: 1;
}

.day-cell:focus-visible {
    outline: 2px solid #3c5cc4;
    outline-offset: 1px;
}

.day-number {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: #2c3754;
}

.day-cell.is-sun .day-number {
    color: #c05353;
}

.day-cell.is-sat .day-number {
    color: #4a6bc0;
}

.day-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e3f2e6;
    color: #2f6b3d;
    font-size: 12px;
    font-weight: 700;
}

.day-late-mark {
    font-size: 11px;
    color: #93641a;
    line-height: 1;
}

.calendar-empty {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    color: #6b7590;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    font-size: 12px;
    color: #6b7590;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.on-time {
    background: #2f9e5f;
}

.dot.late {
    background: #d99423;
}

.legend-hint {
    flex-basis: 100%;
}

/* ===== 벌금 정산표 ===== */
.fine-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fine-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #eaeef6;
    border-radius: 10px;
    background: #fbfcff;
}

.fine-row.is-me {
    border-color: #3c5cc4;
    background: #f5f7ff;
}

.fine-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.fine-name {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fine-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: #6b7590;
}

.fine-amount {
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: #b5482f;
}

.fine-amount.is-zero {
    color: #2f6b3d;
}

.fine-empty {
    margin: 0;
    font-size: 13px;
    color: #6b7590;
}

/* ===== 입금 계좌 ===== */
.account-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 16px 12px 13px;
    border: 1px solid #cfd8ea;
    border-radius: 12px;
    background: #f5f8ff;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: background-color 120ms, border-color 120ms;
}

.account-card:hover {
    background: #eef3ff;
}

.account-card:active {
    background: #e4ebff;
}

.account-card:focus-visible {
    outline: 2px solid #3c5cc4;
    outline-offset: 2px;
}

.account-card.is-copied {
    border-color: #2f9e5f;
    background: #eef8f1;
}

.account-bank {
    font-size: 13px;
    color: #4a5572;
    font-weight: 600;
}

/* 12자리 계좌번호가 360px 화면에서도 한 줄에 들어가도록 자간·크기를 맞춘다 */
.account-number {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
    color: #1a2032;
    line-height: 1.2;
    word-break: break-all;
}

.account-holder {
    font-size: 14px;
    color: #2c3754;
}

.account-hint {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7590;
}

.account-card.is-copied .account-hint {
    color: #2f6b3d;
    font-weight: 600;
}

@media (max-width: 359px) {
    .account-number {
        font-size: 21px;
    }
}

/* ===== 계정 설정 ===== */
.settings-panel {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d0d6e3;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: #4a5572;
    cursor: pointer;
    transition: background-color 120ms;
}

.settings-btn:hover {
    background: #f0f3f9;
}

.settings-btn:active {
    background: #e5eaf3;
}

/* 모달 안 입력 필드 (비밀번호 변경) */
.modal-body label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5572;
}

.modal-body input {
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #d0d6e3;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 400;
    color: #1a2032;
}

.modal-body input:focus {
    outline: 2px solid #7d9bff;
    outline-offset: 1px;
    border-color: #7d9bff;
}

.modal-error {
    margin: 10px 0 0;
    font-size: 13px;
    color: #b5482f;
}

/* ===== 모달 명단 ===== */
.attendee-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 50vh;
    overflow-y: auto;
}

.attendee-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #eaeef6;
    border-radius: 8px;
    background: #fbfcff;
}

.attendee-name {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attendee-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7590;
    flex-shrink: 0;
}

/* ===== 관리자 출석 조정 ===== */
.admin-day-summary {
    margin: 0 0 10px;
    font-size: 13px;
    color: #6b7590;
}

.admin-day-summary.is-blocked {
    color: #b5482f;
    font-weight: 600;
}

.admin-list {
    max-height: 56vh;
}

/* 이름줄 아래에 버튼줄이 오므로 가로 배치를 세로로 되돌린다 */
.admin-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.admin-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.admin-item-reason {
    font-size: 12px;
    color: #9aa2b5;
}

.admin-actions {
    display: flex;
    gap: 6px;
}

.admin-action {
    flex: 1 1 0;
    min-height: 44px;
    padding: 0 6px;
    border: 1px solid #d0d6e3;
    border-radius: 9px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #3a4560;
    cursor: pointer;
}

.admin-action:hover:not(:disabled) {
    background: #f2f5fc;
    border-color: #aebbd8;
}

.admin-action:active:not(:disabled) {
    transform: translateY(1px);
}

.admin-action:focus-visible {
    outline: 2px solid #3c5cc4;
    outline-offset: 1px;
}

/* 지금 상태 — 누를 수 없고, 어떤 상태인지 한눈에 보이게 채운다 */
.admin-action.is-current {
    background: #e9edf7;
    border-color: #c3cde6;
    color: #3c5cc4;
    cursor: default;
}

.admin-action:disabled:not(.is-current) {
    opacity: 0.5;
    cursor: default;
}

/* ===== 토스트 ===== */
.toast-container {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 60;
    width: calc(100% - 32px);
    max-width: 420px;
    pointer-events: none;
}

.toast {
    padding: 11px 14px;
    border-radius: 10px;
    background: #2c3754;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 6px 18px rgba(26, 32, 50, 0.22);
    text-align: center;
}

.toast.success {
    background: #2f6b3d;
}

.toast.danger {
    background: #a83c3c;
}

.toast.warn {
    background: #93641a;
}

/* ===== 모달 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 25, 40, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 70;
}

.modal-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px 14px;
    box-shadow: 0 12px 34px rgba(20, 25, 40, 0.28);
}

.modal-title {
    margin: 0 0 10px;
    font-size: 16px;
}

.modal-body {
    font-size: 14px;
    color: #4a5572;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 8px;
}

.modal-btn {
    flex: 1;
    min-height: 46px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid #d0d6e3;
    background: #fff;
    color: #2c3754;
}

.modal-btn.modal-ok {
    background: #3c5cc4;
    border-color: #3c5cc4;
    color: #fff;
    font-weight: 600;
}

.modal-btn.modal-ok.danger {
    background: #b5482f;
    border-color: #b5482f;
}

.modal-btn:hover {
    filter: brightness(0.97);
}

/* ===== 데스크톱 보정 ===== */
@media (min-width: 600px) {
    .att-layout {
        max-width: 640px;
        padding: 22px 18px 96px;
    }

    .day-cell {
        min-height: 66px;
    }
}
