/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.navbar-brand h1 span {
    font-size: 0.7em;
    font-weight: normal;
    opacity: 0.8;
    margin: 0 0.2em;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.navbar-item {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar-item:hover,
.navbar-item.active {
    background-color: #34495e;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header h3 {
    margin: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Health Status */
.health-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.health-item:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: #666;
}

.status {
    font-size: 0.9rem;
}

.status-ok {
    color: #27ae60;
}

.status-warning {
    color: #f39c12;
}

.status-error {
    color: #e74c3c;
}

.status-running {
    color: #3498db;
}

.status-completed {
    color: #27ae60;
}

.status-failed {
    color: #e74c3c;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-item h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-numbers {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-success {
    color: #27ae60;
}

.stat-error {
    color: #e74c3c;
}

.stat-skipped {
    color: #95a5a6;
}

.stat-runs {
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #666;
}

.data-table tr:hover {
    background-color: #f8f9fa;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #666;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.alert-success {
    background-color: #efe;
    border: 1px solid #cfc;
    color: #363;
}

/* Log Viewer */
.log-filters {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.log-entries {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    max-height: 600px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #eee;
}

.log-timestamp {
    color: #7f8c8d;
    margin-right: 0.5rem;
}

.log-level {
    font-weight: bold;
    margin-right: 0.5rem;
}

.log-debug .log-level {
    color: #95a5a6;
}

.log-info .log-level {
    color: #3498db;
}

.log-warning .log-level {
    color: #f39c12;
}

.log-error .log-level {
    color: #e74c3c;
}

/* Footer */
.footer {
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer a {
    color: #3498db;
    text-decoration: none;
}

.footer a:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* Utility Classes */
.text-muted {
    color: #7f8c8d;
}

.text-center {
    text-align: center;
}

.text-warning {
    color: #f39c12;
    font-weight: bold;
}

/* Running Items */
.running-items {
    list-style: none;
}

.running-items li {
    padding: 0.5rem;
    border-left: 3px solid #3498db;
    margin-bottom: 0.5rem;
    background: #ecf0f1;
}

/* Legend */
.legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Error Messages in Table */
.error-message {
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 0.25rem;
}

.error-message small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* Tooltip styling */
[title] {
    cursor: help;
}

/* Sync Control Panel */
.sync-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.sync-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.sync-form {
    display: inline-block;
}

.btn-large {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
}

.btn-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.advanced-sync-form {
    margin-bottom: 2rem;
}

.advanced-sync-form h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.advanced-sync-form hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid #ddd;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    transition: width 0.3s ease;
}

/* Status badges */
.status-pending {
    color: #f39c12;
}

.status-running {
    color: #3498db;
    font-weight: bold;
}

.status-cancelled {
    color: #95a5a6;
}

/* Small buttons */
.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-info {
    background-color: #3498db;
    color: white;
}

.btn-info:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.text-error {
    color: #e74c3c;
    font-size: 0.875rem;
}

/* Workflow Guide */
.workflow-guide {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
}

.workflow-guide ol {
    margin: 0 0 1rem 1.5rem;
    padding: 0;
}

.workflow-guide li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .log-filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}