/* ==========================================================================
   Générateur d'images IA - Alsace Terrasse
   ========================================================================== */

/* --- Variables & Reset --- */
:root {
    --primary: #cc0b1e;
    --primary-hover: #a80918;
    --primary-light: rgba(204, 11, 30, 0.1);
    --bg: #ffffff;
    --bg-secondary: #f5f5f5;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --green: #10b981;
    --green-light: #d1fae5;
    --blue: #3b82f6;
    --blue-light: #dbeafe;
    --red: #ef4444;
    --red-light: #fef2f2;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* ==========================================================================
   Header
   ========================================================================== */
header {
    background: var(--bg);
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.header-brand img {
    height: 40px;
    width: auto;
}

.header-brand h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.header-brand .badge-count {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-sub);
    font-size: 0.875rem;
}

.header-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
}

.tabs-left {
    display: flex;
    gap: 24px;
}

.tab {
    padding: 10px 0;
    cursor: pointer;
    color: var(--text-sub);
    border-bottom: 3px solid transparent;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Version Badge */
.version-badge {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s ease;
}

.version-badge:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

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

.btn-validate {
    background: var(--green-light);
    color: var(--green);
    border: 1px solid #a7f3d0;
}

.btn-validate:hover {
    background: #bbf7d0;
}

.btn-reject {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid #fecaca;
}

.btn-reject:hover {
    background: #fee2e2;
}

.btn-archive {
    background: var(--bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-archive:hover {
    background: var(--border);
}

.btn-admin {
    background: var(--text-main);
    color: white;
}

.btn-admin:hover {
    background: #374151;
}

.btn-logout {
    background: transparent;
    color: var(--text-sub);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-logout:hover {
    background: var(--bg-secondary);
    color: var(--text-main);
}

.btn-delete {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
    padding: 0.4rem 0.6rem;
    min-width: auto;
    flex: 0 !important;
}

.btn-delete:hover {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red);
}

.btn-download {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
    padding: 0.4rem 0.6rem;
    min-width: auto;
    flex: 0 !important;
    text-decoration: none;
}

.btn-download:hover {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue);
}

/* ==========================================================================
   Header Stats (Rate Limits + Storage)
   ========================================================================== */
.header-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

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

.stat-value.stat-danger {
    color: var(--red);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-sub);
}

/* Storage Indicator */
.storage-indicator {
    gap: 10px;
}

.storage-bar {
    width: 80px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.storage-fill.warning {
    background: #f59e0b;
}

.storage-fill.danger {
    background: var(--red);
}

.storage-text {
    font-size: 0.75rem;
    color: var(--text-sub);
    white-space: nowrap;
}

/* ==========================================================================
   Main Content
   ========================================================================== */
main {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

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

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-id {
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.85rem;
}

.card-select {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Status Badges */
.status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-processing {
    background: var(--blue-light);
    color: #1e40af;
}

.status-done {
    background: var(--green-light);
    color: #065f46;
}

.status-validated {
    background: #ecfdf5;
    color: var(--green);
    border: 1px solid var(--green);
}

.status-rejected {
    background: var(--red-light);
    color: var(--red);
}

.status-archived {
    background: var(--bg-secondary);
    color: var(--text-sub);
    border: 1px solid var(--border);
}

/* Images Row */
.images-row {
    display: flex;
    height: 220px;
}

.img-box {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-box:first-child {
    border-right: 1px solid var(--border-light);
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.img-box img:hover {
    transform: scale(1.03);
}

.img-label {
    position: absolute;
    bottom: 0;
    left: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Actions */
.card-actions {
    padding: 0.875rem 1rem;
    display: flex;
    gap: 10px;
    margin-top: auto;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
}

.card-actions .btn {
    flex: 1;
}

/* ==========================================================================
   Loader
   ========================================================================== */
.loader {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: var(--text-sub);
    font-size: 0.8rem;
    margin-top: 8px;
}

/* ==========================================================================
   Bulk Actions Bar
   ========================================================================== */
.bulk-actions {
    background: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
    display: none;
    position: sticky;
    top: 73px;
    z-index: 99;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
}

.bulk-actions.visible {
    display: flex;
}

.bulk-count {
    font-weight: 600;
}

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

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

.bulk-actions .btn-reject {
    background: white;
    color: var(--red);
    border: none;
}

.bulk-actions .btn-reject:hover {
    background: var(--red-light);
}

.bulk-actions .btn-validate {
    background: white;
    color: var(--green);
    border: none;
}

.bulk-actions .btn-validate:hover {
    background: var(--green-light);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

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

.modal-content {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-sub);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-main);
}

/* ==========================================================================
   Upload Zone
   ========================================================================== */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

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

.drop-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.drop-zone-text {
    color: var(--text-sub);
    font-size: 0.9rem;
}

.drop-zone-hint {
    color: var(--text-sub);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Upload Preview */
.upload-preview {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.upload-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview-item .remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.upload-preview-item:hover .remove {
    opacity: 1;
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-top: 0.5rem;
    text-align: center;
}

.upload-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-sub);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 300;
    flex-direction: column;
}

.lightbox.visible {
    display: flex;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.5);
    color: white;
}

.lightbox-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lightbox-counter {
    font-size: 0.9rem;
    opacity: 0.8;
}

.lightbox-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.lightbox-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Slider Comparison */
.comparison-container {
    position: relative;
    width: 80%;
    max-width: 1200px;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.comparison-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
}

.comparison-image.after {
    clip-path: inset(0 0 0 50%);
}

.comparison-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: white;
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 10;
}

.comparison-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.comparison-slider::after {
    content: '\2194';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: var(--text-main);
}

.comparison-label {
    position: absolute;
    bottom: 1rem;
    padding: 6px 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
}

.comparison-label.before {
    left: 1rem;
}

.comparison-label.after {
    right: 1rem;
}

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-nav.prev {
    left: 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.lightbox-nav.next {
    right: 1rem;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Lightbox Actions */
.lightbox-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0,0,0,0.5);
}

.lightbox-footer .btn {
    min-width: 140px;
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, #e5e5e5 100%);
}

.login-box {
    background: var(--bg);
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    width: 420px;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    max-width: 180px;
    margin-bottom: 1.5rem;
}

.login-title {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-main);
}

.login-subtitle {
    color: var(--text-sub);
    margin: 0 0 2rem 0;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn img {
    width: 20px;
    height: 20px;
}

.login-error {
    background: var(--red-light);
    color: var(--red);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-size: 0.875rem;
}

.login-pending {
    background: #fef3c7;
    color: #92400e;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   Admin Panel
   ========================================================================== */
.admin-section {
    margin-top: 1.5rem;
}

.admin-section h3 {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.user-item:last-child {
    border-bottom: none;
}

.user-email {
    font-size: 0.875rem;
}

.user-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--primary-light);
    color: var(--primary);
    margin-left: 8px;
}

.user-remove {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    opacity: 0.6;
}

.user-remove:hover {
    opacity: 1;
}

.add-user-form {
    display: flex;
    gap: 8px;
    margin-top: 0.75rem;
}

.add-user-form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

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

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-sub);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    color: var(--text-main);
    margin: 0 0 0.5rem 0;
}

.empty-state-text {
    margin: 0 0 1.5rem 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    header {
        padding: 0 1rem;
    }

    main {
        padding: 1rem;
    }

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

    .header-brand h1 {
        font-size: 0.95rem;
    }

    .header-user span {
        display: none;
    }

    .comparison-container {
        width: 95%;
    }

    .lightbox-nav {
        padding: 0.5rem;
        font-size: 1.5rem;
    }

    .lightbox-footer {
        flex-direction: column;
        padding: 1rem;
    }

    .lightbox-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tabs {
        gap: 12px;
    }

    .tab {
        font-size: 0.8rem;
    }

    .images-row {
        height: 160px;
    }

    .modal-content {
        padding: 1.5rem;
    }
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 100px;
}

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

/* Prompt Textarea (larger) */
.prompt-textarea {
    width: 100%;
    min-height: 180px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-secondary);
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg);
}

/* Modal Large */
.modal-large {
    width: 600px;
}

/* ==========================================================================
   Changelog
   ========================================================================== */
.changelog {
    max-height: 400px;
    overflow-y: auto;
}

.changelog-version {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.changelog-version:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.changelog-version-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.75rem;
}

.changelog-version-number {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.changelog-version-date {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.changelog-list {
    margin: 0;
    padding-left: 1.25rem;
}

.changelog-list li {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.changelog-list li:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Reprocess Modal
   ========================================================================== */
.source-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.source-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.source-option:hover {
    background: var(--bg-secondary);
}

.source-option input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
}

.source-option input[type="radio"]:checked + .source-label {
    color: var(--primary);
    font-weight: 600;
}

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

.source-desc {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-left: auto;
}

.reprocess-actions {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
}

.reprocess-actions .btn {
    flex: 1;
}

/* ==========================================================================
   History Modal
   ========================================================================== */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

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

.history-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: transform 0.2s;
}

.history-item img:hover {
    transform: scale(1.05);
}

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

.history-date {
    font-size: 0.75rem;
    color: var(--text-sub);
    display: block;
    margin-bottom: 4px;
}

.history-prompt {
    font-size: 0.85rem;
    color: var(--text-main);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
