/* Styling for the Admin dashboard (Components/Admin/**). Reuses the site's
   existing palette (see :root in site-new.css) so this section matches the
   rest of the app rather than introducing new colours. */

.admin-container {
    max-width: 1800px;
    margin: 0 auto;
}

.admin-body {
    padding-top: 1.75em;
}

/* Summary stat cards */
.admin-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin-bottom: 1.5em;
}

.admin-stat-card {
    display: flex;
    align-items: center;
    gap: 0.9em;
    background: var(--ea-white, #fff);
    border: 1px solid #e2e6e6;
    border-radius: 0.6rem;
    padding: 1em 1.25em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

    .admin-stat-card:hover {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
        transform: translateY(-1px);
    }

.admin-stat-icon {
    width: 2.6em;
    height: 2.6em;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9f2f1;
    color: #75A6A4;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.admin-stat-card-online .admin-stat-icon {
    background: #e9f5f0;
    color: #2fa96a;
}

/* Stat cards that open a popup on click (currently just "Online Now") */
.admin-stat-card-clickable {
    cursor: pointer;
}

.admin-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ea-green, #003330);
    line-height: 1.1;
}

.admin-stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Search boxes on the grids */
.admin-search-box {
    display: flex;
    align-items: center;
    gap: 0.6em;
    border: 1px solid #dde2e2;
    border-radius: 2rem;
    padding: 0.4em 1em;
    margin-bottom: 0.9em;
    background: #fafcfc;
}

    .admin-search-box i {
        color: #9aa5a5;
    }

    .admin-search-box input {
        border: none;
        background: transparent;
        outline: none;
        width: 100%;
        font-size: 0.9rem;
    }

.admin-search-empty {
    color: #6c757d;
    font-size: 0.85rem;
    padding: 0.75em 0;
}

.admin-access-denied {
    padding: 3em 1em;
    text-align: center;
    color: #666;
}

/* Two-column layout: accounts on the left, that account's users on the right */
.container-accounts {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.6fr);
    gap: 1.5em;
    align-items: start;
}

@media (max-width: 992px) {
    .container-accounts {
        grid-template-columns: 1fr;
    }
}

.admin-card {
    background: var(--ea-white, #fff);
    border: 1px solid #e2e6e6;
    border-radius: 0.6rem;
    padding: 1.25em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.15s ease;
}

.btn-admin-primary, .btn-admin-outline, .btn-admin-danger, .btn-admin-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75em;
    flex-wrap: wrap;
    gap: 0.75em;
}

/* Add/Edit/Delete etc. buttons, relocated into the card header (right-aligned
   next to the title) so they're reachable without scrolling past the list -
   handy on a smaller laptop screen. */
.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75em;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.admin-card-title {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--ea-green, #003330);
    margin: 0;
}

