:root {
    --primary-color: #4A90E2;
    --secondary-color: #f5f6fa;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --disabled-bg: #f0f0f0;
    --header-bg: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ===== SEASONAL THEMES ===== */

/* 🎄 Christmas (12월) - 빨강 중심 테마 + 귀여운 배경 */
body.theme-christmas {
    --primary-color: #d32f2f;
    --secondary-color: #388e3c;
    background: url('../images/christmas_bg.jpg');
    background-size: 400px;
    background-repeat: repeat;
}

body.theme-christmas .app-container {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-christmas header {
    background: linear-gradient(135deg, #c62828, #d32f2f, #b71c1c);
    color: #fff;
    border-bottom: 4px solid #ffd700;
}

body.theme-christmas h1 {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.theme-christmas header p {
    color: #ffcdd2;
}

body.theme-christmas .tabs {
    background: #c62828;
}

body.theme-christmas .tab-btn {
    background: #c62828;
    color: #ffcdd2;
    font-weight: 600;
}

body.theme-christmas .tab-btn.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
    background: #b71c1c;
}

body.theme-christmas .card {
    background: #fff;
    border: 2px solid #ef5350;
    color: #333;
}

body.theme-christmas .card h2 {
    color: #c62828;
}

body.theme-christmas .summary-footer {
    background: linear-gradient(90deg, #c62828, #388e3c);
    color: #fff;
}

/* 테마 공통 - 테이블/버튼/입력 요소 가시성 */
body.theme-christmas table,
body.theme-newyear table,
body.theme-chuseok table,
body.theme-halloween table,
body.theme-autumn table {
    background: #fff;
    color: #333;
}

body.theme-christmas th,
body.theme-newyear th,
body.theme-chuseok th,
body.theme-halloween th,
body.theme-autumn th {
    background: #f5f5f5 !important;
    color: #333 !important;
}

body.theme-christmas td,
body.theme-newyear td,
body.theme-chuseok td,
body.theme-halloween td,
body.theme-autumn td {
    background: #fff;
    color: #333;
}

body.theme-christmas .sticky-col,
body.theme-newyear .sticky-col,
body.theme-chuseok .sticky-col,
body.theme-halloween .sticky-col,
body.theme-autumn .sticky-col {
    background: #fff !important;
    color: #333 !important;
}

/* 테마 공통 - 버튼 가시성 */
body.theme-christmas .add-btn,
body.theme-newyear .add-btn,
body.theme-chuseok .add-btn,
body.theme-halloween .add-btn,
body.theme-autumn .add-btn,
body.theme-winter .add-btn,
body.theme-spring .add-btn,
body.theme-summer .add-btn {
    background: #4caf50 !important;
    color: #fff !important;
}

body.theme-christmas .file-upload-btn,
body.theme-newyear .file-upload-btn,
body.theme-chuseok .file-upload-btn,
body.theme-halloween .file-upload-btn,
body.theme-autumn .file-upload-btn {
    background: #fff !important;
    color: #333 !important;
    border: 2px solid #ccc !important;
}

body.theme-christmas .order-btn,
body.theme-newyear .order-btn,
body.theme-chuseok .order-btn,
body.theme-halloween .order-btn,
body.theme-autumn .order-btn {
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
}

body.theme-christmas .group-select,
body.theme-newyear .group-select,
body.theme-chuseok .group-select,
body.theme-halloween .group-select,
body.theme-autumn .group-select {
    background: #fff !important;
    color: #333 !important;
}

body.theme-christmas input[type="text"],
body.theme-newyear input[type="text"],
body.theme-chuseok input[type="text"],
body.theme-halloween input[type="text"],
body.theme-autumn input[type="text"] {
    background: #fff !important;
    color: #333 !important;
}

/* 테마 공통 - 구분 헤더 */
body.theme-christmas .group-header td {
    background: linear-gradient(135deg, #c62828, #d32f2f) !important;
    color: #fff !important;
}

body.theme-newyear .group-header td {
    background: linear-gradient(135deg, #8b0000, #b22222) !important;
    color: #ffd700 !important;
}

body.theme-chuseok .group-header td {
    background: linear-gradient(135deg, #d4a373, #8b6914) !important;
    color: #ffeaa7 !important;
}

body.theme-halloween .group-header td {
    background: linear-gradient(135deg, #7b1fa2, #4a148c) !important;
    color: #ff6f00 !important;
}

body.theme-autumn .group-header td {
    background: linear-gradient(135deg, #d4731a, #8b4513) !important;
    color: #ffd700 !important;
}

body.theme-winter .group-header td {
    background: linear-gradient(135deg, #a8d5e5, #7ec8e3) !important;
    color: #2c4a52 !important;
}

body.theme-spring .group-header td {
    background: linear-gradient(135deg, #ff9eb5, #d63384) !important;
    color: #fff !important;
}

body.theme-summer .group-header td {
    background: linear-gradient(135deg, #00b4d8, #0077b6) !important;
    color: #fff !important;
}

/* 테마별 날짜 헤더 */
body.theme-christmas .date-header {
    background: linear-gradient(135deg, #c62828, #388e3c) !important;
}

body.theme-newyear .date-header {
    background: linear-gradient(135deg, #8b0000, #ffd700) !important;
}

body.theme-chuseok .date-header {
    background: linear-gradient(135deg, #d4a373, #8b6914) !important;
}

body.theme-halloween .date-header {
    background: linear-gradient(135deg, #7b1fa2, #ff6f00) !important;
}

body.theme-autumn .date-header {
    background: linear-gradient(135deg, #d4731a, #8b4513) !important;
}

body.theme-winter .date-header {
    background: linear-gradient(135deg, #a8d5e5, #7ec8e3) !important;
}

body.theme-winter .date-header span,
body.theme-winter .date-header button {
    color: #2c4a52 !important;
}

body.theme-spring .date-header {
    background: linear-gradient(135deg, #ff9eb5, #a8e6cf) !important;
}

body.theme-spring .date-header span,
body.theme-spring .date-header button {
    color: #5d4e37 !important;
}

body.theme-summer .date-header {
    background: linear-gradient(135deg, #00b4d8, #f77f00) !important;
}

/* 테마별 그룹 네비게이션 */
body.theme-christmas .group-nav {
    background: linear-gradient(135deg, #c62828, #388e3c) !important;
}

body.theme-newyear .group-nav {
    background: linear-gradient(135deg, #8b0000, #b22222) !important;
}

body.theme-chuseok .group-nav {
    background: linear-gradient(135deg, #d4a373, #8b6914) !important;
}

body.theme-halloween .group-nav {
    background: linear-gradient(135deg, #7b1fa2, #4a148c) !important;
}

body.theme-autumn .group-nav {
    background: linear-gradient(135deg, #d4731a, #8b4513) !important;
}

body.theme-winter .group-nav {
    background: linear-gradient(135deg, #a8d5e5, #7ec8e3) !important;
}

body.theme-winter .group-nav .nav-label {
    color: #2c4a52 !important;
}

body.theme-spring .group-nav {
    background: linear-gradient(135deg, #ff9eb5, #ffb3c6) !important;
}

body.theme-spring .group-nav .nav-label {
    color: #5d4e37 !important;
}

body.theme-summer .group-nav {
    background: linear-gradient(135deg, #00b4d8, #90e0ef) !important;
}

/* 테마별 은행 정보 카드 */
body.theme-christmas .bank-info-card {
    background: linear-gradient(135deg, #c62828, #388e3c) !important;
}

body.theme-newyear .bank-info-card {
    background: linear-gradient(135deg, #8b0000, #b22222) !important;
}

body.theme-chuseok .bank-info-card {
    background: linear-gradient(135deg, #d4a373, #8b6914) !important;
}

body.theme-halloween .bank-info-card {
    background: linear-gradient(135deg, #7b1fa2, #4a148c) !important;
}

body.theme-autumn .bank-info-card {
    background: linear-gradient(135deg, #d4731a, #8b4513) !important;
}

body.theme-winter .bank-info-card {
    background: linear-gradient(135deg, #a8d5e5, #7ec8e3) !important;
    color: #2c4a52 !important;
}

body.theme-spring .bank-info-card {
    background: linear-gradient(135deg, #ff9eb5, #a8e6cf) !important;
    color: #5d4e37 !important;
}

body.theme-summer .bank-info-card {
    background: linear-gradient(135deg, #00b4d8, #0077b6) !important;
}

/* 🌅 New Year (1월) - 귀여운 새해 배경 */
body.theme-newyear {
    --primary-color: #ffd700;
    --secondary-color: #8b0000;
    background: url('../images/newyear_bg.jpg');
    background-size: 400px;
    background-repeat: repeat;
}

body.theme-newyear .app-container {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-newyear header {
    background: linear-gradient(135deg, #8b0000, #ffd700);
    color: #fff;
    border-bottom: 3px solid #ffd700;
}

body.theme-newyear h1 {
    color: #ffd700;
}

body.theme-newyear header p {
    color: #ffefb3;
}

body.theme-newyear .tabs {
    background: #1a0a0a;
}

body.theme-newyear .tab-btn {
    background: #1a0a0a;
    color: #ffb3b3;
}

body.theme-newyear .tab-btn.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
}

body.theme-newyear .card {
    background: rgba(139, 0, 0, 0.85);
    border: 1px solid #b22222;
    color: #fff;
}

body.theme-newyear .card h2 {
    color: #ffd700;
}

body.theme-newyear .summary-footer {
    background: linear-gradient(90deg, #ffd700, #8b0000);
    color: #fff;
}

/* 🌕 Chuseok (추석) - 귀여운 추석 배경 */
body.theme-chuseok {
    --primary-color: #d4a373;
    --secondary-color: #ccd5ae;
    background: url('../images/chuseok_bg.jpg');
    background-size: 400px;
    background-repeat: repeat;
}

body.theme-chuseok .app-container {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-chuseok header {
    background: linear-gradient(135deg, #d4a373, #8b6914);
    color: #fff;
    border-bottom: 3px solid #ffeaa7;
}

body.theme-chuseok h1 {
    color: #ffeaa7;
}

body.theme-chuseok header p {
    color: #f5deb3;
}

body.theme-chuseok .tabs {
    background: #1a1410;
}

body.theme-chuseok .tab-btn {
    background: #1a1410;
    color: #d4a373;
}

body.theme-chuseok .tab-btn.active {
    color: #ffeaa7;
    border-bottom-color: #ffeaa7;
}

body.theme-chuseok .card {
    background: rgba(61, 41, 20, 0.9);
    border: 1px solid #8b6914;
    color: #f5deb3;
}

body.theme-chuseok .card h2 {
    color: #ffeaa7;
}

body.theme-chuseok .summary-footer {
    background: linear-gradient(90deg, #d4a373, #8b6914);
    color: #fff;
}

/* 🌸 Spring (3-5월) - 귀여운 벚꽃 배경 */
body.theme-spring {
    --primary-color: #ff9eb5;
    --secondary-color: #c8e6c9;
    background: url('../images/spring_bg.jpg');
    background-size: 400px;
    background-repeat: repeat;
}

body.theme-spring .app-container {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-spring header {
    background: linear-gradient(135deg, #ff9eb5, #a8e6cf);
    color: #5d4e37;
    border-bottom: 3px solid #ff9eb5;
}

body.theme-spring h1 {
    color: #d63384;
}

body.theme-spring header p {
    color: #6a5d4d;
}

body.theme-spring .tabs {
    background: #fff5f8;
}

body.theme-spring .tab-btn {
    background: #fff5f8;
    color: #b56576;
}

body.theme-spring .tab-btn.active {
    color: #d63384;
    border-bottom-color: #d63384;
}

body.theme-spring .card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ffb3c6;
}

body.theme-spring .card h2 {
    color: #d63384;
}

body.theme-spring .summary-footer {
    background: linear-gradient(90deg, #ff9eb5, #a8e6cf);
    color: #5d4e37;
}

/* 🏖️ Summer (6-8월) - 귀여운 바다 배경 */
body.theme-summer {
    --primary-color: #00b4d8;
    --secondary-color: #90e0ef;
    background: url('../images/summer_bg.jpg');
    background-size: 400px;
    background-repeat: repeat;
}

body.theme-summer .app-container {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-summer header {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
    color: #fff;
    border-bottom: 3px solid #f77f00;
}

body.theme-summer h1 {
    color: #fff;
}

body.theme-summer header p {
    color: #caf0f8;
}

body.theme-summer .tabs {
    background: #90e0ef;
}

body.theme-summer .tab-btn {
    background: #90e0ef;
    color: #0077b6;
}

body.theme-summer .tab-btn.active {
    color: #03045e;
    border-bottom-color: #f77f00;
}

body.theme-summer .card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #90e0ef;
}

body.theme-summer .card h2 {
    color: #0077b6;
}

body.theme-summer .summary-footer {
    background: linear-gradient(90deg, #00b4d8, #f77f00);
    color: #fff;
}

/* 🍁 Autumn (9-11월) - 귀여운 단풍 배경 */
body.theme-autumn {
    --primary-color: #d4731a;
    --secondary-color: #f5deb3;
    background: url('../images/autumn_bg.jpg');
    background-size: 400px;
    background-repeat: repeat;
}

body.theme-autumn .app-container {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-autumn header {
    background: linear-gradient(135deg, #d4731a, #8b4513);
    color: #fff;
    border-bottom: 3px solid #ffd700;
}

body.theme-autumn h1 {
    color: #ffd700;
}

body.theme-autumn header p {
    color: #f5deb3;
}

body.theme-autumn .tabs {
    background: #2d1f14;
}

body.theme-autumn .tab-btn {
    background: #2d1f14;
    color: #d4a373;
}

body.theme-autumn .tab-btn.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
}

body.theme-autumn .card {
    background: rgba(92, 61, 46, 0.9);
    border: 1px solid #8b4513;
    color: #f5deb3;
}

body.theme-autumn .card h2 {
    color: #ffd700;
}

body.theme-autumn .summary-footer {
    background: linear-gradient(90deg, #d4731a, #8b4513);
    color: #fff;
}

/* 🎃 Halloween (10월) - 할로윈 테마 */
body.theme-halloween {
    --primary-color: #6a1b9a;
    --secondary-color: #f3e5f5;
    background: url('../images/halloween_bg.jpg');
    background-size: 300px;
    background-repeat: repeat;
}

body.theme-halloween .app-container {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-halloween header {
    background: linear-gradient(135deg, #7b1fa2, #4a148c);
    color: #fff;
    border-bottom: 3px solid #ff6f00;
}

body.theme-halloween h1 {
    color: #ff6f00;
}

body.theme-halloween header p {
    color: #e1bee7;
}

body.theme-halloween .tabs {
    background: #311b92;
}

body.theme-halloween .tab-btn {
    background: #311b92;
    color: #b39ddb;
}

body.theme-halloween .tab-btn.active {
    color: #ff6f00;
    border-bottom-color: #ff6f00;
}

body.theme-halloween .card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #7b1fa2;
}

body.theme-halloween .card h2 {
    color: #7b1fa2;
}

body.theme-halloween .summary-footer {
    background: linear-gradient(90deg, #7b1fa2, #ff6f00);
    color: #fff;
}

/* ❄️ Winter (2월) - 귀여운 눈사람 배경 */
body.theme-winter {
    --primary-color: #a8d5e5;
    --secondary-color: #e8f4f8;
    background: url('../images/winter.png');
    background-size: 300px;
    background-repeat: repeat;
}

body.theme-winter .app-container {
    background: rgba(255, 255, 255, 0.95);
}

body.theme-winter header {
    background: linear-gradient(135deg, #a8d5e5, #7ec8e3);
    color: #2c4a52;
    border-bottom: 3px solid #fff;
}

body.theme-winter h1 {
    color: #2c4a52;
}

body.theme-winter header p {
    color: #4a6670;
}

body.theme-winter .tabs {
    background: #e8f4f8;
}

body.theme-winter .tab-btn {
    background: #e8f4f8;
    color: #4a6670;
}

body.theme-winter .tab-btn.active {
    color: #2c4a52;
    border-bottom-color: #7ec8e3;
}

body.theme-winter .card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #a8d5e5;
}

body.theme-winter .card h2 {
    color: #2c4a52;
}

body.theme-winter .summary-footer {
    background: linear-gradient(90deg, #a8d5e5, #7ec8e3);
    color: #2c4a52;
}

/* ===== FALLING ANIMATIONS ===== */
.falling-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}

.falling-item {
    position: absolute;
    top: -60px;
    opacity: 0.85;
    will-change: transform;
}

/* 🎄 Christmas - Sway Animation (좌우로 흔들리며 떨어짐) */
.falling-item.fall-sway {
    animation: fallSway linear infinite;
}

@keyframes fallSway {
    0% {
        transform: translateY(-60px) translateX(0) rotate(0deg);
        opacity: 0.9;
    }

    25% {
        transform: translateY(25vh) translateX(30px) rotate(90deg);
    }

    50% {
        transform: translateY(50vh) translateX(-20px) rotate(180deg);
    }

    75% {
        transform: translateY(75vh) translateX(25px) rotate(270deg);
    }

    100% {
        transform: translateY(100vh) translateX(0) rotate(360deg);
        opacity: 0.3;
    }
}

/* 🎊 New Year - Confetti Animation (빠르게 흔들리며 떨어짐) */
.falling-item.fall-confetti {
    animation: fallConfetti linear infinite;
}

@keyframes fallConfetti {
    0% {
        transform: translateY(-60px) translateX(0) rotate(0deg) scale(1);
        opacity: 1;
    }

    10% {
        transform: translateY(10vh) translateX(-20px) rotate(72deg) scale(1.1);
    }

    20% {
        transform: translateY(20vh) translateX(25px) rotate(144deg) scale(0.9);
    }

    30% {
        transform: translateY(30vh) translateX(-15px) rotate(216deg) scale(1.05);
    }

    40% {
        transform: translateY(40vh) translateX(20px) rotate(288deg) scale(0.95);
    }

    50% {
        transform: translateY(50vh) translateX(-25px) rotate(360deg) scale(1);
    }

    60% {
        transform: translateY(60vh) translateX(15px) rotate(432deg) scale(1.1);
    }

    70% {
        transform: translateY(70vh) translateX(-20px) rotate(504deg) scale(0.9);
    }

    80% {
        transform: translateY(80vh) translateX(10px) rotate(576deg) scale(1);
    }

    90% {
        transform: translateY(90vh) translateX(-10px) rotate(648deg) scale(0.95);
    }

    100% {
        transform: translateY(100vh) translateX(0) rotate(720deg) scale(1);
        opacity: 0.2;
    }
}

/* ❄️ Winter/Chuseok - Gentle Animation (부드럽게 떨어짐) */
.falling-item.fall-gentle {
    animation: fallGentle linear infinite;
}

@keyframes fallGentle {
    0% {
        transform: translateY(-60px) translateX(0) rotate(0deg);
        opacity: 0.9;
    }

    25% {
        transform: translateY(25vh) translateX(15px) rotate(45deg);
    }

    50% {
        transform: translateY(50vh) translateX(-10px) rotate(90deg);
    }

    75% {
        transform: translateY(75vh) translateX(10px) rotate(135deg);
    }

    100% {
        transform: translateY(100vh) translateX(0) rotate(180deg);
        opacity: 0.4;
    }
}

/* 🌸 Spring/Autumn - Flutter Animation (나풀거리며 떨어짐) */
.falling-item.fall-flutter {
    animation: fallFlutter ease-in-out infinite;
}

@keyframes fallFlutter {
    0% {
        transform: translateY(-60px) translateX(0) rotate(0deg) rotateY(0deg);
        opacity: 0.9;
    }

    15% {
        transform: translateY(15vh) translateX(40px) rotate(30deg) rotateY(90deg);
    }

    30% {
        transform: translateY(30vh) translateX(-30px) rotate(-20deg) rotateY(180deg);
    }

    45% {
        transform: translateY(45vh) translateX(35px) rotate(25deg) rotateY(270deg);
    }

    60% {
        transform: translateY(60vh) translateX(-25px) rotate(-15deg) rotateY(360deg);
    }

    75% {
        transform: translateY(75vh) translateX(30px) rotate(20deg) rotateY(450deg);
    }

    100% {
        transform: translateY(100vh) translateX(0) rotate(0deg) rotateY(540deg);
        opacity: 0.3;
    }
}

/* 🌊 Summer - Wave Animation (파도처럼 출렁이며 떨어짐) */
.falling-item.fall-wave {
    animation: fallWave ease-in-out infinite;
}

@keyframes fallWave {
    0% {
        transform: translateY(-60px) translateX(0) scale(1);
        opacity: 0.85;
    }

    20% {
        transform: translateY(20vh) translateX(50px) scale(1.15);
    }

    40% {
        transform: translateY(40vh) translateX(-40px) scale(0.9);
    }

    60% {
        transform: translateY(60vh) translateX(45px) scale(1.1);
    }

    80% {
        transform: translateY(80vh) translateX(-35px) scale(0.95);
    }

    100% {
        transform: translateY(100vh) translateX(0) scale(1);
        opacity: 0.3;
    }
}

/* 🎃 Halloween - Spooky Animation (으스스하게 흔들리며 떨어짐) */
.falling-item.fall-spooky {
    animation: fallSpooky linear infinite;
}

@keyframes fallSpooky {
    0% {
        transform: translateY(-60px) translateX(0) rotate(0deg) scale(1);
        opacity: 0.9;
    }

    10% {
        transform: translateY(10vh) translateX(-30px) rotate(-20deg) scale(1.2);
    }

    20% {
        transform: translateY(20vh) translateX(35px) rotate(15deg) scale(0.8);
    }

    30% {
        transform: translateY(30vh) translateX(-25px) rotate(-25deg) scale(1.1);
    }

    40% {
        transform: translateY(40vh) translateX(40px) rotate(20deg) scale(0.9);
    }

    50% {
        transform: translateY(50vh) translateX(-35px) rotate(-15deg) scale(1.15);
    }

    60% {
        transform: translateY(60vh) translateX(30px) rotate(25deg) scale(0.85);
    }

    70% {
        transform: translateY(70vh) translateX(-40px) rotate(-20deg) scale(1.05);
    }

    80% {
        transform: translateY(80vh) translateX(25px) rotate(10deg) scale(0.95);
    }

    90% {
        transform: translateY(90vh) translateX(-15px) rotate(-10deg) scale(1);
    }

    100% {
        transform: translateY(100vh) translateX(0) rotate(0deg) scale(1);
        opacity: 0.2;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: #f0f2f5;
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    padding-bottom: 80px;
    /* Space for footer */
}

/* Header & Tabs */
header {
    padding: 20px;
    text-align: center;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.tabs {
    display: flex;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    border: none;
    background: white;
    font-size: 1rem;
    font-weight: 600;
    color: #7f8c8d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

/* ... (Skipping middle parts, jumping to card) ... */
/* NOTE: I cannot skip lines in replace_file_content like this. I must include everything I replace. */
/* Wait, I am replacing the whole file top part or chunks? I should use chunks. */
/* I will split this into multiple replacement chunks for safety and precision. */
/* Cancelling this replace_file_content to do it properly with chunks. */

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Content Sections */
.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu Board Styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #34495e;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1200px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}



.image-container img {
    width: 100%;
    /* Limit height for landscape view on mobile so it doesn't scroll too much */
    max-height: 40vh;
    object-fit: contain;
    background: #000;
    cursor: zoom-in;
}

/* User Management Styles */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.add-btn {
    padding: 10px 20px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.danger-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* Group Quick Navigation */
.group-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.group-nav .nav-label {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.group-nav-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.group-nav-btn:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.group-nav-btn:active {
    transform: translateY(0);
}

/* Sort Button */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h2 {
    margin: 0;
}

.sort-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.sort-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* Group Header in Survey Table */
.group-header td {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    font-weight: bold;
    text-align: left;
    padding-left: 15px;
    color: #fff !important;
    font-size: 1rem;
}

/* Settings List (Users & Groups) */
#user-list-edit,
#group-list-edit {
    list-style: none;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 10px;
}

#user-list-edit li,
#group-list-edit li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 8px;
}

#user-list-edit li:last-child,
#group-list-edit li:last-child {
    border-bottom: none;
}

/* Group header in user list */
.user-list-group-header {
    background: #e1e7ec;
    font-weight: bold;
    color: #2c3e50;
    padding: 12px 15px !important;
    font-size: 0.95rem;
}

/* User controls (order buttons + name) */
.user-controls,
.group-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* User actions (group select + delete) */
.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-select {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
}

.delete-btn {
    background: #fab1a0;
    color: #d63031;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 5px;
}

.order-btn {
    background: var(--secondary-color);
    border: 1px solid #ccc;
    padding: 2px 8px;
    cursor: pointer;
    margin-right: 5px;
    font-size: 0.8rem;
    border-radius: 4px;
}

.hint-text {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    text-align: right;
}

.file-upload-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
}

.file-upload-btn input {
    display: none;
}

/* Survey Styles */
.date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.date-header button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    padding: 10px 18px;
    cursor: pointer;
    border-radius: 50%;
    color: #fff;
    transition: all 0.3s ease;
    font-weight: bold;
}

.date-header button:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

#current-week-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Common date display style for menu and settlement */
.date-header span {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.survey-table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    background: #fff;
}

th,
td {
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem;
}

th {
    background: linear-gradient(180deg, #f8f9fa, #e9ecef);
    font-weight: 700;
    color: #333;
    font-size: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.sticky-col {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 10;
    border-right: 2px solid #dee2e6;
    font-weight: 700;
    font-size: 0.95rem;
}

th.sticky-col {
    background: linear-gradient(180deg, #f8f9fa, #e9ecef);
}

/* Checkbox toggle style - 개선된 디자인 */
.meal-check {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin-right: 4px;
    vertical-align: middle;
}

.meal-cell label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 6px;
    font-size: 0.85rem !important;
    font-weight: 600;
    transition: all 0.2s ease;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    cursor: pointer;
}

.meal-cell label:hover {
    background: #e3f2fd;
    border-color: #64b5f6;
}

/* 체크된 상태 스타일 */
.meal-cell label:has(input:checked) {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.meal-cell.holiday {
    background-color: var(--disabled-bg);
    color: var(--danger-color);
    font-size: 0.8rem;
    font-weight: bold;
    vertical-align: middle;
}

.meal-cell.holiday input {
    display: none;
}

/* Footer Summary */
.summary-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 10px 15px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
    z-index: 200;
    gap: 5px;
    flex-wrap: wrap;
}

.summary-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: 8px;
    min-width: 60px;
}

.summary-day .day-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
}

.summary-day .day-count {
    font-size: 0.7rem;
    color: #666;
}

.summary-item {
    font-weight: bold;
    font-size: 1.1rem;
}

.save-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(74, 144, 226, 0.3);
}

.save-btn:active {
    transform: scale(0.98);
}

/* Three-State Meal Buttons */
.meal-btn-group {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 3px 0;
}

.meal-label {
    font-size: 0.7rem;
    color: #666;
    min-width: 28px;
}

.meal-state-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meal-state-btn:hover {
    transform: scale(1.1);
}

.meal-state-btn.active-yes {
    background: #4caf50;
    border-color: #388e3c;
    color: white;
}

.meal-state-btn.active-no {
    background: #e74c3c;
    border-color: #c0392b;
    color: white;
}

.meal-state-btn[data-value="yes"]:not(.active-yes):hover {
    border-color: #4caf50;
    color: #4caf50;
}

.meal-state-btn[data-value="no"]:not(.active-no):hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* User Item Styles for Admin */
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
    gap: 10px;
    flex-wrap: wrap;
}

.user-item:hover {
    background: #f9f9f9;
}

.user-name {
    font-weight: 600;
    min-width: 70px;
    color: #333;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.month-picker-group {
    display: flex;
    gap: 4px;
}

.month-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.month-picker-wrapper:hover {
    background: #e8e8e8;
}

.month-label {
    font-size: 0.75rem;
    color: #888;
    font-weight: 500;
    white-space: nowrap;
}

.month-picker-wrapper input[type="month"] {
    border: none;
    background: transparent;
    font-size: 0.8rem;
    color: #333;
    cursor: pointer;
    padding: 0;
    width: 85px;
}

.month-picker-wrapper input[type="month"]::-webkit-calendar-picker-indicator {
    display: none;
}

/* Skip Switch Styles */
.skip-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.skip-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.skip-switch .skip-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

.skip-switch .skip-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.skip-switch input:checked+.skip-slider {
    background-color: #e74c3c;
}

.skip-switch input:checked+.skip-slider:before {
    transform: translateX(20px);
}

.skip-label-text {
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    display: none;
}

.skip-switch input:checked~.skip-label-text {
    display: block;
}

/* Shared Card Styles for Menu and Settlement Lists */
.menu-card,
.settlement-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s;
}

.menu-card:hover,
.settlement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.menu-card img,
.settlement-card img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    border: 1px solid #eee;
    flex-shrink: 0;
    margin-bottom: 0;
    display: block;
}

.menu-card-info,
.settlement-card-info {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.menu-card-type {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.menu-card-type.weekly {
    background: #e3f2fd;
    color: #1976d2;
}

.menu-card-type.special {
    background: #fce4ec;
    color: #c2185b;
}

.menu-card-date,
.settlement-month-label {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.menu-card .delete-btn,
.settlement-card .delete-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    background: #ffcdd2;
    color: #c62828;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    margin-left: auto;
}

.menu-card .delete-btn:hover,
.settlement-card .delete-btn:hover {
    background: #ef9a9a;
}