/* ==========================================================================
   Bonyan Performance OS — shared panel chrome
   Tokens live in /design/tokens.css — do not redeclare :root colours here.
   ========================================================================== */

@import url("/design/tokens.css");
@import url("/design/live-shared.css");
@import url("/design/components.css");
@import url("/design/overlays.css");
@import url("/design/aurora.css");

@font-face {
  font-family: "Dana";
  src: url("/vendor/fonts/dana/DanaFaNum-Medium.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Dana";
  src: url("/vendor/fonts/dana/DanaFaNum-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

* { box-sizing: border-box; }

/* Class-based display rules must never win over the hidden attribute. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.35; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }
p { margin: 0; }
a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--bn-forest);
  outline-offset: 2px;
}

/* --------------------------------------------------------------- header -- */

#nav {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  background: var(--bn-forest);
}

#app-main {
  min-height: calc(100vh - var(--header-h));
  transition: opacity .15s ease;
}
#app-main.is-navigating {
  opacity: .55;
  pointer-events: none;
}

/* App shell: only the content column scrolls, so the navbar cannot shift while
   scrolling or switching pages. Added by JS once the shared navbar is mounted,
   which leaves login/portal pages on the normal document scroll. */
html.app-shell,
html.app-shell body {
  height: 100%;
}
html.app-shell body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html.app-shell #nav {
  flex: 0 0 auto;
}
html.app-shell #app-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.top {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--header-h);
  padding: 0 var(--sp-5);
  background: var(--bn-forest);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  font-size: .88rem;
  color: rgba(244, 251, 246, 0.92);
  white-space: nowrap;
}
.brand-mark { display: none; }

.top nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.top nav::-webkit-scrollbar { display: none; }

.top nav a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .55rem;
  border-radius: 8px;
  color: rgba(244, 251, 246, 0.68);
  font-size: .81rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .16s var(--bn-ease), color .16s var(--bn-ease);
}
.top nav a:hover { background: rgba(255, 255, 255, 0.07); color: var(--bn-tv-ink); }
.top nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 -2px 0 var(--bn-lime);
}
.top nav a:focus-visible {
  outline: 3px solid var(--bn-lime);
  outline-offset: 2px;
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-inline-start: auto;
}
.top .nav-toggle { color: rgba(244, 251, 246, 0.85); }
.top .nav-toggle:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.user {
  font-size: .82rem;
  color: var(--muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu { position: relative; }
.account-trigger {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.account-trigger:hover .user-avatar,
.account-trigger[aria-expanded="true"] .user-avatar {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  background: var(--bn-forest);
  border: 2px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 8px rgba(22, 36, 30, .12);
}
.user-avatar.is-lg { width: 48px; height: 48px; font-size: .95rem; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.account-popover {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 240px;
  padding: .55rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  display: grid;
  gap: .2rem;
}
.account-popover-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem .6rem .75rem;
  margin-bottom: .25rem;
  border-bottom: 1px solid var(--line);
}
.account-popover-head strong {
  display: block;
  font-size: .92rem;
  line-height: 1.3;
}
.account-popover-head span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  direction: ltr;
  text-align: start;
}
.account-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  padding: .45rem .7rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: start;
}
.account-item:hover { background: var(--surface-soft); }
.account-item.is-danger { color: var(--danger); }
.account-item.is-danger:hover { background: var(--danger-soft); }
.account-upload { cursor: pointer; }
.account-lang {
  justify-content: center;
  padding-block: .55rem;
}
.account-lang .lang-switch { width: 100%; justify-content: center; }

.nav-toggle { display: none; }

/* ---------------------------------------------------------------- layout -- */

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
}
.page-head .page-title { display: flex; flex-direction: column; gap: .15rem; }
.page-head .page-sub { color: var(--muted); font-size: .88rem; }
.page-head .page-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); }

/* Title, primary action and section tabs stay in view while the list scrolls,
   so the current location on the page is always visible. */
.page-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: calc(var(--sp-5) * -1) calc(var(--sp-5) * -1) 0;
  padding: var(--sp-4) var(--sp-5) var(--sp-3);
  /* Opaque: rows scrolling underneath must not show through the bar. */
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

