/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-blue: #333;
    --secondary-blue: #555;
    --grey-50: #f5f5f5;
    --grey-100: #e0e0e0;
    --grey-200: #ccc;
    --grey-400: #999;
    --grey-600: #666;
    --grey-800: #333;
    --grey-900: #222;
    --grey-950: #111;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
}

body {
    font-family: 'Manrope', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: var(--grey-950);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: #f5f7fa;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 200px;
    background: white;
    color: var(--grey-950);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid var(--grey-200);
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--grey-200);
    background: white;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.nav-item {
    padding: 12px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--grey-50);
    border-left-color: var(--primary-blue);
}

.nav-item.active {
    background: var(--grey-50);
    border-left-color: var(--primary-blue);
    color: var(--primary-blue);
}

.nav-item span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 200px;
    position: relative;
    z-index: 1;
}

/* Top Header */
.top-header {
    background: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--grey-200);
}

.header-left h1 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-blue);
}

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

.refresh-btn {
    background: none;
    border: none;
    color: var(--grey-600);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: var(--grey-50);
    color: var(--primary-blue);
}

.refresh-btn.loading {
    animation: spin 1s linear infinite;
}

.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.logout-btn {
    background: none;
    border: none;
    color: var(--grey-600);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.logout-btn:hover {
    background: var(--grey-50);
}

/* Page Content */
.page-content {
    display: none;
    padding: 24px;
}

.page-content.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    width: 250px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--grey-400);
    font-size: 1.2rem;
}

/* Select Styles */
select {
    padding: 8px 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: white;
}

select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* Button Styles */
.btn {
    padding: 8px 16px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--grey-800);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--grey-50);
}

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

.btn-primary:hover {
    background: var(--grey-800);
}

.btn-secondary {
    background: var(--grey-100);
    color: var(--grey-800);
    border-color: var(--grey-200);
}

.btn-secondary:hover {
    background: var(--grey-200);
}

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

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

.btn-info {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.btn-info:hover {
    background: #138496;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons .btn {
    background: #333 !important;
    color: white !important;
    border: 1px solid #333 !important;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

/* Data Table */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
    overflow: hidden;
}

.data-table th {
    background: var(--grey-50);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--grey-800);
    border-bottom: 1px solid var(--grey-200);
    font-size: 0.9rem;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--grey-100);
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: var(--grey-50);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Users Count */
.users-count, .messages-count {
    color: var(--grey-600);
    font-weight: normal;
    font-size: 0.9rem;
}

/* Messages Table Container */
.messages-table-container {
    overflow: visible;
    position: relative;
}

/* Analytics Styles */
.stats-overview {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--textLight);
    font-weight: 500;
}

.stat-divider {
    width: 1px;
    height: 60px;
    background: var(--grey-200);
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
}

.chart-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 20px;
    text-align: center;
}

.chart {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-placeholder {
    color: var(--textLight);
    font-style: italic;
}

/* Simple Chart Styles */
.simple-chart {
    width: 100%;
}

/* Registration Metrics Styles */
.date-range-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: white;
}

.date-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.registration-metrics-container {
    margin-top: 24px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
    text-align: center;
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-card.conversion-card {
    background: linear-gradient(135deg, var(--primary-blue), #3b82f6);
    color: white;
    border: none;
}

.metric-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.conversion-card .metric-number {
    color: white;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--textLight);
    font-weight: 500;
}

.conversion-card .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--grey-100);
}

.chart-row:last-child {
    border-bottom: none;
}

.chart-label {
    min-width: 100px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.chart-bar-container {
    flex: 1;
    height: 24px;
    background: var(--grey-100);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: end;
}

.chart-bar {
    width: 100%;
    background: var(--primary-blue);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.3s ease;
    min-height: 10px;
}

.chart-value {
    min-width: 60px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    text-align: right;
}

.chart-summary {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--grey-50);
    border-radius: var(--radius-sm);
}

.chart-section {
    margin-top: 20px;
}

.chart-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--grey-200);
}

/* Chart Styles */
.chart-wrapper {
    background: white;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 20px;
    text-align: center;
}

.chart-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grey-200);
}

.chart-label {
    min-width: 120px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.chart-bar-container {
    flex: 1;
    height: 40px;
    background: var(--grey-100);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: end;
}

.chart-bar {
    height: 24px;
    background: var(--primary-blue);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
    min-width: 20px;
}

.chart-value {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
    min-width: 60px;
    text-align: right;
}

.chart-summary {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.summary-item {
    text-align: center;
    padding: 16px 24px;
    background: var(--grey-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 4px;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--textLight);
    font-weight: 500;
}

.chart-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--grey-200);
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--grey-200);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--textLight);
    font-weight: 500;
}

.chart-container {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-600);
    font-style: italic;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 16px;
}

