/* ============================================================
   ROSTER INSIGHT — Dashboard Shared Styles
   Professional SAAS Design — Radzen Blazor Compatible
   ============================================================ */

/* ── Typography & Root ─────────────────────────────── */
.dashboard-page {
    padding: 0px;
    background-color: #f8fafc;
    min-height: calc(100vh - 104px);
    font-family: 'Inter', 'Roboto', sans-serif;
}

/* ── Dashboard Grid Layout ─────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


.dashboard-grid-item-full {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .dashboard-grid-item-half {
        grid-column: span 1;
    }
}

/* ── Widget Card ────────────────────────────────────── */
.widget-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease;
    height: 100%;
    min-height: 320px;
}

.widget-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* ── Widget Header ──────────────────────────────────── */
.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.widget-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.widget-title-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.widget-title-icon.teal {
    background: rgba(18, 141, 182, 0.12);
    color: #128db6;
}

.widget-title-icon.green {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.widget-title-icon.orange {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.widget-title-icon.red {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.widget-title-icon.purple {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.widget-title-icon.slate {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

.widget-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.widget-refresh-info {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* ── Widget Body ────────────────────────────────────── */
.widget-body {
    padding: 16px 20px;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.widget-body-scroll {
    overflow-y: auto;
    max-height: 280px;
}

/* ── KPI Strip ──────────────────────────────────────── */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 0;
}

.kpi-tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 16px 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kpi-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.kpi-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.kpi-tile.kpi-teal::before {
    background: #128db6;
}

.kpi-tile.kpi-orange::before {
    background: #f59e0b;
}

.kpi-tile.kpi-red::before {
    background: #ef4444;
}

.kpi-tile.kpi-green::before {
    background: #10b981;
}

.kpi-tile.kpi-purple::before {
    background: #8b5cf6;
}

.kpi-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.kpi-tile.kpi-teal .kpi-tile-icon {
    background: rgba(18, 141, 182, 0.1);
    color: #128db6;
}

.kpi-tile.kpi-orange .kpi-tile-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.kpi-tile.kpi-red .kpi-tile-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.kpi-tile.kpi-green .kpi-tile-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.kpi-tile.kpi-purple .kpi-tile-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.kpi-tile-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.kpi-tile-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.kpi-tile-action {
    margin-top: auto;
}

/* ── CSS Bar Chart ──────────────────────────────────── */
.css-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
    padding: 0 4px;
}

.css-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
    gap: 4px;
}

.css-bar-stack {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    gap: 1px;
    flex: 1;
}

.css-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: opacity 0.2s ease;
}

.css-bar:hover {
    opacity: 0.8;
}

.css-bar-completed {
    background: #128db6;
}

.css-bar-failed {
    background: #ef4444;
}

.css-bar-primary {
    background: #128db6;
}

.css-bar-success {
    background: #10b981;
}

.css-bar-warning {
    background: #f59e0b;
}

.css-bar-label {
    font-size: 0.62rem;
    color: #64748b;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.css-bar-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.css-bar-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}

.css-bar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Horizontal Bar (Working Hours) ────────────────── */
.hbar-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.hbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hbar-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    width: 30px;
    flex-shrink: 0;
    text-align: right;
}

.hbar-track {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.hbar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    background: linear-gradient(90deg, #128db6, #0ea5e9);
}

.hbar-value {
    font-size: 0.72rem;
    color: #0f172a;
    font-weight: 600;
    width: 48px;
    text-align: left;
    flex-shrink: 0;
}

/* ── Ranked List ────────────────────────────────────── */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #ffffff;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #94a3b8, #64748b);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #cd7c32, #a0522d);
}

.rank-badge.rank-other {
    background: #e2e8f0;
    color: #64748b;
}

.rank-item-content {
    flex: 1;
    min-width: 0;
}

.rank-item-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.rank-item-bar-track {
    height: 5px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.rank-item-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.rank-item-bar-fill.teal {
    background: linear-gradient(90deg, #128db6, #0ea5e9);
}

.rank-item-bar-fill.red {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.rank-item-bar-fill.orange {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.rank-item-bar-fill.purple {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.rank-item-bar-fill.green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.rank-item-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 40px;
    text-align: right;
}

/* ── Employee Leaderboard ───────────────────────────── */
.leaderboard-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.podium-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.podium-item.first .podium-avatar {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    width: 52px;
    height: 52px;
    font-size: 1rem;
}

.podium-item.second .podium-avatar {
    background: linear-gradient(135deg, #94a3b8, #64748b);
}

.podium-item.third .podium-avatar {
    background: linear-gradient(135deg, #cd7c32, #a0522d);
}

.podium-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-hours {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 500;
}

/* ── Empty State ────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    color: #94a3b8;
    text-align: center;
    gap: 8px;
}

.empty-state-icon {
    font-size: 2rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── Loading Skeleton ───────────────────────────────── */
.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ── Radzen Grid Overrides ──────────────────────────── */
.widget-card .rz-datatable,
.widget-card .rz-grid {
    border: none !important;
    border-radius: 0 !important;
    font-size: 0.82rem;
}

.widget-card .rz-datatable-thead th,
.widget-card .rz-grid-table thead th {
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 12px !important;
}

.widget-card .rz-datatable-tbody tr,
.widget-card .rz-grid-table tbody tr {
    border-bottom: 1px solid #f8fafc !important;
    transition: background 0.15s;
}

.widget-card .rz-datatable-tbody tr:hover,
.widget-card .rz-grid-table tbody tr:hover {
    background: #f8fafc !important;
}

.widget-card .rz-datatable-tbody td,
.widget-card .rz-grid-table tbody td {
    padding: 9px 12px !important;
    color: #1e293b !important;
    font-size: 0.8rem !important;
    border: none !important;
}

/* ── Radzen Tabs Overrides ──────────────────────────── */
.widget-card .rz-tabview .rz-tabview-nav {
    background: transparent !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 0 16px !important;
}

.widget-card .rz-tabview .rz-tabview-nav li a {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    border: none !important;
    padding: 10px 14px !important;
    border-radius: 0 !important;
}

.widget-card .rz-tabview .rz-tabview-nav li.rz-tabview-selected a {
    color: #128db6 !important;
    border-bottom: 2px solid #128db6 !important;
    background: transparent !important;
}

.widget-card .rz-tabview-panels {
    padding: 12px 0 0 0 !important;
}

/* ── Row Status Colors ──────────────────────────────── */
.row-danger {
    background-color: rgba(239, 68, 68, 0.07) !important;
}

.row-warning {
    background-color: rgba(245, 158, 11, 0.07) !important;
}

.row-success {
    background-color: rgba(16, 185, 129, 0.07) !important;
}

/* ── Status Badge ───────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.status-badge.expired {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

/* ── Filter Row ─────────────────────────────────────── */
.widget-filters {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    align-items: flex-end;
    background: #fafbfc;
}

.widget-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 180px;
}

.widget-filter-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Radzen Chart Custom Overrides ─────────────────── */
.widget-card .rz-chart {
    font-family: 'Inter', 'Roboto', sans-serif !important;
}

.widget-card .rz-chart .rz-category-axis text,
.widget-card .rz-chart .rz-value-axis text {
    fill: #64748b !important;
    font-size: 9.5px !important;
    font-weight: 500 !important;
}

.widget-card .rz-chart .rz-legend-item-text {
    fill: #475569 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}

.widget-card .rz-chart .rz-line {
    display: none !important;
}


