
/* ===== THEME TOKENS ===== */
:root {
  /* neutrals */
  --app-bg: #ffffff;
  --app-fg: #111827;
  --muted: #6c757d;

/* help icons */
  --help-icon: #b0b6b6;
  --help-icon-hover: #8a8f8f;

  /* cards */
  --card-bg: #ffffff;
  --card-fg: #111827;
  --card-shadow: 0 6px 24px rgba(0,0,0,.08);
  --card-border: #e9ecef;
  --card-hover-bg: rgba(0, 0, 0, 0.04);

  /* dropdown/menu */
  --menu-bg: var(--card-bg);
  --menu-fg: var(--app-fg);
  --menu-border: color-mix(in srgb, var(--card-border) 85%, transparent);
  --menu-hover-bg: var(--card-hover-bg);
  --menu-active-bg: color-mix(in srgb, var(--primary) 14%, transparent);

  /* navbar profile trigger */
  --navlink-fg: var(--nav-fg);
  --navlink-hover-bg: color-mix(in srgb, var(--nav-fg) 12%, transparent);


  /* nav + sidebar */
  --nav-bg: #041e42;
  --nav-fg: #f8f9fa;

  --sidebar-bg: #041e42;
  --sidebar-fg: #e9ecef;
  --sidebar-border: #002855;
  --sidebar-active: #06306b;
  --sidebar-active-hover: #0a3d91;
  --sidebar-icon: #adb5bd;


  /* accents */
  --primary: #0d6efd;

  /* callouts */
  --callout-border: #e9ecef;
  --callout-bg: #f8f9fa;
  --callout-warning-bg: #fff8e1;
  --callout-info-bg: #e7f8fb;
  --callout-success-bg: #e6f4ea;
  --callout-danger-bg: #fbe9eb;
  --callout-primary-bg: #e9f2ff;

  --bs-body-color: var(--app-fg);           /* maps Bootstrap body text color */
  --bs-secondary-color: var(--muted);       /* maps muted/secondary text */
  --bs-primary: var(--primary);             /* optional: for .text-primary, etc. */
  --bs-heading-color: var(--app-fg);
  --tab-fg: #777;
  --tab-border: #777;
  --surface: #fff;       
  --card-border: #dee2e6;
  --bs-table-bg: transparent;
  --bs-table-color: var(--bs-body-color);
  --table-row-hover-bg: rgba(0, 0, 0, 0.04); /* light theme */
  --th-background: #f8f9fa;

  --row-active-bg: var(--callout-primary-bg, #e9f2ff);
  --sidebar-active-fg: #041e42;

}

/* Dark theme overrides */
html[data-theme="dark"] {
  --app-bg: #0b1220;
  --app-fg: #e5e7eb;

  --card-bg: #0f1629;
  --card-fg: #e5e7eb;
  --card-shadow: 0 6px 24px rgba(0,0,0,.35);
  --card-border: #1f2a44;
  --card-hover-bg: rgba(255, 255, 255, 0.08);

  --nav-bg: #0b1220;
  --nav-fg: #e5e7eb;

  --row-active-bg: var(--sidebar-active, #132040);

  --menu-bg: var(--card-bg);
  --menu-fg: var(--app-fg);
  --menu-border: color-mix(in srgb, var(--card-border) 90%, transparent);
  --menu-hover-bg: rgba(255,255,255,.06);
  --navlink-hover-bg: rgba(255,255,255,.08);

  --sidebar-bg: #0b1220;
  --sidebar-fg: #e5e7eb;
  --sidebar-border: #16203a;
  --sidebar-active: #132040;
  --sidebar-active-hover: #1b2b54;
  --sidebar-icon: #9aa3b2;

  --primary: #5aa0ff;

  --callout-border: #1f2a44;
  --callout-bg: #121a2e;
  --callout-warning-bg: #2b2517;
  --callout-info-bg: #0f2230;
  --callout-success-bg: #0f2a1a;
  --callout-danger-bg: #2a1316;
  --callout-primary-bg: #0f1e3a;

  --bs-body-color: var(--app-fg);
  --bs-secondary-color: var(--muted);
  --bs-primary: var(--primary);
  --bs-heading-color: var(--app-fg);
  --tab-fg: #b6bdc7;        /* use your muted/neutral */
  --tab-border: #293349;    /* matches other UI borders */
  --surface: #111827;          /* dark tab background */
  --card-border: #2b3447;
  --bs-table-bg: transparent;
  --bs-table-color: var(--bs-body-color);
  --table-row-hover-bg: rgba(255, 255, 255, 0.08);
  --th-background: #0b1220;

 --row-active-bg: var(--sidebar-active, #e5e7eb);
  --sidebar-active-fg: #e5e7eb;

}


/* ===== MEDIUM THEME (Slate / Steel) ===== */
html[data-theme="medium"] {
  --app-bg: #f1f3f6;           /* soft neutral base */
  --app-fg: #1e2530;           /* rich navy-gray text */
  --muted: #6b7280;            /* medium gray */

  /* cards */
  --card-bg: #ffffff;
  --card-fg: #1e2530;
  --card-shadow: 0 4px 16px rgba(0,0,0,.06);
  --card-border: #d0d6de;

  /* nav + sidebar */
  --nav-bg: #e9edf3;           /* light slate-blue */
  --nav-fg: #041e42;           /* deep NRWA navy text */

  --sidebar-bg: #e0e6ef;       /* gentle steel background */
  --sidebar-fg: #1e2530;       /* readable navy-gray */
  --sidebar-border: #c9d1dc;   /* subtle cool gray divider */
  --sidebar-active: #d1ddf2;   /* light blue highlight */
  --sidebar-active-hover: #c3d3f0; /* hover accent */
  --sidebar-icon: #5c677d;     /* slate gray icons */

  /* accents */
  --primary: #0a64d2;          /* tempered Bootstrap blue */

  /* callouts */
  --callout-border: #d0d6de;
  --callout-bg: #f6f8fa;
  --callout-warning-bg: #fff5da;
  --callout-info-bg: #e8f3f8;
  --callout-success-bg: #e9f4ec;
  --callout-danger-bg: #faebee;
  --callout-primary-bg: #e0ecff;

  /* Bootstrap mappings */
  --bs-body-color: var(--app-fg);
  --bs-secondary-color: var(--muted);
  --bs-primary: var(--primary);
  --bs-heading-color: var(--app-fg);
  --tab-fg: #5c677d;
  --tab-border: #c9d1dc;
  --surface: #f6f8fa;
  --bs-table-bg: transparent;
  --bs-table-color: var(--bs-body-color);
  --table-row-hover-bg: rgba(0, 0, 0, 0.04);
  --th-background: #e9edf3;

  --row-active-bg: var(--sidebar-active, var(--callout-primary-bg, #e0ecff));
  --sidebar-active-fg: #041e42;
}

/* ===== LIGHT THEME (Clean / Daylight) ===== */
html[data-theme="light"],
html:not([data-theme]) {
  --app-bg: #ffffff;           /* crisp white background */
  --app-fg: #111827;           /* near-black readable text */
  --muted: #6c757d;            /* neutral gray */

  /* cards */
  --card-bg: #ffffff;
  --card-fg: #111827;
  --card-shadow: 0 6px 24px rgba(0,0,0,.08);
  --card-border: #e9ecef;

  /* nav + sidebar */
  --nav-bg: #f8f9fa;           /* soft neutral navigation bar */
  --nav-fg: #041e42;           /* deep  navy text for brand contrast */

  --sidebar-bg: #ffffff;       /* clean white sidebar */
  --sidebar-fg: #212529;       /* standard Bootstrap body text */
  --sidebar-border: #e5e7eb;   /* subtle light divider */
  --sidebar-active: #e9f2ff;   /* gentle blue highlight (links/buttons) */
  --sidebar-active-hover: #dbe9ff; /* slightly stronger hover */
  --sidebar-icon: #6c757d;     /* muted gray icons */

  /* accents */
  --primary: #0d6efd;          /* Bootstrap blue accent */

  /* callouts */
  --callout-border: #e9ecef;
  --callout-bg: #f8f9fa;
  --callout-warning-bg: #fff8e1;
  --callout-info-bg: #e7f8fb;
  --callout-success-bg: #e6f4ea;
  --callout-danger-bg: #fbe9eb;
  --callout-primary-bg: #e9f2ff;

  /* Bootstrap mappings */
  --bs-body-color: var(--app-fg);
  --bs-secondary-color: var(--muted);
  --bs-primary: var(--primary);
  --bs-heading-color: var(--app-fg);
  --tab-fg: #777;
  --tab-border: #dee2e6;
  --surface: #ffffff;
  --bs-table-bg: transparent;
  --bs-table-color: var(--bs-body-color);
  --table-row-hover-bg: rgba(0, 0, 0, 0.04);  /* subtle gray hover */
  --th-background: #f8f9fa;

  --row-active-bg: var(--sidebar-active, var(--callout-primary-bg, #e9f2ff));
  --sidebar-active-fg: #041e42;
}

/* Theme-aware checkerboard */
:root{
  --cb-size: 12px;
  --cb-a: rgba(0,0,0,.10);
  --cb-b: rgba(255,255,255,1);
}
html[data-theme="dark"]{
  --cb-a: rgba(255,255,255,.10);
  --cb-b: rgba(17,24,39,1); /* dark surface */
}


/* ========================
   GLOBAL BASE + FIXES
======================== */
html { overflow-y: scroll; scrollbar-gutter: stable both-edges; }

/* Disable transitions until JS marks ready */
body { transition: none; color: var(--app-fg); background: var(--app-bg); }
body.js-anim { transition: background .2s ease, color .2s ease; }

body.modal-scroll-lock {
  position: fixed;
  overflow: hidden;
  width: 100%;
  touch-action: none;
}

/*.logo-img,
.avatar-img{
  background: transparent !important;
  display: block;
}
*/

.bg-checkerboard{
  background-color: var(--cb-b) !important;
  background-image:
    linear-gradient(45deg, var(--cb-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--cb-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--cb-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--cb-a) 75%) !important;
  background-size: calc(var(--cb-size) * 2) calc(var(--cb-size) * 2) !important;
  background-position: 0 0, 0 var(--cb-size), var(--cb-size) calc(-1 * var(--cb-size)), calc(-1 * var(--cb-size)) 0 !important;
}

.checkerboard {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, rgba(0,0,0,.10) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0,0,0,.10) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0,0,0,.10) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0,0,0,.10) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0px;
}


/* Keep the right-side group from wrapping and changing navbar height */
.custom-navbar .container-fluid > .d-flex.align-items-center {
  flex-wrap: nowrap;
}

/* Profile trigger sizing + theme color */
.profile-trigger{
  padding: .25rem .5rem;
  font-size: .75rem;
  color: var(--nav-fg) !important;
  border-radius: .5rem;
  white-space: nowrap;
}

/* Don’t let name blow up the navbar */
.profile-name{
  font-size: .875rem;
  max-width: 160px;          /* adjust */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Optional hover */
.profile-trigger:hover,
.profile-trigger:focus{
  background: color-mix(in srgb, var(--nav-fg) 12%, transparent);
  color: var(--nav-fg) !important;
}

/* Profile dropdown: menu */
.profile-menu.dropdown-menu{
  background: var(--menu-bg) !important;
  color: var(--menu-fg) !important;
  border: 1px solid var(--menu-border) !important;
  box-shadow: var(--card-shadow);
  border-radius: .5rem;
  padding: .35rem;
}

/* Items */
.profile-menu .dropdown-item{
  color: var(--menu-fg) !important;
  border-radius: .35rem;
}

.profile-menu .dropdown-item:hover,
.profile-menu .dropdown-item:focus{
  background: var(--menu-hover-bg) !important;
  color: var(--menu-fg) !important;
}

.profile-menu .dropdown-item:active{
  background: var(--menu-active-bg) !important;
  color: var(--menu-fg) !important;
}

/* Nav icons */
.nav-task-icon i,
.nav-notification-icon i {
  font-size: 1.05rem;
}

/* Badge pinned to top-right of icon */
.nav-badge {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  font-size: 0.65rem;
  padding: 0.25em 0.45em;
  line-height: 1;
  min-width: 1.25em;
  text-align: center;
}

/* The clickable profile area in the navbar */
.navbar .profile-trigger{
  color: var(--navlink-fg) !important;
  border-radius: .5rem;
}

.navbar .profile-trigger:hover,
.navbar .profile-trigger:focus{
  background: var(--navlink-hover-bg);
  color: var(--navlink-fg) !important;
}

/* Ensure caret matches nav fg */
.navbar .profile-trigger.dropdown-toggle::after{
  border-top-color: currentColor;
}

/* Make the avatar edge look good on all themes (optional) */
.navbar .profile-trigger .avatar,
.navbar .profile-trigger img{
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--nav-fg) 25%, transparent);
  border-radius: 50%;
}


/* ===========================
   INFO OFFCANVAS (theme-aware)
=========================== */
#infoPanel.info-panel{
  background: var(--card-bg);
  color: var(--card-fg);
  border-left: 1px solid var(--card-border);
}

#infoPanel .info-panel-header{
  display:flex;
  align-items:center;
  gap:.75rem;
  padding:.75rem 1rem;

  background: var(--nav-bg);
  color: var(--nav-fg);
  border-bottom: 1px solid color-mix(in srgb, var(--card-border) 60%, transparent);
  letter-spacing: .02em;
}

#infoPanel #infoPanel-title{
  color: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

#infoPanel #infoPanel-subtitle{
  color: var(--bs-secondary-color);
}

