* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.accepted .stat-value { color: #fbbf24; }
.stat-card.pending .stat-value { color: #60a5fa; }
.stat-card.in-progress .stat-value { color: #a78bfa; }
.stat-card.succeeded .stat-value { color: #34d399; }
.stat-card.failed .stat-value { color: #f87171; }

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #374151;
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

.refresh-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: #5568d3;
}

.tasks-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tasks-section h2 {
    margin-bottom: 20px;
    color: #1f2937;
}

#tasks-container {
    display: grid;
    gap: 20px;
}

.task-card {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.task-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.task-id {
    font-weight: 600;
    color: #374151;
    font-family: 'Courier New', monospace;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-accepted {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.status-pending {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.status-in-progress {
    background: #ede9fe;
    color: #5b21b6;
}

.status-badge.status-succeeded {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.task-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.task-info {
    font-size: 0.95rem;
}

.task-info strong {
    color: #374151;
    display: block;
    margin-bottom: 4px;
}

.task-footer {
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.task-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.875rem;
    color: #6b7280;
}

.task-dates strong {
    color: #374151;
}

.error-message {
    margin-top: 10px;
    padding: 10px;
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 4px;
    color: #991b1b;
    font-size: 0.9rem;
}

.loading,
.no-tasks {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .task-body {
        grid-template-columns: 1fr;
    }
    
    .task-dates {
        flex-direction: column;
        gap: 8px;
    }
}

/* Navigation Link */
.nav-link {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Lawyer Selection Styles */
.lawyer-selection {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lawyer-selection h2 {
    margin-bottom: 20px;
    color: #1f2937;
}

.lawyer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.lawyer-card {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.lawyer-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.lawyer-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
}

.lawyer-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #6b7280;
}

.stat-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.stat-badge.unread {
    background: #dbeafe;
    color: #1e40af;
}

.stat-badge.read {
    background: #d1fae5;
    color: #065f46;
}

.back-btn {
    padding: 10px 20px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #4b5563;
}

/* UGE Notifications Styles */
.uge-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.uge-stat {
    font-size: 1rem;
    color: #374151;
}

.uge-stat strong {
    color: #667eea;
    font-size: 1.2rem;
    margin-left: 5px;
}

#uge-notifications-container {
    display: grid;
    gap: 20px;
}

.documents-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.documents-section strong {
    display: block;
    margin-bottom: 10px;
    color: #374151;
    font-size: 1rem;
}

.document-item {
    margin: 8px 0;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: background 0.2s, border-color 0.2s;
}

.document-item:hover {
    background: #f3f4f6;
    border-color: #667eea;
}

.download-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.download-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

.no-documents {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-style: italic;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px dashed #e5e7eb;
}

.tasks-section + .tasks-section {
    margin-top: 30px;
}

/* Retrieval Action Buttons */
.retrieval-actions {
    margin-top: 15px;
}

.retrieval-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.retrieval-btn:not(.processing):not(:disabled) {
    background: #667eea;
    color: white;
}

.retrieval-btn:not(.processing):not(:disabled):hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.retrieval-btn.unread-retrieval {
    background: #f59e0b;
    color: white;
}

.retrieval-btn.unread-retrieval:hover {
    background: #d97706;
}

.retrieval-btn.processing {
    background: #e5e7eb;
    color: #6b7280;
    cursor: not-allowed;
}

.warning-text {
    margin-top: 10px;
    padding: 10px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    color: #92400e;
    font-size: 0.9rem;
    font-weight: 500;
}