/* ------------------------------------------------------- section sub-nav -- */

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}
.subnav-btn {
  min-height: 34px;
  padding: .28rem .8rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .16s var(--bn-ease), color .16s var(--bn-ease);
}
.subnav-btn:hover { background: var(--surface-soft); color: var(--ink); }
.subnav-btn[aria-selected="true"] { background: var(--bn-forest); color: #fff; }
.subnav-btn[aria-selected="true"]:hover { background: var(--bn-forest-soft); color: #fff; }
.subnav-btn .count {
  margin-inline-start: .35rem;
  font-size: .74rem;
  font-weight: 700;
  opacity: .75;
}

.page-section[hidden] { display: none !important; }
.page-section { display: flex; flex-direction: column; gap: var(--sp-4); }

/* ----------------------------------------------------------------- cards -- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  box-shadow: none;
}
.card + .card { margin-top: 0; }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.card-head .card-title { display: flex; flex-direction: column; gap: .1rem; }
.card-head .card-sub { color: var(--muted); font-size: .82rem; font-weight: 400; }
.card-head .card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
/* Inline filters in a card header should size to their content, not stretch. */
.card-head .card-actions input,
.card-head .card-actions select { width: auto; min-width: 210px; }

.card.soft { background: var(--surface-soft); box-shadow: none; }
.card.accent { border-color: rgba(15, 122, 90, .3); background: var(--surface); }

.section + .section { margin-top: var(--sp-5); }
.section-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  font-size: .95rem;
  font-weight: 700;
}

/* ---------------------------------------------------- dashboard (sadmin) -- */

.section-head {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.section-head h2 { font-size: 1rem; font-weight: 700; }
.ds-page-lead {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.5;
}
.ds-page-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.ds-ops-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
@media (min-width: 900px) {
  .ds-ops-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ds-ops-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-height: 148px;
  padding: var(--sp-4);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color .16s var(--bn-ease), box-shadow .16s var(--bn-ease), transform .16s var(--bn-ease);
}
.ds-ops-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 24px rgba(22, 58, 39, 0.08);
  transform: translateY(-1px);
}
.ds-ops-card.is-priority {
  background: linear-gradient(145deg, color-mix(in srgb, var(--bn-forest) 92%, #000) 0%, var(--bn-forest-soft) 100%);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f4fbf6;
}
.ds-ops-card.is-priority .ds-ops-kicker { color: rgba(196, 255, 26, 0.85); }
.ds-ops-card.is-priority p { color: rgba(244, 251, 246, 0.72); }
.ds-ops-card.is-priority .ds-ops-cta { color: var(--bn-lime); }
.ds-ops-card.is-alert {
  border-color: color-mix(in srgb, var(--bn-warn) 45%, var(--line));
  background: var(--bn-warn-soft);
}
.ds-ops-kicker {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--muted);
}
.ds-ops-card strong {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
}
.ds-ops-card p {
  margin: 0;
  flex: 1;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--muted);
}
.ds-ops-cta {
  margin-top: .15rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
}

.ds-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
@media (min-width: 640px) {
  .ds-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.ds-stat {
  text-align: center;
  padding: var(--sp-4) var(--sp-3);
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.ds-stat .val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.ds-stat .lbl {
  margin-top: .25rem;
  font-size: .74rem;
  color: var(--muted);
  line-height: 1.35;
}
.ds-stat.is-alert-stat {
  background: var(--bn-warn-soft);
  border-color: color-mix(in srgb, var(--bn-warn) 35%, var(--line));
}
.ds-stat.is-alert-stat .val { color: var(--bn-warn); }


/* ----------------------------------------------------------------- forms -- */

label {
  display: block;
  margin-bottom: .3rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: .5rem .7rem;
  font: inherit;
  font-size: .9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* Fixed height keeps selects and date pickers flush with the plain inputs beside them. */
select, input[type="date"], input[type="time"], input[type="datetime-local"],
input[data-jdp] { height: 40px; }
textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
input[readonly], input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: not-allowed;
}
input[type="file"] { padding: .35rem .5rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
}
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .form-grid .col-2, .form-grid .col-full { grid-column: 1 / -1; }
}

.field { min-width: 0; }
.field-hint { margin-top: .35rem; font-size: .76rem; color: var(--muted); }
/* Buttons sitting in a form column must line up with the inputs beside them. */
.field > button, .field > .btn { min-height: 40px; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.toolbar .field { flex: 1 1 220px; max-width: 320px; }
/* Short pickers (a 2–3 option filter) should not claim a full search-box width. */
.toolbar .field.narrow { flex: 0 1 180px; }
.toolbar .spacer { flex: 1 1 auto; }

/* Keep a table from butting up against the controls above it. */
.form-actions + .table-wrap,
.error + .table-wrap,
.ok + .table-wrap,
.alert + .table-wrap,
.form-grid + .table-wrap { margin-top: var(--sp-5); }

/* --------------------------------------------------------------- buttons -- */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: .45rem 1rem;
  font: inherit;
  font-size: .87rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s var(--bn-ease), border-color .16s var(--bn-ease), color .16s var(--bn-ease);
}
button:hover, .btn:hover { background: var(--surface-soft); border-color: var(--muted); }
button:active, .btn:active { background: var(--accent-soft); }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary, button.primary {
  background: var(--bn-lime);
  border-color: var(--bn-lime);
  color: var(--bn-lime-ink);
}
.btn.primary:hover, button.primary:hover {
  background: #d4ff4d;
  border-color: #d4ff4d;
  color: var(--bn-lime-ink);
}
.btn.primary:focus-visible {
  outline: 3px solid var(--bn-forest);
  outline-offset: 2px;
}

.btn.danger, button.danger {
  background: var(--surface);
  border-color: rgba(179, 38, 30, .35);
  color: var(--danger);
}
.btn.danger:hover, button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn.info, button.info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 35%, var(--line-strong));
  color: var(--info);
}
.btn.info:hover, button.info:hover {
  background: color-mix(in srgb, var(--info) 18%, var(--surface));
  border-color: var(--info);
  color: var(--info);
}
.btn.info:focus-visible {
  outline: 3px solid var(--info);
  outline-offset: 2px;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.ghost:hover { background: var(--surface-soft); color: var(--ink); }

.btn.sm, button.sm { min-height: 30px; padding: .2rem .55rem; font-size: .78rem; }
.btn.block { width: 100%; }

.lang-switch { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 999px; }
.lang-switch button {
  min-height: 28px;
  padding: .1rem .65rem;
  font-size: .78rem;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
}
.lang-switch button:hover { background: transparent; color: var(--ink); }
.lang-switch button.active-lang { background: var(--bn-lime); color: var(--bn-lime-ink); }

/* ---------------------------------------------------------------- tables -- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table { width: 100%; border-collapse: collapse; font-size: .87rem; background: var(--surface); }

th, td {
  padding: .7rem .8rem;
  text-align: start;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td.wrap-text { white-space: normal; min-width: 200px; }

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: none;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s var(--bn-ease); }
tbody tr:hover { background: var(--surface-soft); }
tbody tr.selected { background: var(--accent-soft) !important; }
table.clickable tbody tr { cursor: pointer; }

.row-actions { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; justify-content: flex-end; }
.row-actions button, .row-actions .btn { min-height: 36px; padding: .2rem .65rem; font-size: .8rem; }
.row-actions a.sm,
.row-actions .icon-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 30px;
  min-width: 30px;
  padding: .2rem .55rem;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.row-actions a.sm:hover,
.row-actions .icon-gear:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.view-switch {
  display: inline-flex;
  gap: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.view-switch button {
  min-height: 32px;
  padding: .25rem .75rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.view-switch button.is-active,
.view-switch button[aria-selected="true"] {
  background: var(--bn-forest);
  color: #fff;
  box-shadow: none;
}

.equipment-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--sp-4);
  padding: var(--sp-2) 0 var(--sp-1);
}
.equipment-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-height: 0;
  padding: .85rem .9rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.equipment-card.is-tone-green { border-inline-start: 3px solid var(--bn-success); }
.equipment-card.is-tone-blue { border-inline-start: 3px solid var(--bn-info); }
.equipment-card.is-tone-yellow { border-inline-start: 3px solid var(--bn-warn); }
.equipment-card.is-tone-red { border-inline-start: 3px solid var(--bn-danger); }
.equipment-card.is-tone-white { border-inline-start: 3px solid var(--bn-line-strong); }
.equipment-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .6rem;
}
.equipment-card-check {
  flex: 0 0 auto;
  padding-top: .15rem;
}
.equipment-kanban-select-all {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  white-space: nowrap;
}
.equipment-card-info {
  display: flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 0;
  flex: 1;
}
.equipment-card-battery {
  flex: 0 0 auto;
  margin-inline-start: auto;
}
.equipment-card-id {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .72rem;
  color: var(--muted);
  font-weight: 600;
}
.equipment-card-name {
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink-soft);
  word-break: break-word;
}
.equipment-card-person {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: .28rem;
  margin-top: .35rem;
  font-size: .95rem;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.3;
  min-width: 0;
}
.equipment-card-person-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.equipment-card-person-role {
  flex: 0 0 auto;
  font-size: .68rem;
  font-weight: 600;
  color: var(--muted);
}
.equipment-card-handover {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: .15rem;
  min-width: 0;
}
.equipment-card-handover .badge {
  font-variant-numeric: tabular-nums;
  font-size: .72rem;
  padding: .12rem .5rem;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eq-modal-form {
  display: grid;
  gap: 1rem;
}
.eq-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}
.eq-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.eq-mode-card {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}
.eq-mode-card > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.eq-mode-card-inner {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 108px;
  padding: .85rem .9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.eq-mode-card.is-active .eq-mode-card-inner,
.eq-mode-card > input:checked + .eq-mode-card-inner {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(15, 122, 90, .1);
}
.eq-mode-title {
  display: block;
  margin: 0;
  font-size: .82rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}
.eq-mode-control {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.eq-mode-control input[type="number"] {
  width: 5.2rem;
  flex: 0 0 5.2rem;
  min-height: 40px;
  text-align: center;
  font-weight: 800;
  pointer-events: auto;
}
.eq-mode-unit {
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
}
.eq-mode-card select {
  width: 100%;
}
.eq-mode-card select:disabled,
.eq-mode-card input:disabled {
  opacity: .45;
}
.eq-inspect-battery {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem .95rem;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.eq-inspect-battery span {
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
}
.eq-inspect-battery strong {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.eq-choice-grid {
  padding: .45rem;
  min-height: 0;
}
.eq-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.eq-combo { position: relative; }
.eq-combo-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: .3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--bn-shadow, 0 10px 28px rgba(15, 28, 20, .12));
}
.eq-combo-item {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  width: 100%;
  min-width: 0;
  padding: .55rem .7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  overflow: hidden;
}
.eq-combo-item:hover,
.eq-combo-item.is-active {
  background: var(--accent-soft);
}
.eq-combo-item strong {
  display: block;
  font-size: .86rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eq-combo-item span {
  display: block;
  font-size: .74rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eq-combo-empty {
  padding: .7rem .75rem;
  font-size: .8rem;
  color: var(--muted);
}
.eq-combo-section {
  padding: .35rem .55rem .15rem;
  font-size: .68rem;
  font-weight: 700;
  color: var(--muted);
  border-top: 1px solid rgba(15, 23, 42, .06);
}
.eq-combo-section:first-child {
  border-top: 0;
}
#handoverDrawer .bn-modal-panel,
#handoverDrawer .bn-modal-body { overflow: visible; }

.ho-report-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--sp-3) var(--sp-4);
  align-items: end;
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.ho-report-filters .field { margin: 0; }
.ho-report-filters select,
.ho-report-filters input { width: 100%; min-width: 0; }
.ho-report-filters .eq-combo { min-width: 0; }
.ho-report-filters .eq-combo-list {
  inset-inline-start: 0;
  inset-inline-end: auto;
  min-width: 100%;
  width: max(100%, 240px);
  max-width: min(320px, calc(100vw - 2rem));
  max-height: 180px;
  padding: .15rem;
  border-radius: 10px;
  scrollbar-width: thin;
}
.ho-report-filters .eq-combo-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding: .22rem .45rem;
  border-radius: 6px;
}
.ho-report-filters .eq-combo-item strong {
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}
.ho-report-filters .eq-combo-item span {
  font-size: .67rem;
  line-height: 1.2;
  flex-shrink: 0;
  max-width: 38%;
}
.ho-report-filters .eq-combo-empty {
  padding: .35rem .45rem;
  font-size: .74rem;
}
.ho-report-filters .eq-combo:focus-within .eq-combo-list:not([hidden]) {
  z-index: 50;
}
.ho-filter-reset {
  justify-self: start;
  align-self: end;
  min-height: 40px;
}
.ho-report-meta {
  margin: 0 0 var(--sp-3);
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 720px) {
  .ho-report-filters { grid-template-columns: 1fr 1fr; }
  .ho-filter-reset { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .eq-modal-row,
  .eq-mode-grid { grid-template-columns: 1fr; }
}
.equipment-card-meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}
.equipment-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: auto;
}
.equipment-card-actions .sm {
  min-height: 30px;
  padding: .2rem .6rem;
  font-size: .78rem;
}

/* Kanban board — content-height columns, horizontal scroll when many stages */
html.app-shell #app-main.is-equipment-kanban > .wrap {
  max-width: none;
  width: 100%;
}
html.app-shell #app-main.is-equipment-kanban .page-bar {
  margin-bottom: 0;
}
.equipment-kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  align-items: flex-start;
  padding: 2px 0 8px;
  min-height: 0;
}
.equipment-kanban-col {
  flex: 0 0 248px;
  width: 248px;
  min-width: 248px;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .65rem .6rem .7rem;
}
.equipment-kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--line);
}
.equipment-kanban-col-head .badge {
  font-size: .65rem;
  padding: .1rem .35rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.equipment-kanban-col-title {
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}
.equipment-kanban-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: .7rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.equipment-kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.equipment-kanban-col.is-tone-green { border-top: 3px solid var(--bn-success); }
.equipment-kanban-col.is-tone-blue { border-top: 3px solid var(--bn-info); }
.equipment-kanban-col.is-tone-yellow { border-top: 3px solid var(--bn-warn); }
.equipment-kanban-col.is-tone-red { border-top: 3px solid var(--bn-danger); }
.equipment-kanban-col.is-tone-white { border-top: 3px solid var(--bn-line-strong); }
.equipment-kanban-empty {
  padding: .7rem .5rem;
  text-align: start;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.4;
}
.equipment-kanban .equipment-card {
  min-height: 0;
  padding: .7rem .75rem .65rem;
  gap: .35rem;
  box-shadow: none;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bn-aurora-cream) 35%, var(--surface));
}
.equipment-kanban .equipment-card-code {
  font-size: .98rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.2;
}
.equipment-kanban .equipment-card-id {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
}
.equipment-kanban .equipment-card-name {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-soft);
}
.equipment-kanban .equipment-card-person {
  margin-top: .28rem;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}
