.demandes-page {
    width: 100%;
}

.demandes-page .demandes-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.demandes-page .section-kicker {
    margin-bottom: 7px;
    color: #2563eb;
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.12em;
}

.demandes-page .demandes-heading h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.75rem, 2.2vw, 2.25rem);
    font-weight: 780;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.demandes-page .demandes-heading p {
    max-width: 760px;
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.95rem;
}

.demandes-page .create-request-panel,
.demandes-page .requests-section {
    border-color: #e4eaf2 !important;
    border-radius: 14px !important;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.03);
}

.demandes-page .create-request-panel {
    margin-bottom: 24px;
    padding: 22px;
}

.demandes-page .create-request-header,
.demandes-page .requests-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.demandes-page .create-request-header {
    margin-bottom: 22px;
}

.demandes-page .request-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.demandes-page .request-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.demandes-page .request-field-wide {
    margin-bottom: 18px;
}

.demandes-page .request-field label {
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
}

.demandes-page .request-select {
    width: 100%;
    min-height: 42px;
    padding: 0 38px 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    background: #fff;
    color: #0f172a;
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.demandes-page .request-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.09);
}

.demandes-page .request-select:disabled {
    background: #f8fafc;
    color: #94a3b8;
}

.demandes-page .request-help {
    color: #64748b;
    font-size: 0.76rem;
}

.demandes-page .request-title-field {
    margin-bottom: 18px;
}

.demandes-page .attachment-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    color: #64748b;
    font-size: 0.8rem;
}

.demandes-page .create-request-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #edf1f6;
}

.demandes-page .requests-section {
    overflow: hidden;
}

.demandes-page .requests-section-heading {
    align-items: center;
    padding: 20px 22px;
    border-bottom: 1px solid #edf1f6;
}

.demandes-page .request-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
}

.demandes-page .requests-loading,
.demandes-page .requests-empty {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demandes-page .requests-empty {
    flex-direction: column;
    gap: 6px;
    padding: 40px 20px;
    text-align: center;
}

.demandes-page .requests-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: #eff6ff;
    color: #2563eb;
}

.demandes-page .requests-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.demandes-page .requests-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.demandes-page .requests-table th,
.demandes-page .requests-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #edf1f6;
    text-align: left;
    vertical-align: middle;
}

.demandes-page .requests-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.demandes-page .requests-table tbody tr:last-child td {
    border-bottom: 0;
}

.demandes-page .requests-table tbody tr:hover {
    background: #fbfdff;
}

.demandes-page .request-main-cell {
    min-width: 285px;
}

.demandes-page .request-main-cell strong,
.demandes-page .request-main-cell span,
.demandes-page .request-project-cell strong,
.demandes-page .request-project-cell span,
.demandes-page .request-user-cell span,
.demandes-page .request-user-cell small {
    display: block;
}

.demandes-page .request-main-cell strong {
    margin: 2px 0 4px;
    color: #0f172a;
    font-size: 0.9rem;
}

.demandes-page .request-main-cell span,
.demandes-page .request-project-cell span,
.demandes-page .request-user-cell small {
    color: #64748b;
    font-size: 0.77rem;
    line-height: 1.4;
}

.demandes-page .request-reference {
    color: #2563eb;
    font-size: 0.7rem;
    font-weight: 800;
}

.demandes-page .request-project-cell strong,
.demandes-page .request-user-cell span {
    color: #334155;
    font-size: 0.82rem;
}

.demandes-page .request-user-cell small {
    margin-top: 3px;
}

.demandes-page .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.demandes-page .status-new {
    background: #eff6ff;
    color: #1d4ed8;
}

.demandes-page .request-date-cell {
    white-space: nowrap;
    color: #475569;
    font-size: 0.8rem;
}

@media (max-width: 760px) {
    .demandes-page .demandes-heading {
        flex-direction: column;
    }

    .demandes-page .demandes-heading .mud-button-root {
        width: 100%;
    }

    .demandes-page .request-grid {
        grid-template-columns: 1fr;
    }

    .demandes-page .create-request-actions {
        flex-direction: column-reverse;
    }

    .demandes-page .create-request-actions .mud-button-root {
        width: 100%;
    }
}

