/* ===== History Page Specific Styles ===== */

        /* Stats Dashboard */
        .stats-dashboard {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 16px;
            margin-bottom: 32px;
        }

        .dash-card {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 18px;
            border: 1px solid var(--border-color);
            padding: 24px 16px;
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .dash-card:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-glow);
            border-color: var(--border-glow);
        }

        .dash-card .dash-icon {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 14px;
            transition: transform 0.3s ease;
        }

        .dash-card:hover .dash-icon {
            transform: scale(1.1);
        }

        .dash-icon svg {
            width: 24px;
            height: 24px;
        }

        .dash-icon.green { background: rgba(99, 102, 241, 0.12); color: var(--success); }
        .dash-icon.blue { background: rgba(59, 130, 246, 0.12); color: var(--info); }
        .dash-icon.purple { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }
        .dash-icon.amber { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
        .dash-icon.red { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

        .dash-value {
            font-size: 2rem;
            font-weight: 800;
            background: var(--gradient-accent);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1.2;
        }

        .dash-label {
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-top: 6px;
            font-weight: 500;
        }

        /* Chart Section */
        .chart-section {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 20px;
            border: 1px solid var(--border-color);
            padding: 28px;
            margin-bottom: 28px;
        }

        .chart-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 12px;
        }

        .chart-header h3 {
            font-size: 1.15rem;
            font-weight: 700;
        }

        .chart-legend {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }

        .legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.82rem;
            color: var(--text-secondary);
        }

        .legend-dot {
            width: 10px;
            height: 10px;
            border-radius: 3px;
        }

        .legend-dot.qudurat { background: #6366F1; }
        .legend-dot.tahsili { background: #818CF8; }
        .legend-dot.step { background: #8B5CF6; }

        .chart-wrapper {
            position: relative;
            padding: 0 4px;
        }

        .chart-y-labels {
            position: absolute;
            right: -2px;
            top: 0;
            bottom: 30px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            width: 32px;
        }

        .chart-y-label {
            font-size: 0.7rem;
            color: var(--text-muted);
            text-align: left;
            direction: ltr;
        }

        .chart-area {
            margin-right: 36px;
        }

        .chart-grid {
            position: relative;
            height: 220px;
            border-bottom: 2px solid var(--border-color);
            border-right: 2px solid var(--border-color);
        }

        .chart-grid-line {
            position: absolute;
            right: 0;
            left: 0;
            height: 1px;
            background: var(--border-color);
            opacity: 0.5;
        }

        .chart-bars-container {
            display: flex;
            align-items: flex-end;
            gap: 6px;
            height: 100%;
            padding: 0 12px 0 4px;
            overflow-x: auto;
            scrollbar-width: thin;
        }

        .chart-bar-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            flex: 1;
            min-width: 28px;
            max-width: 56px;
            height: 100%;
            justify-content: flex-end;
        }

        .chart-bar-item {
            width: 100%;
            border-radius: 6px 6px 0 0;
            position: relative;
            cursor: pointer;
            transition: all 0.3s ease;
            min-height: 4px;
        }

        .chart-bar-item:hover {
            opacity: 0.85;
            transform: scaleY(1.02);
            transform-origin: bottom;
        }

        .chart-bar-item.qudurat { background: linear-gradient(180deg, #818CF8, #4F46E5); }
        .chart-bar-item.tahsili { background: linear-gradient(180deg, #A5B4FC, #6366F1); }
        .chart-bar-item.step { background: linear-gradient(180deg, #A78BFA, #7C3AED); }

        .bar-tooltip {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            padding: 6px 12px;
            border-radius: 8px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            font-size: 0.75rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
            z-index: 10;
            box-shadow: var(--shadow-md);
            text-align: center;
            line-height: 1.5;
        }

        .chart-bar-item:hover .bar-tooltip {
            opacity: 1;
        }

        .chart-date-labels {
            display: flex;
            gap: 6px;
            margin-right: 36px;
            padding: 8px 12px 0 4px;
            overflow: hidden;
        }

        .chart-date-label {
            flex: 1;
            min-width: 28px;
            max-width: 56px;
            text-align: center;
            font-size: 0.65rem;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .chart-empty {
            height: 220px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 0.95rem;
        }

        /* Filters */
        .filters-section {
            display: flex;
            gap: 12px;
            margin-bottom: 24px;
            flex-wrap: wrap;
            align-items: center;
        }

        .filter-group {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }

        .filter-group-label {
            font-size: 0.85rem;
            color: var(--text-muted);
            font-weight: 600;
            margin-left: 4px;
        }

        .filter-pill {
            padding: 7px 16px;
            border-radius: 50px;
            border: 1px solid var(--border-color);
            background: var(--bg-glass-light);
            color: var(--text-secondary);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.85rem;
            font-family: inherit;
        }

        .filter-pill:hover {
            border-color: var(--green-400);
            color: var(--green-400);
        }

        .filter-pill.active {
            background: var(--gradient-accent);
            border-color: transparent;
            color: white;
        }

        .sort-select {
            padding: 7px 14px;
            border-radius: 50px;
            border: 1px solid var(--border-color);
            background: var(--bg-glass-light);
            color: var(--text-secondary);
            font-weight: 500;
            font-size: 0.85rem;
            cursor: pointer;
            font-family: inherit;
            appearance: none;
            -webkit-appearance: none;
            padding-left: 32px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: 10px center;
        }

        .sort-select:focus {
            outline: none;
            border-color: var(--green-400);
        }

        .filters-divider {
            width: 1px;
            height: 28px;
            background: var(--border-color);
            margin: 0 4px;
        }

        /* History Cards */
        .history-entries {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 32px;
        }

        .hist-card {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 16px;
            border: 1px solid var(--border-color);
            padding: 20px 24px;
            display: flex;
            align-items: center;
            gap: 20px;
            transition: all 0.3s ease;
            animation: fadeInUp 0.3s ease;
        }

        .hist-card:hover {
            border-color: var(--border-glow);
            box-shadow: var(--shadow-sm);
            transform: translateX(4px);
        }

        .hist-score-ring {
            width: 64px;
            height: 64px;
            flex-shrink: 0;
            position: relative;
        }

        .hist-score-ring svg {
            transform: rotate(-90deg);
            width: 64px;
            height: 64px;
        }

        .hist-score-ring .ring-bg {
            fill: none;
            stroke: var(--bg-tertiary);
            stroke-width: 5;
        }

        .hist-score-ring .ring-fill {
            fill: none;
            stroke-width: 5;
            stroke-linecap: round;
            transition: stroke-dashoffset 0.8s ease;
        }

        .hist-score-ring .ring-fill.high { stroke: var(--success); }
        .hist-score-ring .ring-fill.medium { stroke: var(--warning); }
        .hist-score-ring .ring-fill.low { stroke: var(--danger); }

        .hist-score-text {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            font-weight: 800;
        }

        .hist-score-text.high { color: var(--success); }
        .hist-score-text.medium { color: var(--warning); }
        .hist-score-text.low { color: var(--danger); }

        .hist-info {
            flex: 1;
            min-width: 0;
        }

        .hist-title {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 6px;
            flex-wrap: wrap;
        }

        .hist-exam-badge {
            display: inline-flex;
            align-items: center;
            padding: 3px 10px;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .hist-exam-badge.qudurat {
            background: rgba(99, 102, 241, 0.12);
            color: var(--success);
        }

        .hist-exam-badge.tahsili {
            background: rgba(59, 130, 246, 0.12);
            color: var(--info);
        }

        .hist-exam-badge.step {
            background: rgba(139, 92, 246, 0.12);
            color: #8B5CF6;
        }

        .hist-section-name {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .hist-meta {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
            color: var(--text-secondary);
            font-size: 0.82rem;
        }

        .hist-meta-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .hist-meta-item svg {
            width: 14px;
            height: 14px;
            opacity: 0.6;
        }

        .hist-fraction {
            text-align: center;
            min-width: 60px;
            flex-shrink: 0;
        }

        .hist-fraction-val {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .hist-fraction-label {
            font-size: 0.72rem;
            color: var(--text-muted);
        }

        .hist-progress-bar {
            width: 100%;
            height: 4px;
            background: var(--bg-tertiary);
            border-radius: 2px;
            overflow: hidden;
            margin-top: 10px;
        }

        .hist-progress-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.8s ease;
        }

        .hist-progress-fill.high { background: var(--success); }
        .hist-progress-fill.medium { background: var(--warning); }
        .hist-progress-fill.low { background: var(--danger); }

        /* Empty State */
        .empty-state-container {
            text-align: center;
            padding: 80px 20px;
            animation: fadeInUp 0.5s ease;
        }

        .empty-icon {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: var(--bg-glass-light);
            border: 2px dashed var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 28px;
        }

        .empty-icon svg {
            width: 52px;
            height: 52px;
            stroke: var(--text-muted);
            opacity: 0.5;
        }

        .empty-state-container h3 {
            font-size: 1.4rem;
            font-weight: 700;
            margin-bottom: 10px;
            color: var(--text-primary);
        }

        .empty-state-container p {
            color: var(--text-secondary);
            font-size: 1rem;
            margin-bottom: 28px;
            max-width: 400px;
            margin-left: auto;
            margin-right: auto;
        }

        .empty-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* Clear History */
        .danger-zone {
            margin-top: 20px;
            padding: 24px;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border-radius: 16px;
            border: 1px solid rgba(239, 68, 68, 0.2);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            flex-wrap: wrap;
        }

        .danger-zone-info h4 {
            font-size: 1rem;
            font-weight: 600;
            color: var(--danger);
            margin-bottom: 4px;
        }

        .danger-zone-info p {
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .btn-danger-outline {
            padding: 10px 24px;
            border-radius: 12px;
            border: 2px solid var(--danger);
            background: transparent;
            color: var(--danger);
            font-weight: 600;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.3s ease;
            font-family: inherit;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }

        .btn-danger-outline:hover {
            background: rgba(239, 68, 68, 0.1);
        }

        .btn-danger-outline svg {
            width: 18px;
            height: 18px;
        }

        /* Confirm Dialog */
        .confirm-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            animation: fadeIn 0.2s ease;
        }

        .confirm-dialog {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 36px;
            max-width: 420px;
            width: 100%;
            text-align: center;
            animation: scaleIn 0.3s ease;
        }

        .confirm-dialog .confirm-icon {
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: rgba(239, 68, 68, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 20px;
        }

        .confirm-dialog .confirm-icon svg {
            width: 32px;
            height: 32px;
            stroke: var(--danger);
        }

        .confirm-dialog h3 {
            font-size: 1.2rem;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .confirm-dialog p {
            color: var(--text-secondary);
            font-size: 0.95rem;
            margin-bottom: 28px;
            line-height: 1.6;
        }

        .confirm-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
        }

        .confirm-actions .btn {
            min-width: 120px;
        }

        /* Responsive */
        @media (max-width: 768px) {
            .stats-dashboard {
                grid-template-columns: repeat(3, 1fr);
            }

            .stats-dashboard .dash-card:nth-child(4),
            .stats-dashboard .dash-card:nth-child(5) {
                grid-column: span 1;
            }

            .hist-card {
                flex-direction: column;
                text-align: center;
                padding: 20px 16px;
            }

            .hist-card:hover {
                transform: translateY(-2px);
            }

            .hist-title {
                justify-content: center;
            }

            .hist-meta {
                justify-content: center;
            }

            .filters-section {
                overflow-x: auto;
                flex-wrap: nowrap;
                scrollbar-width: none;
                -ms-overflow-style: none;
                padding-bottom: 4px;
            }

            .filters-section::-webkit-scrollbar { display: none; }

            .filter-group {
                flex-wrap: nowrap;
            }

            .filters-divider { display: none; }

            .danger-zone {
                flex-direction: column;
                text-align: center;
            }

            .chart-area {
                margin-right: 30px;
            }
        }

        @media (max-width: 480px) {
            .stats-dashboard {
                grid-template-columns: repeat(2, 1fr);
            }

            .stats-dashboard .dash-card:last-child {
                grid-column: span 2;
            }

            .dash-value {
                font-size: 1.6rem;
            }

            .dash-card {
                padding: 18px 12px;
            }

            .dash-icon {
                width: 40px;
                height: 40px;
            }
        }