/* =========================================================
   Members Area Styles (DOGS-East)
   ========================================================= */

/* ---------- LOGIN ---------- */

.members-login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.members-login-card {
    background: var(--card-background, #ffffff);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    max-width: 420px;
    width: 100%;
}

.members-login-card h1 {
    margin-top: 0;
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color, #FAB95B);
}

.form-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.form-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

/* ---------- DASHBOARD ---------- */

.members-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.members-header-actions {
    display: flex;
    gap: 10px;
}

.members-grid {
    display: grid;
    gap: 22px;
}

.members-section-title {
    margin-top: 0;
    margin-bottom: 10px;
}

.members-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 920px) {
    .members-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .members-header {
        flex-direction: column;
        align-items: stretch;
    }

    .members-cards {
        grid-template-columns: 1fr;
    }
}

.members-card {
    display: block;
    position: relative;
    padding: 16px;
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: inherit;

    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);

    transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}

.members-card:hover,
.members-card:focus-visible {
    transform: translateY(-2px);
    filter: brightness(1.02);
    outline: none;
}

.members-card-title {
    font-weight: 900;
    letter-spacing: 0.2px;
    margin-bottom: 6px;
}

.members-card-desc {
    opacity: 0.9;
    font-size: 14px;
    line-height: 1.35;
}

.members-card--restricted {
    opacity: 0.85;
    border-style: dashed;
}

.members-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.3px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(26, 50, 99, 0.12);
}

html[data-theme="dark"] .members-card {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
}

html[data-theme="dark"] .members-pill {
    background: rgba(156, 198, 255, 0.18);
}

/* =========================================================
   Applicant Kit Downloads
   ========================================================= */

.applicant-downloads {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.applicant-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    font-weight: 800;
    font-size: 13px;
    text-decoration: none;

    padding: 6px 10px;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.10);
    color: var(--text-primary);

    transition: transform var(--dur-fast) var(--ease),
        filter var(--dur-fast) var(--ease);
}

.applicant-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

html[data-theme="dark"] .applicant-link {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
}

/* =========================================================
   Activity Log UI
   ========================================================= */

.activity-filters {
    margin-bottom: var(--space-xl);
    display: grid;
    gap: 12px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.filter-group {
    grid-column: span 3;
}

.filter-actions {
    grid-column: span 3;
    display: flex;
    justify-content: flex-end;
}

.filter-group label {
    display: block;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.2px;
    margin-bottom: 6px;
    opacity: 0.9;
}

.filter-group input[type="text"],
.filter-group input[type="date"],
.filter-group select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .filter-group input[type="text"],
html[data-theme="dark"] .filter-group input[type="date"],
html[data-theme="dark"] .filter-group select {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
    color: var(--text-primary);
}

.filter-fieldset {
    grid-column: span 8;
    border: 0;
    padding: 0;
    margin: 0;
}

.filter-fieldset legend {
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.2px;
    margin-bottom: 6px;
    opacity: 0.9;
}

/* ---------- Segmented radio control ---------- */

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.40);
    border: 1px solid rgba(0, 0, 0, 0.10);
    width: fit-content;
    max-width: 100%;
}

html[data-theme="dark"] .segmented {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
}

.segmented-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    user-select: none;

    border: 1px solid rgba(0, 0, 0, 0.10);
    background: rgba(255, 255, 255, 0.55);

    transition: transform var(--dur-fast) var(--ease),
        filter var(--dur-fast) var(--ease),
        background-color var(--dur-fast) var(--ease);
}

html[data-theme="dark"] .segmented-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
}

.segmented-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented-item:has(input:checked) {
    background: rgba(26, 50, 99, 0.95);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.16);
}

.segmented-item:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

/* =========================================================
   Admin Actions Row (UI only)
   ========================================================= */

.activity-admin-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;

    margin-top: 4px;
    margin-bottom: 10px;
    padding: 10px 12px;

    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-action {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px 10px;
    border-radius: 999px;

    text-decoration: none;
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.2px;

    border: 1px solid rgba(0, 0, 0, 0.10);
    color: var(--text-primary);

    transition: transform var(--dur-fast) var(--ease),
        filter var(--dur-fast) var(--ease);
}

.admin-action:hover,
.admin-action:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.02);
    outline: none;
}

/* Subtle “category” tint to match table header groups */
.admin-action--search {
    background: rgba(166, 205, 255, 0.28);
}

.admin-action--training {
    background: rgba(255, 201, 251, 0.26);
}

.admin-action--demo {
    background: rgba(191, 255, 230, 0.24);
}

.admin-action--eval {
    background: rgba(255, 203, 180, 0.24);
}

.admin-action--other {
    background: rgba(205, 248, 255, 0.22);
}

html[data-theme="dark"] .admin-action--search {
    background: rgba(156, 198, 255, 0.12);
}

html[data-theme="dark"] .admin-action--training {
    background: rgba(255, 170, 245, 0.10);
}

