/*
 * Shared administration navigation
 */

.site-header-main {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3rem);
}

/* Dashboard moderation actions */

.moderation-action-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 24px;
}

.moderation-action-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    padding: 22px;
    border: 1px solid rgba(225, 197, 100, 0.2);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(225, 197, 100, 0.07),
            rgba(255, 255, 255, 0.015)
        );
}

.moderation-action-card h3 {
    margin: 0;
    color: #f4f4f5;
    font-size: 1.05rem;
}

.moderation-action-card .form-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.moderation-action-card .form-field > span {
    color: #d8d9dd;
    font-size: 0.9rem;
    font-weight: 700;
}

.moderation-action-card select {
    width: 100%;
    min-height: 46px;
    padding: 11px 42px 11px 14px;
    border: 1px solid #303744;
    border-radius: 10px;
    outline: none;
    appearance: none;
    background-color: #0c1016;
    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            #e1c564 50%
        ),
        linear-gradient(
            135deg,
            #e1c564 50%,
            transparent 50%
        );
    background-position:
        calc(100% - 19px) 50%,
        calc(100% - 13px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    color: #f4f4f5;
    color-scheme: dark;
    font: inherit;
    line-height: 1.4;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        background-color 160ms ease;
}

.moderation-action-card select:hover {
    border-color: rgba(225, 197, 100, 0.55);
    background-color: #10151d;
}

.moderation-action-card select:focus {
    border-color: #e1c564;
    box-shadow: 0 0 0 3px rgba(225, 197, 100, 0.13);
}

.moderation-action-card select option {
    background: #0c1016;
    color: #f4f4f5;
}

.moderation-action-card textarea {
    width: 100%;
    min-height: 104px;
    padding: 12px 14px;
    resize: vertical;
    border: 1px solid #303744;
    border-radius: 10px;
    outline: none;
    background: #0c1016;
    color: #f4f4f5;
    font: inherit;
    line-height: 1.5;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.moderation-action-card textarea:focus {
    border-color: #e1c564;
    box-shadow: 0 0 0 3px rgba(225, 197, 100, 0.13);
}

.moderation-action-card .button {
    align-self: flex-start;
}

.moderation-action-danger {
    border-color: rgba(248, 113, 113, 0.3);
    background:
        linear-gradient(
            145deg,
            rgba(248, 113, 113, 0.09),
            rgba(255, 255, 255, 0.015)
        );
}

.moderation-action-danger h3 {
    color: #fca5a5;
}

.moderation-action-danger .button {
    border-color: rgba(248, 113, 113, 0.5);
    color: #fca5a5;
}

.moderation-action-danger .button:hover,
.moderation-action-danger .button:focus-visible {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
}

.confirmation-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #c8cbd2;
    font-size: 0.9rem;
    line-height: 1.45;
    cursor: pointer;
}

.confirmation-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 1px 0 0;
    accent-color: #e1c564;
}

.notice-success {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid rgba(74, 222, 128, 0.32);
    border-radius: 12px;
    background: rgba(74, 222, 128, 0.09);
    color: #86efac;
}

.notice-error {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid rgba(248, 113, 113, 0.34);
    border-radius: 12px;
    background: rgba(248, 113, 113, 0.09);
    color: #fca5a5;
}

@media (max-width: 900px) {
    .moderation-action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .moderation-action-grid {
        gap: 14px;
        padding: 16px;
    }

    .moderation-action-card {
        padding: 18px;
    }

    .moderation-action-card .button {
        width: 100%;
    }
}

.admin-navigation {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.admin-navigation a {
    padding: 0.55rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--csg-muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        color 140ms ease,
        background 140ms ease,
        border-color 140ms ease;
}

.admin-navigation a:hover,
.admin-navigation a:focus-visible {
    color: var(--csg-accent-hover);
    background: var(--csg-accent-soft);
    border-color: var(--csg-border-gold);
}

.admin-navigation a.is-active {
    color: #10100d;
    background: var(--csg-accent);
    border-color: var(--csg-accent);
}

.admin-navigation a:focus-visible {
    outline: 3px solid rgb(225 197 100 / 35%);
    outline-offset: 3px;
}

/*
 * Member directory filters
 */

.member-filter-panel {
    margin-bottom: 24px;
}

.member-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 16px;
    padding: 1.25rem;
}

