/* BrainzieFairstall base styling: a thin layer over team.core's component library (teamcore-components.css).
   It sets the page chrome the component CSS deliberately leaves to the host, and brands the generic
   tcc-* components with the app's theme colours (the same palette gathered for the landing page). */

:root {
  --app-ink: #18122B;
  --app-muted: color-mix(in srgb, #18122B 55%, white);
  --app-line: color-mix(in srgb, #D81B72 12%, white);
  --app-brand: #D81B72;
  --app-brand-deep: color-mix(in srgb, #D81B72 80%, black);
  --app-paper: #FDFBFE;
  --app-surface: #FFFFFF;

  /* Brand the team.core buttons (the components read these). */
  --tcc-btn-primary-bg: #D81B72;
  --tcc-btn-primary-fg: #ffffff;
  --tcc-btn-primary-bg-hover: color-mix(in srgb, #D81B72 80%, black);
  --tcc-btn-radius: 10px;

  /* The controlled error experience (ErrorView / AppErrorBoundary) themes with the app palette; retune per app. */
  --tcc-error-header-bg: var(--app-brand-deep);
  --tcc-error-header-fg: #ffffff;
  --tcc-error-body-bg: var(--app-surface);
  --tcc-error-body-fg: var(--app-ink);
}

/* Blazor's own last-resort error strip (see index.html) — shown only when the runtime itself crashes. */
#blazor-error-ui {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 3000;
  padding: 0.75rem 1.25rem;
  background: #fff3cd;
  color: #513c06;
  font-family: var(--tcc-font);
  box-shadow: var(--tcc-shadow-s);
}
#blazor-error-ui .reload { color: var(--app-brand-deep); font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* The shell fixes itself to the viewport so the body never scrolls — exactly one scrollbar on any page (.app-main
   below is the single scroll region; a grid page hands that scroll to the grid via .app-page--fill, keeping its header
   pinned). Mirrors the CRM reference and EOM. */
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: var(--tcc-font); color: var(--app-ink); background: var(--app-paper); }

/* App bar + side navigation.
   Nav links live in team.core's left-anchored Drawer (a mini icon-rail when collapsed — the default — expanding to
   labels when the app bar's menu button is toggled). The app bar (brand + profile + system info) stays across the top;
   the drawer is pinned below it via --tcc-drawer-top and the content clears the rail via .app-main's left margin. The
   generic --tcc-drawer-… and --tcc-nav-… tokens are mapped onto the app palette so the drawer themes with the app. */
:root {
  --app-bar-height: 3.25rem;
  --tcc-drawer-top: var(--app-bar-height);
  --tcc-drawer-bg: var(--app-surface);
  --tcc-drawer-mini-width: 3.5rem;
  --tcc-drawer-width: 15rem;
  --tcc-nav-fg: var(--app-ink);
  --tcc-nav-hover-bg: color-mix(in srgb, var(--app-brand) 10%, transparent);
  --tcc-nav-divider: var(--app-line);
  --tcc-nav-active-fg: var(--app-brand-deep);
  --tcc-nav-active-bg: color-mix(in srgb, var(--app-brand) 12%, transparent);
  --tcc-nav-active-accent: var(--app-brand);
}

.app-bar {
  /* Its height includes its border, and .app-main's its padding, so the two add up to the window exactly: as content boxes they overran it by 65px, which the body's overflow: hidden cut off the bottom of the page, the legal links with it. */
  box-sizing: border-box;
  position: sticky;
  top: 0;
  /* Above the drawer (1100) and its backdrop (1099) so the brand + tools stay usable while the menu is open. */
  z-index: 1101;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--app-bar-height);
  padding: 0 1.25rem 0 0.5rem;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-line);
}
.app-bar__menu { color: var(--app-muted); flex: none; }
.app-bar__menu:hover { color: var(--app-brand-deep); }
.app-bar__brand { font-weight: 700; color: var(--app-brand-deep); text-decoration: none; font-size: 1.05rem; }
.app-bar__spacer { margin-left: auto; }

/* The nav icons are stroke/outline SVGs; override .tcc-icon's fill:currentColor (which would fill the closed shapes into solid blobs) and size them for the rail. */
.tcc-navmenu .tcc-navlink__icon { width: 1.35rem; height: 1.35rem; fill: none; }

