/* Qualium · Générateur schema.org */

:root {
    --brand-1: #ed729c;
    --brand-2: #f19073;
    --brand-gradient: linear-gradient(135deg, #ed729c 0%, #f19073 100%);
    --brand-ink: #c24a76;
    --brand-soft: #fdeef2;

    --text: #24212b;
    --muted: #6f6a76;
    --bg: #f8f5f3;
    --surface: #ffffff;
    --border: #ece5e1;

    --success-bg: #e7f5ee;
    --success-ink: #1d6a48;
    --danger: #d14545;
    --danger-bg: #fdecea;
    --danger-ink: #a12f2f;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(36, 33, 43, .04), 0 6px 20px rgba(36, 33, 43, .05);
    --focus: 0 0 0 3px rgba(237, 114, 156, .22);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-ink); text-underline-offset: 2px; }
a:hover { color: var(--brand-1); }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 600; margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.text-right { text-align: right; }
.inline { display: inline; }

/* ---------- Barre du haut ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1180px;
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.topbar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar-logo img { height: 26px; display: block; }
.topbar-product {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    padding-left: 10px;
    border-left: 1px solid var(--border);
}
.topbar-nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.topbar-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.topbar-nav a:hover { color: var(--text); background: var(--bg); }
.topbar-nav a.active { color: var(--brand-ink); background: var(--brand-soft); }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.topbar-account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
}
.topbar-account:hover, .topbar-account.active { background: var(--bg); color: var(--text); }
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-gradient);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

/* ---------- Mise en page ---------- */

.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 80px; }

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.subtitle { color: var(--muted); margin: 6px 0 0; }
.breadcrumb { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-ink); }

.section-title {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    margin: 36px 0 12px;
}

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.columns { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------- Cartes ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; }
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #fcfaf9;
}

.est-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.est-card:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: #f3c9d6;
    box-shadow: 0 10px 28px rgba(237, 114, 156, .14);
}
.est-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.est-card-title { font-size: 19px; font-weight: 600; margin: 0; }
.est-card .meta { margin: auto 0 0; font-size: 13px; color: var(--muted); }

.entity-card { display: flex; flex-direction: column; gap: 10px; }
.entity-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.entity-card p { margin: 0; font-size: 14px; flex: 1; }
.entity-card .btn { align-self: flex-start; }
.entity-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.count {
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty h1 { color: var(--text); }
.empty-inline { padding: 20px 16px; margin: 0; }
.error-code {
    font-size: 56px;
    font-weight: 600;
    margin: 0 0 8px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Badges & chips ---------- */

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
}
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: #f7d3df; }
.badge-muted { opacity: .7; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
}

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background: var(--brand-gradient); color: #fff; box-shadow: 0 4px 14px rgba(237, 114, 156, .32); }
.btn-primary:hover { color: #fff; filter: brightness(1.05) saturate(1.05); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { color: var(--text); background: var(--bg); }
.btn-ghost { background: none; color: var(--muted); padding: 6px 12px; }
.btn-ghost:hover { color: var(--text); background: var(--bg); }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { color: var(--danger-ink); background: var(--danger-bg); }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn.is-disabled, .btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ---------- Formulaires ---------- */

.form { display: grid; gap: 20px; max-width: 600px; }
.field { margin: 0; }
fieldset.field { border: 0; padding: 0; }
.field label, .field legend { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; padding: 0; }
.field .hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.field summary { cursor: pointer; color: var(--muted); font-size: 14px; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
input[type=tel], input[type=time], input[type=date], input[type=search], select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-1); box-shadow: var(--focus); }
.has-error input, .has-error select { border-color: var(--danger); }
.error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }

.checkbox, .radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.checkbox input, .radio input { margin-top: 4px; accent-color: var(--brand-1); }
.radio + .radio { margin-top: 8px; }
.checkbox-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* ---------- Alertes ---------- */

.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-success { background: var(--success-bg); color: var(--success-ink); }
.alert-error { background: var(--danger-bg); color: var(--danger-ink); }
.alert-info { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Tableaux ---------- */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fcfaf9; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-inactive td { opacity: .55; }

/* ---------- Connexion ---------- */

.auth-body {
    background:
        radial-gradient(circle at 15% 20%, rgba(237, 114, 156, .16), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(241, 144, 115, .16), transparent 45%),
        var(--bg);
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px 32px; }
.auth-logo { display: block; height: 38px; margin: 0 auto 8px; }
.auth-product { text-align: center; color: var(--muted); margin: 0 0 28px; font-size: 14px; }
.auth-help { text-align: center; color: var(--muted); font-size: 13px; margin: 20px 0 0; }

/* ---------- Fiche établissement ---------- */

.kicker { display: block; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); margin: 0 0 4px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-head .section-title { margin-bottom: 12px; }
.count-inline {
    display: inline-block;
    min-width: 22px;
    padding: 0 7px;
    margin-left: 4px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    text-align: center;
    letter-spacing: 0;
}
.entity-list { display: grid; gap: 10px; }
.entity-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.entity-row:hover { color: inherit; border-color: #f3c9d6; box-shadow: 0 8px 22px rgba(237, 114, 156, .12); }
.entity-row-main { padding: 20px 24px; }
.entity-row-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.entity-row-title { font-size: 16px; font-weight: 600; }
.entity-row-body .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-empty { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; font-size: 14px; }

.progress { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand-gradient); transition: width .3s ease; }
.mini-progress { display: flex; align-items: center; gap: 8px; width: 140px; font-size: 13px; color: var(--muted); }
.mini-progress .progress { flex: 1; }

/* ---------- Formulaires d'édition ---------- */

.completeness { min-width: 220px; }
.completeness-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.completeness-label strong { color: var(--text); font-weight: 600; }

.alert-block { display: block; line-height: 1.6; }

.tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
.tab:hover { color: var(--text); background: var(--bg); }
.tab.active { background: var(--brand-gradient); color: #fff; }
.tab-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}
.tab.active .tab-badge { background: #fff; color: var(--danger); }

.form-section { padding: 28px; }
.form-section-title { font-size: 18px; font-weight: 600; margin: 0 0 20px; }
.section-intro { margin: -8px 0 20px; color: var(--muted); font-size: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 28px; }
.field-wide { grid-column: 1 / -1; }

.field-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.field-label { font-weight: 500; font-size: 14px; }
.level { font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px; }
.level-required { background: var(--brand-soft); color: var(--brand-ink); }
.level-recommended { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.field textarea { resize: vertical; min-height: 44px; }
.field .error + .error { margin-top: 2px; }
.has-error > .field-head .field-label { color: var(--danger-ink); }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }

.sublabel { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 400; }

.tr-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tr-item { position: relative; }
.tr-item .lang {
    position: absolute;
    top: 9px;
    left: 10px;
    z-index: 1;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg);
    color: var(--muted);
    pointer-events: none;
}
.tr-item input, .tr-item textarea { padding-left: 48px; }

.inline-grid { display: grid; gap: 12px; }
.inline-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }

