/* ========================================
   Admin Panel CSS - Lesson Generator
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header p {
    opacity: 0.9;
    font-size: 1rem;
}

.btn-back {
    position: absolute;
    top: 2rem;
    left: 2rem;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

/* Main Content */
main {
    padding: 2rem;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.card p {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

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

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

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-edit {
    background: #667eea;
    color: white;
}

.btn-edit:hover:not(:disabled) {
    background: #5a67d8;
}

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

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin-right: 0.3rem;
}

/* Stats Section */
.stats-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
}

.stats-section h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e5e7eb;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.3rem;
}

/* Upload Section */
.upload-section {
    max-width: 600px;
    margin: 0 auto;
}

/* Compact Upload Layout */
.upload-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.upload-left,
.upload-right {
    display: flex;
    flex-direction: column;
}

.drop-zone-compact {
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
}

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

.drop-zone-compact .drop-zone-icon i {
    color: #667eea;
}

.drop-zone-compact .drop-zone-text {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.drop-zone-compact .drop-zone-subtext {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.requirements-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.75rem;
    justify-content: center;
}

.requirements-inline span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.requirements-inline i {
    color: #667eea;
    font-size: 0.65rem;
}

/* File Card (replaces drop-zone when file selected) */
.file-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
}

.file-card-icon {
    font-size: 2rem;
    color: #059669;
    flex-shrink: 0;
}

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