.modal-content {
    margin-bottom: 20px;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--grey-200);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border: 1px solid #ddd;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--grey-600);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--grey-800);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.login-btn {
    width: 100%;
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 10px;
}

.login-btn:hover {
    background: var(--grey-800);
}

.login-btn:active {
    transform: translateY(1px);
}

.login-btn:disabled {
    background: var(--grey-400);
    cursor: not-allowed;
}

.message {
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Dialogue Styles */
.dialogue-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-message {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid #333;
}

.luni-message {
    background: #e8f4fd;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid #007bff;
}

.message-cell {
    max-width: 400px;
    word-wrap: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-actions {
        justify-content: stretch;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* R1 Retention Page Styles */
.retention-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.summary-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--grey-100);
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--grey-600);
    font-weight: 500;
}

.retention-table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--grey-100);
    overflow: hidden;
}

#r1-table {
    width: 100%;
    border-collapse: collapse;
}

#r1-table th {
    background: var(--grey-50);
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--grey-800);
    border-bottom: 1px solid var(--grey-200);
    font-size: 0.9rem;
}

#r1-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--grey-100);
    color: var(--grey-800);
}

#r1-table tbody tr:hover {
    background: var(--grey-50);
}

#r1-table tbody tr:last-child td {
    border-bottom: none;
}

/* R1 percentage styling */
.r1-percentage {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.r1-percentage.high {
    background: #e8f5e8;
    color: #2d5a2d;
}

.r1-percentage.medium {
    background: #fff3cd;
    color: #856404;
}

.r1-percentage.low {
    background: #f8d7da;
    color: #721c24;
}

/* Date range selector for R1 */
#retention-page .date-range-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

#retention-page .date-input {
    padding: 8px 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: white;
}

#retention-page .date-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

/* Responsive design for R1 page */
@media (max-width: 768px) {
    .retention-summary {
        flex-direction: column;
    }
    
    .summary-card {
        min-width: auto;
    }
    
    #r1-table th,
    #r1-table td {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    #retention-page .date-range-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    #retention-page .date-range-selector span {
        display: none;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: var(--grey-600);
    font-size: 0.875rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--grey-200);
    background: white;
    color: var(--grey-600);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--grey-50);
    border-color: var(--grey-400);
    color: var(--grey-800);
}

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

.pagination-pages {
    display: flex;
    gap: 0.25rem;
}

.pagination-page {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--grey-200);
    background: white;
    color: var(--grey-600);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.pagination-page:hover {
    background: var(--grey-50);
    border-color: var(--grey-400);
    color: var(--grey-800);
}

.pagination-page.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.pagination-page.ellipsis {
    cursor: default;
    border: none;
    background: transparent;
}

.pagination-page.ellipsis:hover {
    background: transparent;
    border: none;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--grey-600);
}

.pagination-size select {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--grey-800);
    font-size: 0.875rem;
}

.pagination-size select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .pagination-controls {
        justify-content: center;
    }
    
    .pagination-pages {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-size {
        justify-content: center;
    }
}

/* Analytics Sections */
.analytics-section {
    margin-bottom: 2rem;
}

.analytics-section h3 {
    margin: 0 0 1rem 0;
    color: var(--grey-800);
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 0.5rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.analytics-card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--grey-200);
}

.analytics-card h4 {
    margin: 0 0 1rem 0;
    color: var(--grey-700);
    font-size: 1.125rem;
    font-weight: 500;
}

/* Simple Chart Styles */
.simple-chart {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.chart-row:last-child {
    border-bottom: none;
}

.chart-label {
    min-width: 100px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.chart-bar-container {
    flex: 1;
    height: 24px;
    background: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: end;
}

.chart-bar {
    width: 100%;
    background: #333;
    border-radius: 4px 4px 0 0;
    transition: width 0.3s ease;
    min-height: 10px;
}

.chart-value {
    min-width: 60px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-align: right;
}


/* Analytics Section Styles */
.analytics-section {
    margin-bottom: 1.5rem;
}

.analytics-card {
    background: #fff;
    padding: 1rem;
    margin-bottom: 1rem;
}

.analytics-card h3 {
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.analytics-summary {
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.summary-label {
    font-weight: 500;
    color: #666;
}

.summary-value {
    font-weight: 600;
    color: #333;
}

.analytics-details {
    margin-top: 1rem;
}

.detail-section {
    margin-bottom: 1rem;
}

.detail-section h4 {
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.detail-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.detail-value {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

/* No Data Message */
.no-data {
    text-align: center;
    color: var(--grey-500);
    font-style: italic;
    padding: 2rem;
    background: var(--grey-50);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--grey-300);
}

/* Responsive Analytics */
@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-bar,
    .age-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .bar-label,
    .age-label {
        min-width: auto;
        text-align: left;
    }
    
    .analytics-section h3 {
        font-size: 1.25rem;
    }
}
