/* ============================================================
   GDP CRM — Mockup System
   Shared stylesheet — Mazer-inspired theme overrides
   Used by every page in /mockups/pages/
   ============================================================ */

:root {
  --gdp-primary:        #435ebe;   /* current Mazer primary */
  --gdp-primary-rgb:    67, 94, 190;
  --gdp-primary-soft:   #e8edfa;
  --gdp-primary-dark:   #354a96;
  --gdp-success:        #198754;
  --gdp-success-soft:   #d8efe3;
  --gdp-warning:        #f59e0b;
  --gdp-warning-soft:   #fdf1d6;
  --gdp-danger:         #dc3545;
  --gdp-danger-soft:    #fadcdf;
  --gdp-info:           #0dcaf0;
  --gdp-info-soft:      #d4f3fa;
  --gdp-purple:         #6f42c1;
  --gdp-pink:           #d63384;
  --gdp-text:           #25396f;
  --gdp-text-muted:     #6c757d;
  --gdp-text-light:     #9aa0a6;
  --gdp-border:         #e9ecef;
  --gdp-border-soft:    #f1f3f5;
  --gdp-bg:             #f5f6fa;
  --gdp-surface:        #ffffff;
  --gdp-sidebar:        #ffffff;
  --gdp-shadow-sm:      0 1px 2px rgba(33, 50, 91, .06);
  --gdp-shadow:         0 4px 12px rgba(33, 50, 91, .08);
  --gdp-shadow-lg:      0 12px 32px rgba(33, 50, 91, .10);
  --gdp-radius:         0.5rem;
  --gdp-radius-sm:      0.375rem;
  --gdp-radius-lg:      0.75rem;
  --gdp-sidebar-width:  260px;
  --gdp-sidebar-collapsed: 78px;
  --gdp-navbar-height:  64px;
  /* Spacing scale — use these instead of ad-hoc rem values in new rules */
  --gdp-space-xs: .25rem;
  --gdp-space-sm: .5rem;
  --gdp-space-md: 1rem;
  --gdp-space-lg: 1.5rem;
  --gdp-space-xl: 2rem;
  /* Type scale */
  --gdp-fs-sm:   13px;
  --gdp-fs-base: 14px;
  --gdp-fs-h5:   15px;
  --gdp-fs-h3:   24px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--gdp-bg);
  color: var(--gdp-text);
  font-size: 14px;
  margin: 0;
}

a { color: var(--gdp-primary); text-decoration: none; }
a:hover { color: var(--gdp-primary-dark); }

/* Skip link — visually hidden until focused, then slides in at top-left (WCAG 2.4.1) */
.skip-link {
  position: absolute; left: 8px; top: -56px; z-index: 100000;
  background: var(--gdp-primary); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 8px;
  font-weight: 700; font-size: 14px;
  transition: top .15s ease;
}
.skip-link:focus {
  top: 0; color: #fff;
  outline: 2px solid #fff; outline-offset: 2px;
}
/* Programmatic focus on the content region shouldn't paint a stray outline */
#main-content:focus { outline: none; }

/* ====================== APP SHELL ====================== */
.app { display: flex; min-height: 100vh; }
.app-main {
  flex: 1;
  display: flex; flex-direction: column;
  min-width: 0;
  margin-left: var(--gdp-sidebar-width);
  transition: margin-left .2s ease;
}
.sidebar-collapsed .app-main { margin-left: var(--gdp-sidebar-collapsed); }

/* ============= SIDEBAR ============= */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--gdp-sidebar-width);
  background: var(--gdp-sidebar);
  border-right: 1px solid var(--gdp-border);
  display: flex; flex-direction: column;
  z-index: 1030; transition: width .2s ease;
}
.sidebar-collapsed .sidebar { width: var(--gdp-sidebar-collapsed); }

.sidebar-header {
  height: var(--gdp-navbar-height);
  padding: 0 1.25rem;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--gdp-border);
  gap: .75rem;
}
.sidebar-logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gdp-primary), var(--gdp-primary-dark));
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 18px;
  flex: none;
  box-shadow: 0 2px 8px rgba(67,94,190,.35);
}
.sidebar-brand { line-height: 1.1; }
.sidebar-brand b { display: block; font-weight: 800; font-size: 16px; color: var(--gdp-text); }
.sidebar-brand small { font-size: 11px; color: var(--gdp-text-muted); }
.sidebar-collapsed .sidebar-brand { display: none; }

.sidebar-menu {
  flex: 1; overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
}
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: #d6d9e0; border-radius: 4px; }

.sidebar-section {
  padding: 1rem 1.5rem 0.4rem;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gdp-text-light);
}
.sidebar-collapsed .sidebar-section {
  padding: .75rem 0 .25rem;
  text-align: center; font-size: 9px;
}