html[data-theme="dark"] .admin-action--demo {
    background: rgba(140, 255, 210, 0.10);
}

html[data-theme="dark"] .admin-action--eval {
    background: rgba(255, 170, 130, 0.10);
}

html[data-theme="dark"] .admin-action--other {
    background: rgba(170, 240, 255, 0.10);
}

/* ---------- Table ---------- */

.activity-table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: rgba(255, 255, 255, 0.40);
}

html[data-theme="dark"] .activity-table-wrap {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.activity-table th,
.activity-table td {
    padding: 10px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    vertical-align: top;
    font-size: 13px;
}

html[data-theme="dark"] .activity-table th,
html[data-theme="dark"] .activity-table td {
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

.activity-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    font-weight: 900;
}

html[data-theme="dark"] .activity-table thead th {
    background: rgba(12, 18, 30, 0.85);
}

.activity-head-top th.group {
    text-align: center;
}

.group-search {
    background: rgba(166, 205, 255, 0.28) !important;
}

.group-training {
    background: rgba(255, 201, 251, 0.26) !important;
}

.group-demo {
    background: rgba(191, 255, 230, 0.24) !important;
}

.group-eval {
    background: rgba(255, 203, 180, 0.24) !important;
}

.group-other {
    background: rgba(205, 248, 255, 0.22) !important;
}

html[data-theme="dark"] .group-search {
    background: rgba(156, 198, 255, 0.12) !important;
}

html[data-theme="dark"] .group-training {
    background: rgba(255, 170, 245, 0.10) !important;
}

html[data-theme="dark"] .group-demo {
    background: rgba(140, 255, 210, 0.10) !important;
}

html[data-theme="dark"] .group-eval {
    background: rgba(255, 170, 130, 0.10) !important;
}

html[data-theme="dark"] .group-other {
    background: rgba(170, 240, 255, 0.10) !important;
}

.activity-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.25);
}

html[data-theme="dark"] .activity-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

.activity-footnotes {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(0, 0, 0, 0.10);
}

html[data-theme="dark"] .activity-footnotes {
    border-top-color: rgba(255, 255, 255, 0.10);
}

.members-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: var(--space-xl);
}

/* =========================================================
   MOBILE: Custom layout for Activity Log
   ========================================================= */

/* Show cards on mobile, hide big table */
.activity-cards {
    display: none;
}

@media (max-width: 720px) {

    .filter-row {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch;
    }

    .filter-group,
    .filter-fieldset,
    .filter-actions {
        grid-column: auto;
    }

    .filter-actions {
        justify-content: stretch;
    }

    .filter-actions .btn {
        width: 100%;
    }

    .segmented {
        width: 100%;
        border-radius: 16px;
        justify-content: space-between;
    }

    .segmented-item {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }

    .activity-admin-row {
        grid-template-columns: 1fr;
    }

    .admin-action {
        width: 100%;
    }

    .activity-table-wrap {
        display: none;
    }

    .activity-cards {
        display: grid;
        gap: 12px;
        margin-top: 6px;
    }

    .activity-card {
        border-radius: var(--radius-xl);
        background: rgba(255, 255, 255, 0.55);
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
        padding: 14px;
    }

    html[data-theme="dark"] .activity-card {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.10);
    }

    .activity-card-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 10px;
    }

    .activity-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.3px;
        padding: 6px 10px;
        border-radius: 999px;
        background: rgba(26, 50, 99, 0.12);
        margin-bottom: 8px;
    }

    html[data-theme="dark"] .activity-badge {
        background: rgba(156, 198, 255, 0.18);
    }

    .activity-card-title {
        margin: 0;
        font-size: 16px;
    }

    .activity-card-sub {
        font-size: 13px;
        margin-top: 2px;
    }

    .activity-card-meta {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 10px;
        font-size: 13px;
    }

    .activity-card-meta .k {
        display: block;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.3px;
        opacity: 0.75;
        margin-bottom: 2px;
    }

    .activity-card-meta .v {
        font-weight: 800;
    }

    .activity-card-grid {
        display: grid;
        gap: 10px;
    }

    .mini-group {
        border-radius: 14px;
        padding: 10px 12px;
        background: rgba(255, 255, 255, 0.35);
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    html[data-theme="dark"] .mini-group {
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.10);
    }

    .mini-title {
        font-weight: 900;
        margin-bottom: 6px;
    }

    .mini-row {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        font-size: 13px;
        padding: 3px 0;
        opacity: 0.95;
    }

    .members-page-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .activity-card-meta {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Member Contact Roster UI
   ========================================================= */

.roster-filters {
    margin-bottom: var(--space-lg);
    display: grid;
    gap: 12px;
}

.roster-filter-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.roster-filter-row .filter-group {
    grid-column: span 4;
}

.roster-filter-row .filter-actions {
    grid-column: span 4;
    display: flex;
    justify-content: flex-end;
}

.roster-table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: rgba(255, 255, 255, 0.40);
}

