:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #111827;
    --bg-card: #1f2937;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #374151;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

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

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover { color: var(--text-main); }
nav a.active { color: var(--primary); }

.status-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
}

.status-item {
    font-size: 0.9em;
    color: var(--text-muted);
}

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

.card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: var(--text-muted);
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
}

.card.error .stat-value {
    color: var(--error);
}

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

.section-header h2 {
    margin: 0;
}

.recent-activity {
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-muted);
}

td {
    font-size: 0.9em;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-muted);
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.85em;
}

/* Forms */
.config-section {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.config-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9em;
}

input {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: white;
    box-sizing: border-box;
    font-size: 0.95em;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.9em;
}

.message.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.message.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
}

.status-badge.ok { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.status-badge.unknown { background: rgba(156, 163, 175, 0.2); color: var(--text-muted); }

.text-error { color: var(--error); }

/* Config grid */
.config-grid {
    display: grid;
    gap: 10px;
}

.config-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
}

.config-item strong {
    color: var(--text-muted);
    min-width: 180px;
}

/* Reports */
.reports-section {
    margin-bottom: 30px;
}

.report-detail {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.report-detail pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85em;
    color: var(--text-main);
    max-height: 500px;
    overflow-y: auto;
}

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

    .status-bar {
        flex-direction: column;
        gap: 8px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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