.sidebar-menu ul { list-style: none; padding: 0; margin: 0; }
.sidebar-item { position: relative; margin: 1px 0.75rem; }
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .75rem;
  border-radius: var(--gdp-radius-sm);
  color: var(--gdp-text);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-link i {
  font-size: 18px; width: 22px; text-align: center;
  color: var(--gdp-text-muted);
  flex: none;
}
.sidebar-link:hover { background: var(--gdp-primary-soft); color: var(--gdp-primary); }
.sidebar-link:hover i { color: var(--gdp-primary); }
.sidebar-item.active > .sidebar-link {
  background: var(--gdp-primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(67,94,190,.3);
}
.sidebar-item.active > .sidebar-link i { color: #fff; }

.sidebar-link .chev { margin-left: auto; font-size: 14px; transition: transform .15s; }
.sidebar-item.open > .sidebar-link .chev { transform: rotate(90deg); }

.sidebar-submenu {
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease;
  margin-left: 2.5rem;
}
.sidebar-item.open > .sidebar-submenu { max-height: 600px; }
.sidebar-submenu a {
  display: block; padding: .35rem .75rem; font-size: 13px;
  color: var(--gdp-text-muted); border-radius: 6px;
  position: relative;
}
.sidebar-submenu a:hover { color: var(--gdp-primary); }
.sidebar-submenu a.active {
  color: var(--gdp-primary); font-weight: 700;
  background: var(--gdp-primary-soft);
}

.sidebar-collapsed .sidebar-link span,
.sidebar-collapsed .sidebar-link .chev,
.sidebar-collapsed .sidebar-submenu { display: none; }
.sidebar-collapsed .sidebar-link { justify-content: center; padding: .55rem; }

/* ============= NAVBAR ============= */
.navbar-top {
  position: sticky; top: 0; z-index: 1020;
  background: var(--gdp-surface);
  border-bottom: 1px solid var(--gdp-border);
  height: var(--gdp-navbar-height);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem;
}
.navbar-top .burger {
  border: none; background: transparent; color: var(--gdp-text);
  font-size: 22px; cursor: pointer; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 8px;  /* 44px = comfortable touch target */
}
.navbar-top .burger:focus-visible { outline: 2px solid var(--gdp-primary); outline-offset: 2px; }
.navbar-top .burger:hover { background: var(--gdp-bg); }
.navbar-search {
  flex: 1; max-width: 460px;
  position: relative;
}
.navbar-search i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gdp-text-muted);
}
.navbar-search input {
  width: 100%; padding: .55rem 1rem .55rem 2.4rem;
  border: 1px solid var(--gdp-border); border-radius: 999px;
  background: var(--gdp-bg);
  font-size: 13px;
}
.navbar-search input:focus { outline: none; border-color: var(--gdp-primary); background: #fff; box-shadow: 0 0 0 3px rgba(var(--gdp-primary-rgb), .12); }
.navbar-search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: #fff; border: 1px solid var(--gdp-border); border-radius: 4px;
  padding: 1px 6px; font-size: 10px; color: var(--gdp-text-muted);
}

.navbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

/* ===== Global reporting-user filter (in navbar) ===== */
.navbar-user-filter {
  display: flex; align-items: center; gap: .4rem;
  background: var(--gdp-bg);
  border: 1px solid var(--gdp-border);
  border-radius: 999px;
  padding: 3px 12px 3px 14px;
  transition: border-color .15s, background .15s;
  max-width: 240px;
}
.navbar-user-filter:hover,
.navbar-user-filter:focus-within {
  border-color: var(--gdp-primary);
  background: #fff;
}
.navbar-user-filter > i {
  color: var(--gdp-text-muted);
  font-size: 14px;
  flex: none;
}
.navbar-user-filter:focus-within > i { color: var(--gdp-primary); }
.navbar-user-filter select {
  border: 0; background: transparent; padding: 6px 24px 6px 0;
  font-size: 12.5px; font-weight: 600; color: var(--gdp-text);
  cursor: pointer; outline: none; min-width: 140px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%236c757d' d='M3.204 5l4.796 5.481L12.796 5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right center;
  background-size: 14px;
}
@media (max-width: 991px) {
  .navbar-user-filter { display: none; }
}
.navbar-icon {
  position: relative; width: 38px; height: 38px;
  border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--gdp-border); background: var(--gdp-surface);
  color: var(--gdp-text); cursor: pointer; transition: all .15s;
  padding: 0; font: inherit;  /* neutralize native <button> chrome */
}
.navbar-icon:hover { background: var(--gdp-primary-soft); color: var(--gdp-primary); border-color: var(--gdp-primary-soft); }
.navbar-icon i { font-size: 17px; }
.navbar-icon .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gdp-danger); border: 2px solid #fff;
}
.navbar-icon .badge-count {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--gdp-danger); color: #fff;
  border-radius: 999px; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}

/* Account-menu trigger is now a real <button>; strip UA chrome so the inner
   .user-menu pill renders exactly as the old anchor did. */
