.messages {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.message {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    background: var(--surface);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: var(--border-radius);
    padding: 24px;
    color: var(--text-secondary);
}

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--border-radius);
    padding: 11px 14px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.button-primary:hover,
.button-primary:focus {
    background: var(--primary-dark);
}

.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 10px 14px;
    background: var(--surface);
    color: var(--text-primary);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.button-link {
    display: inline-block;
    text-decoration: none;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.875rem;
    font-weight: 700;
}

.badge-success {
    background: color-mix(in srgb, var(--surface) 70%, #2b946c 30%);
    color: var(--text-primary);
}

.badge-muted {
    background: color-mix(in srgb, var(--surface) 70%, var(--border) 30%);
    color: var(--text-secondary);
}

.document-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 700;
}

.document-status span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.document-status-complete span {
    background: #2b946c;
}

.document-status-pending span {
    background: #c58a22;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.data-table th {
    background: color-mix(in srgb, var(--surface) 82%, var(--primary) 18%);
    font-size: 0.875rem;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    min-width: 82px;
}

.table-actions a,
.table-actions button {
    margin: 0;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ==========================================================
   MENU DE AÇÕES DOS MEMBROS
   ========================================================== */

.table-actions {
    position: relative;

    min-width: 70px;

    text-align: center;
}


/* ==========================================================
   DETAILS
   ========================================================== */

.row-action-menu {
    position: relative;

    display: inline-flex;

    align-items: center;
    justify-content: center;
}


/* ==========================================================
   ENGRENAGEM
   ========================================================== */

.row-action-menu summary {
    position: relative;

    display: inline-grid;

    width: 38px;
    height: 38px;

    place-items: center;

    border: 1px solid
        color-mix(
            in srgb,
            var(--border) 80%,
            transparent
        );

    border-radius: 10px;

    background:
        color-mix(
            in srgb,
            var(--surface) 90%,
            transparent
        );

    color: var(--text-secondary);

    cursor: pointer;

    list-style: none;

    outline: none;

    transition:
        color 180ms ease,
        background 180ms ease,
        border-color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}


.row-action-menu summary::-webkit-details-marker {
    display: none;
}


.row-action-menu summary::marker {
    display: none;
    content: "";
}


.row-action-menu summary:hover,
.row-action-menu summary:focus-visible {
    border-color:
        color-mix(
            in srgb,
            var(--primary) 38%,
            var(--border)
        );

    background:
        color-mix(
            in srgb,
            var(--primary) 7%,
            var(--surface)
        );

    color: var(--primary);

    box-shadow:
        0 5px 15px
        color-mix(
            in srgb,
            var(--primary) 9%,
            transparent
        );
}


/* ==========================================================
   ENGRENAGEM ABERTA
   ========================================================== */

.row-action-menu[open] summary {
    border-color:
        color-mix(
            in srgb,
            var(--primary) 42%,
            var(--border)
        );

    background:
        color-mix(
            in srgb,
            var(--primary) 9%,
            var(--surface)
        );

    color: var(--primary);
}


.row-action-menu summary svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition:
        transform 300ms
        cubic-bezier(0.22, 1, 0.36, 1);
}


.row-action-menu[open] summary svg {
    transform: rotate(45deg);
}


/* ==========================================================
   PAINEL
   O JS DEFINE TOP E LEFT
   ========================================================== */

.row-action-panel {
    position: fixed;

    z-index: 1600;

    display: grid;

    width: 205px;

    overflow: hidden;

    border: 1px solid
        color-mix(
            in srgb,
            var(--border) 65%,
            transparent
        );

    border-radius: 12px;

    background:
        color-mix(
            in srgb,
            var(--surface) 96%,
            transparent
        );

    box-shadow:
        0 18px 45px
        rgba(15, 23, 42, 0.13),
        0 3px 10px
        rgba(15, 23, 42, 0.06);

    opacity: 0;

    transform:
        translateY(-6px)
        scale(0.985);

    transform-origin: top right;

    pointer-events: none;

    transition:
        opacity 160ms ease,
        transform 190ms
        cubic-bezier(0.22, 1, 0.36, 1);
}


/* MENU VISÍVEL */

.row-action-menu[open]
.row-action-panel {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}


/* ==========================================================
   CABEÇALHO
   ========================================================== */

