/* ==========================================================================
   BLACKMARK Staff Dashboard — dashboard.css
   Scope: everything is prefixed .bm-dash so it never leaks into the theme.
   Brand tokens ONLY:
     --bm-black:    #0B0B0B  (near-black, primary / dark surfaces)
     --bm-ivory:    #F5F5F5  (ivory, light surfaces / text on dark)
     --bm-platinum: #B9BDC2  (platinum — DARK backgrounds, borders, signals ONLY.
                              NEVER body text on ivory: contrast 1.73:1.)
     Grays: neutral graphite scale derived from the brand system.
   Type: "Editorial" serif headlines (Georgia fallback) + Manrope body.
   Logo: three-bar mark is rendered by .bm-mark (3 bars) — swap for the
   uploaded PNG/SVG in production if preferred; geometry must not change.
   ========================================================================== */

.bm-dash {
  --bm-black: #0B0B0B;
  --bm-ivory: #F5F5F5;
  --bm-platinum: #B9BDC2;
  --bm-graphite-900: #171717;
  --bm-graphite-700: #2B2B2B;
  --bm-graphite-500: #5A5A5A;
  --bm-graphite-300: #C9C9C9;
  --bm-graphite-200: #E3E3E3;
  --bm-graphite-100: #EFEFEF;
  --bm-white: #FFFFFF;
  --bm-sidebar-w: 232px;
  --bm-topbar-h: 64px;
  --bm-radius: 10px;
  --bm-shadow: 0 12px 40px rgba(11, 11, 11, 0.28);
  --bm-font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --bm-font-head: "Editorial", "Playfair Display", Georgia, serif;

  font-family: var(--bm-font-body);
  color: var(--bm-black);
  background: var(--bm-ivory);
  min-height: 100vh;
  box-sizing: border-box;
}
.bm-dash *, .bm-dash *::before, .bm-dash *::after { box-sizing: inherit; }
.bm-dash a { color: inherit; text-decoration: none; }
.bm-dash button { font-family: inherit; cursor: pointer; }

/* Micro-label: wide-tracked uppercase, the brand's signature label style */
.bm-dash .bm-micro {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--bm-graphite-500);
}

/* Three-bar logo mark */
.bm-dash .bm-mark { display: inline-flex; flex-direction: column; gap: 4px; }
.bm-dash .bm-mark i { display: block; height: 4px; background: currentColor; border-radius: 2px; }
.bm-dash .bm-mark i:nth-child(1) { width: 34px; }
.bm-dash .bm-mark i:nth-child(2) { width: 26px; }
.bm-dash .bm-mark i:nth-child(3) { width: 18px; }

/* ============================ APP SHELL ================================= */
.bm-dash .bm-shell { display: flex; min-height: 100vh; }

/* ============================ SIDEBAR =================================== */
.bm-dash .bm-sidebar {
  width: var(--bm-sidebar-w); flex: 0 0 var(--bm-sidebar-w);
  background: var(--bm-black); color: var(--bm-ivory);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.bm-dash .bm-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px; color: var(--bm-ivory);
  border-bottom: 1px solid var(--bm-graphite-700);
}
.bm-dash .bm-brand .bm-mark { color: var(--bm-ivory); }
.bm-dash .bm-brand-name {
  font-family: var(--bm-font-body); font-weight: 800;
  font-size: 17px; letter-spacing: 0.09em; line-height: 1.1;
}
.bm-dash .bm-brand-sub {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bm-platinum); margin-top: 3px;
}
.bm-dash .bm-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.bm-dash .bm-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--bm-platinum);
  transition: background 0.15s ease, color 0.15s ease;
}
.bm-dash .bm-nav a:hover { background: var(--bm-graphite-900); color: var(--bm-ivory); }
.bm-dash .bm-nav a.bm-active {
  background: var(--bm-graphite-900); color: var(--bm-ivory);
  box-shadow: inset 3px 0 0 var(--bm-platinum); /* platinum signal on dark */
}
.bm-dash .bm-nav .bm-ico { width: 20px; text-align: center; font-size: 16px; line-height: 1; flex: 0 0 20px; }
.bm-dash .bm-nav .bm-badge {
  margin-left: auto; font-size: 11px; font-weight: 800;
  background: var(--bm-ivory); color: var(--bm-black);
  border-radius: 999px; padding: 1px 8px;
}
.bm-dash .bm-sidebar-foot {
  margin-top: auto; padding: 16px 20px;
  border-top: 1px solid var(--bm-graphite-700);
  font-size: 12px; color: var(--bm-platinum);
}
.bm-dash .bm-sidebar-foot a { color: var(--bm-ivory); font-weight: 700; }

