/* =====================================================================
   X1 LMS  —  Design System v2.0
   Palette: Slate + Blue accent
   ===================================================================== */

/* ── Custom Properties ────────────────────────────────────────────── */
:root {
  --sb-width:         260px;
  --topnav-h:         54px;

  /* Sidebar */
  --sb-bg:            #0f172a;
  --sb-hover:         #1e293b;
  --sb-border:        rgba(255,255,255,0.06);
  --sb-text:          #94a3b8;
  --sb-bright:        #f1f5f9;
  --sb-section:       #334155;

  /* Page */
  --bg-page:          #f1f5f9;
  --bg-card:          #ffffff;
  --border:           #e2e8f0;
  --text-1:           #0f172a;
  --text-2:           #475569;
  --text-3:           #94a3b8;

  /* Accent */
  --accent:           #2563eb;
  --accent-h:         #1d4ed8;
  --accent-light:     #eff6ff;

  /* Status */
  --c-new:            #2563eb;
  --c-dnc:            #64748b;
  --c-pitched:        #0891b2;
  --c-ip:             #d97706;
  --c-fallout:        #dc2626;
  --c-registered:     #16a34a;
  --c-recycled:       #334155;
  --c-todays:         #7c3aed;
  --c-overdue:        #b91c1c;
}

/* ── Reset / Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-page);
  color: var(--text-1);
}

a { transition: color .15s, background .15s; }
a:hover, a:focus { text-decoration: none !important; outline: none !important; box-shadow: none; }
button:focus { outline: none !important; box-shadow: none !important; }
h1,h2,h3,h4,h5,.h1,.h2,.h3,.h4,.h5 {
  font-weight: 600;
  line-height: 1.4;
  font-family: inherit;
  color: var(--text-1);
}
label { color: var(--text-2); font-weight: 500; font-size: 13px; }

/* ── Layout ───────────────────────────────────────────────────────── */
.wrapper { width: 100%; min-height: 100vh; display: flex; }

/* ── Sidebar ──────────────────────────────────────────────────────── */
#sidebar {
  min-width: var(--sb-width);
  max-width: var(--sb-width);
  background: var(--sb-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin .25s ease;
  flex-shrink: 0;
  z-index: 200;
  overflow: hidden;
}
#sidebar.active { margin-left: calc(-1 * var(--sb-width)); }

@media (max-width: 991.98px) {
  #sidebar { position: fixed; height: 100%; margin-left: calc(-1 * var(--sb-width)); }
  #sidebar.active { margin-left: 0; }
}

/* Brand row */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-brand-logo {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: -.5px;
  flex-shrink: 0;
}
.sb-brand-name {
  color: var(--sb-bright);
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

/* User row */
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
  text-decoration: none;
}
.sb-user:hover { background: var(--sb-hover); }
.sb-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}
.sb-user-name {
  color: var(--sb-bright);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.sb-user-emp { color: var(--sb-section); font-size: 11px; }

/* Search */
.sb-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-search form { display: flex; gap: 0; }
.sb-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}
.sb-search-icon {
  position: absolute;
  left: 9px;
  color: #475569;
  font-size: 11px;
  pointer-events: none;
}
.sb-search-input {
  width: 100%;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px 0 0 6px;
  padding: 7px 8px 7px 27px;
  color: var(--sb-text);
  font-size: 12px;
  outline: none;
  transition: border-color .15s;
}
.sb-search-input::placeholder { color: #475569; }
.sb-search-input:focus { border-color: var(--accent); color: var(--sb-bright); }
.sb-search-submit {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0 10px;
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.sb-search-submit:hover { background: var(--accent-h); }

/* Nav scroll area */
.sb-nav {
  padding: 8px 0 20px;
  overflow-y: auto;
  flex: 1;
}
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }

.sb-section-label {
  padding: 10px 16px 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sb-section);
}
.sb-divider { height: 1px; background: var(--sb-border); margin: 6px 0; }

.sb-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 500;
  gap: 9px;
  border-left: 3px solid transparent;
  transition: all .12s;
  cursor: pointer;
}
.sb-item:hover, .sb-item.active {
  color: var(--sb-bright);
  background: #1e293b;
  border-left-color: var(--accent);
}
.sb-item i { width: 15px; text-align: center; font-size: 13px; flex-shrink: 0; }
.sb-item span { flex: 1; }