.user-menu-trigger { border: none; background: transparent; padding: 0; font: inherit; cursor: pointer; text-align: left; }
.navbar-icon:focus-visible,
.user-menu-trigger:focus-visible { outline: 2px solid var(--gdp-primary); outline-offset: 2px; }

.user-menu {
  display: flex; align-items: center; gap: .75rem;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  cursor: pointer; transition: background .15s;
}
.user-menu:hover { background: var(--gdp-bg); }
.user-menu .user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gdp-primary), var(--gdp-primary-dark));
  color: #fff; font-weight: 700;
  display: grid; place-items: center;
}
.user-menu .user-name { line-height: 1.15; }
.user-menu .user-name b { display: block; font-size: 13px; font-weight: 700; color: var(--gdp-text); }
.user-menu .user-name small { font-size: 11px; color: var(--gdp-text-muted); }

/* ============= MAIN CONTENT ============= */
.content { padding: 1.5rem 1.75rem 3rem; }
.page-heading { margin-bottom: 1.5rem; }
.page-heading .crumbs {
  font-size: 12px; color: var(--gdp-text-muted);
  margin-bottom: .25rem;
}
.page-heading .crumbs a { color: var(--gdp-text-muted); }
.page-heading .crumbs b { color: var(--gdp-primary); font-weight: 600; }
.page-heading h3 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -.01em; color: var(--gdp-text); }
.page-heading p { margin: .15rem 0 0; color: var(--gdp-text-muted); font-size: 13px; }

.page-header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}

/* ============= CARDS ============= */
.card {
  background: var(--gdp-surface);
  border: 1px solid var(--gdp-border);
  border-radius: var(--gdp-radius);
  box-shadow: var(--gdp-shadow-sm);
  margin-bottom: 1.25rem;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gdp-border-soft);
  /* display: flex;  */
  align-items: center; justify-content: space-between; gap: .75rem;
  flex-wrap: wrap;
}
.card-header h5 { margin: 0; font-size: 15px; font-weight: 700; color: var(--gdp-text); }
.card-header .card-sub { margin: .15rem 0 0; color: var(--gdp-text-muted); font-size: 12px; }

/* List-page header toolbars (filter + search + action buttons). The :has scope
   limits this to card headers that actually contain form controls — i.e. the
   list toolbars — so plain card headers elsewhere are untouched. Below the
   tablet breakpoint the controls stack and fill the row instead of overflowing. */
@media (max-width: 767.98px) {
  .card-header:has(.form-control, .form-select) .form-control,
  .card-header:has(.form-control, .form-select) .form-select {
    flex: 1 1 100%; width: 100%;
  }
  .card-header:has(.form-control, .form-select) { flex: 1 1 auto; }
  .card-header:has(.form-control, .form-select) [id^="filterSelectedUser"],
  .card-header:has(.form-control, .form-select) [id$="SelectedUserId"] {
    flex: 1 1 100%; min-width: 0 !important;
  }
}
.card-body { padding: 1.25rem; }
/* List tables sit flush in their card — drop padding on the card-body that holds the list partial. */
.card-body:has(> .partialContainer) { padding: 0; }
/* …but detail-page partials (Notes/Todo/Lead Journey/Disposition use data-url-lead) are
   content, not flush tables — keep their normal body padding. */
.card-body:has(> .partialContainer[data-url-lead]) { padding: 1.25rem; }

/* Lead Update page: body flush at the bottom so the footer's top padding is the only gap. */
#createPartialForm > #partialContainer,
#createPartialForm .card-body { padding-bottom: 0; margin-bottom: 0; }
/* Journey / Disposition timelines wrap to the card width — never scroll sideways.
   Both classes raise specificity above the global .partialContainer { overflow-x:auto }. */
.partialContainer.leadDispositionContainer,
.partialContainer.historyContainer { overflow-x: hidden; max-width: 100%; }
.card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--gdp-border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  background: var(--gdp-border-soft);
  border-radius: 0 0 var(--gdp-radius) var(--gdp-radius);
}

/* ============= BUTTONS ============= */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  border-radius: var(--gdp-radius-sm);
  padding: .5rem .9rem; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--gdp-primary); border-color: var(--gdp-primary); color: #fff; }