.row-action-panel-header {
    display: grid;

    gap: 2px;

    padding: 11px 12px 9px;

    border-bottom: 1px solid
        color-mix(
            in srgb,
            var(--border) 60%,
            transparent
        );

    background:
        color-mix(
            in srgb,
            var(--primary) 3%,
            transparent
        );
}


.row-action-panel-header span {
    color: var(--text-secondary);

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

    letter-spacing: 0.09em;

    text-transform: uppercase;
}


.row-action-panel-header small {
    overflow: hidden;

    color: var(--text-primary);

    font-size: 0.75rem;
    font-weight: 700;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* ==========================================================
   ITENS
   ========================================================== */

.row-action-panel
.row-action-item {
    display: flex;

    width: 100%;
    min-height: 38px;

    align-items: center;

    gap: 9px;

    border: 0;

    padding: 8px 11px;

    background: transparent;

    color: var(--text-primary);

    font: inherit;

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

    text-align: left;

    text-decoration: none;

    cursor: pointer;

    transition:
        background 150ms ease,
        color 150ms ease,
        padding-left 150ms ease;
}


.row-action-panel
.row-action-item svg {
    width: 15px;
    height: 15px;

    flex-shrink: 0;

    fill: none;
    stroke: var(--text-secondary);

    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition:
        stroke 150ms ease;
}


.row-action-panel
.row-action-item:hover,
.row-action-panel
.row-action-item:focus-visible {
    padding-left: 14px;

    background:
        color-mix(
            in srgb,
            var(--primary) 6%,
            transparent
        );

    color: var(--primary);

    outline: none;
}


.row-action-panel
.row-action-item:hover svg,
.row-action-panel
.row-action-item:focus-visible svg {
    stroke: var(--primary);
}


/* ==========================================================
   DIVISOR
   ========================================================== */

.row-action-divider {
    height: 1px;

    margin: 4px 10px;

    background:
        color-mix(
            in srgb,
            var(--border) 70%,
            transparent
        );
}


/* ==========================================================
   ARQUIVAR
   ========================================================== */

.row-action-panel
.row-action-danger {
    color:
        color-mix(
            in srgb,
            #b24a4a 82%,
            var(--text-primary)
        );
}


.row-action-panel
.row-action-danger svg {
    stroke: currentColor;
}


.row-action-panel
.row-action-danger:hover,
.row-action-panel
.row-action-danger:focus-visible {
    background:
        rgba(178, 74, 74, 0.07);

    color: #b24a4a;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 640px) {

    .row-action-panel {
        width: 195px;
    }


    .row-action-panel
    .row-action-item {
        min-height: 41px;

        font-size: 0.78rem;
    }

}


/* ==========================================================
   REDUÇÃO DE MOVIMENTO
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .row-action-menu summary,
    .row-action-menu summary svg,
    .row-action-panel,
    .row-action-panel .row-action-item {
        transition: none;
    }

}

.member-avatar {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 50%;
    object-fit: cover;
    background: color-mix(in srgb, var(--surface) 70%, var(--primary) 30%);
    color: var(--text-primary);
    font-weight: 700;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.45);
}

.modal[aria-hidden="false"] {
    display: flex;
}

.modal-panel {
    width: min(100%, 560px);
    max-height: min(760px, calc(100vh - 48px));
    overflow-y: auto;
    border-radius: var(--border-radius);
    padding: 20px;
    background: var(--surface);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.detail-list dt {
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    color: var(--text-secondary);
}

.section-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.section-tabs a {
    flex: 0 0 auto;
    display: inline-block;
    padding: 10px 12px;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    text-decoration: none;
}

.section-tabs a.is-active,
.section-tabs a:focus,
.section-tabs a:hover {
    border-bottom-color: var(--primary);
    color: var(--text-primary);
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.summary-card {
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 16px;
    background: var(--surface);
}

.summary-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 700;
}

.summary-card strong {
    display: block;
    font-size: 1.35rem;
}

.report-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.report-columns h2 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

.compact-table {
    min-width: 420px;
}

.autocomplete-field {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--surface);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.autocomplete-option {
    display: grid;
    width: 100%;
    gap: 3px;
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.autocomplete-option:hover,
.autocomplete-option:focus {
    background: color-mix(in srgb, var(--surface) 78%, var(--primary) 22%);
}

.autocomplete-option span,
.autocomplete-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.autocomplete-empty {
    padding: 10px 12px;
}
