.notes-page .notes-filter-combos {
    grid-template-columns: minmax(280px, 1.7fr) minmax(180px, .8fr) minmax(150px, .65fr) auto;
}

.notes-page .note-main-cell {
    min-width: 260px;
}

.notes-page .note-title-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.notes-page .note-title-row .mud-icon-root {
    color: #64748b;
    flex: 0 0 auto;
}

.notes-page .note-file-name,
.notes-page .note-muted {
    display: block;
    margin-top: .25rem;
    color: #64748b;
    font-size: .78rem;
}

.notes-page .note-label-list {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.notes-page .note-label-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .5rem;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .75rem;
    font-weight: 650;
    line-height: 1.2;
}

.notes-page .note-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: .28rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}

.notes-page .note-status-active {
    background: #dcfce7;
    color: #166534;
}

.notes-page .note-status-inactive {
    background: #e2e8f0;
    color: #475569;
}

.notes-page .note-row-inactive td {
    background: #f8fafc;
    color: #64748b;
}

.notes-page .note-task-count {
    text-align: center;
    color: #475569;
    font-weight: 700;
}

.notes-page .note-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.notes-page .note-detail-heading .note-status {
    margin-top: .55rem;
}

.notes-page .note-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.25rem;
    align-items: start;
}

.notes-page .note-detail-main {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.notes-page .note-info-card {
    position: sticky;
    top: 132px;
}

.notes-page .note-info-card > h2,
.notes-page .note-section-heading h2 {
    margin: 0;
    font-size: 1.05rem;
    color: #0f172a;
}

.notes-page .note-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.notes-page .note-section-heading p {
    margin: .25rem 0 0;
    color: #64748b;
    font-size: .86rem;
}

.notes-page .note-project-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.notes-page .note-project-locked {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .75rem .9rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
}

.notes-page .note-project-locked > span {
    color: #64748b;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.notes-page .note-project-locked strong {
    flex: 1;
    color: #0f172a;
    font-size: .9rem;
}

.notes-page .note-project-locked .mud-icon-root {
    color: #94a3b8;
}

.notes-page .note-file-editor {
    display: grid;
    gap: .7rem;
    margin-top: 1rem;
}

.notes-page .note-current-file {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .75rem .85rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
}

.notes-page .note-current-file > div {
    display: grid;
    gap: .15rem;
    flex: 1;
    min-width: 0;
}

.notes-page .note-current-file strong {
    color: #0f172a;
    overflow-wrap: anywhere;
}

.notes-page .note-current-file span {
    color: #64748b;
    font-size: .78rem;
}

.notes-page .note-file-action {
    color: #2563eb;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.notes-page .note-file-action:hover {
    text-decoration: underline;
}

.notes-page .note-selected-file {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .7rem;
    border-radius: 8px;
    background: #eff6ff;
    color: #1e40af;
    font-size: .82rem;
}

.notes-page .note-selected-file strong {
    margin-left: auto;
    color: #1d4ed8;
}

.notes-page .note-upload-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    width: fit-content;
    padding: .55rem .85rem;
    border: 1px solid #2563eb;
    border-radius: 8px;
    background: #fff;
    color: #2563eb;
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
}

.notes-page .note-upload-button:hover {
    background: #eff6ff;
}

.notes-page .note-upload-button.disabled {
    opacity: .55;
    cursor: default;
}

.notes-page .note-upload-button input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.notes-page .note-help {
    color: #64748b;
    font-size: .78rem;
}

.notes-page .note-label-editor {
    display: grid;
    gap: .65rem;
    margin-top: 1.2rem;
}

.notes-page .note-label-editor > label {
    color: #475569;
    font-size: .82rem;
    font-weight: 700;
}

.notes-page .note-label-entry {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.notes-page .note-label-entry .task-create-input {
    flex: 1;
}

.notes-page .note-label-list-edit {
    margin-top: .1rem;
}

.notes-page .note-label-chip-edit button {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: .8;
}

.notes-page .note-linked-task-list {
    display: grid;
    gap: .55rem;
}

.notes-page .note-linked-task {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: .6rem;
    align-items: center;
    padding: .7rem .8rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    color: #0f172a;
    text-decoration: none;
}

.notes-page .note-linked-task:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.notes-page .note-linked-task > span {
    color: #64748b;
    font-size: .76rem;
    font-weight: 700;
}

.notes-page .note-linked-task small {
    color: #64748b;
}

.notes-page .note-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(15, 23, 42, .55);
}

.notes-page .note-dialog {
    width: min(520px, 100%);
    padding: 1.25rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.notes-page .note-dialog h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.15rem;
}

.notes-page .note-dialog p {
    margin: .65rem 0 1rem;
    color: #475569;
    line-height: 1.5;
}

.notes-page .note-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
}

@media (max-width: 1100px) {
    .notes-page .notes-filter-combos {
        grid-template-columns: 1fr 1fr;
    }

    .notes-page .note-detail-layout {
        grid-template-columns: 1fr;
    }

    .notes-page .note-info-card {
        position: static;
    }
}

@media (max-width: 700px) {
    .notes-page .notes-filter-combos,
    .notes-page .note-project-selectors {
        grid-template-columns: 1fr;
    }

    .notes-page .note-current-file,
    .notes-page .note-label-entry {
        align-items: flex-start;
        flex-direction: column;
    }

    .notes-page .note-current-file > div,
    .notes-page .note-label-entry .task-create-input {
        width: 100%;
    }

    .notes-page .note-linked-task {
        grid-template-columns: 1fr;
    }
}

/* Notes liées depuis une fiche tâche. */
.task-notes-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.task-notes-heading h2 {
    margin: 0;
}

.task-notes-heading p {
    margin: .25rem 0 0;
    color: #64748b;
    font-size: .86rem;
}

.task-notes-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
}

.task-note-list {
    display: grid;
    gap: .65rem;
}

.task-note-card {
    display: flex;
    align-items: center;
    gap: .55rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.task-note-card:hover {
    border-color: #bfdbfe;
}

.task-note-card.inactive {
    background: #f8fafc;
}

.task-note-card-main {
    display: grid;
    gap: .3rem;
    flex: 1;
    min-width: 0;
    padding: .75rem .85rem;
    color: #0f172a;
    text-decoration: none;
}

.task-note-card-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
}

.task-note-file,
.task-note-link-meta {
    color: #64748b;
    font-size: .77rem;
    overflow-wrap: anywhere;
}

.task-note-labels {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.task-note-card .note-label-chip {
    display: inline-flex;
    align-items: center;
    padding: .18rem .45rem;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .72rem;
    font-weight: 650;
}

.task-note-card .note-status {
    display: inline-flex;
    align-items: center;
    padding: .2rem .45rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
}

.task-note-card .note-status-inactive {
    background: #e2e8f0;
    color: #475569;
}

.task-note-link-dialog {
    width: min(720px, calc(100vw - 2rem));
}

.task-note-link-dialog-list {
    display: grid;
    gap: .5rem;
    max-height: 52vh;
    margin-top: .85rem;
    overflow: auto;
}

.task-note-link-dialog-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.task-note-link-dialog-item:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #f8fbff;
}

.task-note-link-dialog-item:disabled {
    opacity: .6;
    cursor: default;
}

.task-note-link-dialog-item > span {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.task-note-link-dialog-item small {
    color: #64748b;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .task-notes-heading {
        flex-direction: column;
    }

    .task-notes-heading-actions {
        justify-content: flex-start;
    }
}
