/* 가계부 분석 전용 스타일 (trading.css 위에 확장) */

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.chart-half canvas {
  width: 100% !important;
  max-height: 320px;
}

.pie-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pie-header select {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85em;
}

/* 모달 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 1100px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { margin: 0; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  color: var(--text-light);
  padding: 0 5px;
}

.modal-close:hover { color: var(--danger); }

.modal-content .table-wrapper {
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
}

.modal-summary {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9em;
  font-weight: 600;
  color: var(--dark);
  text-align: right;
}

/* 빠른 기간 버튼 */
.btn-sm {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-sm:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 반응형 */
@media (max-width: 768px) {
  .chart-row { grid-template-columns: 1fr; }
  .modal-content { width: 95%; }
}