.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit span { color: var(--muted); font-size: 13px; white-space: nowrap; }

.segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg);
}
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(36, 33, 43, .12); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
/* .field .check : doit l'emporter sur la règle générique ".field label" (bloc, gras, marge) */
.check, .field .check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 400; cursor: pointer; padding: 4px 0; margin: 0; }
.check input { accent-color: var(--brand-1); width: 16px; height: 16px; margin: 0; flex-shrink: 0; }

.day-picker { display: flex; flex-wrap: wrap; gap: 4px; }
.day-picker .check { padding: 0; }
.day-picker input { position: absolute; opacity: 0; pointer-events: none; }
.day-picker span {
    display: block;
    min-width: 44px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    background: #fff;
}
.day-picker input:checked + span { background: var(--brand-soft); border-color: #f3c9d6; color: var(--brand-ink); font-weight: 500; }
.day-picker input:focus-visible + span { box-shadow: var(--focus); }

.catalog-custom { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }

.repeater { display: grid; gap: 10px; justify-items: start; }
.repeater-rows { display: grid; gap: 10px; width: 100%; }
.repeater-rows:empty { display: none; }
.repeater-row {
    position: relative;
    width: 100%;
    padding: 14px 44px 14px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fcfaf9;
}
.repeater-row.is-scalar { padding: 8px 44px 8px 8px; }
.repeater-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.repeater-row.is-scalar .repeater-fields { grid-template-columns: 1fr; }
.subfield.span-2 { grid-column: 1 / -1; }
.repeater-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.repeater-remove:hover { background: var(--danger-bg); color: var(--danger); }

.inherit-toggle, .field .inherit-toggle { display: inline-flex; margin-bottom: 0; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; color: var(--muted); cursor: pointer; font-weight: 400; }
.inherit-toggle input { accent-color: var(--brand-1); margin: 0; }
.inherit-target { border: 0; padding: 0; margin: 0; min-width: 0; }
.inherit-target:disabled { opacity: .55; }
.inherit-target:disabled input, .inherit-target:disabled textarea, .inherit-target:disabled select { background: var(--bg); }

.save-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 20px;
    padding: 12px 0 16px;
    background: linear-gradient(to bottom, rgba(248, 245, 243, 0), var(--bg) 30%);
}
.save-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px 12px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(36, 33, 43, .1);
}
.save-status { font-size: 14px; }
[data-dirty-indicator] { color: var(--brand-ink); font-weight: 500; }
[data-dirty-indicator]::before { content: '●'; margin-right: 6px; }
.danger-zone { margin-top: 8px; text-align: right; }

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
    .topbar-inner { gap: 12px; padding: 0 16px; }
    .topbar-product, .topbar-account .name { display: none; }
    .container { padding: 24px 16px 64px; }
    h1 { font-size: 24px; }
    .columns { grid-template-columns: 1fr; }
    .table th:nth-child(4), .table td:nth-child(4) { display: none; }
    .fields, .tr-pair, .repeater-fields { grid-template-columns: 1fr; }
    .inline-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-section { padding: 20px 16px; }
    .entity-row { flex-wrap: wrap; gap: 12px; }
    .save-bar-inner { border-radius: var(--radius); }
    .completeness { min-width: 0; width: 100%; }
}

/* ---------- Exports (fiches JSON-LD) ---------- */
.export-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.export-pages { display: flex; flex-direction: column; padding: 8px; position: sticky; top: 16px; }
.export-page { display: block; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.export-page strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.export-page .kicker { color: var(--muted); }
.export-page:hover { background: var(--bg); color: var(--text); }
.export-page.active { background: var(--brand-soft); }
.export-page.active .kicker { color: var(--brand-ink); }
.export-main { min-width: 0; }
.export-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.export-toolbar .tabs { margin-bottom: 0; }
.export-toolbar .tab { text-decoration: none; }
.export-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.export-target { margin: 8px 0 16px; overflow-wrap: anywhere; }
.code-block {
    margin: 0 0 16px;
    padding: 20px;
    max-height: 70vh;
    overflow: auto;
    background: #24212b;
    color: #f3eef0;
    border-radius: var(--radius);
    font: 13px/1.55 ui-monospace, 'Cascadia Code', Consolas, monospace;
    white-space: pre;
    tab-size: 2;
}
@media (max-width: 800px) {
    .export-layout { grid-template-columns: 1fr; }
    .export-pages { position: static; }
}
.code-block-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