.equipment-kanban .equipment-card-person-role {
  font-size: .64rem;
}
.equipment-kanban .equipment-card-battery .battery-icon {
  font-size: .72rem;
}
.equipment-kanban .equipment-card-battery .battery-icon svg {
  width: 22px;
  height: 12px;
}
.equipment-kanban .equipment-card-status .badge {
  font-size: .68rem;
  padding: .1rem .4rem;
}
.equipment-kanban .equipment-card-meta {
  gap: .35rem;
}
.equipment-kanban .equipment-card-meta .battery-icon {
  font-size: .72rem;
}
.equipment-kanban .equipment-card-meta .battery-icon svg {
  width: 22px;
  height: 12px;
}
.equipment-kanban .equipment-card-actions {
  gap: 4px;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
}
.equipment-kanban .equipment-card-actions .sm {
  min-height: 32px;
  padding: .2rem .55rem;
  font-size: .74rem;
  width: auto;
}

/* Club class calendar (Jalali month view) */
html.app-shell #app-main.is-classes-calendar {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
html.app-shell #app-main.is-classes-calendar > .wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  width: 100%;
  padding-bottom: var(--sp-3);
  overflow: auto;
  display: flex;
  flex-direction: column;
}
html.app-shell #app-main.is-classes-calendar > .wrap > #ok,
html.app-shell #app-main.is-classes-calendar > .wrap > #err {
  flex-shrink: 0;
}
html.app-shell #app-main.is-classes-calendar .page-bar {
  flex-shrink: 0;
  margin-bottom: 0;
}
html.app-shell #app-main.is-classes-calendar > .wrap > .cls-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}
html.app-shell #app-main.is-classes-calendar .cls-sidebar {
  max-height: calc(100vh - var(--bn-header-h) - 140px);
  overflow-y: auto;
}
html.app-shell #app-main.is-classes-calendar .page-section[data-section-panel="calendar"],
html.app-shell #app-main.is-classes-calendar .page-section[data-section-panel="month"],
html.app-shell #app-main.is-classes-calendar .page-section[data-section-panel="week"],
html.app-shell #app-main.is-classes-calendar .page-section[data-section-panel="day"] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  gap: 0;
  display: flex;
  flex-direction: column;
}
.class-head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.class-head-cal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.class-head-cal .class-calendar-title {
  font-size: 1rem;
  margin: 0;
  flex: 0 0 auto;
}
html.app-shell #app-main:not(.is-classes-calendar) .class-head-cal {
  display: none;
}
.class-calendar-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  overflow: hidden;
  padding: var(--sp-2) var(--sp-3) var(--sp-2);
}
.class-calendar-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  column-gap: 10px;
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 2px;
}
.class-calendar-toolbar:has(#classSelectionPanel:not([hidden])) {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface-soft);
}
.class-calendar-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.class-cal-month-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.class-cal-month-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}
.class-cal-month-btn:hover {
  background: var(--accent-soft);
  border-color: var(--bn-forest);
  color: var(--bn-forest);
}
.class-cal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}
.class-cal-badge.is-month::after {
  content: "";
  width: 0;
  height: 0;
  margin-inline-start: 8px;
  border: 5px solid transparent;
  border-top-color: currentColor;
  border-bottom-width: 0;
  transform: translateY(1px);
}
.class-cal-badge.is-year {
  width: 5.4rem;
  padding: 0 8px;
  text-align: center;
  cursor: text;
}
.class-cal-month-wrap { position: relative; }
.class-cal-month-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 220px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}
.class-cal-month-menu[hidden] { display: none !important; }
.class-cal-month-menu button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
}
.class-cal-month-menu button:hover { background: var(--accent-soft); }
.class-cal-month-menu button.is-active {
  background: var(--bn-forest);
  color: #fff;
}
.class-calendar-grid {
  --cal-weeks: 6;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: auto repeat(var(--cal-weeks), minmax(5.5rem, 1fr));
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  overflow: auto;
  background: var(--surface);
  align-items: stretch;
}
.class-cal-head {
  padding: .45rem .2rem;
  text-align: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.class-cal-head-short { display: none; }
.class-cal-head:nth-child(7) { color: var(--bn-danger); }
@media (max-width: 720px) {
  .class-cal-head-full { display: none; }
  .class-cal-head-short { display: inline; }
  .class-cal-head { font-size: .78rem; }
}
.class-cal-cell {
  min-height: 0;
  height: auto;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: .12rem .14rem .1rem;
  display: flex;
  flex-direction: column;
  gap: .08rem;
  background: var(--surface);
  overflow: hidden;
}
.class-cal-cell:nth-child(7n+1) { border-left: 0; }
.class-cal-cell.is-out {
  background: var(--surface-soft);
  opacity: .55;
}
.class-cal-cell:hover:not(.is-out) {
  background: color-mix(in srgb, var(--bn-forest) 4%, var(--surface));
}
.class-cal-cell.is-today {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(22, 58, 39, 0.22);
}
.class-cal-day {
  flex-shrink: 0;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  text-align: left;
}
html[dir="rtl"] .class-cal-day { text-align: right; }
.class-cal-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-shrink: 0;
  height: 22px;
  max-height: 22px;
  min-height: 0;
  line-height: 1;
}
.class-cal-add {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--muted);
  line-height: 0;
  cursor: pointer;
  flex: 0 0 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.class-cal-add svg {
  width: 12px;
  height: 12px;
  display: block;
}
.class-cal-cell:hover .class-cal-add,
.class-cal-cell:focus-within .class-cal-add,
.class-cal-add:focus-visible {
  opacity: 1;
  pointer-events: auto;
  color: var(--bn-forest);
}
button.class-cal-add,
button.class-cal-add:hover,
button.class-cal-add:focus-visible {
  min-height: 18px;
  min-width: 18px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.class-cal-cell:hover .class-cal-add:hover,
button.class-cal-add:hover {
  background: color-mix(in srgb, var(--bn-forest) 10%, transparent);
  color: var(--bn-forest);
}
.class-cal-events {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 3px;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
  padding: 2px;
}
.class-cal-event {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: auto;
  min-width: 2.4rem;
  max-width: calc(50% - 2px);
  flex: 0 1 auto;
  min-height: 1.15rem;
  padding: 0 5px;
  border: 0;
  border-radius: 6px;
  border-inline-start: 3px solid var(--ev-color, #1f6f9a);
  background: color-mix(in srgb, var(--ev-color, #1f6f9a) 16%, white);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: none;
  outline: none;
}
html[dir="rtl"] .class-cal-event {
  border-inline-end: 0;
  border-inline-start: 3px solid var(--ev-color, #1f6f9a);
}
.class-cal-event:hover {
  background: color-mix(in srgb, var(--ev-color, #1f6f9a) 20%, white);
  border-color: var(--ev-color, #1f6f9a);
}
.class-cal-event:focus,
.class-cal-event:focus-visible {
  outline: none;
}
.class-cal-event.is-selected {
  outline: none;
  box-shadow: none;
  opacity: 1;
  background: color-mix(in srgb, var(--ev-color, #1f6f9a) 28%, white);
}
.class-calendar-grid:has(.class-cal-event.is-selected) .class-cal-event:not(.is-selected),
.class-calendar-grid:has(.class-cal-event.is-selected) .class-cal-more {
  opacity: 0.28;
  filter: saturate(0.45);
}
.class-calendar-grid:has(.class-cal-event.is-selected) .class-cal-event:not(.is-selected):hover {
  opacity: 0.72;
  filter: saturate(0.8);
}
.class-cal-event.has-title {
  justify-content: flex-start;
  gap: 4px;
  max-width: calc(100% - 2px);
}
.class-cal-event-time {
  flex-shrink: 0;
  font-size: .58rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: .9;
  line-height: 1.1;
}
.class-cal-event-title {
  font-size: .62rem;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}
.class-cal-event-coach {
  display: none;
}
.class-cal-event-meta { display: none; }
.class-cal-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.15rem;
  min-width: 1.6rem;
  margin: 0;
  padding: 0 5px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--bn-forest);
  font: inherit;
  font-size: .58rem;
  font-weight: 800;
  cursor: pointer;
}

.class-inspector-main {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  padding: 4px 0;
}
.class-inspector-swatch {
  width: 8px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 99px;
  background: var(--ev-color, #1f6f9a);
}
.class-inspector-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  overflow: hidden;
}
.class-inspector-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.class-inspector-title-row strong {
  font-size: .88rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}
.class-inspector-when,
.class-inspector-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.class-inspector-when span,
.class-inspector-meta span {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  padding: 0 7px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.class-inspector-actions {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.class-day-sheet {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface-soft);
  padding: .55rem .65rem .65rem;
}
.class-day-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.class-day-sheet-head strong { font-size: .88rem; }
.class-day-sheet-list {
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow: auto;
}
.class-day-sheet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 4px 10px;
  border: 0;
  border-radius: 10px;
  border-inline-start: 3px solid var(--ev-color, #1f6f9a);
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.class-day-sheet-item:hover { background: var(--accent-soft); }
.class-day-sheet-copy {
  display: grid;
  min-width: 0;
}
.class-day-sheet-copy strong {
  font-size: .82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.class-day-sheet-copy em {
  font-style: normal;
  font-size: .72rem;
  color: var(--muted);
}

.class-cal-popup {
  position: fixed;
  z-index: 80;
  max-width: 260px;
  padding: .6rem .75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.45;
  pointer-events: none;
  color: var(--ink);
}
.class-cal-popup strong { display: block; font-size: .86rem; margin-bottom: 4px; }
.class-cal-popup div + div { margin-top: .12rem; color: var(--muted); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.class-list-card { display: grid; gap: var(--sp-3); }
.class-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.class-list-search { flex: 1 1 220px; min-width: 0; }
.class-list-search input {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 0 .85rem;
  font: inherit;
  background: var(--surface);
}
.class-list-filters {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.class-list-filters button {
  min-height: 32px;
  padding: 0 .75rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.class-list-filters button.is-active {
  background: var(--bn-forest);
  color: #fff;
}
.class-list-card .bn-data tbody td {
  vertical-align: middle;
}
.class-list-card .bn-identity {
  display: table-cell;
  vertical-align: middle;
}
.class-list-card .class-list-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.class-list-card .class-list-identity-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  line-height: 1.25;
}
.class-list-swatch {
  width: 8px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 99px;
  background: var(--ev-color, #1f6f9a);
}
.class-list-card tbody tr[data-id] { cursor: pointer; }
.class-list-card tbody tr[data-id]:hover td { background: var(--accent-soft); }

.class-weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.class-weekday-grid .choice-badge {
  justify-content: center;
  padding: 0;
  font-size: .74rem;
  min-width: 0;
  width: 100%;
}
.class-weekday-grid .choice-badge span {
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: .3rem .1rem;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.class-weekday-grid .choice-badge input:checked + span {
  background: var(--bn-forest);
  color: #fff;
  border-color: var(--bn-forest);
  box-shadow: none;
}
.drawer-body .class-form-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  grid-column: 1 / -1;
}
.drawer-body .class-form-inline .field {
  min-width: 0;
}

#classDrawer .bn-modal-panel.class-modal {
  width: min(760px, calc(100vw - 28px));
  max-height: min(90vh, 820px);
  overflow: visible;
  background: #fff;
  border: 1px solid var(--bn-line);
  box-shadow: 0 24px 56px rgba(18, 32, 24, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#classDrawer .class-modal-head {
  align-items: center;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--bn-line);
}
#classDrawer .class-modal-head-copy { min-width: 0; }
#classDrawer .class-modal-kicker { display: none; }
#classDrawer .class-modal-head h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
#classDrawer .class-modal-body {
  padding: 18px 20px 8px;
  overflow: auto;
  max-height: calc(90vh - 132px);
}
#classDrawer .class-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
}
#classDrawer .class-span { grid-column: 1 / -1; }
#classDrawer .class-modal-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
#classDrawer .class-modal-col.is-schedule {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--bn-line);
  background: none;
  border-radius: 0;
}
#classDrawer .class-modal-block-title {
  margin: 0;
  font-size: .92rem;
  font-weight: 800;
  color: var(--bn-ink);
}
#classDrawer .class-modal-pair,
#classDrawer .class-modal-when {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
#classDrawer .class-modal-when {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#classDrawer .class-modal-body .field { margin: 0; }
#classDrawer .class-modal-body label {
  margin-bottom: 6px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--bn-ink);
}
#classDrawer .class-modal-body input:not([type="checkbox"]),
#classDrawer .class-modal-body select,
#classDrawer .class-modal-body textarea {
  min-height: 40px;
  height: 40px;
  padding: .4rem .7rem;
  font-size: .9rem;
  border-radius: 12px;
}
#classDrawer .class-modal-body textarea {
  height: auto;
  min-height: 72px;
  resize: vertical;
}
#classDrawer .class-modal-body input[data-jdp],
#classDrawer .class-modal-body .bn-timepicker-input {
  height: 40px;
}
#classDrawer .bn-timepicker-input {
  text-align: center;
  padding-inline: 32px;
}
#classDrawer #classStatus { display: none !important; }
.bn-timepicker {
  position: relative;
  display: block;
}
.bn-timepicker-input {
  width: 100%;
  direction: ltr;
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  padding-inline-end: 36px;
}
.bn-timepicker-icon {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--bn-forest);
  box-shadow: none;
}
.bn-timepicker-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.bn-timepicker-icon:hover,
.bn-timepicker.is-open .bn-timepicker-icon {
  background: color-mix(in srgb, var(--bn-forest) 10%, transparent);
  color: var(--bn-forest);
}
.bn-timepicker-panel {
  position: fixed;
  z-index: 140;
  padding: 14px 14px 16px;
  background: #fff;
  border: 1px solid var(--bn-line);
  border-radius: 24px;
  box-shadow: 0 22px 56px rgba(18, 32, 24, 0.18);
}
.bn-timepicker-panel[hidden] { display: none !important; }
.bn-clock-head {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.bn-clock-head span {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--bn-muted);
  padding: 0 2px 4px;
}
.bn-clock-hh,
.bn-clock-mm {
  min-width: 52px;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: var(--bn-canvas);
  box-shadow: none;
  color: var(--bn-ink);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.bn-clock-hh.is-on,
.bn-clock-mm.is-on,
.bn-clock-hh.is-on:hover,
.bn-clock-mm.is-on:hover {
  background: var(--bn-forest);
  color: #fff;
}
.bn-clock-face {
  position: relative;
  width: 248px;
  height: 248px;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  cursor: pointer;
}
.bn-clock-disk {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(50%);
  background:
    radial-gradient(circle at 50% 42%, #fff 0 36%, color-mix(in srgb, var(--bn-aurora-cream) 70%, #fff) 70%, color-mix(in srgb, var(--bn-aurora-sage) 35%, #fff) 100%);
  border: 6px solid var(--bn-forest);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7), 0 10px 24px rgba(22, 58, 39, 0.12);
}
.bn-clock-disk::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  pointer-events: none;
  background:
    repeating-conic-gradient(from -0.4deg, color-mix(in srgb, var(--bn-forest) 40%, transparent) 0 0.8deg, transparent 0.8deg 6deg),
    repeating-conic-gradient(from -0.7deg, var(--bn-forest) 0 1.4deg, transparent 1.4deg 30deg);
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 8px), #000 calc(100% - 7px));
          mask: radial-gradient(farthest-side, #0000 calc(100% - 8px), #000 calc(100% - 7px));
}
.bn-clock-arm {
  position: absolute;
  inset: 0;
  transform: rotate(var(--deg, 0deg));
  pointer-events: none;
  z-index: 2;
}
.bn-clock-arm-line {
  position: absolute;
  left: 50%;
  top: calc(50% - var(--len, 50px) + var(--knob, 16px));
  width: 3px;
  height: calc(var(--len, 50px) - var(--knob, 16px));
  margin-left: -1.5px;
  background: var(--bn-forest);
  border-radius: 99px;
}
.bn-clock-arm-knob {
  position: absolute;
  left: 50%;
  top: calc(50% - var(--len, 50px) - var(--knob, 16px));
  width: calc(var(--knob, 16px) * 2);
  height: calc(var(--knob, 16px) * 2);
  margin-left: calc(var(--knob, 16px) * -1);
  border-radius: 50%;
  background: var(--bn-lime);
  box-shadow: 0 0 0 3px var(--bn-forest);
  z-index: 4;
}
.bn-clock-arm.is-snap {
  --knob: 16px;
}
.bn-clock-arm.is-snap .bn-clock-arm-knob { visibility: hidden; }
.bn-clock-arm:not(.is-snap) { --knob: 7px; }
.bn-clock-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--bn-forest);
  box-shadow: 0 0 0 3px #fff;
  pointer-events: none;
  z-index: 5;
}
.bn-clock-nums {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.bn-clock-nums button {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: -16px 0 0 -16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: var(--bn-ink);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
  transform: rotate(calc(var(--i) * 30deg)) translateY(var(--ring)) rotate(calc(var(--i) * -30deg));
}
.bn-clock-nums button:hover,
.bn-clock-nums button:active {
  background: transparent;
  border: 0;
  box-shadow: none;
}
.bn-clock-nums button.is-on,
.bn-clock-nums button.is-on:hover,
.bn-clock-nums button.is-on:active {
  background: var(--bn-lime);
  color: var(--bn-forest);
  box-shadow: 0 0 0 3px var(--bn-forest);
  z-index: 4;
}
.bn-clock-nums[data-ring="inner"] button { --ring: -50px; font-size: 0.72rem; color: var(--bn-muted); }
.bn-clock-nums[data-ring="outer"] button { --ring: -82px; }
.bn-clock-nums[data-ring="inner"] button.is-on { color: var(--bn-forest); }
.bn-clock-face[data-mode="m"] [data-ring="inner"] { display: none; }
.bn-clock-face[data-mode="m"] [data-ring="outer"] button { font-size: 0.82rem; }
#classDrawer .class-status-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  height: 40px;
  min-height: 40px;
  padding: 3px;
  background: var(--bn-canvas, #f7faf7);
  border: 1px solid var(--bn-line);
  border-radius: 12px;
}
#classDrawer .class-status-toggle button {
  min-height: 0;
  height: 100%;
  min-width: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  color: var(--bn-muted);
  font-size: .75rem;
  font-weight: 700;
}
#classDrawer .class-status-toggle button:hover {
  background: rgba(22, 58, 39, 0.06);
  border: 0;
  color: var(--bn-ink);
}
#classDrawer .class-status-toggle button.is-active,
#classDrawer .class-status-toggle button.is-active:hover {
  background: var(--bn-forest);
  color: #fff;
}
#classDrawer .class-weekday-grid {
  gap: 6px;
}
#classDrawer .class-weekday-grid .choice-badge span {
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 800;
  background: #fff;
}
#classDrawer .class-weekday-grid .choice-badge input:checked + span {
  background: var(--bn-forest);
  color: #fff;
  border-color: var(--bn-forest);
}
#classDrawer .class-modal-hint {
  margin: 0;
  padding: 0;
  font-size: .75rem;
  line-height: 1.6;
  color: var(--bn-muted);
  background: none;
  border-radius: 0;
}
#classDrawer .class-modal-roster {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--bn-line);
  display: grid;
  gap: 10px;
}
#classDrawer .class-roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#classDrawer .class-roster-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  align-items: center;
}
#classDrawer .class-roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .45rem;
  max-height: 220px;
  overflow: auto;
}
#classDrawer .class-roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem .7rem;
  border: 1px solid var(--bn-line);
  border-radius: 10px;
  background: #fff;
}
#classDrawer .class-roster-row.is-inactive {
  opacity: .65;
  background: var(--bn-canvas, #f7faf7);
}
#classDrawer .class-roster-copy {
  min-width: 0;
  display: grid;
  gap: .15rem;
}
#classDrawer .class-roster-copy strong {
  font-size: .88rem;
}
#classDrawer .class-roster-copy span {
  font-size: .72rem;
  color: var(--bn-muted);
}
#classDrawer .class-roster-ops {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}
#classDrawer .class-roster-empty {
  font-size: .8rem;
  color: var(--bn-muted);
  padding: .4rem 0;
}
#classDrawer .class-roster-toolbar {
  display: block;
}
#classDrawer .class-roster-toolbar input[type="search"] {
  width: 100%;
}
#classDrawer .class-roster-select-all {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--bn-ink);
  white-space: nowrap;
}
#classDrawer .class-roster-select-all input,
#classDrawer .class-roster-check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  border: 1.5px solid #b7c7be;
  border-radius: 4px;
  background: #fff center / 10px 10px no-repeat;
  box-shadow: none;
}
#classDrawer .class-roster-select-all input:checked,
#classDrawer .class-roster-check-row input[type="checkbox"]:checked {
  border-color: #163a27;
  background-color: #163a27;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.2 4.7 8.7 9.8 3.3' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#classDrawer .class-roster-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--bn-line);
  border-radius: 12px;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #c3d2c9 transparent;
}
#classDrawer .class-roster-check-row + .class-roster-check-row {
  border-top: 1px solid #eef3f0;
}
#classDrawer .class-roster-check-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 6px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
#classDrawer .class-roster-check-row label:hover {
  background: #f7faf7;
}
#classDrawer .class-roster-check-row label:has(input:checked) {
  background: #f3f8f4;
}
#classDrawer .class-roster-check-row .class-roster-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
#classDrawer .class-roster-check-row .class-roster-copy strong {
  font-size: .88rem;
  font-weight: 700;
  color: var(--bn-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#classDrawer .class-roster-check-row .class-roster-copy span {
  flex: 0 0 auto;
  font-size: .75rem;
  font-weight: 600;
  color: #6d7f74;
  font-variant-numeric: tabular-nums;
}
#classDrawer .class-modal-foot {
  background: #fff;
  border-top: 1px solid var(--bn-line);
  padding: 12px 20px 14px;
  align-items: center;
}
#classDrawer .class-modal-foot .btn { min-width: 88px; }
@media (max-width: 720px) {
  #classDrawer .class-modal-layout,
  #classDrawer .class-modal-when { grid-template-columns: 1fr 1fr; }
  #classDrawer .class-span { grid-column: 1 / -1; }
}

