/* IGMMZ admin dashboard (demo). Uses the brand variables and fonts from styles.css. */

body.admin {
    background: #f3f4f6;
    color: #1b1b1b;
}

.admin-shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--navy);
    color: rgba(255, 255, 255, 0.8);
    border-right: 3px solid var(--green);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
}

.admin-brand img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
}

.admin-brand strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
}

.admin-brand small {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.admin-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 12px;
    overflow-y: auto;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.admin-nav a svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.admin-nav a.active {
    background: var(--green);
    color: #fff;
}

.admin-nav .count {
    min-width: 26px;
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.75rem;
    text-align: center;
}

.admin-nav a.active .count {
    background: rgba(0, 0, 0, 0.22);
}

.admin-sidebar-foot {
    display: grid;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-foot a,
.admin-sidebar-foot button {
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.72);
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    text-decoration: none;
    text-underline-offset: 3px;
    cursor: pointer;
}

.admin-sidebar-foot a:hover,
.admin-sidebar-foot button:hover {
    color: #fff;
    text-decoration: underline;
}

.admin-scrim {
    display: none;
}

/* ---------- Main area ---------- */
.admin-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.admin-topbar h1 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 600;
}

.refresh-btn {
    margin-left: auto;
}

.admin-menu-btn {
    display: none;
}

.admin-user {
    overflow: hidden;
    font-size: 0.8125rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.5);
}

.admin-content {
    padding: 24px 32px 48px;
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    border: 0;
    background: var(--green);
    color: #fff;
    transition: filter 0.15s;
}

.btn-primary:hover {
    filter: brightness(0.92);
}

.btn-ghost {
    border: 1px solid #cfd6de;
    background: #fff;
    color: #1b1b1b;
}

.btn-ghost:hover {
    border-color: #1b1b1b;
}

body.admin :is(a, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

/* ---------- Dashboard ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--green);
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.stat-label {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #777;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-sub {
    font-size: 0.8125rem;
    color: #666;
}

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}

.panel-box {
    background: #fff;
    border: 1px solid var(--border);
}

.panel-box-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.panel-box-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.activity {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.activity li:last-child {
    border-bottom: 0;
}

.activity .type {
    flex-shrink: 0;
    width: 112px;
    font-family: var(--font-heading);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--green);
}

.activity .title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity .date {
    flex-shrink: 0;
    width: 88px;
    font-size: 0.8125rem;
    text-align: right;
    color: #888;
}

.quick-actions {
    display: grid;
    gap: 10px;
    padding: 20px;
}

.quick-actions .btn-ghost {
    justify-content: flex-start;
}

/* ---------- List views ---------- */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.list-toolbar input[type="search"],
.list-toolbar select {
    height: 40px;
    border: 1px solid #cfd6de;
    background: #fff;
    font: inherit;
    font-size: 0.9375rem;
}

.list-toolbar input[type="search"] {
    flex: 1 1 240px;
    max-width: 360px;
    padding: 0 14px;
}

.list-toolbar select {
    padding: 0 12px;
}

.list-toolbar .btn-primary {
    margin-left: auto;
}

.table-wrap {
    position: relative; /* keeps the hidden "Actions" label inside, so phones don't scroll sideways */
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--border);
}

.admin-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    padding: 12px 16px;
    background: #fafafa;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
    color: #666;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.admin-table .title-cell {
    max-width: 420px;
    font-weight: 600;
}

.admin-table .title-cell small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #777;
}

.admin-table .nowrap {
    white-space: nowrap;
}

.row-actions {
    text-align: right;
    white-space: nowrap;
}

.row-actions button {
    padding: 4px 8px;
    border: 0;
    background: none;
    color: var(--green);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}

.row-actions button:hover {
    text-decoration: underline;
}

.row-actions button.danger {
    color: #b42318;
}

.admin-table .empty {
    padding: 40px 20px;
    text-align: center;
    color: #777;
}

.list-count {
    margin: 12px 0 0;
    font-size: 0.8125rem;
    color: #777;
}

/* ---------- Status badges ---------- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-published,
.badge-open {
    background: #e7f5ec;
    color: #1f7a3f;
}

.badge-draft {
    background: #eef0f3;
    color: #555;
}

.badge-in-review {
    background: #fff4d6;
    color: #8a5a00;
}

.badge-locked {
    background: #ebe8f6;
    color: #4b3c8f;
}

.badge-hidden,
.badge-rejected,
.badge-lapsed {
    background: #fde8e7;
    color: #b42318;
}

.badge-in-good-standing,
.badge-approved {
    background: #e7f5ec;
    color: #1f7a3f;
}

.badge-new {
    background: #e6f0fb;
    color: #1d5fa8;
}

.badge-under-review,
.badge-pending,
.badge-pending-payment {
    background: #fff4d6;
    color: #8a5a00;
}

.badge-confirmed {
    background: #e7f5ec;
    color: #1f7a3f;
}

/* shown on a section whose database table hasn't been created yet */
.admin-notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #fff4d6;
    border-left: 3px solid #d39b00;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #5c4300;
}