#infoPanel .info-panel-body{
  background: var(--card-bg);
  color: var(--card-fg);
}

/* Close button that works in light + dark */
#infoPanel .btn-close{
  opacity: .75;
  filter: invert(1) grayscale(1) brightness(2);
}
html[data-theme="light"] #infoPanel .btn-close,
html[data-theme="medium"] #infoPanel .btn-close{
  opacity: .65;
  filter: none;
}

/* Backdrop */
.offcanvas-backdrop.show{
  background-color:#000;
  opacity:.45;
}
html[data-theme="dark"] .offcanvas-backdrop.show{
  opacity:.70;
}


/* =========================
   INFO CONTENT (preview + sections)
========================= */
.info-preview{
  max-width:520px;
  margin:0 auto;
  padding:5px;
  background: var(--card-bg);
  color: var(--card-fg);
}

.r2-info-section{ margin-top:30px; }
.r2-info-section:first-child{ margin-top:6px; }

.r2-info-heading{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 12px 0;
  font-size:15.5px;
  font-weight:900;
  letter-spacing:.2px;
  color: var(--app-fg);
}

.r2-info-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  border-radius:50%;
  border:1px solid var(--primary);
  color: var(--primary);
  background: transparent;
  flex-shrink:0;
}

.r2-info-badge i{
  font-size:.85rem;
  line-height:1;
  font-weight:700;
}

.r2-info-text{
  margin:0;
  font-size:14.5px;
  line-height:1.6;
  color: var(--card-fg);
}

.r2-info-list{
  margin:0;
  padding-left:40px;
  font-size:14.5px;
  line-height:1.65;
  color: var(--card-fg);
}
.r2-info-list li{ margin:10px 0; }