.btn-primary:hover { background: var(--gdp-primary-dark); border-color: var(--gdp-primary-dark); color: #fff; }
.btn-outline-primary { border-color: var(--gdp-primary); color: var(--gdp-primary); background: transparent; }
.btn-outline-primary:hover { background: var(--gdp-primary); color: #fff; }
.btn-outline-secondary { border-color: var(--gdp-border); color: var(--gdp-text); background: var(--gdp-surface); }
.btn-outline-secondary:hover { background: var(--gdp-bg); border-color: var(--gdp-text-muted); }
.btn-light { background: var(--gdp-bg); color: var(--gdp-text); border-color: var(--gdp-border); }
.btn-light:hover { background: var(--gdp-border); }
.btn-success { background: var(--gdp-success); color: #fff; border-color: var(--gdp-success); }
.btn-danger  { background: var(--gdp-danger); color: #fff; border-color: var(--gdp-danger); }
.btn-warning { background: var(--gdp-warning); color: #fff; border-color: var(--gdp-warning); }
.btn-sm { padding: .3rem .65rem; font-size: 12px; }
.btn-icon { justify-content: center; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--gdp-text-muted); }
.btn-ghost:hover { background: var(--gdp-bg); color: var(--gdp-text); }

/* Icon-only list refresh / reload buttons — same height and visual weight as the
   neighbouring Apply / Clear / Search buttons, with the glyph dead-centered.
   The <i> is made a flex box so the icon ignores bootstrap-icons' vertical-align:
   text-top (which otherwise pushes the glyph to the top of the button). */
#reloadTable, #reloadLeadTable, #refreshInaccessibleTable, #refresh-btn {
  justify-content: center;
  padding-left: 8px; padding-right: 8px;
  aspect-ratio: 1;            /* perfect square; height auto-matches Apply/Clear */
}
#reloadTable > i, #reloadLeadTable > i,
#refreshInaccessibleTable > i, #refresh-btn > i {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
}

/* ============= FORMS ============= */
.form-label { font-size: 12px; font-weight: 700; color: var(--gdp-text); margin-bottom: .25rem; letter-spacing: 0.01em; }
.form-label .req { color: var(--gdp-danger); margin-left: 2px; }
/* Saved-filter Choices control: fixed tidy width so the selected value doesn't
   sprawl/wrap after a filter is picked. Same rule the Lead page gets from overview.css,
   now shared so Sales/Opportunity match it. CSS-only — does not touch the change handler. */
.saved-filter .choices { width: 170px; max-width: 100%; margin-bottom: 0; }
.form-control, .form-select {
  width: 100%; padding: .5rem .75rem; font-size: 13px;
  border: 1px solid var(--gdp-border); border-radius: var(--gdp-radius-sm);
  background: #fff; color: var(--gdp-text);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--gdp-primary);
  box-shadow: 0 0 0 3px rgba(var(--gdp-primary-rgb), .12);
}
.form-control[readonly] { background: var(--gdp-bg); }
.form-text { font-size: 11px; color: var(--gdp-text-muted); margin-top: .2rem; }
.form-group { margin-bottom: 1rem; }
.form-check-input:checked { background-color: var(--gdp-primary); border-color: var(--gdp-primary); }
.form-switch .form-check-input { width: 2.25rem; height: 1.15rem; }
.input-group {
  display: flex; align-items: stretch;
}
.input-group .form-control { border-radius: 0; }
.input-group > :first-child { border-radius: var(--gdp-radius-sm) 0 0 var(--gdp-radius-sm); }
.input-group > :last-child  { border-radius: 0 var(--gdp-radius-sm) var(--gdp-radius-sm) 0; }
.input-group-text {
  display: flex; align-items: center; justify-content: center; padding: 0 .75rem;
  background: var(--gdp-bg); border: 1px solid var(--gdp-border); color: var(--gdp-text-muted);
  font-size: 13px;
}
/* Icon-only addons: fixed-width, dead-centered box so every leading/trailing
   glyph lines up in one column and reads crisply. Scoped via :has to icon-only
   addons so text prefixes (units, $, https://) keep their padded sizing. */
.input-group-text:has(> i.bi:only-child) { width: 44px; padding: 0; }
.input-group-text > i.bi {
  display: block; width: 1em; text-align: center;
  font-size: 16px; line-height: 1; color: var(--gdp-text);
}

/* ============= BADGES ============= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: var(--gdp-bg); color: var(--gdp-text);
  border: 1px solid var(--gdp-border);
}
.badge-primary  { background: var(--gdp-primary-soft); color: var(--gdp-primary); border-color: transparent; }
.badge-success  { background: var(--gdp-success-soft); color: var(--gdp-success); border-color: transparent; }
.badge-warning  { background: var(--gdp-warning-soft); color: #b8761a; border-color: transparent; }
.badge-danger   { background: var(--gdp-danger-soft); color: var(--gdp-danger); border-color: transparent; }
.badge-info     { background: var(--gdp-info-soft); color: #07788f; border-color: transparent; }
.badge-purple   { background: #ede1fa; color: var(--gdp-purple); border-color: transparent; }
.badge-pink     { background: #fbe1ed; color: var(--gdp-pink); border-color: transparent; }
.badge-dark     { background: #25396f; color: #fff; border-color: transparent; }
.badge-soft     { background: #f1f3f5; color: var(--gdp-text-muted); }
/* Status badges sit on solid contextual backgrounds (Active/Inactive, roles, etc.) —
   force white text for contrast. Light variants (.bg-light, .bg-light-*) are excluded. */
.badge.bg-primary, .badge.bg-secondary, .badge.bg-success,
.badge.bg-danger, .badge.bg-warning, .badge.bg-info, .badge.bg-dark { color: #fff !important; }
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

/* ============= STAT CARDS ============= */
.stat-card { padding: 1.25rem; position: relative; overflow: hidden; }
.stat-card .stat-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--gdp-text-muted);
  display: flex; align-items: center; gap: 6px;
}
.stat-card .stat-value {
  font-size: 28px; font-weight: 800; color: var(--gdp-text);
  letter-spacing: -.02em; margin: .35rem 0 .25rem;
  line-height: 1;
}
.stat-card .stat-delta { font-size: 12px; color: var(--gdp-text-muted); }
.stat-card .stat-delta b { font-weight: 700; }
.stat-card .stat-delta.up b { color: var(--gdp-success); }
.stat-card .stat-delta.down b { color: var(--gdp-danger); }
.stat-card .stat-icon {
  position: absolute; top: 1rem; right: 1rem;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--gdp-primary-soft); color: var(--gdp-primary);
  font-size: 22px; line-height: 1;
}
/* Center the glyph itself — bootstrap-icons use vertical-align:text-top, which
   leaves the icon sitting high in the badge; a flex <i> with line-height:1 fixes it. */