html[data-theme="dark"] .roster-table-wrap {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.10);
}

.roster-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
}

.roster-table th,
.roster-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    vertical-align: top;
    font-size: 13px;
    text-align: center;
}

html[data-theme="dark"] .roster-table th,
html[data-theme="dark"] .roster-table td {
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

.roster-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    font-weight: 900;
    text-align: center;
}

html[data-theme="dark"] .roster-table thead th {
    background: rgba(12, 18, 30, 0.85);
}

.roster-name {
    font-weight: 900;
}

.roster-dog {
    font-size: 12px;
    margin-top: 3px;
}

.roster-vcard {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 16px;
}

html[data-theme="dark"] .roster-vcard {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.10);
}

/* Footnotes + key */
.roster-footnotes {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid rgba(0, 0, 0, 0.10);
}

html[data-theme="dark"] .roster-footnotes {
    border-top-color: rgba(255, 255, 255, 0.10);
}

.roster-key {
    border-radius: var(--radius-xl);
    padding: 14px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .roster-key {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
}

.roster-key-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px 12px;
    margin-top: 8px;
    font-size: 13px;
}

.roster-key-row .k {
    font-weight: 900;
}

.roster-key-row .v {
    opacity: 0.95;
}

/* Mobile cards */
.roster-cards {
    display: none;
}

@media (max-width: 720px) {
    .roster-filter-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .roster-filter-row .filter-group,
    .roster-filter-row .filter-actions {
        grid-column: auto;
    }

    .roster-filter-row .filter-actions {
        justify-content: stretch;
    }

    .roster-filter-row .filter-actions .btn {
        width: 100%;
    }

    .roster-table-wrap {
        display: none;
    }

    .roster-cards {
        display: grid;
        gap: 12px;
    }

    .roster-card {
        border-radius: var(--radius-xl);
        background: rgba(255, 255, 255, 0.55);
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
        padding: 14px;
    }

    html[data-theme="dark"] .roster-card {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.10);
    }

    .roster-card-top {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 10px;
    }

    .roster-pin {
        font-size: 12px;
        font-weight: 900;
        opacity: 0.75;
        margin-bottom: 6px;
    }

    .roster-card-title {
        margin: 0;
        font-size: 16px;
        font-weight: 900;
    }

    .roster-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 10px;
        font-size: 13px;
    }

    .roster-meta .k,
    .roster-phones .k {
        display: block;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.3px;
        opacity: 0.75;
        margin-bottom: 3px;
    }

    .roster-meta .v {
        font-weight: 800;
    }

    .roster-phones .v {
        font-weight: 800;
        padding: 3px 0;
    }
}

@media (max-width: 420px) {
    .roster-meta {
        grid-template-columns: 1fr;
    }
}

.background-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.background-option-card {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.background-option-card:hover {
    transform: translateY(-1px);
}

.background-option-card input {
    width: auto;
}

.background-preview {
    display: block;
    min-height: 120px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.background-option-label {
    font-weight: 700;
}

.background-option-card:has(input:checked) {
    outline: 3px solid rgba(42, 106, 148, 0.45);
    border-color: rgba(42, 106, 148, 0.9);
}

.site-settings-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.site-settings-form input[type="file"] {
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.82);
}

.background-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.background-option-card {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.72);
}

.background-option-select {
    display: grid;
    gap: 0.65rem;
    cursor: pointer;
}

.background-option-select input {
    width: auto;
}

.background-preview {
    display: block;
    min-height: 125px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.background-option-label {
    font-weight: 700;
}

.background-option-card:has(input:checked) {
    outline: 3px solid rgba(42, 106, 148, 0.45);
    border-color: rgba(42, 106, 148, 0.9);
}

.background-delete-button {
    justify-self: start;
}

.background-default-note {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Activity Log wide layout */

.activity-log-content {
    max-width: min(1500px, calc(100vw - 48px));
}

.activity-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-xl);
}

/* Give the table more room before it starts horizontal scrolling */
.activity-table {
    width: 100%;
    min-width: 1320px;
}

/* Sticky Action/Edit column */
.activity-table th:first-child,
.activity-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 4px 0 8px rgba(0, 0, 0, 0.06);
}

.activity-table thead th:first-child {
    z-index: 5;
}

/* Keep sticky Edit/Action column from changing during row hover */
.activity-table tbody tr:hover td:first-child,
.activity-table tbody tr:nth-child(even):hover td:first-child,
.activity-table tbody tr:nth-child(odd):hover td:first-child {
    background: rgba(255, 255, 255, 0.95);
}

html[data-theme="dark"] .activity-table th:first-child,
html[data-theme="dark"] .activity-table td:first-child,
html[data-theme="dark"] .activity-table tbody tr:hover td:first-child,
html[data-theme="dark"] .activity-table tbody tr:nth-child(even):hover td:first-child,
html[data-theme="dark"] .activity-table tbody tr:nth-child(odd):hover td:first-child {
    background: #1c2430;
}