/* Les Darons – Répertoire (admin) */
:root {
    --ldrp-black: #111;
    --ldrp-ivory: #f1efe8;
    --ldrp-grey: #666;
    --ldrp-light: #faf9f6;
}

.ldrp-admin-wrap {
    background: #fff;
    padding: 24px 24px 32px;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.05);
}

.ldrp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.ldrp-kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--ldrp-grey);
}

.ldrp-header h1 {
    margin: 4px 0 0;
    font-size: 26px;
}

.ldrp-actions button + button {
    margin-left: 6px;
}

.ldrp-inline-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 13px;
}

td.is-editing {
    padding: 4px;
}

.ldrp-inline-input textarea {
    min-height: 60px;
}

.ldrp-import-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f6f6f6;
    border: 1px solid #e0e0e0;
    font-size: 12px;
    color: var(--ldrp-grey);
}

.ldrp-import-status::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid #d0d0d0;
    border-top-color: #111;
    border-radius: 50%;
    display: inline-block;
    animation: ldrp-spin 0.8s linear infinite;
}

.ldrp-import-status:not(.is-active) {
    display: none;
}

.ldrp-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #f8f8f8;
    font-size: 12px;
    color: #444;
}

.ldrp-status.is-error {
    border-color: #e08b8b;
    background: #fff1f1;
    color: #a20000;
}

.ldrp-status:not(.is-info):not(.is-error) {
    display: none;
}

.ldrp-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ldrp-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ldrp-search input[type="search"] {
    min-width: 280px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d9d9d9;
    background: var(--ldrp-ivory);
}

.ldrp-bulk {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #111;
    color: #fff;
}

.ldrp-table-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
}

#ldrp-table thead th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

#ldrp-table th, #ldrp-table td {
    vertical-align: middle;
}

#ldrp-table td {
    font-size: 13px;
}

#ldrp-table tbody tr:hover {
    background: #f8f8f8;
}

.ldrp-col-actions {
    text-align: right;
    white-space: nowrap;
}

.ldrp-col-checkbox {
    width: 32px;
    text-align: center;
}

.ldrp-col-small {
    width: 80px;
    text-align: right;
}

.ldrp-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ldrp-notes-preview {
    display: inline-block;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ldrp-footnote {
    margin-top: 10px;
    color: var(--ldrp-grey);
}

/* --------------------------------------------------
   Modal
-------------------------------------------------- */
.ldrp-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.ldrp-modal.is-visible {
    display: flex;
}

.ldrp-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(1px);
}

.ldrp-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 20px 20px 12px;
    width: min(860px, 96vw);
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 55px rgba(0,0,0,0.18);
}

.ldrp-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ldrp-modal__close {
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    color: #333;
}

.ldrp-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.ldrp-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.ldrp-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.ldrp-grid label,
.ldrp-notes {
    font-weight: 600;
    color: #222;
}

.ldrp-grid input,
.ldrp-grid select,
.ldrp-notes textarea {
    width: 100%;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid #d9d9d9;
    padding: 8px 10px;
    background: var(--ldrp-light);
    font-weight: 400;
}

.ldrp-notes textarea {
    resize: vertical;
}

.ldrp-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.ldrp-lock {
    overflow: hidden;
}

@keyframes ldrp-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------
   Responsive
-------------------------------------------------- */
@media (max-width: 760px) {
    .ldrp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ldrp-actions {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .ldrp-search input[type="search"] {
        width: 100%;
    }
}
