/* 부드러운 파스텔 블루 테마 */
:root {
    --bg-color: #f0f8ff;
    --main-blue: #42a5f5;
    --text-dark: #37474f;
    --white: #ffffff;
}

body {
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 15px;
    padding-bottom: 100px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-dark);
    min-height: 100vh;
    box-sizing: border-box;
}

h2 { text-align: center; color: #546e7a; margin-bottom: 20px; }

/* 입력 폼 */
.input-group {
    background: var(--white);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(66, 165, 245, 0.15);
    margin-bottom: 25px;
    border: 1px solid #bbdefb;
}
input, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #cfd8dc;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 16px;
    background-color: #fbfbfb;
}

/* 라디오 버튼 */
.radio-label { font-size: 14px; color: #546e7a; margin-bottom: 5px; font-weight: bold; }
.radio-group { display: flex; gap: 8px; margin-bottom: 15px; }
.radio-group label {
    flex: 1; text-align: center; background: #eceff1; color: #607d8b;
    padding: 12px 5px; border-radius: 12px; cursor: pointer; font-weight: bold; font-size: 14px;
    transition: 0.2s;
}
input[type="radio"] { display: none; }

#payer-me:checked + label,
#payer-hyung:checked + label {
    background: var(--main-blue); color: white;
    box-shadow: 0 4px 10px rgba(66, 165, 245, 0.4);
}

.type-group input[type="radio"]:checked + label {
    background: #78909c; color: white;
    box-shadow: 0 4px 10px rgba(120, 144, 156, 0.4);
}
#type-settlement:checked + label {
    background: #4caf50; color: white;
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.4);
}

.save-btn {
    width: 100%; padding: 15px; background-color: var(--main-blue);
    color: white; font-size: 18px; font-weight: bold; border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 10px rgba(66, 165, 245, 0.3);
}

