* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --sidebar-bg: #1f2937;
    --sidebar-hover: #374151;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: var(--sidebar-hover);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Language Selector in Sidebar */
.language-selector-sidebar {
    margin-bottom: 16px;
}

.language-selector-sidebar select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.language-selector-sidebar select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-selector-sidebar select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.language-selector-sidebar select option {
    background: #1f2937;
    color: white;
    padding: 10px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    transition: var(--transition);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.topbar h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.user-info span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card.large {
    grid-column: 1 / -1;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-icon svg {
    stroke: white;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.view-all-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Card */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

/* Create Link Form */
.create-link-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.flex-2 {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Error Message */
.error-message {
    background: #fee2e2;
    border: 2px solid var(--error-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #991b1b;
    font-size: 0.9rem;
}

/* Links List */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-item {
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.link-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.link-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.link-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.link-short {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.link-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.link-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.link-status.status-active {
    background: #d1fae5;
    color: #065f46;
}

.link-status.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.link-original {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
    word-break: break-all;
}

.link-actions {
    display: flex;
    gap: 8px;
}

.link-action-btn {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.link-action-btn:hover {
    background: var(--bg-tertiary);
}

.link-action-btn.danger {
    color: var(--error-color);
    border-color: var(--error-color);
}

.link-action-btn.danger:hover {
    background: #fee2e2;
}

.link-action-btn.toggle-btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.link-action-btn.toggle-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.link-item.inactive {
    opacity: 0.6;
    background: var(--bg-tertiary);
}

.link-item.inactive .link-short {
    text-decoration: line-through;
}

/* Page Actions */
.page-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* Profile */
.profile-card h2 {
    margin-bottom: 24px;
    font-size: 1.5rem;
}

.profile-info {
    display: flex;
    gap: 24px;
    align-items: center;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 2.5rem;
}

.profile-details {
    flex: 1;
}

.profile-details p {
    margin-bottom: 12px;
    font-size: 1rem;
}

.profile-details strong {
    color: var(--text-secondary);
    font-weight: 600;
    display: inline-block;
    min-width: 140px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}

.modal-content h3 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    margin: 0 auto 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar-header h2,
    .nav-item span,
    .logout-btn span {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        padding: 20px 15px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .topbar h1 {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Top Links List */
.top-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.top-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.top-link-item:hover {
    background: var(--bg-tertiary);
}

.top-link-info {
    flex: 1;
}

.top-link-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.top-link-url {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.top-link-clicks {
    background: var(--primary-gradient);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

/* Package Widget */
.package-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.package-widget-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.package-info {
    flex: 0 0 auto;
}

.package-name {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.package-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
}

.package-usage {
    flex: 1 1 250px;
    min-width: 200px;
}

.usage-item {
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 14px;
    margin-bottom: 8px;
}

.usage-label {
    font-weight: 500;
}

.usage-value {
    font-weight: 700;
}

.usage-progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.usage-progress-bar {
    background: white;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.btn-upgrade {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #667eea;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.3);
}

.btn-upgrade svg {
    stroke-width: 2.5;
}

/* Pagination Controls */
.pagination-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-info span {
    color: var(--text-primary);
    font-weight: 600;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-size label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pagination-size select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
}

.pagination-size select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pagination-size select:hover {
    border-color: var(--primary-color);
}

/* Pagination Navigation */
.pagination-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 20px;
    flex-wrap: wrap;
}

/* Pagination Navigation (Top) - different spacing */
.pagination-navigation-top {
    margin-top: 0;
    margin-bottom: 20px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn svg {
    stroke-width: 2;
}

/* Page Numbers */
.page-numbers {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-number-btn {
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.page-number-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

.page-number-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.page-ellipsis {
    padding: 0 8px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Responsive Pagination */
@media (max-width: 768px) {
    .pagination-controls-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-navigation {
        padding: 16px 10px;
        gap: 8px;
    }

    .pagination-btn span {
        display: none;
    }

    .page-number-btn {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .page-numbers {
        gap: 4px;
    }
}

/* Scroll to Top Button */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    transition: var(--transition);
    display: none;
    align-items: center;
    justify-content: center;
}

.scroll-to-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.scroll-to-top-btn:active {
    transform: translateY(-1px);
}

.scroll-to-top-btn svg {
    stroke-width: 2.5;
}

/* Responsive Scroll to Top */
@media (max-width: 768px) {
    .scroll-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }

    .scroll-to-top-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   ANALYTICS STYLES - PHASE 1
   ============================================ */

/* Analytics Containers */
.analytics-container {
    margin-bottom: 24px;
}

.analytics-section {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.analytics-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Overall Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.metric-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.metric-sublabel {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Link Distribution */
.distribution-grid {
    display: grid;
    gap: 20px;
    margin-top: 16px;
}

.distribution-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.distribution-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.distribution-icon {
    font-size: 1.5rem;
}

.distribution-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.distribution-bar-wrapper {
    margin-top: 12px;
}

.distribution-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.distribution-bar-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

.distribution-bar-fill.custom-alias {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.distribution-bar-fill.active-status {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.distribution-bar-fill.with-title {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.distribution-stats {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.distribution-stats span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Click Distribution */
.click-ranges {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.click-range-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.click-range-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.click-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.click-range-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.click-range-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.click-range-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.click-range-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
}

.click-range-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Domain Analytics */
.domain-summary {
    display: flex;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.domain-summary span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.domains-list {
    display: grid;
    gap: 12px;
}

.domain-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.domain-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.domain-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.domain-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.domain-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.domain-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.domain-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.domain-percent {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Responsive Analytics */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 12px;
    }

    .metric-card {
        padding: 16px;
    }

    .metric-icon {
        font-size: 1.5rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .metric-label {
        font-size: 0.8rem;
    }

    .analytics-section {
        padding: 16px;
    }

    .distribution-stats {
        flex-direction: column;
        gap: 4px;
    }

    .domain-item {
        flex-wrap: wrap;
    }

    .domain-info {
        flex: 1 1 100%;
        order: 2;
    }

    .domain-stats {
        order: 3;
        flex: 1 1 auto;
        align-items: flex-start;
        flex-direction: row;
        gap: 12px;
        width: 100%;
        margin-top: 8px;
    }
}
