@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --black: #0d0d0d;
    --white: #ffffff;
    --paper: #f4f4f2;
    --grey-1: #6b6b6b;
    --grey-2: #b8b8b4;
    --line: #dedcd7;
    --danger: #b3261e;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--black);
    line-height: 1.5;
}
a { color: inherit; }

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.75rem;
    border-bottom: 1px solid var(--line);
    background: var(--white);
}
.admin-header .logo {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.admin-header nav { display: flex; gap: 1.5rem; align-items: center; font-size: 0.85rem; }
.admin-header nav a { border-bottom: 1px solid transparent; }
.admin-header nav a:hover { border-color: var(--black); }
.btn-logout {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--black);
    color: var(--white);
    border: none;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}
.btn-logout:hover { background: #262626; }

.admin-shell { max-width: 1000px; margin: 0 auto; padding: 2rem 1.75rem 5rem; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.tab-link {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab-link.active { border-color: var(--black); color: var(--black); }
.tab-link:not(.active) { color: var(--grey-1); }

.card {
    background: var(--white);
    border: 1px solid var(--line);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card h3 { font-size: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.card h3:first-of-type { margin-top: 0.5rem; }

.field { margin-bottom: 1.1rem; }
.field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grey-1);
    margin-bottom: 0.4rem;
}
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=number],
.field input[type=url],
.field input[type=file],
.field textarea,
.field select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line);
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--black);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: 2px solid var(--black);
    outline-offset: 1px;
    background: var(--white);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.field-hint { font-size: 0.78rem; color: var(--grey-1); margin: 0.4rem 0 0; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.gallery-thumb-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--grey-1);
    cursor: default;
}
.gallery-thumb-wrap span { display: flex; align-items: center; gap: 0.3rem; }
.gallery-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--line);
}

.repeatable-rows { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.6rem; }
.repeatable-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 0.6rem;
    align-items: center;
}
@media (max-width: 640px) {
    .repeatable-row { grid-template-columns: 1fr; }
}
.repeatable-row input { margin: 0; }
.repeatable-row-3 { grid-template-columns: 0.9fr 1.3fr 1.3fr auto; }
.repeatable-row-1 { grid-template-columns: 1fr auto; }
.repeatable-row-skill-cv { grid-template-columns: 1fr 0.85fr auto auto; align-items: center; }
.repeatable-group { margin-bottom: 0.6rem; }
.repeatable-row-en {
    margin-top: 0.4rem;
    align-items: center;
    opacity: 0.9;
}
.repeatable-row-en.repeatable-row-3 { grid-template-columns: auto 1.3fr 1.3fr; }
.repeatable-row-en.repeatable-row-1 { grid-template-columns: auto 1fr; }
.repeatable-row-en:not(.repeatable-row-3):not(.repeatable-row-1) { grid-template-columns: auto 1fr 1fr; }
.field-en-inline { font-size: 0.85rem; }
.lang-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--grey-1);
    border: 1px solid var(--line);
    padding: 0.25rem 0.4rem;
    white-space: nowrap;
}
.field-en label .lang-badge,
.field-en > label .lang-badge { margin-right: 0.4rem; }
.field-en textarea, .field-en input { background: var(--paper); }
.inline-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--grey-1);
    white-space: nowrap;
}
.inline-checkbox input { width: auto; }
@media (max-width: 780px) {
    .repeatable-row-3 { grid-template-columns: 1fr; }
    .repeatable-row-skill-cv { grid-template-columns: 1fr auto auto; }
    .repeatable-row-en.repeatable-row-3 { grid-template-columns: 1fr; }
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.checkbox-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.85rem;
    border: 1px solid var(--line);
    padding: 0.45rem 0.7rem;
    cursor: pointer;
}
.checkbox-chip input { width: auto; margin: 0; }
.checkbox-chip:has(input:checked) {
    border-color: var(--black);
    background: var(--paper);
}

.btn {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.7rem 1.2rem;
    background: var(--black);
    color: var(--white);
    border: 1px solid var(--black);
    cursor: pointer;
}
.btn:hover { background: #262626; }
.btn-outline { background: transparent; color: var(--black); }
.btn-outline:hover { background: var(--black); color: var(--white); }
.btn-danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.68rem; }

.flash {
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    border: 1px solid;
}
.flash-success { background: #f0f5ee; border-color: #8fae7c; color: #33502a; }
.flash-error { background: #f7ecea; border-color: var(--danger); color: var(--danger); }

.project-list { list-style: none; margin: 0; padding: 0; }
.project-row {
    display: grid;
    grid-template-columns: 56px 1fr auto auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--line);
}
.project-list li:last-child .project-row { border-bottom: 1px solid var(--line); }
.project-thumb {
    width: 56px; height: 56px;
    object-fit: cover;
    background: var(--paper);
    border: 1px solid var(--line);
}
.project-info .p-title { font-weight: 600; font-size: 0.95rem; }
.project-info .p-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--grey-1);
    text-transform: uppercase;
}
.actions-inline { display: flex; gap: 0.5rem; }