.stat-card .stat-icon i {
  display: flex; align-items: center; justify-content: center;
  width: 1em; height: 1em; line-height: 1;
}
.stat-card.stat-success .stat-icon { background: var(--gdp-success-soft); color: var(--gdp-success); }
.stat-card.stat-warning .stat-icon { background: var(--gdp-warning-soft); color: #b8761a; }
.stat-card.stat-danger  .stat-icon { background: var(--gdp-danger-soft); color: var(--gdp-danger); }
.stat-card.stat-info    .stat-icon { background: var(--gdp-info-soft); color: #07788f; }
.stat-card.stat-purple  .stat-icon { background: #ede1fa; color: var(--gdp-purple); }

/* ============= TABLES ============= */
.gdp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.gdp-table thead th {
  text-align: left; padding: .75rem 1rem;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  color: var(--gdp-text-muted); text-transform: uppercase;
  background: var(--gdp-border-soft);
  border-bottom: 1px solid var(--gdp-border);
  /* Wrap header labels to multiple lines so columns use the available width first;
     the horizontal scrollbar only appears when even wrapped content can't fit. */
  white-space: normal; vertical-align: bottom;
}
.gdp-table thead th .dataTable-sorter { white-space: normal; }
.gdp-table thead th.num { text-align: right; }
.gdp-table tbody td {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--gdp-border-soft);
  vertical-align: middle;
}
.gdp-table tbody tr:hover td { background: var(--gdp-bg); }
.gdp-table tbody tr:last-child td { border-bottom: none; }
.gdp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.gdp-table .row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.gdp-table .row-actions .btn-icon { width: 30px; height: 30px; border: 1px solid var(--gdp-border-soft); background: transparent; color: var(--gdp-text-muted); border-radius: 6px; }
.gdp-table .row-actions .btn-icon:hover { background: var(--gdp-bg); color: var(--gdp-primary); border-color: var(--gdp-primary); }

/* Sort indicator — replace simple-datatables' faint mini-triangles with clear
   up/down arrows: neutral ↕ when sortable, highlighted ↑ / ↓ for the active sort. */
.gdp-table .dataTable-sorter::before { display: none; }            /* drop the up-triangle pseudo */
.gdp-table th .dataTable-sorter { padding-right: 1.3em; }
.gdp-table th .dataTable-sorter::after {
  content: "\2195";                                                /* ↕ neutral (sortable) */
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: auto; height: auto; border: 0;
  font-size: 12px; font-weight: 700; line-height: 1;
  color: var(--gdp-text-light); opacity: 1;
}
.gdp-table th.asc .dataTable-sorter::after,
.gdp-table th.sorting_asc .dataTable-sorter::after  { content: "\2191"; color: var(--gdp-primary); }  /* ↑ */
.gdp-table th.desc .dataTable-sorter::after,
.gdp-table th.sorting_desc .dataTable-sorter::after { content: "\2193"; color: var(--gdp-primary); }  /* ↓ */

.table-wrap { overflow-x: auto; }

/* Color swatch used in master-data list "Color" columns. Defined globally so it
   also renders when these list partials are loaded into the Master Data hub
   (the per-page Index <style> blocks aren't present there). */
.backgroundColor-circle {
  width: 40px; height: 20px;
  border-radius: 15%;
  border: 1px solid var(--gdp-border, #ccc);
  display: inline-block;
  vertical-align: middle;
}
.table-toolbar {
  padding: .85rem 1.25rem;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--gdp-border-soft);
}
.table-toolbar .toolbar-spacer { flex: 1; }

.pager {
  display: flex; align-items: center; gap: 4px;
}
.pager button {
  width: 32px; height: 32px; border: 1px solid var(--gdp-border);
  background: #fff; border-radius: 6px; color: var(--gdp-text);
  font-size: 12px; cursor: pointer;
}
.pager button:hover:not(:disabled) { background: var(--gdp-primary-soft); color: var(--gdp-primary); border-color: var(--gdp-primary); }
.pager button.active { background: var(--gdp-primary); color: #fff; border-color: var(--gdp-primary); }
.pager button:disabled { opacity: .5; cursor: not-allowed; }

/* ============= TABS ============= */
.gdp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--gdp-border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.gdp-tabs a {
  padding: .65rem 1rem; font-size: 13px; font-weight: 600;
  color: var(--gdp-text-muted); border-bottom: 2px solid transparent;
  cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.gdp-tabs a:hover { color: var(--gdp-primary); }
.gdp-tabs a.active { color: var(--gdp-primary); border-color: var(--gdp-primary); }
.gdp-tabs a .count {
  background: var(--gdp-bg); padding: 1px 7px; border-radius: 999px;
  font-size: 11px; color: var(--gdp-text-muted);
}
.gdp-tabs a.active .count { background: var(--gdp-primary-soft); color: var(--gdp-primary); }

/* ============= KANBAN ============= */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 290px; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.kanban-col {
  background: var(--gdp-border-soft);
  border-radius: var(--gdp-radius);
  padding: .75rem;
  display: flex; flex-direction: column; gap: .65rem;
  min-height: 400px;
}
.kanban-col-head {
  display: flex; align-items: center; gap: .5rem;
  padding: 4px 4px 8px;
}
.kanban-col-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.kanban-col-head b { font-size: 13px; }
.kanban-col-head .count {
  font-size: 11px; color: var(--gdp-text-muted);
  background: #fff; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--gdp-border);
}
.kanban-col-head .add { margin-left: auto; border: none; background: transparent; color: var(--gdp-text-muted); cursor: pointer; }
.kanban-card {
  background: var(--gdp-surface); border: 1px solid var(--gdp-border);
  border-radius: var(--gdp-radius-sm); padding: .75rem .85rem;
  box-shadow: var(--gdp-shadow-sm);
  cursor: grab;
}
.kanban-card:hover { box-shadow: var(--gdp-shadow); transform: translateY(-1px); transition: all .15s; }
.kanban-card .kc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kanban-card .kc-name { font-size: 13px; font-weight: 700; color: var(--gdp-text); }
.kanban-card .kc-co { font-size: 12px; color: var(--gdp-text-muted); margin-top: 1px; }
.kanban-card .kc-meta { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
.kanban-card .kc-foot { display: flex; align-items: center; gap: 4px; margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--gdp-border); }
.kanban-card .kc-date { margin-left: auto; font-size: 11px; color: var(--gdp-text-muted); }

/* ============= AVATARS ============= */
.av { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--gdp-primary-soft); color: var(--gdp-primary); font-weight: 700; font-size: 12px; border: 2px solid #fff; }
.av-sm { width: 24px; height: 24px; font-size: 10px; }
.av-lg { width: 56px; height: 56px; font-size: 18px; }
.av-xl { width: 88px; height: 88px; font-size: 28px; border-width: 3px; }
.av-1 { background: var(--gdp-primary-soft); color: var(--gdp-primary); }
.av-2 { background: var(--gdp-success-soft); color: var(--gdp-success); }
.av-3 { background: var(--gdp-warning-soft); color: #b8761a; }
.av-4 { background: var(--gdp-danger-soft); color: var(--gdp-danger); }
.av-5 { background: #ede1fa; color: var(--gdp-purple); }
.av-6 { background: #fbe1ed; color: var(--gdp-pink); }
.av-7 { background: var(--gdp-info-soft); color: #07788f; }
.av-stack { display: inline-flex; }
.av-stack .av { margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }

/* ============= TIMELINE ============= */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--gdp-border); }
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -23px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid var(--gdp-primary);
}
.timeline-item.success::before { border-color: var(--gdp-success); }
.timeline-item.warning::before { border-color: var(--gdp-warning); }
.timeline-item.danger::before  { border-color: var(--gdp-danger); }
.timeline-item .ti-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.timeline-item .ti-head b { font-size: 13px; font-weight: 700; }
.timeline-item .ti-head time { font-size: 11px; color: var(--gdp-text-muted); }
.timeline-item p { margin: .2rem 0 0; font-size: 13px; color: var(--gdp-text-muted); }

/* ============= PROGRESS ============= */
.gdp-progress { height: 8px; background: var(--gdp-border-soft); border-radius: 99px; overflow: hidden; }
.gdp-progress > div { height: 100%; background: var(--gdp-primary); border-radius: 99px; }
.gdp-progress-sm { height: 4px; }

/* ============= ALERTS / EMPTY ============= */
.alert {
  padding: .75rem 1rem; border-radius: var(--gdp-radius-sm);
  font-size: 13px; display: flex; align-items: center; gap: .75rem;
  border: 1px solid transparent;
}
.alert-info     { background: var(--gdp-info-soft); color: #07788f; }
.alert-warning  { background: var(--gdp-warning-soft); color: #b8761a; }
.alert-success  { background: var(--gdp-success-soft); color: var(--gdp-success); }
.alert-danger   { background: var(--gdp-danger-soft); color: var(--gdp-danger); }

.empty-state { padding: 3rem 2rem; text-align: center; color: var(--gdp-text-muted); }
.empty-state i { font-size: 48px; color: var(--gdp-text-light); }
.empty-state h6 { margin: .5rem 0; font-weight: 700; color: var(--gdp-text); font-size: 14px; }

/* ============= MISC ============= */
.divider { height: 1px; background: var(--gdp-border); margin: 1rem 0; }
.text-muted { color: var(--gdp-text-muted) !important; }
.text-primary { color: var(--gdp-primary) !important; }
.text-success { color: var(--gdp-success) !important; }
.text-danger  { color: var(--gdp-danger) !important; }
.text-warning { color: var(--gdp-warning) !important; }
.bg-soft { background: var(--gdp-bg); }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.fs-11 { font-size: 11px !important; }
.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }
.fs-14 { font-size: 14px !important; }

.kbd-key {
  background: #fff; border: 1px solid var(--gdp-border); border-radius: 4px;
  padding: 0 5px; font-size: 10px; color: var(--gdp-text-muted);
  font-family: 'Nunito', monospace;
}

/* ====== Dropdown menu ====== */
.dropdown-wrap { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--gdp-border);
  border-radius: var(--gdp-radius); box-shadow: var(--gdp-shadow-lg);
  min-width: 220px; padding: .5rem 0; z-index: 1050;
  display: none;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem; font-size: 13px;
  color: var(--gdp-text); width: 100%; text-align: left;
  background: transparent; border: none; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--gdp-bg); color: var(--gdp-primary); }
.dropdown-menu .divider { margin: .25rem 0; }
.dropdown-menu .header { padding: .25rem 1rem; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--gdp-text-muted); font-weight: 700; }

/* ====== Modal (lightweight) ====== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(33, 50, 91, .35);
  display: grid; place-items: center; z-index: 1040;   /* below Bootstrap .modal (1050) so dialogs stay clickable */
}
.modal-card {
  background: #fff; border-radius: var(--gdp-radius-lg);
  width: min(560px, 92vw); box-shadow: var(--gdp-shadow-lg);
  overflow: hidden; max-height: 90vh; display: flex; flex-direction: column;
}
.modal-head, .modal-foot {
  padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between;
}
.modal-head { border-bottom: 1px solid var(--gdp-border-soft); }
.modal-foot { border-top: 1px solid var(--gdp-border-soft); gap: .5rem; justify-content: flex-end; }
.modal-body { padding: 1.25rem; overflow-y: auto; }

/* Popups: a select / Choices dropdown opened near the bottom of a modal must show
   ABOVE the footer, not get hidden behind it or clipped by the body's overflow.
   While the dropdown is open, let the body/content overflow and lift the panel. */
.modal .choices__list--dropdown { z-index: 1065 !important; }
.modal-body:has(.choices.is-open) { overflow: visible; }
.modal-dialog-scrollable .modal-content:has(.choices.is-open) { overflow: visible; }

/* ====== Drawer ====== */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(33, 50, 91, .35); z-index: 1055; display: none; }
.drawer-backdrop.show { display: block; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 96vw);
  background: #fff; box-shadow: var(--gdp-shadow-lg); z-index: 1060;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.show { transform: translateX(0); }
.drawer-head, .drawer-foot { padding: 1rem 1.25rem; border-bottom: 1px solid var(--gdp-border-soft); display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.drawer-foot { border-bottom: 0; border-top: 1px solid var(--gdp-border-soft); justify-content: flex-end; gap: .5rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }

/* ====== Auth ====== */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--gdp-surface);
}
.auth-art {
  background: url('../images/bg/4853433.jpg') center/cover no-repeat;
}
.auth-brand { display: inline-flex; align-items: center; }
.auth-brand img { height: 40px; width: auto; display: block; }
.auth-foot { font-size: 12px; color: var(--gdp-text-muted); }
.auth-form {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: 2.5rem 2rem;
}
.auth-form-inner { width: min(420px, 100%); margin: auto 0; }

