/* Home 儀表板（子元件 class 須用全域 CSS，不可放 Home.razor.css scoped） */

/* 與 gs-page 疊用；子元件 class 須全域載入 */
.home-page.gs-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.home-top {
    flex: 0 0 45%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.home-bottom {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.home-bottom .gs-tabbed-list {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.home-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.home-panel.rz-card,
.home-panel.gs-card {
    min-height: 0;
    height: 100%;
}

.home-page .home-panel > .rz-card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.75rem 1rem;
}

.home-panel-header {
    flex-shrink: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
}

.home-panel-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.home-tab-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.home-bottom .gs-list-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.home-bottom .gs-list-panel {
    overflow: hidden;
}

.home-bottom .gs-list-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.home-dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.home-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.home-kpi-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

.home-kpi-label {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.home-kpi-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.home-kpi-unit {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 0.25rem;
}

.home-kpi-trend {
    font-size: 0.75rem;
    color: #16a34a;
    margin-top: 0.25rem;
}

.home-section-title {
    margin-top: 0.25rem;
    color: #374151;
}

.home-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1.5rem;
}

.home-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.home-summary-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.home-summary-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
    text-align: right;
}

.home-summary-sub {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
}

.home-notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.home-notification-item {
    /* Override MudBlazor global button { display:inline-flex; align-items:center } */
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    text-align: left;
    cursor: pointer;
    appearance: none;
    background: #fff;
    color: inherit;
    font: inherit;
    line-height: 1.35;
    margin: 0;
}
    .home-notification-item.unread {
        background: #f0fdf4;
        border-color: #bbf7d0;
    }
        .home-notification-item.unread:hover {
            background: #f3f4f6;
        }

    .home-notification-item.read {
        background: #e3e3e3;
    }
        .home-notification-item.read:hover {
            background: #f3f4f6;
        }

.home-notification-title,
.home-notification-message,
.home-notification-time {
    display: block;
    width: 100%;
}

.home-notification-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.home-notification-message {
    font-size: 0.8125rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.home-notification-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.home-amount-positive {
    color: #16a34a;
}

.home-amount-negative {
    color: #dc2626;
}

.home-data-grid {
    min-height: 0;
}

@media (max-width: 992px) {
    .home-top {
        flex: 0 0 auto;
        max-height: 50%;
        grid-template-columns: 1fr;
    }

    .home-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .home-kpi-grid {
        grid-template-columns: 1fr;
    }
}
