/* ================================================================================
   ADMIN-ANALYTICS.CSS - The admin Analytics screens
   (markup: templates/partials/admin-analytics.html)

     #adminAnalyticsOverlay   overview            classes: admin-an-*
     #adminTopVenuesOverlay   top venues          classes: admin-tv-*
     #adminTopBeersOverlay    top beers           classes: admin-tb-*
     #adminTapsOverlay        taps and screens    classes: admin-tp-*
     #adminTopTownsOverlay    top towns           classes: admin-tt-*
     #adminBreweryStatsOverlay  breweries         classes: admin-bs-*
     #adminMoneyOverlay       money               classes: admin-mn-*
     #adminMonthsOverlay      month by month      classes: admin-mo-*

   House style: every rule sits under its own overlay's id. The screens
   share a look (the period switch, the pills, the ranked rows), and those
   rules are written out once per screen on purpose rather than shared.
   Change one, change the others to match.

   All colour from var(--token), so there is no [data-theme="dark"] block.
   ================================================================================ */


/* ================================================================================
   #adminAnalyticsOverlay - Overview
   ================================================================================ */
#adminAnalyticsOverlay .admin-an-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
}

#adminAnalyticsOverlay .admin-an-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Today / 7 days / 30 days. Three across. */
#adminAnalyticsOverlay .admin-an-period {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminAnalyticsOverlay .admin-an-period-btn {
    min-height: 40px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminAnalyticsOverlay .admin-an-period-btn.is-on {
    background: var(--bg-purple);
    border-color: var(--border-purple);
    color: var(--text-primary);
    font-weight: 700;
}

#adminAnalyticsOverlay .admin-an-empty {
    padding: var(--space-xl) 0;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Where the numbers come from and who is left out. */
#adminAnalyticsOverlay .admin-an-note {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

#adminAnalyticsOverlay .admin-an-about {
    margin: var(--space-xs) 0 0;
    min-height: 1.4em;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Six numbers, two across, so the grid is always even. */
#adminAnalyticsOverlay .admin-an-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
}

/* "Loading…" and errors take the whole width of the grid. */
#adminAnalyticsOverlay .admin-an-metrics .admin-an-empty {
    grid-column: 1 / -1;
}

#adminAnalyticsOverlay .admin-an-metric {
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

#adminAnalyticsOverlay .admin-an-metric-label {
    font-size: var(--text-xs);
    line-height: 1.3;
    color: var(--text-muted);
}

#adminAnalyticsOverlay .admin-an-metric-value {
    font-size: var(--text-2xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Against the period before: up, down, or nothing to say. */
#adminAnalyticsOverlay .admin-an-change {
    font-size: var(--text-xs);
    font-weight: 700;
}

#adminAnalyticsOverlay .admin-an-change.is-up {
    color: var(--green);
}

#adminAnalyticsOverlay .admin-an-change.is-down {
    color: var(--red);
}

#adminAnalyticsOverlay .admin-an-change.is-none {
    font-weight: 600;
    color: var(--text-muted);
}

/* People per day. */
#adminAnalyticsOverlay .admin-an-chart-card {
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

#adminAnalyticsOverlay .admin-an-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

#adminAnalyticsOverlay .admin-an-chart-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
}

#adminAnalyticsOverlay .admin-an-chart-range {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Fourteen columns: the number, the bar, the day of the month. The bar's
   height is a share of the tallest day, set inline by admin-analytics.js. */
#adminAnalyticsOverlay .admin-an-chart {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: var(--space-xs);
    height: 132px;
}

#adminAnalyticsOverlay .admin-an-bar-col {
    display: grid;
    grid-template-rows: 14px minmax(0, 1fr) 14px;
    gap: var(--space-xxs);
    justify-items: center;
    align-items: end;
    min-width: 0;
}

#adminAnalyticsOverlay .admin-an-bar-num,
#adminAnalyticsOverlay .admin-an-bar-day {
    font-size: var(--text-xxs);
    line-height: 14px;
    color: var(--text-muted);
}

