/* =============================================================================
   Dashboard — khối dash-* (nền toàn app: app-shell-dark.css)
   ============================================================================= */

.app-page--dashboard {
    --dash-radius: 1.25rem;
    --dash-glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --dash-glass-bg: rgba(255, 255, 255, 0.06);
    --dash-glow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 48px -12px rgba(0, 0, 0, 0.45), 0 0 100px -24px rgba(14, 165, 233, 0.2);
}

/* —— Header (kiểu auth-brand / thẻ kính) —— */
.dash-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: clamp(1.25rem, 2.8vw, 1.85rem);
    padding: 1rem 1.25rem;
    border-radius: var(--dash-radius);
    background: linear-gradient(160deg, rgba(12, 18, 32, 0.92) 0%, rgba(17, 24, 39, 0.88) 45%, rgba(15, 23, 42, 0.9) 100%);
    border: var(--dash-glass-border);
    box-shadow: var(--dash-glow);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.dash-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 15%, rgba(14, 165, 233, 0.12), transparent 55%);
    pointer-events: none;
}

/* Cùng ngôn ngữ với .dash-metric__icon (Open Iconic, khối vuông bo nhỏ) */
.dash-header__badge {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
    color: #e0f2fe;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(1, 74, 173, 0.45));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.18);
}

.dash-header__text {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.dash-header__title {
    font-size: clamp(1.25rem, 2.2vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.2;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #bae6fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dash-header__sub {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.88);
    margin: 0.35rem 0 0;
    line-height: 1.4;
    max-width: 36rem;
}

.dash-header__meta {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(186, 230, 253, 0.55);
    margin: 0.35rem 0 0;
    letter-spacing: 0.01em;
}

/* —— Metrics (kiểu auth-feature) —— */
.dash-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(0.75rem, 2vw, 1.1rem);
    margin-bottom: clamp(1.25rem, 2.8vw, 1.85rem);
}

@media (max-width: 1199.98px) {
    .dash-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .dash-metrics {
        grid-template-columns: 1fr;
    }
}

.dash-metric {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 7.25rem;
    padding: 1rem 1.15rem 1.1rem;
    border-radius: var(--dash-radius);
    background: var(--dash-glass-bg);
    border: var(--dash-glass-border);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.dash-metric:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(14, 165, 233, 0.28);
    transform: translateY(-2px);
}

.dash-metric__top {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.dash-metric__icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    color: #e0f2fe;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(1, 74, 173, 0.42));
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.dash-metric__label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.88);
    margin: 0;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.dash-metric__value {
    font-size: clamp(1.45rem, 2.8vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #bae6fd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dash-metric__hint {
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.95);
    margin: 0;
    margin-top: auto;
    line-height: 1.35;
    padding-top: 0.2rem;
}

/* Bỏ vạch màu cũ — icon gradient đã đủ nhận diện */
.dash-metric::before {
    display: none;
}

/* Skeleton trên nền tối */
.app-page--dashboard .dash-skel-metric {
    border-radius: var(--dash-radius);
    min-height: 128px;
    background: var(--dash-glass-bg);
    border: var(--dash-glass-border);
    padding: 1.2rem;
}

.app-page--dashboard .dash-skel-metric .skeleton,
.app-page--dashboard .dash-panel .skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.12) 50%,
        rgba(255, 255, 255, 0.06) 100%
    );
    background-size: 200% 100%;
}

/* —— Panel hoạt động — dark: cùng hệ kính với header/metrics (không khối trắng chói) —— */
.dash-panel {
    position: relative;
    border-radius: calc(var(--dash-radius) + 0.15rem);
    background: linear-gradient(165deg, rgba(12, 18, 32, 0.9) 0%, rgba(17, 24, 39, 0.84) 50%, rgba(15, 23, 42, 0.88) 100%);
    border: var(--dash-glass-border);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 20px 48px -16px rgba(0, 0, 0, 0.48),
        0 0 72px -28px rgba(14, 165, 233, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 1.2rem 1.3rem 1.35rem;
    overflow: hidden;
}

.dash-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 72% 48% at 100% 0%, rgba(14, 165, 233, 0.09), transparent 58%);
    pointer-events: none;
    border-radius: inherit;
}

.dash-panel__head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.dash-panel__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #f1f5f9;
    margin: 0;
}

.dash-panel__title .oi {
    font-size: 1rem;
    color: #7dd3fc;
    opacity: 0.95;
}

/* Bề mặt bảng tối, đọc được, đồng bộ app */
.app-page--dashboard .dash-panel .table-wrapper {
    position: relative;
    z-index: 1;
    border-radius: 0.75rem;
    border: 1px solid #2eb398;
    background: rgba(2, 6, 23, 0.52);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-page--dashboard .dash-panel .activity-table thead th {
    background: #2eb398 !important;
    background-image: none !important;
    color: #fff !important;
    border-bottom: 2px solid #2eb398 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
}

.app-page--dashboard .dash-panel .activity-table tbody td {
    color: rgba(248, 250, 252, 0.94) !important;
    border-bottom: 1px solid #2eb398 !important;
    font-size: 0.875rem;
}

.app-page--dashboard .dash-panel .activity-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.045) !important;
}

.app-page--dashboard .dash-panel .activity-table tbody tr:last-child td {
    border-bottom: none;
}

/* Empty state trong panel tối */
.app-page--dashboard .dash-panel .empty-state {
    position: relative;
    z-index: 1;
    padding: 2.25rem 1.5rem;
    border-radius: 0.75rem;
    background: rgba(2, 6, 23, 0.38);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.app-page--dashboard .dash-panel .empty-state-icon {
    color: rgba(125, 211, 252, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

.app-page--dashboard .dash-panel .empty-state h3 {
    color: #e2e8f0;
    font-size: 1.05rem;
}

.app-page--dashboard .dash-panel .empty-state p {
    color: rgba(148, 163, 184, 0.92);
}
