:root {
    --bg: #e8eef5;
    --surface: #f7fafc;
    --border: #d3dde8;
    --text: #1a2433;
    --muted: #5b6b7c;
    --primary: #2f6fad;
    --primary-hover: #245a8e;
    --hover: #e7eef6;
    --selected: #d5e6f6;
    --selected-border: #4a86c1;
    --header-bg: #1c2b3d;
    --header-text: #eaf1f8;
    --shadow: 0 1px 2px rgba(28, 43, 61, 0.06), 0 6px 18px rgba(28, 43, 61, 0.06);
    --action-pos: #059669;
    --action-pos-hover: #047857;
    --action-neg: #b42318;
    --action-neg-hover: #991b1b;
    --action-mute: #1c2b3d;
    --action-mute-hover: #2a3d54;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }
body {
    font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
    background:
        radial-gradient(1200px 400px at 10% -10%, rgba(47, 111, 173, 0.14), transparent 50%),
        var(--bg);
    color: var(--text);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main { flex: 1 0 auto; }

.header {
    background: var(--header-bg);
    color: var(--header-text);
    border-bottom: 3px solid var(--primary);
    padding: 0.85rem 1.5rem;
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
}
.brand-mark {
    width: 0.7rem;
    height: 1.55rem;
    border-radius: 2px;
    background: linear-gradient(180deg, #7eb3e0, var(--primary));
    box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.28);
}
.header h1 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.28rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--header-text);
}
.logo-gedyco {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.logo-mark {
    width: 3.4rem;
    height: 3.4rem;
    flex: 0 0 auto;
    display: block;
}
.logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.logo-word {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 600;
    font-size: 2.35rem;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #1c2b3d;
}
.logo-baseline {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.logo-gedyco-compact {
    gap: 0.55rem;
}
.logo-gedyco-compact .logo-mark {
    width: 1.7rem;
    height: 1.7rem;
}
.logo-gedyco-compact .logo-word {
    font-size: 1.28rem;
    color: var(--header-text);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.nav a {
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(234, 241, 248, 0.72);
    text-decoration: none;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
}

.nav a:hover {
    color: var(--header-text);
    background: rgba(255, 255, 255, 0.08);
}
.nav a.active {
    color: #1a2433;
    background: #d5e6f6;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: rgba(234, 241, 248, 0.8);
    margin-left: 0.5rem;
}
.user-chip .user-role {
    background: rgba(255,255,255,0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}
.user-chip a {
    color: #7eb3e0;
    text-decoration: none;
}
.user-chip a:hover { text-decoration: underline; }
.user-chip a.btn-neg {
    color: #fff;
    padding: 0.25rem 0.7rem;
    min-height: 0;
    font-size: 0.8rem;
}
.nav a.nav-save {
    background: var(--action-pos);
    color: #fff;
}
.nav a.nav-save:hover {
    background: var(--action-pos-hover);
    color: #fff;
}
.nav-more-btn {
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(234, 241, 248, 0.72);
    background: transparent;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
}
.nav-more-btn:hover {
    color: var(--header-text);
    background: rgba(255, 255, 255, 0.08);
}
.nav-more-btn.active {
    color: #1a2433;
    background: #d5e6f6;
}
.user-chip-in-nav { display: none; }
.gate a.landing-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    background: var(--action-pos);
    color: #fff;
    border-radius: 8px;
}
.gate a.landing-btn:hover { background: var(--action-pos-hover); color: #fff; }

.footer {
    margin-top: auto;
    background: var(--header-bg);
    color: rgba(234, 241, 248, 0.72);
    border-top: 3px solid var(--primary);
    padding: 0.7rem 1.5rem;
    font-size: 0.82rem;
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.55rem;
}
.footer-name {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 600;
    color: var(--header-text);
}
.footer-sep { opacity: 0.45; }
.footer-net a {
    color: #7eb3e0;
    text-decoration: none;
}
.footer-net a:hover { text-decoration: underline; }

.app-flash {
    max-width: 1400px;
    margin: 0.85rem auto 0;
    padding: 0.6rem 0.95rem;
    border-radius: 8px;
    font-size: 0.9rem;
}
.app-flash-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.app-flash-ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
a.table-link,
.table-link {
    color: var(--action-pos);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
button.table-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}
a.table-link:hover,
.table-link:hover { color: var(--action-pos-hover); }
.recherche-objet-row { cursor: pointer; }

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.page h1 {
    font-family: "Source Serif 4", Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--muted);
    padding: 0.55rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
}
.crumb {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.crumb:hover { color: var(--primary-hover); }
.crumb-sep { color: var(--muted); }

.block.collapsed {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}
.block.collapsed .block-body,
.block.collapsed .header-actions {
    display: none;
}
.block-summary {
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}
.block.collapsed .block-summary:not(:empty) {
    display: inline;
}
.block-chevron {
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    margin-left: 0.35rem;
    flex: 0 0 auto;
}
.block.collapsed .block-chevron {
    transform: rotate(-45deg);
}
#sec-domaines .block-header,
#sec-familles .block-header,
#sec-categories .block-header {
    cursor: pointer;
}
.block.collapsed .block-header {
    margin-bottom: 0;
}

.block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.95rem 1.15rem;
    box-shadow: var(--shadow);
}

.block-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.block-header h2,
.block > h2 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #3d5268;
    min-width: 90px;
}

.search-input {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    width: 160px;
    outline: none;
}
.search-input:focus,
.inline-form input[type="text"]:focus,
.form-row input:focus,
.form-row select:focus,
.form-field input:focus,
.form-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.22);
    outline: none;
}

