/* ── Dashboard Sidebar ────────────────────────────────────────────────────── */
.bc-sidebar {
  width: 256px;
  min-width: 256px;
  background: #1e2a3a;
  color: #fff;
  flex-shrink: 0;
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.bc-sidebar.collapsed { width: 0; min-width: 0; }

.bc-sidebar-header {
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 44px;
  white-space: nowrap;
}

.bc-sidebar-body { overflow-y: auto; flex: 1; white-space: nowrap; }

.sidebar-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 4px;
}

.bc-company-list {
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.bc-company-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}
.bc-company-item:hover { background: rgba(255,255,255,0.1); }
.bc-company-item input[type=checkbox] { flex-shrink: 0; cursor: pointer; accent-color: #3d8ef8; }

.bc-sidebar-open-btn {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #1e2a3a;
  color: rgba(255,255,255,0.8);
  border: none;
  border-radius: 0 8px 8px 0;
  padding: 12px 7px;
  z-index: 50;
  cursor: pointer;
  box-shadow: 2px 0 8px rgba(0,0,0,0.2);
}
.bc-sidebar-open-btn:hover { color: #fff; background: #263548; }

/* KPI card accent bars */
.kpi-card { border-left: 4px solid transparent !important; }
.kpi-primary { border-left-color: #0d6efd !important; }
.kpi-danger  { border-left-color: #ef4444 !important; }
.kpi-success { border-left-color: #22c55e !important; }
.kpi-warning { border-left-color: #f59e0b !important; }

/* ── PBI-style Report Title Card ───────────────────────────────────────── */
.bc-report-title {
  background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
  border-radius: 8px;
  min-width: 148px;
  max-width: 160px;
  flex-shrink: 0;
  margin-bottom: 1rem;   /* matches mb-3 of the filter card */
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* ── PBI-style Slicer Labels ───────────────────────────────────────────── */
.bc-slicer-label {
  display: block;
  font-size: 0.67rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
  white-space: nowrap;
}
.bc-slicer-select { font-size: 0.82rem; }

/* ── BU Chip Slicer (PBI visual 11 horizontal slicer equivalent) ────────── */
.bc-chip {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  background: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  color: #555;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1.6;
}
.bc-chip:hover { background: #e0e7ff; border-color: #818cf8; color: #3730a3; }
.bc-chip-active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
  font-weight: 600;
}
.bc-chip-active:hover { background: #0b5ed7; border-color: #0b5ed7; color: #fff; }

/* ── Card header shared ────────────────────────────────────────────────── */
.card-header { letter-spacing: 0.01em; }

/* ── Custom Checkbox Dropdown (Property / BU slicer) ──────────────────── */
.bc-check-drop { position: relative; display: inline-block; vertical-align: top; }

.bc-check-drop-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  padding: 4px 8px;
  font-size: 0.82rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  color: #333;
  transition: border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  min-height: 31px;
}
.bc-check-drop-btn:hover  { border-color: #86b7fe; }
.bc-check-drop-btn:focus  { outline: none; border-color: #86b7fe; box-shadow: 0 0 0 3px rgba(13,110,253,.15); }
.bc-check-drop-btn .drop-label  { flex: 1; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.bc-check-drop-btn .drop-arrow  { font-size: 0.6rem; color: #888; flex-shrink: 0; transition: transform .15s; }
.bc-check-drop-btn.open .drop-arrow { transform: rotate(180deg); }
.bc-check-drop-btn.has-selection { border-color: #0d6efd; color: #0d6efd; }

.bc-check-drop-menu {
  position: absolute;
  z-index: 300;
  top: calc(100% + 3px);
  left: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.14);
  overflow: hidden;
}

.bc-check-drop-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.bc-check-drop-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #c7d0dd transparent;
}

.bc-check-drop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #333;
  transition: background .1s;
  user-select: none;
  margin: 0;
  font-weight: normal;
}
.bc-check-drop-item:hover    { background: #f0f4ff; }
.bc-check-drop-item.selected { background: #e8f0fe; color: #0d47a1; }
.bc-check-drop-item input[type=checkbox] {
  flex-shrink: 0;
  accent-color: #0d6efd;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ── Chart canvas guard ────────────────────────────────────────────────── */
#propertyChart, #buChart { width: 100% !important; }

/* ── Filter summary text ───────────────────────────────────────────────── */
#filterSummary { font-size: 0.72rem; }

/* ── Auth Overlay ─────────────────────────────────────────────────────────── */
#authOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 25, 50, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: authFadeIn 0.2s ease;
}
#authOverlay.auth-fade-out { animation: authFadeOut 0.3s ease forwards; }

@keyframes authFadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes authFadeOut { from { opacity: 1 } to { opacity: 0 } }

.auth-card {
  width: 100%;
  max-width: 380px;
  animation: authSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes authSlideUp {
  from { transform: translateY(24px); opacity: 0 }
  to   { transform: translateY(0);    opacity: 1 }
}

.auth-logo-wrap {
  width: 56px; height: 56px;
  background: #0078d4;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(0,120,212,0.35);
}

@keyframes authShake {
  0%,100% { transform: translateX(0) }
  20%     { transform: translateX(-7px) }
  40%     { transform: translateX(7px) }
  60%     { transform: translateX(-4px) }
  80%     { transform: translateX(4px) }
}
.auth-shake { animation: authShake 0.4s ease !important; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.bc-navbar {
  background: #0f3460;
  min-height: 52px;
}

.bc-brand {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.bc-tabs { display: flex; gap: 2px; }

.bc-tab {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 14px 18px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.bc-tab:hover { color: #fff; }
.bc-tab.active {
  color: #fff;
  border-bottom-color: #50b8f0;
}

/* ── Table ────────────────────────────────────────────────────────────────── */
.bc-table-wrap { max-height: 62vh; overflow-y: auto; }

.bc-thead th {
  background: #0f3460;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-color: #1a4a7a !important;
}
.bc-thead th:hover { background: #1a4a7a; }

.bc-thead th.sort-asc::after  { content: ' ▲'; font-size: 0.65rem; opacity: 0.9; }
.bc-thead th.sort-desc::after { content: ' ▼'; font-size: 0.65rem; opacity: 0.9; }

tbody td {
  font-size: 0.8rem;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.num-col { text-align: right !important; }

/* ── Editable cells (cash receipt) ───────────────────────────────────────── */
td.editable { cursor: pointer; }
td.editable:hover { background: #e8f4fd !important; }

td.cell-editing {
  padding: 2px !important;
  background: #fffbe6 !important;
}
td.cell-editing input,
td.cell-editing select {
  width: 100%;
  padding: 4px 8px;
  border: 2px solid #0078d4;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
}

tr.row-changed td { background: #fffbe6 !important; }
tr.row-changed td:first-child { border-left: 3px solid #ffc107 !important; }
tr.row-saving  { opacity: 0.55; pointer-events: none; }
tr.row-error td:first-child { border-left: 3px solid #dc3545 !important; }

/* ── Date Tree Filter (Purchase Order Lines) ─────────────────────────────── */
.bc-date-tree { position:relative; display:inline-block; vertical-align:top; }

.bc-date-tree-btn {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  min-width:170px; min-height:31px; padding:3px 10px;
  background:#fff; border:1px solid #ced4da; border-radius:6px;
  font-size:0.82rem; color:#212529; cursor:pointer;
  transition:border-color .15s, color .15s;
}
.bc-date-tree-btn:hover { border-color:#0d6efd; }
.bc-date-tree-btn.has-selection { border-color:#0d6efd; color:#0d6efd; }
.bc-date-tree-btn .drop-arrow { font-size:0.65rem; transition:transform .2s; flex-shrink:0; }
.bc-date-tree-btn.open .drop-arrow { transform:rotate(180deg); }

.bc-date-tree-menu {
  position:absolute; z-index:320; top:calc(100% + 3px); left:0;
  min-width:210px; background:#fff;
  border:1px solid #dee2e6; border-radius:8px;
  box-shadow:0 4px 20px rgba(0,0,0,.14); overflow:hidden;
}
.bc-date-tree-actions {
  display:flex; gap:4px; padding:5px 10px;
  background:#f8f9fa; border-bottom:1px solid #e9ecef;
}
.bc-date-tree-actions button { font-size:0.75rem; padding:0 4px; }
.bc-date-tree-list { max-height:280px; overflow-y:auto; padding:4px 0; scrollbar-width:thin; }

.bc-year-block { user-select:none; }
.bc-year-row {
  display:flex; align-items:center; gap:6px; padding:5px 10px;
  cursor:pointer; font-weight:600; font-size:0.83rem;
}
.bc-year-row:hover { background:#f0f4ff; }
.bc-year-toggle {
  font-size:0.6rem; color:#6c757d; flex-shrink:0;
  transition:transform .15s; width:12px; text-align:center;
}
.bc-year-toggle.open { transform:rotate(90deg); }
.bc-year-row input[type=checkbox],
.bc-month-row input[type=checkbox] {
  accent-color:#0d6efd; width:14px; height:14px; flex-shrink:0; cursor:pointer;
}

.bc-month-list { display:none; }
.bc-month-list.open { display:block; }
.bc-month-row {
  display:flex; align-items:center; gap:6px;
  padding:3px 10px 3px 30px; cursor:pointer; font-size:0.79rem;
}
.bc-month-row:hover { background:#f0f4ff; }
.bc-month-row.selected { color:#0d47a1; }
