/* === 실거래가 조회 페이지 스타일 === */

/* 날짜 선택 영역 */
.date-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.date-selector label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.date-selector input[type="date"] {
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}

.date-selector .action-btn {
    width: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
}

.date-selector .action-btn .material-icons-round {
    font-size: 20px;
}

/* UI 유형 토글 버튼 */
.icon-toggle-btn {
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.icon-toggle-btn.active {
    background: rgba(58, 166, 255, 0.15);
    color: #58a6ff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.icon-toggle-btn .material-icons-round {
    font-size: 20px;
}

/* 로딩 인디케이터 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 에러 메시지 */
.error-message {
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: #f8847c;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-message::before {
    content: '⚠️';
    font-size: 1.2rem;
}

/* === Premium Data Summary === */
.data-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

@media (min-width: 600px) {
    .data-summary {
        grid-template-columns: repeat(4, 1fr);
    }
}

.summary-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-wrapper .material-icons-round {
    font-size: 16px;
    color: white;
}

.icon-wrapper.date {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    box-shadow: 0 4px 10px rgba(161, 140, 209, 0.4);
}

.icon-wrapper.total {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    box-shadow: 0 4px 10px rgba(132, 250, 176, 0.4);
}

.icon-wrapper.apt {
    background: linear-gradient(135deg, #2980b9 0%, #6dd5fa 100%);
    /* Blue */
    box-shadow: 0 4px 10px rgba(41, 128, 185, 0.4);
}

.icon-wrapper.presale {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    /* Orange */
    box-shadow: 0 4px 10px rgba(246, 211, 101, 0.4);
}

.icon-wrapper.new-high-apt {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    /* Pinkish */
    box-shadow: 0 4px 10px rgba(255, 154, 158, 0.4);
}

.icon-wrapper.new-high-presale {
    background: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
    /* Red/Magenta */
    box-shadow: 0 4px 10px rgba(221, 36, 118, 0.4);
}

.summary-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-content .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-content .value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

/* Animations */
.bounce-in {
    opacity: 0;
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* === Premium Table Styles === */

/* No Data */
.no-data {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.no-data .material-icons-round {
    font-size: 48px;
    opacity: 0.5;
}

/* Gu Section Animation */
.gu-section {
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gu Header */
.gu-header-card {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
    padding: 12px 20px;
    border-left: 4px solid var(--accent, #ffd700);
    border-radius: 4px 12px 12px 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(5px);
}

.gu-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Category Header Row */
.category-header-row {
    background: rgba(255, 255, 255, 0.03);
}

.category-header-row td {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.category-badge.apt {
    background: rgba(58, 166, 255, 0.15);
    color: #58a6ff;
    border: 1px solid rgba(58, 166, 255, 0.3);
}

.category-badge.presale {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* Premium Table Container */
.table-responsive {
    overflow-x: auto;
    border-radius: 16px;
    background: rgba(30, 30, 40, 0.6);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

.premium-table th {
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-muted);
    font-weight: 600;
    padding: 18px 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.premium-table td {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.premium-table tbody tr:last-child td {
    border-bottom: none;
}

/* Row Hover Effect */
.trade-row {
    transition: background 0.2s;
}

.trade-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.trade-row:hover .td-name {
    color: var(--accent, #ffd700);
    transform: translateX(4px);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Columns */
.td-name {
    font-weight: 600;
    color: var(--text-primary);
    transition: transform 0.2s ease, color 0.2s ease;
}

.td-dong {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.td-center {
    text-align: center;
}

.td-right {
    text-align: right;
}

.td-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-apt {
    background: rgba(58, 166, 255, 0.15);
    color: #58a6ff;
    border: 1px solid rgba(58, 166, 255, 0.3);
}

.badge-presale {
    background: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* Price Styling */
.price-tag {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

/* New High Styling */
.trade-row.new-high {
    background: linear-gradient(90deg, rgba(255, 82, 82, 0.08), transparent);
    position: relative;
}

.trade-row.new-high::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ff5252;
    box-shadow: 0 0 10px #ff5252;
}

.trade-row.new-high:hover {
    background: rgba(255, 82, 82, 0.15);
}

.price-tag.new-high {
    color: #ff5252;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.4);
}

.fire-icon {
    font-size: 18px;
    animation: flame 1.5s infinite alternate;
}

@keyframes flame {
    0% {
        transform: scale(1);
        opacity: 0.8;
        filter: drop-shadow(0 0 2px #ff5252);
    }

    100% {
        transform: scale(1.2);
        opacity: 1;
        filter: drop-shadow(0 0 8px #ff5252);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {

    /* Legacy column hiding removed */
    .gu-header-card {
        padding: 10px 16px;
    }

    .premium-table th,
    .premium-table td {
        padding: 12px 10px;
    }

    .price-tag {
        font-size: 0.95rem;
    }
}

/* ====================== 리포트 스타일 ====================== */

/* 리포트 헤더 */
.report-header {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: 1px solid var(--border-accent);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
}

.report-logo img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(201, 162, 39, 0.3));
}

.report-title h2 {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 6px;
}

.report-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 리포트 요약 */
.report-summary {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(26, 41, 66, 0.6));
}

/* 리포트 섹션 */
.report-section {
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.section-header.apt {
    background: rgba(58, 166, 255, 0.15);
    border: 1px solid rgba(58, 166, 255, 0.3);
    color: #58a6ff;
}

.section-header.presale {
    background: rgba(201, 162, 39, 0.15);
    border: 1px solid var(--border-accent);
    color: var(--accent);
}

.section-header .material-icons-round {
    font-size: 24px;
}

.section-header h3 {
    flex: 1;
    font-size: 1rem;
    margin: 0;
    color: inherit;
}

.section-header .count {
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* 카드 그리드 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* 거래 카드 */
.trade-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.trade-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.trade-card.apt::before {
    background: linear-gradient(180deg, #58a6ff, #3d8fd9);
}

.trade-card.presale::before {
    background: linear-gradient(180deg, var(--accent), #b8922a);
}

.trade-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--border-accent);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.card-district {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.card-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
    text-align: right;
}

.card-price-unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.card-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.card-info {
    text-align: center;
}

.card-info .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.card-info .value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 리포트 푸터 */
.report-footer {
    text-align: center;
    padding: 24px;
    margin-top: 32px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

.report-footer p {
    margin-bottom: 8px;
    font-weight: 600;
}

.report-footer .disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* New Category Header Styles */
.category-row td {
    border-bottom: none !important;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category-header .material-icons-round {
    font-size: 1.1rem;
    opacity: 0.9;
}

.apt-header {
    background: linear-gradient(90deg, #3aa6ff 0%, #2e8bdc 100%);
    border-left: 4px solid #82caff;
}

.presale-header {
    background: linear-gradient(90deg, #ff9800 0%, #ed6c02 100%);
    border-left: 4px solid #ffcc80;
}

/* Center Flex for Price Wrapper */
.center-flex {
    justify-content: center;
}

/* Center Alignment Utilities */
.td-center {
    text-align: center;
}

/* Stacked Cell Layout */
.cell-primary {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.cell-secondary {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.price-wrapper {
    margin-bottom: 2px;
}

.price-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.price-text.new-high {
    color: #ff5252;
}

.date-wrapper {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.trade-count {
    color: var(--accent);
    font-weight: 500;
    margin-left: 4px;
    font-size: 0.75rem;
}

/* Column Widths (PC Default) */
.th-dong {
    width: 10%;
}

.th-name {
    width: 50%;
}

.th-area {
    width: 15%;
}

.th-price {
    width: 25%;
}

/* Updated Responsive Table */
@media (max-width: 600px) {

    /* Mobile Column Widths - Prioritize Price to avoid cutting off */
    .th-dong {
        width: 10%;
    }

    .th-name {
        width: 42%;
    }

    .th-area {
        width: 15%;
    }

    .th-price {
        width: 33%;
    }

    .premium-table {
        table-layout: fixed;
        width: 100%;
    }

    .premium-table th,
    .premium-table td {
        padding: 8px 2px;
    }

    .premium-table th {
        font-size: 0.8rem;
        padding: 10px 2px;
        letter-spacing: -0.5px;
    }

    .td-dong {
        font-size: 0.8rem;
        color: var(--text-secondary);
        letter-spacing: -0.8px;
    }

    .td-name {
        font-size: 0.85rem;
        white-space: normal;
        word-break: break-all;
        /* Force break to save space */
        line-height: 1.25;
        letter-spacing: -0.8px;
        padding-right: 2px;
    }

    .cell-primary {
        font-size: 0.85rem;
        white-space: nowrap;
        letter-spacing: -0.8px;
    }

    .cell-secondary {
        font-size: 0.75rem;
        margin-top: 2px;
    }

    .price-wrapper {
        margin-bottom: 2px;
        line-height: 1.2;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        /* Allow wrapping so text is never hidden */
    }

    .price-text {
        font-size: 0.95rem;
        letter-spacing: -0.5px;
        white-space: normal;
        /* Allow price to wrap if absolutely needed */
        word-break: break-all;
        text-align: center;
    }

    .date-wrapper {
        font-size: 0.75rem;
        white-space: normal;
        /* Allow wrap */
        line-height: 1.2;
        letter-spacing: -0.5px;
        margin-top: 2px;
        color: var(--text-muted);
        text-align: center;
    }

    .category-header {
        font-size: 0.9rem;
        padding: 6px 12px;
        min-height: 32px;
        white-space: normal;
    }
}

/* 신고가 스타일 */
.trade-card.new-high {
    border-color: rgba(248, 81, 73, 0.4);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(248, 81, 73, 0.08) 100%);
}

.trade-card.new-high::before {
    background: linear-gradient(180deg, #f85149, #da3633);
}

/* 건축년도 스타일 */
.card-year {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 구별 그룹핑 스타일 */
.gu-list-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.gu-header {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gu-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.gu-section-wrapper {
    margin-bottom: 12px;
}

/* 일별 조회 페이지 테이블 스타일 */
.trades-table-style th {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.new-high-text {
    color: var(--danger);
}

.highlight-row {
    background-color: rgba(248, 81, 73, 0.05);
}

/* Construction Year Info */
.apt-name-text {
    font-weight: 700;
}

.construction-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

.age-badge {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Cancelled Trade Styling */
.trade-row.cancelled {
    background-color: rgba(255, 255, 255, 0.02);
    opacity: 0.7;
}

.trade-row.cancelled .td-name,
.trade-row.cancelled .td-dong {
    text-decoration: line-through;
    opacity: 0.6;
}

.price-text.cancelled {
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 400;
}

.cancel-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #ff5252;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-decoration: none !important;
    margin-left: 4px;
    font-weight: 600;
    vertical-align: middle;
}

/* Previous High Price */
.prev-high-wrapper {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 4px;
    white-space: nowrap;
    opacity: 0.8;
    line-height: normal;
}

/* Mobile Adjustments for Price Wrapper */
@media (max-width: 600px) {
    .price-wrapper .prev-high-wrapper {
        width: 100%;
        text-align: center;
        font-size: 0.7rem;
        margin-top: -2px;
        margin-left: 0;
    }
}

/* Report Dashboard Layout */
.report-dashboard {
    background: rgba(30, 30, 40, 0.6);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.report-date-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.report-date-header .calendar-icon {
    font-size: 1.6rem;
}

.report-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-section-title .material-icons-round {
    font-size: 1.2rem;
    color: var(--accent);
}

/* Main Counts Row */
.report-counts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.report-count-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-count-item.apt {
    border-left: 4px solid #58a6ff;
}

.report-count-item.presale {
    border-left: 4px solid #ff9800;
}

.report-count-item.total {
    border-left: 4px solid #8e44ad;
}

.count-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.count-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* District Grid */
.district-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.district-stat-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.district-name {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.district-count {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile responsive for report */
@media (max-width: 600px) {
    .report-date-header {
        font-size: 1.2rem;
    }

    .report-counts-row {
        grid-template-columns: 1fr;
        /* Stack on mobile */
        gap: 12px;
    }

    .district-summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .count-value {
        font-size: 1.5rem;
    }
}

/* Selected Trades Card Updates */
.card-price-block {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.prev-high-mini {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.card-footer-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    padding: 8px 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 8px;
}

/* Control Panel */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.date-selector {
    margin-bottom: 0;
    /* Override */
}

/* View Mode Toggle */
.view-mode-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-mode-toggle input[type="radio"] {
    display: none;
}

.view-mode-toggle .toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.view-mode-toggle .toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.view-mode-toggle input[type="radio"]:checked+.toggle-btn {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive Control Panel */
@media (max-width: 600px) {
    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .view-mode-toggle {
        justify-content: center;
    }

    .view-mode-toggle .toggle-btn {
        flex: 1;
        justify-content: center;
    }
}

/* === 상세 모달 === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card, #1e1e28);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    padding: 30px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-price-box {
    margin: 20px 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
}

.modal-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
}

.modal-info-grid .info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-info-grid .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-info-grid .value {
    font-size: 1rem;
    font-weight: 600;
}

.detailed-chart-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 20px 10px 10px 10px;
    margin-top: 10px;
}