.demandes-page .request-title-link,
.demandes-page .request-task-link,
.demandes-page .back-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 750;
}

.demandes-page .request-title-link:hover,
.demandes-page .request-task-link:hover,
.demandes-page .back-link:hover {
    text-decoration: underline;
}

.demandes-page .request-main-cell .request-title-link {
    display: block;
    margin: 2px 0 4px;
    color: #0f172a;
    font-size: 0.9rem;
}

.demandes-page .status-handled {
    background: #ecfdf5;
    color: #047857;
}

.demandes-page .request-action-cell {
    min-width: 150px;
    white-space: nowrap;
}

.demandes-page .request-action-empty {
    color: #94a3b8;
}

.demandes-page .back-link {
    display: inline-flex;
    margin-bottom: 18px;
    font-size: 0.86rem;
}

.demandes-page .detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.demandes-page .detail-heading h1 {
    margin: 5px 0 10px;
    color: #0f172a;
    font-size: clamp(1.6rem, 2vw, 2.1rem);
    line-height: 1.15;
}

.demandes-page .detail-badges {
    display: flex;
    gap: 8px;
}

.demandes-page .handled-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px 18px;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    background: #f0fdf4;
}

.demandes-page .handled-banner strong,
.demandes-page .handled-banner span {
    display: block;
}

.demandes-page .handled-banner strong {
    color: #065f46;
    font-size: 0.9rem;
}

.demandes-page .handled-banner span {
    margin-top: 2px;
    color: #047857;
    font-size: 0.8rem;
}

.demandes-page .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
    gap: 20px;
}

.demandes-page .detail-main-card,
.demandes-page .detail-side-card {
    padding: 22px;
    border: 1px solid #e4eaf2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.03);
}

.demandes-page .detail-main-card h2,
.demandes-page .detail-side-card h2 {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 1rem;
}

.demandes-page .detail-description {
    color: #334155;
    font-size: 0.93rem;
    line-height: 1.65;
    white-space: pre-wrap;
}

.demandes-page .detail-list {
    margin: 0;
}

.demandes-page .detail-list > div {
    padding: 10px 0;
    border-bottom: 1px solid #edf1f6;
}

.demandes-page .detail-list > div:first-child {
    padding-top: 0;
}

.demandes-page .detail-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.demandes-page .detail-list dt {
    margin-bottom: 3px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.demandes-page .detail-list dd {
    margin: 0;
    color: #1e293b;
    font-size: 0.86rem;
}

@media (max-width: 900px) {
    .demandes-page .detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .demandes-page .detail-heading,
    .demandes-page .handled-banner {
        flex-direction: column;
        align-items: stretch;
    }
}

.demandes-page .detail-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.demandes-page .detail-main-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.demandes-page .request-edit-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.demandes-page .request-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.demandes-page .messages-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.demandes-page .messages-heading h2 {
    margin: 0;
}

.demandes-page .messages-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 800;
}

.demandes-page .messages-empty {
    padding: 18px;
    border: 1px dashed #dbe3ee;
    border-radius: 10px;
    color: #64748b;
    font-size: 0.86rem;
    text-align: center;
}

.demandes-page .messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demandes-page .message-item {
    padding: 14px 16px;
    border: 1px solid #e5eaf1;
    border-radius: 11px;
    background: #f8fafc;
}

.demandes-page .message-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 7px;
}

.demandes-page .message-meta strong {
    min-width: 0;
    overflow: hidden;
    color: #1e293b;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demandes-page .message-meta time {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 0.72rem;
}

.demandes-page .message-text {
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.demandes-page .message-composer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #edf1f6;
}

.demandes-page .message-composer-actions {
    display: flex;
    justify-content: flex-end;
}

.demandes-page .messages-readonly-note {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 9px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.8rem;
}

@media (max-width: 760px) {
    .demandes-page .detail-heading-actions,
    .demandes-page .request-edit-actions,
    .demandes-page .message-composer-actions {
        width: 100%;
    }

    .demandes-page .detail-heading-actions .mud-button-root,
    .demandes-page .request-edit-actions .mud-button-root,
    .demandes-page .message-composer-actions .mud-button-root {
        flex: 1 1 auto;
    }

    .demandes-page .message-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}

.demandes-page .detail-side-card {
    align-self: start;
}
