/* ============================================
   1일 1전파 운동 - Apple Style Design System
   ============================================ */

/* CSS 변수 정의 - Apple 스타일 */
:root {
    /* Apple 색상 팔레트 */
    --primary: #007AFF;
    /* Apple Blue */
    --primary-dark: #0051D5;
    --primary-light: #5AC8FA;
    --secondary: #FF9500;
    /* Apple Orange */
    --accent: #34C759;
    /* Apple Green */
    --pink: #FF2D55;
    --purple: #AF52DE;

    /* 배경색 - 밝고 깨끗한 Apple 스타일 */
    --bg-primary: #F5F5F7;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F2F2F7;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFAFA;

    /* 다크 모드용 추가 변수 */
    --bg-dark: #1D1D1F;
    --bg-dark-secondary: #2C2C2E;

    /* 텍스트 색상 */
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #86868B;
    --text-on-primary: #FFFFFF;

    /* 기타 */
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-full: 50px;

    /* 폰트 - Apple SF Pro 스타일 */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Noto Sans KR', sans-serif;
}

/* 기본 리셋 */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* ============================================
   로그인 페이지 - Apple 스타일
   ============================================ */
.login-page {
    background: linear-gradient(180deg, #87CEEB 0%, #E0F4FF 50%, #FFFFFF 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

/* 구름 배경 효과 */
.login-page::before {
    content: '';
    position: fixed;
    top: 60%;
    left: -10%;
    width: 120%;
    height: 60%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><ellipse cx="200" cy="60" rx="180" ry="50" fill="white" opacity="0.9"/><ellipse cx="500" cy="80" rx="150" ry="40" fill="white" opacity="0.85"/><ellipse cx="800" cy="50" rx="200" ry="55" fill="white" opacity="0.9"/><ellipse cx="1050" cy="70" rx="170" ry="45" fill="white" opacity="0.85"/></svg>') no-repeat center;
    background-size: cover;
    pointer-events: none;
}

.login-page .container {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    margin: 40px auto;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.logo-section {
    margin-bottom: 32px;
}

.logo-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.logo-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.login-content {
    margin-bottom: 32px;
}

.welcome-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.6;
}

/* Google 로그인 버튼 - Apple 스타일 */
.google-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--text-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 300px;
    box-shadow: var(--shadow);
}

.google-login-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
    color: white;
    opacity: 1;
}

.google-login-btn:active {
    transform: scale(0.98);
}

.google-login-btn svg {
    flex-shrink: 0;
    background: white;
    border-radius: 4px;
    padding: 2px;
}

/* 기능 소개 */
.features {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.feature-icon {
    font-size: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* ============================================
   대시보드 공통 - Apple 스타일
   ============================================ */
.dashboard-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* 헤더 - Apple Navigation Bar */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo span {
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-tertiary);
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: var(--bg-tertiary);
}

/* 메인 컨텐츠 */
.main-content {
    flex: 1;
    padding: 32px 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* 페이지 타이틀 */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 주간 선택 */
.week-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.week-nav-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--primary);
    padding: 10px 18px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.week-nav-btn:hover {
    background: var(--primary);
    color: white;
}

.current-week {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0 8px;
}

/* 카드 스타일 - Apple Card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: none;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ============================================
   구역원 목록 및 전파 체크
   ============================================ */
.member-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.member-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.member-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.member-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.member-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.member-count strong {
    color: var(--primary);
    font-weight: 700;
}

/* 숫자 버튼 그룹 - Apple Segmented Control 스타일 */
.count-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.count-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.count-btn:hover {
    background: var(--primary-light);
    color: white;
    transform: scale(1.05);
}

.count-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.count-btn.filled {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
}

/* ============================================
   버튼 스타일 - Apple Button
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #E5E5EA;
}

.btn-danger {
    background: var(--pink);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

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

/* 모달 - Apple Sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    padding: 28px;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.modal-close {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #E5E5EA;
}

/* 폼 스타일 - Apple Form */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.2);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
}

/* ============================================
   통계 카드 - Apple Widget 스타일
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================
   랭킹 테이블
   ============================================ */
.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
    padding: 16px;
    text-align: left;
}

.ranking-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.ranking-table th:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.ranking-table th:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.ranking-table td {
    border-bottom: 1px solid var(--border-color);
}

.ranking-table tr:hover td {
    background: var(--bg-tertiary);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
}

.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 165, 0, 0.4);
}