#adminAnalyticsOverlay .admin-an-bar-num {
    font-weight: 700;
    color: var(--text-secondary);
}

#adminAnalyticsOverlay .admin-an-bar {
    width: 100%;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--amber);
}

/* The way in to the other screens: one card, one row each. */
#adminAnalyticsOverlay .admin-an-links {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

#adminAnalyticsOverlay .admin-an-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    min-height: 56px;
    padding: var(--space-md);
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

#adminAnalyticsOverlay .admin-an-link:first-child {
    border-top: none;
}

#adminAnalyticsOverlay .admin-an-link:hover:not(:disabled) {
    background: var(--hover-subtle);
}

#adminAnalyticsOverlay .admin-an-link:disabled {
    opacity: 0.55;
    cursor: default;
}

#adminAnalyticsOverlay .admin-an-link-icon {
    flex-shrink: 0;
    width: 28px;
    font-size: var(--text-xl);
    line-height: 1;
    text-align: center;
}

#adminAnalyticsOverlay .admin-an-link-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

#adminAnalyticsOverlay .admin-an-link-name {
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

#adminAnalyticsOverlay .admin-an-link-sub {
    font-size: var(--text-xs);
    line-height: 1.35;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

#adminAnalyticsOverlay .admin-an-link-arrow {
    flex-shrink: 0;
    font-size: var(--text-lg);
    color: var(--text-muted);
}


/* ================================================================================
   #adminTopVenuesOverlay - Top venues
   ================================================================================ */
#adminTopVenuesOverlay .admin-tv-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
}

#adminTopVenuesOverlay .admin-tv-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Today / 7 days / 30 days. Three across. */
#adminTopVenuesOverlay .admin-tv-period {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminTopVenuesOverlay .admin-tv-period-btn {
    min-height: 40px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminTopVenuesOverlay .admin-tv-period-btn.is-on {
    background: var(--bg-purple);
    border-color: var(--border-purple);
    color: var(--text-primary);
    font-weight: 700;
}

#adminTopVenuesOverlay .admin-tv-empty {
    padding: var(--space-xl) 0;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Where the numbers come from and who is left out. */
#adminTopVenuesOverlay .admin-tv-note {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

/* Views / Visits / Snaps, and the Not Diamond switch. Four across. */
#adminTopVenuesOverlay .admin-tv-pills {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminTopVenuesOverlay .admin-tv-pill {
    min-height: 36px;
    padding: var(--space-xs) var(--space-xs);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminTopVenuesOverlay .admin-tv-pill.is-on {
    background: var(--bg-amber);
    border-color: var(--border-amber);
    color: var(--amber);
    font-weight: 700;
}

#adminTopVenuesOverlay .admin-tv-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* One ranked row: its place, what it is, and the number it is ranked on. */
#adminTopVenuesOverlay .admin-tv-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
}

#adminTopVenuesOverlay .admin-tv-rank {
    flex-shrink: 0;
    width: 22px;
    font-size: var(--text-sm);
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
}

#adminTopVenuesOverlay .admin-tv-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

#adminTopVenuesOverlay .admin-tv-name {
    min-width: 0;
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

#adminTopVenuesOverlay .admin-tv-sub {
    font-size: var(--text-xs);
    line-height: 1.35;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

#adminTopVenuesOverlay .admin-tv-value {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#adminTopVenuesOverlay .admin-tv-value-num {
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

#adminTopVenuesOverlay .admin-tv-value-unit {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* The row is a button: it opens the page. */
#adminTopVenuesOverlay button.admin-tv-row {
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

#adminTopVenuesOverlay button.admin-tv-row:hover {
    border-color: var(--border-purple);
}

/* Not Diamond is a switch, not a fourth way to rank: purple when on, so it
   reads as a different kind of button from the three beside it. */
#adminTopVenuesOverlay .admin-tv-pill-switch.is-on {
    background: var(--bg-purple);
    border-color: var(--border-purple);
    color: var(--text-primary);
}

