/* ===== Dashboard Overview ===== */
.dashboard-overview {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* ===== Dashboard Header ===== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 24px;
}

/* ===== Summary Cards Row - CSS Grid Layout ===== */
.dashboard-summary-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

.summary-card-item {
    min-width: 0;
    overflow: hidden;
}

.dashboard-summary-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    transition: box-shadow 0.25s ease;
    height: 100%;
}

    .dashboard-summary-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .dashboard-summary-card .card-body {
        padding: 1.25rem;
    }

.summary-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    font-size: 1.75rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    align-self: center;
}

    .summary-icon i {
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        width: 1em;
        height: 1em;
    }

    .summary-icon.bg-primary {
        background-color: #1A445A !important;
    }

/* Clickable summary cards - match Metrics screen hover effect */
.summary-card-item a .dashboard-summary-card.summary-card-clickable {
    border: 1px solid #e5e7eb;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.summary-card-item a:hover .dashboard-summary-card.summary-card-clickable,
.summary-card-clickable.dashboard-summary-card:hover {
    background-color: #f8fafc;
    border-color: #1A445A;
    box-shadow: 0 2px 8px rgba(26, 68, 90, 0.12);
}

.summary-content {
    min-width: 0;
    flex: 1;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.summary-label {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

.dashboard-user-card .summary-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.supervisor-name {
    color: #48697B !important;
}

/* ===== Dashboard Charts Row - CSS Grid Layout ===== */
.dashboard-charts-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.dashboard-chart-item {
    min-width: 0;
    overflow: hidden;
}

/* ===== Full Width Sections ===== */
.dashboard-full-width-section {
    width: 100%;
}

/* ===== Section Cards ===== */
.dashboard-section-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #ffffff;
    overflow: hidden;
}

/* ===== Card Headers ===== */
.dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
}

.card-header-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Work Hours Header - More Complex Layout */
.dashboard-card-header-complex .card-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.workhours-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chart-legend-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.chart-legend-avg-hrs {
    background-color: #48697B;
}

.chart-legend-target {
    background-color: #CCCCCC;
}

.chart-legend-label {
    font-size: 0.8125rem;
    color: #6b7280;
    white-space: nowrap;
}

/* ===== Dashboard Filter Select ===== */
.dashboard-filter {
    font-size: 0.875rem;
    border-radius: 8px;
    border-color: #e5e7eb;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    min-width: 140px;
    background-position: right 0.5rem center;
}

    .dashboard-filter:focus {
        border-color: #1A445A;
        box-shadow: 0 0 0 2px rgba(26, 68, 90, 0.1);
    }

.dashboard-filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Card Body ===== */
.dashboard-section-card .card-body {
    padding: 1.25rem;
}

/* ===== KPI Cards Grid ===== */
.kpi-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}

.kpi-card-item {
    min-width: 0;
    overflow: hidden;
}

.kpi-card {
    background-color: #f3f6f9;
    border: none;
    border-radius: 12px;
    padding: 1.25rem;
    transition: background-color 0.2s ease;
    height: 100%;
}

    .kpi-card:hover {
        background-color: #eef3f7;
    }

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.kpi-title {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.3;
}

.kpi-card-header i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.kpi-card-body {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.kpi-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.1;
}

.kpi-trend {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ===== Review Donut Chart ===== */
.review-no-data {
    min-height: 200px;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.review-donut-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 1rem 0;
}

.review-chart-container {
    width: 180px;
    height: 180px;
    max-width: 100%;
    margin-bottom: 1.25rem;
}

.review-legend {
    width: 100%;
}

.review-legend-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-text {
    white-space: nowrap;
}

/* ===== Work Hours Chart Container ===== */
.chart-container-responsive {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 280px;
    min-height: 200px;
    overflow: hidden;
}

/* ===== Loading Overlay ===== */
.dashboard-section-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 0 12px 12px;
    z-index: 10;
    align-items: center;
    justify-content: center;
}

    .dashboard-section-loading.active {
        display: flex;
    }

    .dashboard-section-loading::after {
        content: "";
        width: 32px;
        height: 32px;
        border: 3px solid #e5e7eb;
        border-top-color: #1A445A;
        border-radius: 50%;
        animation: dashboard-spin 0.8s linear infinite;
    }

.dashboard-info-note {
    font-size: 0.85rem;
    color: #374151;
    background-color: #f3f4f6;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
}


@keyframes dashboard-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .dashboard-summary-row {
        gap: 1.25rem;
    }

    .dashboard-charts-row {
        gap: 1.75rem;
    }

    .chart-container-responsive {
        height: 320px;
    }
}

/* Desktop (1200px - 1399px) */
@media (max-width: 1399.98px) {
    .summary-value {
        font-size: 1.5rem;
    }

    .kpi-value {
        font-size: 1.625rem;
    }
}

/* Tablet Landscape / Small Desktop (992px - 1199px) */
@media (max-width: 1199.98px) {
    .dashboard-summary-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.875rem;
    }



    .dashboard-summary-card .card-body {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }


    .summary-value {
        font-size: 1.375rem;
    }

    .summary-label {
        font-size: 0.8125rem;
    }

    .dashboard-user-card .summary-value {
        font-size: 1rem;
    }

    .dashboard-charts-row {
        gap: 1.25rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .chart-container-responsive {
        height: 260px;
    }
}