.inline-form {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}
.inline-form input[type="text"] {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    width: 160px;
    outline: none;
}
.inline-form button {
    padding: 0.4rem 0.8rem;
    background: var(--action-pos);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
}
.inline-form button:hover { background: var(--action-pos-hover); }
.inline-form button.btn-mute:hover { background: var(--action-mute-hover); }

.item-card {
    display: flex;
    flex-direction: row;      /* pas column */
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f4f8fc;
    min-width: 0;
    width: auto;              /* pas 100% */
    max-width: none;
    grid-column: auto;        /* pas 1 / -1 */
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(47, 111, 173, 0.22);
}

.item-card:hover { background: var(--hover); border-color: #b7c9dc; }
.item-card.selected {
    background: var(--selected);
    border-color: var(--selected-border);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--primary);
}
.attributs-table tr.selected { background: var(--selected); }
.attributs-table tbody tr:hover { background: #eef3f8; }

.btn-delete {
    font-size: 1.25rem;
    line-height: 1;
    color: #b42318;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}
.btn-delete:hover { opacity: 1; color: #ef4444; }

.empty, .empty-state {
    color: var(--muted);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

/* Attributs */
.attributs-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.attributs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.attributs-table th {
    text-align: left;
    padding: 0.5rem 0.7rem;
    border-bottom: 2px solid var(--border);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.attributs-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
}
.attributs-table code {
    background: var(--hover);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.add-attribut-form {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.form-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.form-row button {
    flex-shrink: 0;
    white-space: nowrap;
}
.form-row input[type="text"],
.form-row input[type="number"],
.form-row select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
}
.form-row input[type="text"] { flex: 1; min-width: 120px; }
.etq-check {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    white-space: nowrap;
}
.form-row.checks {
    align-items: center;
}
.form-row.checks label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    margin-right: 1rem;
    cursor: pointer;
}
.form-row.checks button {
    margin-left: auto;
    padding: 0.4rem 0.9rem;
    background: var(--action-pos);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}
.form-row.checks button:hover { background: var(--action-pos-hover); }

.filtre-perimetre {
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.75rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #f4f8fc;
}
.perimetre-block {
    flex: 1 0 100%;
    margin-top: 0.35rem;
}
.familles-perimetre {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem 1rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    max-height: 240px;
    overflow: auto;
    background: #f4f8fc;
}
.perimetre-domaine {
    font-size: 0.85rem;
}
.perimetre-domaine .options-title {
    margin-bottom: 0.2rem;
}
.perimetre-domaine label {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
}

/* Options de liste */
.options-row td {
    background: #eef3f8;
    padding: 0.6rem 0.75rem;
}
.options-block {
    padding-left: 0.5rem;
}
.options-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
.options-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}
.options-list li {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
}
.empty-options {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
.option-form {
    margin-left: 0;
}
.option-form input[type="text"] {
    width: 140px;
}
.order-btns {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-right: 0.25rem;
}

.btn-order {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.65rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.btn-order:hover {
    color: var(--primary);
}

.options-list li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form {
    display: flex;
    gap: 0.4rem;
    margin-left: 0;
}

.item-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
    cursor: pointer;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 0 0 auto;   /* largeur selon contenu, jamais écrasée */
}

.item-actions button {
    flex: 0 0 auto;
    position: static;  /* annule un éventuel position:absolute */
    margin: 0;
}

.cat-thumb {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    flex: 0 0 28px;
}

.btn-edit {
    background: none;
    border: none;
    color: var(--action-pos);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.2rem;
    opacity: 0.85;
}
.btn-edit:hover {
    opacity: 1;
    color: var(--action-pos-hover);
}
/*
.edit-form {
    width: 100%;
    display: flex;
    gap: 0.3rem;
    align-items: center;
}
.edit-form input[type="text"] {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.9rem;
}
.edit-form button {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
}
.edit-form button[type="submit"] {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
} */
.item-card.editing {
    grid-column: 1 / -1;   /* la carte occupe toute la largeur */
}

.item-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
}

.item-grid > .item-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    max-width: 100%;
    grid-column: auto;
    min-width: 0;
}

.item-grid > .item-card.editing {
    grid-column: 1 / -1;
}
.edit-form {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.edit-form input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.9rem;
}

.edit-form button {
    flex-shrink: 0;        /* boutons toujours visibles */
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
}

.edit-form button[type="submit"] {
    background: var(--action-pos);
    color: white;
    border-color: var(--action-pos);
}

.edit-form select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.85rem;
    max-width: 180px;
}

.attribut-edit-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    padding: 0.35rem 0;
}