#adminTopVenuesOverlay .admin-tv-name-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-sm);
}

/* The venue's tier, in the tier's own colour. */
#adminTopVenuesOverlay .admin-tv-tier {
    flex-shrink: 0;
    padding: 1px var(--space-sm);
    border: 1px solid currentColor;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
    color: var(--text-muted);
}

#adminTopVenuesOverlay .admin-tv-tier.is-diamond {
    color: var(--tier-dot-diamond);
}

#adminTopVenuesOverlay .admin-tv-tier.is-gold {
    color: var(--tier-dot-gold);
}

#adminTopVenuesOverlay .admin-tv-tier.is-silver {
    color: var(--tier-dot-silver);
}

#adminTopVenuesOverlay .admin-tv-tier.is-bronze {
    color: var(--tier-dot-bronze);
}


/* ================================================================================
   #adminTopBeersOverlay - Top beers
   ================================================================================ */
#adminTopBeersOverlay .admin-tb-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
}

#adminTopBeersOverlay .admin-tb-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Today / 7 days / 30 days. Three across. */
#adminTopBeersOverlay .admin-tb-period {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminTopBeersOverlay .admin-tb-period-btn {
    min-height: 40px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminTopBeersOverlay .admin-tb-period-btn.is-on {
    background: var(--bg-purple);
    border-color: var(--border-purple);
    color: var(--text-primary);
    font-weight: 700;
}

#adminTopBeersOverlay .admin-tb-empty {
    padding: var(--space-xl) 0;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Where the numbers come from and who is left out. */
#adminTopBeersOverlay .admin-tb-note {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

/* Most logged / Best rated / Most searched. Three across. */
#adminTopBeersOverlay .admin-tb-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminTopBeersOverlay .admin-tb-pill {
    min-height: 36px;
    padding: var(--space-xs) var(--space-xs);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminTopBeersOverlay .admin-tb-pill.is-on {
    background: var(--bg-amber);
    border-color: var(--border-amber);
    color: var(--amber);
    font-weight: 700;
}

#adminTopBeersOverlay .admin-tb-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* One ranked row: its place, what it is, and the number it is ranked on. */
#adminTopBeersOverlay .admin-tb-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
}

#adminTopBeersOverlay .admin-tb-rank {
    flex-shrink: 0;
    width: 22px;
    font-size: var(--text-sm);
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
}

#adminTopBeersOverlay .admin-tb-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

#adminTopBeersOverlay .admin-tb-name {
    min-width: 0;
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

#adminTopBeersOverlay .admin-tb-sub {
    font-size: var(--text-xs);
    line-height: 1.35;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

#adminTopBeersOverlay .admin-tb-value {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#adminTopBeersOverlay .admin-tb-value-num {
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

#adminTopBeersOverlay .admin-tb-value-unit {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* The row is a button: it opens the page. */
#adminTopBeersOverlay button.admin-tb-row {
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

#adminTopBeersOverlay button.admin-tb-row:hover {
    border-color: var(--border-purple);
}

#adminTopBeersOverlay .admin-tb-brewery {
    font-size: var(--text-sm);
    line-height: 1.3;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}


/* ================================================================================
   #adminTapsOverlay - How people use the app
   ================================================================================ */
#adminTapsOverlay .admin-tp-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
}

#adminTapsOverlay .admin-tp-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Today / 7 days / 30 days. Three across. */
#adminTapsOverlay .admin-tp-period {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminTapsOverlay .admin-tp-period-btn {
    min-height: 40px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminTapsOverlay .admin-tp-period-btn.is-on {
    background: var(--bg-purple);
    border-color: var(--border-purple);
    color: var(--text-primary);
    font-weight: 700;
}

#adminTapsOverlay .admin-tp-empty {
    padding: var(--space-xl) 0;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Where the numbers come from and who is left out. */
#adminTapsOverlay .admin-tp-note {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

