/* =====================================================================
   G-SMaRT Multi-Business System - "Clubhouse" theme
   Loads after Bootstrap 5.3 and app.css. One look for every page:
   operations (courts, bays, café), billing, and the accounting backbone.

   Materials: warm concrete page, paper surfaces, asphalt side rail,
   court-green actions, optic-yellow focus (the colour of the ball).
   Each business keeps one accent: court green, rinse blue, roast brown.
   ===================================================================== */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }

:root {
  --rail-w: 268px;
  --bar-h: 58px;

  --page: #ece9e2;
  --surface: #fbfaf7;
  --surface-2: #f4f2ec;
  --surface-3: #ebe7df;
  --ink: #1d2320;
  --ink-soft: #444c47;
  --muted: #6e7570;
  --line: #d8d3c8;
  --line-soft: #e5e1d8;
  --edge: #cbc5b9;

  --court-900: #10302a;
  --court-800: #163e35;
  --court-700: #1e5245;
  --court-600: #236150;
  --court-500: #2c7462;
  --court-300: #8db8a9;
  --court-100: #dcebe4;
  --court-50: #eef5f1;
  --optic: #d4e157;
  --optic-deep: #a9b62a;

  --pb: #2c7462;  --pb-tint: #e2eee8;
  --cw: #2f6d96;  --cw-tint: #e1ecf4;
  --cf: #8b5a3c;  --cf-tint: #f3e9e0;

  --ok: #2f7a4d;   --ok-tint: #e3f0e7;
  --warn: #a86b12; --warn-tint: #f7ecd8;
  --bad: #b23a2e;  --bad-tint: #f6e2df;
  --info: #2f6d96; --info-tint: #e1ecf4;
  --idle: #7a817c;

  --rail: #17201c;
  --rail-2: #1e2925;
  --rail-3: #27342f;
  --rail-ink: #cdd5d0;
  --rail-muted: #87928b;

  --radius: 12px;
  --radius-sm: 8px;
  --raise-1: 0 1px 0 rgba(255, 255, 255, .85) inset, 0 1px 2px rgba(29, 35, 32, .06), 0 10px 22px -16px rgba(29, 35, 32, .28);
  --raise-2: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 5px rgba(29, 35, 32, .08), 0 22px 40px -22px rgba(29, 35, 32, .38);
  --inset: inset 0 1px 2px rgba(29, 35, 32, .08);
  --ease: cubic-bezier(.2, .75, .2, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);

  --bs-body-font-family: "Barlow", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --bs-body-color: #1d2320;
  --bs-body-bg: #ece9e2;
  --bs-border-color: #d8d3c8;
  --bs-secondary-color: #6e7570;
  --bs-tertiary-bg: #f4f2ec;
  --bs-primary: #236150;
  --bs-primary-rgb: 35, 97, 80;
  --bs-success: #2f7a4d;
  --bs-success-rgb: 47, 122, 77;
  --bs-danger: #b23a2e;
  --bs-danger-rgb: 178, 58, 46;
  --bs-warning: #a86b12;
  --bs-warning-rgb: 168, 107, 18;
  --bs-info: #2f6d96;
  --bs-info-rgb: 47, 109, 150;
  --bs-link-color: #1e5245;
  --bs-link-color-rgb: 30, 82, 69;
  --bs-link-hover-color: #10302a;
  --bs-link-hover-color-rgb: 16, 48, 42;
  --bs-border-radius: 8px;
  --bs-border-radius-sm: 6px;
  --bs-border-radius-lg: 12px;
  --bs-focus-ring-color: rgba(212, 225, 87, .55);
}

html { scroll-padding-top: calc(var(--bar-h) + 14px); }
body {
  font-family: var(--bs-body-font-family);
  font-size: .925rem;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--page);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: "Barlow Condensed", "Barlow", sans-serif; font-weight: 600; letter-spacing: .005em; color: var(--ink); }