/* Mobile */
@media (max-width:600px){
  .info-preview{ padding:14px; }

  .r2-info-heading{ font-size:14.75px; gap:10px; }
  .r2-info-section:first-child{ margin-top:4px; }

  .r2-info-badge{ width:24px; height:24px; }
  .r2-info-badge i{ font-size:.8rem; }

  .r2-info-list{ padding-left:36px; }
}


/* ===========================
  BIG BUTTONS (Quick Adds)
=========================== */
/* Both action buttons same fixed height */
.r2-big-action{
  height: 132px;              /* your fixed height */
  position: relative;
  overflow: hidden;
  padding-bottom: 42px !important;   /* reserve space for .r2-extra */
}

/* Extra info area pinned to bottom, never affects height */
.r2-big-action .r2-extra{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  padding: 0 10px;
  font-size: .75rem;
  line-height: 1.1;
  opacity: .85;
  min-height: 2.2em;          /* reserve ~2 lines even if empty */
}

/* If you want it “invisible” but still reserved */
.r2-big-action .r2-extra.is-empty{
  visibility: hidden;
}

  /* thumb inside any [data-r2-photo-btn] */
  [data-r2-photo-btn] { position: relative; overflow: hidden; }

  /* match your mini-type-card geometry */
  [data-r2-photo-btn] .r2-btn-thumb{
    width: 3.25rem;            /* same as your card */
    height: 3.25rem;
    border-radius: .5rem;      /* card-ish corners (change to .25rem if you want sharper) */
    border: 2px solid var(--bs-primary);   /* will look like a card outline */
    background: #fff;
    overflow: hidden;
    margin-bottom: .35rem;
    display: none;             /* hidden until photo set */
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.08);
  }

  [data-r2-photo-btn] .r2-btn-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* hide camera icon when photo set */
  [data-r2-photo-btn].r2-has-photo [data-r2-photo-icon]{ display:none !important; }
  [data-r2-photo-btn].r2-has-photo .r2-btn-thumb{ display:block; }

  .r2-addr-chip {
    display:inline-flex; align-items:center; gap:.35rem;
    padding:.12rem .45rem; border-radius:999px;
    border:1px solid var(--bs-border-color);
    font-size:.7rem; color: var(--bs-secondary-color);
    background: color-mix(in srgb, var(--bs-body-bg) 85%, transparent);
  }
/* ===========================
   USER PROFILE
=========================== */


  .user-profile-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .user-avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow:
      0 0 0 2px rgba(255,255,255,.7),
      0 4px 10px rgba(15, 23, 42, 0.45);
    background: #f8fafc;
  }

  .user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .user-avatar-initials {
    width: 100%;
    height: 100%;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #0f172a;
    background: radial-gradient(circle at 30% 20%, #c7d2fe, #4f46e5);
    text-transform: uppercase;
  }

  .user-avatar-chip {
    font-size: .65rem;
    padding: .2rem .5rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .85);
    color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
  }

  .user-avatar-chip i {
    font-size: .75rem;
  }

  .user-avatar-upload-input {
    font-size: .7rem;
  }

  @media (max-width: 576px) {
    .user-profile-card-header {
      flex-direction: column;
      align-items: flex-start;
    }
  }



/* ===========================
   R2 Toggle Row + Address Chip
   (theme-aware using your tokens)
=========================== */

