:root {
  --bm-dark: #1a1a2e;
  --bm-red: #e94560;
  --bm-mid: #16213e;
  --bm-light: #0f3460;
}

/* ── Navbar ───────────────────────────────────────────── */
.navbar-bm {
  background: var(--bm-dark);
  border-bottom: 3px solid var(--bm-red);
}
.navbar-bm .navbar-brand {
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: #fff !important;
}
.navbar-bm .navbar-brand span { color: var(--bm-red); }
.navbar-bm .nav-link { color: rgba(255,255,255,.8) !important; font-weight: 500; }
.navbar-bm .nav-link:hover,
.navbar-bm .nav-link.active { color: var(--bm-red) !important; }

/* ── Page header ──────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--bm-dark) 0%, var(--bm-light) 100%);
  color: #fff;
  padding: 1.5rem 0;
  margin-bottom: 1.5rem;
}
.page-header h1 { font-size: 1.6rem; font-weight: 700; margin: 0; }
.page-header p  { margin: 0; opacity: .75; font-size: .9rem; }

/* ── Stat cards ───────────────────────────────────────── */
.stat-card {
  border: none;
  border-radius: 12px;
  color: #fff;
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 4px 18px rgba(0,0,0,.15);
}
.stat-card .stat-icon { font-size: 2.4rem; opacity: .85; }
.stat-card .stat-num  { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card .stat-lbl  { font-size: .8rem; opacity: .8; text-transform: uppercase; letter-spacing: .5px; }
.stat-blue   { background: linear-gradient(135deg,#0061f2,#6ea8fe); }
.stat-green  { background: linear-gradient(135deg,#00ac69,#4dbb92); }
.stat-orange { background: linear-gradient(135deg,#f4a261,#e76f51); }
.stat-purple { background: linear-gradient(135deg,#6f42c1,#a370f7); }

/* ── Buttons ──────────────────────────────────────────── */
.btn-bm {
  background: var(--bm-red);
  border: none;
  color: #fff;
  font-weight: 600;
}
.btn-bm:hover { background: #c73652; color: #fff; }

/* ── Tables ───────────────────────────────────────────── */
.table-bm thead { background: var(--bm-dark); color: #fff; }
.table-bm tbody tr:hover { background: #f8f9ff; }

/* ── Status badges ────────────────────────────────────── */
.badge-pending    { background: #ffc107; color: #000; }
.badge-progress   { background: #0d6efd; color: #fff; }
.badge-completed  { background: #198754; color: #fff; }

/* ── Section card ─────────────────────────────────────── */
.section-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.section-card .card-header {
  background: var(--bm-dark);
  color: #fff;
  border-radius: 12px 12px 0 0 !important;
  font-weight: 600;
}

/* ── Job card print view ──────────────────────────────── */
.jc-print-header {
  background: var(--bm-dark);
  color: #fff;
  padding: 1.2rem 1.6rem;
  border-radius: 8px 8px 0 0;
}
.jc-print-header h2 { margin: 0; font-weight: 800; }
.jc-print-header h2 span { color: var(--bm-red); }
.jc-section-title {
  background: #f1f3ff;
  border-left: 4px solid var(--bm-red);
  padding: .4rem .8rem;
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .8rem;
}
.service-chip {
  display: inline-block;
  background: var(--bm-dark);
  color: #fff;
  border-radius: 20px;
  padding: .25rem .8rem;
  font-size: .82rem;
  margin: .2rem;
}

/* ── Section divider (within a form card) ────────────── */
.jc-section-divider {
  background: linear-gradient(90deg, var(--bm-dark) 0%, var(--bm-light) 100%);
  color: #fff;
  border-radius: 6px;
  padding: .45rem 1rem;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 1rem;
  margin-top: .5rem;
}

/* ── Three-dot action dropdown in tables ─────────────── */
.action-dot-btn {
  width: 30px; height: 30px;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 6px;
}
/* Prevent dropdown from being clipped by table-responsive overflow */
.table-responsive:has(.dropdown.show) { overflow: visible; }

/* ── Empty state ──────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: #999; }
.empty-state i { font-size: 3rem; display: block; margin-bottom: .8rem; opacity: .4; }

/* ── Responsive — small screens (< 576 px) ───────────── */
@media (max-width: 575.98px) {
  .page-header h1 { font-size: 1.15rem; }
  .page-header p  { font-size: .8rem; }

  .stat-card { padding: .9rem 1rem; gap: .7rem; }
  .stat-card .stat-icon { font-size: 1.8rem; }
  .stat-card .stat-num  { font-size: 1.4rem; }

  /* Card headers that use flex layout should stack */
  .card-header.d-flex {
    flex-direction: column;
    align-items: stretch !important;
  }
  .card-header .form-control { width: 100% !important; }

  /* Filter buttons wrap and fill */
  .filter-btn { font-size: .75rem; padding: .25rem .5rem; }

  /* Detail rows: stack label above value */
  .detail-row { flex-direction: column; margin-bottom: .55rem; }
  .detail-label { min-width: unset !important; margin-bottom: .1rem; }

  /* Bill line items */
  .bill-line { font-size: .85rem; }
  #balanceDisplay { font-size: 1.5rem !important; }

  /* Custom service input should be full-width */
  #addSvcWrap { max-width: 100% !important; }

  /* Quick action buttons on dashboard should stretch */
  .d-flex.gap-2.flex-wrap > .btn { flex: 1 1 calc(50% - .5rem); text-align: center; }
}

/* ── Responsive — medium screens (576–767 px) ─────────── */
@media (max-width: 767.98px) {
  /* Tables in view pages should scroll horizontally (already table-responsive in lists) */
  .card-body .table-responsive { -webkit-overflow-scrolling: touch; }

  /* Bill view services/amounts columns stack naturally via Bootstrap col-md */

  /* Ensure navbar toggler icon is visible */
  .navbar-toggler-icon { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); }
}

/* ── Print media ──────────────────────────────────────── */
@media print {
  .no-print, .navbar-bm, .page-header, .btn, button { display: none !important; }
  body { background: #fff !important; }
  .section-card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .jc-print-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