.battery-icon {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}
.battery-icon svg {
  width: 26px;
  height: 14px;
  display: block;
}
.battery-icon.is-low { color: var(--warn); }
.battery-icon.is-critical { color: var(--danger); }
.battery-icon.is-empty { opacity: .55; }

.table-empty {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  color: var(--muted);
  font-size: .87rem;
}
td.table-empty { white-space: normal; }

/* ---------------------------------------------------------------- badges -- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.is-success, .badge.is-approved, .badge.is-active, .badge.is-closed { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(15, 122, 90, .25); }
.badge.is-warn, .badge.is-pending, .badge.is-progress { background: var(--warn-soft); color: var(--warn); border-color: rgba(162, 96, 13, .25); }
.badge.is-danger, .badge.is-rejected { background: var(--danger-soft); color: var(--danger); border-color: rgba(179, 38, 30, .25); }
.badge.is-info, .badge.is-open { background: var(--info-soft); color: var(--info); border-color: rgba(31, 111, 154, .25); }
.badge.is-inactive, .badge.is-disabled { background: var(--surface-soft); color: var(--muted); border-color: var(--line-strong); }

.badge-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
.permission-badge { white-space: normal; line-height: 1.5; }
.table-sub { display: block; margin-top: .15rem; color: var(--muted); font-size: .76rem; }

/* Selectable roles and permissions: the entire badge is a large click target. */
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-3);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.choice-badge {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  user-select: none;
}
.choice-badge input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-badge span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .3rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .8rem;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.choice-badge input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: 0 0 0 2px rgba(15, 122, 90, .1);
}
.choice-badge input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.section-divider {
  height: 1px;
  margin: var(--sp-5) 0;
  background: var(--line);
}