/* Page: the left margin clears the collapsed icon-rail; the drawer overlays content when open, so it never reflows.
   The app bar is a fixed height at the top, so main takes the rest of the viewport and is the single scroll region
   (a normal page scrolls here; a grid page hands the scroll to its grid — see .app-page--fill). One scrollbar, never two.
   The content is centred in the room right of the rail, at --app-page-width at most: a column pinned to the left left a third of a wide
   screen empty, which read as something missing. The scroll region itself spans the whole room, so its scrollbar sits at the edge of the
   window. A page that needs more room (a side panel beside its content) raises --app-page-width. */
.app-main {
  box-sizing: border-box;
  --app-page-width: 64rem;
  margin: 0 0 0 var(--tcc-drawer-mini-width);
  padding: 2rem max(1.75rem, calc((100vw - var(--tcc-drawer-mini-width) - var(--app-page-width)) / 2));
  height: calc(100dvh - var(--app-bar-height));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* What is in the scroll region keeps its own height; the region scrolls instead. A flex column lets its items shrink to fit, and one that
   clips what overflows it (overflow: hidden, as team.core's video player and a rounded table do) may shrink to nothing: a page taller than
   the window squashed a video player to a 20px strip. A page that should fill the window says so with .app-page--fill, below. */
.app-main > * { flex-shrink: 0; }

/* A grid/list page that should fill the viewport and let its grid be the sole scroll region: the page's title,
   intro and toolbar stay pinned at the top; the DataGrid (with Fill="true") grows to fill the rest and scrolls. */
.app-page--fill { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* Always-visible (but unobtrusive) legal links, shown on every page below the content and, on a page shorter than the window, at its foot: .app-main is a column as tall as the window, and the auto top margin takes the room the page leaves. */
.app-legal { margin: auto auto 0.9rem; padding-top: 1.75rem; text-align: center; font-size: 0.82rem; color: var(--app-muted); }
.app-legal a { color: var(--app-muted); text-decoration: none; }
.app-legal a:hover { color: var(--app-brand-deep); text-decoration: underline; }
.app-legal__sep { margin: 0 0.5rem; opacity: 0.6; }
.app-h1 { font-size: 1.6rem; margin: 0 0 0.25rem; }
.app-intro { color: var(--app-muted); margin: 0 0 1.5rem; }

/* Toolbar + input */
.app-toolbar { display: flex; gap: 0.5rem; margin: 1rem 0; flex-wrap: wrap; }
.app-input { padding: 0.5rem 0.7rem; border: 1px solid var(--app-line); border-radius: 10px; font: inherit; min-width: 18rem; }
.app-input:focus { outline: none; border-color: var(--app-brand); }

/* Table */
.app-table { width: 100%; border-collapse: collapse; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: 12px; overflow: hidden; }
.app-table th, .app-table td { text-align: left; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--app-line); }
.app-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--app-muted); background: color-mix(in srgb, #D81B72 5%, white); }
.app-table tr:last-child td { border-bottom: none; }

.app-badge { margin-left: 0.5rem; font-size: 0.75rem; color: var(--app-muted); font-style: italic; }
.app-empty { color: var(--app-muted); }

/* Phones: tighten the app bar + page gutters. The nav stays the same collapsible rail + drawer as desktop. Wide
   content (tables) should scroll inside its own container rather than pushing the page. */
@media (max-width: 768px) {
  .app-bar { padding: 0 0.6rem; gap: 0.5rem; }
  .app-main { margin-left: var(--tcc-drawer-mini-width); padding: 1.25rem 0.9rem; }
  .app-h1 { font-size: 1.35rem; }
}

/* Shops: the screens that run a shop (Pages/Shops). */
.shop-admin-list { list-style: none; margin: 1rem 0 1.5rem; padding: 0; display: grid; gap: .6rem; }
.shop-admin-list a { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .9rem 1.1rem; border: 1px solid var(--app-line); border-radius: 14px; background: var(--app-surface); color: inherit; text-decoration: none; }
.shop-admin-list a:hover { border-color: color-mix(in srgb, var(--app-ink) 45%, var(--app-line)); }
.shop-admin-card { margin: 1.2rem 0; padding: 1.2rem 1.3rem; border: 1px solid var(--app-line); border-radius: 16px; background: var(--app-surface); }
.shop-admin-card h2 { margin-top: 0; }
.shop-admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.shop-admin-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.shop-admin-row h2 { margin: 0; }
.shop-admin-form { display: grid; gap: .8rem 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: .8rem 0; }
.shop-admin-wide { grid-column: 1 / -1; }
.shop-admin-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .8rem; }
.shop-admin-check { display: flex; align-items: center; gap: .5rem; }
.shop-admin-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; }
.shop-admin-muted { color: var(--app-muted); font-size: .9rem; }
.shop-admin-error { color: #B3261E; }
.shop-admin-pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: color-mix(in srgb, var(--app-muted) 15%, transparent); }
.shop-admin-pill.is-on { background: color-mix(in srgb, #2E8B6E 18%, transparent); color: #1F6F55; }
.shop-admin-link { margin-left: .8rem; }
.shop-admin-editor { margin: 1rem 0; padding: 1rem 1.1rem; border: 1px dashed var(--app-brand); border-radius: 14px; }
.shop-admin-editor h3 { margin-top: 0; }
.shop-admin-scroll { overflow-x: auto; }
.shop-admin-num { width: 6.5rem; }
.shop-admin-pair { grid-column: 1 / -1; display: grid; gap: .8rem 1rem; grid-template-columns: minmax(10rem, 1fr) minmax(14rem, 2fr); }
@media (max-width: 560px) { .shop-admin-pair { grid-template-columns: 1fr; } }
/* A product's photos, and its one-offs: each one particular item with its photo beside its values, note, price and For sale. */
.shop-pictures { list-style: none; margin: .6rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .7rem; }
.shop-picture { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.shop-picture img, .shop-oneoff__picture img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--app-line); background: var(--app-surface); }
.shop-oneoffs { margin-top: 1.2rem; }
.shop-oneoff { display: grid; grid-template-columns: 9rem 1fr; gap: .4rem 1rem; align-items: start; margin: .8rem 0; padding: .8rem .9rem; border: 1px solid var(--app-line); border-radius: 12px; }
.shop-oneoff > .shop-admin-actions { grid-column: 1 / -1; }
.shop-oneoff .shop-admin-form { margin: 0; }
.shop-oneoff__picture { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
@media (max-width: 560px) { .shop-oneoff { grid-template-columns: 1fr; } }

/* The home screen's shop cards and a shop's team. */
.home-card__name { color: inherit; text-decoration: none; }
.home-card__name:hover { color: var(--app-brand-deep); text-decoration: underline; }
.home-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; font-size: .9rem; }
.home-card__open { margin-top: 1rem; }
.home-shops { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .5rem; }
.home-shop { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; padding: .7rem .9rem; border: 1px solid var(--app-line); border-radius: 12px; }
.home-shop__name { font-weight: 600; white-space: nowrap; }
.home-shop__next { flex-basis: 100%; color: #7A4B00; }
.home-shop__counts { flex-basis: 100%; color: var(--app-muted); font-size: .9rem; }
.home-another { margin: 1.4rem 0; }
.home-another summary { cursor: pointer; color: var(--app-ink); font-weight: 600; margin-bottom: .8rem; }
.team-unclaimed { font-size: .8rem; color: #7A4B00; }
.team-role-select { min-width: 11rem; }
.team-roles dt { font-weight: 600; margin-top: .6rem; }
.team-roles dd { margin: .1rem 0 0; }
.shop-steps__list { margin: .4rem 0 0; padding-left: 1.3rem; display: grid; gap: .35rem; }
.shop-steps__list .is-done { color: var(--app-muted); }
.shop-steps__list .is-done b { text-decoration: line-through; }
.team-people { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--app-line); }
.team-person { display: grid; grid-template-columns: minmax(12rem, 2fr) minmax(11rem, 1fr) minmax(10rem, 1.4fr) auto; align-items: center; gap: .4rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--app-line); }
.team-person__who { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.team-person__added { font-size: .85rem; }
.team-add { margin-top: 1.4rem; }
@media (max-width: 40rem) {
  .team-person { grid-template-columns: 1fr auto; }
  .team-person__who, .team-person__added { grid-column: 1 / -1; }
}
.shop-order-handover { margin-top: .4rem; }

