/* --- Additional Color Variables for Dashboard --- */
:root {
    --income-breakdown-border: #e5e7eb;
    --light-green-1: #a7e4c4;
    --light-green-2: #e8fff3;
    --inactive-bar-color: #f1f1f1;
    --light-blue-bg: #eef6ff;
    --light-green-bg: #e8fff3;
}

[data-theme="dark"] {
    --income-breakdown-border: #2d2d41;
    --light-green-1: #396352;
    --light-green-2: #274036;
    --inactive-bar-color: #2b2b3a;
    --light-blue-bg: #212e48;
    --light-green-bg: #274036;
}

/* --- GENERAL STATS & GRID STYLES --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.stat-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stacked-card-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header .time-filter {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.card-header .time-filter i {
    font-size: 12px;
    margin-left: 4px;
}

.card-body {
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.card-body .card-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
    font-weight: 500;
}

.card-body .card-main-value {
    font-size: 44px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.info-row .value {
    margin-left: auto;
    font-weight: 600;
}

.text-success {
    color: var(--accent-green);
}

.text-danger {
    color: var(--accent-red);
}

/* --- Chart Card Styles --- */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    margin-top: 10px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 130px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-item .color-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* --- Total Sessions Card --- */
.session-chart-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 10px auto;
}

.session-chart-new {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--accent-blue) 0% 71%, var(--accent-green) 71% 99%, var(--accent-orange) 99% 100%);
    position: relative;
}

.session-chart-new::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 75%;
    height: 75%;
    background: var(--white);
    border-radius: 50%;
    transition: background-color 0.3s;
}

.session-chart-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.session-total-count {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.session-total-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.session-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--active-bg);
    border-radius: 8px;
    font-size: 14px;
}

.breakdown-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-app {
    background-color: var(--accent-blue);
}

.dot-rfid {
    background-color: var(--accent-green);
}

.dot-auto {
    background-color: var(--accent-orange);
}

.breakdown-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.breakdown-stats {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.breakdown-value {
    font-weight: 600;
    color: var(--text-primary);
}

.breakdown-percentage {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* --- User Statistics Card --- */
.user-stats-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-stats-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-blue-bg);
    transition: background-color 0.3s;
}

.user-stats-icon i {
    font-size: 28px;
    color: var(--accent-blue);
}

.user-stats-main .card-main-value {
    font-size: 44px;
    letter-spacing: -1.5px;
}

.user-stats-main .card-label {
    font-size: 14px;
    margin: 0;
}

.user-stats-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.user-stat-box {
    background-color: var(--active-bg);
    padding: 16px;
    border-radius: 10px;
    transition: background-color 0.3s;
}

.user-stat-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.user-stat-box-header i {
    font-size: 16px;
}

.user-stat-box-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-stat-box-change {
    font-size: 13px;
    font-weight: 600;
    margin-left: 8px;
}

.user-stat-box-change i {
    margin-right: 2px;
}

/* --- Energy Breakdown Card --- */
.user-energy-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.energy-type-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.energy-type-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.stat-line .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-line .value {
    color: var(--text-primary);
    font-weight: 600;
}

#revenueEnergyChart {
    display: block;
    box-sizing: border-box;
    height: 380px !important;
    width: 805.5px;
}