/* ---------------------------------------------------------------- drawer -- */
/* Forms open in a slide-over instead of sitting above the data, so a page is
   only ever a list until the user explicitly asks to create or edit. */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 36, 30, .38);
  opacity: 0;
  transition: opacity .18s ease;
}
.drawer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(var(--drawer-offset, 100%));
  transition: transform .22s ease;
}
[dir="rtl"] .drawer-panel { --drawer-offset: -100%; }

.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer.is-open .drawer-panel { transform: translateX(0); }

body.drawer-open #app-main { overflow: hidden; }

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
}
.drawer-head .card-title { display: flex; flex-direction: column; gap: .1rem; }
.drawer-head .card-sub { color: var(--muted); font-size: .82rem; font-weight: 400; }

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--sp-5);
}
.drawer-body > :last-child { margin-bottom: 0; }

.drawer-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
}
.drawer-foot .btn.primary { min-width: 8rem; }

.btn.icon {
  min-width: 40px;
  min-height: 40px;
  padding: 0 .5rem;
  font-size: 1rem;
  line-height: 1;
}

/* A drawer form is one column: scanning top-to-bottom beats hunting a grid. */
.drawer-body .form-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
.drawer-body .form-grid .col-2,
.drawer-body .form-grid .col-full { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .drawer-panel { width: 100%; }
}