.member-filters .form-field {
    display: flex;
    flex: 1 1 240px;
    flex-direction: column;
    gap: 8px;
}

.member-filters .form-field span {
    color: #c7c9d0;
    font-size: 0.84rem;
    font-weight: 700;
}

.member-filters input,
.member-filters select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--csg-text);
    background: #171818;
    border: 1px solid #383a3d;
    border-radius: 8px;
    font: inherit;
}

.member-filters input::placeholder {
    color: #85888f;
}

.member-filters input:hover,
.member-filters select:hover {
    border-color: var(--csg-border-gold);
}

.member-filters input:focus,
.member-filters select:focus {
    border-color: var(--csg-accent);
    outline: 2px solid rgb(225 197 100 / 25%);
    outline-offset: 1px;
}

.page-count {
    color: var(--csg-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

/*
 * Member directory table
 */

.member-table {
    min-width: 940px;
}

.member-table th {
    white-space: nowrap;
}

.member-table td {
    vertical-align: middle;
}

.member-identity {
    display: flex;
    min-width: 250px;
    align-items: center;
    gap: 12px;
}

.member-identity > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.member-identity strong {
    overflow: hidden;
    color: var(--csg-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-identity span:not(.member-avatar):not(.tag) {
    overflow: hidden;
    color: #b7bac1;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-identity small {
    color: #85888f;
    font-size: 0.75rem;
}

.member-avatar {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    color: #10100d;
    background: #282a2d;
    border: 1px solid #414348;
    border-radius: 50%;
    font-weight: 800;
}

.member-avatar-fallback {
    color: #10100d;
    background:
        linear-gradient(
            135deg,
            #e1c564,
            #a88d35
        );
    border-color: rgb(225 197 100 / 45%);
}

.member-profile-link {
    color: inherit;
    text-decoration: none;
}

.member-profile-link:hover strong,
.member-profile-link:focus-visible strong {
    color: var(--csg-accent-hover);
    text-decoration: underline;
}

.member-profile-link:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgb(225 197 100 / 35%);
    outline-offset: 3px;
}

/*
 * Labels, statuses and roles
 */

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    color: var(--csg-accent-hover);
    background: var(--csg-accent-soft);
    border: 1px solid var(--csg-border-gold);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-stack {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.status-active {
    color: #77e4ae;
    background: rgb(43 180 115 / 12%);
    border-color: rgb(80 213 151 / 30%);
}

.status-left {
    color: #b8bbc1;
    background: rgb(131 135 151 / 12%);
    border-color: rgb(155 159 176 / 25%);
}

.status-warning,
.status-pending,
.status-open {
    color: var(--csg-accent-hover);
    background: var(--csg-accent-soft);
    border-color: var(--csg-border-gold);
}

.status-completed,
.status-resolved,
.status-expired,
.status-revoked,
.status-cancelled {
    color: #b8bbc1;
    background: rgb(131 135 151 / 12%);
    border-color: rgb(155 159 176 / 25%);
}

.role-list,
.profile-role-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.role-list {
    max-width: 360px;
}

.role-pill {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    padding: 6px 10px;
    color: #e7e2cf;
    background: rgb(225 197 100 / 8%);
    border: 1px solid rgb(225 197 100 / 24%);
    border-radius: 7px;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.muted {
    color: var(--csg-muted);
    font-size: 0.86rem;
}

/*
 * Empty states
 */

.empty-state {
    display: flex;
    min-height: 190px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 48px 32px;
    text-align: center;
}

.empty-state h2,
.empty-state h3 {
    margin: 0;
    color: var(--csg-text);
}

.empty-state p {
    max-width: 520px;
    margin: 0;
    color: var(--csg-muted);
    line-height: 1.6;
}

.empty-state .button {
    margin-top: 10px;
}

/*
 * Pagination
 */

.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-top: 1px solid var(--csg-border);
}

.pagination > :first-child {
    justify-self: start;
}

.pagination > :last-child {
    justify-self: end;
}

.pagination > span {
    color: var(--csg-muted);
    font-size: 0.86rem;
}

/*
 * Member profile
 */

.profile-back-link {
    margin-bottom: 1.25rem;
}

.profile-back-link a {
    color: var(--csg-accent);
    font-weight: 700;
    text-decoration: none;
}

.profile-back-link a:hover,
.profile-back-link a:focus-visible {
    color: var(--csg-accent-hover);
    text-decoration: underline;
}

.member-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    background:
        linear-gradient(
            110deg,
            rgb(225 197 100 / 7%),
            transparent 45%
        ),
        var(--csg-surface);
}

.member-profile-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1.5rem;
}

.member-profile-identity > div {
    min-width: 0;
}

.member-profile-identity h2 {
    overflow: hidden;
    margin-bottom: 0.45rem;
    color: var(--csg-text);
    font-size: clamp(1.6rem, 4vw, 2.35rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-profile-identity p:last-child {
    overflow: hidden;
    margin-bottom: 0;
    color: var(--csg-muted);
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-profile-avatar {
    display: inline-flex;
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    color: #10100d;
    border: 2px solid var(--csg-border-gold);
    border-radius: 50%;
    box-shadow:
        0 0 0 5px rgb(225 197 100 / 5%);
    font-size: 2rem;
    font-weight: 800;
}

.member-profile-header > .status-stack {
    flex: 0 0 auto;
    align-items: flex-end;
}

.profile-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.profile-detail {
    display: flex;
    min-height: 130px;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.4rem;
    border: 1px solid var(--csg-border);
    border-radius: var(--csg-radius);
    background: var(--csg-surface);
    transition:
        border-color 140ms ease,
        transform 140ms ease;
}

.profile-detail:hover {
    border-color: var(--csg-border-gold);
    transform: translateY(-1px);
}

.profile-detail span {
    color: var(--csg-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.profile-detail strong {
    overflow-wrap: anywhere;
    color: var(--csg-text);
    font-size: 1rem;
    line-height: 1.45;
}

.profile-section-content {
    padding: 1.4rem 1.5rem;
}

.profile-section-content > :last-child {
    margin-bottom: 0;
}

.profile-reason {
    width: min(420px, 35vw);
    min-width: 240px;
    line-height: 1.5;
    white-space: normal;
}

/*
 * Panel spacing
 */

.panel > .panel-heading {
    padding: 1.4rem 1.5rem;
}

.panel > .panel-heading h2 {
    margin-top: 0;
}

.panel > .panel-heading .eyebrow {
    margin-bottom: 0.45rem;
}

/*
 * Responsive layout
 */

@media (max-width: 850px) {
    .site-header-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .profile-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-navigation {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .admin-navigation a {
        width: 100%;
    }

    .member-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .member-filters .form-field {
        width: 100%;
        flex-basis: auto;
    }

    .member-filters .button {
        width: 100%;
    }

    .pagination {
        grid-template-columns: 1fr 1fr;
    }

    .pagination > span {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
    }

    .pagination > :first-child {
        grid-column: 1;
        grid-row: 2;
    }

    .pagination > :last-child {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 620px) {
    .member-profile-header,
    .member-profile-identity {
        align-items: flex-start;
        flex-direction: column;
    }

    .member-profile-header > .status-stack {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .member-profile-avatar {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
        font-size: 1.5rem;
    }

    .member-profile-identity h2 {
        white-space: normal;
    }

    .member-profile-identity p:last-child {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-detail {
        min-height: 105px;
    }

    .empty-state {
        min-height: 160px;
        padding: 36px 20px;
    }
}
