/* 기본 초기화 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

* {-webkit-box-sizing: border-box;-moz-box-sizing: border-box;box-sizing: border-box;}
::-moz-selection {background: #000000; /*메인색*/ color: #e6e6e6;text-shadow: none;}
::selection {background: #000000; color: #e6e6e6; text-shadow: none;}
html, body, div, span, object, iframe, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, strong, sub, sup, legend, caption, table, tbody, thead, tfoot, tr, th, td, summary, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, b, i, a, small, menu, nav, section, time, mark, audio, video, dl, dt, dd, ul, li, ol, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, select, textarea, p, blockquote, button {margin:0;padding:0; border: 0;outline: 0;font-weight: inherit;font-style: inherit;font-family: inherit;color:inherit;vertical-align: middle}
dl,ul,ol,menu,li {list-style:none}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display:block}
input,select,textarea,button {font-family:"Pretendard";background:none}
input::-moz-placeholder, textarea::-moz-placeholder {color: #bbb !important;}
img {border:0; max-width:100%}
table {border-collapse:collapse; table-layout: fixed;}
a {text-decoration:none;}
a:hover {transition:.3s all ease}
span {vertical-align:top}
blockquote {font-style:italic;border-left:5px #000 solid; padding-left:20px;margin:40px 20px;}
div,p {word-break:keep-all;}
b, strong {font-weight:700;}
html{font-size:16px;scroll-behavior: smooth;}
body {color:#333; font-family:"Pretendard","Malgun Gothic","Apple SD Gothic NEO",dotum,sans-serif; background:#fff;-webkit-font-smoothing: antialiased;-webkit-overflow-scrolling: touch;}

.bg-green {background-color: #57d06f;}
.bg-red {background-color: #ff750f;}

/* PC 환경 중앙 정렬 및 가로폭 고정 */
.container {
    max-width: 768px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px; /* 버튼 공간 */
}

/* login page */
.loginBoxBlack {
	position:relative;
	width:620px;
	border:1px solid #ccc;
	padding:30px 0 40px;
	margin:0 auto;	
	background-color:#fff;
}
.login_contents  {margin:0 auto; width:350px;}

/* index page */
.summary-header {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-bottom: 1px dashed #eee;
}
.summary-item {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}
.income { background-color: #e8f2ff; color: #3a82ee; }
.expense { background-color: #f1f3f5; color: #868e96; }

/* 달력 */
.month-title-container {
	display: flex; 
	justify-content: center; 
	align-items: center; 
}
.month-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 20px 0;
    color: #333;
}
.calendar-grid {
    display: grid;
	width: 100%;
    grid-template-columns: repeat(7, 1fr);
    border-top: 1px solid #f1f3f5;
}
.day-cell {
    display: flex;
    flex-direction: column;
	justify-content: flex-start;
    align-items: center;
    height: 70px;
    padding: 5px 2px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 11px;
}
.calendar-amount {
	display: block;
	width: 100%;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: -0.5px;
}
.day-cell.header {
    height: 35px;
    padding: 10px 0;
    font-weight: bold;
    background-color: #f8f9fa;
}
.day-cell.header.sun { color: #ff4d4f; }
.day-cell.header.sat { color: #3a82ee; }
.active-day { background-color: #e8f2ff; border-radius: 8px; }
.nav-btn { font-size: 1.2rem; color: #3a82ee; text-decoration: none; padding: 10px; }
.day-num { font-size: 13px; margin-bottom: 4px; font-weight: 500; }
.day-num.sun { color: #ff4d4f; }
.day-num.sat { color: #3a82ee; }

/* 금액 스타일 */
.amount-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: center;
	margin-top: 2px;
}
.plus { color: #3a82ee !important; }  /* 수입: 파란색 */
.minus { color: #ff4d4f !important; } /* 지출: 빨간색 */

/* 하단 고정 버튼 */
.footer-action {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 720px; /* 컨테이너보다 약간 작게 패딩 고려 */
    padding: 0 20px;
}
.btn-register {
    width: 100%;
    background-color: #3a82ee;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(58, 130, 238, 0.3);
	z-index: 3;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
}

.detail-container {
    background-color: #fff;
    padding: 0 20px;
}

/* 주차 구분선 */
.week-divider {
    position: relative;
    text-align: center;
    margin: 25px 0;
}
.week-divider::before {
    content: "";
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    border-top: 1px dashed #e9ecef;
    z-index: 1;
}
.divider-text {
    position: relative;
    z-index: 2;
    background: #fff;
    padding: 0 15px;
    font-size: 14px;
    color: #adb5bd;
}

/* 일별 타이틀 */
.day-header {
    font-size: 15px;
    color: #495057;
    margin: 20px 0 15px;
}

/* 내역 아이템 */
.history-item {
    display: flex;
    align-items: center;
    padding: 15px 0; 
	border-bottom: 1px solid #f8f9fa; 
	cursor: pointer;
}
.item-icon {
	display: flex; 
	align-items: center; 
	justify-content: center; 
    width: 44px; height: 44px;
	min-width: 44px; 
    border-radius: 50%;
	border: 2px solid #fff; 
    margin-right: 15px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    background-color: #f1f3f5;
}
.item-icon img { width: 100%; height: 100%; object-fit: cover; }
.item-name {
	font-size: 11px; 
	font-weight: bold; 
	color: #fff; 
	letter-spacing: -0.5px;
}
.item-info { 
	flex: 1; 
	margin-left: 15px; 
}
.item-title { 
	font-size: 15px; 
	font-weight: 500; 
	color: #333;
	margin: 0; 
}
.item-category {
	display: inline-block;
	font-size: 10px; 
	color: #495057; 
	font-weight: bold; 
	padding: 2px 8px; 
	border-radius: 12px; 
}
.item-amount { 
	font-weight: 700; 
	font-size: 16px;
}
.item-amount.minus { color: #868e96; } /* 이미지상 지출은 회색빛 검정 */
.item-amount.plus { color: #3a82ee; }

/* 내역 없음 */
.no-data {
    display: flex;
    align-items: center;
    color: #adb5bd;
    padding: 10px 0;
}
.empty-icon {
    width: 35px;
    height: 35px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-right: 12px;
}

/* 등록 페이지 컨테이너 */
.register-page {background-color: #fff;}
.tab-container {
    display: flex;
	align-items: center; 
    padding: 10px 20px;
    gap: 8px;
}
.tab-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e9ecef;
    background: #fff;
    border-radius: 8px;
    color: #868e96;
    font-weight: bold;
    cursor: pointer;
}
.tab-btn.active {
    background: #fff;
    color: #333;
    border-color: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.btn-back {
	display: flex; 
	align-items: center;
	margin-right: 10px; 
	padding: 5px; 
	text-decoration: none;
    transition: opacity 0.2s;
}
.btn-back:active {opacity: 0.5;}


/* 폼 타이틀 및 불러오기 버튼 */
.form-content { padding: 30px 20px; }
.form-title { font-size: 1.4rem; margin-bottom: 15px; }

/* 입력 필드 밑줄 스타일 */
.input-group.underline {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.input-main {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.2rem;
    color: #333;
}
.input-main::placeholder { color: #adb5bd; }
.unit { font-size: 1.1rem; color: #333; }

/* 카테고리 */
.category-options { 
	display: grid; 
	grid-template-columns: repeat(2, 1fr); /* 2열로 배치 */
	gap: 10px; 
	max-height: 300px; 
	overflow-y: auto; 
}
.cat-option {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #eee;
}
.cat-option:active {
    color: #3a82ee;
    border-color: #3a82ee;
    background: #e8f2ff;
}

/* 설정 리스트 */
.setting-list { list-style: none; margin-top: 20px; }
.setting-item {
    display: flex;
    justify-content: space-between;
    padding: 18px 0;
    cursor: pointer;
}
.setting-item .label { color: #495057; }
.setting-item .value { color: #3a82ee; font-weight: 500; }
.setting-item .value.arrow::after {
    content: '>';
    margin-left: 8px;
    color: #adb5bd;
}


/* 달력 커스텀 스타일 */
.air-datepicker {
    --adp-accent-color: #3a82ee; /* 가계부 포인트 컬러와 맞춤 */
    --adp-border-radius: 16px;
    --adp-background-color: #fff;
    --adp-font-size: 15px;
    border: none !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2); /* 깊이감 있는 그림자 */
    padding: 10px;
    z-index: 2000 !important;
    background: #ffffff !important;
}
.air-datepicker.-modal-center- {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important; /* 정중앙 정렬 */
    margin: 0 !important;
    z-index: 9999 !important;      /* 가장 위로 */
    border: none !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3) !important;
    filter: none !important;       /* 흐림 효과 절대 방지 */
    opacity: 1 !important;        /* 투명도 방지 */
}


.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
    background: #fff; width: 80%; max-width: 300px; padding: 20px; border-radius: 12px;
}
.modal-title { margin-bottom: 15px; font-size: 16px; font-weight: bold; }
.repeat-options { list-style: none; padding: 0; }
.repeat-options li {
    padding: 15px 0; border-bottom: 1px solid #f1f3f5; cursor: pointer; color: #343a40;
}
.repeat-options li:last-child { border-bottom: none; }
.btn-close-modal {
    margin-top: 10px; width: 100%; padding: 10px; border: none; background: #eee; border-radius: 8px; cursor: pointer;
}


/* 거래한 사람 섹션 */
.section-sub-title { font-size: 1rem; color: #495057; margin: 30px 0 20px; }
.person-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
}
.person-icon.together {
    width: 45px; height: 45px;
    background: #4573ff;
    border-radius: 50%;
    margin-right: 15px;
}
.person-profile {
    width: 45px; height: 45px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    position: relative;
}
.person-item .person-name { flex: 1;}
.person-item.selected .person-name { font-weight: bold; }
.person-item .check-icon { color: #cccccc; font-weight: 400; }
.person-item.selected .check-icon { color: #3a82ee; font-weight: 600; }

/* 하단 버튼 상태 (입력 전 비활성화 예시) */
.btn-submit {
    width: 100%;
    font-weight: bold;
    font-size: 16px;
	color: #fff;
    padding: 16px;
    border-radius: 12px;
    border: none;
	cursor: pointer;
}
.btn-submit.disabled { background-color: #d1e2ff; color: #fff; }


/* 모바일 대응 (화면이 작아질 때 글자 크기 조정) */
@media (max-width: 768px) {
    .day-cell { height: 60px; font-size: 9px; }
    .day-num { font-size: 12px; }
}