select,
input[type="search"] {
    width: 100%;
    margin-top: 8px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: .18s ease;
    font: inherit;
}

select:focus,
input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(23, 105, 255, .12);
}

.nav a.active {
    background: rgba(255, 255, 255, .12);
    box-shadow: inset 3px 0 0 #42bfff;
}

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

.page-heading h1 {
    margin: 5px 0 7px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    align-items: end;
    gap: 14px;
}

.filters-grid label {
    margin: 0;
}

.filter-actions,
.form-actions,
.actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.button-secondary {
    color: var(--text);
    background: #edf2f8;
}

.button-secondary:hover {
    background: #dfe7f1;
}

.button-danger {
    color: #a32018;
    background: #fff0ef;
}

.button-danger:hover {
    background: #ffe0dd;
}

.button-success {
    color: #087a45;
    background: #e8fff2;
}

.button-success:hover {
    background: #d5f8e5;
}

.button-small {
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 9px;
    font-size: .82rem;
}

.table-panel {
    padding: 0;
    overflow: hidden;
}

.table-summary {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

.table-summary strong {
    color: var(--text);
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    background: #f8fafd;
    font-size: .76rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.text-right {
    text-align: right !important;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.user-cell strong,
.user-cell span,
.user-cell small {
    display: block;
}

.user-cell > div > span,
.user-cell small {
    margin-top: 3px;
    color: var(--muted);
}

.avatar {
    width: 42px;
    height: 42px;
    display: grid !important;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 13px;
    color: #1769ff;
    background: #eaf2ff;
    font-weight: 900;
}

.role-badge,
.status,
.self-label {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: .76rem;
    font-weight: 800;
}

.role-badge {
    color: #344054;
    background: #eef2f6;
}

.status-active {
    color: #087a45;
    background: #e8fff2;
}

.status-inactive {
    color: #7a271a;
    background: #fff0ef;
}

.self-label {
    color: #175cd3;
    background: #eff6ff;
}

.actions {
    justify-content: flex-end;
    min-width: 285px;
}

.actions form {
    margin: 0;
}

.muted {
    color: var(--muted);
}

.empty-state {
    padding: 50px 25px;
    text-align: center;
}

.empty-state strong {
    display: block;
    margin-bottom: 6px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 18px;
    border-top: 1px solid var(--border);
}

.pagination a {
    font-weight: 800;
}

.form-panel {
    max-width: 920px;
}

.narrow-panel {
    max-width: 600px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 18px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field-note {
    align-self: stretch;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #f8fafd;
}

.field-note strong {
    display: block;
    margin-bottom: 5px;
}

.field-note p {
    margin: 0 0 13px;
    color: var(--muted);
    line-height: 1.5;
}

.form-actions {
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.record-meta {
    display: flex;
    gap: 18px;
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 12px;
    color: var(--muted);
    background: #f7f9fc;
}

.record-meta strong {
    color: var(--text);
}

@media (max-width: 1100px) {
    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .page-heading {
        display: block;
    }

    .page-heading > .button {
        margin-top: 16px;
    }

    .filters-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-wide,
    .filter-actions {
        grid-column: auto;
    }

    .filter-actions,
    .form-actions {
        flex-wrap: wrap;
    }

    .actions {
        justify-content: flex-start;
    }

    .record-meta {
        display: grid;
        gap: 6px;
    }
}