/* Agent stat pills inside sidebar */
.sb-lead-stats {
  padding: 4px 10px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sb-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.sb-stat:hover { color: #fff; opacity: 1; transform: translateY(-1px); }
.sb-stat-badge {
  background: rgba(0,0,0,.25);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 10px;
  color: #fff;
}
.sb-stat-new       { background: #1d4ed8; }
.sb-stat-dnc       { background: #475569; }
.sb-stat-pitched   { background: #0e7490; }
.sb-stat-ip        { background: #b45309; }
.sb-stat-recycled  { background: #374151; }
.sb-stat-fallout   { background: #991b1b; }
.sb-stat-registered{ background: #15803d; }
.sb-stat-todays    { background: #6d28d9; }
.sb-stat-overdue   { background: #b91c1c; }

/* ── Top Navigation ───────────────────────────────────────────────── */
.topnav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: var(--topnav-h);
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}
#sidebarCollapse {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .12s, color .12s;
  line-height: 1;
  flex-shrink: 0;
}
#sidebarCollapse:hover { background: var(--bg-page); color: var(--text-1); }
.topnav-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.topnav-right { display: flex; align-items: center; gap: 4px; }
.topnav-btn {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 16px;
  transition: background .12s, color .12s;
  position: relative;
  line-height: 1;
}
.topnav-btn:hover { background: var(--bg-page); color: var(--text-1); }
.topnav-user {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.topnav-user:hover { background: var(--bg-page); }
.topnav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

/* ── Content area ─────────────────────────────────────────────────── */
#content {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-page);
  transition: all .25s;
}
.main_page_content { padding: 14px 16px; flex: 1; }

/* ── Page title bar ───────────────────────────────────────────────── */
.page-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}
.page-title-bar .breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
}
.page-title-bar .breadcrumb-item a { color: var(--text-2); }
.page-title-bar .breadcrumb-item.active { color: var(--text-3); }
.breadcrumb-item+.breadcrumb-item::before { content: "/"; color: var(--text-3); }

/* Progress bar (inline under title) */
#page_load_progress {
  height: 2px !important;
  border-radius: 0;
  margin: 0 !important;
  background: var(--accent-light);
}
#page_load_progress .indeterminate { background: var(--accent); }

/* Legacy page-header support */
.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-block { padding: 10px 20px; }
.page-header-title h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1) !important;
  margin: 0;
}
.page-header .breadcrumb {
  background: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  float: right;
}

/* ── Cards ────────────────────────────────────────────────────────── */
.card1 {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
  margin-top: 12px;
  overflow: hidden;
}
.card_heading {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-2);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  width: 100%;
  margin: 0;
}
.card1_content { padding: 16px; }
.card1_floating_menu {
  float: right;
  color: var(--text-2);
  font-size: 18px;
  padding: 0 8px;
  cursor: pointer;
  margin-top: 4px;
}

/* ── Lead metric tiles ────────────────────────────────────────────── */
.lead_card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  padding: 13px 15px 11px;
  min-width: 148px;
  float: left;
  margin: 5px;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
  color: var(--text-1);
  text-align: left;
}
.lead_card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15,23,42,.09);
  text-decoration: none;
  color: var(--text-1);
}
a .lead_card { text-decoration: none; color: var(--text-1); }
a:hover .lead_card { text-decoration: none; }

.lc-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: 7px;
  white-space: nowrap;
}
.lc-count {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-1);
}

/* Per-status colors */
.lead_card_new       { border-left-color: var(--c-new); }
.lead_card_new       .lc-count { color: var(--c-new); }
.lead_card_dnc       { border-left-color: var(--c-dnc); }
.lead_card_dnc       .lc-count { color: var(--c-dnc); }
.lead_card_pitched   { border-left-color: var(--c-pitched); }
.lead_card_pitched   .lc-count { color: var(--c-pitched); }
.lead_card_ip        { border-left-color: var(--c-ip); }
.lead_card_ip        .lc-count { color: var(--c-ip); }
.lead_card_fallout   { border-left-color: var(--c-fallout); }
.lead_card_fallout   .lc-count { color: var(--c-fallout); }
.lead_card_registered{ border-left-color: var(--c-registered); }
.lead_card_registered .lc-count { color: var(--c-registered); }
.lead_card_recycled  { border-left-color: var(--c-recycled); }
.lead_card_recycled  .lc-count { color: var(--c-recycled); }
.lead_card_todays    { border-left-color: var(--c-todays); }
.lead_card_todays    .lc-count { color: var(--c-todays); }
.lead_card_overdue   { border-left-color: var(--c-overdue); }
.lead_card_overdue   .lc-count { color: var(--c-overdue); }