/* ============================ MAIN COLUMN =============================== */
.bm-dash .bm-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* ============================ TOP BAR =================================== */
.bm-dash .bm-topbar {
  height: var(--bm-topbar-h); flex: 0 0 var(--bm-topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: var(--bm-ivory);
  border-bottom: 1px solid var(--bm-graphite-200);
  position: sticky; top: 0; z-index: 30;
}
.bm-dash .bm-topbar h1 {
  font-family: var(--bm-font-head); font-weight: 500;
  font-size: 24px; margin: 0; letter-spacing: 0.01em;
}
.bm-dash .bm-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bm-dash .bm-searchbox { position: relative; }
.bm-dash .bm-searchbox input {
  width: 260px; max-width: 44vw; height: 40px;
  border: 1px solid var(--bm-graphite-300); border-radius: 999px;
  background: var(--bm-white); padding: 0 16px 0 38px;
  font: 500 14px var(--bm-font-body); color: var(--bm-black);
}
.bm-dash .bm-searchbox input:focus { outline: 2px solid var(--bm-black); outline-offset: 1px; }
.bm-dash .bm-searchbox .bm-search-ico {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--bm-graphite-500); pointer-events: none;
}
.bm-dash .bm-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--bm-black); font-size: 14px; font-weight: 700;
  background: var(--bm-white); color: var(--bm-black);
  transition: background 0.15s ease, color 0.15s ease;
}
.bm-dash .bm-btn:hover { background: var(--bm-graphite-100); }
.bm-dash .bm-btn-primary { background: var(--bm-black); color: var(--bm-ivory); }
.bm-dash .bm-btn-primary:hover { background: var(--bm-graphite-900); }
.bm-dash .bm-btn-ghost { border-color: var(--bm-graphite-300); }
.bm-dash .bm-btn-small { height: 32px; padding: 0 12px; font-size: 13px; }

/* ============================ CONTENT =================================== */
.bm-dash .bm-content { padding: 28px 24px 48px; max-width: 1200px; width: 100%; margin: 0 auto; }
.bm-dash .bm-content h2 {
  font-family: var(--bm-font-head); font-weight: 500; font-size: 22px; margin: 28px 0 12px;
}
.bm-dash .bm-content h2:first-child { margin-top: 0; }
.bm-dash .bm-lede { color: var(--bm-graphite-500); font-size: 15px; margin: 0 0 20px; }

/* Home overview cards */
.bm-dash .bm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.bm-dash .bm-card {
  background: var(--bm-white); border: 1px solid var(--bm-graphite-200);
  border-radius: var(--bm-radius); padding: 18px;
}
.bm-dash .bm-card .bm-card-num {
  font-family: var(--bm-font-head); font-size: 36px; line-height: 1; margin: 6px 0 4px;
}
.bm-dash .bm-card .bm-card-sub { font-size: 13px; color: var(--bm-graphite-500); }
.bm-dash .bm-card-dark { background: var(--bm-black); color: var(--bm-ivory); border-color: var(--bm-black); }
.bm-dash .bm-card-dark .bm-micro { color: var(--bm-platinum); }
.bm-dash .bm-card-dark .bm-card-sub { color: var(--bm-platinum); }