.rank-2 {
    background: linear-gradient(135deg, #E8E8E8 0%, #B8B8B8 100%);
    color: #555;
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    color: white;
}

/* ============================================
   탭 네비게이션 - Apple Segmented Control
   ============================================ */
.tabs {
    display: flex;
    gap: 0;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   알림 / 토스트 - Apple Notification
   ============================================ */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    padding: 16px 24px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--accent);
}

.toast.error {
    background: var(--pink);
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 0 12px;
        height: 60px;
        /* 높이 고정 */
    }

    .header-content {
        flex-wrap: nowrap;
        /* 줄바꿈 방지 */
        padding: 0;
        gap: 12px;
    }

    .header-left {
        flex: 0 0 auto;
        padding-right: 8px;
        border-right: 1px solid rgba(0, 0, 0, 0.1);
        /* 구분선 추가 */
    }

    .header-right {
        flex: 1;
        justify-content: flex-start;
        /* 왼쪽 정렬 */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 8px;
        padding-right: 12px;
        /* 끝부분 여백 */
        mask-image: linear-gradient(to right, black 90%, transparent 100%);
        /* 스크롤 힌트 */
        -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
    }

    .header-right::-webkit-scrollbar {
        display: none;
    }

    .header-logo {
        font-size: 1rem;
    }

    .header-logo span {
        display: none;
    }

    .header-right .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        flex-shrink: 0;
        white-space: nowrap !important;
        min-width: auto;
    }

    .user-info {
        display: none;
    }

    .user-name {
        display: none;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .main-content {
        padding: 20px 16px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .count-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tabs {
        overflow-x: auto;
    }

    .ranking-table {
        font-size: 0.85rem;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 12px;
    }

    .login-card {
        padding: 36px 24px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 32px 20px;
    }

    .logo-section h1 {
        font-size: 1.5rem;
    }

    .logo-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }

    .count-buttons {
        gap: 6px;
    }

    .count-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 2rem;
    }

    /* 모바일 헤더 버튼 - 더 작게 */
    .header {
        height: auto;
        min-height: 52px;
        padding: 8px 10px;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-left {
        flex: 0 0 auto;
    }

    .header-right {
        flex: 1;
        overflow-x: auto;
        gap: 6px;
        padding: 4px 0;
    }

    .header-right .btn {
        padding: 5px 8px;
        font-size: 0.7rem;
        white-space: nowrap !important;
    }

    .header-logo {
        font-size: 0.9rem;
    }

    .header-logo span {
        font-size: 1rem;
    }

    .btn-logout {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
}

/* ============================================
   로딩 스피너
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   빈 상태
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-text {
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ============================================
   관리자 네비게이션
   ============================================ */
.admin-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 12px 24px;
    background: var(--bg-card);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* ============================================
   모바일 반응형 - 관리자 페이지
   ============================================ */
@media (max-width: 768px) {

    /* 관리자 네비게이션 */
    .admin-nav {
        gap: 6px;
    }

    .admin-nav a {
        padding: 10px 14px;
        font-size: 0.85rem;
        flex: 1;
        text-align: center;
        min-width: 70px;
    }

    /* 헤더 */
    .header {
        padding: 0 12px;
        height: 52px;
    }

    .header-logo {
        font-size: 1rem;
    }

    .header-logo span {
        font-size: 1.2rem;
    }

    .user-info {
        display: none;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* 메인 콘텐츠 */
    .main-content {
        padding: 16px 12px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    /* 카드 */
    .card {
        padding: 16px;
        border-radius: var(--radius);
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .card-title {
        font-size: 1.1rem;
    }

    /* 통계 그리드 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* 테이블 - 가로 스크롤 */
    .ranking-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    /* 멤버 카드 */
    .member-card {
        padding: 14px;
        gap: 12px;
    }

    .member-card>div:last-child {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .member-card select.form-input {
        width: 100% !important;
        min-width: 100% !important;
    }

    /* 대시보드 멤버 카드 - 버튼은 가로 유지 */
    .member-card .count-buttons {
        flex-direction: row !important;
        width: 100%;
    }

    /* 주간 선택 */
    .week-selector {
        gap: 8px;
        justify-content: center;
    }

    .week-nav-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .current-week {
        font-size: 0.95rem;
    }

    /* 탭 */
    .tabs {
        padding: 3px;
    }

    .tab {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* 숫자 버튼 - 가로 배치 */
    .count-buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .count-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* 모달 */
    .modal {
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    /* 폼 */
    .form-input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 더 작은 화면 */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .admin-nav a {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .member-name {
        font-size: 0.95rem;
    }

    .member-info div[style*="font-size: 0.85rem"] {
        font-size: 0.75rem !important;
    }
}