.admin-card-subtitle {
    color: var(--ea-green, #003330);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.9em 0;
}

    .admin-card-subtitle strong {
        color: #75A6A4;
        font-weight: 700;
    }

.admin-grid-actions {
    display: flex;
    gap: 0.75em;
    margin-top: 1em;
    flex-wrap: wrap;
}

/* Buttons - matches the app's rounded "eclipse" button style using the
   site's teal/green accent colours instead of Bootstrap defaults. */
.btn-admin-primary {
    color: #fff;
    background-color: var(--ea-green, #003330);
    border-color: var(--ea-green, #003330);
    border-radius: 2rem;
    padding: 0.45rem 1.4rem;
    font-weight: 600;
}

    .btn-admin-primary:hover, .btn-admin-primary:focus {
        color: #fff;
        background-color: #002624;
        border-color: #002624;
    }

.btn-admin-outline {
    color: #75A6A4;
    border: 1px solid #75A6A4;
    background: transparent;
    border-radius: 2rem;
    padding: 0.45rem 1.4rem;
    font-weight: 600;
}

    .btn-admin-outline:hover, .btn-admin-outline:focus {
        color: #fff;
        background-color: #75A6A4;
    }

.btn-admin-danger {
    color: #fff;
    background-color: var(--ea-red, #EE312B);
    border-color: var(--ea-red, #EE312B);
    border-radius: 2rem;
    padding: 0.45rem 1.4rem;
    font-weight: 600;
}

    .btn-admin-danger:hover, .btn-admin-danger:focus {
        color: #fff;
        background-color: #c8241f;
        border-color: #c8241f;
    }

.btn-admin-link {
    background: none;
    border: none;
    color: #6c757d;
    padding: 0.3rem 0.6rem;
    font-weight: 600;
}

    .btn-admin-link:hover {
        color: var(--ea-red, #EE312B);
    }

/* Popup modals (Add Account, Add User, Edit User, Change Password) */
.admin-modal-content {
    border: none;
    border-radius: 0.9rem;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

.admin-modal-header {
    background: linear-gradient(135deg, var(--ea-green, #003330), #00524a);
    border-bottom: none;
    padding: 1.4em 1.6em;
}

    .admin-modal-header .modal-title {
        color: #fff;
        font-weight: 700;
        font-size: 1.4rem;
        display: flex;
        align-items: center;
        gap: 0.6em;
    }

        .admin-modal-header .modal-title i {
            color: #9fd6cf;
        }

.admin-modal-body {
    padding: 1.75em 1.75em 1.5em;
}

.admin-form-title {
    color: var(--ea-green, #003330);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.1em;
}

.admin-form-subtitle {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 1.2em;
}

.admin-form-row {
    display: flex;
    gap: 1em;
}

    .admin-form-row .admin-form-field {
        flex: 1;
    }

.admin-form-field {
    margin-bottom: 1em;
}

.admin-form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #444;
    margin-bottom: 0.3em;
}

.admin-form-actions {
    margin-top: 1.5em;
    display: flex;
    justify-content: flex-end;
    gap: 0.75em;
}

/* Explanatory copy above the role checkboxes on Add/Edit User */
.admin-roles-help {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 0.75em;
}

    .admin-roles-help p {
        margin: 0 0 0.5em 0;
    }

    .admin-roles-help p:last-child {
        margin-bottom: 0;
    }

    .admin-roles-help strong {
        color: #444;
    }

.admin-role-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6em;
}

    .admin-role-list .form-check {
        margin: 0;
        border: 1px solid #dde2e2;
        border-radius: 0.6rem;
        padding: 0.55em 0.9em 0.55em 2.2em;
        background: #fafcfc;
        transition: border-color 0.15s ease, background-color 0.15s ease;
    }

    .admin-role-list .form-check:has(.form-check-input:checked) {
        border-color: #75A6A4;
        background-color: #f0f7f6;
    }

    .admin-role-list .form-check-label {
        font-weight: 600;
        color: #444;
    }

/* Read-only note for a restricted role (e.g. Studbook mare access) already
   allocated to a user - see RestrictedRoles. Not a checkbox, just a fact. */
.admin-restricted-role-note {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.85rem;
    color: #6c757d;
    padding: 0.4em 0;
}

    .admin-restricted-role-note i {
        color: #9aa5a5;
    }

.admin-alert {
    border-radius: 0.4rem;
    padding: 0.6em 1em;
    margin: 1em 0;
    font-size: 0.9rem;
}

.admin-alert-error {
    background-color: #fdecea;
    color: #a02622;
    border: 1px solid #f5c2c0;
}

.admin-alert-success {
    background-color: #e9f5f0;
    color: #1f6e4f;
    border: 1px solid #bfe3d3;
}

/* Online / last-login indicators in the users grid */
.admin-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    font-size: 1.1rem;
}

.admin-status-dot {
    width: 1em;
    height: 1em;
    border-radius: 50%;
    display: inline-block;
    background-color: #b5bdbd;
}

.admin-status-online .admin-status-dot {
    background-color: #2fa96a;
}

.admin-status-online {
    color: #1f6e4f;
    font-weight: 600;
}

.admin-status-offline {
    color: #6c757d;
}

.admin-last-login {
    font-size: 0.85rem;
    color: #555;
}

.admin-confirm-row {
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-size: 0.85rem;
}

.admin-empty-state {
    color: #6c757d;
    padding: 2em 0;
    text-align: center;
}

/* Soften the Blazorise/Bootstrap DataGrid tables (Accounts, Users) so they
   read less like a classic spreadsheet: spaced, rounded "row card" look
   instead of ruled table lines, while keeping native sort/page/select
   behaviour untouched. */
.admin-card .table {
    border-collapse: separate;
    border-spacing: 0 0.5em;
}

.admin-card .table thead th {
    border: none;
    background: transparent;
    color: #8a9494;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding-bottom: 0.4em;
}

.admin-card .table tbody tr {
    background-color: #fafcfc;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.admin-card .table tbody tr:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.admin-card .table tbody tr.table-active,
.admin-card .table tbody tr.b-table-row-selected,
.admin-card .table tbody tr.selected {
    background-color: #f0f7f6;
}

.admin-card .table tbody td,
.admin-card .table thead th {
    border: none;
    vertical-align: middle;
    padding: 0.65em 0.9em;
}

.admin-card .table tbody td:first-child {
    border-top-left-radius: 0.6rem;
    border-bottom-left-radius: 0.6rem;
}

.admin-card .table tbody td:last-child {
    border-top-right-radius: 0.6rem;
    border-bottom-right-radius: 0.6rem;
}

/* Stat row "focused on one account" indicator + link back to the sitewide view */
.admin-stats-context {
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-size: 0.85rem;
    color: #556;
    margin: -0.75em 0 1.25em;
}

    .admin-stats-context i {
        color: #75A6A4;
    }

/* Users / Portfolios pill toggle above the right-hand panel */
.admin-panel-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6em;
    margin-bottom: 0.9em;
}

    .admin-panel-toggle-row .admin-card-subtitle {
        margin: 0;
    }

.admin-toggle-pills {
    display: inline-flex;
    background: #eef2f2;
    border-radius: 2rem;
    padding: 0.2em;
    gap: 0.2em;
}

.admin-toggle-pill {
    border: none;
    background: transparent;
    color: #5b6666;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4em 1.1em;
    border-radius: 2rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .admin-toggle-pill.active {
        background: var(--ea-green, #003330);
        color: #fff;
    }

/* Read-only Portfolios panel: card list instead of another data table */
.admin-portfolio-list {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.admin-portfolio-card {
    border: 1px solid #e2e6e6;
    border-radius: 0.7rem;
    background: #fafcfc;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

    .admin-portfolio-card:hover {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    }

.admin-portfolio-card-header {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.85em 1.1em;
}

.admin-portfolio-card-title {
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-weight: 700;
    color: var(--ea-green, #003330);
    flex: 1;
}

    .admin-portfolio-card-title i {
        color: #75A6A4;
    }

.admin-portfolio-badge {
    background: #e9f2f1;
    color: #75A6A4;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.3em 0.8em;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.3em;
    white-space: nowrap;
}

    .admin-portfolio-badge span {
        font-weight: 500;
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.03em;
    }

.admin-portfolio-meta {
    font-size: 0.95rem;
    color: #6c757d;
    padding: 0 1.1em 0.9em;
}

    .admin-portfolio-meta i {
        color: #9aa5a5;
        margin-right: 0.3em;
    }

    .admin-portfolio-meta strong {
        color: #444;
        font-weight: 600;
    }

/* Users panel: card list instead of a data table, so the name/email/status
   info has room to breathe rather than being squeezed into narrow columns. */
.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin-bottom: 1em;
    max-height: 560px;
    overflow-y: auto;
    padding-top: 0.25em;
    padding-right: 0.3em;
}

.admin-user-card {
    border: 1px solid #e2e6e6;
    border-radius: 0.7rem;
    background: #fafcfc;
    padding: 1em 1.25em;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

    .admin-user-card:hover {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
        transform: translateY(-1px);
    }

    .admin-user-card.selected {
        border-color: #75A6A4;
        background-color: #f0f7f6;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    }

.admin-user-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1em;
}

.admin-user-card-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ea-green, #003330);
    line-height: 1.3;
}

.admin-user-card-email {
    font-size: 0.95rem;
    color: #6c757d;
    margin-top: 0.1em;
}

.admin-user-card-meta {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5em;
    row-gap: 0.4em;
    margin-top: 0.85em;
    font-size: 0.9rem;
    color: #555;
}

    .admin-user-card-meta i {
        color: #9aa5a5;
        margin-right: 0.35em;
        width: 1em;
        text-align: center;
    }

/* Accounts panel: card list instead of a data table. Unlike Users/Portfolios
   (which are already scoped to one account and stay short), the full account
   list can run long, so this scrolls within a fixed height instead of using
   a page-number pager. */
.admin-account-list {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin-bottom: 1em;
    max-height: 560px;
    overflow-y: auto;
    padding-top: 0.25em;
    padding-right: 0.3em;
}

.admin-account-card {
    border: 1px solid #e2e6e6;
    border-radius: 0.7rem;
    background: #fafcfc;
    padding: 1em 1.25em;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

    .admin-account-card:hover {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
        transform: translateY(-1px);
    }

    .admin-account-card.selected {
        border-color: #75A6A4;
        background-color: #f0f7f6;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    }

.admin-account-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1em;
}

.admin-account-card-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ea-green, #003330);
    line-height: 1.3;
}

.admin-account-card-meta {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5em;
    row-gap: 0.4em;
    margin-top: 0.85em;
    font-size: 0.9rem;
    color: #555;
}

    .admin-account-card-meta i {
        color: #9aa5a5;
        margin-right: 0.35em;
        width: 1em;
        text-align: center;
    }

.admin-invoiced-badge {
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.3em 0.9em;
    border-radius: 2rem;
    white-space: nowrap;
}

    .admin-invoiced-badge.invoiced-yes {
        background: #e9f5f0;
        color: #1f6e4f;
    }

    .admin-invoiced-badge.invoiced-no {
        background: #f1f2f2;
        color: #6c757d;
    }

/* Show/hide toggle on password fields */
.admin-password-field {
    position: relative;
}

    .admin-password-field input {
        padding-right: 2.6em;
    }

.admin-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.6em;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #9aa5a5;
    padding: 0.3em 0.4em;
    line-height: 1;
    transition: color 0.15s ease;
}

    .admin-password-toggle:hover, .admin-password-toggle:focus {
        color: #75A6A4;
    }