.attribut-edit-form input[type="text"],
.attribut-edit-form select {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.85rem;
}

.attribut-edit-form label {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.btn-order {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0 0.15rem;
    line-height: 1;
}
.btn-order:hover {
    color: var(--primary-hover);
}

.breadcrumb-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border: 1px solid var(--action-pos);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--action-pos);
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}
.btn-export:hover {
    color: #fff;
    border-color: var(--action-pos-hover);
    background: var(--action-pos-hover);
}

.export-line {
    margin-bottom: 0.5rem;
}

.btn-image {
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.6;
    line-height: 1;
}
.btn-image:hover {
    opacity: 1;
}

.image-upload-form {
    display: inline;
    margin: 0;
}

.categorie-image-block {
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.categorie-image-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.categorie-image-preview img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.image-upload-form-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.image-upload-form-panel .hint {
    font-size: 0.8rem;
    color: var(--muted);
}
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    flex-direction: column;
    z-index: 1000;
}
.lightbox[hidden] { display: none !important; }
.lightbox-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    padding-top: max(0.55rem, env(safe-area-inset-top));
    background: var(--header-bg);
    color: var(--header-text);
}
.lightbox-bar span {
    font-weight: 600;
    font-size: 0.95rem;
}
.lightbox-fermer {
    min-height: 44px;
    min-width: 5.5rem;
    padding: 0.35rem 1rem;
    border: none;
    border-radius: 8px;
    background: #c5d0dc;
    color: #1c2b3d;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}
.lightbox-fermer:hover { background: #d3dde8; color: #1c2b3d; }
.lightbox-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
}
.lightbox img {
    max-width: min(92vw, 900px);
    max-height: calc(100vh - 5.5rem);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.lightbox.is-pdf .lightbox-stage { padding: 0; align-items: stretch; }
.lightbox.is-pdf iframe {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    border: 0;
    background: #525659;
}

.cat-thumb {
    cursor: zoom-in;
}

.categorie-active-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f4f8fc;
}
.cat-thumb-lg {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
}
.categorie-active-path {
    font-size: 0.8rem;
    color: var(--muted);
}
.categorie-active-name {
    font-size: 1.1rem;
    font-weight: 600;
}
.categorie-active-info { flex: 1; }

.objet-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 520px;
}
.form-field label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--muted);
}
.form-field input[type="text"],
.form-field select,
.form-field input[type="file"],
.form-field textarea {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}
.categorie-fiche {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f4f8fc;
    padding: 0.75rem 0.9rem 0.5rem;
    margin-bottom: 1.1rem;
}
.categorie-fiche-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.65rem;
}
.categorie-fiche-grid {
    display: grid;
    grid-template-columns: minmax(10rem, 16rem) minmax(8rem, 12rem) 1fr;
    gap: 0.75rem 1rem;
    align-items: start;
}
.categorie-fiche-desc textarea {
    min-height: 4.5rem;
    resize: vertical;
}
@media (max-width: 720px) {
    .categorie-fiche-grid { grid-template-columns: 1fr; }
}
.cat-edit-form {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
}
.cat-edit-form label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.cat-edit-form textarea {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
}
.cat-edit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
}
.cat-edit-row label { flex: 1 1 8rem; min-width: 0; }
.cat-edit-row select { max-width: none; width: 100%; }
.cat-edit-image {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}
.cat-edit-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.cat-create-form {
    margin: 0 0 0.9rem;
    padding: 0.75rem 0.85rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #f4f8fc;
}
.categorie-fiche-lecture .categorie-fiche-texte {
    margin: 0;
    font-size: 0.9rem;
    white-space: pre-wrap;
}
.categorie-fiche-lecture code {
    background: var(--hover);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}