/* ====== Calendar ====== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--gdp-border); border: 1px solid var(--gdp-border); border-radius: var(--gdp-radius); overflow: hidden; }
.cal-grid .cal-head { background: var(--gdp-border-soft); padding: .55rem; text-align: center; font-size: 11px; font-weight: 700; color: var(--gdp-text-muted); text-transform: uppercase; letter-spacing: .06em; }
.cal-day { background: #fff; min-height: 110px; padding: .5rem; display: flex; flex-direction: column; gap: 4px; }
.cal-day.muted { background: var(--gdp-border-soft); color: var(--gdp-text-light); }
.cal-day.today { background: var(--gdp-primary-soft); }
.cal-day .d { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--gdp-text); margin-bottom: 2px; }
.cal-day.today .d { color: var(--gdp-primary); }
.cal-evt { font-size: 11px; padding: 2px 6px; border-radius: 4px; line-height: 1.3; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-evt.primary  { background: var(--gdp-primary-soft); color: var(--gdp-primary); }
.cal-evt.success  { background: var(--gdp-success-soft); color: var(--gdp-success); }
.cal-evt.warning  { background: var(--gdp-warning-soft); color: #b8761a; }
.cal-evt.danger   { background: var(--gdp-danger-soft); color: var(--gdp-danger); }
.cal-evt.purple   { background: #ede1fa; color: var(--gdp-purple); }

/* ====== Responsive ====== */

