/* Loại bỏ padding của container chính trên trang bảng giá để tối ưu diện tích */
.page-modern-board .container.layout-fluid {
    padding: 5px !important;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .page-modern-board .container.layout-fluid {
        padding-top: 40px !important;
        /* Tránh bị đè bởi mobile ticker cao 35px trên tablet */
    }
}

.modern-board-wrap {
    width: 100%;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: calc(100vh - 55px);
}

/* Tablet (có mobile ticker nhưng không có bottom nav) */
@media (min-width: 769px) and (max-width: 1024px) {
    .modern-board-wrap {
        height: calc(100vh - 55px - 35px);
    }
}

@media (max-width: 768px) {
    .modern-board-wrap {
        /* Mobile thêm bottom nav (65px) và mobile ticker (35px) */
        height: calc(100vh - 55px - 35px - 65px - env(safe-area-inset-bottom));
    }
}

/* Board Layout */
.board-scroll-wrapper {
    overflow-x: auto;
    padding: 10px 10px 4px 10px;
    /* Giảm padding để tối ưu không gian hiển thị */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.board-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.board-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.board-grid {
    display: flex;
    gap: 20px;
    min-width: max-content;
    height: 100%;
    align-items: stretch;
}

/* Industry Columns - Optimized for compactness */
.industry-column.db-card {
    width: 270px;
    /* Thu hẹp độ rộng cột */
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    box-shadow: var(--neumorph-shadow) !important;
    border: 1px solid var(--border-color-light);
    border-radius: var(--card-radius) !important;
    /* Thêm Border Radius chuẩn */
    height: 100%;
}

html.dark-mode .industry-column.db-card {
    border: 1px solid var(--border-color-light);
}

/* Lược bỏ hiệu ứng hover transform theo yêu cầu */
.industry-column:hover {
    transform: none;
}

.industry-header {
    padding: 10px 15px;
    /* Giảm padding */
    border-bottom: 1px solid var(--border-color-divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-header);
}

.industry-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color-dark);
}

.industry-perf {
    font-size: 0.85rem;
    font-weight: 700;
}

.stock-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* Dành cho Firefox: Mặc định ẩn scrollbar */
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
}

/* Hiện scrollbar cho Firefox khi hover vào cột */
.industry-column:hover .stock-list,
.stock-list:hover {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

/* Custom scrollbar cho Chrome, Safari, Edge */
.stock-list::-webkit-scrollbar {
    width: 6px;
}

.stock-list::-webkit-scrollbar-track {
    background: transparent;
}

.stock-list::-webkit-scrollbar-thumb {
    background: transparent;
    /* Mặc định ẩn thanh trượt */
    border-radius: 10px;
}

/* Hiện thanh trượt khi rê chuột vào cột hoặc danh sách */
.industry-column:hover .stock-list::-webkit-scrollbar-thumb,
.stock-list:hover::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

.stock-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    /* Giảm khoảng cách dọc */
    padding: 0 5px;
    /* Giảm padding bảng */
}

.stock-table th {
    text-align: center;
    /* Căn giữa tiêu đề */
    padding: 6px 4px;
    font-size: 10px;
    color: var(--text-color-light);
    text-transform: uppercase;
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 1;
}

.stock-table td {
    padding: 6px 4px;
    font-size: 12px;
    border-bottom: none;
    color: #1a1a1a;
    text-align: center;
    /* Căn giữa dữ liệu */
}

/* Bo góc cho dòng */
.stock-row td:first-child {
    border-radius: 6px 0 0 6px;
    padding-left: 8px;
}

.stock-row td:last-child {
    border-radius: 0 6px 6px 0;
    padding-right: 8px;
}

.stock-row {
    transition: background 0.3s ease;
}

.stock-row:hover {
    filter: brightness(0.95);
}

.col-symbol {
    font-weight: 500;
    width: 45px;
    color: #000 !important;
}

.col-price {
    font-weight: 500;
    text-align: center;
    /* Đảm bảo căn giữa */
    width: 55px;
    color: #000 !important;
}

.col-change {
    text-align: center;
    /* Đảm bảo căn giữa */
    font-size: 0.8rem;
    font-weight: 500;
    width: 60px;
    color: #000 !important;
}

.col-volume {
    text-align: center;
    /* Đảm bảo căn giữa */
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.7rem;
    font-weight: 400;
    width: 50px;
}

/* Status Bar - Bottom Slim version */
.board-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    /* Thu nhỏ padding */
    border-top: 1px solid var(--border-color-divider);
    margin-top: 0px;
    /* Xóa margin top dư thừa */
    background: transparent;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.market-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-color-light);
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #64748b;
    border-radius: 50%;
}

.status-dot.active {
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.update-time {
    font-size: 12px;
    color: var(--text-color-light);
}

.btn-refresh-mini {
    background: transparent;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-refresh-mini:hover {
    color: var(--primary-color);
}

/* Color classes */
.up {
    color: var(--color-success) !important;
}

.down {
    color: var(--color-danger) !important;
}

.ref {
    color: var(--color-warning) !important;
}

.ceil {
    color: #d946ef !important;
}

.floor {
    color: #06b6d4 !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .board-status-bar {
        flex-direction: row;
        justify-content: space-between;
    }

    .status-left {
        gap: 10px;
    }

    .industry-column.db-card {
        width: 260px;
    }
}