/* Panels (recent claims / deadlines / stage summary) */
.bm-dash .bm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bm-dash .bm-panel {
  background: var(--bm-white); border: 1px solid var(--bm-graphite-200);
  border-radius: var(--bm-radius); padding: 18px;
}
.bm-dash .bm-panel h3 { font-family: var(--bm-font-head); font-weight: 500; font-size: 18px; margin: 0 0 12px; }
.bm-dash .bm-stage-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--bm-graphite-100); font-size: 14px;
}
.bm-dash .bm-stage-row:last-child { border-bottom: 0; }
.bm-dash .bm-stage-bar { flex: 1; height: 6px; background: var(--bm-graphite-100); border-radius: 3px; overflow: hidden; }
.bm-dash .bm-stage-bar i { display: block; height: 100%; background: var(--bm-black); }
.bm-dash .bm-stage-count { font-weight: 800; min-width: 28px; text-align: right; }
.bm-dash .bm-deadline-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--bm-graphite-100); font-size: 14px;
}
.bm-dash .bm-deadline-row:last-child { border-bottom: 0; }
.bm-dash .bm-deadline-when { font-weight: 800; white-space: nowrap; }
.bm-dash .bm-deadline-soon { color: var(--bm-black); }
.bm-dash .bm-deadline-soon::after {
  content: "SOON"; margin-left: 8px; font-size: 10px; letter-spacing: 0.14em;
  background: var(--bm-black); color: var(--bm-ivory); border-radius: 4px; padding: 2px 6px;
  vertical-align: 2px;
}

/* Tables (Clients / Claims / Companies / Staff / Schedule / Reports) */
.bm-dash .bm-table-wrap {
  background: var(--bm-white); border: 1px solid var(--bm-graphite-200);
  border-radius: var(--bm-radius); overflow: auto;
}
.bm-dash table.bm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bm-dash .bm-table th {
  text-align: left; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bm-graphite-500); font-weight: 700;
  padding: 12px 14px; border-bottom: 1px solid var(--bm-graphite-200); white-space: nowrap;
}
.bm-dash .bm-table td { padding: 12px 14px; border-bottom: 1px solid var(--bm-graphite-100); vertical-align: top; }
.bm-dash .bm-table tr:last-child td { border-bottom: 0; }
.bm-dash .bm-table tbody tr:hover { background: var(--bm-graphite-100); }
.bm-dash .bm-table .bm-row-link { font-weight: 700; }
.bm-dash .bm-table .bm-row-link:hover { text-decoration: underline; }
.bm-dash .bm-pill {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  border: 1px solid var(--bm-graphite-300); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.bm-dash .bm-pill-dark { background: var(--bm-black); color: var(--bm-ivory); border-color: var(--bm-black); }
.bm-dash .bm-empty { padding: 28px; text-align: center; color: var(--bm-graphite-500); font-size: 14px; }
.bm-dash .bm-list-filter { margin: 0 0 14px; }
.bm-dash .bm-list-filter input {
  width: 320px; max-width: 100%; height: 40px; border: 1px solid var(--bm-graphite-300);
  border-radius: 999px; padding: 0 16px; font: 500 14px var(--bm-font-body); background: var(--bm-white);
}

/* Detail view (client detail / claim detail rendered inside content) */
.bm-dash .bm-detail-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.bm-dash .bm-detail-head h2 { margin: 0; }
.bm-dash .bm-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; }
.bm-dash .bm-kv dt { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bm-graphite-500); font-weight: 700; margin-bottom: 3px; }
.bm-dash .bm-kv dd { margin: 0; font-size: 15px; font-weight: 600; }

/* ===================== FAST ENTRY MODAL (overlay) =======================
   Fixed overlay: the dashboard page stays visible behind it (owner rule).
   ====================================================================== */