/* Optional component tokens (local to these widgets) */
:root{
  --r2-surface: var(--card-bg, var(--bs-body-bg, #fff));
  --r2-surface-fg: var(--card-fg, var(--bs-body-color, #111827));
  --r2-muted: var(--bs-secondary-color, var(--muted, #6c757d));
  --r2-border: var(--card-border, var(--bs-border-color, #dee2e6));
  --r2-hover: var(--card-hover-bg, rgba(0,0,0,.04));
}


  /* tiny toggle like user profile */
  .r2-toggle-row {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:.75rem;
    padding:.4rem .5rem;
    border:1px solid var(--bs-border-color);
    border-radius:.6rem;
    background: var(--bs-body-bg);
  }
  .r2-toggle-row .meta { min-width:0; }
  .r2-toggle-row .label { font-weight:600; font-size:.85rem; margin:0; }
  .r2-toggle-row .hint { margin:0; font-size:.72rem; color: var(--bs-secondary-color); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

  .r2-addr-block .line1 { font-weight:600; }
  .r2-addr-block .line2 { font-size:.78rem; color: var(--bs-secondary-color); }
  .r2-addr-chip {
    display:inline-flex; align-items:center; gap:.35rem;
    padding:.12rem .45rem; border-radius:999px;
    border:1px solid var(--bs-border-color);
    font-size:.7rem; color: var(--bs-secondary-color);
    background: color-mix(in srgb, var(--bs-body-bg) 85%, transparent);
  }



/* tiny toggle like user profile */
.r2-toggle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.4rem .5rem;

  border:1px solid var(--r2-border);
  border-radius:.6rem;

  /* ✅ use “surface/card” not raw body */
  background: var(--r2-surface);
  color: var(--r2-surface-fg);
}

.r2-toggle-row .meta{ min-width:0; }
.r2-toggle-row .label{
  font-weight:600;
  font-size:.85rem;
  margin:0;
  color: var(--r2-surface-fg);
}
.r2-toggle-row .hint{
  margin:0;
  font-size:.72rem;
  color: var(--r2-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Nice hover (optional) */
.r2-toggle-row:hover{
  background: color-mix(in srgb, var(--r2-surface) 92%, var(--r2-hover));
}

/* Address block text */
.r2-addr-block .line1{
  font-weight:600;
  color: var(--r2-surface-fg);
}
.r2-addr-block .line2{
  font-size:.78rem;
  color: var(--r2-muted);
}

/* Address chip */
.r2-addr-chip{
  display:inline-flex;
  align-items:center;
  gap:.35rem;

  padding:.12rem .45rem;
  border-radius:999px;

  border:1px solid var(--r2-border);
  font-size:.7rem;
  color: var(--r2-muted);

  /* ✅ theme-safe “tinted surface” */
  background: color-mix(in srgb, var(--r2-surface) 88%, var(--r2-muted) 12%);
}

/* If you want chip to pop a bit more in dark */
html[data-theme="dark"] .r2-addr-chip{
  background: color-mix(in srgb, var(--r2-surface) 92%, #ffffff 8%);
}

/* ===========================
   R2 ACCORDION (theme-aware)
   Apply with: <div class="accordion r2-accordion">
=========================== */

/* Optional component tokens (inherit your globals) */
.r2-accordion{
  --r2-acc-bg: var(--card-bg);
  --r2-acc-fg: var(--card-fg, var(--app-fg));
  --r2-acc-border: var(--card-border);
  --r2-acc-muted: var(--bs-secondary-color, var(--muted));
  --r2-acc-hover: var(--card-hover-bg);
  --r2-acc-active-bg: color-mix(in srgb, var(--primary) 6%, transparent);
  --r2-acc-active-border: color-mix(in srgb, var(--primary) 22%, var(--r2-acc-border));
  --r2-acc-radius: .75rem;
}

/* Outer shell */
.r2-accordion .accordion-item{
  background: var(--r2-acc-bg);
  color: var(--r2-acc-fg);
  border: 1px solid var(--r2-acc-border);
  border-radius: var(--r2-acc-radius);
  overflow: hidden;
  margin-bottom: .65rem;
  box-shadow: none;
}

/* Prevent double borders between stacked items */
.r2-accordion .accordion-item:not(:first-child){
  margin-top: 0;
}

/* Header button */
.r2-accordion .accordion-button{
  background: var(--r2-acc-bg);
  color: var(--r2-acc-fg);
  font-weight: 700;
  padding: .85rem 1rem;
  box-shadow: none !important;
}

/* Hover */
.r2-accordion .accordion-button:hover{
  background: var(--r2-acc-hover);
}

/* Expanded state */
.r2-accordion .accordion-button:not(.collapsed){
  background: var(--r2-acc-active-bg);
  color: var(--r2-acc-fg);
  border-bottom: 1px solid var(--r2-acc-active-border);
}

/* Focus ring */
.r2-accordion .accordion-button:focus{
  border-color: var(--r2-acc-active-border);
  box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--primary) 20%, transparent) !important;
}

/* Body */
.r2-accordion .accordion-body{
  background: var(--r2-acc-bg);
  color: var(--r2-acc-fg);
  padding: 1rem;
}

/* Small subtitle line inside header (optional) */
.r2-accordion .acc-subtitle{
  display:block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--r2-acc-muted);
  margin-top: .15rem;
}

/* Chevron icon: keep it theme-safe */
.r2-accordion .accordion-button::after{
  filter: none;
  opacity: .75;
}
html[data-theme="dark"] .r2-accordion .accordion-button::after{
  opacity: .9;
}

/* Optional: "compact" variant */
.r2-accordion.r2-accordion-compact .accordion-button{ padding: .65rem .85rem; }
.r2-accordion.r2-accordion-compact .accordion-body{ padding: .85rem; }

/* =========================================
   Accordion completion check: display-only
   ========================================= */

/* Make the right-side check indicator purely visual */
.r2-accordion .acc-check{
  pointer-events: none;     /* can't be clicked/hovered */
  user-select: none;        /* can't be selected */
  opacity: .92;
}

/* If your theme adds "active" effects to children, neutralize */
.r2-accordion .accordion-button:active .acc-check,
.r2-accordion .accordion-button:focus .acc-check{
  transform: none;
  filter: none;
}

/* Your completion state (keep this if you like it) */
.r2-accordion .accordion-button.is-complete{
  background-color: rgba(var(--bs-success-rgb), .10);
  border-bottom-color: rgba(var(--bs-success-rgb), .25);
}
.r2-accordion .accordion-button.is-complete,
.r2-accordion .accordion-button.is-complete:not(.collapsed){
  color: var(--bs-success-text-emphasis, var(--bs-success));
}

/* Show the icon only when complete */
.r2-accordion .acc-check{ display:none; color: var(--bs-success); }
.r2-accordion .accordion-button.is-complete .acc-check{
  display: inline-flex;
  align-items: center;
}




/* ========================
   AUTH CARDS + MESSAGES
======================== */
.auth-card {
  border: 1px solid var(--nav-bg);
  border-radius: 0.5rem;
  padding: 15px;
  background: var(--nav-bg);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.auth-card .card { margin: 0; }

/* Callouts */
.callout {
  padding: .85rem 1rem; margin: .75rem 0;
  border: 1px solid var(--callout-border); border-left-width: .25rem;
  border-radius: .25rem; background-color: var(--callout-bg);
  color: var(--app-fg);
}
.callout-warning { border-left-color: #f0ad4e; background-color: var(--callout-warning-bg); }
.callout-info    { border-left-color: #0dcaf0; background-color: var(--callout-info-bg); }
.callout-success { border-left-color: #198754; background-color: var(--callout-success-bg); }
.callout-danger  { border-left-color: #dc3545; background-color: var(--callout-danger-bg); }
.callout-primary { border-left-color: var(--primary); background-color: var(--callout-primary-bg); }

/* Password toggles */
#toggleLoginPass i,
#togglePass1 i,
#togglePass2 i { font-size: .9rem; line-height: 1; color: var(--muted); }
#toggleLoginPass:focus,
#toggleLoginPass:active,
#togglePass1:focus,
#togglePass2:focus,
#togglePass1:active,
#togglePass2:active {
  outline: none !important; box-shadow: none !important; background: transparent !important;
}

/* Login messages */
#login-messages .alert {
  font-size: .80rem; line-height: 1.25;
  padding: .5rem .75rem; border-radius: .35rem;
  position: relative; padding-right: 2rem;
}
#login-messages .alert .btn-close {
  position: absolute; top: .35rem; right: .5rem;
  width: .8rem; height: .8rem; background-size: .8rem .8rem;
}
#login-messages .alert ul { margin-bottom: 0; }
#login-messages .alert li { margin: 0; padding: 0; }

/* ========================
   AUTH LAYOUT OVERRIDES
======================== */
body.auth-layout, body.auth-layout html { overflow-x: hidden; }
body.auth-layout header,
body.auth-layout .navbar,
body.auth-layout .topbar,
body.auth-layout .top-nav,
body.auth-layout .app-header,
body.auth-layout #app-header { display: none !important; }
body.auth-layout .content-wrapper {
  width: 100% !important; margin: 0 !important; padding: 0 !important;
  max-width: 100% !important; transform: none !important; box-sizing: border-box;
  min-height: 100vh;
}
body.auth-layout .main-content {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: 2rem 0;
}
body.auth-layout .row { margin-left: 0 !important; margin-right: 0 !important; }
body.auth-layout [class^="col-"], body.auth-layout [class*=" col-"] {
  padding-left: .75rem; padding-right: .75rem; box-sizing: border-box;
}
body.auth-layout .container, body.auth-layout .container-fluid {
  max-width: 480px; padding-left: 1rem; padding-right: 1rem;
}
body.auth-layout .card {
  width: 100%; max-width: 480px; margin: 1rem auto;
}

/* Auth background */
body.auth-layout { background-color: var(--nav-bg) !important; }
body.auth-layout .content-wrapper,
body.auth-layout .main-content { background: transparent !important; }
body.auth-layout .card {
  background-color: var(--card-bg); color: var(--card-fg);
  border-radius: 8px; box-shadow: var(--card-shadow); border: 1px solid var(--card-border);
}

/* ========================
   GENERAL APP STYLES
======================== */
.company-contacts-heading {
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.company-contacts-heading:hover { white-space: normal; overflow: visible; text-overflow: unset; }

#property-address-option { display: block !important; visibility: visible !important; }

#category-dropdown.selection-dropdown-menu {
  position: absolute; top: 100%; left: 0; z-index: 1000; display: none;
  max-height: 250px; overflow-y: auto; border: 1px solid var(--card-border); background-color: var(--card-bg); color: var(--card-fg); width: 100%;
}

@media (max-width: 767px){ .view-btn[data-view="panel"] { display: none !important; } }

.sort-icon { margin-left: 4px; font-size: .9rem; vertical-align: middle; color: var(--muted); }
.active-sort .sort-icon { color: var(--primary); }
.sort-option { font-size: .75rem; }

.no-focus-outline:focus { box-shadow: none !important; outline: none !important; }

.card-link:hover .card {
  background-color: rgba(83, 109, 254, 0.25);
  transition: background-color .3s ease, color .3s ease;
}

.my-btn-group { position: relative; z-index: 2; }

.dropdown-item { cursor: pointer; }
.create-new { cursor: pointer; font-weight: bold; color: #007bff; }

.selection-dropdown-menu { width: 100%; z-index: 1050; max-height: 300px; overflow-y: auto; }
.my-custom-negative-margin { margin-top: -1rem; }

.form-control-custom-sm {
  padding-top: .3rem !important; padding-bottom: .3rem !important;
  padding-left: .5rem !important; font-size: .875rem; height: auto !important;
}

.label-header {
  position: absolute; top: 0; left: 5px; font-size: .75rem;
  color: var(--app-fg) !important; font-weight: bold; transform: translateY(-50%);
  background-color: var(--card-bg); padding: 0 4px; line-height: 1;
}

/*.selected-item {
  background-color: #f0f8ff; 
  border-left: 4px solid var(--primary);
}
*/

.selected-item {
  background-color: var(--row-active-bg, var(--callout-primary-bg, #e9f2ff)) !important;
  border-left: 3px solid var(--primary, #0d6efd) !important;
}
/*.nav-underline { border-bottom: 1px solid #777; }
.nav-underline .nav-link {
  position: relative; font-size: 12px; color: #777; padding-bottom: 10px;
  letter-spacing: .5px; transition: color .3s ease;
}
.nav-underline .nav-link.active { color: var(--primary); font-size: 12px; }
.nav-underline .nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 4px;
  background-color: #777; transition: width .3s ease;
}
.nav-underline .nav-link.active::after { width: 100%; background-color: var(--primary); }*/

.nav-underline {
  border-bottom: 1px solid var(--tab-border, var(--muted));
}
.nav-underline .nav-link {
  position: relative;
  font-size: 12px;
  color: var(--tab-fg, var(--muted));
  padding-bottom: 10px;
  letter-spacing: .5px;
  transition: color .3s ease;
}
.nav-underline .nav-link.active {
  color: var(--primary);
}
.nav-underline .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 4px;
  background-color: var(--tab-fg, var(--muted));
  transition: width .3s ease;
}
.nav-underline .nav-link.active::after {
  width: 100%;
  background-color: var(--primary);
}





.required-field::before { content: " * "; color: #dc3545; }
.verified-field::before {
  content: ""; display: inline-block; width: 1em; height: 1em;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="green"><path d="M13.485 1.929a1 1 0 0 1 1.415 1.415l-8 8a1 1 0 0 1-1.415 0l-4-4A1 1 0 0 1 2.9 5.93l3.293 3.293 7.293-7.293z"/></svg>') no-repeat center;
  background-size: contain; margin-right: 5px;
}

.logo-img { height: 75px; transform-origin: center; vertical-align: top; }
.bell-icon { fill: white; }
/*.bi-info-square-fill, .bi-info-circle-fill { fill: #b0b6b6 !important; }*/
.custom-tooltip { tooltip-color: white; tooltip-bg: var(--primary); }

.navbar.fixed-top { z-index: 1300; }

/* ========================
   SIDEBAR (fixed + smooth)
======================== */
:root {
  --navbar-h: 75px;
  --sb-w: 200px;
  --sb-mini-w: 80px;
  --sb-current-w: var(--sb-w);
}
:is(html, body).sidebar-expanded { --sb-current-w: var(--sb-w); }
:is(html, body).sidebar-mini     { --sb-current-w: var(--sb-mini-w); }
:is(html, body).sidebar-hidden   { --sb-current-w: 0px; }

/* Content reserves sidebar width */
.content-wrapper {
  min-height: 100vh;
  padding-top: var(--navbar-h);
  padding-left: var(--sb-current-w);
  background: var(--app-bg);
  transition: padding-left .25s ease, background .2s ease, color .2s ease;
}

/* Fixed sidebar */
#sidebar-nav {
  position: fixed; top: var(--navbar-h); left: 0;
  height: calc(100vh - var(--navbar-h));
  width: var(--sb-current-w); max-width: var(--sb-w);
  overflow-y: auto;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 5px 0 5px -5px rgba(0,0,0,.5);
  padding: 0 10px 10px 10px;
  z-index: 1100;
  transition: width .25s ease, padding .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}


/* Dark when visible */
:is(html, body).sidebar-dark #sidebar-nav {
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
}

/* Sticky mini header row inside sidebar */
.sidebar-mini-header {
  position: sticky; top: 0; background: inherit;
  padding: .35rem .25rem .35rem 0; z-index: 2;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: .35rem;
}

/* Sidebar meta block */
#sidebar-nav .sidebar-meta { padding: 0 .25rem .5rem .25rem; color: var(--sidebar-fg); }

/* Menu buttons */
#sidebar-nav .btn.btn-toggle {
  display: flex; gap: .5rem; align-items: center; justify-content: flex-start;
  width: 100%; padding: .35rem .5rem; font-weight: 600;
  background: transparent; border: 0; text-align: left; color: var(--sidebar-fg);
}
#sidebar-nav .btn.btn-toggle:hover { background: rgba(255,255,255,0.08); color: #ffffff; }
#sidebar-nav .btn.btn-toggle:focus { background: rgba(255,255,255,0.15); }

/* Icons & labels */
.nav-icon { font-size: 1.05rem; color: var(--sidebar-icon); }
.nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--sidebar-fg); }

/* Main content */
.main-content { min-width: 0; background: var(--app-bg); padding: 20px; color: var(--app-fg); }

/* Mini mode (stacked icon + label) */
:is(html, body).sidebar-mini #sidebar-nav {
  width: var(--sb-mini-w);
  padding-left: 4px; padding-right: 4px;
}
:is(html, body).sidebar-mini #sidebar-nav .sidebar-meta,
:is(html, body).sidebar-mini #sidebar-nav hr { display: none !important; }
:is(html, body).sidebar-mini #sidebar-nav .btn.btn-toggle {
  flex-direction: column; align-items: center; justify-content: center;
  gap: .15rem; padding: .35rem 0; text-align: center;
}
:is(html, body).sidebar-mini #sidebar-nav .nav-icon { font-size: 1.1rem; margin: 0; }
:is(html, body).sidebar-mini #sidebar-nav .nav-label {
  display: block !important; max-width: 100%;
  font-size: .65rem; line-height: 1.2; text-align: center; white-space: normal; overflow: visible;
}

/* Hidden mode (off-canvas) */
:is(html, body).sidebar-hidden #sidebar-nav {
  transform: translateX(-100%);
  width: 0; padding: 0; border-right: 0; box-shadow: none; overflow: hidden;
}

/* ========================
   CHEVRON TOGGLE (inside sidebar)
======================== */
#sidebar-mini-toggle {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  padding: 4px; border-radius: 50%; transition: background .2s ease;
}
#sidebar-mini-toggle:hover,
#sidebar-mini-toggle:focus { background: rgba(255,255,255,0.08); }
#sidebar-mini-toggle i.bi-chevron-double-left,
#sidebar-mini-toggle i.bi-chevron-double-right {
  color: var(--sidebar-icon); font-size: 1rem; transition: color .2s ease;
}
#sidebar-mini-toggle:hover i.bi-chevron-double-left,
#sidebar-mini-toggle:hover i.bi-chevron-double-right,
#sidebar-mini-toggle:focus i.bi-chevron-double-left,
#sidebar-mini-toggle:focus i.bi-chevron-double-right { color: #ffffff; }

/* Swap icons based on state */
/*#sidebar-mini-toggle i.bi-chevron-double-left  { display: inline; }
#sidebar-mini-toggle i.bi-chevron-double-right { display: none; }
:is(html, body).sidebar-mini #sidebar-mini-toggle i.bi-chevron-double-left  { display: none; }
:is(html, body).sidebar-mini #sidebar-mini-toggle i.bi-chevron-double-right { display: inline; }*/

/* ========================
   ACTIVE / HOVER STATES
======================== */
#sidebar-nav .btn.btn-toggle.active-dark {
  background: var(--sidebar-active);
  color: var(--sidebar-active-fg, #fff) !important;
  border-radius: 8px;
}

#sidebar-nav .btn.btn-toggle.active-dark .nav-label,
#sidebar-nav .btn.btn-toggle.active-dark .nav-icon {
  color: var(--sidebar-active-fg, #fff) !important;
}

#sidebar-nav .btn.btn-toggle.active-dark:hover {
  background: var(--sidebar-active-hover);
  color: var(--sidebar-active-fg, #fff) !important;
}

:is(html, body).sidebar-mini #sidebar-nav .btn.btn-toggle.active-dark {
  background: var(--sidebar-active-hover);
  border-radius: 10px;
  color: var(--sidebar-active-fg, #fff) !important;
}

/* ========================
   PEEK TAB (shows when hidden)
======================== */
.sidebar-peek-tab {
  position: fixed; top: var(--navbar-h); left: 0;
  width: 36px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-top-right-radius: 10px; border-bottom-right-radius: 10px;
  background: var(--sidebar-bg); color: var(--sidebar-fg);
  box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
  cursor: pointer; z-index: 1200;
  opacity: 0.5; pointer-events: none;
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.sidebar-peek-tab .bi { font-size: 1.1rem; }
.sidebar-peek-tab:hover,
.sidebar-peek-tab:focus { background: var(--sidebar-active); color: #fff; outline: none; }

/* Only visible when fully hidden */
:is(html, body).sidebar-hidden .sidebar-peek-tab { opacity: .5; pointer-events: auto; }

/* Mobile: slightly larger tab */
@media (max-width: 768px) {
  .sidebar-peek-tab { width: 40px; height: 44px; }
}

/* ========================
   NAVBAR COLOR
======================== */
.custom-navbar { background-color: var(--nav-bg) !important; color: var(--nav-fg); }

/* ========================
   MODALS
======================== */
.modal-backdrop { z-index: 2000 !important; }
.modal { z-index: 2050 !important; }


/* ========================
   DARK THEME OVERRIDES
   Activates when <html data-theme="dark"> (or body)
======================== */
:root {
  /* Optional: shared tokens for both themes */
  --bg: #ffffff;
  --fg: #111318;
  --muted: #6c757d;
  --card-bg: #ffffff;
  --card-border: #dee2e6;
  --surface: #fff;
  --input-bg: #fff;
  --input-fg: #111318;
  --input-border: #ced4da;
  --menu-bg: #fff;
  --menu-border: rgba(0,0,0,.15);
  --backdrop: rgba(0, 0, 0, .5);
}
html[data-theme="dark"], body[data-theme="dark"] {
  --bg: #0e1420;
  --fg: #e8ecf2;
  --muted: #b6bdc7;
  --card-bg: #141b2a;
  --card-border: #2b3447;
  --surface: #141b2a;
  --input-bg: #0f1724;
  --input-fg: #e8ecf2;
  --input-border: #293349;
  --menu-bg: #111827;
  --menu-border: #293349;
  --backdrop: rgba(0, 0, 0, .75);
}

/* Page background + text */
html[data-theme="dark"] body,
body[data-theme="dark"] {
  background-color: var(--bg) !important;
  color: var(--fg) !important;
}

/* Cards (incl. auth cards’ inner .card) */
html[data-theme="dark"] .card,
body[data-theme="dark"] .card {
  background-color: var(--card-bg) !important;
  color: var(--fg) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="dark"] .card .card-header,
html[data-theme="dark"] .card .card-footer {
  background-color: transparent !important;
  border-color: var(--card-border) !important;
}

/* Modals */
html[data-theme="dark"] .modal-content {
  background-color: var(--card-bg) !important;
  color: var(--fg) !important;
  border-color: var(--card-border) !important;
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  border-color: var(--card-border) !important;
  background: transparent !important;
}
html[data-theme="dark"] .modal-backdrop.show {
  background-color: #000 !important;
  opacity: 0.75 !important; /* aligns with --backdrop */
}

/* Dropdowns */
html[data-theme="dark"] .dropdown-menu {
  background-color: var(--menu-bg) !important;
  color: var(--fg) !important;
  border-color: var(--menu-border) !important;
}
html[data-theme="dark"] .dropdown-item {
  color: var(--fg) !important;
}
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
  background-color: rgba(255,255,255,0.06) !important;
}

/* Inputs */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .form-check-input {
  background-color: var(--input-bg) !important;
  color: var(--input-fg) !important;
  border-color: var(--input-border) !important;
}
html[data-theme="dark"] .form-control::placeholder {
  color: var(--muted) !important;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  border-color: #3b82f6 !important; /* soft blue focus */
  box-shadow: 0 0 0 .2rem rgba(59,130,246,.25) !important;
}

/* List group */
html[data-theme="dark"] .list-group-item {
  background-color: var(--card-bg) !important;
  color: var(--fg) !important;
  border-color: var(--card-border) !important;
}

/* Tables */
html[data-theme="dark"] .table {
  color: var(--fg) !important;
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,0.03);
  --bs-table-hover-bg: rgba(255,255,255,0.06);
  border-color: var(--card-border) !important;
}
html[data-theme="dark"] .table > :not(caption) > * > * {
  background-color: transparent !important;
  box-shadow: none !important;
}

/* Alerts / callouts */
html[data-theme="dark"] .callout {
  background-color: #0f1724 !important;
  border-color: #22304a !important;
  color: var(--fg) !important;
}
html[data-theme="dark"] .callout-primary   { border-left-color: #3b82f6 !important; }
html[data-theme="dark"] .callout-success   { border-left-color: #22c55e !important; }
html[data-theme="dark"] .callout-info      { border-left-color: #06b6d4 !important; }
html[data-theme="dark"] .callout-warning   { border-left-color: #f59e0b !important; }
html[data-theme="dark"] .callout-danger    { border-left-color: #ef4444 !important; }

/* Auth card wrapper (outer shell stays brand color; inner .card handled above) */
html[data-theme="dark"] .auth-card {
  border-color: #0a3d91 !important;
  background: #041e42 !important; /* keep your brand navy */
}

/* Content wrapper */
html[data-theme="dark"] .content-wrapper,
html[data-theme="dark"] .main-content {
  background: var(--bg) !important;
}

/* Selection dropdown (custom) */
html[data-theme="dark"] #category-dropdown.selection-dropdown-menu,
html[data-theme="dark"] .selection-dropdown-menu {
  background-color: var(--menu-bg) !important;
  color: var(--fg) !important;
  border-color: var(--menu-border) !important;
}

/* Misc text hues */
html[data-theme="dark"] .nav-underline .nav-link {
  color: #b6bdc7 !important;
}
html[data-theme="dark"] .nav-underline .nav-link.active {
  color: #3b82f6 !important;
}
html[data-theme="dark"] .label-header {
  color: var(--fg) !important;
  background: var(--card-bg) !important;
}

/* Scrollbars (webkit) */
html[data-theme="dark"] *::-webkit-scrollbar {
  width: 10px; height: 10px;
}
html[data-theme="dark"] *::-webkit-scrollbar-track {
  background: #0f1724;
}
html[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background-color: #26324a; border-radius: 8px; border: 2px solid #0f1724;
}

@media (max-width: 767px) {
  .view-switch-container {
    display: none !important;
  }
}

/* Always let JS decide which icon shows */
#sidebar-mini-toggle i.bi { display: inline !important; }

/* PeekTab: hide by default */
.sidebar-peek-tab {
  opacity: 0;
  pointer-events: none;
}

/* Show ONLY when the sidebar is fully hidden */
body.sidebar-hidden .sidebar-peek-tab {
  opacity: .6 !important;
  pointer-events: auto !important;
}

/* Explicitly hide in expanded & mini */
body.sidebar-expanded .sidebar-peek-tab,
body.sidebar-mini     .sidebar-peek-tab {
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Position info button aligned with label text baseline */
.position-relative > .position-absolute.top-0.end-0 {
  top: 50%;                     /* center vertically in field */
  right: 0.35rem;                /* snug to right edge */
  transform: translateY(-50%);   /* perfect vertical alignment */
  z-index: 3;
}

/* Info button styling */
.info-btn {
  --_size: 20px;
  width: var(--_size);
  height: var(--_size);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  box-shadow: none !important;
  cursor: pointer;
}

.info-btn:focus {
  outline: none;
  box-shadow: none !important;
}

/* Icon style */
.info-btn .bi {
  font-size: 0.7rem;
  color: var(--help-icon, #b0b6b6);
  transition: color 0.2s ease;
}

.info-btn:hover .bi,
.info-btn:focus .bi {
  color: var(--primary, #0d6efd);
}

/* Search Bar Width */
  .min-w-0 { min-width: 0; } /* let flex child actually shrink */

  /* Left column: 100% by default; 75% at md+ */
  @media (min-width: 768px) {
    .search-col-md {
      flex: 0 0 33%;
      max-width: 33%;
    }

  }


/* Reserve space in inputs/selects */
.position-relative > .form-control,
.position-relative > .form-select {
  padding-right: 2rem;
}

/* Ensure labels don’t run under the button */
.position-relative > .label-header {
  padding-right: 1.75rem;
}

/* Inline label + help button container */
.label-inline {
  position: absolute;
  top: 0;
  left: 5px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--card-bg);
  padding: 0 4px;
  line-height: 1;
  z-index: 3;
}

/* Neutralize the old absolute label rules inside the inline wrapper */
.label-inline .label-header {
  position: static !important;
  transform: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Keep your existing info-btn styles (size, color, hover) */
.info-btn { --_size: 18px; width: var(--_size); height: var(--_size); padding: 0; display: inline-flex; align-items:center; justify-content:center; border:0; background:transparent; }
.info-btn .bi { font-size: .7rem; color: var(--help-icon,#b0b6b6); transition: color .2s; }
.info-btn:hover .bi, .info-btn:focus .bi { color: var(--primary,#0d6efd); }

/* Input/select padding so content doesn’t sit under the label+icon */
.position-relative > .form-control,
.position-relative > .form-select { padding-right: 2rem; }

/* If you had .position-relative > .label-header absolute before, you can keep it
   for other places; the .label-inline override above handles these fields. */

/* Raise help offcanvas above modal + backdrop */
.offcanvas-backdrop { z-index: 2055 !important; }
.offcanvas, .offcanvas.show { z-index: 2060 !important; }
.offcanvas-backdrop.show { opacity: .5 !important; }

/* ===========================
   GLOBAL TABLE SORT ICONS
   (theme-aware, no shifting)
=========================== */

.table td,
.table th {
  color: var(--bs-table-color, var(--bs-body-color));
}

/* GLOBAL TABLE SORT ICONS (no shift, inactive muted, active blue) */
.table th .sort-option {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: .75rem;
}

.table th .sort-icon {
  display: inline-block;
  width: 1em;
  margin-left: 4px;
  font-size: .9rem;
  vertical-align: middle;

  opacity: 0.45; /* muted */
  /*color: var(--muted, #6c757d);*/
  transition: color .15s ease, opacity .15s ease;
}

.table th.active-sort .sort-icon {
  opacity: 1;
  color: var(--primary, #0d6efd);
}

/* Header icons (not the sort caret) */
.table thead th i:not(.sort-icon) {
  margin-right: .35rem;   /* space between icon and label */
  margin-left: 0;         /* no unnecessary left margin */
  opacity: .55;           /* muted look */
}

/* Checkbox column: narrow, centered */
.table-selectable .col-select { width: 32px; text-align: center; }
.table-selectable .col-select input[type="checkbox"] {
  width: 14px; height: 14px; cursor: pointer;
}

/* ===========================
   ROUNDED CORNERS FOR 
=========================== */

/* Outer border only + rounded corners */
.table-wrap {
  border: 1px solid var(--card-border);
  border-radius: .4rem;
  overflow: hidden;       /* clips hover/bg inside radius */
  box-shadow: none;
}
.table-wrap .table { margin-bottom: 0; }

/* Show gutter: must color the TABLE, not tbody */
.table-wrap .table.table-row-gap {
  border-collapse: separate !important;   /* enable spacing */
  border-spacing: 0 .25rem !important;     /* vertical gap size */
  /*background-color: var(--surface, #f5f5f5); /* gutter color */
  background-color: var(--th-background);
}

/* Rows look like cards */
.table-row-gap tbody tr {
  background-color: var(--card-bg);
}

/* Remove all inner borders so only wrapper’s border shows */
.table-row-gap > :not(caption) > * > * {
  border: 0 !important;
}

/* Keep header flush at the top (no extra gap above it) */
.table-row-gap thead { background-color: var(--card-bg); }
/* optional: ensure header cells don’t inherit any odd borders */
.table-row-gap thead th { border: 0; }

/* ===========================
   Sticky Tabs for modals
=========================== */
.sticky-tabs {
  position: sticky;
  top: 0;                        /* stick to top of scrollable parent */
  z-index: 1020;                 /* above content */
  background: var(--surface, var(--card-bg));
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 1px 0 rgba(0,0,0,.03); /* subtle pinned effect */
}

body {
  color: var(--bs-body-color) !important;
  background-color: var(--app-bg) !important;
}

/*h1, h2, h3, h4, h5, h6 {
  color: var(--bs-heading-color) !important;
}*/

h1, h2, h3, h4, h5, h6 {
  color: var(--bs-heading-color);
}

/* Global table text color */
table td,
table th {
  color: var(--bs-body-color) !important;
}

/* Ensure rows have a visible base in dark mode */
html[data-theme="dark"] table tbody tr {
  background-color: var(--card-bg) !important;
}

/* Apply theme-aware hover globally */
table.table-hover tbody tr:hover {
  background-color: var(--table-row-hover-bg) !important;
}


/* ===========================
   NOTE ROW HOVER + SELECT FIX
   (strong selector to beat theme order)
=========================== */

body #notes-flat-list .note-row {
  background-color: var(--card-bg, #fff);
  border-radius: .25rem;
  /*margin-bottom: .25rem;*/
  padding-bottom: .5rem;
  padding-top: .5rem;
  cursor: pointer;
  transition: background-color .15s ease, border-left .15s ease;
}

/* Hover effect */
body #notes-flat-list .note-row:hover,
html[data-theme="dark"] body #notes-flat-list .note-row:hover {
  background-color: var(--table-row-hover-bg, rgba(0, 0, 0, 0.04)) !important;
}

/* Selected state (notes) – shared primary stripe + callout background */
body #notes-flat-list .note-row.selected,
html[data-theme="dark"] body #notes-flat-list .note-row.selected {
  background-color: var(--row-active-bg, var(--callout-primary-bg, #e9f2ff)) !important;
  border-left: 3px solid var(--primary, #0d6efd) !important;
}

/* Hover still theme-aware */
html[data-theme="dark"] body #notes-flat-list .note-row:hover {
  background-color: var(--table-row-hover-bg, rgba(255,255,255,0.08)) !important;
}

/* Subtle divider between notes */
body #notes-flat-list .note-row {
  position: relative;
}

/* Light separator line */
body #notes-flat-list .note-row:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 1px;
  background-color: var(--card-border, #e9ecef);
  opacity: 0.5;
}

/* Dark theme softer line */
html[data-theme="dark"] body #notes-flat-list .note-row:not(:last-child)::after {
  background-color: var(--card-border, #2b3447);
  opacity: 0.35;
}


#geoOverlay {
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#geoOverlay.show {
  display: flex !important;
  opacity: 1;
}



/* GLOBAL LIST ROW HOVER + SELECT
   (assets, properties, tasks, etc.)
================================== */
body .list-group-item[role="button"] {
  cursor: pointer;
  background-color: var(--card-bg, #fff);
  border-left: 3px solid transparent;
  transition:
    background-color .15s ease,
    border-left-color .15s ease;
}

body .list-group-item[role="button"]:hover,
html[data-theme="dark"] body .list-group-item[role="button"]:hover {
  background-color: var(--table-row-hover-bg, rgba(0, 0, 0, 0.04)) !important;
}

body .list-group-item[role="button"].selected,
body .list-group-item[role="button"].active,
html[data-theme="dark"] body .list-group-item[role="button"].selected,
html[data-theme="dark"] body .list-group-item[role="button"].active {
  background-color: var(--row-active-bg, var(--callout-primary-bg, #e9f2ff)) !important;
  border-left-color: var(--primary, #0d6efd) !important;
}

body .list-group-item.active,
html[data-theme="dark"] body .list-group-item.active {
  background-color: var(--row-active-bg, var(--callout-primary-bg, #e9f2ff)) !important;
  border-left: 3px solid var(--primary, #0d6efd) !important;
}

/* THEME-SPECIFIC ROW ACTIVE COLORS (MEDIUM + DARK) */
html[data-theme="medium"] .selected-item,
html[data-theme="dark"]   .selected-item {
  background-color: var(--sidebar-active) !important;
  color: var(--sidebar-active-fg, var(--bs-body-color)) !important;
}

html[data-theme="medium"] body .list-group-item[role="button"].selected,
html[data-theme="medium"] body .list-group-item[role="button"].active,
html[data-theme="medium"] body .list-group-item.active,
html[data-theme="dark"]   body .list-group-item[role="button"].selected,
html[data-theme="dark"]   body .list-group-item[role="button"].active,
html[data-theme="dark"]   body .list-group-item.active {
  background-color: var(--sidebar-active) !important;
  color: var(--sidebar-active-fg, var(--bs-body-color)) !important;
}
/* KIP  */



.kpi-card:hover,
.card-soft:hover {
  background-color: var(--card-hover-bg);
  /*box-shadow: 0 0 3px 2px var(--primary);*/
  box-shadow: 0 0 2px 3px color-mix(in srgb, var(--primary) 50%, transparent);
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

      /* Fix card-header rounding mismatch */




/*.card.card-soft .card-header {
  border-top-left-radius: .75rem;
  border-top-right-radius: .75rem;
}*/


.card.card-soft .card-header.bg-primary-subtle {
  backdrop-filter: blur(4px);
  border-top-left-radius: .75rem;
  border-top-right-radius: .75rem;
}

/* Keep bg-primary-subtle headers consistent across themes */
.card-header.bg-primary-subtle {
  background: color-mix(in srgb, var(--primary) 5%, transparent) !important;
  color: var(--primary) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 22%, var(--card-border)) !important;
}
  .section-title { font-weight: 700; font-size: .95rem; color: var(--bs-secondary-color,#6c757d); letter-spacing:.3px; text-transform: uppercase; }
.card-soft { border:1px solid var(--bs-border-color,#dee2e6); border-radius:.75rem; }

.clear-selection-btn {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  z-index: 5;
}

.clear-selection-btn:hover {
  color: #212529;
}



/* Zoom Control Container */
.leaflet-control-zoom {
  border: none;
  border-radius: 0.375rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Zoom In/Out Buttons */
.leaflet-control-zoom a {
  background-color: #0d6efd;
  color: #fff;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border: none;
  width: 34px;
  height: 34px;
  line-height: 34px;
  font-size: 20px;
  transition: background-color 0.2s, opacity 0.2s;
  opacity: 0.85;
}

/* Hover effect with full opacity */
.leaflet-control-zoom a:hover {
  background-color: #0b5ed7;
  color: #fff;
  opacity: 1;
}


.leaflet-control.layer-toggle button {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem !important;
}

.leaflet-control.layer-toggle .active {
  background-color: #0d6efd;
  color: #fff;
}

/* Custom pill toggle styling */
.layer-toggle .btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.layer-toggle {
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 10px;
}


/* Task mini type badge card */
.mini-type-card {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: .5rem;
  background: var(--card-bg);
}

/* Activity List Display */
  .act-row { border: 1px solid var(--bs-border-color); border-radius: .65rem; }
  .act-icon-tile {
    width: 2.25rem; height: 2.25rem;
    border-radius: .6rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    display:flex; align-items:center; justify-content:center;
    flex-shrink: 0;
  }
  .act-meta { font-size: .6rem; line-height: 1.1; }
  .act-title { font-size: .8rem; line-height: 1.15; }
  .act-badge { font-size: .58rem; letter-spacing: .02em; }

  /* Make the taskTypeBadgeCard fit inside the icon tile */
  .act-icon-tile .mini-type-card { width:2.25rem !important; height:2.25rem !important; border-radius:.6rem; }
  .act-icon-tile .mini-type-card i { font-size:.8rem !important; }


/*  Minimap Zoom Control Container */
.leaflet-control-zoom {
  border: none;
  border-radius: 0.375rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Zoom In/Out Buttons */
.leaflet-control-zoom a {
  background-color: #0d6efd;
  color: #fff;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  border: none;
  width: 34px;
  height: 34px;
  line-height: 34px;
  font-size: 20px;
  transition: background-color 0.2s, opacity 0.2s;
  opacity: 0.85;
}

/* Hover effect with full opacity */
.leaflet-control-zoom a:hover {
  background-color: #0b5ed7;
  color: #fff;
  opacity: 1;
}


.leaflet-control.layer-toggle button {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem !important;
}

.leaflet-control.layer-toggle .active {
  background-color: #0d6efd;
  color: #fff;
}

/* Custom pill toggle styling */
.layer-toggle .btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.layer-toggle {
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 10px;
}

/* Entity Card Profile */
.entity-avatar-wrap{
  width:72px;height:72px;border-radius:50%;
  overflow:hidden;flex-shrink:0;
  box-shadow:0 0 0 2px rgba(255,255,255,.7), 0 4px 10px rgba(15,23,42,.25);
  background:#f8fafc;
  display:flex;align-items:center;justify-content:center;
}
.entity-avatar-img{ width:100%; height:100%; object-fit:cover; display:block; }

/* FLAT initials: white-ish background, primary text */
.entity-avatar-initials{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  text-transform:uppercase;
  /* text + bg now theme-aware */
  color: var(--primary, #0d6efd);
  background: var(--card-bg, #ffffff);
  font-size:1.4rem;
}

/* User Profile Avatar (reuses entity look, but with fixed size) */
.user-avatar-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .7),
    0 4px 10px rgba(15, 23, 42, .25);
  background: #f8fafc;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* FLAT initials: white-ish background, primary text */
.user-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary, #0d6efd);
  background: var(--card-bg, #ffffff);
  font-size: 1.8rem;
}


/* Task modal should be "mobile width" even on desktop */
#task-modal .modal-dialog.modal-task-narrow{
  /* "mobile-ish" width on desktop/tablet */
  max-width: 430px !important;
  width: calc(100vw - 1.25rem);
  margin: .5rem auto;
}

/* Fixed height on desktop (scroll inside body) */
@media (min-width: 576px){
  #task-modal .modal-dialog.modal-task-narrow{
    height: 78vh;               /* fixed height */
  }
  #task-modal .modal-content{
    height: 100%;
    display:flex;
    flex-direction:column;
  }
  #task-modal .modal-body{
    flex: 1 1 auto;
    overflow:auto;
  }
}

/* Fullscreen on small devices is handled by modal-fullscreen-sm-down,
   but enforce good height math and remove weird spacing */
#task-modal .modal-body.task-modal-body{
  margin: 0;
  padding-top: 1rem;            /* tweak as needed */
}

/* Optional: if any of your task partials rely on mt-4 from default modal body */
#task-modal .modal-body.mt-4{ margin-top:0 !important; }

