* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* --- Auth --- */
#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#login-container button {
    padding: 12px 32px;
    font-size: 16px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#login-container button:hover {
    background: #0052a3;
}

/* --- Layout --- */
#app {
    display: none;
}

header {
    background: #1a1a2e;
    color: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
}

header button {
    background: transparent;
    color: #ccc;
    border: 1px solid #555;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

header button:hover {
    color: white;
    border-color: #999;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #e0e0e0;
    padding: 0 24px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    color: #666;
}

.tab:hover {
    color: #333;
}

.tab.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
    font-weight: 600;
}

/* --- Content --- */
.content {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* --- Cards --- */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-bottom: 12px;
    font-size: 16px;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

th {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    height: 80px;
    font-family: monospace;
}

/* --- Buttons --- */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* --- Toolbar --- */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* --- Status badge --- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

/* --- Log viewer --- */
.log-viewer {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.6;
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 8px;
    padding: 24px;
    width: 480px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    margin-bottom: 16px;
    font-size: 18px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* --- Loading --- */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
