/* ── Optimable brand variables ───────────────────────────── */
:root {
    --opt-teal:       #0A7B83;
    --opt-teal-light: #0D9DA7;
    --opt-mint:       #02C39A;
    --opt-navy:       #0D1B2A;
    --opt-cream:      #F5F0E8;

    /* Override Pico primary palette */
    --pico-primary:                 var(--opt-teal);
    --pico-primary-hover:           var(--opt-teal-light);
    --pico-primary-focus:           rgba(10, 123, 131, 0.25);
    --pico-primary-inverse:         #fff;

    /* Font */
    --pico-font-family:             'DM Sans', system-ui, sans-serif;
    --pico-font-size:               16px;
    --pico-line-height:             1.6;
}

/* ── Nav brand logo ──────────────────────────────────────── */
.nav-brand {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.2rem;
    color: var(--pico-color) !important;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.nav-brand span { color: var(--opt-mint); }
.nav-brand:hover { text-decoration: none; color: var(--pico-color) !important; }

/* Optimable Custom Styles */

/* Progress log container */
.progress-log {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    font-family: monospace;
    font-size: 0.85rem;
    margin: 1rem 0;
}

.progress-log p {
    margin: 0.25rem 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.progress-log p:last-child {
    border-bottom: none;
}

/* Progress message types */
.progress-info {
    color: var(--pico-primary);
}

.progress-agent {
    color: var(--pico-secondary);
    font-weight: 500;
}

.progress-progress {
    color: var(--pico-muted-color);
}

.progress-error {
    color: var(--pico-del-color);
    font-weight: 500;
}

/* Success message */
.success {
    color: var(--pico-ins-color);
}

/* Error message */
.error {
    color: var(--pico-del-color);
}

/* Markdown content styling */
.markdown-body {
    line-height: 1.6;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.markdown-body table {
    width: 100%;
    margin: 1rem 0;
}

.markdown-body code {
    background: var(--pico-code-background-color);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.markdown-body pre {
    background: var(--pico-code-background-color);
    padding: 1rem;
    overflow-x: auto;
    border-radius: var(--pico-border-radius);
}

.markdown-body blockquote {
    border-left: 3px solid var(--pico-primary);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--pico-muted-color);
}

/* Header nav vertical rhythm (shell look handled by design-system.css) */
header nav {
    padding: 0.5rem 0;
}

/* Reports table */
table[role="grid"] td:last-child {
    text-align: right;
}

/* Breadcrumb styling */
nav[aria-label="breadcrumb"] ul {
    padding: 0;
    margin: 0;
}

nav[aria-label="breadcrumb"] li {
    display: inline;
}

nav[aria-label="breadcrumb"] li:not(:last-child)::after {
    content: " / ";
    color: var(--pico-muted-color);
}

/* Loading indicator */
[aria-busy="true"] {
    opacity: 0.7;
}

/* Button disabled state */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Status Indicators (GPU + vLLM) ===== */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.gpu-off,
.vllm-off {
    background-color: var(--c-text-subtle);
}

.gpu-starting,
.gpu-stopping {
    background-color: var(--c-warning);
    animation: status-pulse 1s ease-in-out infinite;
}

.gpu-ready,
.vllm-ready {
    background-color: var(--c-success);
}

.gpu-error {
    background-color: var(--c-danger);
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.gpu-btn {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    margin-left: 0.4rem;
}

#gpu-indicator,
#vllm-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#gpu-indicator small,
#vllm-indicator small {
    margin: 0;
}

#gpu-timer {
    color: var(--pico-muted-color);
    font-variant-numeric: tabular-nums;
}

/* ===== Facture module ===== */

/* Import card — fond subtil, remplace .facture-upload */
.facture-import-card {
    background: var(--c-info-bg);
    border: 1px solid color-mix(in srgb, var(--opt-teal) 22%, var(--c-border));
    border-radius: var(--radius-md);
    padding: var(--sp-5);
    margin-bottom: var(--sp-5);
}

.import-config-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.import-config-row label { flex: 1; min-width: 150px; margin: 0; }

/* Row hover + open state */
#facture-list tbody tr:not(.facture-detail-row) { cursor: pointer; }
tr.facture-row--open > td {
    background: color-mix(in srgb, var(--opt-teal) 6%, transparent);
}

/* Expansion inline row */
.facture-detail-row > td.facture-detail-cell {
    padding: 0;
    border-left: 3px solid var(--opt-teal);
    background: var(--pico-card-background-color);
}
.facture-detail-cell > article {
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--pico-border-color);
    animation: expand-down 0.18s ease;
}
@keyframes expand-down {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