/* Buttons / Screens / Drop-off. Three across. */
#adminTapsOverlay .admin-tp-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminTapsOverlay .admin-tp-pill {
    min-height: 36px;
    padding: var(--space-xs) var(--space-xs);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminTapsOverlay .admin-tp-pill.is-on {
    background: var(--bg-amber);
    border-color: var(--border-amber);
    color: var(--amber);
    font-weight: 700;
}

#adminTapsOverlay .admin-tp-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* One ranked row: its place, what it is, and the number it is ranked on. */
#adminTapsOverlay .admin-tp-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
}

#adminTapsOverlay .admin-tp-rank {
    flex-shrink: 0;
    width: 22px;
    font-size: var(--text-sm);
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
}

#adminTapsOverlay .admin-tp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

#adminTapsOverlay .admin-tp-name {
    min-width: 0;
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

#adminTapsOverlay .admin-tp-sub {
    font-size: var(--text-xs);
    line-height: 1.35;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

#adminTapsOverlay .admin-tp-value {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#adminTapsOverlay .admin-tp-value-num {
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

#adminTapsOverlay .admin-tp-value-unit {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Button and screen names are the names in the code, so they are shown the
   way code is. */
#adminTapsOverlay .admin-tp-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--text-sm);
}

/* Drop-off: one card per question, a bar per line. The bar's width is the
   line's share, set inline by admin-analytics.js. */
#adminTapsOverlay .admin-tp-drop {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

#adminTapsOverlay .admin-tp-drop-title {
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

#adminTapsOverlay .admin-tp-drop-of {
    margin-top: calc(var(--space-sm) * -1);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

#adminTapsOverlay .admin-tp-drop-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-xs);
}

#adminTapsOverlay .admin-tp-drop-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

#adminTapsOverlay .admin-tp-drop-figure {
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
}

#adminTapsOverlay .admin-tp-drop-track {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-option);
    overflow: hidden;
}

#adminTapsOverlay .admin-tp-drop-fill {
    display: block;
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--amber);
}


/* ================================================================================
   #adminTopTownsOverlay - Top towns
   ================================================================================ */
#adminTopTownsOverlay .admin-tt-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
}

#adminTopTownsOverlay .admin-tt-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Today / 7 days / 30 days. Three across. */
#adminTopTownsOverlay .admin-tt-period {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminTopTownsOverlay .admin-tt-period-btn {
    min-height: 40px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminTopTownsOverlay .admin-tt-period-btn.is-on {
    background: var(--bg-purple);
    border-color: var(--border-purple);
    color: var(--text-primary);
    font-weight: 700;
}

#adminTopTownsOverlay .admin-tt-empty {
    padding: var(--space-xl) 0;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Where the numbers come from and who is left out. */
#adminTopTownsOverlay .admin-tt-note {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

/* Searched / Visited / Viewed. Three across. */
#adminTopTownsOverlay .admin-tt-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminTopTownsOverlay .admin-tt-pill {
    min-height: 36px;
    padding: var(--space-xs) var(--space-xs);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminTopTownsOverlay .admin-tt-pill.is-on {
    background: var(--bg-amber);
    border-color: var(--border-amber);
    color: var(--amber);
    font-weight: 700;
}

#adminTopTownsOverlay .admin-tt-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* One ranked row: its place, what it is, and the number it is ranked on. */
#adminTopTownsOverlay .admin-tt-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
}

#adminTopTownsOverlay .admin-tt-rank {
    flex-shrink: 0;
    width: 22px;
    font-size: var(--text-sm);
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
}

#adminTopTownsOverlay .admin-tt-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

#adminTopTownsOverlay .admin-tt-name {
    min-width: 0;
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

#adminTopTownsOverlay .admin-tt-sub {
    font-size: var(--text-xs);
    line-height: 1.35;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

#adminTopTownsOverlay .admin-tt-value {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#adminTopTownsOverlay .admin-tt-value-num {
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

#adminTopTownsOverlay .admin-tt-value-unit {
    font-size: var(--text-xs);
    color: var(--text-muted);
}


/* ================================================================================
   #adminBreweryStatsOverlay - Breweries and partners
   ================================================================================ */
