/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 1.5rem;
    max-width: 950px;
    margin: 0 auto;
    width: 100%;
}

.bento-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.bento-card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.bento-card-header p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Specific Cards */
.bento-chart {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
}

.chart-plot {
    margin-top: 2rem;
    width: 100%;
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Horizontal Gridlines */
.chart-plot::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 0;
    right: 0;
    border-top: 1px dashed var(--border-color);
    z-index: 0;
}

.chart-plot::after {
    content: '';
    position: absolute;
    top: 60%;
    left: 0;
    right: 0;
    border-top: 1px dashed var(--border-color);
    z-index: 0;
}

.css-chart-svg {
    width: 100%;
    height: 160px;
    display: block;
    z-index: 1;
    overflow: visible;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    z-index: 1;
}

.bento-qr {
    grid-column: span 1;
    align-items: center;
    text-align: center;
}

.qr-code-wrapper {
    margin: 1.5rem 0;
    width: 50%;
    aspect-ratio: 1;
    background: #ffffff;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .qr-code-wrapper {
    background: #ffffff; /* Keep QR code background white for scannability */
    padding: 0.75rem;
}

.qr-code-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 1px solid var(--border-color);
}

.icon-btn:hover {
    background-color: var(--card-bg);
}

.icon-btn .material-icons {
    font-size: 1rem;
}

/* Small Bottom Cards */
.bento-small {
    padding: 1.5rem;
    align-items: center;
    text-align: center;
    justify-content: center;
    min-height: 150px;
    gap: 1rem;
}

.bento-small h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.bento-icon {
    font-size: 2.5rem;
}

.bg-green-light {
    background-color: #d1ead1;
}

[data-theme="dark"] .bg-green-light {
    background-color: #1a3a1a;
}

.bg-green-light h3, .bg-green-light .bento-icon {
    color: #2b4d24;
}

[data-theme="dark"] .bg-green-light h3, [data-theme="dark"] .bg-green-light .bento-icon {
    color: #a8d5a8;
}

.bg-white h3, .bg-white .bento-icon {
    color: #1a4d3a;
}

[data-theme="dark"] .bg-white h3, [data-theme="dark"] .bg-white .bento-icon {
    color: #9ad290;
}

.bg-gray {
    background-color: #d9d9d9;
}

[data-theme="dark"] .bg-gray {
    background-color: #333333;
}

.bg-gray h3, .bg-gray .bento-icon {
    color: #ffffff;
}

/* Responsive */
@media (max-width: 900px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    
    .bento-chart, .bento-qr {
        grid-column: span 1;
    }
}