/* ===== Reset & Base ===== */
* { 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.5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Login ===== */
.login-container { max-width: 400px; margin: 100px auto; padding: 2rem; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-align: center; }
.login-container h1 { margin-bottom: 1.5rem; }
.login-container input { width: 100%; padding: 0.75rem; margin-bottom: 1rem; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; }
.login-container button { width: 100%; padding: 0.75rem; background: #2563eb; color: white; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; }
.login-container button:hover { background: #1d4ed8; }
.error { color: #dc2626; margin-bottom: 1rem; }

/* ===== Navbar ===== */
.navbar {
    background: #1e293b;
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 56px;
    gap: 2rem;
}
.nav-brand {
    font-weight: 700;
    font-size: 1.125rem;
    color: white;
    white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }
.nav-links {
    display: flex;
    gap: 1.5rem;
}
.nav-links a {
    color: #cbd5e1;
    font-size: 0.9rem;
}
.nav-links a:hover {
    color: white;
    text-decoration: none;
}

/* ===== Layout ===== */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== Page Headers ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    text-align: center;
    line-height: 1.5;
    transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    text-decoration: none;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}
.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    padding: 0;
    cursor: pointer;
    font-size: inherit;
}
.btn-link:hover {
    text-decoration: underline;
}
.btn-link.danger,
.danger {
    color: #dc2626;
}
.btn-link.danger:hover {
    color: #b91c1c;
}

/* ===== Tables ===== */
.jobs-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.jobs-table th,
.jobs-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.jobs-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}
.jobs-table td {
    font-size: 0.9rem;
}
.jobs-table tbody tr:hover {
    background: #f8fafc;
}
.jobs-table td:last-child {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-queued {
    background: #e5e7eb;
    color: #4b5563;
}
.badge-extracting {
    background: #fef3c7;
    color: #92400e;
}
.badge-translating {
    background: #dbeafe;
    color: #1e40af;
}
.badge-completed {
    background: #d1fae5;
    color: #065f46;
}
.badge-failed {
    background: #fee2e2;
    color: #991b1b;
}
.badge-default {
    background: #dbeafe;
    color: #1e40af;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    vertical-align: middle;
}

/* ===== Cards ===== */
.prompt-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}
.card-meta {
    font-size: 0.82rem;
    color: #64748b;
}
.card-actions {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== Forms ===== */
.prompt-form {
    background: white;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}

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

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #1f2937;
    background: white;
    transition: border-color 0.15s;
}
input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

textarea {
    resize: vertical;
    min-height: 200px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    font-size: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.empty-state a {
    font-weight: 600;
}

/* ===== Utilities ===== */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}