/* 정산 요약 */
.summary-container { margin-bottom: 20px; }
.summary-box {
    background: white; border-radius: 15px; padding: 15px;
    text-align: center; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.shared-box {
    background: #e3f2fd; margin-bottom: 10px; border: 1px solid #90caf9;
}
.settlement-msg {
    margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 16px; font-weight: bold; color: #d81b60;
}

.personal-row { display: flex; gap: 10px; }
.personal-box { flex: 1; background: white; border: 1px solid #eee; }
.box-title { font-size: 13px; color: #78909c; margin-bottom: 5px; }
.box-value { font-size: 20px; font-weight: bold; color: #37474f; }

/* 필터 영역 */
.list-header { font-weight: bold; color: #546e7a; margin-bottom: 10px; padding-left: 5px; }
.filter-container { margin-bottom: 15px; }
.filter-row { display: flex; gap: 5px; overflow-x: auto; }
.filter-btn {
    flex: 1; border: 1px solid #cfd8dc; background: white; color: #607d8b;
    padding: 8px 5px; border-radius: 20px; font-size: 13px; font-weight: bold; cursor: pointer; white-space: nowrap;
}
.filter-btn.active {
    background: var(--main-blue); color: white; border-color: var(--main-blue);
    box-shadow: 0 2px 5px rgba(66, 165, 245, 0.3);
}
.custom-date-box {
    display: flex; gap: 5px; align-items: center;
    background: #fff; padding: 10px; border-radius: 10px; margin-top: 5px; border: 1px solid #ddd;
}
.custom-date-box input { margin: 0; padding: 8px; font-size: 13px; }

/* 리스트 */
ul { list-style: none; padding: 0; margin: 0; }
li {
    background: white; border-bottom: 1px solid #f0f0f0; padding: 15px;
    display: flex; justify-content: space-between; align-items: center;
    border-radius: 15px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.payer-mark { font-weight: bold; margin-right: 3px; font-size: 14px; }
.text-me, .text-hyung { color: var(--main-blue); }

.badge {
    font-size: 11px; padding: 3px 8px; border-radius: 6px;
    margin-right: 5px; font-weight: bold; vertical-align: middle;
}
.badge.shared { background: #e3f2fd; color: var(--main-blue); border: 1px solid #bbdefb; } 
.badge.personal { background: #f5f5f5; color: #757575; border: 1px solid #e0e0e0; }
.badge.settlement { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

.item-date { font-size: 12px; color: #b0bec5; margin-top: 5px; }
.price-text { color: #37474f; font-size: 16px; margin-right: 8px; font-weight: bold;}

/* 버튼들 */
.lock-btn { background: none; border: none; font-size: 18px; cursor: pointer; padding: 5px; opacity: 0.5; }
.edit-btn { background-color: #ffca28; color: white; border: none; border-radius: 6px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.delete-btn { background-color: #ef5350; color: white; border: none; border-radius: 6px; padding: 6px 10px; font-size: 12px; cursor: pointer; }

/* 수정창 */
.edit-box { width: 100%; background: #fafafa; padding: 15px; border-radius: 15px; border: 2px solid var(--main-blue); }
.edit-box input[type="datetime-local"] { background: white; font-family: inherit; color: #333; }
.save-edit-btn { background-color: var(--main-blue); color: white; border: none; border-radius: 6px; padding: 8px 15px; cursor: pointer; }
.cancel-edit-btn { background-color: #b0bec5; color: white; border: none; border-radius: 6px; padding: 8px 15px; cursor: pointer; }

/* ★ 수정된 현재시간 버튼 (높이 줄임) */
.now-btn {
    background-color: #eceff1;
    color: #607d8b;
    border: 1px solid #cfd8dc;
    border-radius: 8px; 
    padding: 8px 10px; /* 적당한 패딩 */
    font-size: 11px; 
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    align-self: center; /* ★ 핵심: 옆 입력창 높이에 따라 늘어나지 않게 중앙 정렬 */
}
.now-btn:active {
    background-color: #cfd8dc;
}

/* 엑셀 다운로드 버튼 */
.download-btn {
    background-color: #2e7d32;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3);
    margin-bottom: 20px;
}

/* 여행 배너 (맨 위) */
.trip-banner {
    text-align: center; font-size: 14px; font-weight: bold; color: #1e88e5;
    background: white; border: 1px solid #bbdefb; border-radius: 20px;
    padding: 8px 12px; margin: -8px auto 15px; width: fit-content;
}
.trip-banner.past {
    width: auto; color: #6d4c41; background: #fff8e1; border: 1px solid #ffe082;
    border-radius: 15px; padding: 12px; font-size: 15px;
}
.trip-sub { font-size: 12px; color: #a1887f; font-weight: normal; margin-top: 3px; }
.back-btn {
    margin-top: 10px; background: var(--main-blue); color: white; border: none;
    border-radius: 20px; padding: 8px 16px; font-size: 13px; font-weight: bold; cursor: pointer;
}

/* 📊 하루 지출 그래프 */
.chart-box {
    background: var(--white); border: 1px solid #bbdefb; border-radius: 20px;
    padding: 15px; margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(66, 165, 245, 0.12);
}
.chart-head { display: flex; justify-content: space-between; align-items: center; }
.chart-title { font-weight: bold; color: #546e7a; font-size: 15px; }
.chart-legend { font-size: 11px; color: #78909c; display: flex; align-items: center; gap: 4px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
/* 그래프 색: 공용 = 테마 파랑, 개인 = 차분한 코랄 레드 */
:root { --line-shared: #4f9fe8; --line-own: #e8737f; }
.lg.shared { background: var(--line-shared); }
.lg.own { background: var(--line-own); }
.lg { width: 14px; height: 3px; border-radius: 2px; }

.chart-stats { margin: 12px 0 6px; }
.chart-caption { font-size: 12px; color: #78909c; margin-bottom: 6px; padding-left: 2px; }
.chart-caption b { color: #546e7a; }
.cap-link { color: #1e88e5; text-decoration: underline; cursor: pointer; }
.who-row { display: flex; gap: 8px; }
.who-card { flex: 1.6; background: var(--bg-color); border-radius: 12px; padding: 9px 12px; }
.who-name { font-size: 12px; color: #78909c; font-weight: bold; }
.who-total { font-size: 20px; font-weight: bold; color: #37474f; margin-top: 2px; }
.who-total span { font-size: 11px; color: #90a4ae; font-weight: normal; }
.who-break { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.tag { font-size: 10px; font-weight: bold; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.tag.shared { color: #2f7fc8; background: #e1effc; }
.tag.own { color: #c9505d; background: #fce8ea; }
.side-card { flex: 1; background: var(--bg-color); border-radius: 12px; padding: 9px 8px; text-align: center; }
.side-label { font-size: 11px; color: #78909c; }
.side-value { font-size: 17px; font-weight: bold; color: #1e88e5; margin-top: 3px; }
.side-card.up .side-value { color: #d9606c; }
.side-card.down .side-value { color: #4caf7d; }
.side-sub { font-size: 10px; color: #90a4ae; margin-top: 1px; }

.chart-area { display: flex; }
.chart-yaxis { position: relative; width: 30px; flex: 0 0 30px; }
.chart-yaxis span {
    position: absolute; right: 5px; transform: translateY(-50%);
    font-size: 9px; color: #a7b6c2; white-space: nowrap;
}
.chart-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.chart-bars { min-width: 100%; }
.line-chart { display: block; }
.line-chart .ln { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .g-line { stroke: #eef3f8; stroke-width: 1; }
.line-chart .g-line.base { stroke: #dde6ee; }
.line-chart .g-label { font-size: 9px; fill: #a7b6c2; }
.line-chart .x-label { font-size: 10px; fill: #90a4ae; }
.line-chart .x-label.today { fill: #1e88e5; font-weight: bold; }
.line-chart .x-label.sel { fill: #1565c0; font-weight: bold; }
.line-chart .sel-line { stroke: #90caf9; stroke-width: 1.5; stroke-dasharray: 3 3; }
.line-chart .hit { cursor: pointer; }
.chart-hint { font-size: 11px; color: #b0bec5; text-align: center; margin-top: 6px; }
.chart-empty { color: #aaa; font-size: 13px; text-align: center; padding: 50px 0; }

/* 과거 여행 (맨 아래) */
.past-trips { text-align: center; margin-top: 10px; }
.past-btn {
    background: white; color: #607d8b; border: 1px solid #cfd8dc; border-radius: 20px;
    padding: 10px 20px; font-size: 14px; font-weight: bold; cursor: pointer;
}
.past-trip-list { flex-direction: column; gap: 8px; margin-top: 10px; }
.past-trip-item {
    display: flex; justify-content: space-between; align-items: center;
    background: white; border: 1px solid #e0e0e0; border-radius: 12px;
    padding: 12px 15px; font-size: 14px; font-weight: bold; color: #37474f; cursor: pointer;
}
.past-trip-item.active { border-color: #ffb300; background: #fff8e1; }
.past-count { font-size: 12px; color: #90a4ae; font-weight: normal; }
.past-empty { font-size: 13px; color: #aaa; padding: 10px; }