/* Off-canvas backdrop: dims + locks the page behind the mobile sidebar.
   Created/toggled by gdp-shell.js; only ever shown <=991px. */
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 1029;
  background: rgba(33, 50, 91, .45);
  opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }
@media (min-width: 992px) { .sidebar-backdrop { display: none !important; } }
/* Prevent the page behind the open off-canvas sidebar from scrolling. */
body.sidebar-open { overflow: hidden; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: none; box-shadow: var(--gdp-shadow-lg); }
  .app-main { margin-left: 0 !important; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}

/* Tighter gutters + smaller headings on phones so content gets the space. */
@media (max-width: 575px) {
  body { font-size: 13px; }            /* nudge body copy down on small phones */
  .content { padding: 1rem 1rem 2.5rem; }
  .navbar-top { padding: 0 .85rem; gap: .5rem; }
  .page-heading { margin-bottom: 1.25rem; }
  .page-heading h3 { font-size: 20px; }
  .card-header { padding: .85rem 1rem; }
  .card-header h5 { font-size: 14px; }
  .card-body { padding: 1rem; }
  .card-body:has(> .partialContainer) { padding: 0; }
}

/* ============================================================
   RECONCILIATION — integrate the GDP theme into the live app.
   (gdp-theme.css is loaded LAST so these win over Bootstrap/Mazer.)
   ============================================================ */

