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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.8em;
    margin: 0;
}

.user-info {
    margin-right: 20px;
    font-weight: 500;
}

/* Login Section */
.login-section {
    max-width: 500px;
    margin: 50px auto;
    padding: 20px;
}

.tabs-login {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}

.tab-login-btn {
    flex: 1;
    padding: 12px;
    background: #e0e0e0;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-login-btn:first-child {
    border-radius: 5px 0 0 0;
}

.tab-login-btn:last-child {
    border-radius: 0 5px 0 0;
}

.tab-login-btn.active {
    background: white;
    color: #667eea;
}

/* Card */
.card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

.card-header h2 {
    margin: 0;
}

/* Tabs */
.tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    padding: 20px;
    background: white;
    margin: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tab-btn {
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #5568d3;
}

.tab-icon {
    font-size: 1.5em;
}

.tab-content {
    display: none;
    padding: 0 20px 20px 20px;
}

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

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: #27ae60;
    color: white;
}

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

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

.btn-warning:hover {
    background: #e67e22;
}

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

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

.btn-small {
    padding: 8px 16px;
    font-size: 12px;
}

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

/* Status Box */
.status-box {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-connected {
    background: #d4edda;
    border: 2px solid #27ae60;
    color: #155724;
}

.status-disconnected {
    background: #f8d7da;
    border: 2px solid #e74c3c;
    color: #721c24;
}

.status-info {
    background: #d1ecf1;
    border: 2px solid #17a2b8;
    color: #0c5460;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

table tr:hover {
    background: #f8f9fa;
}

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

.badge-running {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-completed {
    background: #d4edda;
    color: #155724;
}

.badge-paused {
    background: #fff3cd;
    color: #856404;
}

.badge-draft {
    background: #e0e0e0;
    color: #666;
}

.badge-failed {
    background: #f8d7da;
    color: #721c24;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

/* Info Box */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196f3;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box pre {
    background: white;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 10px;
}

/* Search Box */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card h3 {
    font-size: 2em;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card p {
    color: #666;
    font-size: 0.9em;
}

/* Messages */
.error {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 5px;
    margin-top: 10px;
}

.success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 12px;
    border-radius: 5px;
    margin-top: 10px;
}

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

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.status-loading {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 10px;
    }

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

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

    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
