/* ==========================================
   RADICULL DASHBOARD - STYLES
   Consistent with Landing Page Design System
   ========================================== */

/* --- CSS Variables --- */
:root {
    /* Colors */
    --primary: #4338CA;
    --primary-hover: #3730A3;
    --primary-light: #EEF2FF;
    --secondary: #0F172A;
    --text-main: #334155;
    --text-light: #64748B;
    --text-muted: #94A3B8;
    --bg-white: #FFFFFF;
    --bg-light: #F8FAFC;
    --bg-dark: #0F172A;
    --border-color: #E2E8F0;
    
    /* Category Colors */
    --accent-success: #059669;
    --accent-success-bg: #ECFDF5;
    --accent-success-border: #A7F3D0;
    --accent-neutral: #D97706;
    --accent-neutral-bg: #FFFBEB;
    --accent-neutral-border: #FDE68A;
    --accent-ignore: #64748B;
    --accent-ignore-bg: #F1F5F9;
    --accent-ignore-border: #CBD5E1;
    --accent-danger: #DC2626;
    --accent-danger-bg: #FEF2F2;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Spacing */
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-main);
    background: var(--bg-light);
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* --- Layout --- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 40px;
}

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--secondary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.logo span {
    color: var(--primary);
}

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

.nav-section {
    margin-bottom: 32px;
}

.nav-label {
    padding: 0 24px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

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

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary);
}

.user-plan {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-light);
    font-size: 1rem;
}

/* --- Views --- */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Analysis Card --- */
.analysis-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    display: flex;
    gap: 16px;
    padding: 32px 32px 0;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.card-title h2 {
    margin-bottom: 4px;
}

.card-title p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.analysis-form {
    padding: 32px;
}

.form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-group label svg {
    color: var(--text-muted);
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-light);
    transition: all var(--transition-fast);
}

/* Spezifischer Fix fÃ¼r date inputs auf Mobile */
input[type="date"].input-field {
    text-align: left;
    -webkit-appearance: none;
    appearance: none;
}




.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    background: var(--bg-light);
    transition: all var(--transition-base);
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-content {
    pointer-events: none;
}

.upload-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--bg-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: var(--shadow-sm);
    color: var(--primary);
}

.drop-text {
    margin-bottom: 16px;
}

.drop-title {
    display: block;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 4px;
}

.drop-hint {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
}

.drop-formats {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.format-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    background: var(--bg-white);
    color: var(--text-light);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- File Preview --- */
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.file-chip:hover {
    border-color: var(--primary);
}

.file-chip-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.file-chip .remove {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-chip .remove:hover {
    background: var(--accent-danger-bg);
    color: var(--accent-danger);
}

/* --- Analyze Button --- */
.analyze-btn {
    width: 100%;
    margin-top: 24px;
    padding: 16px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-base);
    box-shadow: 0 4px 14px rgba(67, 56, 202, 0.35);
}

.analyze-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 56, 202, 0.4);
}

.analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    flex-shrink: 0;
}

/* --- Spinner --- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Card Footer --- */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Recent Section --- */
.recent-section {
    margin-top: 48px;
}

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

.recent-header h3 {
    font-size: 1.25rem;
}

.view-all-link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: gap var(--transition-fast);
}

.view-all-link:hover {
    gap: 8px;
}

/* --- History Grid --- */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.history-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.history-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.history-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--secondary);
    margin-bottom: 4px;
}

.history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.history-stats {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-item.priority .stat-label { color: var(--accent-success); }
.stat-item.priority .stat-value { color: var(--accent-success); }
.stat-item.neutral .stat-label { color: var(--accent-neutral); }
.stat-item.neutral .stat-value { color: var(--accent-neutral); }
.stat-item.ignore .stat-label { color: var(--accent-ignore); }
.stat-item.ignore .stat-value { color: var(--accent-ignore); }

/* --- Empty State --- */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--secondary);
}

.empty-state p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- Settings --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.settings-card.danger {
    border-color: rgba(220, 38, 38, 0.2);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.settings-card.danger .settings-card-header {
    background: var(--accent-danger-bg);
    border-color: rgba(220, 38, 38, 0.1);
    color: var(--accent-danger);
}

.settings-card-header h3 {
    font-size: 1rem;
}

.settings-content {
    padding: 20px 24px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-label {
    font-weight: 500;
    color: var(--text-main);
}

.setting-value {
    color: var(--text-light);
}

.plan-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
}

.setting-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 16px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-color);
    border-radius: 24px;
    transition: var(--transition-base);
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--accent-danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* ==========================================
   FULLSCREEN RESULTS VIEW
   ========================================== */

.results-view {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--bg-light);
    flex-direction: column;
    overflow: hidden;
}

.results-view.active {
    display: flex;
}

