
:root {
    color-scheme: light only;

    --bulma-scheme-main: #ffffff;
    --bulma-scheme-main-bis: #fafafa;
    --bulma-scheme-main-ter: #f5f5f5;
    --bulma-text: #4a4a4a;
    --bulma-text-strong: #363636;
}

html,
body {
    color-scheme: light only;
    background-color: #fafafa;
    color: #363636;
    min-height: 100vh;
}

body,
button,
input,
select,
textarea,
.navbar,
.card,
.title,
.subtitle {
    font-family: "Noto Sans", sans-serif;
}

.navbar {
    background-color: #444A6C;
}

.btn-info {
    color: #fff;
    background-color: #3071a9;
    border-color: #2a6495;
}

.family-card,
.operation-card {
    height: 100%;
    transition: transform .12s ease, box-shadow .12s ease;
}

.family-card:hover,
.operation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,0,0,.08);
    background-color: #fafafa;
}

.method-get { background: #dff6e9; color: #147a3d; }
.method-post { background: #e5f0ff; color: #225ea8; }
.method-put { background: #fff0d9; color: #8a5600; }
.method-delete { background: #ffe2e2; color: #a51d2d; }
.method-patch { background: #eee4ff; color: #6541a5; }

.code-area,
.result-area {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.doc-field-details {
    margin-top: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
}

.doc-field-details > summary {
    cursor: pointer;
    padding: 0.6rem 0.8rem;
    user-select: none;
    font-size: 0.9rem;
}

.doc-field-details > summary:hover {
    background: #f3f4f6;
}

.doc-field-details[open] > summary {
    border-bottom: 1px solid #e5e7eb;
}

.doc-field-details-content {
    padding: 0.75rem 1rem;
}

.doc-field-section {
    margin-bottom: 0.75rem;
}

.doc-field-section:last-child {
    margin-bottom: 0;
}

.doc-field-label {
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.doc-field-warning {
    padding: 0.6rem;
    border-left: 3px solid #f59e0b;
    background: #fffaf0;
}

.doc-multiline {
    white-space: pre-line;
}

.result-area {
    min-height: 180px;
    max-height: 600px;
    overflow: auto;
    background: #111827;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
}

.table-container {
    max-height: 600px;
    overflow: auto;
}

.request-section {
    border-top: 1px solid #e5e7eb;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.body-object {
    border-left: 3px solid #e5e7eb;
    padding-left: 1rem;
}

.body-property > .body-object,
.body-property > .body-array {
    margin-top: .5rem;
}

.array-item {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    box-shadow: none;
}

.request-preview {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.request-preview-code {
    white-space: pre-wrap;
    word-break: break-word;
    background: #f3f4f6;
    border-radius: 6px;
    padding: .9rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .85rem;
}

/* V1.5 - Tableau de bord de santé API */
.health-kpi {
    height: 100%;
    border-top: 4px solid #d1d5db;
}
.health-kpi-ok { border-top-color: #22c55e; }
.health-kpi-ko { border-top-color: #ef4444; }
.health-family { padding: 0; overflow: hidden; }
.health-family-summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
}
.health-family-summary::-webkit-details-marker { display: none; }
.health-family-summary::after {
    content: "▾";
    color: #6b7280;
    margin-left: .5rem;
    transition: transform .15s ease;
}
details[open] > .health-family-summary::after { transform: rotate(180deg); }
.health-family .table-container { padding: 0 1.25rem 1.25rem; }
.health-family-counts { margin-left: auto; display: flex; gap: .35rem; flex-wrap: wrap; }
.health-dot {
    display: inline-block;
    width: .75rem;
    height: .75rem;
    border-radius: 999px;
    margin-right: .5rem;
    vertical-align: middle;
    box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}
.health-dot-ok { background: #22c55e; }
.health-dot-ko { background: #ef4444; }
.health-reason { margin-top: .25rem; font-size: .78rem; color: #6b7280; }
.health-auth { margin-top: .2rem; font-size: .75rem; color: #6b7280; }
.health-table td { vertical-align: middle; }
@media (max-width: 768px) {
    .health-family-summary { align-items: flex-start; flex-direction: column; }
    .health-family-counts { margin-left: 0; }
}

/* V1.6 - Documentation métier */
.doc-intro { border-left: 4px solid #3273dc; }
.doc-section { margin-top: 1rem; }
.doc-help-card { background: #f8fafc; border-left: 3px solid #60a5fa; padding: .8rem 1rem; margin-top: .55rem; border-radius: 4px; }
.doc-help-card p { margin-bottom: .35rem; }
.doc-help-card p:last-child { margin-bottom: 0; }
.doc-support { background: #fff8e1; border-left-color: #f59e0b; }
.doc-warning { background: #fff1f2; border-left-color: #ef4444; }
.doc-field { padding: 0; overflow: hidden; }
.doc-field-summary { cursor: pointer; list-style: none; padding: 1rem 1.25rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.doc-field-summary::-webkit-details-marker { display:none; }
.doc-field-content { padding: 0 1.25rem 1.25rem; border-top:1px solid #eee; }


/* V1.6.1 - Accordéon documentation métier + retours à la ligne */
.doc-multiline {
    white-space: pre-line;
}

.doc-accordion {
    padding: 0;
    overflow: hidden;
}

.doc-accordion-summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fff;
    user-select: none;
}

.doc-accordion-summary::-webkit-details-marker {
    display: none;
}

.doc-accordion-summary::after {
    content: "▾";
    color: #6b7280;
    font-size: 1rem;
    margin-left: .5rem;
    transition: transform .15s ease;
}

.doc-accordion[open] > .doc-accordion-summary::after {
    transform: rotate(180deg);
}

.doc-accordion-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.doc-accordion-hint {
    margin-left: auto;
    color: #6b7280;
    font-size: .85rem;
    font-weight: 400;
}

.doc-accordion[open] .doc-accordion-hint {
    display: none;
}

.doc-accordion-content {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.25rem;
}

.field-help-button {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: none;
    border-radius: 50%;
    background: #3273dc;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    transition: background 0.15s ease, transform 0.15s ease;
}

.field-help-button:hover {
    background: #2366c4;
    transform: scale(1.06);
}

.field-help-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.field-help-modal.is-active {
    display: block;
}

.field-help-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.55);
}

.field-help-modal-card {
    position: relative;
    z-index: 1001;
    width: min(680px, calc(100vw - 2rem));
    max-height: 80vh;
    overflow-y: auto;
    margin: 10vh auto 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.field-help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.field-help-modal-content {
    padding: 1.25rem;
}

.field-help-modal-close {
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.field-help-modal-close:hover {
    color: #111;
}

.doc-field-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.doc-field-section {
    margin-bottom: 1rem;
}

.doc-field-warning {
    padding: 0.75rem;
    border-left: 3px solid #f59e0b;
    background: #fffaf0;
}

.doc-multiline {
    white-space: pre-line;
}

@media (max-width: 768px) {
    .doc-accordion-summary {
        align-items: flex-start;
    }
    .doc-accordion-hint {
        display: none;
    }
}