/* Tablet Portrait (768px - 991px) */
@media (max-width: 991.98px) {
    .dashboard-header {
        gap: 1rem;
    }

    .dashboard-filter-container {
        display: flex !important;
        flex-wrap: wrap;
        gap: 0.875rem !important;
        align-items: center !important;
        width: 100%;
    }

    .dashboard-filter-container select {
        flex: 1;
        min-width: 150px;
    }

    .dashboard-summary-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.875rem;
    }

    .summary-card-item:first-child {
        grid-column: span 3;
    }

    .dashboard-summary-card .card-body {
        flex-direction: row;
        align-items: center;
    }

    .dashboard-user-card .card-body {
        justify-content: center;
        text-align: center;
    }

    .dashboard-charts-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .dashboard-card-header {
        padding: 1rem;
    }

    .dashboard-section-card .card-body {
        padding: 1rem;
    }

    .kpi-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .review-chart-container {
        width: 200px;
        height: 200px;
    }

    .chart-container-responsive {
        height: 240px;
    }

    .workhours-header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Large Mobile (576px - 767px) */
@media (max-width: 767.98px) {
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .dashboard-filter-container {
        display: flex !important;
        flex-direction: row;
        gap: 0.75rem !important;
        align-items: center !important;
        width: 100%;
        flex-wrap: wrap;
    }

    .dashboard-filter-container select {
        flex: 1;
        min-width: 120px;
    }

    .dashboard-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .summary-card-item:first-child {
        grid-column: span 2;
    }

    .dashboard-summary-card .card-body {
        padding: 1rem;
    }


    .summary-value {
        font-size: 1.25rem;
    }

    .summary-label {
        font-size: 0.8125rem;
    }

    .dashboard-user-card .summary-value {
        font-size: 0.9375rem;
    }

    .dashboard-user-card .summary-label {
        font-size: 0.8125rem;
    }

    .dashboard-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-header-actions {
        width: 100%;
    }

    .dashboard-filter {
        width: 100%;
        max-width: none;
    }

    .dashboard-card-header-complex {
        flex-direction: column;
        align-items: flex-start;
    }

    .workhours-header-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        width: 100%;
    }

    .chart-legend-group {
        width: 100%;
        justify-content: flex-start;
    }

    .kpi-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .kpi-card {
        padding: 1rem;
    }

    .kpi-value {
        font-size: 1.375rem;
    }

    .kpi-title {
        font-size: 0.875rem;
    }

    .review-chart-container {
        width: 180px;
        height: 180px;
    }

    .review-legend-bottom {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .chart-container-responsive {
        height: 220px;
        min-height: 180px;
    }
}

/* Small Mobile (< 576px) */
@media (max-width: 575.98px) {
    .dashboard-overview {
        padding: 0;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    .dashboard-filter-container {
        display: flex !important;
        flex-direction: row;
        gap: 0.625rem !important;
        align-items: center !important;
        width: 100%;
        flex-wrap: nowrap;
    }

    .dashboard-filter-container select {
        flex: 1;
        min-width: 80px;
        padding: 0.5rem 0.5rem;
        font-size: 0.875rem;
    }

    .dashboard-info-note {
        margin-top: 0.25rem;
    }

    .dashboard-summary-row {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }

    .summary-card-item:first-child {
        grid-column: span 1;
    }

    .dashboard-summary-card .card-body {
        padding: 0.875rem 1rem;
    }


    .summary-value {
        font-size: 1.125rem;
    }

    .summary-label {
        font-size: 0.75rem;
    }

    .dashboard-charts-row {
        gap: 1rem;
    }

    .dashboard-card-header {
        padding: 0.875rem 1rem;
    }

    .card-header-title {
        font-size: 1rem;
    }

    .dashboard-section-card .card-body {
        padding: 1rem;
    }

    .kpi-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.625rem;
    }

    .kpi-card {
        padding: 0.875rem;
    }

    .kpi-value {
        font-size: 1.25rem;
    }

    .kpi-title {
        font-size: 0.8125rem;
    }

    .kpi-trend {
        font-size: 0.75rem;
    }

    .review-chart-container {
        width: 160px;
        height: 160px;
    }

    .review-legend-bottom {
        font-size: 0.8125rem;
        gap: 0.375rem;
    }

    .chart-container-responsive {
        height: 200px;
        min-height: 160px;
    }

    .chart-legend-label {
        font-size: 0.75rem;
    }
}

/* Extra Small Mobile (< 400px) */
@media (max-width: 399.98px) {
    .kpi-cards-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        padding: 1rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .chart-container-responsive {
        height: 180px;
        min-height: 150px;
    }
}

/* ===== Print Styles ===== */
/* ===== Print Styles ===== */
@media print {
    .dashboard-overview {
        padding: 0;
    }

    .dashboard-summary-row {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .dashboard-charts-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-section-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .dashboard-filter {
        display: none;
    }
}