/* ----------------------------------------------------------- empty state -- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4);
  color: var(--muted);
  text-align: center;
}
.empty-state strong { color: var(--ink-soft); font-size: .92rem; }
.field.is-required > label::after { content: " *"; color: var(--danger); }
.empty-state p { font-size: .84rem; max-width: 34rem; }

/* ---------------------------------------------------------------- alerts -- */

.alert, .error, .ok {
  display: block;
  margin: var(--sp-3) 0;
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  border: 1px solid transparent;
}
.error, .alert.alert-error { background: var(--danger-soft); border-color: rgba(179, 38, 30, .25); color: var(--danger); }
.ok, .alert.alert-ok { background: var(--accent-soft); border-color: rgba(15, 122, 90, .25); color: var(--accent-ink); }
.alert.alert-info { background: var(--info-soft); border-color: rgba(31, 111, 154, .25); color: var(--info); }
.alert:empty, .error:empty, .ok:empty { display: none; }

.notice {
  display: flex;
  gap: var(--sp-2);
  padding: .65rem .85rem;
  margin-bottom: var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .84rem;
}

.selected-club-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: .55rem .85rem;
  margin-bottom: var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(15, 122, 90, .22);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .87rem;
}
.selected-club-banner:empty { display: none; }

.muted { color: var(--muted); font-size: .85rem; }

/* ------------------------------------------------------------------ tabs -- */

.tabs {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px;
  margin-bottom: var(--sp-4);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  /* overflow-x:auto makes overflow-y compute to auto, which zeroes flex
     min-height inside column flex parents and collapses the bar to ~padding. */
  overflow: visible;
}
.tab-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: .25rem 1rem;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
}
.tab-btn:hover { background: transparent; color: var(--ink); }
.tab-btn.active { background: var(--bn-forest); color: #fff; box-shadow: none; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ------------------------------------------------------------ stat cards -- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-3);
}
.stat {
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--accent-ink); line-height: 1.2; }
.stat-label { font-size: .82rem; color: var(--muted); }

/* ----------------------------------------------------------- detail grid -- */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
}
.detail-grid > div {
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  overflow-wrap: anywhere;
}
.detail-grid span { display: block; font-size: .76rem; color: var(--muted); margin-bottom: .2rem; }
.detail-grid strong { display: block; font-size: .9rem; }
.detail-grid p { margin: 0; font-size: .88rem; white-space: pre-wrap; line-height: 1.75; }
.detail-grid .detail-wide { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ auth -- */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-5);
  background:
    radial-gradient(760px 380px at 85% 5%, rgba(15, 122, 90, .12), transparent 60%),
    radial-gradient(620px 320px at 5% 95%, rgba(31, 111, 154, .1), transparent 55%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-lg);
}
.auth-head { margin-bottom: var(--sp-4); }
.auth-head h1 { font-size: 1.25rem; margin-bottom: .2rem; }
.auth-head .muted { font-size: .86rem; }
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.login-back {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .84rem;
  color: var(--muted);
  text-decoration: none;
}
.login-back:hover { color: var(--accent); }
.auth-card .form-grid { grid-template-columns: 1fr; margin-bottom: var(--sp-4); }
.auth-card .btn.primary { width: 100%; min-height: 44px; margin-top: var(--sp-2); }
.auth-hint {
  margin-top: var(--sp-3);
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
}

/* Legacy login markup support */
.login-box { width: min(420px, 100%); margin: 8vh auto; }

/* Portal layout lives in /design/aurora.css */

/* ------------------------------------------------------------- utilities -- */

.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.hidden { display: none !important; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-4) var(--sp-5); }
.contact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--sp-4); align-items: end; margin-bottom: var(--sp-5); }

/* --------------------------------------------------------------- profile -- */

.profile-layout {
  display: grid;
  gap: var(--sp-5);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-5);
  background:
    linear-gradient(135deg, rgba(15, 122, 90, .12), rgba(15, 122, 90, .02) 42%, var(--surface) 70%),
    var(--surface);
  border: 1px solid rgba(15, 122, 90, .14);
}

.profile-avatar-wrap {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: .55rem;
  max-width: 12rem;
}
.profile-avatar-hit {
  position: relative;
  display: grid;
  justify-items: center;
  gap: .55rem;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: center;
}
.profile-avatar-hit:hover .profile-avatar,
.profile-avatar-hit:focus-within .profile-avatar {
  box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 24px rgba(11, 92, 68, .28);
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #14936d, #0b5c44);
  box-shadow: 0 10px 24px rgba(11, 92, 68, .28);
  border: 3px solid #fff;
  transition: box-shadow .15s ease;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: .25rem .7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
}
.profile-avatar-hit:hover .profile-avatar-edit {
  background: var(--surface-soft);
  border-color: var(--muted);
}

