/* assets/css/style.css */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chart-wrapper-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
}

.chart-container {
    position: relative; 
    height: 350px; 
    width: 100%;
    min-width: 1000px;
}

.text-sm {
    font-size: 0.9rem;
}

/* Beautiful scrollbar for the table */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
 
.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1; 
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8; 
}

/* ============================================
   HORIZONTAL BAR REPORT (Báo cáo cột ngang)
   ============================================ */

.hbar-section {
    margin-bottom: 2rem;
}

.hbar-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.hbar-row {
    display: flex;
    align-items: stretch;
    position: relative;
}

.hbar-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    color: #fff;
    border-radius: 8px;
    min-width: 130px;
    flex: 1;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.15s ease;
    position: relative;
}

.hbar-cell:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.hbar-cell-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.92;
    margin-bottom: 6px;
    line-height: 1.3;
}

.hbar-cell-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

/* Cell colors */
.hbar-green  { background: linear-gradient(135deg, #198754, #20c997); }
.hbar-orange { background: linear-gradient(135deg, #e67e22, #fd7e14); }
.hbar-red    { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.hbar-gray   { background: linear-gradient(135deg, #495057, #6c757d); }
.hbar-cyan   { background: linear-gradient(135deg, #0891b2, #22d3ee); }

/* Arrow between cells */
.hbar-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #adb5bd;
    padding: 0 4px;
    flex-shrink: 0;
}

/* Bracket under "Cần làm sạch" group */
.hbar-bracket-wrapper {
    display: flex;
    align-items: flex-start;
    margin-top: 2px;
    position: relative;
}

.hbar-bracket-spacer {
    flex: 1;
    min-width: 130px;
}

.hbar-bracket-group {
    flex: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    /* account for 4 arrows (each ~28px) within the group */
    margin-left: 28px;
}

.hbar-bracket-line {
    width: 96%;
    height: 18px;
    border-left: 3px solid #6c757d;
    border-right: 3px solid #6c757d;
    border-bottom: 3px solid #6c757d;
    border-radius: 0 0 8px 8px;
}

.hbar-bracket-label {
    margin-top: 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #dc3545;
    text-align: center;
}

.hbar-bracket-label-green {
    color: #198754;
}

/* Da lam sach bracket (single cell) */
.hbar-bracket-single {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 130px;
}

.hbar-bracket-single .hbar-bracket-line {
    width: 80%;
}

.hbar-bracket-single .hbar-bracket-label {
    color: #198754;
}

/* ============================================
   HISTORY SUMMARY TABLE (Bảng tổng hợp)
   ============================================ */

.history-table th {
    font-size: 0.82rem;
    vertical-align: middle;
}

.history-table td {
    vertical-align: middle;
}

.history-delta-up {
    color: #198754;
    font-weight: 700;
}

.history-delta-down {
    color: #dc3545;
    font-weight: 700;
}

.history-delta-zero {
    color: #6c757d;
    font-weight: 600;
}

.history-total-row {
    background-color: #f8f9fa;
    font-weight: 800;
    border-top: 3px solid #333 !important;
}

/* History settings */
.history-settings {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.history-settings select {
    width: auto;
    display: inline-block;
    font-size: 0.85rem;
    padding: 2px 8px;
}