/* ---------- Add / edit dialog ---------- */
.admin-dialog {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 0;
    border: 0;
    border-top: 3px solid var(--green);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.admin-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.admin-dialog form {
    padding: 24px;
}

.admin-dialog h2 {
    margin: 0 0 18px;
    font-size: 1.25rem;
    font-weight: 600;
}

.dialog-fields {
    display: grid;
    gap: 14px;
}

.dialog-field label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
}

.dialog-field input,
.dialog-field select,
.dialog-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd6de;
    background: #fff;
    font: inherit;
    font-size: 0.9375rem;
    color: #1b1b1b;
}

.dialog-field textarea {
    min-height: 96px;
    resize: vertical;
}

.dialog-field :is(input, select, textarea):focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #777;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

/* ---------- Toast ---------- */
.admin-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 100;
    padding: 12px 20px;
    background: #1b1b1b;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity 0.2s, transform 0.2s;
}

.admin-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1099.98px) {
    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 899.98px) {
    .admin-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    /* sidebar slides in from the left */
    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 50;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .admin-shell.nav-open .admin-sidebar {
        transform: none;
    }

    .admin-shell.nav-open .admin-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 40;
        background: rgba(0, 0, 0, 0.4);
    }

    .admin-menu-btn {
        display: inline-grid;
        place-items: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid var(--border);
        background: #fff;
        cursor: pointer;
    }

    .admin-menu-btn svg {
        width: 20px;
        height: 20px;
    }

    .admin-topbar {
        padding: 12px 16px;
    }

    .admin-content {
        padding: 16px 16px 40px;
    }
}

@media (max-width: 559.98px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .activity .type {
        display: none;
    }

    .list-toolbar input[type="search"] {
        max-width: none;
    }

    .list-toolbar .btn-primary {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-sidebar,
    .admin-toast {
        transition: none;
    }
}

/* ---------- Sign-in screen ---------- */
.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    background: var(--navy);
}

.auth-screen[hidden],
.admin-shell[hidden] {
    display: none;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 32px 28px 24px;
    background: #fff;
    border-top: 4px solid var(--green);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.auth-logo {
    display: block;
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
}

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.auth-intro {
    margin: 0 0 24px;
    font-size: 0.9375rem;
    text-align: center;
    color: #555;
}

.auth-status {
    margin: 0 0 16px;
    font-size: 0.875rem;
    text-align: center;
    color: #777;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form[hidden],
.auth-setup[hidden],
.auth-denied[hidden],
.auth-message[hidden],
.auth-status[hidden] {
    display: none;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #cfd6de;
    font: inherit;
    font-size: 1rem;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

.auth-submit {
    justify-content: center;
    width: 100%;
    height: 46px;
    font-size: 0.9375rem;
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.auth-link {
    justify-self: center;
    padding: 0;
    border: 0;
    background: none;
    color: var(--green);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-setup {
    padding: 14px 16px;
    background: #fff8e6;
    border-left: 3px solid #e0a100;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #5c4400;
}

.auth-setup p {
    margin: 0 0 6px;
}

.auth-setup ol {
    margin: 0;
    padding-left: 20px;
}

.auth-setup code {
    font-size: 0.8125rem;
}

.auth-message {
    margin: 16px 0 0;
    padding: 10px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    background: #fde8e7;
    color: #b42318;
}

.auth-message.ok {
    background: #e7f5ec;
    color: #1f7a3f;
}

.auth-back {
    display: block;
    margin-top: 24px;
    font-size: 0.875rem;
    text-align: center;
    text-decoration: none;
    color: #555;
}

.auth-back:hover {
    color: var(--green);
    text-decoration: underline;
}

/* loading state for the content area */
.admin-loading {
    padding: 40px 0;
    text-align: center;
    color: #777;
}

/* ---------- File fields (downloads, board minutes) ---------- */
.file-current {
    margin: 0 0 8px;
    font-size: 0.875rem;
    color: #555;
}

.file-current a,
.file-link {
    color: var(--green);
    font-weight: 600;
    word-break: break-all;
}

.dialog-field input[type="file"] {
    padding: 8px;
    background: #fafafa;
}

.dialog-field .file-or {
    margin-top: 12px;
    font-weight: 500;
    color: #555;
}

/* ---------- Tabs (Members page: Members, Applications, Subscriptions, Payments, Payment Methods) ---------- */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin: -4px 0 20px;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: inset 0 -1px 0 var(--border);
}

.admin-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 12px 16px;
    border-bottom: 3px solid transparent;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.admin-tabs a:hover {
    color: #1b1b1b;
}

.admin-tabs a.active {
    border-bottom-color: var(--green);
    color: var(--green);
}

.admin-tabs .count {
    min-width: 24px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #e9ecef;
    font-size: 0.75rem;
    text-align: center;
    color: #555;
}

.admin-tabs a.active .count {
    background: #fbe9df;
    color: var(--green);
}

/* ---------- Overview chart (dashboard) ----------
   Series colours are the first three slots of the validated chart palette:
   members blue, revenue orange, subscriptions aqua (dashed, so it isn't colour alone). */
.chart-card {
    --series-members: #2a78d6;
    --series-revenue: #eb6834;
    --series-subs: #1baf7a;
    --chart-grid: #e1e0d9;
    --chart-axis: #c3c2b7;
    --chart-muted: #898781;
    position: relative;
    margin-top: 24px;
    padding: 20px 24px 14px;
}

.chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
}

.chart-head h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.chart-sub {
    margin: 4px 0 0;
    font-size: 0.875rem;
    color: #666;
}

.chart-range {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: #f1f2f4;
    border-radius: 8px;
}

.chart-range button {
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: none;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
}

.chart-range button:hover {
    color: #1b1b1b;
}

.chart-range button[aria-pressed="true"] {
    background: #fff;
    color: #1b1b1b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 40px;
    margin: 18px 0 4px;
}

.chart-legend-item {
    display: grid;
    gap: 2px;
}

.chart-legend-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #555;
}

.chart-key {
    width: 18px;
    height: 4px;
    overflow: visible;
}

.chart-legend-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1b1b1b;
}

.chart-plots {
    min-height: 280px;
    margin-top: 10px;
    border-radius: 4px;
}

.chart-plots:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 4px;
}