.login-shell {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--white);
    border: 1px solid var(--line);
    padding: 2.25rem;
}
.login-card h1 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0;
}
.login-card .btn { width: 100%; text-align: center; margin-top: 0.5rem; }
.hint { font-size: 0.78rem; color: var(--grey-1); margin-top: 1.25rem; }

.empty-state {
    padding: 2rem 0;
    color: var(--grey-1);
    font-size: 0.9rem;
}

/* ---------------------------------------------------------------------
   Demandes de contact
   ------------------------------------------------------------------- */
.request-list { list-style: none; margin: 0; padding: 0; }
.request-item { border-top: 1px solid var(--line); }
.request-list li:last-child { border-bottom: 1px solid var(--line); }

.request-summary {
    display: grid;
    grid-template-columns: 10px 1.4fr 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0.25rem;
    text-decoration: none;
    color: inherit;
}
.request-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--grey-2);
}
.status-nouveau .request-status-dot { background: #2563eb; }
.status-en_cours .request-status-dot { background: #d97706; }
.status-termine .request-status-dot { background: #16a34a; }

.request-name { font-weight: 600; font-size: 0.92rem; }
.request-reason {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--grey-1);
}
.request-date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--grey-1);
    white-space: nowrap;
}
.request-status-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--line);
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
}
/* Code couleur par statut : bleu = nouveau, orange = en attente, vert = terminé */
.status-nouveau .request-status-label {
    background: #eaf1fe;
    border-color: #2563eb;
    color: #1d4ed8;
}
.status-en_cours .request-status-label {
    background: #fef3e2;
    border-color: #d97706;
    color: #b45309;
}
.status-termine .request-status-label {
    background: #eafbf0;
    border-color: #16a34a;
    color: #15803d;
}

.request-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}
.request-filter-tab {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.2rem;
    margin-right: 1.25rem;
    border-bottom: 2px solid transparent;
    color: var(--grey-1);
}
.request-filter-tab.active { color: var(--black); border-color: var(--black); }

@media (max-width: 780px) {
    .request-summary { grid-template-columns: 10px 1fr; row-gap: 0.3rem; }
    .request-reason, .request-date, .request-status-label { grid-column: 2; }
}

.request-detail {
    padding: 0 0.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.request-fields { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem 1.5rem; }
.request-fields div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding: 0.35rem 0; }
.request-fields dt { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; color: var(--grey-1); }
.request-fields dd { margin: 0; font-weight: 600; text-align: right; }

.request-message p { margin: 0; white-space: pre-line; font-size: 0.92rem; line-height: 1.6; }
.request-links ul, .request-files ul { margin: 0; padding-left: 1.2rem; }
.request-links li, .request-files li { font-size: 0.88rem; margin-bottom: 0.3rem; word-break: break-word; }

.request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.request-actions select {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 0.85rem;
}

/* ---------------------------------------------------------------------
   Commandes
   ------------------------------------------------------------------- */
.order-list { list-style: none; margin: 0; padding: 0; }
.order-item { border-top: 1px solid var(--line); padding: 0.9rem 0.25rem; }
.order-list li:last-child { border-bottom: 1px solid var(--line); }

.order-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}
.order-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey-2); flex-shrink: 0; }
.status-nouvelle .order-status-dot { background: #2563eb; }
.status-en_cours .order-status-dot { background: #d97706; }
.status-attente_client .order-status-dot { background: #7c3aed; }
.status-terminee .order-status-dot { background: #16a34a; }
.status-annulee .order-status-dot { background: #9ca3af; }

.order-name { font-weight: 600; font-size: 0.95rem; }
.order-type { font-weight: 400; color: var(--grey-1); }
.order-client {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--grey-1);
}
.order-status-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--line);
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
}
.status-nouvelle .order-status-label { background: #eaf1fe; border-color: #2563eb; color: #1d4ed8; }
.status-en_cours .order-status-label { background: #fef3e2; border-color: #d97706; color: #b45309; }
.status-attente_client .order-status-label { background: #f2ebfe; border-color: #7c3aed; color: #6d28d9; }
.status-terminee .order-status-label { background: #eafbf0; border-color: #16a34a; color: #15803d; }
.status-annulee .order-status-label { background: #f2f2f0; border-color: #9ca3af; color: #6b7280; }

.order-deadline {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--grey-1);
}
.order-deadline.is-soon { color: #b45309; font-weight: 600; }
.order-deadline.is-overdue { color: #b91c1c; font-weight: 600; }

.order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.82rem;
    color: var(--grey-1);
    margin-bottom: 0.6rem;
}

.order-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