/* Results Header */
.results-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.back-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.results-header-content {
    flex: 1;
    min-width: 0;
}

.results-header-content h1 {
    font-size: 1.25rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.results-header-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Results Body */
.results-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

/* Desktop: 3 columns layout */
@media (min-width: 1024px) {
    .results-body {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        align-items: start;
        padding: 24px 32px;
    }
    
    .results-section {
        margin-bottom: 0;
    }
    
    /* On desktop, sections are always expanded */
    .results-section[data-collapsed="true"] .section-items {
        display: block;
    }
    
    .results-section[data-collapsed="true"] .section-toggle {
        transform: none;
    }
    
    .section-toggle {
        display: none;
    }
    
    .section-header {
        cursor: default;
    }
    
    .section-header:hover {
        background: var(--bg-white);
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .results-body {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 20px 24px;
    }
    
    .results-section {
        margin-bottom: 0;
    }
    
    .results-section:last-child {
        grid-column: span 2;
    }
}

/* Results Sections (replaces columns on mobile) */
.results-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.section-header:hover {
    background: var(--bg-light);
}

.section-header.priority { border-left: 4px solid var(--accent-success); }
.section-header.neutral { border-left: 4px solid var(--accent-neutral); }
.section-header.ignore { border-left: 4px solid var(--accent-ignore); }

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

.section-header.priority .section-icon {
    background: var(--accent-success-bg);
    color: var(--accent-success);
}

.section-header.neutral .section-icon {
    background: var(--accent-neutral-bg);
    color: var(--accent-neutral);
}

.section-header.ignore .section-icon {
    background: var(--accent-ignore-bg);
    color: var(--accent-ignore);
}

.section-label {
    flex: 1;
}

.section-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--secondary);
    display: block;
}

.section-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.section-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition-base);
}

.results-section[data-collapsed="true"] .section-toggle {
    transform: rotate(-90deg);
}

.results-section[data-collapsed="true"] .section-items {
    display: none;
}

/* Section Items */
.section-items {
    padding: 8px;
}

.result-item {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
    border-left: 3px solid transparent;
    transition: all var(--transition-base);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item.priority { border-left-color: var(--accent-success); }
.result-item.neutral { border-left-color: var(--accent-neutral); }
.result-item.ignore { 
    border-left-color: var(--accent-ignore);
    opacity: 0.8;
}

.item-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
}

.item-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.result-item.priority .item-indicator { background: var(--accent-success); }
.result-item.neutral .item-indicator { background: var(--accent-neutral); }
.result-item.ignore .item-indicator { background: var(--accent-ignore); }

.item-content {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--secondary);
    line-height: 1.4;
    display: block;
    margin-bottom: 6px;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-hours {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.item-hours svg {
    width: 14px;
    height: 14px;
}

.item-confidence {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-white);
}

.result-item.priority .item-confidence { color: var(--accent-success); }
.result-item.neutral .item-confidence { color: var(--accent-neutral); }
.result-item.ignore .item-confidence { color: var(--accent-ignore); }

.item-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.item-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.result-item[data-expanded="true"] .item-toggle {
    transform: rotate(180deg);
}

/* Item Details (Expandable) */
.item-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
    background: var(--bg-white);
}

.result-item[data-expanded="true"] .item-details {
    max-height: 500px;
}

.detail-row {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.detail-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.detail-value {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.6;
}

.detail-tags {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    background: var(--bg-light);
    color: var(--text-light);
    border-radius: 4px;
}

/* Empty State in Section */
.section-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================
   RESPONSIVE STYLES
   ========================================== */

@media (max-width: 968px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 24px 20px;
        padding-top: 88px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .history-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 16px;
        padding-top: 80px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 24px 0;
    }
    
    .analysis-form {
        padding: 24px;
    }
    
    .card-footer {
        padding: 16px 24px;
    }
    
    .drop-zone {
        padding: 32px 16px;
    }
    
    .history-card {
        padding: 20px;
    }
    
    .history-stats {
        gap: 16px;
    }
    
    /* Results View Mobile */
    .results-header {
        padding: 12px 16px;
    }
    
    .back-btn {
        width: 40px;
        height: 40px;
    }
    
    .results-header-content h1 {
        font-size: 1.1rem;
    }
    
    .results-body {
        padding: 16px;
    }
    
    .results-section {
        margin-bottom: 12px;
    }
    
    .section-header {
        padding: 14px;
    }
    
    .section-icon {
        width: 36px;
        height: 36px;
    }
    
    .section-name {
        font-size: 0.95rem;
    }
    
    .section-items {
        padding: 6px;
    }
    
    .result-item {
        margin-bottom: 6px;
    }
    
    .item-main {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .item-name {
        font-size: 0.9rem;
    }
    
    .item-toggle {
        width: 28px;
        height: 28px;
    }
}