#adminBreweryStatsOverlay .admin-bs-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
}

#adminBreweryStatsOverlay .admin-bs-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

/* Today / 7 days / 30 days. Three across. */
#adminBreweryStatsOverlay .admin-bs-period {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminBreweryStatsOverlay .admin-bs-period-btn {
    min-height: 40px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminBreweryStatsOverlay .admin-bs-period-btn.is-on {
    background: var(--bg-purple);
    border-color: var(--border-purple);
    color: var(--text-primary);
    font-weight: 700;
}

#adminBreweryStatsOverlay .admin-bs-empty {
    padding: var(--space-xl) 0;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Where the numbers come from and who is left out. */
#adminBreweryStatsOverlay .admin-bs-note {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

/* Page views / Shop taps / Codes copied. Three across. */
#adminBreweryStatsOverlay .admin-bs-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

#adminBreweryStatsOverlay .admin-bs-pill {
    min-height: 36px;
    padding: var(--space-xs) var(--space-xs);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

#adminBreweryStatsOverlay .admin-bs-pill.is-on {
    background: var(--bg-amber);
    border-color: var(--border-amber);
    color: var(--amber);
    font-weight: 700;
}

#adminBreweryStatsOverlay .admin-bs-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* One ranked row: its place, what it is, and the number it is ranked on. */
#adminBreweryStatsOverlay .admin-bs-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
}

#adminBreweryStatsOverlay .admin-bs-rank {
    flex-shrink: 0;
    width: 22px;
    font-size: var(--text-sm);
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
}

#adminBreweryStatsOverlay .admin-bs-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

#adminBreweryStatsOverlay .admin-bs-name {
    min-width: 0;
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

#adminBreweryStatsOverlay .admin-bs-sub {
    font-size: var(--text-xs);
    line-height: 1.35;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

#adminBreweryStatsOverlay .admin-bs-value {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#adminBreweryStatsOverlay .admin-bs-value-num {
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

#adminBreweryStatsOverlay .admin-bs-value-unit {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* The row is a button: it opens the brewery's page. */
#adminBreweryStatsOverlay button.admin-bs-row {
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

#adminBreweryStatsOverlay button.admin-bs-row:hover {
    border-color: var(--border-purple);
}

#adminBreweryStatsOverlay .admin-bs-name-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-sm);
}

/* A partner right now, by the one rule in utils/brewery_partner.py. */
#adminBreweryStatsOverlay .admin-bs-partner {
    flex-shrink: 0;
    padding: 1px var(--space-sm);
    border: 1px solid var(--border-amber);
    border-radius: var(--radius-pill);
    background: var(--bg-amber);
    color: var(--amber);
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
}


/* ================================================================================
   #adminMoneyOverlay - Money (no period switch: it is "as things stand now")
   ================================================================================ */
#adminMoneyOverlay .admin-mn-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
}

#adminMoneyOverlay .admin-mn-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

#adminMoneyOverlay .admin-mn-empty {
    padding: var(--space-xl) 0;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Where the numbers come from and who is left out. */
#adminMoneyOverlay .admin-mn-note {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

#adminMoneyOverlay .admin-mn-about {
    margin: var(--space-xs) 0 0;
    min-height: 1.4em;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

#adminMoneyOverlay .admin-mn-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Stripe could not be reached. */
#adminMoneyOverlay .admin-mn-warning {
    padding: var(--space-md);
    background: var(--bg-red);
    border: 1px solid var(--border-red);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--text-sm);
    line-height: 1.5;
}

/* The two money cards at the top: what is coming in, and what actually
   came in. A title, a line per figure, and for the first a closing note. */
#adminMoneyOverlay .admin-mn-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-amber);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

#adminMoneyOverlay .admin-mn-card-title {
    padding: var(--space-md) var(--space-md) var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
}

#adminMoneyOverlay .admin-mn-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-light);
}

/* The first line sits straight under the title, with no rule between. */
#adminMoneyOverlay .admin-mn-card-title + .admin-mn-line {
    border-top: none;
}