.bm-dash .bm-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(11, 11, 11, 0.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 5vh 16px 16px; overflow-y: auto;
}
.bm-dash .bm-modal-backdrop.bm-open { display: flex; }
.bm-dash .bm-modal {
  background: var(--bm-white); border-radius: 14px; width: 640px; max-width: 100%;
  box-shadow: var(--bm-shadow); padding: 26px 26px 22px;
  animation: bm-pop 0.16s ease-out;
}
@keyframes bm-pop { from { transform: translateY(8px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.bm-dash .bm-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.bm-dash .bm-modal-head h3 { font-family: var(--bm-font-head); font-weight: 500; font-size: 24px; margin: 0; }
.bm-dash .bm-modal-close {
  border: 0; background: var(--bm-graphite-100); width: 34px; height: 34px;
  border-radius: 50%; font-size: 16px; line-height: 1;
}
.bm-dash .bm-modal-close:hover { background: var(--bm-graphite-200); }

/* Small-edit pop-up reuses the same shell at a narrower width */
.bm-dash .bm-modal.bm-modal-small { width: 440px; }

/* Form fields (Fast Entry + small edits) */
.bm-dash .bm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.bm-dash .bm-form .bm-field-full { grid-column: 1 / -1; }
.bm-dash .bm-field label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--bm-graphite-500); margin-bottom: 6px;
}
.bm-dash .bm-field input, .bm-dash .bm-field select, .bm-dash .bm-field textarea {
  width: 100%; border: 1px solid var(--bm-graphite-300); border-radius: 8px;
  padding: 10px 12px; font: 500 14px var(--bm-font-body); color: var(--bm-black); background: var(--bm-white);
}
.bm-dash .bm-field textarea { min-height: 72px; resize: vertical; }
.bm-dash .bm-field input:focus, .bm-dash .bm-field select:focus, .bm-dash .bm-field textarea:focus {
  outline: 2px solid var(--bm-black); outline-offset: 1px;
}
.bm-dash .bm-form-actions { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.bm-dash .bm-form-note { grid-column: 1 / -1; font-size: 13px; color: var(--bm-graphite-500); margin: 0; }
.bm-dash .bm-form-success {
  grid-column: 1 / -1; background: var(--bm-black); color: var(--bm-ivory);
  border-radius: 8px; padding: 12px 14px; font-size: 14px; font-weight: 600;
}
.bm-dash .bm-form-error {
  grid-column: 1 / -1; border: 1px solid var(--bm-black); border-radius: 8px;
  padding: 12px 14px; font-size: 14px; font-weight: 600;
}

/* ============ SEARCH RESULTS PANEL (fixed overlay, right) ===============
   Owner rule: slides out from the RIGHT and HOVERS over the page.
   It must NOT push, shift, or resize page content — position: fixed only.
   ====================================================================== */
.bm-dash .bm-search-scrim {
  position: fixed; inset: 0; z-index: 150; background: rgba(11, 11, 11, 0.35);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.bm-dash .bm-search-scrim.bm-open { opacity: 1; pointer-events: auto; }
.bm-dash .bm-search-panel {
  position: fixed; top: 0; right: 0; height: 100dvh; width: 400px; max-width: 92vw;
  z-index: 160; background: var(--bm-white); box-shadow: var(--bm-shadow);
  transform: translateX(105%); transition: transform 0.24s ease;
  display: flex; flex-direction: column;
}
.bm-dash .bm-search-panel.bm-open { transform: translateX(0); }
.bm-dash .bm-search-panel-head {
  background: var(--bm-black); color: var(--bm-ivory);
  padding: 18px 20px; display: flex; align-items: center; gap: 12px;
}
.bm-dash .bm-search-panel-head h3 { font-family: var(--bm-font-head); font-weight: 500; font-size: 20px; margin: 0; flex: 1; }
.bm-dash .bm-search-panel-head .bm-modal-close { background: var(--bm-graphite-700); color: var(--bm-ivory); }
.bm-dash .bm-search-panel-head .bm-modal-close:hover { background: var(--bm-graphite-500); }
.bm-dash .bm-search-panel-body { padding: 16px 20px 24px; overflow-y: auto; }
.bm-dash .bm-search-q { font-size: 13px; color: var(--bm-graphite-500); margin: 0 0 14px; }
.bm-dash .bm-search-group { margin-bottom: 20px; }
.bm-dash .bm-search-group h4 {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bm-graphite-500); margin: 0 0 8px; font-weight: 800;
}
.bm-dash .bm-search-result {
  display: block; padding: 10px 12px; border: 1px solid var(--bm-graphite-200);
  border-radius: 8px; margin-bottom: 8px;
}
.bm-dash .bm-search-result:hover { border-color: var(--bm-black); }
.bm-dash .bm-search-result .bm-sr-title { font-weight: 700; font-size: 14px; }
.bm-dash .bm-search-result .bm-sr-sub { font-size: 12px; color: var(--bm-graphite-500); margin-top: 2px; }
.bm-dash .bm-search-none { font-size: 14px; color: var(--bm-graphite-500); }
.bm-dash .bm-search-loading { font-size: 14px; color: var(--bm-graphite-500); }

/* Settings view */
.bm-dash .bm-settings-list { display: grid; gap: 10px; max-width: 560px; }
.bm-dash .bm-settings-list a, .bm-dash .bm-settings-list .bm-setting-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--bm-white); border: 1px solid var(--bm-graphite-200);
  border-radius: var(--bm-radius); padding: 14px 16px; font-size: 14px; font-weight: 600;
}
.bm-dash .bm-settings-list a:hover { border-color: var(--bm-black); }
.bm-dash .bm-settings-list .bm-setting-desc { display: block; font-weight: 500; color: var(--bm-graphite-500); font-size: 13px; margin-top: 2px; }

