/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   App Container
   ============================================ */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 1.75rem;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.nav-tab:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--accent-gradient);
    color: white;
}

/* ============================================
   Views
   ============================================ */
.view {
    display: none;
    flex: 1;
    padding: 2rem;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

/* ============================================
   Builder Layout
   ============================================ */
.builder-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    height: calc(100vh - 70px - 4rem);
}

/* Sidebar */
.sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    height: fit-content;
    max-height: 100%;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sidebar-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.field-types {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-type {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: grab;
    transition: var(--transition);
    user-select: none;
}

.field-type:hover {
    background: var(--bg-glass);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.field-type:active {
    cursor: grabbing;
}

.field-type.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.field-icon {
    font-size: 1.25rem;
}

.sidebar-section-title {
    margin-top: 1.5rem;
    color: var(--accent-secondary);
}

.field-templates .field-type {
    border-left: 3px solid var(--accent-primary);
}

.field-templates .field-type:hover {
    border-left-color: var(--accent-secondary);
}

.delete-template-btn {
    opacity: 0;
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition);
}

.field-type:hover .delete-template-btn {
    opacity: 1;
}

.delete-template-btn:hover {
    background: var(--danger-color);
    color: white;
}

.field-action-btn.save-template {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.field-action-btn.save-template:hover {
    background: var(--warning-color);
    color: white;
}

/* Builder Main */
.builder-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.builder-header {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.form-name-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
}

.form-name-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-name-input::placeholder {
    color: var(--text-muted);
}

.builder-actions {
    display: flex;
    gap: 0.75rem;
}

/* Builder Canvas */
.builder-canvas {
    flex: 1;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    min-height: 400px;
    overflow-y: auto;
    transition: var(--transition);
}

.builder-canvas.drag-over {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ============================================
   Form Fields in Builder
   ============================================ */
.form-field {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: grab;
    transition: var(--transition);
    position: relative;
}

.form-field:hover {
    border-color: var(--accent-primary);
}

.form-field.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.form-field.drag-over {
    border-top: 3px solid var(--accent-primary);
    margin-top: 0.5rem;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.field-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-type-badge {
    background: var(--bg-glass);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.required-badge {
    background: var(--danger);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.field-actions {
    display: flex;
    gap: 0.5rem;
}

.field-action-btn {
    background: var(--bg-glass);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.field-action-btn:hover {
    background: var(--accent-primary);
    color: white;
}

.field-action-btn.delete:hover {
    background: var(--danger);
}

.field-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.field-preview {
    opacity: 0.7;
}

.field-preview input,
.field-preview textarea,
.field-preview select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.875rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    pointer-events: none;
}

.field-preview textarea {
    min-height: 80px;
    resize: none;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
}

/* ============================================
   Forms Grid
   ============================================ */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

.form-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.form-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.form-card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.form-card-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-family: monospace;
}

.form-card-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.form-card-actions {
    display: flex;
    gap: 0.5rem;
}

.form-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    font-size: 0.85rem;
    text-decoration: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.form-link:hover {
    text-decoration: underline;
}

/* ============================================
   Customers Grid
   ============================================ */
.customers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

.customer-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

.customer-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.customer-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.customer-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.customer-company {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.customer-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.status-badge.completed {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.status-badge.no-form {
    background: rgba(100, 100, 120, 0.2);
    color: var(--text-muted);
}

.customer-form-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.customer-form-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.customer-form-name {
    font-size: 0.9rem;
    color: var(--accent-primary);
}

.customer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.customer-link input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: monospace;
}

.customer-link input:focus {
    outline: none;
}

.copy-link-btn {
    background: var(--accent-primary);
    border: none;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.copy-link-btn:hover {
    opacity: 0.9;
}

.customer-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   Submissions
   ============================================ */
.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 200px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.submissions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submission-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
}

.submission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.submission-form-name {
    font-weight: 600;
    color: var(--accent-primary);
}

.submission-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.submission-data {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.submission-field {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

.submission-field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.submission-field-value {
    font-size: 0.95rem;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: toastSlide 0.3s ease;
    min-width: 300px;
}

@keyframes toastSlide {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--accent-primary);
}

/* ============================================
   Empty States
   ============================================ */
.empty-list {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-list-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-list h3 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .builder-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .sidebar {
        order: -1;
    }

    .field-types {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .builder-header {
        flex-direction: column;
    }

    .form-name-input {
        width: 100%;
    }

    .view-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* ============================================
   Analytics View
   ============================================ */
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.analytics-title {
    flex: 1;
    text-align: center;
}

.analytics-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analytics-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-family: monospace;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(20px);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
}

.chart-container h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

/* Timeline Chart */
.timeline-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 200px;
    padding-top: 1rem;
}

.timeline-bar {
    flex: 1;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-height: 4px;
    position: relative;
    transition: var(--transition);
    cursor: pointer;
}

.timeline-bar:hover {
    opacity: 0.8;
}

.timeline-bar::after {
    content: attr(data-label);
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.timeline-bar .bar-value {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Field Charts */
.field-charts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.field-chart {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.field-chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.field-chart-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-glass);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bar-label {
    width: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
}

.bar-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.bar-percent {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 45px;
    text-align: right;
}

/* Pie Chart (CSS-only) */
.pie-chart-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.pie-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(var(--accent-primary) 0deg,
            var(--accent-secondary) 90deg,
            var(--success) 180deg,
            var(--warning) 270deg,
            var(--accent-primary) 360deg);
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Number Stats */
.number-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.number-stat {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-sm);
}

.number-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.number-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Checkbox Stats */
.checkbox-stats {
    display: flex;
    gap: 1rem;
}

.checkbox-stat {
    flex: 1;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
}

.checkbox-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.checkbox-stat-value.yes {
    color: var(--success);
}

.checkbox-stat-value.no {
    color: var(--danger);
}

.checkbox-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Data Table Section */
.data-table-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.search-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 250px;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.table-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table td {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.data-table tbody tr:hover {
    background: var(--bg-glass);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Analytics Responsive */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .analytics-header {
        flex-direction: column;
    }

    .analytics-title {
        order: -1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-chart {
        height: 150px;
    }

    .timeline-bar::after {
        display: none;
    }
}