.objet-fiche-page .objet-fiche {
    max-width: 44rem;
}
.objet-fiche {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f4f8fc;
    padding: 0.9rem 1rem 1rem;
    box-shadow: var(--shadow);
}
.objet-fiche-panel {
    margin: 0.75rem 0 1rem;
}
.objet-fiche-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.objet-fiche-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.objet-fiche-back {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.objet-fiche-back:hover { text-decoration: underline; }
.objet-fiche-path {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}
.objet-fiche-nom {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 0.85rem;
}
.objet-fiche-grid {
    display: grid;
    grid-template-columns: minmax(8rem, 16rem) 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
    margin-bottom: 1rem;
}
.objet-fiche-media img {
    display: block;
    width: 100%;
    max-height: 16rem;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.objet-fiche-pdf {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.4rem 0.8rem;
    background: var(--action-pos);
    color: #fff;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
}
.objet-fiche-pdf:hover { background: var(--action-pos-hover); color: #fff; }
.objet-fiche-fichier {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
    word-break: break-all;
}
.objet-fiche-meta .form-field p { margin: 0; }
.objet-fiche-muted {
    color: var(--muted);
    font-size: 0.85rem;
}
.objet-fiche-actions { margin-top: 0.5rem; }
.objet-fiche-attrs {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.objet-fiche-dl { margin: 0.4rem 0 0; }
.objet-fiche-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--hover);
}
.objet-fiche-row dt {
    color: var(--muted);
    font-weight: 500;
}
.objet-fiche-row dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}
@media (max-width: 720px) {
    .objet-fiche-grid { grid-template-columns: 1fr; }
}
.check-inline {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
}
.req { color: #dc2626; }
.badge-nommable {
    font-size: 0.7rem;
    font-weight: 600;
    background: #d5e6f6;
    color: #1e4d7b;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    margin-left: 0.25rem;
}
.serie-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    margin-top: 0.45rem;
}
.serie-panel { margin-top: 0.45rem; }
.rattache-groupe { margin: 0.65rem 0 0.9rem; }
.rattache-table th:first-child,
.rattache-table td:first-child { width: 2.2rem; text-align: center; }
.rattache-table th:nth-child(3),
.rattache-table td:nth-child(3),
.rattache-table th:nth-child(4),
.rattache-table td:nth-child(4) { width: 7rem; text-align: center; }
.serie-panel .btn-export { font-size: 0.8rem; padding: 0.2rem 0.55rem; }
.nom-calcule-box {
    background: #e7eef6;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}
.nom-calcule-label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}
.form-actions button[type="submit"] {
    padding: 0.55rem 1.2rem;
    background: var(--action-pos);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.form-actions button[type="submit"]:hover { background: var(--action-pos-hover); }
button[type="submit"]:not(.chip-btn):not(.btn-mute):not(.btn-neg) {
    background: var(--action-pos);
    color: #fff;
    border: 1px solid var(--action-pos);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0.45rem 1rem;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 8px;
}
button[type="submit"]:not(.chip-btn):not(.btn-mute):not(.btn-neg):hover {
    background: var(--action-pos-hover);
    border-color: var(--action-pos-hover);
    color: #fff;
}

.success-banner {
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    color: #065f46;
    font-size: 0.9rem;
}
.btn-success {
    padding: 0.4rem 0.9rem;
    background: var(--action-pos);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-success:hover { background: var(--action-pos-hover); }
button.btn-pos,
a.btn-pos,
.btn-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.45rem 1rem;
    background: var(--action-pos);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}
button.btn-pos:hover,
a.btn-pos:hover { background: var(--action-pos-hover); color: #fff; }
button.btn-neg,
a.btn-neg,
.btn-neg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.45rem 1rem;
    background: var(--action-neg);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}
button.btn-neg:hover,
a.btn-neg:hover { background: var(--action-neg-hover); color: #fff; }
button.btn-mute,
a.btn-mute,
.btn-mute {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.45rem 1rem;
    background: var(--action-mute);
    color: #eaf1f8;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
}
button.btn-mute:hover,
a.btn-mute:hover { background: var(--action-mute-hover); color: #fff; }
button.btn-mute.btn-icon {
    min-height: 2rem;
    min-width: 2rem;
    padding: 0.2rem 0.45rem;
    background: transparent;
    color: var(--action-mute);
    font-size: 1.15rem;
    line-height: 1;
}
button.btn-mute.btn-icon:hover {
    background: var(--hover);
    color: var(--action-mute-hover);
}
.lightbox-fermer.btn-mute {
    background: #c5d0dc;
    color: #1c2b3d;
}
.lightbox-fermer.btn-mute:hover {
    background: #eaf1f8;
    color: #1c2b3d;
}
.gate .btn-pos,
.gate .btn-neg {
    width: 100%;
}
.obj-liste-header {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.obj-liste-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}
#filtre-type {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.85rem;
}

.obj-nom-cell .obj-tip { display: none; }
.obj-tip-float {
    position: fixed;
    z-index: 4000;
    min-width: 220px;
    max-width: 360px;
    padding: 0.55rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(28, 43, 61, 0.18);
    font-size: 0.8rem;
    line-height: 1.35;
    pointer-events: none;
    color: var(--text);
}
.obj-tip-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}
.obj-tip-k {
    color: var(--muted);
}
.obj-tip-v {
    font-weight: 600;
    text-align: right;
}

.recherche-intro {
    color: var(--muted);
    margin: 0.15rem 0 0.35rem;
    font-size: 0.95rem;
}
.recherche-search label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #3d5268;
}
.recherche-search input[type="search"] {
    width: 100%;
    max-width: 36rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
}
.recherche-search input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.22);
    outline: none;
}
.rech-section {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin: 0.9rem 0 0.45rem;
}
.rech-hit {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
}
.rech-hit-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.65rem;
}
.rech-hit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
    min-height: 44px;
}
.rech-list { list-style: none; padding: 0; margin: 0; }
.rech-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #d5e6f6;
    color: #1e4d7b;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
}
.rech-nested { margin-top: 0.5rem; }
.rech-nested-kicker {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 0.2rem;
}
.rech-nested ul { list-style: none; padding: 0; margin: 0; }
.rech-nested li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.6rem;
    padding: 0.28rem 0;
    min-height: 40px;
    border-top: 1px solid var(--hover);
}
.recherche-wizard { margin-top: 0.25rem; }
.recherche-question {
    font-size: 1.15rem;
    font-weight: 650;
    margin: 0.35rem 0 0.75rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    min-width: 0;
}
.recherche-question span {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.9rem;
}
.recherche-choix {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.choix-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.chip-form { display: inline; }
.chip-btn {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f4f8fc;
    color: var(--text);
    cursor: pointer;
}
.chip-btn:hover {
    border-color: var(--primary);
    background: var(--selected);
}
.chip-n {
    margin-left: 0.35rem;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}
.recherche-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.recherche-detail {
    font-size: 0.82rem;
    color: var(--muted);
}
.recherche-detail span {
    display: inline-block;
    margin-right: 0.75rem;
}

@media (min-width: 901px) {
    .nav-more { display: contents; }
    .nav-more-btn { display: none; }
    .nav-more-panel {
        display: contents;
    }
    .nav-more-panel[hidden] {
        display: contents !important;
    }
}
@media (max-width: 900px) {
    .header {
        padding: 0.65rem 0.9rem;
    }
    .header-inner {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.5rem;
    }
    .user-chip-header { display: none; }
    .nav {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        min-width: 0;
    }
    .nav a {
        padding: 0.5rem 0.55rem;
        font-size: 0.82rem;
    }
    .nav-more { position: relative; flex: 0 0 auto; }
    .nav-more-btn {
        min-height: 44px;
        padding: 0.5rem 0.75rem;
        font-weight: 600;
    }
    .nav-more-panel {
        display: none;
        position: absolute;
        top: calc(100% + 0.35rem);
        right: 0;
        min-width: 13.5rem;
        padding: 0.4rem;
        background: var(--header-bg);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 12px;
        box-shadow: 0 10px 28px rgba(0,0,0,0.35);
        flex-direction: column;
        z-index: 50;
    }
    .nav-more.open .nav-more-panel {
        display: flex !important;
    }
    .nav-more-panel a {
        display: flex;
        align-items: center;
        min-height: 44px;
        border-radius: 8px;
        white-space: nowrap;
    }
    .user-chip-in-nav {
        display: flex;
        flex-wrap: wrap;
        margin: 0.4rem 0.15rem 0.15rem;
        padding-top: 0.45rem;
        border-top: 1px solid rgba(255,255,255,0.12);
    }
}
@media (max-width: 720px) {
    .page {
        padding: 1rem 0.9rem 2rem;
    }
}

/* Accueil / identification */
body.landing-body main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
}
.gate {
    width: 100%;
    max-width: 26rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.6rem;
}
.gate .logo-gedyco {
    justify-content: center;
}
.logo-gedyco-animated {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
}
.logo-mark-anim {
    width: 8.5rem;
    height: 8.5rem;
    border-radius: 1.35rem;
    object-fit: cover;
    box-shadow: 0 12px 36px rgba(28, 43, 61, 0.22);
}
.logo-gedyco-animated .logo-word {
    font-size: 2.7rem;
}
.logo-gedyco-animated .logo-baseline {
    letter-spacing: 0.08em;
}
.gate-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.15rem 1.2rem 1.2rem;
    box-shadow: var(--shadow);
}
.gate-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}
.gate-form input {
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
}
.gate-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.22);
    outline: none;
}
.gate-form button {
    margin-top: 0.25rem;
}
.gate-soon {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}
.gate-soon a {
    color: var(--primary);
    font-weight: 600;
    word-break: break-all;
}
.gate-skip {
    text-align: center;
}