#adminMoneyOverlay .admin-mn-line-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

#adminMoneyOverlay .admin-mn-line-name {
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

#adminMoneyOverlay .admin-mn-line-sub {
    font-size: var(--text-xs);
    line-height: 1.35;
    color: var(--text-muted);
}

#adminMoneyOverlay .admin-mn-line-value {
    flex-shrink: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--text-primary);
}

/* "You received": the figure the lines above it lead to. */
#adminMoneyOverlay .admin-mn-line.is-total {
    background: var(--bg-amber);
}

#adminMoneyOverlay .admin-mn-line.is-total .admin-mn-line-value {
    color: var(--amber);
}

#adminMoneyOverlay .admin-mn-card-foot {
    padding: var(--space-sm) var(--space-md) var(--space-md);
    border-top: 1px solid var(--border-light);
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--text-muted);
}

#adminMoneyOverlay .admin-mn-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

#adminMoneyOverlay .admin-mn-section-title {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
}

#adminMoneyOverlay .admin-mn-none {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* One card per section, one line per venue or brewery. */
#adminMoneyOverlay .admin-mn-rows {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

#adminMoneyOverlay .admin-mn-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    min-height: 48px;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
}

#adminMoneyOverlay .admin-mn-row:first-child {
    border-top: none;
}

/* The row is a button when there is a page to open. */
#adminMoneyOverlay button.admin-mn-row {
    cursor: pointer;
}

#adminMoneyOverlay button.admin-mn-row:hover {
    background: var(--hover-subtle);
}

#adminMoneyOverlay .admin-mn-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xxs);
}

#adminMoneyOverlay .admin-mn-row-name {
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

#adminMoneyOverlay .admin-mn-row-sub {
    font-size: var(--text-xs);
    line-height: 1.4;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

#adminMoneyOverlay .admin-mn-row-value {
    flex-shrink: 0;
    font-size: var(--text-md);
    font-weight: 800;
    color: var(--text-primary);
}

/* Cancelled, payment failed, not live: the thing to notice about a row. */
#adminMoneyOverlay .admin-mn-flag {
    flex-shrink: 0;
    padding: 1px var(--space-sm);
    border: 1px solid var(--border-red);
    border-radius: var(--radius-pill);
    background: var(--bg-red);
    color: var(--red);
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
}


/* ================================================================================
   #adminMonthsOverlay - Month by month (no period switch: every month is here)
   ================================================================================ */
#adminMonthsOverlay .admin-mo-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-lg);
}

#adminMonthsOverlay .admin-mo-title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

#adminMonthsOverlay .admin-mo-empty {
    padding: var(--space-xl) 0;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* What each figure means and who is left out. */
#adminMonthsOverlay .admin-mo-note {
    margin: 0;
    font-size: var(--text-xs);
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

#adminMonthsOverlay .admin-mo-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* One month. */
#adminMonthsOverlay .admin-mo-month {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

#adminMonthsOverlay .admin-mo-month-head {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
}

#adminMonthsOverlay .admin-mo-month-name {
    font-size: var(--text-md);
    font-weight: 800;
    color: var(--text-primary);
}

/* The month we are in is not finished. */
#adminMonthsOverlay .admin-mo-month-sofar {
    padding: 1px var(--space-sm);
    border: 1px solid var(--border-amber);
    border-radius: var(--radius-pill);
    background: var(--bg-amber);
    color: var(--amber);
    font-size: var(--text-xs);
    font-weight: 700;
}

/* Eight figures, two across, so the grid is always even. */
#adminMonthsOverlay .admin-mo-figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md) var(--space-lg);
}

#adminMonthsOverlay .admin-mo-figure-label {
    font-size: var(--text-xs);
    line-height: 1.3;
    color: var(--text-muted);
}

#adminMonthsOverlay .admin-mo-figure-value {
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
}

#adminMonthsOverlay .admin-mo-figure-sub {
    font-size: var(--text-xs);
    line-height: 1.3;
    color: var(--text-muted);
}
