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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 15px;
    font-size: 28px;
}

header h1 i {
    margin-right: 10px;
}

nav {
    display: flex;
    gap: 15px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

nav a:hover, nav a.active {
    background: rgba(255,255,255,0.2);
}

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

.section.active {
    display: block;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid #667eea;
}

.stat-card.success {
    border-left-color: #10b981;
}

.stat-card.error {
    border-left-color: #ef4444;
}

.stat-card.warning {
    border-left-color: #f59e0b;
}

.stat-card.info {
    border-left-color: #3b82f6;
}

.stat-icon {
    font-size: 32px;
    color: #667eea;
}

.stat-card.success .stat-icon {
    color: #10b981;
}

.stat-card.error .stat-icon {
    color: #ef4444;
}

.stat-card.warning .stat-icon {
    color: #f59e0b;
}

.stat-card.info .stat-icon {
    color: #3b82f6;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select, .filters input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

.projects-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    font-weight: 600;
    color: #374151;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

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

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

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

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

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

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

.btn-secondary {
    background: #6b7280;
    color: white;
}

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.logs-container {
    max-height: 500px;
    overflow-y: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.log-entry {
    margin-bottom: 5px;
    padding: 5px;
    border-left: 3px solid transparent;
}

.log-entry.info {
    border-left-color: #3b82f6;
}

.log-entry.error {
    border-left-color: #ef4444;
    color: #fca5a5;
}

.log-entry.warning {
    border-left-color: #f59e0b;
    color: #fcd34d;
}

.log-entry.debug {
    border-left-color: #6b7280;
    color: #9ca3af;
}

.log-timestamp {
    color: #9ca3af;
    margin-right: 10px;
}

.steps-timeline {
    margin-top: 20px;
}

.step-item {
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #ddd;
    background: #f9fafb;
    border-radius: 5px;
}

.step-item.completed {
    border-left-color: #10b981;
    background: #ecfdf5;
}

.step-item.running {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.step-item.failed {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.step-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.step-time {
    font-size: 12px;
    color: #6b7280;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.loading i {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

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

.analysis-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.analysis-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    background: #ef4444;
    color: white;
    margin-left: 5px;
}

.tab-btn.active .badge {
    background: #667eea;
}

.analysis-content {
    background: white;
    border-radius: 5px;
    padding: 20px;
    min-height: 200px;
}

.analysis-entries {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.analysis-entry {
    padding: 15px;
    border-left: 4px solid #ddd;
    border-radius: 5px;
    background: #f9fafb;
}

.analysis-entry.critical {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.analysis-entry.error {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.analysis-entry.warning {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.analysis-entry.info {
    border-left-color: #10b981;
    background: #ecfdf5;
}

.entry-header {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.entry-timestamp {
    font-weight: 600;
    color: #374151;
}

.entry-pattern {
    padding: 3px 10px;
    border-radius: 12px;
    background: #667eea;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.entry-client {
    padding: 3px 10px;
    border-radius: 12px;
    background: #6b7280;
    color: white;
    font-size: 12px;
    font-family: monospace;
}

.entry-message {
    color: #374151;
    margin-bottom: 8px;
    line-height: 1.5;
}

.entry-uri {
    color: #6b7280;
    font-size: 13px;
    margin-top: 8px;
    font-family: monospace;
}

.entry-uri i {
    margin-right: 5px;
    color: #667eea;
}

.entry-details {
    margin-top: 10px;
}

.entry-details summary {
    cursor: pointer;
    color: #667eea;
    font-size: 13px;
    user-select: none;
}

.entry-details summary:hover {
    text-decoration: underline;
}

.entry-details pre {
    margin-top: 10px;
    padding: 10px;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 5px;
    font-size: 11px;
    overflow-x: auto;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-style: italic;
}

/* Configuration Management */
.config-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.config-tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.config-tab-btn:hover {
    color: #667eea;
}

.config-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.config-tab-content {
    display: none;
}

.config-tab-content.active {
    display: block;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.config-header h3 {
    margin: 0;
}

.config-list {
    margin-top: 20px;
}

.config-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.config-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.config-item-header h4 {
    margin: 0;
    color: #374151;
    font-size: 18px;
}

.config-item-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.config-item-body {
    color: #6b7280;
    font-size: 14px;
}

.config-item-body p {
    margin: 8px 0;
}

.config-item-body code {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    color: #667eea;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1001;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content {
    padding: 0;
}

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

.modal-header h3 {
    margin: 0;
    color: #374151;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal form {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

