/* ── Admin dashboard ─────────────────────────────────────────── */

/* admin page layout */

.admin-header__sub
{
    font-family: var(--font-ui);
    font-size: var(--size-sm);
    color: var(--ink-3);
    margin-bottom: 0;
}
.admin-page
{
    max-width: var(--max-w);
    margin: 0 auto;
    padding: var(--space-16) var(--space-8) var(--space-16);
}
.admin-section
{
    margin-bottom: var(--space-12);
}
.admin-section__head
{
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--rule-heavy);
    margin-bottom: var(--space-4);
}
.admin-section__head h2
{
    font-family: var(--font-ui);
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    flex: 1;
}
.admin-section__count
{
    font-family: var(--font-mono);
    font-size: var(--size-xs);
    color: var(--ink-4);
}
/* admin table */

.admin-table
{
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-ui);
    font-size: var(--size-sm);
}
.admin-table th
{
    text-align: left;
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-4);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--rule);
    white-space: nowrap;
}
.admin-table td
{
    padding: var(--space-3) var(--space-3);
    border-bottom: 1px solid var(--rule);
    color: var(--ink-2);
    vertical-align: middle;
}
@media (hover: hover)
{
    .admin-table tr:hover td { background-color: var(--bg-alt); }
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table__title a
{
    color: var(--ink);
    border-bottom: none;
    font-weight: 500;
}
@media (hover: hover)
{
    .admin-table__title a:hover { color: var(--accent); border-bottom: none; }
}
/* the action buttons line up as a flex row: identical gaps regardless of
   whether a button is bare or wrapped in a form, and uniform widths via the
   min-width on .admin-btn below */
.admin-table__actions
{
    white-space: nowrap;
    vertical-align: middle;
}
/* buttons and their wrapping forms sit inline on one row, spaced by a right
   margin dropped on the last one */
.admin-table__actions > form,
.admin-table__actions > .admin-btn
{
    margin-right: var(--space-1);
}
.admin-table__actions > form:last-child,
.admin-table__actions > .admin-btn:last-child
{
    margin-right: 0;
}
.admin-table__actions .admin-btn { vertical-align: middle; }
/* keep short dates like "25 Jul 2026" on one line so the actions column cannot
   squeeze them onto two rows */
.admin-table__date { white-space: nowrap; }
/* admin action buttons */

.admin-btn
{
    font-family: var(--font-ui);
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: var(--space-1) var(--space-2);
    border: 1px solid currentColor;
    background: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-block;
    /* pin line-height and box model so the <a> Edit button matches the <button>
       ones exactly — anchors and buttons compute their box height differently */
    line-height: 1.4;
    box-sizing: border-box;
    /* one width for every action button so a row stays even. sized to fit the
       longest label (Make owner / Unfeature) inside it, not just as a floor —
       otherwise those two overflow the min-width and end up wider than Edit */
    min-width: 6.5rem;
    text-align: center;
}
.admin-btn--edit { color: var(--ink-2); border-color: var(--ink-2); }
@media (hover: hover)
{
    .admin-btn--edit:hover { background: var(--ink-2); color: var(--bg); }
}
.admin-btn--delete { color: var(--accent); }
@media (hover: hover)
{
    .admin-btn--delete:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
}
.admin-btn--approve { color: #5a8a5a; border-color: #5a8a5a; }
@media (hover: hover)
{
    .admin-btn--approve:hover { background: #5a8a5a; color: #fff; }
}
.admin-btn--deny { color: var(--accent); }
@media (hover: hover)
{
    .admin-btn--deny:hover { background: var(--accent); color: var(--bg); }
}
/* status badges */

.status-badge
{
    display: inline-block;
    /* middle-align so the "Featured" badge lines up with the Unfeature button
       when they share the featured picker's action cell */
    vertical-align: middle;
    font-family: var(--font-ui);
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1px var(--space-1);
    /* all status badges share one width so Published/Draft/Featured line up;
       sized to the longest label, no more */
    min-width: 5.5rem;
    text-align: center;
}
.status-badge--published
{
    color: #5a8a5a;
    border: 1px solid #5a8a5a;
}
.status-badge--draft
{
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--accent);
}
.status-badge--featured
{
    color: var(--accent);
    border: 1px solid var(--accent);
}
/* role badges in the team table */

.role-badge
{
    display: inline-block;
    font-family: var(--font-ui);
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1px var(--space-1);
    border: 1px solid currentColor;
    /* one width for Root owner/Owner/Admin so the column reads evenly;
       sized to the longest label */
    min-width: 6.5rem;
    text-align: center;
}
/* the status and role cells lay their badges out with a flex gap. flex ignores
   the whitespace text nodes between the spans, so the gap is exactly space-1 —
   the same value the action buttons use, no collapsed-space fuzz on top */
.admin-table__badges
{
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
.role-badge--root { color: var(--accent); }
.role-badge--owner { color: var(--ink-2); }
.role-badge--admin { color: var(--ink-3); }
/* small "you" chip next to the logged-in person's own row */

.you-tag
{
    display: inline-block;
    font-family: var(--font-ui);
    font-size: var(--size-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
    border: 1px solid var(--rule);
    padding: 0 var(--space-2);
    margin-left: var(--space-2);
    vertical-align: middle;
    line-height: 1.6;
}
.admin-header__btns
{
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}




/* ── Narrow screens ──────────────────────────────────────────── */

/* tables keep their layout and scroll sideways inside their own box instead
   of dragging the whole page wide. 900px, not 700: with the uniform-width
   action buttons the articles table is ~800px wide, so between 700 and 900
   the whole page overflowed while the phone rule below never applied */
@media (max-width: 900px)
{
    .admin-table { display: block; overflow-x: auto; }
}

@media (max-width: 700px)
{
    .admin-page { padding: var(--space-8) var(--space-4); }

    /* the two header buttons share the row evenly */
    .admin-header__btns .btn { flex: 1 1 auto; justify-content: center; }
}
