* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* 인증 화면 스타일 */
#auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
}

.auth-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-box h1 {
    color: #1e3a5f;
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-box h2 {
    color: #4a5568;
    font-size: 18px;
    margin-bottom: 30px;
    font-weight: normal;
}

.form-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
}

.form-section input,
.form-section select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-section input:focus,
.form-section select:focus {
    outline: none;
    border-color: #3182ce;
}

.form-section button {
    width: 100%;
    padding: 14px;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.form-section button:hover {
    background: #2c5282;
}

.switch-text {
    margin-top: 20px;
    color: #718096;
    font-size: 14px;
}

.switch-text a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 600;
}

.switch-text a:hover {
    text-decoration: underline;
}

/* 메인 화면 스타일 */
#main-container {
    display: flex;
    flex-direction: column;
}

header {
    background: #1e3a5f;
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

#user-info {
    font-size: 14px;
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 탭 네비게이션 */
.tabs {
    background: white;
    padding: 0 24px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 16px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #718096;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #1e3a5f;
}

.tab-btn.active {
    color: #1e3a5f;
    border-bottom-color: #1e3a5f;
}

/* 메인 컨텐츠 */
main {
    padding: 24px;
    flex: 1;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card h3 {
    color: #1e3a5f;
    margin-bottom: 20px;
    font-size: 18px;
}

.card h4 {
    color: #2d3748;
    margin: 20px 0 12px;
    font-size: 16px;
}

/* 시계 디스플레이 */
.clock-display {
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}

#current-time {
    font-size: 48px;
    font-weight: 700;
    color: #1e3a5f;
    font-family: 'Courier New', monospace;
}

.attendance-status {
    text-align: center;
    margin-bottom: 20px;
}

#attendance-status-text {
    font-size: 16px;
    color: #4a5568;
}

.attendance-buttons {
    display: flex;
    gap: 16px;
}

.btn-clock-in,
.btn-clock-out {
    flex: 1;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-clock-in {
    background: #38a169;
    color: white;
}

.btn-clock-in:hover:not(:disabled) {
    background: #2f855a;
}

.btn-clock-out {
    background: #e53e3e;
    color: white;
}

.btn-clock-out:hover:not(:disabled) {
    background: #c53030;
}

.btn-clock-in:disabled,
.btn-clock-out:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.today-record {
    margin-top: 20px;
    padding: 16px;
    background: #f7fafc;
    border-radius: 8px;
}

.today-record p {
    margin: 8px 0;
    color: #4a5568;
    font-size: 14px;
}

/* 현재 출근 인원 */
.worker-list {
    max-height: 400px;
    overflow-y: auto;
}

.worker-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.worker-item:last-child {
    border-bottom: none;
}

.worker-avatar {
    width: 40px;
    height: 40px;
    background: #1e3a5f;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 12px;
}

.worker-info {
    flex: 1;
}

.worker-name {
    font-weight: 600;
    color: #2d3748;
}

.worker-rank {
    font-size: 12px;
    color: #718096;
}

.worker-time {
    font-size: 12px;
    color: #38a169;
}

.no-workers {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
}

/* 주간 근무시간 */
.week-info {
    background: #edf2f7;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #4a5568;
}

/* 주간 선택기 */
.week-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: #edf2f7;
    border-radius: 8px;
}

.week-range-text {
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
    min-width: 200px;
    text-align: center;
}

.btn-week-nav {
    padding: 8px 16px;
    background: white;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    transition: all 0.2s;
}

.btn-week-nav:hover {
    background: #1e3a5f;
    color: white;
    border-color: #1e3a5f;
}

.btn-current-week {
    padding: 8px 16px;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-current-week:hover {
    background: #2c5282;
}

.weekly-summary {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.weekly-summary .hours {
    font-size: 36px;
    font-weight: 700;
    color: #1e3a5f;
}

.weekly-summary .label {
    font-size: 14px;
    color: #718096;
    margin-top: 8px;
}

/* 테이블 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 600;
    font-size: 13px;
}

td {
    color: #2d3748;
    font-size: 14px;
}

tbody tr:hover {
    background: #f7fafc;
}

/* 정산 */
.my-settlement-info {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
}

.settlement-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.settlement-row:last-child {
    border-bottom: none;
    font-weight: 600;
}

/* 접근 제한 메시지 */
.access-restricted {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
}

.access-restricted p {
    margin-bottom: 8px;
}

/* 상태 배지 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-working {
    background: #c6f6d5;
    color: #276749;
}

.status-off {
    background: #fed7d7;
    color: #c53030;
}

/* 알림 메시지 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
}

.alert-error {
    background: #fed7d7;
    color: #c53030;
}

.alert-info {
    background: #bee3f8;
    color: #2b6cb0;
}

/* 직급 안내 문구 */
.rank-notice {
    font-size: 12px;
    color: #e53e3e;
    margin-bottom: 12px;
    text-align: left;
}

/* 관리자 탭 */
.admin-notice {
    background: #fef3c7;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #92400e;
}

#admin-user-table select {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
}

#admin-user-table button {
    padding: 6px 12px;
    background: #1e3a5f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

#admin-user-table button:hover {
    background: #2c5282;
}

/* 내 정보 탭 */
.mypage-info {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.mypage-info p {
    margin: 8px 0;
    font-size: 14px;
}

.mypage-info .label {
    color: #718096;
    display: inline-block;
    width: 100px;
}

.mypage-info .value {
    color: #2d3748;
    font-weight: 600;
}

/* 위험 구역 */
.danger-zone {
    border: 2px solid #fed7d7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 24px;
}

.danger-zone h4 {
    color: #c53030;
    margin-bottom: 12px;
}

.danger-zone p {
    color: #718096;
    font-size: 14px;
    margin-bottom: 16px;
}

.btn-danger {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-danger:hover {
    background: #c53030;
}

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    color: #c53030;
    margin-bottom: 16px;
}

.modal-content p {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 14px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.btn-cancel {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #cbd5e0;
}

/* 근무시간 관리 모달 스타일 */
.modal-wide {
    max-width: 700px;
    text-align: left;
}

.modal-wide h3 {
    color: #1e3a5f;
    margin-bottom: 20px;
}

.target-info {
    background: #f7fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.target-info p {
    margin: 4px 0;
}

.week-info-small {
    font-size: 13px;
    color: #718096;
}

.time-records-section {
    margin: 20px 0;
}

.time-records-section h4 {
    color: #2d3748;
    margin-bottom: 12px;
}

#time-records-table {
    width: 100%;
    font-size: 13px;
}

#time-records-table th,
#time-records-table td {
    padding: 10px 8px;
    text-align: center;
}

#time-records-table th {
    background: #edf2f7;
}

.incomplete {
    color: #e53e3e;
    font-weight: 600;
}

.incomplete-row {
    background: #fff5f5;
}

.adjust-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.adjust-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.btn-adjust {
    padding: 4px 10px;
    background: #ed8936;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-adjust:hover {
    background: #dd6b20;
}

.btn-delete-record {
    padding: 4px 10px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete-record:hover {
    background: #c53030;
}

.no-adjust,
.no-delete,
.no-manage {
    color: #a0aec0;
    font-size: 12px;
}

.btn-manage {
    padding: 6px 12px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-manage:hover {
    background: #2c5282;
}