/* Mobile nav toggle (appears <= 860px) */
.bm-dash .bm-nav-toggle { display: none; }

/* ============================ RESPONSIVE ================================ */
@media (max-width: 1020px) {
  .bm-dash .bm-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  /* Sidebar becomes an off-canvas OVERLAY drawer (does not push content) */
  .bm-dash .bm-sidebar {
    position: fixed; left: 0; top: 0; height: 100dvh;
    transform: translateX(-105%); transition: transform 0.24s ease;
    box-shadow: var(--bm-shadow); z-index: 170;
  }
  .bm-dash .bm-sidebar.bm-open { transform: translateX(0); }
  .bm-dash .bm-nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--bm-graphite-300); background: var(--bm-white); font-size: 17px;
  }
  .bm-dash .bm-topbar { padding: 0 14px; gap: 10px; }
  .bm-dash .bm-topbar h1 { font-size: 20px; }
  .bm-dash .bm-content { padding: 20px 14px 40px; }
}
@media (max-width: 480px) { /* ~390px phones */
  .bm-dash .bm-searchbox input { width: 130px; }
  .bm-dash .bm-btn-fastentry { padding: 0 12px; }
  .bm-dash .bm-cards { grid-template-columns: 1fr 1fr; }
  .bm-dash .bm-card .bm-card-num { font-size: 28px; }
  .bm-dash .bm-form { grid-template-columns: 1fr; }
  .bm-dash .bm-modal { padding: 20px 16px; }
  .bm-dash .bm-table th, .bm-dash .bm-table td { padding: 10px; }
  .bm-dash .bm-search-panel { width: 340px; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-dash .bm-search-panel, .bm-dash .bm-sidebar, .bm-dash .bm-search-scrim { transition: none; }
  .bm-dash .bm-modal { animation: none; }
}
/* dashboard headings must be near-black: the theme's h1/h2/h3 color is light. */
.bm-dash .bm-topbar h1,
.bm-dash .bm-content h2,
.bm-dash .bm-panel h3,
.bm-dash .bm-modal-head h3 { color: var(--bm-black); }