.chart-plot-label {
    margin: 14px 0 2px;
    font-family: var(--font-heading);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
}

.chart-plot svg {
    display: block;
    overflow: visible;
    touch-action: pan-y;
}

.chart-grid line {
    stroke: var(--chart-grid);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.chart-axis-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    fill: var(--chart-muted);
}

.chart-grid line.chart-base {
    stroke: var(--chart-axis);
}

.chart-axis-text {
    font-family: var(--font-body, inherit);
    font-size: 11px;
    fill: var(--chart-muted);
}

.chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-line.members { stroke: var(--series-members); }
.chart-line.revenue { stroke: var(--series-revenue); }
.chart-line.subs { stroke: var(--series-subs); stroke-dasharray: 6 4; }

.chart-area {
    stroke: none;
    opacity: 0.1;
}

.chart-area.members { fill: var(--series-members); }
.chart-area.revenue { fill: var(--series-revenue); }

.chart-cross {
    stroke: #9b9a94;
    stroke-width: 1;
}

.chart-dot {
    stroke: #fff;
    stroke-width: 2;
}

.chart-dot.members { fill: var(--series-members); }
.chart-dot.revenue { fill: var(--series-revenue); }
.chart-dot.subs { fill: var(--series-subs); }

.chart-tip {
    position: absolute;
    z-index: 5;
    min-width: 190px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-size: 0.8125rem;
    pointer-events: none;
}

.chart-tip[hidden] {
    display: none;
}

.chart-tip-date {
    margin-bottom: 6px;
    font-weight: 600;
    color: #555;
}

.chart-tip-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-tip-row + .chart-tip-row {
    margin-top: 4px;
}

.chart-tip-key {
    flex-shrink: 0;
    width: 14px;
    border-top: 2px solid;
}

.chart-tip-key.members { border-color: var(--series-members); }
.chart-tip-key.revenue { border-color: var(--series-revenue); }
.chart-tip-key.subs { border-color: var(--series-subs); border-top-style: dashed; }

.chart-tip-row strong {
    min-width: 64px;
    color: #1b1b1b;
}

.chart-tip-row span:last-child {
    color: #666;
}

@media (max-width: 559.98px) {
    .chart-card {
        padding: 16px 14px 10px;
    }

    .chart-legend {
        gap: 10px 24px;
    }

    .chart-legend-value {
        font-size: 1.25rem;
    }
}

/* ---------- Chart + Latest Members row (dashboard) ---------- */
.dash-top {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    margin-top: 24px;
    align-items: stretch;
}

.dash-top .chart-card {
    margin-top: 0;
}

.latest-card {
    display: flex;
    flex-direction: column;
}

.latest-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.latest-head a {
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--green);
    text-decoration: none;
}

.latest-head a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.latest-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.latest-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: none;
    font: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.latest-row:hover {
    background: #fafafa;
}

.latest-list li:last-child .latest-row {
    border-bottom: 0;
}

.latest-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fbe9df;
    color: var(--green);
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 700;
}

.latest-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.latest-text strong {
    overflow: hidden;
    font-size: 0.9375rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-text span {
    overflow: hidden;
    font-size: 0.8125rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #777;
}

.latest-end {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.latest-date {
    font-size: 0.75rem;
    color: #888;
}

.latest-empty {
    display: grid;
    gap: 8px;
    padding: 40px 20px;
    font-size: 0.875rem;
    text-align: center;
    color: #777;
}

.latest-empty a {
    color: var(--green);
    font-weight: 600;
}

@media (max-width: 1099.98px) {
    .dash-top {
        grid-template-columns: minmax(0, 1fr);
    }
}
