/* ============================================
   APPROUVED - Interface Utilisateur
   Thème Violet #5812d0
   ============================================ */

:root {
    /* Couleurs principales */
    --primary: #5812d0;
    --primary-light: #7c3aed;
    --primary-dark: #4c1d95;
    --primary-50: #f5f3ff;
    --primary-100: #ede9fe;
    --primary-200: #ddd6fe;
    --primary-300: #c4b5fd;
    --primary-400: #a78bfa;
    --primary-500: #8b5cf6;
    --primary-600: #5812d0;
    --primary-700: #6d28d9;
    --primary-800: #5b21b6;
    --primary-900: #4c1d95;

    /* Couleurs complémentaires */
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;

    /* Neutres */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-primary: 0 4px 14px 0 rgba(88, 18, 208, 0.39);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--primary-50) 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ============================================
   Layout
   ============================================ */

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo svg {
    width: 40px;
    height: 40px;
}

.sidebar-logo .logo-img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: contain;
    background: white;
    padding: 4px;
}

.sidebar-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    padding: 0 1rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

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

/* Sidebar Footer - User Info */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-societe {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: capitalize;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

/* Header */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 1rem;
}

/* Pages - Hidden by default, shown when active */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.card-body {
    padding: 1.5rem;
    position: relative;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
}

/* Section Header */
.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

/* Grid */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.quick-actions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.quick-actions-grid .btn {
    flex: 1 1 200px;
    max-width: 300px;
}

@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ============================================
   Forms
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-label-required::after {
    content: '*';
    color: var(--error);
    margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: white;
    color: var(--gray-900);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--gray-300);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 18, 208, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 0.375rem;
}

/* File Upload */
.file-upload {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--gray-50);
}

.file-upload:hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.file-upload.dragover {
    border-color: var(--primary);
    background: var(--primary-100);
}

.file-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: -1;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--primary);
}

.file-upload-text {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.file-upload-text strong {
    color: var(--primary);
}

.file-upload-hint {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--primary-50);
    border-radius: var(--radius);
    margin-top: 1rem;
}

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

.file-preview-info {
    flex: 1;
}

.file-preview-name {
    font-weight: 600;
    color: var(--gray-900);
}