.aide {
    display: grid;
    grid-template-columns: 13rem 1fr;
    gap: 1.75rem;
    align-items: start;
}
.aide-toc {
    position: sticky;
    top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.88rem;
    padding: 0.75rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.aide-toc a {
    color: var(--primary);
    text-decoration: none;
}
.aide-toc a:hover { text-decoration: underline; }
.aide-body h1 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.55rem;
    margin-bottom: 0.5rem;
}
.aide-lead { color: var(--muted); margin-bottom: 1.25rem; }
.aide-body h2 {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.2rem;
    margin: 1.6rem 0 0.55rem;
    padding-top: 0.2rem;
}
.aide-body h3 {
    font-size: 0.98rem;
    margin: 0.9rem 0 0.35rem;
}
.aide-body p, .aide-body li { font-size: 0.95rem; }
.aide-body ul, .aide-body ol { margin: 0.35rem 0 0.7rem 1.2rem; }
.aide-body li { margin-bottom: 0.25rem; }
.aide-body section { scroll-margin-top: 0.75rem; }
.aide-fig {
    margin: 0.6rem 0 1rem;
}
.aide-fig img {
    display: block;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.aide-fig-empty {
    padding: 1.4rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #f4f8fc;
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
}
.aide-fig figcaption {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.35rem;
}
@media (max-width: 860px) {
    .aide { grid-template-columns: 1fr; }
    .aide-toc { position: static; flex-direction: row; flex-wrap: wrap; }
}

@media (hover: none), (pointer: coarse) {
    .item-card:hover {
        background: #f4f8fc;
        border-color: var(--border);
    }
    .item-card.selected:hover {
        background: var(--selected);
        border-color: var(--selected-border);
    }
    .attributs-table tbody tr:hover { background: transparent; }
    .attributs-table tbody tr.selected:hover { background: var(--selected); }
    .nav a:hover {
        color: rgba(234, 241, 248, 0.72);
        background: transparent;
    }
    .nav a.active:hover {
        color: #1a2433;
        background: #d5e6f6;
    }
    .item-card,
    .item-name,
    .crumb,
    .block-header,
    .recherche-objet-row,
    .rech-hit-row,
    .rech-nested li,
    .obj-nom,
    .emp-objet a {
        min-height: 44px;
    }
    .item-actions button,
    .btn-edit,
    .btn-delete,
    .btn-order {
        min-width: 44px;
        min-height: 44px;
    }
    .nav a,
    .nav-more-btn {
        padding: 0.55rem 0.75rem;
        min-height: 44px;
    }
}