.num, .text-end, td.money, .money, .kpi .value, .tabular { font-variant-numeric: tabular-nums; }
code, kbd, .mono, .ref { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; }
code { color: var(--court-700); font-size: .86em; }
::selection { background: rgba(212, 225, 87, .55); color: var(--ink); }
:focus-visible { outline: 3px solid rgba(212, 225, 87, .75); outline-offset: 1px; }
a { color: var(--court-700); }
a:hover { color: var(--court-900); }
.text-muted, .text-secondary { color: var(--muted) !important; }
.text-primary { color: var(--court-600) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--bad) !important; }
.text-warning { color: var(--warn) !important; }
.bg-light { background-color: var(--surface-2) !important; }
hr { border-color: var(--line); opacity: 1; }

/* ------------------------------------------------------------------ shell: side rail + stage */
body.app { overflow-x: hidden; }
.shell { display: flex; min-height: 100vh; }
.stage { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.rail {
  width: var(--rail-w); min-width: var(--rail-w); background: var(--rail); color: var(--rail-ink);
  border-right: 1px solid #0f1613;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .03);
}
@media (min-width: 992px) {
  .rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
}
.rail.offcanvas-lg { --bs-offcanvas-bg: var(--rail); --bs-offcanvas-color: var(--rail-ink); --bs-offcanvas-width: 292px; background-color: var(--rail) !important; }
.rail .offcanvas-body { display: flex !important; flex-direction: column; padding: 0; min-height: 0; flex: 1 1 auto; }
.rail-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.05rem .9rem; color: #fff; text-decoration: none !important; }
.rail-brand:hover { color: #fff; }
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; display: grid; place-items: center;
  background: var(--court-600);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 -2px 0 rgba(0, 0, 0, .25) inset, 0 3px 8px rgba(0, 0, 0, .45);
}
.brand-mark svg { width: 24px; height: 24px; display: block; }
.brand-words { line-height: 1.05; min-width: 0; }
.brand-words strong { display: block; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.22rem; letter-spacing: .02em; }
.brand-words span { display: block; font-size: .76rem; color: var(--rail-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-company { margin: 0 .8rem .6rem; padding: .5rem .7rem; border-radius: 9px; background: var(--rail-2); border: 1px solid rgba(255, 255, 255, .05); font-size: .8rem; color: var(--rail-ink); display: flex; align-items: center; gap: .5rem; }
.rail-company .bi { color: var(--optic); }
.rail-company span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-company .dropdown-toggle { color: inherit; background: none; border: 0; padding: 0; display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; font-size: inherit; }
.rail-scroll { flex: 1 1 auto; overflow-y: auto; padding: .1rem 0 1rem; scrollbar-width: thin; scrollbar-color: #33413b transparent; }
.rail-scroll::-webkit-scrollbar { width: 8px; }
.rail-scroll::-webkit-scrollbar-thumb { background: #33413b; border-radius: 8px; border: 2px solid var(--rail); }
.rail-section { padding: 1rem 1.15rem .3rem; font-size: .74rem; font-weight: 500; color: var(--rail-muted); }

.rail .mod { margin: 1px .55rem; }
.rail .mod-btn {
  width: 100%; display: flex; align-items: center; gap: .65rem; padding: .48rem .55rem; border: 0; border-radius: 9px;
  background: transparent; color: var(--rail-ink); font-size: .9rem; font-weight: 500; text-align: left;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.rail .mod-btn:hover { background: var(--rail-2); color: #fff; }
.rail .mod-btn .chev { margin-left: auto; font-size: .7rem; opacity: .55; transition: transform .25s var(--ease); }
.rail .mod-btn[aria-expanded="true"] { color: #fff; }
.rail .mod-btn[aria-expanded="true"] .chev { transform: rotate(90deg); }
.mod-ico {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: grid; place-items: center; font-size: .9rem;
  color: #dfe6e1; background: var(--rail-3); border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 0 rgba(0, 0, 0, .35);
}
.mod[data-accent="pb"] .mod-ico { background: #245c4d; }
.mod[data-accent="cw"] .mod-ico { background: #28587a; }
.mod[data-accent="cf"] .mod-ico { background: #6e4730; }
.mod.is-current .mod-btn { background: var(--rail-2); }
.mod-links { padding: .15rem 0 .5rem; }
.rail .menu-link {
  position: relative; display: block; margin: 1px 0 1px 2.35rem; padding: .32rem .6rem; border-radius: 7px; border: 0;
  color: #b9c3bd; font-size: .855rem; line-height: 1.3; text-decoration: none;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.rail .menu-link:hover { background: var(--rail-2); color: #fff; }
.rail .menu-link.active { background: var(--rail-3); color: #fff; font-weight: 600; box-shadow: none; }
.rail .menu-link.active::before { content: ""; position: absolute; left: -.7rem; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--optic); animation: markIn .35s var(--spring) both; }
@keyframes markIn { from { transform: scaleY(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.rail .menu-group { padding: .55rem .6rem .15rem 2.95rem; font-size: .72rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--rail-muted); }
.rail .menu-sub { padding: .4rem 1rem .1rem 3.4rem; font-size: .72rem; color: #6f7a73; }
.rail .menu-reports summary { padding: .35rem .6rem .35rem 2.95rem; color: var(--rail-muted); font-size: .8rem; font-weight: 500; }
.rail .menu-reports summary::before { border-left-color: var(--rail-muted); }
.rail .menu-reports summary:hover { color: #fff; }
.rail .menu-reports .menu-link { margin-left: 3.1rem; font-size: .83rem; }
.rail-foot { padding: .7rem .9rem; border-top: 1px solid rgba(255, 255, 255, .06); font-size: .76rem; color: var(--rail-muted); display: flex; justify-content: space-between; gap: .5rem; }
.rail .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, .06); }
.rail .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }

/* the bar over the page */
.topbar {
  position: sticky; top: 0; z-index: 1020; min-height: var(--bar-h);
  display: flex; align-items: center; gap: .75rem; padding: .55rem 1.25rem;
  background: rgba(251, 250, 247, .94); border-bottom: 1px solid var(--line);
  transition: box-shadow .25s var(--ease);
}
@supports (backdrop-filter: blur(4px)) { .topbar { background: rgba(251, 250, 247, .86); backdrop-filter: saturate(1.2) blur(8px); } }
.topbar.is-scrolled { box-shadow: 0 10px 24px -18px rgba(29, 35, 32, .45); }
.crumbs { min-width: 0; display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs strong { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--edge); }
.topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.tb-btn {
  position: relative; height: 38px; min-width: 38px; padding: 0 .7rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: .86rem; font-weight: 500;
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 var(--line-soft);
  transition: transform .1s var(--ease), background-color .15s var(--ease);
  text-decoration: none !important;
}
.tb-btn:hover { background: #fff; color: var(--ink); }
.tb-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #fff inset; }
.tb-btn .count {
  position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--bad); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--surface);
  animation: countPop .5s var(--spring) both;
}
@keyframes countPop { from { transform: scale(.3); } to { transform: none; } }
.tb-search { position: relative; }
.tb-search .bi { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tb-search input {
  width: 300px; height: 38px; padding-left: 2.1rem; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); font-size: .86rem;
  box-shadow: var(--inset); transition: width .3s var(--ease), background-color .2s;
}
.tb-search input:focus { width: 380px; background: #fff; outline: 0; border-color: var(--court-500); box-shadow: 0 0 0 3px rgba(212, 225, 87, .55); }
.tb-user { display: inline-flex; align-items: center; gap: .55rem; border: 0; background: none; padding: .2rem .3rem; border-radius: 10px; color: var(--ink); }
.tb-user:hover { background: var(--surface-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff;
  background: var(--court-700); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 2px 0 var(--court-900);
}
.tb-user .who { line-height: 1.1; text-align: left; }
.tb-user .who strong { display: block; font-size: .85rem; font-weight: 600; }
.tb-user .who small { display: block; font-size: .72rem; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-area { padding: 1.15rem 1.35rem 2.5rem; min-width: 0; flex: 1 1 auto; }
@media (max-width: 575.98px) { .main-area { padding: .9rem .75rem 2rem; } .topbar { padding: .5rem .75rem; } }

/* entrance: the page's blocks settle in one after another */
.main-area > * { animation: rise .42s var(--ease) both; }
.main-area > *:nth-child(2) { animation-delay: .03s; }
.main-area > *:nth-child(3) { animation-delay: .06s; }
.main-area > *:nth-child(4) { animation-delay: .09s; }
.main-area > *:nth-child(5) { animation-delay: .12s; }
.main-area > *:nth-child(6) { animation-delay: .15s; }
.main-area > *:nth-child(n+7) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise .4s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .04s; } .stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .12s; } .stagger > *:nth-child(5) { animation-delay: .16s; }
.stagger > *:nth-child(6) { animation-delay: .2s; } .stagger > *:nth-child(n+7) { animation-delay: .24s; }

/* platform and company strips */
.platform-strip, .company-strip {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .5rem 1.35rem; font-size: .84rem;
  background: var(--court-900); color: #e6ece8; border-bottom: 1px solid #0b211c;
}
.platform-strip .bi, .company-strip .bi { color: var(--optic); }
.platform-strip a, .company-strip .btn-link { color: var(--optic) !important; margin-left: auto; font-weight: 600; }

/* ------------------------------------------------------------------ page bar: the title and the page's buttons */
.page-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem;
  margin: 0 0 1rem; padding: 0 0 .75rem; min-height: 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none;
}
.page-bar h1 { font-size: 1.6rem; line-height: 1.1; margin: 0; font-weight: 600; letter-spacing: .005em; }
.page-bar .page-sub { display: block; font-family: "Barlow", sans-serif; font-size: .84rem; color: var(--muted); font-weight: 400; margin-top: .2rem; letter-spacing: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* ------------------------------------------------------------------ cards and surfaces */
.card {
  --bs-card-bg: var(--surface); --bs-card-border-color: var(--line); --bs-card-border-radius: var(--radius); --bs-card-inner-border-radius: calc(var(--radius) - 1px);
  --bs-card-cap-bg: transparent; --bs-card-cap-padding-y: .7rem; --bs-card-cap-padding-x: 1rem; --bs-card-spacer-x: 1rem; --bs-card-spacer-y: .95rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--raise-1);
}
.card > .card-header {
  background: transparent; border-bottom: 1px solid var(--line-soft); font-weight: 600; font-size: .95rem; color: var(--ink);
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.card > .card-header > .bi { color: var(--court-600); }
.card > .card-footer { background: var(--surface-2); border-top: 1px solid var(--line-soft); }
.card .card-title { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 1.15rem; }
.card.h-100 { height: 100%; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--raise-1); }
.well { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; box-shadow: var(--inset); padding: .8rem .9rem; }

/* ------------------------------------------------------------------ buttons: keycaps that press down */
.btn {
  --bs-btn-font-weight: 600; --bs-btn-border-radius: 8px; --bs-btn-focus-box-shadow: 0 0 0 3px rgba(212, 225, 87, .6);
  font-weight: 600; letter-spacing: .005em; border-radius: 8px;
  transition: transform .08s var(--ease), box-shadow .12s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:active, .btn.active { transform: translateY(1px); }
.btn-sm { --bs-btn-padding-y: .32rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .84rem; border-radius: 7px; }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-padding-x: 1.2rem; border-radius: 10px; }
.btn .bi { margin-right: .1rem; }
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--court-600); --bs-btn-border-color: var(--court-700);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--court-500); --bs-btn-hover-border-color: var(--court-700);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--court-700); --bs-btn-active-border-color: var(--court-800);
  --bs-btn-disabled-bg: #7fa699; --bs-btn-disabled-border-color: #7fa699;
  background-image: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 2px 0 var(--court-900), 0 8px 14px -10px rgba(16, 48, 42, .8);
}
.btn-primary:active, .btn-primary.active { box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 1px 0 var(--court-900); }
.btn-success {
  --bs-btn-bg: var(--ok); --bs-btn-border-color: #286a43; --bs-btn-hover-bg: #378a59; --bs-btn-hover-border-color: #286a43; --bs-btn-active-bg: #286a43;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 2px 0 #1e5233;
}
.btn-danger {
  --bs-btn-bg: var(--bad); --bs-btn-border-color: #962f25; --bs-btn-hover-bg: #c44a3d; --bs-btn-hover-border-color: #962f25; --bs-btn-active-bg: #962f25;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 2px 0 #74241c;
}
.btn-warning {
  --bs-btn-color: #2a1d05; --bs-btn-bg: #e4b04f; --bs-btn-border-color: #c08f2c; --bs-btn-hover-bg: #ebbd64; --bs-btn-hover-border-color: #c08f2c; --bs-btn-hover-color: #2a1d05; --bs-btn-active-bg: #d39e3a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 2px 0 #9c7220;
}
.btn-secondary {
  --bs-btn-bg: #59615c; --bs-btn-border-color: #474e4a; --bs-btn-hover-bg: #66706a; --bs-btn-hover-border-color: #474e4a; --bs-btn-active-bg: #474e4a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 2px 0 #333935;
}
.btn-dark { --bs-btn-bg: var(--rail); --bs-btn-border-color: #0d1311; --bs-btn-hover-bg: var(--rail-3); box-shadow: 0 1px 0 rgba(255, 255, 255, .1) inset, 0 2px 0 #050807; }
.btn-optic {
  --bs-btn-color: #1d2320; --bs-btn-bg: var(--optic); --bs-btn-border-color: #b5c13a; --bs-btn-hover-bg: #dde86e; --bs-btn-hover-color: #1d2320; --bs-btn-hover-border-color: #b5c13a;
  --bs-btn-active-bg: #c6d34a; --bs-btn-active-color: #1d2320;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 2px 0 #8e9926;
}
.btn-outline-secondary, .btn-light, .btn-outline-dark {
  --bs-btn-color: var(--ink); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line);
  --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: #fff; --bs-btn-hover-border-color: var(--edge);
  --bs-btn-active-color: var(--ink); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-border-color: var(--edge);
  --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: var(--surface-2); --bs-btn-disabled-border-color: var(--line);
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 var(--line);
}
.btn-outline-primary {
  --bs-btn-color: var(--court-700); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--court-300);
  --bs-btn-hover-color: var(--court-800); --bs-btn-hover-bg: var(--court-50); --bs-btn-hover-border-color: var(--court-500);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--court-600); --bs-btn-active-border-color: var(--court-700);
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 #c4dacf;
}
.btn-outline-danger {
  --bs-btn-color: var(--bad); --bs-btn-bg: var(--surface); --bs-btn-border-color: #e1b3ad; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--bad); --bs-btn-hover-border-color: #962f25;
  --bs-btn-active-bg: #962f25; --bs-btn-active-border-color: #962f25; box-shadow: 0 1px 0 #fff inset, 0 2px 0 #ecd3cf;
}
.btn-outline-success {
  --bs-btn-color: var(--ok); --bs-btn-bg: var(--surface); --bs-btn-border-color: #a9cdb6; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ok); --bs-btn-hover-border-color: #286a43;
  --bs-btn-active-bg: #286a43; box-shadow: 0 1px 0 #fff inset, 0 2px 0 #cfe3d6;
}
.btn-outline-warning {
  --bs-btn-color: var(--warn); --bs-btn-bg: var(--surface); --bs-btn-border-color: #e3c58f; --bs-btn-hover-color: #2a1d05; --bs-btn-hover-bg: #e4b04f; --bs-btn-hover-border-color: #c08f2c;
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 #efdfc0;
}
.btn-outline-info {
  --bs-btn-color: var(--info); --bs-btn-bg: var(--surface); --bs-btn-border-color: #a7c4d8; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--info); --bs-btn-hover-border-color: #255878;
  box-shadow: 0 1px 0 #fff inset, 0 2px 0 #cddde8;
}
.btn[class*="btn-outline-"]:active, .btn-light:active { box-shadow: 0 1px 0 #fff inset; }
.btn-link { --bs-btn-color: var(--court-700); --bs-btn-hover-color: var(--court-900); box-shadow: none !important; font-weight: 600; }
.btn-link:active { transform: none; }
.btn-group > .btn { box-shadow: none; }
.btn-close:focus { box-shadow: 0 0 0 3px rgba(212, 225, 87, .6); }

/* ------------------------------------------------------------------ fields: pressed into the surface */
.form-label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .28rem; }
.form-control, .form-select {
  background-color: #fffefb; border: 1px solid #d3cec3; color: var(--ink); border-radius: 8px; box-shadow: var(--inset);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s;
}
.form-control-sm, .form-select-sm { border-radius: 7px; font-size: .86rem; min-height: 34px; }
.form-control:hover, .form-select:hover { border-color: #c2bcb0; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--court-500); box-shadow: var(--inset), 0 0 0 3px rgba(212, 225, 87, .55); }
.form-control::placeholder { color: #a39f96; }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--surface-2); color: var(--ink-soft); }
.form-check-input { border-color: #bdb7aa; box-shadow: var(--inset); }
.form-check-input:checked { background-color: var(--court-600); border-color: var(--court-700); }
.form-check-input:focus { border-color: var(--court-500); box-shadow: 0 0 0 3px rgba(212, 225, 87, .55); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%238db8a9'/%3e%3c/svg%3e"); }
.input-group-text { background: var(--surface-2); border-color: #d3cec3; color: var(--muted); }
.form-text { color: var(--muted); }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--bad); }

/* ------------------------------------------------------------------ tables */
.table {
  --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--line-soft);
  --bs-table-hover-bg: rgba(212, 225, 87, .13); --bs-table-striped-bg: rgba(29, 35, 32, .025); --bs-table-active-bg: var(--court-50);
  margin-bottom: 0;
}
.table > thead th, .table > thead td {
  background: var(--surface-2); color: var(--ink-soft); font-weight: 600; font-size: .78rem; letter-spacing: .01em; text-transform: none;
  border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom;
}
.table > :not(caption) > * > * { padding: .5rem .7rem; }
.table-sm > :not(caption) > * > * { padding: .36rem .55rem; }
.table > tbody > tr { transition: background-color .12s; }
.table > tfoot td, .table > tfoot th, .table .total-row td { font-weight: 700; border-top: 2px solid var(--line); background: var(--surface-2); }
.table-responsive { border-radius: inherit; }
.card > .table-responsive:first-child > .table > thead th:first-child { border-top-left-radius: var(--radius); }
.card > .table-responsive:first-child > .table > thead th:last-child { border-top-right-radius: var(--radius); }
.table a { font-weight: 500; }
.table-light, .table-light > th, .table-light > td { --bs-table-bg: var(--surface-2); --bs-table-color: var(--ink-soft); }

/* ------------------------------------------------------------------ alerts, tabs, menus, dialogs */
.alert { border-radius: 10px; border: 1px solid transparent; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset; font-size: .9rem; }
.alert-success { background: var(--ok-tint); border-color: #bcd9c6; color: #1f5133; }
.alert-danger { background: var(--bad-tint); border-color: #e6bab4; color: #7c2219; }
.alert-warning { background: var(--warn-tint); border-color: #e5cfa4; color: #67420a; }
.alert-info { background: var(--info-tint); border-color: #b9cfe0; color: #1f4a67; }
.alert-secondary, .alert-light { background: var(--surface-2); border-color: var(--line); color: var(--ink-soft); }
.alert-dismissible { animation: rise .4s var(--ease) both; }
.nav-tabs { border-bottom: 1px solid var(--line); gap: .15rem; }
.nav-tabs .nav-link {
  border: 1px solid transparent; border-bottom: 0; border-radius: 9px 9px 0 0; color: var(--ink-soft); font-weight: 600; font-size: .88rem; padding: .5rem .9rem;
  transition: color .15s, background-color .15s;
}
.nav-tabs .nav-link:hover { color: var(--ink); background: var(--surface-2); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--court-800); background: var(--surface); border-color: var(--line); box-shadow: 0 -2px 0 var(--court-600) inset; box-shadow: inset 0 3px 0 var(--court-600); }
.nav-pills .nav-link { border-radius: 8px; color: var(--ink-soft); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--court-600); }
.dropdown-menu {
  --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line); --bs-dropdown-link-hover-bg: var(--surface-2); --bs-dropdown-link-active-bg: var(--court-600);
  border-radius: 11px; padding: .35rem; box-shadow: var(--raise-2); font-size: .88rem;
  animation: dropIn .18s var(--ease) both;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-item { border-radius: 7px; padding: .42rem .7rem; display: flex; align-items: center; gap: .55rem; }
.dropdown-item .bi { color: var(--muted); }
.modal { --bs-modal-bg: var(--surface); --bs-modal-border-color: var(--line); --bs-modal-border-radius: 14px; --bs-modal-header-border-color: var(--line-soft); --bs-modal-footer-border-color: var(--line-soft); }
.modal-content { box-shadow: 0 30px 70px -30px rgba(10, 16, 13, .6), 0 2px 0 rgba(255, 255, 255, .8) inset; }
.modal-header { padding: .9rem 1.1rem; }
.modal-title { font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 1.3rem; }
.modal-footer { background: var(--surface-2); border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; }
.modal.fade .modal-dialog { transform: translateY(14px) scale(.975); transition: transform .32s var(--spring), opacity .2s; }
.modal.show .modal-dialog { transform: none; }
.modal-backdrop { --bs-backdrop-bg: #0f1613; --bs-backdrop-opacity: .55; }
.list-group { --bs-list-group-bg: var(--surface); --bs-list-group-border-color: var(--line-soft); --bs-list-group-action-hover-bg: var(--surface-2); --bs-list-group-active-bg: var(--court-600); --bs-list-group-active-border-color: var(--court-700); }
.progress { --bs-progress-bg: var(--surface-3); --bs-progress-bar-bg: var(--court-600); border-radius: 6px; box-shadow: var(--inset); }
.progress-bar { transition: width .6s var(--ease); }
.tooltip { --bs-tooltip-bg: var(--rail); --bs-tooltip-border-radius: 7px; font-family: "Barlow", sans-serif; }
.offcanvas { --bs-offcanvas-bg: var(--surface); }

/* plain text status labels (no capsules): colour + a small square swatch */
.badge { border-radius: 5px; font-weight: 600; letter-spacing: .01em; }
.st { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .84rem; white-space: nowrap; color: var(--ink-soft); }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; flex: 0 0 8px; box-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.st-ok { color: var(--ok); } .st-warn { color: var(--warn); } .st-bad { color: var(--bad); } .st-info { color: var(--info); } .st-idle { color: var(--idle); }
.st-court { color: var(--pb); } .st-run { color: #6b55a8; }
.st.live::before { animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ------------------------------------------------------------------ figures */
.kpi, .stat {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem .9rem; box-shadow: var(--raise-1);
  height: 100%;
}
.kpi .label, .stat .label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi .value, .stat .value { font-family: "Barlow Condensed", sans-serif; font-size: 1.85rem; font-weight: 600; line-height: 1.05; margin-top: .2rem; color: var(--ink); }
.stat .note { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.stat .value small { font-family: "Barlow", sans-serif; font-size: .9rem; color: var(--muted); font-weight: 500; }
.stat[data-accent]::after { content: ""; position: absolute; left: 1rem; right: 1rem; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--stat-accent, var(--court-600)); }
.stat[data-accent="pb"] { --stat-accent: var(--pb); } .stat[data-accent="cw"] { --stat-accent: var(--cw); } .stat[data-accent="cf"] { --stat-accent: var(--cf); }
.stat[data-accent="ok"] { --stat-accent: var(--ok); } .stat[data-accent="warn"] { --stat-accent: var(--warn); } .stat[data-accent="bad"] { --stat-accent: var(--bad); }
.stat a.stretched-link:hover ~ * { color: inherit; }
.stat:has(a.stretched-link) { transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.stat:has(a.stretched-link):hover { transform: translateY(-2px); box-shadow: var(--raise-2); }

/* section headings inside a page */
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin: 1.25rem 0 .6rem; }
.sec-title h2 { font-size: 1.2rem; margin: 0; }
.sec-title .sec-note { font-size: .82rem; color: var(--muted); }

/* empty states */
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty .bi { font-size: 1.6rem; display: block; margin-bottom: .4rem; color: var(--edge); }

/* skeleton while a panel loads */
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 8px; min-height: 1rem; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* toasts (app.js: window.mbToast) */
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.mb-toast {
  pointer-events: auto; min-width: 260px; max-width: 380px; padding: .7rem .9rem; border-radius: 11px; background: var(--rail); color: #eef2ef; font-size: .88rem;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7); border-left: 4px solid var(--optic); animation: toastIn .4s var(--spring) both;
}
.mb-toast.is-bad { border-left-color: #e0796e; } .mb-toast.is-ok { border-left-color: #7fc79a; }
.mb-toast.out { animation: toastOut .3s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ------------------------------------------------------------------ log-in and join pages */
body.login-bg {
  min-height: 100vh; background-color: var(--page);
  background-image: radial-gradient(rgba(29, 35, 32, .055) 1px, transparent 1px); background-size: 18px 18px;
}
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-panel {
  width: 100%; max-width: 940px; display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 40px 80px -40px rgba(16, 24, 20, .55);
  animation: rise .55s var(--ease) both;
}
.auth-side { position: relative; background: var(--rail); color: #e9eeea; padding: 2rem 2rem 1.6rem; display: flex; flex-direction: column; min-height: 520px; }
.auth-side .rail-brand { padding: 0; }
.auth-court { margin: auto 0; padding: 1.4rem 0; }
.auth-court svg { width: 100%; height: auto; display: block; }
.auth-court .line { fill: none; stroke: rgba(255, 255, 255, .78); stroke-width: 2; stroke-linecap: square; stroke-dasharray: 101; stroke-dashoffset: 101; animation: draw 1.6s var(--ease) forwards; }
.auth-court .line.l2 { animation-delay: .25s; } .auth-court .line.l3 { animation-delay: .45s; } .auth-court .line.l4 { animation-delay: .65s; }
.auth-court .surface-fill { fill: #245c4d; }
.auth-court .kitchen { fill: #2b6b5a; }
.auth-court .ball { fill: var(--optic); animation: ballHop 2.8s var(--ease) 1.4s both; transform-box: fill-box; transform-origin: center; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ballHop { 0% { opacity: 0; transform: translate(-140px, 30px) scale(.6); } 35% { opacity: 1; transform: translate(-60px, -18px); } 70% { transform: translate(0, 0); } 100% { opacity: 1; transform: none; } }
.auth-units { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; font-size: .8rem; }
.auth-units div { padding: .55rem .6rem; border-radius: 9px; background: var(--rail-2); border: 1px solid rgba(255, 255, 255, .05); display: flex; align-items: center; gap: .45rem; color: #cfd8d2; }
.auth-units .bi { font-size: 1rem; }
.auth-units .u-pb .bi { color: #8fd1b6; } .auth-units .u-cw .bi { color: #8fc0e3; } .auth-units .u-cf .bi { color: #e2b48f; }
.auth-form { padding: 2.4rem 2.4rem 2rem; display: flex; flex-direction: column; }
.auth-form h1 { font-size: 2rem; margin: 0 0 .25rem; }
.auth-form .lede { color: var(--muted); margin-bottom: 1.5rem; font-size: .92rem; }
.auth-form .form-control { height: 46px; font-size: 1rem; }
.auth-form .btn-primary { height: 48px; font-size: 1rem; }
.auth-foot { margin-top: auto; padding-top: 1.4rem; font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }
.pw-wrap { position: relative; }
.pw-wrap .pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: .35rem .5rem; border-radius: 6px; }
.pw-wrap .pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
@media (max-width: 820px) {
  .auth-panel { grid-template-columns: 1fr; max-width: 460px; }
  .auth-side { min-height: 0; padding: 1.3rem 1.4rem; }
  .auth-court { display: none; }
  .auth-units { margin-top: 1rem; }
  .auth-form { padding: 1.6rem 1.4rem 1.4rem; }
}
.login-card { border-radius: 16px; }

/* ------------------------------------------------------------------ the rest of the backbone, in the new materials */
.page-bar + .card, .filters { animation: none; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--raise-1); padding: .75rem .9rem; }
.co-state { font-weight: 600; } .co-active { color: var(--ok); } .co-inactive { color: var(--idle); } .co-failed { color: var(--bad); } .co-provisioning { color: var(--warn); }
.platform .rail .menu-link { margin-left: .55rem; display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; font-size: .88rem; }
.platform .rail .menu-link .bi { width: 20px; color: var(--rail-muted); }
.platform .rail .menu-link.active::before { left: -.55rem; }
.platform .rail .menu-group { padding-left: 1.15rem; }

@media print {
  body { background: #fff !important; }
  .rail, .topbar, .platform-strip, .company-strip, .no-print, .toast-stack { display: none !important; }
  .main-area { padding: 0 !important; }
  .main-area > * { animation: none !important; }
  .card { box-shadow: none !important; border-color: #bbb !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .auth-court .line { stroke-dashoffset: 0; }
}

/* figures stay plain: no decorative circles behind the numbers */
.kpi::after { display: none; }
