/* BANZA visual identity: the single source of fonts and brand colours for every surface.
   Pages map their local tokens to these variables; they must not load other fonts.
   The PWA build (pwa/build.mjs) embeds this same file, swapping the Google Fonts import for local copies. */
@import url('https://fonts.googleapis.com/css2?family=Fustat:wght@400;500;600;700&family=Inter+Tight:wght@400;500;600;700&display=swap');

:root {
  --banza-blue: #1A2AD2;
  --banza-blue-dark: #1421A8;     /* hover / pressed */
  --banza-blue-soft: #EEF0FD;     /* selected rows, soft backgrounds */
  --banza-blue-on-dark: #8C96FF;  /* the brand blue lacks contrast on dark surfaces */
  --banza-orange: #FF6B00;
  --banza-orange-dark: #E05E00;
  --banza-black: #0A0A0A;
  --banza-white: #FFFFFF;
  --banza-focus: rgba(26, 42, 210, .30);
  --banza-font-heading: 'Fustat', ui-sans-serif, system-ui, sans-serif;
  --banza-font-body: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --banza-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body {
  font-family: var(--banza-font-body);
  font-weight: 500;
}

h1, h2, h3 {
  font-family: var(--banza-font-heading);
  font-weight: 600;
  letter-spacing: -0.03em;
}

/* Banza logo (white symbol) inside the blue brand badge of every surface. */
.banza-mark-img {
  display: block;
  width: 68%;
  height: auto;
  pointer-events: none;
}

/* Logo badge that collapses / expands the sidebar: on hover or focus the logo turns away and a « takes its place
   (» when the sidebar is collapsed). The button keeps the badge's own size and colours. */
.banza-logo-toggle { position: relative; border: 0; padding: 0; cursor: pointer; overflow: hidden; }
.banza-logo-toggle .banza-mark-img,
.banza-logo-toggle .banza-collapse-ico { transition: opacity .28s ease, transform .45s cubic-bezier(.2, .8, .2, 1); }
/* The « glyph (Reicon has no double chevron) lives here once, as a mask: pages only carry an empty span. */
.banza-logo-toggle .banza-collapse-ico {
  position: absolute; inset: 0; margin: auto; width: 58%; height: 58%; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m11 17-5-5 5-5'/%3E%3Cpath d='m18 17-5-5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m11 17-5-5 5-5'/%3E%3Cpath d='m18 17-5-5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0; transform: rotate(-120deg) scale(.4);
}
.banza-logo-toggle:hover .banza-mark-img,
.banza-logo-toggle:focus-visible .banza-mark-img { opacity: 0; transform: rotate(120deg) scale(.4); }
.banza-logo-toggle:hover .banza-collapse-ico,
.banza-logo-toggle:focus-visible .banza-collapse-ico { opacity: 1; transform: none; }
.banza-logo-toggle[data-collapsed]:hover .banza-collapse-ico,
.banza-logo-toggle[data-collapsed]:focus-visible .banza-collapse-ico { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .banza-logo-toggle .banza-mark-img, .banza-logo-toggle .banza-collapse-ico { transition: opacity .01ms; }
}

/* Form controls do not inherit the font by default in browsers. */
button, input, select, textarea, optgroup {
  font-family: inherit;
}

/* ---------------------------------------------------------------- shared components (decision 064)
   One source for the BANZA Select (shared/js/banza-select.js), its popover / bottom sheet and the press
   feedback of buttons. Tokens follow the page theme ([data-theme="dark"]). Motion: shared/js/banza-motion.js. */
:root {
  --bz-surface: #FFFFFF; --bz-raised: #F3F4F6; --bz-line: #E5E7EB; --bz-ink: var(--banza-black); --bz-muted: #6B7280;
  --bz-hover: #F3F4F6; --bz-accent: var(--banza-blue); --bz-radius: 14px;
  --bz-shadow: 0 12px 32px rgba(10, 10, 10, .12), 0 2px 6px rgba(10, 10, 10, .06);
  --bz-chevron: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  --bz-check: url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}
[data-theme="dark"] {
  --bz-surface: #17181B; --bz-raised: #1F2125; --bz-line: #2A2C31; --bz-ink: #F4F5F7; --bz-muted: #9CA3AF;
  --bz-hover: #24262B; --bz-accent: var(--banza-blue-on-dark); --bz-shadow: 0 16px 40px rgba(0, 0, 0, .55);
}

/* Press feedback: a short, restrained physical response on every button. */
:where(button, .btn, [role="button"]):not(:disabled):active { transform: scale(.97); }
:where(button, .btn, [role="button"]) { transition: transform .16s cubic-bezier(.2, .8, .2, 1), background-color .16s ease, color .16s ease, border-color .16s ease; }

/* Trigger: the page's own field classes (copied from the native select) give its size; this is the fallback. */
:where(.bz-select) {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--bz-line); border-radius: 10px;
  background: var(--bz-surface); color: var(--bz-ink); font: inherit;
}
.bz-select-host { display: contents; }  /* Admin (React): wraps the native select it owns */
.bz-select { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; cursor: pointer; }
.bz-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bz-select.is-placeholder .bz-select-value { color: var(--bz-muted); }
.bz-select-chevron {
  width: 14px; height: 14px; flex: none; background: currentColor; opacity: .55;
  -webkit-mask: var(--bz-chevron) center / contain no-repeat; mask: var(--bz-chevron) center / contain no-repeat;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.bz-select[aria-expanded="true"] .bz-select-chevron { transform: rotate(180deg); }
.bz-select:disabled { opacity: .55; cursor: not-allowed; }
.bz-select.is-focused { outline: 2px solid var(--bz-accent); outline-offset: 2px; }  /* the hidden native select has the focus */
.bz-select[aria-invalid="true"] { border-color: #DC2626; }

/* Popover (desktop) and bottom sheet (touch phones): a fixed layer positions, the panel inside is the surface. */
.bz-layer { position: fixed; z-index: 2000; max-width: min(440px, calc(100vw - 16px)); }
.bz-layer.is-sheet { left: 0; right: 0; bottom: 0; max-width: none; }
.bz-pop {
  padding: 6px;
  border: 1px solid var(--bz-line); border-radius: var(--bz-radius); background: var(--bz-surface); color: var(--bz-ink);
  box-shadow: var(--bz-shadow); font: 500 14px/1.4 var(--banza-font-body);
}
.bz-select-search {
  display: block; width: 100%; height: 38px; margin: 0 0 6px; padding: 0 12px; border: 0; border-radius: 10px;
  background: var(--bz-raised); color: inherit; font: inherit; outline: none;
}
.bz-select-search:focus-visible { box-shadow: 0 0 0 2px var(--bz-accent); }
.bz-select-list { list-style: none; margin: 0; padding: 0; max-height: min(320px, 50vh); overflow-y: auto; overscroll-behavior: contain; outline: none; }
.bz-option { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.bz-option.is-active { background: var(--bz-hover); }
.bz-pop.is-keyboard .bz-option.is-active { box-shadow: inset 0 0 0 1.5px var(--bz-accent); }
.bz-option[aria-selected="true"] { color: var(--bz-accent); font-weight: 600; }
.bz-option[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.bz-option-text { flex: 1; min-width: 0; }
.bz-option-desc { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--bz-muted); }
.bz-option-check {
  width: 16px; height: 16px; flex: none; background: currentColor; visibility: hidden;
  -webkit-mask: var(--bz-check) center / contain no-repeat; mask: var(--bz-check) center / contain no-repeat;
}
.bz-option[aria-selected="true"] .bz-option-check { visibility: visible; }
.bz-select-group { padding: 10px 10px 4px; font-size: 12px; color: var(--bz-muted); }
.bz-select-empty { padding: 12px 10px; color: var(--bz-muted); }
.bz-pop.is-sheet {
  max-height: 78dvh; display: flex; flex-direction: column;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; border-bottom: 0;
}
.bz-pop.is-sheet .bz-select-list { max-height: none; flex: 1; }
.bz-pop.is-sheet .bz-option { min-height: 48px; }
.bz-pop.is-sheet .bz-select-search { height: 44px; font-size: 16px; }
.bz-sheet-grip { width: 40px; height: 4px; margin: 4px auto 10px; border-radius: 999px; background: var(--bz-line); }
.bz-sheet-title { margin: 0 4px 10px; font: 600 16px/1.3 var(--banza-font-heading); }
.bz-backdrop { position: fixed; inset: 0; z-index: 1999; background: rgba(0, 0, 0, .42); }
html.bz-scroll-locked { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  :where(button, .btn, [role="button"]):not(:disabled):active { transform: none; }
  .bz-select-chevron { transition: none; }
}
