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

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

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 30px;
}

header h1 a {
    color: #333;
    text-decoration: none;
    font-size: 1.5rem;
}

nav a {
    margin-left: 20px;
    color: #666;
    text-decoration: none;
}

nav a:hover { color: #000; }

h2 { margin-bottom: 20px; }

.form-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

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

.form-group textarea { resize: vertical; }
.form-group small { color: #888; }

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #666;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.btn:hover { background: #555; }
.btn.primary { background: #2563eb; }
.btn.primary:hover { background: #1d4ed8; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 5px 10px; font-size: 12px; }

.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-form input { flex: 1; }

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.info-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.info-box h3 { margin-bottom: 15px; }

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.tasks-table th,
.tasks-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tasks-table th {
    background: #f9f9f9;
    font-weight: 600;
}

.text-preview {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.queued { background: #fef3c7; color: #92400e; }
.status-badge.processing { background: #dbeafe; color: #1e40af; }
.status-badge.completed { background: #d1fae5; color: #065f46; }
.status-badge.failed { background: #fee2e2; color: #991b1b; }

.loading {
    color: #666;
    font-style: italic;
}

.error-msg {
    display: block;
    color: #991b1b;
    font-size: 11px;
}

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

.api-key-display {
    color: #888;
    font-family: monospace;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #2563eb;
}

.stat-label {
    color: #888;
    font-size: 0.9rem;
}

.admin-header {
    margin-bottom: 20px;
    text-align: right;
}

.disabled-text { color: #999; }

footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    text-align: center;
    color: #888;
}

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