/* ── Club member drawer ── */
#memberDrawer .bn-modal-panel.is-wide {
  max-width: 720px;
}
#memberDrawer .member-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-top: .25rem;
}
#memberDrawer .member-modal-body > #memberTabs,
#memberDrawer .member-tabs {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  align-self: flex-start;
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: 4px;
  margin: 0;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  height: auto;
  min-height: 42px;
  max-height: none;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  overflow: visible;
  box-sizing: border-box;
}
#memberDrawer .member-tabs .tab-btn {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  min-height: 34px;
  height: auto;
  max-height: none;
  line-height: 1.25;
  border-radius: 999px;
  padding: .45rem .95rem;
  font-size: .85rem;
  font-weight: 700;
  overflow: visible;
}
#memberDrawer .member-hero {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(15, 122, 90, .08), rgba(15, 122, 90, .02) 55%, var(--surface) 100%),
    var(--surface-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
}
#memberDrawer .member-hero-avatar {
  flex: 0 0 auto;
}
#memberDrawer .member-avatar {
  width: 84px;
  height: 84px;
  font-size: 1.25rem;
}
#memberDrawer .member-avatar-hit {
  gap: .35rem;
}
#memberDrawer .member-avatar-hit .profile-avatar-edit {
  font-size: .72rem;
  padding: .18rem .55rem;
}
#memberDrawer .member-hero-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding-top: .15rem;
}
#memberDrawer .member-hero-kicker {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
#memberDrawer .member-role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
#memberDrawer .member-role-pill {
  min-height: 36px;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
#memberDrawer .member-role-pill:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft);
}
#memberDrawer .member-role-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 92, 68, .22);
}
#memberDrawer .member-role-pill:disabled {
  opacity: .55;
  cursor: not-allowed;
}
#memberDrawer .member-hero-hint {
  margin: 0;
  font-size: .76rem;
  color: var(--muted);
  line-height: 1.5;
}
#memberDrawer .member-inline-ok,
#memberDrawer .member-inline-err {
  margin: 0;
  font-size: .78rem;
}
#memberDrawer .member-section + .member-section {
  margin-top: var(--sp-3);
}
#memberDrawer .member-section-title {
  margin: 0 0 var(--sp-3);
  font-size: .84rem;
  font-weight: 800;
  color: var(--ink);
}
#memberDrawer .member-form-grid,
#memberDrawer .member-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3) var(--sp-4);
}
#memberDrawer .member-form-grid .col-full,
#memberDrawer .member-readonly-grid .col-full,
#memberDrawer .member-readonly-head {
  grid-column: 1 / -1;
}
#memberDrawer .member-readonly-head {
  padding-bottom: .15rem;
}
#memberDrawer .member-pass-banner {
  margin-top: var(--sp-3);
  padding: .75rem .9rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-soft));
  border: 1px dashed color-mix(in srgb, var(--accent) 24%, var(--line));
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Compact HR profile tab */
#memberDrawer .hr-profile-compact {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
#memberDrawer .hr-profile-head {
  padding: .7rem .85rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-soft));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
}
#memberDrawer .hr-profile-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
}
#memberDrawer .hr-profile-title-row strong {
  font-size: .95rem;
  font-weight: 800;
}
#memberDrawer .hr-chip-muted {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
}
#memberDrawer .hr-profile-summary {
  margin: .35rem 0 0;
  font-size: .75rem;
  color: var(--muted);
  line-height: 1.45;
  direction: ltr;
  text-align: start;
}
#memberDrawer .hr-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
#memberDrawer .hr-stat-card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .65rem .75rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
#memberDrawer .hr-stat-card--soft {
  background: var(--surface-soft);
}
#memberDrawer .hr-stat-card label {
  margin: 0;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
}
#memberDrawer .hr-stat-row {
  display: flex;
  align-items: baseline;
  gap: .35rem;
}
#memberDrawer .hr-stat-card input[type="number"],
#memberDrawer .hr-stat-card input:disabled,
#memberDrawer .hr-stat-card select:disabled {
  width: 100%;
  margin: 0;
  padding: .2rem 0;
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  box-shadow: none;
}
#memberDrawer .hr-stat-card select:disabled {
  font-size: .88rem;
  font-weight: 700;
  appearance: none;
  pointer-events: none;
}
#memberDrawer .hr-unit {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  flex: 0 0 auto;
}
#memberDrawer .hr-stat-meta {
  font-size: .7rem;
  color: var(--muted);
  line-height: 1.35;
}
#memberDrawer .hr-zones-block {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
#memberDrawer .hr-zones-label {
  font-size: .72rem;
  font-weight: 800;
  color: var(--muted);
}
#memberDrawer .hr-zone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
#memberDrawer .hr-zone-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--z, var(--accent)) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--z, var(--accent)) 28%, var(--line));
  font-size: .78rem;
  line-height: 1;
}
#memberDrawer .hr-zone-chip em {
  font-style: normal;
  font-weight: 800;
  color: var(--z, var(--accent));
  font-size: .72rem;
}
#memberDrawer .hr-zone-chip b {
  font-weight: 700;
  color: var(--ink);
}
#memberDrawer .hr-zone-empty {
  font-size: .8rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  #memberDrawer .member-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  #memberDrawer .member-hero-main {
    align-items: center;
    width: 100%;
  }
  #memberDrawer .member-role-pills {
    justify-content: center;
  }
  #memberDrawer .member-form-grid,
  #memberDrawer .hr-stat-grid {
    grid-template-columns: 1fr;
  }
}

.profile-identity-body { min-width: 0; }
.profile-identity-body h2 { font-size: 1.25rem; margin-bottom: .15rem; }
.profile-identity-body .muted { color: var(--muted); direction: ltr; text-align: start; }
.profile-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: var(--sp-3); }

.profile-security-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr);
  gap: var(--sp-5);
  align-items: start;
}

.profile-pass-form { grid-template-columns: 1fr; }
.profile-pass-form .form-actions { margin-top: var(--sp-2); }

.profile-policy {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
}

.profile-policy-head { margin-bottom: var(--sp-4); }
.profile-policy-head h3 {
  font-size: .95rem;
  margin-bottom: .25rem;
}
.profile-policy-head .muted {
  font-size: .82rem;
  color: var(--muted);
}

.profile-policy-choices {
  margin: var(--sp-3) 0 var(--sp-4);
}

.profile-policy .form-actions { margin-top: var(--sp-3); }

.profile-policy h3 {
  font-size: .92rem;
  margin-bottom: var(--sp-3);
}

.profile-policy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}

.profile-policy-list li {
  position: relative;
  padding-inline-start: 1.55rem;
  color: var(--muted);
  font-size: .88rem;
}

.profile-policy-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .35rem;
  width: .85rem;
  height: .85rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
}

.profile-policy-list li.is-ok { color: var(--accent-ink); }
.profile-policy-list li.is-ok::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--surface);
}

.profile-policy-list li.is-bad { color: var(--danger); }
.profile-policy-list li.is-bad::before {
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 900px) {
  .wrap { padding: var(--sp-4) var(--sp-3) var(--sp-5); }
  .card { padding: var(--sp-4) var(--sp-3); border-radius: var(--radius); }
  .top { padding: 0 var(--sp-3); gap: var(--sp-2); flex-wrap: wrap; }
  .nav-toggle {
    display: inline-flex;
    min-height: 34px;
    padding: .2rem .6rem;
  }
  .top nav {
    order: 3;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: var(--sp-3);
  }
  .top.nav-open nav { display: flex; }
  .top nav a { padding: .5rem .7rem; }
  .actions { margin-inline-start: auto; }
  .user { display: none; }
  .profile-security-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .page-head { align-items: flex-start; }
  .toolbar .field { max-width: none; }
  th, td { padding: .5rem .55rem; }
  .profile-identity { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   Classes multi-view layout
   ═══════════════════════════════════════════════════════════ */

.cls-wrap { --cls-sidebar-w: 220px; }

/* Sidebar + main layout */
.cls-layout {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.cls-list-row { cursor: pointer; }
.cls-list-row:hover { background: var(--accent-soft); }

/* ── Sidebar ── */
.cls-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  position: sticky;
  top: calc(var(--bn-header-h) + 12px);
  max-height: calc(100vh - var(--bn-header-h) - 24px);
  overflow-y: auto;
}

/* Mini calendar */
.cls-mini-cal { font-size: 0.78rem; }
.mini-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 0.82rem;
  margin-bottom: var(--sp-2);
}
.mini-cal-nav {
  width: 28px; height: 28px;
  min-width: 28px; min-height: 28px;
  padding: 0; border: 0; background: transparent;
  box-shadow: none; color: var(--muted); font-size: 1.1rem;
  border-radius: 8px; cursor: pointer;
  display: grid; place-items: center;
}
.mini-cal-nav:hover { background: var(--accent-soft); color: var(--bn-forest); }
.mini-cal-title { font-weight: 800; color: var(--ink); text-align: center; font-size: 0.82rem; }
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}
.mini-cal-head {
  text-align: center;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--muted);
  padding: 2px 0 4px;
}
button.mini-cal-day {
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 1;
  min-width: 0; min-height: 0;
  padding: 0; border: 0; border-radius: 50%;
  background: transparent; box-shadow: none;
  color: var(--ink); font-size: 0.72rem; font-weight: 600;
  cursor: pointer;
}
button.mini-cal-day:hover { background: var(--accent-soft); }
button.mini-cal-day.is-today { color: var(--bn-forest); font-weight: 800; }
button.mini-cal-day.is-selected {
  background: var(--bn-forest); color: #fff;
}

