/*
 * admin.css — the platform console, which must not look like the product.
 *
 * Arena is cyan. This is amber, and the bar across the top says Platform
 * in it. Michael will be in both screens and must never be unsure which
 * one he is operating — that is the whole reason this file exists rather
 * than the console being a tab in Arena.
 *
 * Brand tokens only. The amber is --drtx-warn, which is already in the
 * palette and already measured against this background; a console is no
 * excuse to invent a colour.
 */

.admin-body {
    background: var(--drtx-bg);
    color: var(--drtx-text);
    font-family: var(--drtx-font-sans);
    margin: 0;
}

/* --- the bar that says where you are ------------------------------------ */

.admin-bar {
    background: var(--drtx-notice-bg);
    border-bottom: 3px solid var(--drtx-warn);
    padding: 10px 18px;
    overflow: hidden;
}
.admin-mark { vertical-align: middle; opacity: 0.85; }
.admin-what {
    font-family: var(--drtx-font-mono);
    font-size: 12px;
    letter-spacing: var(--drtx-label-tracking);
    text-transform: uppercase;
    color: var(--drtx-warn);
    margin-left: 10px;
    vertical-align: middle;
}
.admin-out {
    float: right;
    color: var(--drtx-notice-text);
    font-size: 14px;
    text-decoration: underline;
    margin-top: 3px;
}

.admin {
    max-width: 820px;
    margin: 0 auto;
    padding: 22px 18px 48px;
}
.admin-h { margin-top: 0; }
.admin-say {
    color: var(--drtx-text-muted);
    line-height: 1.45;
    margin: 0 0 20px;
}

/* --- a row ---------------------------------------------------------------
 *
 * One line per thing, laid out so the STATE is readable down the column
 * without reading the names: that is the question being asked of this
 * screen, and the names are only how you find the row.
 */

.adm-row {
    border-bottom: 1px solid var(--drtx-border);
    padding: 12px 0;
    overflow: hidden;
}
.adm-name {
    display: inline-block;
    min-width: 30%;
    font-weight: 700;
    vertical-align: middle;
}
.adm-id {
    display: inline-block;
    min-width: 20%;
    font-family: var(--drtx-font-mono);
    font-size: 12px;
    color: var(--drtx-text-muted);
    vertical-align: middle;
}
.adm-state {
    display: inline-block;
    min-width: 22%;
    font-family: var(--drtx-font-mono);
    font-size: 12px;
    vertical-align: middle;
}
.is-on { color: var(--drtx-ok); }
.is-grace { color: var(--drtx-warn); }
.is-off { color: var(--drtx-text-muted); }
/*
 * The buttons to the right, out of the flow. Name, id and state take
 * most of the width between them, and two buttons after that wrapped
 * onto a line of their own under the row they belonged to.
 */
.adm-do { float: right; margin-left: 6px; }

/* --- a phone, because support happens away from a desk ------------------- */

@media (max-width: 620px) {
    /*
     * Stacked. Four things across a 375px screen is four things nobody
     * can read, and this is a screen somebody opens on a phone because a
     * venue has rung up.
     */
    .adm-name, .adm-id, .adm-state {
        display: block;
        min-width: 0;
        margin-bottom: 2px;
    }
    .adm-do { margin: 8px 6px 0 0; }
}

/*
 * What plan a subscriber is on, beside what the gate says about them.
 * Quiet: the state — paid until when — is the thing read first, and
 * this is the answer to the question after it.
 */
.adm-plan {
    font-family: var(--drtx-font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--drtx-text-muted);
}

/*
 * A found row that opens something. Support reads these out loud on
 * the phone and then taps one, so the whole row is the target rather
 * than a word in it.
 */
.adm-click { cursor: pointer; }
/* --drtx-raised, not a white tint: a white tint on a light page is
 * a hover state nobody can see. */
.adm-click:hover { background: var(--drtx-raised); }

/* The counts across the top of "how it is going". Mono so the numbers
 * line up when you glance down them twice in a minute. */
.adm-stat {
    font-family: var(--drtx-font-mono);
    font-size: 12px;
    margin-right: 16px;
    color: var(--drtx-text-muted);
    white-space: nowrap;
}

/*
 * ADMIN MODE, while it is on.
 *
 * Red, not the console's amber. Amber means "you are operating the
 * platform", which is true the moment you open this page. Red means
 * "you can currently reach into everybody else's data", which is only
 * true for half an hour at a time and is the thing worth noticing
 * from the other side of a room.
 *
 * --drtx-alarm, the same token the view-as banner in Arena uses, so
 * the two states a platform administrator can be in look like each
 * other and like nothing else.
 */
.admin-mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--drtx-alarm);
    color: var(--drtx-alarm-text);
    font-family: var(--drtx-font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
}
.admin-mode-what {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 12px;
}
.admin-mode .button { flex: 0 0 auto; }

/* And a line down the page, so it is not only the strip at the top
 * that has changed when somebody scrolls past it. */
body.is-acting .admin { border-left: 3px solid var(--drtx-alarm); }

@media (max-width: 560px) {
    .admin-mode { display: block; }
    .admin-mode-what { display: block; margin: 0 0 8px; }
}

/*
 * The counts across the top of "how it is going".
 *
 * .adm-row clips what overflows it, which is right for a row of
 * name / id / state and wrong for a list of numbers: at 375px
 * "10 competitions", "10 paying" and "21 joined this week" simply
 * ran off the right edge and were cut. They wrap instead.
 */
.adm-stats {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
}
.adm-stats .adm-stat { margin-bottom: 4px; }

/* A heading that follows another section still needs the room, and
 * .panel-title-next would have made it a quiet mono label instead. */
.admin-h { margin-top: 32px; }
