/* ═══════════════════════════════════════════════════════
   🦐 STOMATOPODA DASHBOARD STYLES
   ═══════════════════════════════════════════════════════ */

:root {
    --primary: #1e40af;
    --secondary: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #111827;
    --light: #f3f4f6;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

.hidden {
    display: none !important;
}

/* Loading Screen */
#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: white;
    font-size: 1.5rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Main App */
#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header */
header {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-actions button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.header-actions button:hover {
    background: #1e3a8a;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Filters */
.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid white;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.filter-btn.active {
    background: white;
    color: var(--primary);
}

/* Documents List */
.documents-list {
    display: grid;
    gap: 1.5rem;
}

.document-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 300px 1fr;
    transition: transform 0.3s;
}

.document-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.document-image {
    position: relative;
}

.document-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.confidence-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
}

.confidence-high {
    background: var(--success);
    color: white;
}

.confidence-medium {
    background: var(--warning);
    color: white;
}

.confidence-low {
    background: var(--danger);
    color: white;
}

.document-info {
    padding: 1.5rem;
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.document-type {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

.document-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.extracted-data {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    max-height: 250px;
    overflow-y: auto;
}

.document-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--warning);
    color: white;
}

.btn-approve {
    background: var(--success);
    color: white;
}

.btn-reject {
    background: var(--danger);
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .document-card {
        grid-template-columns: 1fr;
    }
    
    .document-image img {
        height: 250px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
  }

/* ═══════════════════════════════════════════════════════
   🌙 DARK MODE
   ═══════════════════════════════════════════════════════ */

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .stat-card,
body.dark-mode .document-card,
body.dark-mode header {
    background: #1e1e2e;
    color: #e0e0e0;
}

body.dark-mode .stat-info h3,
body.dark-mode .document-type {
    color: #7c3aed;
}

body.dark-mode .extracted-data {
    background: #2a2a3e;
    color: #e0e0e0;
   }
/* ═══════════════════════════════════════════════════════
   ✏️ EDIT MODAL
   ═══════════════════════════════════════════════════════ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.5rem;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

#editFields {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════
   📊 FLOATING REPORT BUTTON
   ═══════════════════════════════════════════════════════ */

.floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    z-index: 999;
}

.floating-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.floating-btn:active {
    transform: scale(0.95);
}

/* Dark mode adjustments */
body.dark-mode .modal-content {
    background: #1e1e2e;
    color: #e0e0e0;
}

body.dark-mode .form-group label {
    color: #e0e0e0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background: #2a2a3e;
    border-color: #3a3a4e;
    color: #e0e0e0;
}

body.dark-mode .modal-header {
    border-bottom-color: #3a3a4e;
   }