/* Sidebar filter groups */
.cls-filter-group { display: flex; flex-direction: column; gap: 4px; }
.cls-filter-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cls-filter-select {
  width: 100%; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface-soft);
  font: inherit; font-size: 0.78rem; color: var(--ink); cursor: pointer;
  min-height: 0;
}
.cls-filter-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.cls-pill { display: inline-flex; align-items: center; cursor: pointer; }
.cls-pill input { display: none; }
.cls-pill span {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-soft);
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.cls-pill input:checked + span {
  background: var(--bn-forest); color: #fff; border-color: var(--bn-forest);
}

/* Legend */
.cls-legend { display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.cls-legend-item { display: flex; align-items: center; gap: 7px; font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.cls-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Main panel (all sections share this) ── */
.cls-main { min-width: 0; }

/* ── Week view ── */
.cls-week-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  overflow: hidden;
  padding: var(--sp-2) var(--sp-3) 0;
}
.cls-week-card > .class-calendar-toolbar,
.cls-day-card > .class-calendar-toolbar {
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--sp-1);
  margin-bottom: 0;
}
.cls-week-range { font-weight: 800; font-size: 0.92rem; min-width: 12rem; text-align: center; }
.cls-week-grid-wrap { overflow: auto; flex: 1 1 auto; }

.wk-grid {
  --wk-hour-h: 52px;
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(0, 1fr));
  min-width: 580px;
}
.wk-gutter-head, .wk-day-head {
  padding: 6px 4px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface-soft);
  position: sticky; top: 0; z-index: 2;
}
.wk-gutter-head { border-left: 0; }
.wk-day-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wk-day-head.is-today { background: var(--accent-soft); }
.wk-day-name { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.wk-day-num { font-size: 0.9rem; font-weight: 800; color: var(--ink); }
.wk-day-head.is-today .wk-day-num { color: var(--bn-forest); }

.wk-time {
  padding: 4px 4px 0;
  font-size: 0.65rem; font-weight: 700; color: var(--muted);
  text-align: center; border-bottom: 1px solid var(--line);
  line-height: 1; height: var(--wk-hour-h, 52px); display: flex; align-items: flex-start; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.wk-time.is-gap {
  height: 32px;
  align-items: center;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.15;
  padding: 2px 3px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
  opacity: 0.9;
}
.wk-cell {
  position: relative;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  height: var(--wk-hour-h, 52px);
  padding: 0;
  overflow: visible;
  cursor: pointer;
}
.wk-cell.is-gap {
  height: 32px;
  cursor: default;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}
.wk-cell:hover { background: color-mix(in srgb, var(--bn-forest) 4%, var(--surface)); }
.wk-cell.is-gap:hover { background: color-mix(in srgb, var(--surface-soft) 70%, transparent); }
.wk-event {
  position: absolute;
  top: calc(var(--wk-top, 0) * var(--wk-hour-h, 52px));
  left: 2px;
  right: 2px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: calc(var(--wk-h, 1) * var(--wk-hour-h, 52px));
  min-height: calc(0.25 * var(--wk-hour-h, 52px));
  box-sizing: border-box;
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  border-inline-start: 3px solid var(--ev-color, #1f6f9a);
  background: color-mix(in srgb, var(--ev-color, #1f6f9a) 14%, white);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  width: auto;
  text-align: start;
  min-width: 0;
  box-shadow: none;
  overflow: hidden;
}
.wk-ev-title { font-size: 0.7rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wk-ev-time { font-size: 0.62rem; color: var(--muted); }
.wk-event:hover { filter: brightness(0.95); z-index: 3; }

/* ── Day view ── */
.cls-day-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3) 0; overflow: hidden; }
.cls-day-label { font-weight: 800; font-size: 0.92rem; min-width: 10rem; text-align: center; }
.cls-day-week-strip {
  display: flex; overflow-x: auto;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.day-strip-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  flex: 1; min-width: 44px; padding: 8px 4px;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  cursor: pointer; color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  transition: background .12s, border-color .12s;
}
.day-strip-btn:hover { background: var(--accent-soft); }
.day-strip-btn.is-today { color: var(--bn-forest); }
.day-strip-btn.is-selected { border-bottom-color: var(--bn-forest); color: var(--bn-forest); }
.day-strip-name { font-size: 0.75rem; font-weight: 700; }
.day-strip-num {
  font-size: 1rem; font-weight: 800;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
}
.day-strip-btn.is-selected .day-strip-num { background: var(--bn-forest); color: #fff; }

.cls-day-body { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.cls-day-empty { color: var(--muted); font-size: 0.88rem; text-align: center; padding: var(--sp-5); }
.cls-day-event {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  border-inline-start: 4px solid var(--ev-color, #1f6f9a);
  background: color-mix(in srgb, var(--ev-color, #1f6f9a) 6%, var(--surface));
  overflow: visible; transition: box-shadow .14s;
}
.cls-day-event:hover { box-shadow: var(--shadow); }
.cls-day-ev-header {
  display: grid; grid-template-columns: 80px 1fr auto;
  align-items: start; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
}
.cls-day-ev-time { font-size: 0.78rem; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; padding-top: 2px; }
.cls-day-ev-body {
  display: flex; flex-direction: row; align-items: center;
  gap: var(--sp-3); min-width: 0; flex: 1;
}
.cls-day-ev-main {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 2px;
}
.cls-day-ev-title-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cls-day-ev-title-row strong { font-size: 0.88rem; }
.cls-day-ev-title-row .badge { font-size: 0.65rem; padding: 1px 6px; }
.cls-day-ev-meta { font-size: 0.75rem; color: var(--muted); }

/* roster chips inline in day event body */
.cls-day-ev-roster {
  flex: 1 1 auto;
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: flex-end;
  gap: 4px 6px;
  min-width: 0;
  padding: 0;
}
.cls-day-roster-chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--ev-color, #1f6f9a) 18%, white);
  color: var(--ink); font-size: 0.72rem; font-weight: 700; line-height: 1.35;
  border: 1px solid color-mix(in srgb, var(--ev-color, #1f6f9a) 30%, transparent);
  white-space: nowrap;
}
.cls-day-ev-roster-loading { font-size: 0.72rem; color: var(--muted); }
.cls-day-roster-empty { font-size: 0.72rem; color: var(--muted); }
.cls-day-add-btn { margin: var(--sp-2) var(--sp-3) var(--sp-3); align-self: flex-start; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .cls-layout { grid-template-columns: 1fr; }
  .cls-sidebar { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .cls-mini-cal { display: none; }
}
@media (max-width: 640px) {
  .cls-layout { grid-template-columns: 1fr; }
  .cls-sidebar { display: none; }
  .wk-grid { grid-template-columns: 40px repeat(7, minmax(40px, 1fr)); }
  .cls-day-ev-body { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
  .cls-day-ev-roster { justify-content: flex-start; }
  .cls-day-ev-header { grid-template-columns: 72px 1fr auto; }
}
