/* =========================================================
   Admin - Racines
   Formulaire centré et compact / liste pleine largeur
   ========================================================= */

.roots-admin-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}


/* =========================================================
   En-tête
   ========================================================= */

.roots-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    width: 100%;
    box-sizing: border-box;

    padding: 26px 28px;

    background: #ffffff;
    border: 1px solid #dfe8ef;
    border-radius: 22px;

    box-shadow: 0 7px 20px rgba(31, 60, 90, 0.07);
}

.roots-page-header-form {
    justify-content: flex-start;
}

.roots-page-kicker {
    margin-bottom: 5px;

    color: #109c9b;

    font-size: 0.78rem;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.roots-page-header h1 {
    margin: 0;

    color: #102b56;

    font-size: clamp(1.8rem, 3vw, 2.45rem);
    font-weight: 900;
    line-height: 1.1;
}

.roots-page-header p {
    max-width: 800px;

    margin: 9px 0 0;

    color: #536579;

    line-height: 1.55;
}


/* =========================================================
   Boutons
   ========================================================= */

.roots-primary-button,
.roots-secondary-button,
.roots-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;

    border-radius: 12px;

    font-weight: 800;
    text-decoration: none !important;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.roots-primary-button {
    padding: 10px 15px;

    border: 1px solid #109c9b;
    background: #109c9b;

    color: #ffffff !important;
}

.roots-primary-button:hover {
    background: #0d8988;
    border-color: #0d8988;

    transform: translateY(-1px);
}

.roots-secondary-button {
    padding: 9px 14px;

    border: 1px solid #cfdce5;
    background: #ffffff;

    color: #40556b !important;
}

.roots-secondary-button:hover {
    background: #f7fafc;

    transform: translateY(-1px);
}


/* =========================================================
   Panneaux
   ========================================================= */

.roots-panel,
.roots-form-panel {
    width: 100%;
    box-sizing: border-box;

    padding: 26px 28px;

    background: #ffffff;

    border: 1px solid #dfe8ef;
    border-radius: 22px;

    box-shadow: 0 7px 20px rgba(31, 60, 90, 0.07);
}

/* Liste pleine largeur ; formulaire compact et centré */
.roots-form-panel {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   Liste
   ========================================================= */

.roots-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 20px;
}

.roots-search {
    flex: 1;
    max-width: 500px;
    min-width: 0;
}

.roots-search label,
.roots-field label {
    display: block;

    margin-bottom: 7px;

    color: #334a61;

    font-size: 0.87rem;
    font-weight: 800;
}

.roots-search input,
.roots-field input,
.roots-field textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 11px 13px;

    border: 1px solid #cfdce5;
    border-radius: 11px;

    background: #ffffff;

    color: #20384f;

    font: inherit;
    line-height: 1.45;
}

.roots-search input:focus,
.roots-field input:focus,
.roots-field textarea:focus {
    outline: 2px solid rgba(16, 156, 155, 0.15);
    border-color: #109c9b;
}

.roots-count {
    padding-bottom: 10px;

    color: #718196;

    font-size: 0.86rem;
    font-weight: 800;
}

.roots-table-wrapper {
    overflow-x: auto;
}

.roots-table {
    width: 100%;
    border-collapse: collapse;
}

.roots-table th,
.roots-table td {
    padding: 13px 12px;

    border-bottom: 1px solid #e8eef3;

    text-align: left;
    vertical-align: middle;
}

.roots-table th {
    color: #536579;

    font-size: 0.78rem;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.roots-col-order {
    width: 80px;
}

.roots-col-arabic {
    width: 160px;
}

.roots-col-actions {
    width: 200px;
}

.roots-arabic-cell {
    direction: rtl;

    color: #102b56;

    font-size: 1.65rem;
    font-weight: 800;

    white-space: nowrap;
}

.roots-explanation-cell {
    max-width: 520px;

    color: #536579;

    line-height: 1.5;
}

.roots-empty-row {
    padding: 30px !important;

    color: #718196;

    text-align: center !important;
}

.roots-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.roots-action-button {
    padding: 7px 10px;

    border: 1px solid #d3dfe7;

    background: #ffffff;

    color: #40556b !important;

    font-size: 0.82rem;
}

.roots-action-button:hover {
    background: #f6f9fb;
}

.roots-action-delete {
    border-color: #f0c7c7;

    color: #a64646 !important;
}


/* =========================================================
   Messages
   ========================================================= */

.roots-message {
    margin-bottom: 18px;
    padding: 12px 14px;

    border-radius: 11px;

    font-size: 0.9rem;
    font-weight: 700;
}

.roots-message.is-success {
    background: #eefaf3;
    border: 1px solid #bfe4cc;

    color: #22613a;
}

.roots-message.is-error {
    background: #fff2f2;
    border: 1px solid #efc5c5;

    color: #8b3535;
}


/* =========================================================
   Formulaire
   ========================================================= */

.roots-form-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 24px;
    padding-bottom: 16px;

    border-bottom: 1px solid #e8eef3;
}

.roots-form-title-row h2 {
    margin: 0;

    color: #102b56;

    font-size: 1.25rem;
    font-weight: 900;
}

.roots-form-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(200px, 260px);

    column-gap: 34px;
    row-gap: 26px;
}

.roots-form-grid > * {
    min-width: 0;
}

.roots-field {
    min-width: 0;
}

.roots-field small {
    display: block;

    margin-top: 7px;

    color: #7a8999;

    line-height: 1.45;
}

.roots-field textarea {
    min-height: 115px;
    resize: vertical;
}

.roots-field-arabic input {
    padding-top: 13px;
    padding-bottom: 13px;

    font-size: 1.7rem;
}

.roots-field-full {
    grid-column: 1 / -1;
}

.roots-required {
    color: #b84545;
}


/* =========================================================
   Aperçu
   ========================================================= */

.roots-preview-box {
    display: flex;
    flex-direction: column;
    justify-content: center;

    min-width: 0;
    min-height: 120px;
    box-sizing: border-box;

    padding: 16px 18px;

    border: 1px dashed #b9d7df;
    border-radius: 16px;

    background: #f8fdfe;
}

.roots-preview-label {
    margin-bottom: 8px;

    color: #718196;

    font-size: 0.76rem;
    font-weight: 900;

    text-transform: uppercase;
    letter-spacing: 0.55px;
}

.roots-preview-arabic {
    color: #102b56;

    font-size: 2.4rem;
    font-weight: 900;

    text-align: center;
    letter-spacing: 0.18em;
    line-height: 1.25;
}


/* =========================================================
   Actions formulaire
   ========================================================= */

.roots-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;

    margin-top: 28px;
    padding-top: 20px;

    border-top: 1px solid #e7edf2;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1000px) {
    .roots-form-panel {
        max-width: none;
    }
}

@media (max-width: 900px) {
    .roots-form-grid {
        grid-template-columns: 1fr;

        column-gap: 0;
        row-gap: 22px;
    }

    .roots-field-full {
        grid-column: auto;
    }
}

@media (max-width: 800px) {
    .roots-page-header,
    .roots-toolbar,
    .roots-form-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .roots-page-header .roots-primary-button {
        align-self: flex-start;
    }

    .roots-search {
        max-width: none;
    }

    .roots-count {
        padding-bottom: 0;
    }
}

@media (max-width: 520px) {
    .roots-page-header,
    .roots-panel,
    .roots-form-panel {
        padding: 18px;

        border-radius: 17px;
    }

    .roots-form-actions {
        flex-direction: column-reverse;
    }

    .roots-form-actions > * {
        width: 100%;
    }

    .roots-preview-arabic {
        font-size: 2rem;
    }
}