/* Tile group wrappers */
.tile-group { margin-bottom: 14px; }
.tile-group::after { content: ""; display: table; clear: both; }
.tile-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  transition: all .15s;
}
.btn.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.btn-primary:hover, .btn.btn-primary:focus {
  background: var(--accent-h) !important;
  border-color: var(--accent-h) !important;
  color: #fff;
}
.btn-default {
  background: #f1f5f9 !important;
  border-color: var(--border) !important;
  color: var(--text-1) !important;
}
.btn-default:hover { background: #e2e8f0 !important; }
.btn-action { padding-right: 22px !important; }
.btn-icon-only { height: 30px; }
.btn-icon-only::after { content: '' !important; }

/* ── Task-list split-pane layout ─────────────────────────────────── */
.tl-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.tl-list-panel {
  width: 420px;
  min-width: 260px;
  max-width: 640px;
  flex-shrink: 0;
  padding-right: 0;
}
/* Drag handle between panels */
.tl-resizer {
  width: 5px;
  flex-shrink: 0;
  cursor: col-resize;
  background: var(--border);
  border-radius: 3px;
  transition: background .15s;
  margin: 0 2px;
}
.tl-resizer:hover,
.tl-resizer.is-dragging { background: var(--accent); }
.tl-detail-panel {
  flex: 1;
  min-width: 0;
  padding-left: 0;
}
@media (max-width: 767px) {
  .tl-layout { flex-direction: column; }
  .tl-list-panel { width: 100%; max-width: 100%; padding-right: 0; }
  .tl-resizer { display: none; }
  .tl-detail-panel { padding-left: 0; }
}

/* Lead item cards (replaces table rows in task_list) */
.lead-list {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.lead-list::-webkit-scrollbar { width: 4px; }
.lead-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.lead-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
  border-left: 3px solid transparent;
}
.lead-item:hover { background: #f8fafc; }
.lead-item.lead_selected {
  background: var(--accent-light);
  border-left-color: var(--accent);
}
.lead-item.li-overdue-border { border-left-color: #fca5a5; }
.lead-item.li-overdue-border.lead_selected { border-left-color: var(--accent); }

/* top row: checkbox + name + status badge */
.li-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.li-check { flex-shrink: 0; cursor: pointer; margin-top: 1px; }
.li-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* mid row: ID + source + agent */
.li-mid {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  padding-left: 20px;
  margin-bottom: 2px;
}
.li-id { font-weight: 600; color: var(--text-2); font-size: 11px; }
.li-source {
  background: #f1f5f9;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-2);
  max-width: 110px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.li-assignee {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
  white-space: nowrap;
}

/* bottom row: date + overdue */
.li-bot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 20px;
}
.li-date { font-size: 11px; color: var(--text-2); }
.li-overdue { font-size: 11px; color: #dc2626; font-weight: 600; }

/* Leads panel card flex layout so list scrolls inside */
/* NOTE: no overflow:hidden here — that clips dropdown menus.
   Scrolling is handled by #lead_list_scroll inside. */
#leads_card {
  display: flex !important;
  flex-direction: column;
}
.leads-card-header {
  flex-shrink: 0;
}
.leads-card-meta {
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.leads-card-meta a { color: var(--text-2); font-size: 12px; }
.leads-card-footer {
  flex-shrink: 0;
  padding: 5px 10px;
  border-top: 1px solid var(--border);
}
/* Compact pagination inside the narrow leads panel */
.leads-card-footer > div { font-size: 10px; color: var(--text-3); margin-bottom: 2px; }
.leads-card-footer > div > p { margin: 0; line-height: 1.4; }
.leads-card-footer .pagination { flex-wrap: wrap; gap: 2px; border: none; background: none; }
.leads-card-footer .pagination a {
  padding: 3px 7px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Tables ───────────────────────────────────────────────────────── */
.table { font-size: 13px; color: var(--text-1); }
.table thead th {
  background: #f8fafc;
  border-top: none;
  border-bottom: 2px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
  padding: 9px 12px;
  white-space: nowrap;
}
.table td {
  vertical-align: middle;
  padding: 9px 12px;
  border-top: 1px solid var(--border);
}
.table-hover tbody tr:hover { background: #f8fafc; }
.table-responsive { min-height: 200px; }

/* ── Forms ────────────────────────────────────────────────────────── */
.form-control {
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  padding: 7px 11px;
  color: var(--text-1);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  outline: none;
}
.form-group { margin-bottom: 14px !important; }
.input_error { color: #dc2626; margin-left: 8px; font-size: 12px; }
.required::before { content: '*'; color: #dc2626; margin-right: 2px; }

/* ── Badges ───────────────────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 4px; }

/* ── Navbar bootstrap override ────────────────────────────────────── */
.navbar {
  background: var(--bg-card) !important;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

/* ── Dropdowns ────────────────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12) !important;
  padding: 4px;
  font-size: 13px;
  margin-top: 6px;
}
.dropdown-item {
  border-radius: 5px;
  padding: 7px 12px;
  color: var(--text-1);
  transition: background .12s;
}
.dropdown-item:hover { background: var(--accent-light); color: var(--accent); }
.dropdown-toggle::after { content: none !important; }

/* ── Row reset ────────────────────────────────────────────────────── */
.row { margin: 0 !important; }

/* ── Progress bar ─────────────────────────────────────────────────── */
.progress {
  position: relative;
  height: 3px;
  display: block;
  width: 100%;
  background: var(--accent-light);
  border-radius: 0;
  overflow: hidden;
  margin: 0 !important;
}
.nomargin { margin: 0 !important; }
.progress .determinate {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--accent);
  transition: width .3s linear;
}
.progress .indeterminate { background: var(--accent); }
.progress .indeterminate::before {
  content: '';
  position: absolute;
  background: inherit;
  top: 0; left: 0; bottom: 0;
  animation: indeterminate 2.1s cubic-bezier(.65,.815,.735,.395) infinite;
}
.progress .indeterminate::after {
  content: '';
  position: absolute;
  background: inherit;
  top: 0; left: 0; bottom: 0;
  animation: indeterminate-short 2.1s cubic-bezier(.165,.84,.44,1) infinite;
  animation-delay: 1.15s;
}
@keyframes indeterminate {
  0%   { left: -35%;  right: 100%; }
  60%  { left: 100%;  right: -90%; }
  100% { left: 100%;  right: -90%; }
}
@keyframes indeterminate-short {
  0%   { left: -200%; right: 100%; }
  60%  { left: 107%;  right: -8%;  }
  100% { left: 107%;  right: -8%;  }
}

/* ── Comments ─────────────────────────────────────────────────────── */
.comment_box { margin: 16px 0; width: 100%; }
.comment {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.comment_user_photo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment_user_name  { font-weight: 600; font-size: 13px; margin-bottom: 2px; color: var(--text-1); }
.comment_date       { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.comment_text       { font-size: 13px; color: var(--text-1); line-height: 1.6; }
.comment_customer_visit_img { width: 90px; border-radius: 4px; }
#add_new_comment_card { max-width: 800px; }

/* ── Filter sidenav ───────────────────────────────────────────────── */
.sidenav1 {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 400;
  top: 0; right: 0;
  background: var(--bg-card);
  overflow-x: hidden;
  transition: .3s ease;
  box-shadow: -8px 0 24px rgba(15,23,42,.1);
  font-size: 13px;
}
.sidenav1 .closebtn {
  position: absolute;
  top: 8px; right: 18px;
  font-size: 28px;
  color: var(--text-2);
  cursor: pointer;
}
#filter_div { padding: 48px 14px 24px; }
.filter_field { color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 2px; margin-top: 8px; }
.filter_label { font-size: 12px; margin-bottom: 0; color: var(--text-2); }
.filter_value { width: 14px; height: 14px; }
.filter_values_div { margin-left: 8px; max-height: 240px; overflow: auto; max-width: 95%; }
.filter_tag {
  background: var(--accent-light);
  color: var(--accent);
  margin-left: 4px;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 500;
}
.search_tag_nonclikable {
  background: #f1f5f9;
  margin-left: 4px;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 12px;
}
.filter_tag_heading { float: left; }

/* ── Filter Bar (task_list collapsible search) ────────────────────── */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.filter-bar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  flex-wrap: wrap;
  min-height: 44px;
}
.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.filter-toggle-btn:hover { background: var(--accent-h); color: #fff; }
.filter-toggle-btn .filter-caret { transition: transform .2s; font-size: 11px; }
.filter-toggle-btn[aria-expanded="true"] .filter-caret { transform: rotate(180deg); }
.filter-active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}
.filter-active-tag {
  display: inline-flex;
  align-items: center;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.filter-clear-all {
  margin-left: auto;
  white-space: nowrap;
  font-size: 11px;
  color: #dc2626;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #fca5a5;
  text-decoration: none;
}
.filter-clear-all:hover { background: #fef2f2; color: #dc2626; }
.filter-bar-body {
  padding: 16px 20px 14px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* ── Filter form horizontal grid ─────────────────────────────────── */
.ff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 12px;
  align-items: flex-end;
}
.ff-row:last-child { margin-bottom: 0; }
.ff-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ff-group.ff-full { flex: 1 1 100%; min-width: 100%; }
.ff-group.ff-grow { flex: 1; min-width: 180px; }
.ff-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  line-height: 1.2;
}
.ff-input, .ff-select {
  height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  color: var(--text-1);
  width: 100%;
  min-width: 0;
}
.ff-input:focus, .ff-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  outline: none;
}
/* Chip-style radio buttons */
.ff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ff-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all .12s;
  background: #fff;
  color: var(--text-2);
  white-space: nowrap;
  user-select: none;
  margin: 0;
  font-weight: 400;
  line-height: 1.4;
}
.ff-chip input[type=radio],
.ff-chip input[type=checkbox] { display: none; }
.ff-chip.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}
.ff-chip:hover { border-color: var(--accent); color: var(--accent); }
.ff-chip.is-selected:hover { color: #fff; }
.ff-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Pagination ───────────────────────────────────────────────────── */
.pagination {
  display: inline-flex;
  background: var(--bg-card);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.pagination a {
  color: var(--text-1);
  padding: 6px 13px;
  font-size: 13px;
  text-decoration: none;
  transition: background .12s;
  border-right: 1px solid var(--border);
}
.pagination a:last-child { border-right: none; }
.pagination a.disabled { opacity: .4; cursor: not-allowed; }
.pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination a:hover:not(.active):not(.disabled) { background: var(--bg-page); }

/* ── Sortable ─────────────────────────────────────────────────────── */
.sortable { cursor: pointer; user-select: none; }
.fa-sort-light { color: #fff !important; }
.fa-sort { color: var(--text-3); margin-left: 2px; }

/* ── Highlight ────────────────────────────────────────────────────── */
.highlight              { background: #fefce8 !important; }
.highlightDeletedArticle{ background: #fee2e2 !important; }

/* ── Blink (overdue alerts) ───────────────────────────────────────── */
@keyframes blink { from { opacity: 1; } to { opacity: 0; } }
.blink { animation: blink .6s ease-in-out infinite alternate; }

/* ── Date hint ────────────────────────────────────────────────────── */
.dates::after { content: "DD-MM-YYYY"; color: var(--text-3); font-size: 10px; margin-left: 6px; }

/* ── Task view ────────────────────────────────────────────────────── */
.task_view_th { font-weight: 600; color: var(--text-2); }
.model_note {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  background: #fff7ed;
  max-width: fit-content;
  padding: 3px 14px 3px 10px;
  border-radius: 0 20px 20px 0;
  margin-left: -16px;
  margin-bottom: 8px;
  border-left: 3px solid #f97316;
}
.modal-header-dark { background: var(--accent); color: #fff; }

/* ── User with dp ─────────────────────────────────────────────────── */
.user_name_with_dp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border-radius: 20px;
  padding: 3px 10px 3px 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

/* ── Top-right serial number ──────────────────────────────────────── */
.topright_sr_no {
  position: absolute;
  top: 0; right: 0;
  background: #334155;
  color: #fff;
  padding: 2px 10px;
  border-radius: 0 0 0 8px;
  font-size: 11px;
}

/* ── Status message pill ──────────────────────────────────────────── */
.status_msg_div {
  max-width: fit-content;
  background: #f8fafc;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-2);
  border: 1px solid var(--border);
  margin-top: 2px;
}

/* ── Utilities ────────────────────────────────────────────────────── */
.size13 { font-size: 13px; }
.size16 { font-size: 16px; }
.size18 { font-size: 18px; }
.size20 { font-size: 20px; }
.title_green { color: var(--c-registered); }
.title_dark_grey { color: #fff; background: #64748b; padding: 3px 10px; border-radius: 5px; }
.title_dark_green { color: #fff; background: var(--c-registered); padding: 3px 10px; border-radius: 5px; }
.product_subheading { font-size: 15px; color: var(--accent); margin-bottom: 2px; font-weight: 600; }
.sm_heading { font-size: 14px; color: #dc2626; font-weight: 600; }
.product_code { margin-left: 5px; }
.product_details_tech_spec_td { background: #f8fafc; }
.product_details_price { color: #dc2626; font-size: 18px; font-weight: 700; }
.cart_item_title { font-size: 13px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.card-body_custom { padding: 12px; }
.left-border-lg { }
@media (min-width: 992px) { .left-border-lg { border-left: 1px solid var(--border); } }

/* ── Login page ───────────────────────────────────────────────────── */
#login_body {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login_form_card {
  max-width: 440px;
  width: 100%;
  margin: 0 20px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login_form_title {
  padding: 28px 24px 22px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
}
.login_form_title h4, .login_form_title h3 { color: #fff; margin: 0; }
.login_form { padding: 24px; }
.forgot_password_form { padding: 24px; }
#login_error, #forgot_password_error   { color: #dc2626; font-size: 13px; padding: 0 0 8px; }
#login_success, #forgot_password_success { color: #16a34a; font-size: 13px; padding: 0 0 8px; }

/* ── Custom scrollbar ─────────────────────────────────────────────── */
.custom_scrollbar::-webkit-scrollbar { width: 5px; }
.custom_scrollbar::-webkit-scrollbar-track { background: var(--bg-page); border-radius: 3px; }
.custom_scrollbar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.custom_scrollbar::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Legacy sidebar classes (used in external/ area) ──────────────── */
.sidebar_submenu  { color: var(--accent); font-weight: 600; }
.sidebar_subsubmenu { color: var(--accent); font-weight: 500; font-size: 13px; }

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  .main_page_content { padding: 10px; }
  .lead_card { min-width: 130px; padding: 10px 12px; }
  .lc-count  { font-size: 22px; }
  .topnav    { padding: 0 12px; }
  .topnav-title { font-size: 13px; }
}

/* ── Report: New Lead Arrivals ────────────────────────────────────── */
.report-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.rff-group { display: flex; flex-direction: column; }
.rff-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
}
.report-filter-bar input[type=date],
.report-filter-bar select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 13px;
  background: var(--bg-page);
  color: var(--text-1);
  outline: none;
  transition: border-color .15s;
  height: 34px;
}
.report-filter-bar input[type=date]:focus,
.report-filter-bar select:focus { border-color: var(--accent); }
.rff-group-quickbtns { display: flex; flex-direction: column; }
.report-quickbtns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 0;
}
.report-quickbtn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  background: var(--bg-page);
  color: var(--text-2);
  transition: all .15s;
  white-space: nowrap;
  height: 34px;
  line-height: 1.6;
}
.report-quickbtn:hover,
.report-quickbtn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Stat cards */
.rstat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.rstat-card {
  flex: 1 1 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 14px 22px;
  position: relative;
  overflow: hidden;
}
.rstat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 10px 0 0 10px;
  background: var(--border);
}
.rstat-card.rstat-default::before  { background: #64748b; }
.rstat-card.rstat-accent::before   { background: var(--accent); }
.rstat-card.rstat-success::before  { background: var(--c-registered, #16a34a); }
.rstat-card.rstat-warning::before  { background: var(--c-fallout, #f97316); }
.rstat-card.rstat-orange::before   { background: #f59e0b; }
.rstat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 5px;
}
.rstat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.rstat-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* Source breakdown */
.rsrc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rsrc-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 6px 8px;
  border-bottom: 2px solid var(--border);
  text-align: left;
}
.rsrc-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rsrc-table tr:last-child td { border-bottom: none; }
.rsrc-bar-wrap {
  background: var(--bg-page);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  min-width: 60px;
}
.rsrc-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}
.rsrc-pct { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* Chart wrapper */
.report-chart-wrap {
  position: relative;
  height: 260px;
}

/* ── Reason / Sub-status Breakdown grid ──────────────────────────── */
.rbd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.rbd-block {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.rbd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px 8px 12px;
  border-left: 4px solid #94a3b8;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.rbd-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
}
.rbd-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-left: 8px;
  white-space: nowrap;
}
.rbd-none {
  font-size: 12px;
  color: var(--text-3);
  padding: 10px 12px;
  margin: 0;
}
.rbd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rbd-table tr:last-child td { border-bottom: none; }
.rbd-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.rbd-reason {
  color: var(--text-1);
  word-break: break-word;
}
.rbd-reason a {
  color: var(--text-1);
  text-decoration: none;
}
.rbd-reason a:hover { text-decoration: underline; color: var(--accent); }
.rbd-cnt {
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
  width: 30px;
  color: var(--text-1);
}
.rbd-pct { width: 70px; padding-left: 8px !important; }
.rbd-bar-wrap {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.rbd-bar {
  height: 100%;
  border-radius: 4px;
  opacity: .75;
  transition: width .3s ease;
}

/* ── Notification Bell ────────────────────────────────────────────── */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px;
  background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  border-radius: 8px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* ── Notification Side Pane ───────────────────────────────────────── */
#notif-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.2); z-index: 1040;
}
#notif-overlay.open { display: block; }
#notif-pane {
  position: fixed; top: 0; right: -380px; width: 360px; height: 100vh;
  background: var(--bg-card); border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 1050; transition: right .25s ease;
  display: flex; flex-direction: column;
  font-size: 13px;
}
#notif-pane.open { right: 0; }
#notif-pane-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px; color: var(--text-1);
  flex-shrink: 0;
}
.notif-header-actions { display: flex; gap: 6px; align-items: center; }
#notif-clear-all-btn {
  font-size: 11px; color: var(--text-3); background: none; border: none;
  cursor: pointer; padding: 3px 8px; border-radius: 4px; font-weight: 500;
}
#notif-clear-all-btn:hover { background: var(--bg-page); color: var(--text-2); }
#notif-pane-close-btn {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  padding: 4px 7px; border-radius: 4px; font-size: 15px; line-height: 1;
}
#notif-pane-close-btn:hover { background: var(--bg-page); color: var(--text-1); }
#notif-pane-list { flex: 1; overflow-y: auto; }
#notif-pane-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 10px; color: var(--text-3); padding: 40px 20px;
}
#notif-pane-empty i { font-size: 36px; opacity: .35; }
#notif-pane-empty span { font-size: 13px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s; position: relative;
}
.notif-item:hover { background: var(--accent-light); }
.notif-item.unseen { background: #f0f7ff; }
.notif-item-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0; margin-top: 2px;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-msg { color: var(--text-1); line-height: 1.45; word-break: break-word; }
.notif-item-time { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.notif-item-dismiss {
  background: none; border: none; cursor: pointer; color: var(--text-3);
  font-size: 12px; padding: 4px 5px; border-radius: 4px; flex-shrink: 0;
  line-height: 1; opacity: 0; transition: opacity .12s, background .12s;
  align-self: center;
}
.notif-item:hover .notif-item-dismiss { opacity: 1; }
.notif-item-dismiss:hover { background: #fee2e2; color: #dc2626; }

/* ── Print ────────────────────────────────────────────────────────── */
@media print {
  #sidebar, .topnav, .page-title-bar, .page-header { display: none !important; }
  #content { min-width: 0; }
  .card1 { box-shadow: none; border: 1px solid #ddd; }
}