/* The app keeps its existing Bootstrap modals (#modal-delete, #modal-status,
   SmartLead sync). The theme only defines .modal-card/.modal-backdrop, which
   the app does not use, so Bootstrap modals are unaffected. Keep app loader
   and overlay above the shell. */
#loader { z-index: 2000; }
#loadingOverlay { z-index: 1900; }

/* Session-expiry warning (shown only on idle timeout; JS toggles inline display).
   Extracted from inline styles in _Layout.cshtml — values unchanged. */
.session-modal { display: none; position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.5); justify-content: center; align-items: center; }
.session-modal__box { background: #fff; padding: 30px; border-radius: 10px;
  max-width: 400px; width: 90%; text-align: center; box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.session-modal__icon { font-size: 48px; margin-bottom: 10px; }
.session-modal__title { color: #dc3545; margin-bottom: 10px; }
.session-modal__text { color: #6c757d; margin-bottom: 20px; }
.session-modal__actions { display: flex; gap: 10px; justify-content: center; }
.session-modal__btn { padding: 10px 24px; border: none; border-radius: 6px;
  cursor: pointer; font-size: 14px; color: #fff; }
.session-modal__btn--primary { background: #0d6efd; }
.session-modal__btn--danger { background: #dc3545; }

/* Notification + user menus are Bootstrap dropdowns; let Bootstrap/Popper own
   their placement. The theme supplies only the surface (bg/border/radius). */
.navbar-top .dropdown-menu[data-bs-popper] { position: absolute; }

/* Content fills the viewport below the sticky navbar. */
.app-main > .content {
  min-height: calc(100vh - var(--gdp-navbar-height));
  display: flex; flex-direction: column;
  min-width: 0;            /* allow flex children to shrink instead of forcing page-wide overflow */
}
/* Flex/grid items default to min-width:auto, which lets a wide list table widen the
   whole page. Let the content column (and the hub's grid columns) shrink, and keep
   wide tables scrolling horizontally INSIDE the partial/card on narrow devices. */
.app-main > .content > * { min-width: 0; }
.md-layout > * { min-width: 0; }
.partialContainer { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
/* Pagination/footer row: card-body padding is 0 so the table sits flush — give the
   pagination its own inset and kill Bootstrap's negative gutter margins (which would
   otherwise spill past the card edge and create a spurious second horizontal scroll). */
.partialContainer > .row { margin-left: 0; margin-right: 0; padding: .85rem 1.25rem; }

/* Footer is the last flex item in .content. margin-top:auto pins it to the
   bottom of the viewport when the page is shorter than the screen, and collapses
   to 0 when content overflows — so on tall pages it simply flows after the
   content and is only seen once you scroll to the end. */
.app-main > .content > footer { margin-top: auto; }

/* Footer breathing room + muted "end of page" separator. */
.app-main .footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--gdp-border); font-size: 12px; }