.file-card-name {
    font-weight: 600;
    color: #065f46;
    font-size: 0.95rem;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-meta {
    font-size: 0.8rem;
    color: #047857;
    margin: 0;
}

.file-card .btn-small {
    flex-shrink: 0;
}

.settings-compact {
    padding: 1rem;
    margin-bottom: 0;
}

.settings-compact h3 {
    display: none;
}

.form-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.settings-compact .form-group {
    margin-bottom: 0.5rem;
}

.settings-compact .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.settings-compact .form-control {
    padding: 0.5rem;
    font-size: 0.9rem;
}

.settings-compact .form-help {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.checkbox-inline {
    margin-bottom: 0.75rem !important;
}

.checkbox-inline label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem !important;
    cursor: pointer;
}

.btn-block {
    width: 100%;
    display: block;
}

@media (max-width: 768px) {
    .upload-layout {
        grid-template-columns: 1fr;
    }
}

.drop-zone {
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9fafb;
    margin-bottom: 2rem;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #667eea;
    background: #ede9fe;
}

.drop-zone.has-file {
    border-color: #10b981;
    background: #d1fae5;
}

.drop-zone-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.drop-zone-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.drop-zone-subtext {
    color: #6b7280;
    margin-bottom: 1rem;
}

/* File Info */
.file-info {
    background: #ede9fe;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.file-info-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

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

/* Settings Panel */
.settings-panel {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.settings-panel h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

/* Progress Section */
.progress-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.progress-section h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.progress-bar-container {
    background: #e5e7eb;
    border-radius: 12px;
    height: 30px;
    overflow: hidden;
    position: relative;
}

.progress-bar-container.large {
    height: 40px;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.stage-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
    margin-top: 0.5rem;
}

.stage-details {
    color: #6b7280;
    margin-top: 0.3rem;
}

/* Progress Overview */
.progress-overview {
    background: #f9fafb;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Stages Container */
.stages-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stage-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
}

.stage-item.active {
    border-color: #667eea;
    background: #ede9fe;
    transform: scale(1.05);
}

.stage-item.completed {
    border-color: #10b981;
    background: #d1fae5;
}

.stage-item.failed {
    border-color: #ef4444;
    background: #fee2e2;
}

.stage-icon {
    font-size: 2rem;
}

.stage-info h4 {
    margin-bottom: 0.3rem;
    color: #374151;
}

.stage-info p {
    font-size: 0.85rem;
    color: #6b7280;
}

.stage-status {
    margin-left: auto;
    font-size: 1.5rem;
}

/* Log Container */
.log-container {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.log-container h3 {
    margin-bottom: 1rem;
    color: #667eea;
}

.log-entries {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.log-entry {
    padding: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #374151;
}

.log-entry:last-child {
    border-bottom: none;
}

/* Result Section */
.result-section {
    background: #d1fae5;
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.result-section h3 {
    color: #065f46;
    margin-bottom: 1rem;
}

.error-section {
    background: #fee2e2;
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.error-section h3 {
    color: #991b1b;
    margin-bottom: 1rem;
}

/* Actions */
.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Requirements */
.requirements {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.requirements h4 {
    color: #92400e;
    margin-bottom: 0.5rem;
}

.requirements ul {
    list-style-position: inside;
    color: #78350f;
}

.requirements li {
    padding: 0.3rem 0;
}

/* Filters */
.filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.filter-btn:hover {
    border-color: #667eea;
    background: #ede9fe;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.jobs-table thead {
    background: #f9fafb;
}

.jobs-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.jobs-table td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.jobs-table tr:hover {
    background: #f9fafb;
}

.job-id {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #667eea;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

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

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

.status-cancelled {
    background: #e5e7eb;
    color: #374151;
}

/* Type badges for job types */
.type-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.type-audio {
    background: #e0e7ff;
    color: #3730a3;
}

.type-translation {
    background: #fef3c7;
    color: #92400e;
}

.loading,
.error {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background: #f9fafb;
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Collections-specific styles */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.collection-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.collection-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.collection-card h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.collection-meta {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.collection-description {
    color: #374151;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.collection-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.collection-stat {
    font-size: 0.85rem;
    color: #6b7280;
}

.collection-stat.visibility {
    font-weight: 600;
}

.collection-stat.visibility.public {
    color: #10b981;
}

.collection-stat.visibility.private {
    color: #ef4444;
}

.collection-stat.visibility.unlisted {
    color: #f59e0b;
}

.collection-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.collection-id {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

.collection-creator {
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.collection-date {
    color: #9ca3af;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

/* Modal overlays */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Large modal with fixed header/footer */
.modal-large {
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* Modal Header - Fixed */
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-header h3 {
    color: #667eea;
    margin: 0;
    font-size: 1.5rem;
}

/* Modal Body - Scrollable */
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer - Fixed */
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid #e5e7eb;
    flex-shrink: 0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: #f9fafb;
}

.modal h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.modal p {
    color: #374151;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Form elements for modals */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* Tags input */
.tags-input {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.tags-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.tag .remove {
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
}

.tag .remove:hover {
    color: #ef4444;
}

.add-tag-input {
    flex: 1;
    min-width: 100px;
}

/* Lessons selection */
.lessons-selection {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    margin-top: 0.5rem;
    background: #f9fafb;
    overflow: hidden;
}

.lessons-selection-header {
    padding: 1rem;
    border-bottom: 2px solid #e5e7eb;
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.lessons-selection-header h4 {
    margin: 0 0 0.8rem 0;
    color: #374151;
    font-size: 1rem;
}

.lesson-search-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.lesson-search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Scrollable lessons list */
.lessons-list-wrapper {
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem;
}

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lesson-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.lesson-item:hover {
    background: #f9fafb;
    border-color: #667eea;
}

.lesson-item.selected {
    background: #e3f2fd;
    border-color: #667eea;
}

.lesson-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.lesson-item input[type="checkbox"] {
    cursor: pointer;
}

/* Selected lessons section */
.selected-lessons-section {
    padding: 1rem;
    border-top: 2px solid #e5e7eb;
    background: white;
}

.selected-lessons-section h4 {
    margin: 0 0 0.8rem 0;
    color: #374151;
    font-size: 1rem;
}

.selected-lessons-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 150px;
    overflow-y: auto;
}

.selected-lesson-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.lesson-order-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: bold;
    min-width: 28px;
    text-align: center;
}

.lesson-title {
    flex: 1;
    font-size: 0.9rem;
    color: #374151;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: none;
}

.alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #10b981;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

.alert.info {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #3b82f6;
}

.alert.active {
    display: block;
}

/* Filters section */
.filters-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group input,
.filter-group select {
    padding: 0.6rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

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

.filter-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.filter-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-stat i {
    color: #667eea;
}

.filter-stat strong {
    color: #374151;
}

/* Main actions */
.main-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* User management specific */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.user-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.user-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.user-role {
    background: #ede9fe;
    color: #667eea;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-details {
    color: #718096;
    margin-bottom: 1rem;
}

.user-meta {
    font-size: 0.85rem;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-user {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-edit {
    background: #dbeafe;
    color: #2563eb;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-delete:hover {
    background: #fecaca;
}

.user-form {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    display: none;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.no-users {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.no-users i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

/* Admin-only elements */
.admin-only {
    display: none;
}

.admin-only.show {
    display: block;
}

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

    .container {
        border-radius: 12px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .btn-back {
        position: static;
        display: block;
        margin-bottom: 1rem;
        text-align: center;
    }

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

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

    .jobs-table {
        font-size: 0.85rem;
    }

    .jobs-table th,
    .jobs-table td {
        padding: 0.5rem;
    }

    .collections-grid,
    .users-grid {
        grid-template-columns: 1fr;
    }

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

    .main-actions {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
    }
}
