/*
 * admin.css - additions for the admin screens only. Loads AFTER /shared/butter.css
 * and only adds classes (adm-*, bt-main--wide); it redefines nothing in the kit
 * and uses the kit's tokens. Owner: Builder B. Candidates to absorb into the
 * kit if Builder A wants them: bt-main--wide and the table classes.
 */
.bt-main--wide { max-width: 1120px; }
/* Blocks stacked in an admin page breathe by default; sections below set their own larger gap. */
.bt-main--wide > * + * { margin-top: 16px; }

.adm-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.adm-bar > .bt-field { flex: 1 1 160px; max-width: 280px; }
/* A button in the bar (Today's Refresh) sits level with the bottom of the fields, the same 48px high. */
.adm-bar > .bt-btn { flex: none; align-self: flex-end; }
.adm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.adm-scroll--more { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }

.adm-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 16px;
  background: var(--bt-white); border: 2px solid var(--bt-toast); border-radius: var(--bt-radius-tight); overflow: hidden;
}
.adm-table th {
  text-align: left; font: 600 13px var(--bt-font-head); padding: 10px 12px;
  background: var(--bt-yellow); border-bottom: 2px solid var(--bt-toast); white-space: nowrap;
}
.adm-table td { padding: 10px 12px; border-bottom: 1px solid #E6E3DB; vertical-align: middle; }
.adm-table td.nw { white-space: nowrap; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table .num, .adm-table th.num { text-align: right; }
.adm-table td.num { font-variant-numeric: tabular-nums; font-family: var(--bt-font-head); font-weight: 600; white-space: nowrap; }
.adm-table tr.adm-red td { background: #FBE4E0; }
.adm-table tr.adm-sub td { background: #FAF8F3; }
.adm-table tr.adm-off td { color: var(--bt-muted-text); }

.adm-neg { color: var(--bt-red); font-weight: 700; }
.adm-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-tabs .bt-btn[aria-pressed="true"] { background: var(--bt-yellow); }
.adm-section > * + * { margin-top: 12px; }
.adm-section { margin-top: 28px; }
.adm-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 16px; }
.adm-kv dt { font: 600 14px var(--bt-font-head); color: var(--bt-muted-text); margin: 0; }
.adm-kv dd { margin: 0; }
.adm-pct { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-pct .bt-btn[aria-pressed="true"] { background: var(--bt-yellow); border-width: 3px; }
.adm-check { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 16px; }
.adm-check input { width: 24px; height: 24px; accent-color: var(--bt-toast); }
.adm-checks { display: flex; gap: 8px 20px; flex-wrap: wrap; }

/* Leave: the decision controls sit apart from everything else on the card, and
   the pre-approval is small, quiet and collapsed (PENDING-DECISIONS 7a). */
.adm-decision { margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--bt-muted); }
.adm-quiet { font-size: 13px; color: var(--bt-muted-text); margin: 6px 0 0; }

/* Roster: week buttons in one row */
.adm-weeknav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 480px; }
.adm-weeknav .bt-btn { padding: 0 8px; }

/* Roster week grid */
.adm-grid { min-width: 860px; }
.adm-grid td, .adm-grid th { text-align: center; padding: 6px; min-width: 104px; }
.adm-grid td:first-child, .adm-grid th:first-child { text-align: left; min-width: 150px; position: sticky; left: 0; background: var(--bt-white); }
.adm-grid th:first-child { background: var(--bt-yellow); }
.adm-cell {
  display: block; white-space: nowrap; width: 100%; min-height: 48px; padding: 4px 6px; background: var(--bt-white);
  border: 1px solid var(--bt-muted); border-radius: var(--bt-radius-tight); font: 600 13px var(--bt-font-head);
  color: var(--bt-toast); cursor: pointer;
}
.adm-cell:focus-visible { outline: 3px solid var(--bt-toast); outline-offset: 2px; }
.adm-cell--shift { background: var(--bt-yellow); border-color: var(--bt-toast); }
.adm-cell--blocked { background: #EFECE5; color: var(--bt-muted-text); cursor: default; }
.adm-cell--add { color: var(--bt-muted-text); font-weight: 400; }
/* A day on the site that is not the person's default: a dashed edge AND the words "Other site" (text, never colour alone). */
.adm-cell--away { border-style: dashed; border-width: 2px; }
.adm-away { display: block; font: 400 11px var(--bt-font-head); }
/* Small heading row for each default site, and the small action under a name */
.adm-grid tr.adm-group th { text-align: left; background: var(--bt-toast); color: var(--bt-yellow); position: static; min-width: 0; }
.adm-site-actions .bt-btn { min-height: 48px; }
.adm-mini { min-height: 44px; margin-top: 4px; font-size: 13px; padding: 0 10px; }

/* Days table on the Month page: closed until asked for */
.adm-days > summary { margin: 0; }
.adm-days[open] > summary { margin-bottom: 12px; }

@media (max-width: 640px) {
  .adm-bar > .bt-field { max-width: none; }
  .adm-table { font-size: 14px; }
  .adm-table th, .adm-table td { padding: 8px 8px; }
}

/* Cards and panels (kit: 2px Warm Toast edge, generous radius) are the same on both sides.
   Tables and rows keep the tight radius (Design Tokens). The welcome card keeps its gold edge. */
.bt-main--wide .bt-welcome .bt-card { border-color: var(--bt-gold); }

/* Today: four yellow tiles, two by two on a phone */
.adm-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 600px) { .adm-tiles { grid-template-columns: repeat(4, 1fr); } }
.adm-tile {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 6px; min-height: 96px; padding: 14px 14px 12px;
  background: var(--bt-yellow); color: var(--bt-toast); border: 2px solid var(--bt-toast); border-radius: var(--bt-radius-card);
  font: inherit; text-align: left; cursor: pointer; width: 100%; -webkit-tap-highlight-color: transparent;
}
/* Selected: its list is open. Warm Toast with yellow figures, the same look the late alert used to have. */
.adm-tile[aria-expanded="true"] { background: var(--bt-toast); color: var(--bt-yellow); }
.adm-tile:focus-visible { outline: 3px solid var(--bt-toast); outline-offset: 2px; }
.adm-tile__n { font: 700 40px/1 var(--bt-font-head); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.adm-tile__label { font: 600 14px/1.2 var(--bt-font-head); }

/* The admin tabs live in the header (no fixed bottom bar), so the page needs no bottom room for one. */
.bt-main--wide { padding-bottom: 40px; }

/* Leave: the "before you decide" block under the request details */
.adm-preview { padding: 12px 14px; background: var(--bt-cream); border-radius: var(--bt-radius-tight); }
.adm-preview__h { margin: 0 0 4px; font: 600 15px var(--bt-font-head); }
.adm-preview p { margin: 0 0 6px; }
.adm-preview__list { margin: 0; padding-left: 20px; }
.adm-preview .bt-banner { margin: 0 0 6px; }


/* Today: each list is one card, a bar you tap and the table under it when open */
.adm-secs > * + * { margin-top: 12px; }
.adm-sec { background: var(--bt-white); border: 2px solid var(--bt-toast); border-radius: var(--bt-radius-tight); }
/* The list you are on is outlined in yellow; nothing is outlined at rest. Tiles scroll to it clear of the sticky header. */
.adm-sec { scroll-margin-top: 124px; }
.adm-sec[open] { outline: 4px solid var(--bt-yellow); }
.adm-sec > summary { min-height: 48px; padding: 0 12px; gap: 10px; }
.adm-sec > summary .bt-tag { margin-left: auto; flex: none; }
.adm-sec__title { font: 700 16px var(--bt-font-head); }
.adm-sec[open] > summary { border-bottom: 2px solid var(--bt-toast); }
.adm-sec__body { padding: 4px; }
.adm-sec__body > p { margin: 4px; }
.adm-sec .adm-table { border: 0; border-radius: 0; }

/* The tables inside: name, then shift, then scans or status; none of them breaks mid-word */
.adm-today th, .adm-today td { padding: 8px 6px; }
.adm-today .adm-name { font-weight: 600; white-space: nowrap; }
.adm-today .adm-c-name .bt-small { font-size: 13px; white-space: nowrap; }
.adm-today .adm-c-shift { white-space: nowrap; padding-right: 14px; }
.adm-today .adm-c-last div { white-space: nowrap; }
.adm-today .bt-tag { white-space: nowrap; font-size: 12px; padding: 2px 8px; }
.adm-today tr.adm-has-after td { border-bottom: 0; }
.adm-today tr.adm-after td { padding-top: 0; }
.adm-after .bt-stack > div:empty { display: none; }
@media (min-width: 700px) {
  .adm-sec__body { padding: 12px; }
  .adm-today th, .adm-today td { padding: 10px 16px; }
  .adm-today .adm-c-shift { padding-right: 24px; }
  .adm-today th:nth-child(1) { width: 42%; }
  .adm-today th:nth-child(2) { width: 28%; }
  .adm-today .bt-tag { font-size: 13px; padding: 2px 12px; }
}