.file-preview-size {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.file-preview-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.file-preview-remove:hover {
    background: var(--error-light);
    color: var(--error);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn svg {
    width: 18px;
    height: 18px;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

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

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 0.75rem;
}

/* ============================================
   Tables
   ============================================ */

.table-container {
    overflow-x: auto;
    width: 100%;
}

.content-section {
    width: 100%;
}

.table,
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td,
.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.table th,
.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
}

.table td,
.data-table td {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.table tbody tr,
.data-table tbody tr {
    transition: background var(--transition-fast);
}

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

.table-empty {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}

/* Document name with tooltip */
.document-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.document-name svg {
    flex-shrink: 0;
    color: var(--gray-400);
}

.filename-tooltip {
    position: relative;
    cursor: pointer;
}

.filename-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--gray-800);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.813rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filename-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Badges & Tags
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Auth Info Display */
.auth-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.auth-info .auth-name {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-info small {
    font-size: 0.75rem;
}

.doc-name {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.doc-name strong {
    word-break: break-word;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group .form-label {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.filter-group .form-input {
    width: 100%;
}

/* ============================================
   Alerts & Notifications
   ============================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-message {
    font-size: 0.875rem;
    opacity: 0.9;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-error {
    background: var(--error-light);
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
}

.alert-info {
    background: var(--primary-100);
    color: var(--primary-dark);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn var(--transition-normal) ease-out;
    min-width: 300px;
    max-width: 400px;
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-success svg { color: var(--success); }
.toast-error svg { color: var(--error); }
.toast-warning svg { color: var(--warning); }
.toast-info svg { color: var(--primary); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.875rem;
}

.toast-message {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Modals
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-lg {
    max-width: 800px;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-title svg {
    color: var(--primary);
}

/* ============================================
   Search Box
   ============================================ */

.search-box {
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    padding-left: 2.75rem !important;
    padding-right: 2.5rem !important;
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* ============================================
   Toggle Switch
   ============================================ */

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: var(--transition-fast);
    border-radius: 24px;
}

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

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

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

.toggle-label {
    color: var(--gray-700);
    font-size: 0.875rem;
}

/* ============================================
   User/Admin Info Display
   ============================================ */

.user-info,
.admin-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-info strong,
.admin-info strong {
    font-weight: 600;
    color: var(--gray-900);
}

.user-info small,
.admin-info small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ============================================
   Stats Cards
   ============================================ */

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

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

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon-primary {
    background: var(--primary-100);
    color: var(--primary);
}

.stat-icon-success {
    background: var(--success-light);
    color: var(--success);
}

.stat-icon-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-icon-accent {
    background: #cffafe;
    color: var(--accent);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ============================================
   Loading States
   ============================================ */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 0%, var(--gray-100) 50%, var(--gray-200) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Verification Result
   ============================================ */

.verification-result {
    text-align: center;
    padding: 2rem;
}

.verification-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verification-icon svg {
    width: 40px;
    height: 40px;
}

.verification-success .verification-icon {
    background: var(--success-light);
    color: var(--success);
}

.verification-error .verification-icon {
    background: var(--error-light);
    color: var(--error);
}

.verification-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.verification-success .verification-title {
    color: var(--success);
}

.verification-error .verification-title {
    color: var(--error);
}

.verification-message {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.verification-details {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: left;
}

.verification-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.verification-detail-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.verification-detail-value {
    color: var(--gray-600);
    font-size: 0.875rem;
    word-break: break-all;
    max-width: 60%;
    text-align: right;
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    color: var(--gray-300);
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state-message {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Tabs
   ============================================ */

.tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ============================================
   Hash Display
   ============================================ */

.hash-display {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    background: var(--gray-100);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    word-break: break-all;
    color: var(--gray-700);
}

.hash-display-label {
    display: block;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    font-family: 'Inter', sans-serif;
}

/* ============================================
   Responsive Sidebar Toggle
   ============================================ */

.sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 101;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }
}

/* ============================================
   Utilities
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-muted { color: var(--gray-500); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

.hidden { display: none; }
.relative { position: relative; }

/* ============================================
   Batch Operations / Progress Bar
   ============================================ */

.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    min-width: 60px;
    text-align: right;
}

/* Batch Summary */
.batch-summary {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.batch-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.batch-stat {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-sm);
}

.batch-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.batch-stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.batch-stat-total .batch-stat-value { color: var(--gray-700); }
.batch-stat-success .batch-stat-value { color: var(--success); }
.batch-stat-warning .batch-stat-value { color: var(--warning); }
.batch-stat-error .batch-stat-value { color: var(--error); }

/* Batch Results List */
.batch-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.batch-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
}

.batch-result-item:hover {
    box-shadow: var(--shadow-sm);
}

.batch-result-authentic {
    border-left: 3px solid var(--success);
}

.batch-result-invalid {
    border-left: 3px solid var(--warning);
}

.batch-result-not_found,
.batch-result-error {
    border-left: 3px solid var(--error);
}

.batch-result-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-result-authentic .batch-result-icon { color: var(--success); }
.batch-result-invalid .batch-result-icon { color: var(--warning); }
.batch-result-not_found .batch-result-icon,
.batch-result-error .batch-result-icon { color: var(--error); }

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

.batch-result-filename {
    font-weight: 500;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.batch-result-message {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

.batch-result-hash {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-family: monospace;
    margin-top: 0.25rem;
}

.batch-result-status {
    flex-shrink: 0;
}

/* Responsive batch stats */
@media (max-width: 640px) {
    .batch-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .batch-result-item {
        flex-wrap: wrap;
    }

    .batch-result-status {
        width: 100%;
        margin-top: 0.5rem;
        padding-left: 48px;
    }
}

/* ============================================
   PENDING APPROVAL STYLES
   ============================================ */

.row-pending {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.05) 0%, transparent 100%);
}

.row-pending:hover {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, var(--gray-50) 100%);
}

.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--primary);
    text-decoration: none;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.doc-link:hover {
    background: var(--primary-100);
    color: var(--primary-dark);
}

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

.btn-success:hover {
    background: #059669;
}

/* ============================================
   AI Title Generation Button
   ============================================ */

.input-with-button {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-with-button .form-input {
    flex: 1;
    min-width: 0;
}

.btn-generate-title {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-generate-title svg {
    color: var(--primary);
}

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

.btn-generate-title:disabled svg {
    color: var(--gray-400);
}

.btn-generate-title .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

@media (max-width: 640px) {
    .input-with-button {
        flex-direction: column;
    }

    .btn-generate-title {
        width: 100%;
        justify-content: center;
    }

    .btn-generate-title .btn-text {
        display: inline;
    }
}
