/* GEV Workflo Plus — Control Panel styles */

:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --border: #2d3a4d;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --error: #f87171;
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* ——— Login ——— */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-card h1 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.login-subtitle {
    margin: 0 0 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.login-form input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.login-form button {
    width: 100%;
    padding: 0.65rem 1rem;
    margin-top: 0.5rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.login-form button:hover {
    background: var(--accent-hover);
}

.error {
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid var(--error);
    border-radius: 6px;
    color: var(--error);
    font-size: 0.9rem;
}

/* ——— Dashboard ——— */
.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu span {
    color: var(--muted);
    font-size: 0.9rem;
}

.user-menu a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.user-menu a:hover {
    text-decoration: underline;
}

.dashboard-main {
    flex: 1;
    padding: 1.5rem;
}

.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
}

.panel-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.welcome-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}
.action-form {
    margin: 0;
}
.action-form-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.action-form-inline .limit-input {
    width: 4rem;
    padding: 0.5rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    text-align: center;
}
.action-form-inline .limit-input:focus {
    outline: none;
    border-color: var(--accent);
}
.action-form-label {
    color: var(--muted);
    font-size: 0.9rem;
}
.btn-secondary {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--muted);
}

/* ——— Jobs (collapsible) ——— */
.jobs-section {
    margin: 0;
}
.jobs-section summary {
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    list-style: none;
    padding: 0.25rem 0;
    user-select: none;
}
.jobs-section summary::-webkit-details-marker {
    display: none;
}
.jobs-section summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.15s;
    width: 1em;
}
.jobs-section[open] summary::before {
    transform: rotate(90deg);
}
.jobs-section > *:not(summary) {
    margin-top: 1rem;
}

/* ——— Raw (collapsible) ——— */
.raw-section {
    margin: 0;
}
.raw-section summary {
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    list-style: none;
    padding: 0.25rem 0;
    user-select: none;
}
.raw-section summary::-webkit-details-marker {
    display: none;
}
.raw-section summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.15s;
    width: 1em;
}
.raw-section[open] summary::before {
    transform: rotate(90deg);
}
.raw-section > *:not(summary) {
    margin-top: 1rem;
}
.raw-intro {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ——— Jobs panel ——— */
.jobs-form {
    margin: 1rem 0 0;
}
.btn-primary {
    padding: 0.6rem 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:hover {
    background: var(--accent-hover);
}
.export-links {
    margin: 1rem 0 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.btn-link {
    padding: 0.4rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.9rem;
    text-decoration: none;
}
.btn-link:hover {
    background: var(--border);
}
.job-data-link {
    color: var(--accent);
    font-size: 0.875rem;
    text-decoration: none;
}
.job-data-link:hover {
    text-decoration: underline;
}
.job-data-link + .job-data-link {
    margin-left: 0.5rem;
}
.jobs-message {
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}
.error-verbose {
    margin: 0.75rem 0 0;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--error);
    border-radius: 6px;
    color: var(--error);
    font-size: 0.8rem;
    font-family: ui-monospace, monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 20rem;
    overflow: auto;
}
.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}
.jobs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.jobs-table th,
.jobs-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.jobs-table th {
    color: var(--muted);
    font-weight: 600;
}
.jobs-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
