/*
 * Bespoke Cloud HR System — Admin UI
 * Brand: Careviel — Navy #1A2D4D · Sage #7FB69B · Cream #FAFAF7
 * The variable names below are preserved (--blue is the brand navy, --green is the
 * sage accent) so every existing UI rule recolours automatically.
 */

/* ── Brand tokens ─────────────────────────────────────────────────────────── */
:root {
  /* "Blue" family — repurposed as Careviel Navy. Names kept for backward compat. */
  --blue:       #1A2D4D;  /* Careviel navy (wordmark) */
  --blue-md:    #2B4A78;  /* Hover / link */
  --blue-dk:    #142340;  /* Dark navy */
  --blue-xdk:   #0F1E36;  /* Sidebar deepest */
  --blue-lt:    #C9D4E5;  /* Soft navy tint */
  --blue-pale:  #EDF1F7;  /* Page wash, button-outline hover bg */
  --blue-nav:   #0F1E36;  /* Sidebar bg — deepest navy for white logo contrast */

  /* "Green" family — repurposed as Careviel Sage. Names kept for backward compat. */
  --green:      #7FB69B;  /* Careviel sage accent */
  --green-dk:   #5A8F77;  /* Darker sage */
  --green-lt:   #B9D7C7;  /* Light sage */
  --green-pale: #E6F0EB;  /* Soft sage tint, badge bg */

  /* Teal — kept as a secondary support hue, harmonised with sage */
  --teal:       #4A9D8E;
  --teal-dark:  #2D7A6D;

  --white:      #FAFAF7;  /* Careviel cream surface */
  --surface:    #FFFFFF;
  --ink:        #0F1E36;  /* Body text = deep navy, not slate */
  --muted:      #6B7280;
  --subtle:     #9CA3AF;

  --ok:         #7FB69B;  /* "Compliant" pill */
  --ok-bg:      #E6F0EB;
  --warn:       #B45309;
  --warn-bg:    #FEF3C7;
  --danger:     #B91C1C;
  --danger-bg:  #FEE2E2;
  --info-bg:    #EDF1F7;

  --border:     #E5E7EB;
  --bord-md:    #D1D5DB;

  --sb-bg:      var(--brand-sb-bg, #1A2D4D);          /* Brand-overridable */
  --sb-text:    var(--brand-sb-text, #D1D5DB);         /* Brand-overridable */
  --sb-text-dim:#9CA3AF;          /* For section labels — readable but subdued */
  --sb-hover:   rgba(255,255,255,.07);
  --sb-active:  color-mix(in srgb, var(--brand-sb-accent, #7FB69B) 22%, transparent); /* Sage glow (brand-overridable) */
  --sb-accent:  var(--brand-sb-accent, #7FB69B);
  --brand-font-stack: var(--brand-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);

  --r:          10px;
  --r-sm:       7px;
  --r-lg:       14px;

  --shadow:     0 1px 3px rgba(15,30,54,.06), 0 4px 12px rgba(15,30,54,.04);
  --shadow-md:  0 4px 20px rgba(15,30,54,.10);
  --shadow-lg:  0 8px 40px rgba(15,30,54,.14);

  --font:   var(--brand-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);
  --font-ui:var(--brand-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
#bc-admin-root, #bc-admin-root * { box-sizing: border-box; font-family: var(--font); }
#bc-admin-root h1, #bc-admin-root h2, #bc-admin-root h3 {
  font-family: var(--font-ui); padding: 0; margin: 0; border: none;
}
#bc-admin-root a  { color: inherit; text-decoration: none; }
#bc-admin-root p  { margin: 0; }
#bc-admin-root input, #bc-admin-root select, #bc-admin-root textarea, #bc-admin-root button {
  font-family: inherit;
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.bc-layout    { display: flex; height: calc(100vh - 32px); overflow: hidden; background: var(--white); }
@media (max-width:782px) { .bc-layout { height: calc(100vh - 46px); } }

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR — premium dark navy with clear visual hierarchy
══════════════════════════════════════════════════════════════════════════ */
.bc-sidebar {
  width: 252px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--sb-bg);
  overflow-y: auto; border-right: 1px solid rgba(255,255,255,.06);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
}
.bc-sidebar::-webkit-scrollbar { width: 4px; }
.bc-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.bc-sidebar-top {
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(180deg, #233659 0%, #1A2D4D 100%);
  flex-shrink: 0;
}
.bc-sidebar-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #1A2D4D, #7FB69B);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(16,185,129,.3);
}
.bc-wordmark {
  font-family: var(--font-ui); font-weight: 700; font-size: 13.5px;
  color: #F8FAFC; letter-spacing: -.01em; line-height: 1.2;
}
.bc-wordmark small {
  display: block; font-size: 9px; font-weight: 500;
  color: #B9C5D5; text-transform: uppercase; letter-spacing: .08em; margin-top: 3px;
}

/* Nav section labels */
.bc-nav-section {
  font-size: 9.5px; font-weight: 700; color: var(--sb-text-dim);
  text-transform: uppercase; letter-spacing: .14em;
  padding: 16px 20px 5px;
}

/* Nav items */
.bc-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; font-size: 13px; font-weight: 500;
  color: var(--sb-text);
  text-decoration: none !important; cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .12s; position: relative; border-radius: 0;
  letter-spacing: -.01em;
}
.bc-nav-item:hover {
  background: var(--sb-hover);
  color: #FFFFFF !important;
  border-left-color: rgba(127,182,155,.45);
}
.bc-nav-item.act {
  background: var(--sb-active);
  color: #FFFFFF !important;
  border-left-color: var(--sb-accent);
  font-weight: 600;
}
.bc-nav-item.act .bc-nav-icon { filter: brightness(1.2); }
.bc-nav-icon { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; opacity: .9; }
.bc-nav-item.act .bc-nav-icon { opacity: 1; }

.bc-sidebar-footer {
  margin-top: auto; padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 10px; color: var(--sb-text-dim); line-height: 1.8; flex-shrink: 0;
}
.bc-sidebar-footer a { color: #7FB69B; font-weight: 600; }

/* ══════════════════════════════════════════════════════════════════════════
   MAIN AREA
══════════════════════════════════════════════════════════════════════════ */
.bc-main-wrap { flex: 1; overflow: hidden; display: flex; flex-direction: column; background: var(--white); }

.bc-topbar {
  height: 54px; background: var(--surface); flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 26px; gap: 14px;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.bc-topbar-title {
  font-family: var(--font-ui); font-size: 14px; font-weight: 700;
  color: var(--ink); letter-spacing: -.01em;
}
.bc-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ── Sign out button — styled here too so it works in wp-admin context ─── */
.hr-signout {
  background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
  border: 2px solid #B91C1C;
  border-radius: 10px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .3px;
  padding: 9px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(220,38,38,0.35), 0 1px 3px rgba(0,0,0,0.1);
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
.hr-signout:hover {
  background: linear-gradient(180deg, #DC2626 0%, #B91C1C 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220,38,38,0.45), 0 1px 3px rgba(0,0,0,0.12);
}
.hr-signout:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(220,38,38,0.35);
}
.bc-topbar-user  { font-size: 12px; color: var(--muted); }
.bc-topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: 11px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(30,58,138,.25);
}
.bc-main { flex: 1; overflow-y: auto; padding: 24px 28px; min-height: 0; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.bc-ph {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.bc-pt {
  font-family: var(--font-ui); font-size: 22px; font-weight: 700;
  color: var(--ink); letter-spacing: -.4px;
}
.bc-ps { font-size: 13px; color: var(--muted); margin-top: 3px; }
.bc-btn-row { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════════════ */
.bc-btn {
  display: inline-flex !important; align-items: center !important;
  justify-content: center !important; gap: 6px;
  padding: 8px 18px !important; font-size: 13px !important; font-weight: 600 !important;
  border-radius: var(--r-sm) !important; cursor: pointer !important;
  border: 1.5px solid transparent !important;
  font-family: var(--font-ui) !important;
  transition: all .13s; white-space: nowrap; min-height: 36px;
  line-height: 1.4 !important; outline: none !important;
  box-shadow: none !important;
}
.bc-btn:hover:not(:disabled)  { transform: translateY(-1px); box-shadow: var(--shadow) !important; }
.bc-btn:active:not(:disabled) { transform: scale(.98) !important; }
.bc-btn:disabled               { opacity: .4 !important; cursor: not-allowed !important; transform: none !important; }

.bc-btn-p  {
  background: linear-gradient(135deg, var(--green), var(--green-dk)) !important;
  color: #fff !important; border-color: var(--green-dk) !important;
}
.bc-btn-b  {
  background: linear-gradient(135deg, var(--blue-md), var(--blue)) !important;
  color: #fff !important; border-color: var(--blue) !important;
}
.bc-btn-o  {
  background: var(--surface) !important; color: var(--ink) !important;
  border-color: var(--bord-md) !important;
}
.bc-btn-o:hover { background: var(--blue-pale) !important; border-color: var(--blue-md) !important; }
.bc-btn-danger {
  background: #FEF2F2 !important; color: var(--danger) !important;
  border-color: rgba(220,38,38,.25) !important;
}
.bc-btn-danger:hover { background: #FEE2E2 !important; }
.bc-btn-sm  { padding: 5px 12px !important; font-size: 12px !important; min-height: 30px; }

/* ══════════════════════════════════════════════════════════════════════════
   STATS / KPI CARDS
══════════════════════════════════════════════════════════════════════════ */
.bc-stats {
  display: grid; grid-template-columns: repeat(auto-fill,minmax(145px,1fr));
  gap: 14px; margin-bottom: 24px;
}
.bc-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px 20px;
  border-top: 3px solid var(--border);
  transition: box-shadow .14s, transform .12s;
  box-shadow: var(--shadow);
}
.bc-stat:hover   { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bc-stat.green   { border-top-color: var(--green); }
.bc-stat.blue    { border-top-color: var(--blue-md); }
.bc-stat.ok      { border-top-color: var(--ok); }
.bc-stat.warn    { border-top-color: var(--warn); }
.bc-stat.danger  { border-top-color: var(--danger); }
.bc-sl {
  font-size: 10.5px; color: var(--muted); font-weight: 700;
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em;
}
.bc-sv {
  font-family: var(--font-ui); font-size: 30px; font-weight: 800;
  color: var(--ink); line-height: 1;
}
.bc-ss { font-size: 11px; color: var(--subtle); margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════════════════ */
.bc-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
  margin-bottom: 18px; box-shadow: var(--shadow);
}
.bc-ch {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  background: #FAFBFF; gap: 10px;
}
.bc-ct {
  font-family: var(--font-ui); font-size: 14px; font-weight: 700;
  color: var(--ink);
}

/* ══════════════════════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════════════════════ */
.bc-table { width: 100%; border-collapse: collapse; }
.bc-table th {
  text-align: left; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 10px 18px;
  border-bottom: 2px solid var(--border);
  background: #F8FAFC; white-space: nowrap;
}
.bc-table td {
  padding: 11px 18px; font-size: 13px;
  border-bottom: 1px solid rgba(226,232,240,.6);
  vertical-align: middle;
}
.bc-table tr:last-child td { border-bottom: none; }
.bc-table tr:hover td      { background: #F8FAFF; }

/* ── Pills ───────────────────────────────────────────────────────────────── */
.bc-pill     { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; font-family: var(--font-ui); }
.bc-p-ok     { background: #DCFCE7; color: #166534; }
.bc-p-warn   { background: #FEF3C7; color: #92400E; }
.bc-p-danger { background: #FEE2E2; color: #991B1B; }
.bc-p-blue   { background: #DDE4ED; color: #1E40AF; }
.bc-p-green  { background: #DCFCE7; color: #166534; }
.bc-p-gray   { background: #F1F5F9; color: #475569; }

/* ── Worker avatar ───────────────────────────────────────────────────────── */
.bc-wa {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: 12px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}
.bc-wr { display: flex; align-items: center; gap: 10px; }
.bc-wn { font-size: 13px; font-weight: 600; color: var(--ink); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.bc-fg   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 20px; }
.bc-fgl  { display: flex; flex-direction: column; gap: 5px; }
.bc-fgl.full { grid-column: 1 / -1; }
.bc-fgl label {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .04em;
}
.bc-fgl input, .bc-fgl select, .bc-fgl textarea {
  height: 38px !important; border: 1.5px solid var(--border) !important;
  border-radius: var(--r-sm) !important; padding: 0 12px !important;
  font-size: 13px !important; color: var(--ink) !important;
  background: var(--surface) !important; font-family: inherit !important;
  outline: none; transition: border-color .14s, box-shadow .14s;
  box-shadow: none !important; width: 100%;
}
.bc-fgl textarea { height: auto !important; padding: 10px 12px !important; resize: vertical; }
.bc-fgl input:focus, .bc-fgl select:focus {
  border-color: var(--blue-md) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}
.bc-ff {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  background: #F8FAFC; align-items: center;
}
.bc-req { color: var(--danger); font-size: 11px; }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.bc-filter-bar    { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 16px; }
.bc-filter-search {
  flex: 1; min-width: 200px; height: 38px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 0 13px; font-size: 13px; font-family: inherit;
  background: var(--surface); outline: none; color: var(--ink);
  transition: border-color .14s, box-shadow .14s;
}
.bc-filter-search:focus { border-color: var(--blue-md); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.bc-filter-select {
  height: 38px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 0 11px; font-size: 13px; font-family: inherit;
  background: var(--surface); color: var(--ink); outline: none;
  cursor: pointer;
}
.bc-filter-select:focus { border-color: var(--blue-md); }

/* ── Panel (full-page sub-view) ───────────────────────────────────────────── */
.bc-panel {
  animation: bc-panel-in .16s ease; margin: -24px -28px;
  min-height: calc(100vh - 54px - 32px); display: flex; flex-direction: column;
  background: var(--white);
}
@keyframes bc-panel-in { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }
.bc-panel-header {
  display: flex; align-items: center; gap: 14px; padding: 18px 26px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--blue) 100%);
  border-bottom: 3px solid var(--green); flex-shrink: 0;
}
.bc-panel-back {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px;
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: #fff !important;
  cursor: pointer; font-family: inherit; white-space: nowrap; flex-shrink: 0; transition: background .13s;
}
.bc-panel-back:hover { background: rgba(255,255,255,.2) !important; }
.bc-panel-header .bc-pt { color: #fff !important; font-size: 20px !important; }
.bc-panel-header .bc-ps { color: rgba(255,255,255,.65) !important; }
.bc-panel-body   { padding: 26px; flex: 1; }
.bc-panel-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 26px; background: var(--surface);
  border-top: 1px solid var(--border); flex-shrink: 0;
  position: sticky; bottom: 0; box-shadow: 0 -3px 12px rgba(15,23,42,.07);
}

/* ── Grids ────────────────────────────────────────────────────────────────── */
.bc-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.bc-g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media(max-width:900px) { .bc-g2, .bc-g3 { grid-template-columns: 1fr !important; } }

/* ── Rota ─────────────────────────────────────────────────────────────────── */
.bc-rota-wrap  { overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.bc-rota-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bc-rota-table th { background: #F8FAFC; padding: 10px 10px; border: 1px solid var(--border); font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; white-space: nowrap; font-family: var(--font-ui); }
.bc-rota-table th.wc { text-align: left; }
.bc-rota-table td { padding: 6px 6px; border: 1px solid rgba(226,232,240,.6); text-align: center; vertical-align: middle; min-width: 80px; }
.bc-rota-table td.wc { text-align: left; font-weight: 600; white-space: nowrap; padding: 8px 14px; background: #F8FAFC; }

.bc-rota-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 42px; border-radius: var(--r-sm); cursor: pointer;
  transition: opacity .12s, transform .1s; user-select: none;
}
.bc-rota-cell:hover  { opacity: .82; transform: scale(.97); }
.bc-rota-cell:active { transform: scale(.94); }
.bc-rota-empty {
  background: #F8FAFC; border: 1.5px dashed #CBD5E1;
  font-size: 13px; font-weight: 600; color: #94A3B8; width: 100%;
}
.bc-rota-empty:hover { background: var(--blue-pale); border-color: var(--blue-md); color: var(--blue-md); }
.bc-rota-shift { padding: 5px 8px; width: 100%; }
.bc-rota-label { font-size: 11.5px; font-weight: 700; font-family: var(--font-ui); line-height: 1.3; }
.bc-rota-time  { font-size: 9.5px; opacity: .7; margin-top: 1px; font-family: var(--font-ui); }
.bc-rota-loc   { font-size: 9px; opacity: .65; margin-top: 2px; font-family: var(--font-ui);
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }

/* ── Skeleton ─────────────────────────────────────────────────────────────── */
.bc-sk {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%; animation: bc-shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes bc-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.bc-sk-title { height: 28px; width: 260px; margin-bottom: 20px; }
.bc-sk-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.bc-sk-card  { height: 88px; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.bc-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  padding: 12px 20px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; color: #fff;
  box-shadow: var(--shadow-lg); animation: bc-panel-in .2s ease;
  max-width: 360px; word-break: break-word;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.bc-alert   { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: var(--r); font-size: 13px; margin-bottom: 16px; line-height: 1.6; border-left: 4px solid; }
.bc-alert-d { background: #FEF2F2; border-color: var(--danger);  color: #991B1B; }
.bc-alert-w { background: #FFFBEB; border-color: var(--warn);    color: #92400E; }
.bc-alert-i { background: #EDF1F7; border-color: var(--blue-md); color: var(--blue); }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.bc-modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: bc-panel-in .14s ease; backdrop-filter: blur(2px);
}
.bc-modal {
  background: var(--surface); border-radius: var(--r-lg);
  width: 480px; max-width: 96vw; max-height: 92vh;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  overflow: hidden; border: 1px solid var(--border);
}
.bc-modal-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  background: #F8FAFC; flex-shrink: 0;
}
.bc-modal-title { font-family: var(--font-ui); font-size: 16px; font-weight: 700; color: var(--ink); }
.bc-modal-close {
  background: none; border: none; font-size: 17px; color: var(--muted);
  cursor: pointer; padding: 6px 8px; border-radius: 6px; line-height: 1;
  transition: background .12s;
}
.bc-modal-close:hover { background: #F1F5F9; color: var(--ink); }
.bc-modal-body   { padding: 22px; overflow-y: auto; flex: 1; }
.bc-modal-footer {
  display: flex; align-items: center; gap: 8px; padding: 16px 22px;
  border-top: 1px solid var(--border); background: #F8FAFC; flex-shrink: 0;
}

/* ── Sponsor toggle ───────────────────────────────────────────────────────── */
.bc-sponsor-opts { display: flex; gap: 10px; margin: 10px 0; }
.bc-sponsor-opt  { flex: 1; border: 2px solid var(--border); border-radius: var(--r); cursor: pointer; padding: 14px 16px; transition: all .14s; }
.bc-sponsor-opt:hover      { border-color: var(--blue-md); }
.bc-sponsor-opt.selected   { border-color: var(--blue-md); background: var(--blue-pale); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.bc-sponsor-opt-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 4px; font-family: var(--font-ui); }
.bc-sponsor-opt-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── Toggle switch ────────────────────────────────────────────────────────── */
.bc-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.bc-toggle input { opacity: 0; width: 0; height: 0; }
.bc-toggle-sl { position: absolute; cursor: pointer; inset: 0; background: var(--bord-md); border-radius: 999px; transition: .18s; }
.bc-toggle-sl::before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; bottom: 2px; background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.bc-toggle input:checked + .bc-toggle-sl { background: var(--green); }
.bc-toggle input:checked + .bc-toggle-sl::before { transform: translateX(18px); }

/* ── Compliance bars ──────────────────────────────────────────────────────── */
.bc-bar-bg    { height: 8px; background: #F1F5F9; border-radius: 999px; overflow: hidden; }
.bc-bar-fill  { height: 100%; border-radius: 999px; transition: width .5s; }
.bc-bar-ok    { background: linear-gradient(90deg, var(--green), #34D399); }
.bc-bar-warn  { background: linear-gradient(90deg, var(--warn), #FBBF24); }
.bc-bar-danger{ background: linear-gradient(90deg, var(--danger), #F87171); }

/* ── Geofence map area ────────────────────────────────────────────────────── */
.bc-map-card  { height: 480px; display: flex; flex-direction: column; }
.bc-map-area  { flex: 1; background: #E8F0FE; overflow: hidden; border-radius: 0 0 var(--r) var(--r); }
.bc-fence-item{ display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.bc-fence-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.bc-empty {
  text-align: center; padding: 52px 24px; color: var(--muted);
}
.bc-empty > div:first-child { font-size: 42px; margin-bottom: 14px; }
.bc-empty .bc-ev { font-family: var(--font-ui); font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .bc-sidebar, .bc-topbar { display: none !important; }
  .bc-layout, .bc-main-wrap { display: block !important; }
  .bc-card { box-shadow: none !important; border: 1px solid #ddd !important; page-break-inside: avoid; }
}

/* ── Batch selection ──────────────────────────────────────────────────────── */
.bc-row-selected td { background: #EDF1F7 !important; }
.bc-row-selected td:first-child { border-left: 3px solid var(--blue-md); }
.bc-table thead th:first-child,
.bc-table tbody td:first-child { width: 36px; padding-left: 14px; }
.bc-table input[type="checkbox"] {
  width: 15px; height: 15px; cursor: pointer; accent-color: var(--blue-md);
}

/* ── WordPress admin integration ──────────────────────────────────────────── */
/* When rendered inside WP admin, bc-layout must escape the WP container. */
#wpbody #bc-admin-root,
#wpbody-content #bc-admin-root {
  margin: -10px -15px;
}
/* Folded WP menu: 36px; expanded: 160px; we set to 0 via inline CSS on wpcontent */
.bc-layout { position: relative; }
