:root {
    --bg: #0e0f12;
    --panel: #17191e;
    --panel2: #20232a;
    --text: #f3f0e8;
    --muted: #aaa8a2;
    --line: #343740;
    --gold: #d5b678;
    --danger: #e88484;
    --ok: #83c99a
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 Inter, system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

a {
    color: inherit
}

.bo-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: auto
}

.bo-head {
    border-bottom: 1px solid var(--line);
    background: #111216;
    padding: 18px 0
}

.bo-head .bo-wrap,
.bo-titlebar,
.bo-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px
}

.bo-head b {
    font-size: 18px
}

.bo-head nav {
    display: flex;
    gap: 14px;
    align-items: center
}

.bo-head nav a[aria-label] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none
}

.bo-main {
    padding: 34px 0 60px;
    flex: 1 0 auto
}

.bo-titlebar {
    margin-bottom: 22px
}

.bo-titlebar h1 {
    margin: 0;
    font-size: 28px
}

.bo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    border: 1px solid #6f6044;
    border-radius: 8px;
    background: var(--gold);
    color: #16130e;
    padding: 10px 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer
}

.bo-btn.secondary {
    background: var(--panel2);
    color: var(--text);
    border-color: var(--line)
}

.bo-btn.danger {
    background: #3b2023;
    color: #ffc5c5;
    border-color: #6e383e
}

.bo-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px
}

.bo-filters {
    display: grid;
    grid-template-columns: 1fr 190px 190px auto;
    gap: 10px;
    margin-bottom: 18px
}

.bo-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px
}

.bo-pager-info {
    color: var(--muted);
    font-size: 13px
}

.bo-pager-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.bo-pager-gap {
    color: var(--muted);
    padding: 0 2px
}

.bo-table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px
}

.bo-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px
}

.bo-table th,
.bo-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: nowrap
}

.bo-table th:nth-child(2),
.bo-table td:nth-child(2) {
    white-space: normal
}

.bo-table th {
    background: var(--panel2);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em
}

.bo-table tr:last-child td {
    border-bottom: 0
}

.bo-table h3 {
    font-size: 15px;
    margin: 0 0 3px
}

.bo-content {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 310px;
    text-decoration: none;
    border-radius: 8px;
    transition: background .2s
}

.bo-content:hover {
    background: rgba(213, 182, 120, .08)
}

.bo-thumb {
    width: 76px;
    height: 52px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: var(--panel2)
}

.bo-image-preview {
    width: min(100%, 620px);
    max-height: 350px;
    object-fit: contain;
    object-position: left center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0b0c0f
}

.bo-actions>a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    background: var(--panel2)
}

.bo-actions .bo-btn {
    min-width: 36px;
    min-height: 36px;
    width: 36px;
    height: 36px;
    padding: 0
}

.bo-warning {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #f3c66e;
    font-weight: 700
}

.bo-warning[hidden] {
    display: none
}

.bo-muted {
    color: var(--muted);
    font-size: 13px
}

.bo-badge {
    display: inline-block;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px
}

.bo-badge.draft {
    color: #f0cb7c
}

.bo-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px
}

.bo-field {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.bo-field.full {
    grid-column: 1/-1
}

.bo-field label {
    font-weight: 700;
    font-size: 13px
}

.bo-field small {
    color: var(--muted)
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #101217;
    color: var(--text);
    padding: 11px 12px;
    font: inherit
}

input,
select {
    min-height: 44px;
    line-height: 1.35
}

textarea {
    min-height: 260px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, monospace
}

.bo-notice {
    border: 1px solid #315d3e;
    background: #15251a;
    color: #b9ebc6;
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 18px
}

.bo-notice.error {
    border-color: #703b41;
    background: #29171a;
    color: #ffc1c7
}

.bo-login {
    width: min(460px, calc(100% - 32px));
    margin: 9vh auto
}

.bo-login h1 {
    margin-top: 0
}

.bo-login form {
    display: grid;
    gap: 14px
}

.bo-empty {
    text-align: center;
    color: var(--muted);
    padding: 35px
}

.bo-inline {
    display: inline
}

.bo-count {
    color: var(--muted);
    margin-left: 8px
}

@media(max-width:760px) {

    .bo-filters,
    .bo-form {
        grid-template-columns: 1fr
    }

    .bo-field.full {
        grid-column: auto
    }

    .bo-titlebar,
    .bo-head .bo-wrap {
        align-items: flex-start;
        flex-direction: column
    }

    .bo-head nav {
        flex-wrap: wrap
    }

    .bo-thumb {
        width: 60px;
        height: 44px
    }
}

.bo-field .bo-warning {
    display: inline-flex;
    margin-left: 8px;
    color: var(--danger);
    font-weight: 700
}

.bo-warning[hidden] {
    display: none
}

.bo-links-list {
    display: grid;
    gap: 8px
}
/* Liste des liens externes */

.bo-links-header,
.bo-link-item {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 42px;
    gap: 12px;
    align-items: center;
}

.bo-links-header {
    padding: 0 12px 7px;
    color: #929baa;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bo-links-list {
    display: grid;
    gap: 8px;
}

.bo-link-item {
    min-width: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
}

.bo-link-text {
    display: grid;
    grid-column: 1 / 3;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.bo-link-label,
.bo-link-url {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-link-label {
    color: #f3f5f7;
    font-weight: 700;
}

.bo-link-label::before {
    margin-right: 8px;
    color: #aeb7c5;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f044";
}

.bo-link-url {
    color: #aeb7c5;
    font-size: 0.9rem;
}

.bo-link-remove {
    width: 38px;
    height: 38px;
    border-radius: 9px;
}

.bo-link-add {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    width: auto;
    margin-top: 10px;
    padding-inline: 14px;
}


/* Fenêtre d’ajout ou de modification */

.bo-dialog {
    width: min(92vw, 520px);
    max-width: 520px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: #171b21;
    color: #f5f7fa;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.bo-dialog::backdrop {
    background: rgba(5, 8, 12, 0.72);
    backdrop-filter: blur(4px);
}

.bo-dialog-card {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.bo-dialog-head {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.bo-dialog-head h2 {
    margin: 0;
    font-size: 1.35rem;
}

.bo-dialog .bo-field {
    display: grid;
    gap: 7px;
}

.bo-dialog .bo-field label {
    font-size: 0.9rem;
    font-weight: 700;
}

.bo-dialog input {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: #0f1319;
    color: #fff;
    font-size: 1rem;
}

.bo-dialog input:focus {
    border-color: #7fa7ff;
    outline: 3px solid rgba(85, 130, 255, 0.25);
}

.bo-dialog-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
}

.bo-dialog-actions .bo-btn {
    width: auto;
    min-width: 48px;
    min-height: 44px;
    border-radius: 10px;
}

.bo-dialog-head .bo-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}


/* Affichage mobile sur deux lignes */

@media (max-width: 700px) {
    .bo-links-header {
        display: none;
    }

    .bo-link-item {
        grid-template-columns: minmax(0, 1fr) 42px;
    }

    .bo-link-text {
        grid-column: 1;
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .bo-link-remove {
        grid-column: 2;
        grid-row: 1;
    }

    .bo-dialog-card {
        padding: 20px;
    }
}
