/* ==========================================================================
   Lyso CRM — Architectural Dark Editorial Edition (Zero-Card Hairline UI)
   ========================================================================== */

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  /* Custom Hero Background Hook:
     تصویر بک‌گراند خود را با نام hero-bg.jpg در assets/img/ بگذارید و خط زیر را فعال کنید:
     --hero-bg-image: url('../img/hero-bg.jpg'); */
  --hero-bg-image: none;

  /* Core Obsidian Palette — Calm, High-Craft, Non-Neon */
  --bg: #0a0b10;
  --bgs: #0f111a;
  --sb-bg: #0c0d14;
  --surface: #11131e;
  --surface2: #161927;
  --cd: #11131e;
  --cd-solid: #11131e;
  --el: #171a29;
  --el2: #1e2235;
  --bd: rgba(255, 255, 255, 0.065);
  --line: rgba(255, 255, 255, 0.075);
  --gb: rgba(255, 255, 255, 0.11);
  --gm: #131624;
  --gl: rgba(10, 11, 16, 0.86);

  /* Typography */
  --tx: #f1f2f8;
  --tx2: #c5c9de;
  --mu: #8287a3;
  --mu2: #585d78;

  /* Refined Violet-Indigo Accent */
  --ac: #0f8a7d;
  --ac2: #0d7368;
  --lt: #2dd4bf;
  --or: #f59e0b;
  --on: #ffffff;
  --g1: rgba(15, 138, 125, 0.11);
  --g2: rgba(15, 138, 125, 0.22);

  /* Semantic & Chart Colors */
  --ok: #10b981;
  --wn: #f59e0b;
  --bad: #f43f5e;
  --sky: #38bdf8;
  --k1: #0f8a7d;
  --k2: #f59e0b;
  --k3: #10b981;
  --k4: #2563eb;
  --k5: #38bdf8;
  --k6: #f43f5e;

  --s0: #0f8a7d;
  --s1: #3b82f6;
  --s2: #10b981;
  --s3: #f59e0b;
  --s4: #ec4899;

  /* Geometry — Architectural, crisp radii */
  --r: 12px;
  --r-sm: 8px;
  --sd: 0 1px 0 rgba(255, 255, 255, 0.03);
  --bs: 0 1px 2px rgba(0, 0, 0, 0.28);
  --ring: 0 0 0 2.5px rgba(15, 138, 125, 0.28);

  /* Slim Minimal Sidebar Widths */
  --sb-w: 192px;
  --sb-w-col: 58px;
}

:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bgs: #ffffff;
  --sb-bg: #fafbfe;
  --surface: #ffffff;
  --surface2: #f2f4fa;
  --cd: #ffffff;
  --cd-solid: #ffffff;
  --el: #f1f3f9;
  --el2: #e7eaf5;
  --bd: rgba(15, 23, 42, 0.08);
  --line: rgba(15, 23, 42, 0.09);
  --gb: rgba(15, 23, 42, 0.13);
  --gm: #ffffff;
  --gl: rgba(246, 247, 251, 0.90);
  --tx: #121526;
  --tx2: #363c59;
  --mu: #656c8a;
  --mu2: #8e94b2;
  --ac: #0f766e;
  --ac2: #0f766e;
  --lt: #0f766e;
  --g1: rgba(15, 118, 110, 0.09);
  --g2: rgba(15, 118, 110, 0.16);
  --sd: 0 1px 2px rgba(15, 23, 42, 0.04);
  --bs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --ring: 0 0 0 2.5px rgba(15, 118, 110, 0.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }

/* CRITICAL FIX: Prevents horizontal layout shift when switching between tall and short tabs */
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

* { scrollbar-width: thin; scrollbar-color: rgba(130, 135, 163, 0.22) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: rgba(130, 135, 163, 0.24); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(15, 138, 125, 0.48); }

html, body {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}
input, textarea, select { -webkit-user-select: text !important; user-select: text !important; }
@media print { html, body { display: none !important; } }

body {
  font: 13px/1.62 Vazirmatn, Tahoma, system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--tx);
  min-height: 100vh;
  overflow-x: clip;
  font-feature-settings: "tnum" 1;
}

a { color: var(--lt); cursor: pointer; text-decoration: none; transition: color .14s; }
a:hover { color: var(--tx); }

/* ==========================================================================
   App Shell: Ultra-Minimal Slim Right Sidebar + Fluid Hairline Workspace
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.sidebar {
  width: var(--sb-w);
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 22;
  background: var(--sb-bg);
  border-inline-end: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 12px 9px 10px;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .2s cubic-bezier(.22, 1, .36, 1), transform .22s cubic-bezier(.22, 1, .36, 1);
}

/* Collapsed Icon-Only Rail Mode */
body.sb-col .sidebar { width: var(--sb-w-col); padding-inline: 7px; }
body.sb-col .sb-brand-txt,
body.sb-col .sb-nav button span:not(.sb-badge),
body.sb-col .sb-grp,
body.sb-col .sb-util span,
body.sb-col .sb-util kbd { display: none; }
body.sb-col .sb-brand { justify-content: center; padding: 4px 0 10px; }
body.sb-col .sb-collapse { position: static; margin-top: 2px; }
body.sb-col .sb-brand-l { display: none; }
body.sb-col .sb-nav button,
body.sb-col .sb-util { justify-content: center; padding: 0; }
body.sb-col .sb-nav button .sb-badge {
  position: absolute; top: 3px; left: 4px;
  min-width: 15px; height: 15px; font-size: 9px; padding: 0 3px;
}

.sb-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 5px 11px;
  border-bottom: 1px solid var(--bd);
  min-height: 40px;
}
.sb-brand-l {
  display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer;
}
.sb-logo {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #0f8a7d 0%, #0f766e 100%);
  color: #fff;
}
.sb-brand-txt { min-width: 0; line-height: 1.15; }
.sb-brand-txt b { display: block; font-size: 14px; font-weight: 800; color: var(--tx); letter-spacing: -.2px; }
.sb-brand-txt b i { color: var(--lt); font-style: normal; }
.sb-brand-txt small { display: block; font-size: 9.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sb-collapse, .sb-close {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  border: 1px solid transparent; background: transparent; color: var(--mu);
  cursor: pointer; display: grid; place-items: center; transition: all .14s;
}
.sb-collapse:hover, .sb-close:hover { background: var(--el); color: var(--tx); border-color: var(--bd); }
.sb-close { display: none; }
body.sb-col .sb-collapse svg { transform: rotate(180deg); }

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.sb-grp {
  font-size: 10px; font-weight: 700; color: var(--mu2);
  padding: 9px 8px 4px; letter-spacing: .2px;
}
.sb-grp:first-child { padding-top: 2px; }
.sb-sep { height: 1px; background: var(--bd); margin: 5px 6px; }

.sb-nav button {
  position: relative;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mu);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: right;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.sb-nav button svg {
  width: 16px; height: 16px; flex: none;
  stroke-width: 1.8; opacity: .75; transition: opacity .12s, color .12s;
}
.sb-nav button:hover { color: var(--tx); background: rgba(255, 255, 255, 0.04); }
:root[data-theme="light"] .sb-nav button:hover { background: var(--el); }

.sb-nav button.on {
  color: var(--tx);
  font-weight: 700;
  background: var(--g1);
}
.sb-nav button.on svg { opacity: 1; color: var(--lt); }
.sb-nav button.on::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 7px; bottom: 7px;
  width: 2.5px;
  border-radius: 99px;
  background: var(--ac);
}

.sb-badge {
  margin-inline-start: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; font-size: 10px; font-weight: 800;
  display: inline-grid; place-items: center;
  background: rgba(244, 63, 94, 0.16);
  color: #fb7185;
}
:root[data-theme="light"] .sb-badge { color: #e11d48; }

/* Ultra-Quiet Minimal Sidebar Footer (NO "آنلاین هستید", NO promo card) */
.sb-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sb-util {
  width: 100%; height: 32px; padding: 0 9px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--mu); font: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 9px;
  transition: background .12s, color .12s; white-space: nowrap;
}
.sb-util svg { width: 15px; height: 15px; flex: none; opacity: .75; }
.sb-util:hover { background: var(--el); color: var(--tx); }
.sb-util.out:hover { background: rgba(244, 63, 94, 0.12); color: #fb7185; }
.sb-util kbd {
  margin-inline-start: auto; font-family: inherit; font-size: 9.5px;
  padding: 1px 5px; border-radius: 5px;
  background: var(--el); border: 1px solid var(--bd); color: var(--mu);
}

.sb-ov {
  display: none; position: fixed; inset: 0; z-index: 21;
  background: rgba(4, 5, 10, 0.6);
  backdrop-filter: none;
}

/* ==========================================================================
   Main Fluid Column & Compact Sticky Topbar
   ========================================================================== */
.app-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: clip;
}

.topbar {
  position: sticky; top: 0; z-index: 16;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 0 22px;
  background: var(--gl);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.tb-right { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sb-toggle {
  display: none; width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--bd); background: var(--surface); color: var(--tx);
  cursor: pointer; place-items: center; flex: none;
}

.top-search {
  display: flex; align-items: center; gap: 8px;
  width: min(360px, 100%);
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--bd);
  color: var(--mu);
  cursor: pointer;
  transition: border-color .14s;
}
.top-search:hover { border-color: var(--gb); color: var(--tx2); }
.top-search svg { width: 14px; height: 14px; flex: none; }
.top-search span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search kbd {
  margin-inline-start: auto; font-family: inherit; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 5px;
  background: var(--el); border: 1px solid var(--bd); color: var(--mu);
}

.tb-left { display: flex; align-items: center; gap: 7px; flex: none; }
.tb-ico-btn {
  position: relative;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--bd);
  background: var(--surface);
  color: var(--tx2);
  cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .14s, color .14s, background .14s;
}
.tb-ico-btn:hover { border-color: var(--gb); color: var(--tx); background: var(--el); }
.tb-ico-btn svg { width: 16px; height: 16px; }
.bell-dot {
  position: absolute; top: -4px; left: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; font-size: 9.5px; font-weight: 800;
  background: var(--bad); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.bell-dot:empty { display: none; }

.tb-user {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 6px 0 10px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--bd);
  cursor: pointer; transition: border-color .14s;
}
.tb-user:hover { border-color: var(--gb); }
.tb-u-av {
  width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, #0f8a7d, #0f766e);
  color: #fff; font-weight: 800; font-size: 11px;
  display: grid; place-items: center; flex: none;
}
.tb-u-info { display: flex; flex-direction: column; line-height: 1.18; }
.tb-u-info b { font-size: 11.5px; font-weight: 700; color: var(--tx); white-space: nowrap; }
.tb-u-info small { font-size: 9.5px; color: var(--mu); white-space: nowrap; }

main {
  padding: 18px 22px 28px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  flex: 1;
  min-width: 0;
}

footer {
  margin-top: auto;
  padding: 11px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--mu2);
  border-top: 1px solid var(--bd);
}
footer a { color: var(--mu); font-weight: 700; }
footer a:hover { color: var(--lt); }

/* ==========================================================================
   ZERO-CARD ARCHITECTURAL DASHBOARD (Unified Hairline Surface Frame)
   ========================================================================== */
.desk-frame {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Row 0: Executive Hero Strip (Ready for custom --hero-bg-image) */
.hero-strip {
  position: relative;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background-color: #10121e;
  background-image:
    linear-gradient(90deg, rgba(10, 11, 18, 0.86) 0%, rgba(16, 18, 30, 0.72) 55%, rgba(16, 18, 30, 0.88) 100%),
    var(--hero-bg-image),
    radial-gradient(45% 140% at 15% 50%, rgba(15, 138, 125, 0.14), transparent 70%);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}
:root[data-theme="light"] .hero-strip {
  background-color: #f8f9fe;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.88) 0%, rgba(246, 247, 253, 0.78) 60%, rgba(255, 255, 255, 0.92) 100%),
    var(--hero-bg-image),
    radial-gradient(45% 130% at 15% 50%, rgba(15, 118, 110, 0.08), transparent 70%);
}
.hero-r { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero-r h1 {
  font-size: 21px; font-weight: 800; color: var(--tx);
  letter-spacing: -.25px; line-height: 1.25;
}
.hero-r h1 span { color: var(--lt); }
.hero-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--mu);
}
.hero-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--mu2); }
.hero-l {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.hero-goal-inline {
  min-width: 220px; display: flex; flex-direction: column; gap: 5px;
  padding-inline-end: 16px; border-inline-end: 1px solid var(--line);
}
.hero-goal-inline .rw { font-size: 11px; color: var(--mu); }
.hero-goal-inline .rw b { font-size: 12px; color: var(--tx); }
.hx-edit {
  border: 0; background: transparent; color: var(--mu); cursor: pointer;
  padding: 0 4px; border-radius: 5px; font-size: 11px;
}
.hx-edit:hover { color: var(--lt); background: var(--g1); }
.hx-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
:root[data-theme="light"] .hx-bar { background: var(--el2); }
.hx-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0f8a7d, #38bdf8); transition: width .4s ease; }
.hx-sub { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--mu); gap: 8px; }
.hero-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Row 1: Unified Hairline Metric Ticker Strip (Replaces ALL AI KPI Cards!) */
.mstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 14px;
}
.desk-frame > .mstrip {
  border: 0; border-radius: 0; margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.mcell {
  position: relative;
  padding: 15px 18px 12px;
  border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  transition: background .14s;
  min-width: 0;
}
.mcell:last-child { border-inline-end: 0; }
.mcell.cl { cursor: pointer; }
.mcell.cl:hover { background: rgba(255, 255, 255, 0.022); }
:root[data-theme="light"] .mcell.cl:hover { background: var(--surface2); }
.mcell-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.mcell-lbl {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--mu);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mcell-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--kc, var(--ac));
}
.mcell-val {
  font-size: 22px; font-weight: 800; color: var(--tx);
  line-height: 1.2; letter-spacing: -.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mcell-sub {
  font-size: 11px; color: var(--mu);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mcell-sub em { font-style: normal; color: var(--kc, var(--lt)); font-weight: 600; }
.mcell-wave { width: 100%; height: 28px; display: block; margin-top: 2px; }

/* Compact Subpage Metric Strip */
.mstrip.compact .mcell { padding: 11px 14px; gap: 2px; }
.mstrip.compact .mcell-val { font-size: 17px; }

/* Hairline Split-Grid Rows inside .desk-frame */
.desk-row-mid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.6fr) minmax(0, 1.05fr);
  border-bottom: 1px solid var(--line);
}
.desk-row-bot {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.06fr) minmax(0, 1.05fr);
  border-bottom: 1px solid var(--line);
}
.desk-pane {
  padding: 18px 20px;
  border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column; min-width: 0;
}
.desk-pane:last-child { border-inline-end: 0; }

.pane-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
}
.pane-title {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 800; color: var(--tx); margin: 0;
}
.pane-title svg { width: 15px; height: 15px; color: var(--lt); flex: none; }
.pane-link { font-size: 11px; font-weight: 600; color: var(--mu); }
.pane-link:hover { color: var(--lt); }

/* Trapezoid Funnel Chart */
.funnel-wrap { display: flex; flex-direction: column; gap: 7px; justify-content: center; flex: 1; }
.fn-tier {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center; gap: 12px; cursor: pointer; padding: 2px 0; transition: opacity .14s;
}
.fn-tier:hover { opacity: .88; }
.fn-lbl { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.fn-lbl span { color: var(--mu); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-lbl b { color: var(--tx); font-size: 12.5px; font-weight: 800; }
.fn-bar-box { height: 28px; display: flex; align-items: center; }
.fn-bar-box svg { width: 100%; height: 28px; overflow: visible; }

/* Growth Smooth Bezier Curve */
.chart-pills {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 2px; border-radius: 8px;
  background: var(--el); border: 1px solid var(--bd);
}
.chart-pills button {
  height: 24px; padding: 0 9px; border: 0; border-radius: 6px;
  background: transparent; color: var(--mu); font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: .12s;
}
.chart-pills button:hover { color: var(--tx); }
.chart-pills button.on { background: var(--ac); color: #fff; font-weight: 700; }
.growth-svg-box { position: relative; flex: 1; min-height: 185px; display: flex; align-items: center; }
.growth-svg-box svg { width: 100%; height: 190px; overflow: visible; display: block; }
.growth-tip {
  position: absolute; top: 2px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 8px;
  background: var(--el2); border: 1px solid var(--gb);
  font-size: 11.5px; font-weight: 700; color: var(--tx);
  pointer-events: none;
}
.growth-tip i { width: 7px; height: 7px; border-radius: 50%; background: var(--lt); }

/* Acquisition Donut */
.donut-layout { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex: 1; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
.dl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px; padding: 3px 6px; border-radius: 7px; cursor: pointer; transition: background .12s;
}
.dl-row:hover { background: var(--el); }
.dl-name { display: inline-flex; align-items: center; gap: 7px; color: var(--tx2); min-width: 0; }
.dl-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dl-pct { font-weight: 800; color: var(--tx); font-size: 12px; }
.donut-ring-box { position: relative; width: 138px; height: 138px; flex: none; display: grid; place-items: center; }
.donut-ring-box svg { width: 138px; height: 138px; transform: rotate(-90deg); overflow: visible; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 19px; font-weight: 800; color: var(--tx); line-height: 1.15; }
.donut-center small { font-size: 10px; color: var(--mu); margin-top: 2px; }

/* Upcoming Schedule (Clean Ledger Rows — Zero Cards) */
.sched-split { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; align-items: start; flex: 1; }
.today-stamp {
  padding: 12px 6px; text-align: center;
  border-radius: 10px; background: var(--el); border: 1px solid var(--bd);
  cursor: pointer; transition: border-color .14s;
}
.today-stamp:hover { border-color: var(--ac); }
.today-stamp span { display: block; font-size: 10.5px; font-weight: 700; color: var(--lt); }
.today-stamp b { display: block; font-size: 26px; font-weight: 800; color: var(--tx); line-height: 1.2; margin: 2px 0; }
.today-stamp small { display: block; font-size: 10.5px; color: var(--mu); }

.ledger-list { display: flex; flex-direction: column; }
.ledger-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--bd);
  transition: background .12s;
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-row.cl { cursor: pointer; border-radius: 7px; padding-inline: 6px; }
.ledger-row.cl:hover { background: rgba(255, 255, 255, 0.03); }
:root[data-theme="light"] .ledger-row.cl:hover { background: var(--surface2); }
.ledger-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ic, var(--ac)); }
.ledger-main { flex: 1; min-width: 0; }
.ledger-main b { display: block; font-size: 12px; font-weight: 600; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger-main small { display: block; font-size: 10.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger-end { text-align: left; flex: none; font-size: 11.5px; font-weight: 700; color: var(--tx2); white-space: nowrap; }
.ledger-end small { display: block; font-size: 10px; font-weight: 500; color: var(--mu); }

/* Smart Radar Strip at Bottom of Desk Frame */
.radar-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  background: rgba(255, 255, 255, 0.015);
}
.radar-item {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px;
  border-inline-end: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.45; cursor: pointer;
  transition: background .12s;
}
.radar-item:last-child { border-inline-end: 0; }
.radar-item:hover { background: var(--g1); }
.radar-item > div { flex: 1; min-width: 0; color: var(--tx2); }
.radar-item b { color: var(--tx); }
.radar-item em { font-style: normal; font-weight: 700; color: var(--lt); white-space: nowrap; font-size: 11px; }

/* ==========================================================================
   BESPOKE EDITORIAL JALALI CALENDAR (Split Month Matrix + Live Day Inspector)
   ========================================================================== */
.cal-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cal-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav-title {
  font-size: 16px; font-weight: 800; color: var(--tx);
  min-width: 132px; text-align: center;
}
.cal-nav button {
  height: 30px; min-width: 30px; padding: 0 9px;
  border-radius: 8px; border: 1px solid var(--bd);
  background: var(--el); color: var(--tx); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.cal-nav button:hover { border-color: var(--ac); color: var(--lt); }
.cal-flts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cal-flt-btn {
  height: 27px; padding: 0 10px; border-radius: 7px;
  border: 1px solid transparent; background: transparent;
  color: var(--mu); font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: all .12s;
}
.cal-flt-btn:hover { background: var(--el); color: var(--tx); }
.cal-flt-btn.on { background: var(--g1); color: var(--lt); border-color: rgba(15, 138, 125, 0.3); }
.cal-flt-btn i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.cal-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  min-height: 540px;
}
.cal-matrix-wrap {
  display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--line);
  min-width: 0;
}
.cal-wk-hd {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.cal-wk-hd span {
  padding: 9px 6px; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--mu);
  border-inline-end: 1px solid var(--bd);
}
.cal-wk-hd span:last-child { border-inline-end: 0; color: #fb7185; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  flex: 1;
}
.cal-cell {
  position: relative;
  min-height: 92px;
  padding: 7px 8px;
  border-inline-end: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  transition: background .12s;
  min-width: 0;
}
.cal-cell:nth-child(7n) { border-inline-end: 0; }
.cal-cell:hover { background: rgba(255, 255, 255, 0.024); }
:root[data-theme="light"] .cal-cell:hover { background: var(--surface2); }
.cal-cell.out { opacity: .34; background: rgba(0, 0, 0, 0.12); }
:root[data-theme="light"] .cal-cell.out { background: #f8f9fc; }
.cal-cell.fri { background: rgba(244, 63, 94, 0.03); }
.cal-cell.sel {
  background: rgba(15, 138, 125, 0.09);
  box-shadow: inset 0 0 0 1.5px var(--ac);
  z-index: 1;
}
.cal-cell-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
}
.cal-num {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--tx2);
}
.cal-cell.fri .cal-num { color: #fb7185; }
.cal-cell.td .cal-num {
  background: var(--ac); color: #fff; font-weight: 800;
}
.cal-add-mini {
  width: 20px; height: 20px; border-radius: 6px; border: 0;
  background: var(--el2); color: var(--mu); font-size: 13px; line-height: 1;
  cursor: pointer; opacity: 0; transition: opacity .12s, color .12s;
  display: grid; place-items: center;
}
.cal-cell:hover .cal-add-mini, .cal-cell.sel .cal-add-mini { opacity: 1; }
.cal-add-mini:hover { background: var(--ac); color: #fff; }

.cal-evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-ev-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 2px 6px; border-radius: 5px;
  font-size: 10.5px; font-weight: 600; line-height: 1.45;
  background: rgba(15, 138, 125, 0.13); color: var(--tx);
  border-inline-start: 2.5px solid var(--evc, var(--ac));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: filter .12s;
}
.cal-ev-pill:hover { filter: brightness(1.18); }
.cal-ev-pill.late { background: rgba(244, 63, 94, 0.15); border-inline-start-color: var(--bad); color: #fda4af; }
:root[data-theme="light"] .cal-ev-pill.late { color: #be123c; }
.cal-ev-pill.done { opacity: .48; text-decoration: line-through; }
.cal-more { font-size: 10px; color: var(--mu); padding-inline-start: 4px; font-weight: 600; }

/* Left Selected-Day Inspector Pane */
.cal-agenda {
  display: flex; flex-direction: column;
  background: rgba(0, 0, 0, 0.12);
  min-width: 0;
}
:root[data-theme="light"] .cal-agenda { background: #fafbfe; }
.cal-ag-hd {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.cal-ag-hd b { display: block; font-size: 14.5px; font-weight: 800; color: var(--tx); }
.cal-ag-hd small { display: block; font-size: 11px; color: var(--mu); margin-top: 2px; }
.cal-ag-body {
  padding: 12px 16px 16px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1; overflow-y: auto; max-height: 560px;
}
.cal-ag-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--bd);
  border-inline-start: 3px solid var(--evc, var(--ac));
}
.cal-ag-item.done { opacity: .55; }
.cal-ag-txt { flex: 1; min-width: 0; }
.cal-ag-txt b { display: block; font-size: 12px; font-weight: 700; color: var(--tx); line-height: 1.45; }
.cal-ag-item.done .cal-ag-txt b { text-decoration: line-through; }
.cal-ag-txt small { display: block; font-size: 10.5px; color: var(--mu); margin-top: 2px; }
.cal-ag-acts { display: flex; gap: 3px; margin-top: 6px; flex-wrap: wrap; }
.cal-ag-ov {
  margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line);
}
.cal-ag-ov-h {
  font-size: 11px; font-weight: 800; color: #fb7185; margin-bottom: 7px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ==========================================================================
   Editorial Surfaces, Sections, Tables, Forms (Sub-Pages)
   ========================================================================== */
.cd, .mc, .ag-card, .pipe-bar, .tb, .tkb, .col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.cd { padding: 16px 18px; }
.cd.tw { padding: 0; max-height: 74vh; overflow: auto; }
.g { display: grid; gap: 12px; margin-bottom: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.gA, .gC { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.gB { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .gA, .gB, .gC { grid-template-columns: 1fr; } }

.ph {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.ph > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ph h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--tx); letter-spacing: -.2px; }
.ph small { font-size: 11.5px; color: var(--mu); display: block; }
.ph .acts { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }

h2 { font-size: 17px; font-weight: 800; margin-bottom: 10px; }
h3 {
  font-size: 13.5px; font-weight: 800; margin-bottom: 11px;
  display: flex; align-items: center; gap: 7px; color: var(--tx);
}
h4 { font-size: 12px; color: var(--mu); margin: 12px 0 7px; font-weight: 700; }
small { color: var(--mu); font-size: 11px; }

/* Buttons & Inputs */
.btn, .mi {
  font: inherit; font-weight: 600;
  border: 1px solid var(--gb);
  background: var(--el);
  color: var(--tx);
  border-radius: 8px;
  height: 33px; padding: 0 12px;
  font-size: 12px; cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.mi {
  height: 26px; min-width: 26px; padding: 0 7px;
  border-radius: 7px; font-size: 11px; background: var(--el);
}
.btn:hover, .mi:hover { border-color: rgba(15, 138, 125, 0.55); background: var(--g1); color: var(--tx); }
.btn.p {
  background: var(--ac); border-color: var(--ac); color: #fff; font-weight: 700;
}
.btn.p:hover { filter: brightness(1.09); background: var(--ac); color: #fff; }
.btn.o {
  background: #d97706; border-color: #d97706; color: #fff; font-weight: 700;
}
.btn.o:hover { filter: brightness(1.08); background: #d97706; color: #fff; }
.mi.del:hover, .btn.del:hover {
  background: rgba(244, 63, 94, 0.14) !important;
  border-color: var(--bad) !important;
  color: var(--bad) !important;
}

input, select, textarea {
  font: inherit; font-size: 12.5px; color: var(--tx);
  background: var(--el); border: 1px solid var(--bd);
  border-radius: 8px; padding: 0 11px; width: 100%;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
input:not([type=checkbox]):not([type=radio]), select { height: 34px; }
textarea { height: auto; padding: 8px 11px; line-height: 1.68; }
input::placeholder, textarea::placeholder { color: var(--mu2); }
input:focus, select:focus, textarea:focus {
  border-color: var(--ac); box-shadow: var(--ring); outline: 0; background: var(--surface);
}
input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--ac); cursor: pointer; }
option { background: var(--surface); color: var(--tx); }

.tb {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  margin-bottom: 12px; padding: 8px 10px;
}
.tb input { flex: 1; min-width: 180px; width: auto; height: 32px !important; }
.tb select { width: auto; height: 32px !important; }

.seg {
  display: inline-flex; border: 1px solid var(--bd); border-radius: 8px;
  background: var(--el); padding: 2px; gap: 2px;
}
.seg button {
  border: 0; background: transparent; color: var(--mu);
  font: inherit; font-size: 11.5px; font-weight: 600;
  height: 26px; padding: 0 10px; border-radius: 6px;
  cursor: pointer; white-space: nowrap; transition: .12s;
}
.seg button:hover { color: var(--tx); }
.seg button.on { background: var(--ac); color: #fff; font-weight: 700; }

/* Tables */
.tw { overflow-x: auto; }
.tw > h3 { padding: 14px 18px 9px; margin: 0; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--el); color: var(--mu);
  font-size: 11px; font-weight: 700; text-align: right;
  padding: 10px 13px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 10px 13px; border-bottom: 1px solid var(--bd); vertical-align: middle; font-size: 12.5px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.cl { cursor: pointer; transition: background .1s; }
tbody tr.cl:hover { background: var(--g1); }
tr.pr-h td:first-child { box-shadow: inset -3px 0 var(--bad); }
tr.pr-l td:first-child { box-shadow: inset -3px 0 var(--bd); }

.sub { display: block; font-size: 10.5px; color: var(--mu); line-height: 1.4; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.ch {
  display: inline-flex; align-items: center; height: 21px;
  font-size: 10.5px; font-weight: 600; padding: 0 8px; border-radius: 6px;
  background: var(--g1); color: var(--lt); margin-inline-end: 3px; white-space: nowrap;
}
.ok { color: var(--ok); } .wn { color: var(--wn); } .bad { color: var(--bad); } .lt { color: var(--lt); } .mu { color: var(--mu); }
.ch.bad { background: rgba(244, 63, 94, 0.14); color: #fb7185; }
.ch.wn { background: rgba(245, 158, 11, 0.14); color: #fbbf24; }
.ch.ok { background: rgba(16, 185, 129, 0.14); color: #34d399; }
.ch.mu { background: var(--el); color: var(--mu); }
:root[data-theme="light"] .ch.bad { color: #e11d48; }
:root[data-theme="light"] .ch.wn { color: #d97706; }
:root[data-theme="light"] .ch.ok { color: #059669; }

.bar { height: 6px; border-radius: 99px; background: var(--el); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #0f8a7d, #38bdf8); border-radius: 99px; }
.rw { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tr { display: flex; gap: 9px; align-items: center; padding: 7px 6px; border-bottom: 1px solid var(--bd); font-size: 12.5px; border-radius: 7px; }
.tr:last-child { border-bottom: 0; }
.tr > div { flex: 1; min-width: 0; }
.tr > div b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr small { display: block; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk2 { cursor: pointer; }
.pk2:hover { background: var(--g1); }
.fn { margin: 7px 0; } .fn .bar { height: 6px; margin-top: 4px; }

.av {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
  background: linear-gradient(135deg, var(--a1, #0f8a7d), var(--a2, #3b82f6));
  color: #fff; flex: none;
}
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.xs { width: 24px; height: 24px; font-size: 10px; border-radius: 7px; }
.av.lg { width: 42px; height: 42px; font-size: 16px; border-radius: 11px; }

.rg {
  width: 30px; height: 30px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p)*1%), var(--el) 0);
  display: grid; place-items: center; position: relative; flex: none;
}
.rg::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.rg b { position: relative; font-size: 9.5px; color: var(--c); }
.gg { display: flex; align-items: center; gap: 6px; }
.nm { display: flex; align-items: center; gap: 8px; min-width: 185px; }
.nm .tg { display: block; margin-top: 2px; }
.pd { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-inline-end: 4px; background: var(--bad); }
.dt { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-inline-end: 5px; background: currentColor; }
.cn span, .cn small { display: block; direction: ltr; unicode-bidi: isolate; text-align: right; max-width: 175px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stp { display: inline-flex; gap: 2px; }
.stp i { width: 11px; height: 4px; border-radius: 2px; background: var(--el2); }
.stp i.on { background: var(--ac); }
.lg { display: flex; gap: 12px; font-size: 11px; color: var(--mu); }
.lg i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 4px; vertical-align: -1px; }
.lc { width: 100%; max-height: 205px; display: block; overflow: visible; }

/* ==========================================================================
   Pipeline Kanban
   ========================================================================== */
.pipe-bar {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start;
  gap: 7px; padding: 8px 10px; margin-bottom: 10px; overflow-x: auto;
}
.pipe-bar .sbx { position: relative; display: flex; align-items: center; flex: 1 1 220px; min-width: 185px; }
.sbx > span { position: absolute; inset-inline-start: 10px; font-size: 12px; opacity: .65; pointer-events: none; z-index: 1; }
.sbx input { height: 32px !important; padding-inline-start: 30px !important; padding-inline-end: 64px !important; font-size: 12px !important; }
.sbx em { position: absolute; inset-inline-end: 9px; font-style: normal; font-size: 10px; color: var(--lt); font-weight: 700; pointer-events: none; }
.pipe-bar .seg { flex: none; }
.pipe-bar select { width: auto !important; flex: none !important; min-width: 122px; max-width: 175px; height: 32px !important; padding: 0 9px !important; font-size: 12px !important; }
.pipe-bar .mi { flex: none; height: 32px !important; padding: 0 9px !important; }
@media (max-width: 960px) { .pipe-bar { flex-wrap: wrap; } .pipe-bar .sbx { flex: 1 1 100%; } }

.fsum { display: flex; gap: 2px; margin-bottom: 10px; border-radius: 8px; overflow: hidden; height: 22px; }
.fsum span { display: flex; align-items: center; justify-content: center; padding: 0 8px; color: #fff; font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; cursor: pointer; }
.kb { display: grid; grid-template-columns: repeat(5, minmax(215px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.col { padding: 10px; display: flex; flex-direction: column; border-top: 2px solid var(--sc); }
.col.ov { outline: 2px dashed var(--sc); }
.col-hd { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 6px; }
.col-hd b { font-size: 12px; color: var(--tx); display: flex; align-items: center; gap: 5px; }
.col-hd span { font-size: 10.5px; color: var(--mu); font-weight: 600; }
.col-flt { position: relative; margin-top: 6px; }
.col-flt input { height: 28px !important; font-size: 11px !important; padding-inline-start: 9px !important; padding-inline-end: 24px !important; border-radius: 7px; }
.col-flt i { position: absolute; inset-inline-end: 7px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 10px; color: var(--mu); cursor: pointer; display: none; }
.col-flt.has-v i { display: block; }
.kcl { margin-top: 7px; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 280px); min-height: 46px; overflow-y: auto; }
.kcl-e { display: none; text-align: center; font-size: 11px; color: var(--mu); padding: 14px 4px; border: 1px dashed var(--bd); border-radius: 8px; margin-top: 6px; }
.col.em .kcl-e { display: block; }
.dc {
  background: var(--el); border: 1px solid var(--bd); border-radius: 9px; padding: 8px 10px;
  cursor: grab; transition: border-color .12s; display: flex; flex-direction: column; gap: 4px;
}
.dc:hover { border-color: var(--sc); }
.dc[hidden] { display: none !important; }
.dc1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.dcn { flex: 1; min-width: 0; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tx); }
.dcn:hover { color: var(--lt); }
.dcv { font-weight: 800; font-size: 10.5px; color: var(--lt); background: var(--g1); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.dc2 { display: flex; align-items: center; gap: 5px; min-width: 0; }
.dct { flex: 1; min-width: 0; font-size: 10.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcd { font-size: 10px; color: var(--mu); white-space: nowrap; }
.dcd.bad { color: var(--bad); font-weight: 700; }
.dca { display: inline-flex; gap: 2px; opacity: .75; }
.dc:hover .dca { opacity: 1; }
.dca .mi { min-width: 19px; height: 19px; padding: 0 4px; font-size: 9.5px; border-radius: 5px; }

/* ==========================================================================
   Tasks Board
   ========================================================================== */
.tkg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 10px; align-items: start; }
.tkb { padding: 12px; display: flex; flex-direction: column; gap: 6px; border-top: 2px solid var(--bc, var(--ac)); }
.tkh { display: flex; align-items: center; justify-content: space-between; padding-bottom: 7px; border-bottom: 1px solid var(--bd); }
.tkh b { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.tkc {
  background: var(--el); border: 1px solid var(--bd); border-radius: 9px;
  padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.tkc:hover { border-color: rgba(15, 138, 125, 0.45); }
.tkc.dn { opacity: .54; }
.ckb {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--mu);
  background: transparent; display: grid; place-items: center;
  cursor: pointer; flex: none; color: #fff; font-size: 9.5px; padding: 0;
}
.ckb:hover { border-color: var(--ac); }
.ckb.on { background: var(--ok); border-color: var(--ok); }
.tk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tk-r1 { display: flex; align-items: center; gap: 5px; min-width: 0; }
.tk-title { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tx); }
.tkc.dn .tk-title { text-decoration: line-through; color: var(--mu); }
.tk-r2 { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--mu); min-width: 0; }
.tk-r2 a { font-weight: 700; color: var(--lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-act { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.tk-act .mi { height: 21px; min-width: 21px; padding: 0 5px; font-size: 10px; }
.tk-empty { text-align: center; padding: 16px 10px; color: var(--mu); border: 1px dashed var(--bd); border-radius: 8px; font-size: 11.5px; }

/* ==========================================================================
   Docs Tab — Zero-Card Hairline Action Strip + Rock-Solid Table Alignment
   ========================================================================== */
.doc-launch-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 12px;
}
@media (max-width: 760px) { .doc-launch-strip { grid-template-columns: 1fr; } }
.doc-litem {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; cursor: pointer;
  border-inline-end: 1px solid var(--line);
  transition: background .14s;
}
.doc-litem:last-child { border-inline-end: 0; }
.doc-litem:hover { background: var(--g1); }
.doc-litem-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-lic {
  width: 38px; height: 38px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 18px;
  background: var(--el); border: 1px solid var(--bd);
}
.doc-ltxt { min-width: 0; }
.doc-ltxt b { display: block; font-size: 13px; font-weight: 800; color: var(--tx); }
.doc-ltxt small { display: block; font-size: 11px; color: var(--mu); margin-top: 2px; line-height: 1.45; }

.docs-tbl { width: 100%; border-collapse: collapse; min-width: 820px; }
.docs-tbl th, .docs-tbl td { text-align: right !important; vertical-align: middle !important; padding: 10px 13px; }
.docs-tbl .doc-col1 { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.docs-tbl .doc-no { font-size: 11.5px; font-weight: 800; color: var(--tx); }
.docs-tbl .doc-acts { display: inline-flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.docs-tbl .doc-acts .mi { height: 27px; min-width: 27px; padding: 0 8px; font-size: 11px; }
.docs-tbl select.doc-st-sel { width: 116px !important; height: 29px !important; font-size: 11.5px !important; padding: 0 7px !important; border-radius: 7px !important; }

/* Split-Screen Docs Studio */
.dst-bar {
  position: sticky; top: 60px; z-index: 12;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; margin-bottom: 12px; border-radius: var(--r);
  background: var(--gm); border: 1px solid var(--gb);
}
.dst-bar-r, .dst-bar-l { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dst-bar select { width: auto !important; height: 33px !important; font-size: 12px; }
.dst-mob-sw { display: none; }
.dst-grid { display: grid; grid-template-columns: minmax(380px, 1.04fr) minmax(420px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1180px) {
  .dst-mob-sw { display: inline-flex; }
  .dst-grid { grid-template-columns: 1fr; }
  .dst-grid[data-mob="form"] .dst-pv-col { display: none; }
  .dst-grid[data-mob="prev"] .dst-fm-col { display: none; }
}
.dst-fm-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dst-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; }
.dst-sec-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dst-sec-hd h3 { margin: 0; }
.dst-sec details summary { cursor: pointer; font-weight: 800; font-size: 13px; list-style: none; display: flex; align-items: center; justify-content: space-between; color: var(--tx); }
.dst-sec details summary::-webkit-details-marker { display: none; }
.dst-sec details[open] summary { margin-bottom: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--bd); }
.dst-colors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dst-clr { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.dst-clr.on { border-color: var(--tx); transform: scale(1.1); }
.dit-wrap { overflow-x: auto; margin: 6px 0 10px; border: 1px solid var(--bd); border-radius: 9px; }
.dit { width: 100%; border-collapse: collapse; min-width: 540px; }
.dit th { background: var(--el); padding: 7px; font-size: 11px; font-weight: 700; color: var(--mu); text-align: right; border-bottom: 1px solid var(--bd); }
.dit td { padding: 5px; border-bottom: 1px solid var(--bd); }
.dit tr:last-child td { border-bottom: 0; }
.dit input, .dit select { height: 30px !important; font-size: 12px; padding: 0 7px; border-radius: 6px; }
.dit .dit-sum { font-weight: 800; font-size: 12px; color: var(--lt); white-space: nowrap; text-align: left; direction: ltr; }
.dst-totbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; padding: 10px 12px; border-radius: 9px; background: var(--el); border: 1px solid var(--bd); margin-top: 8px; }
.dst-totbox > div small { display: block; font-size: 10.5px; color: var(--mu); }
.dst-totbox > div b { font-size: 13.5px; font-weight: 800; color: var(--tx); }
.dst-totbox .grand b { color: var(--lt); font-size: 15px; }
.dst-words { margin-top: 8px; padding: 8px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--g1); color: var(--lt); border: 1px dashed rgba(15, 138, 125, 0.35); }
.dcl-item { background: var(--el); border: 1px solid var(--bd); border-radius: 9px; padding: 9px 11px; margin-bottom: 7px; }
.dcl-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.dcl-num { height: 22px; padding: 0 7px; border-radius: 6px; background: var(--g1); color: var(--lt); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; }
.dcl-hd input { height: 29px !important; font-weight: 700; font-size: 12px; }
.dcl-item textarea { font-size: 12px; min-height: 64px; resize: vertical; }
.dpay-row { display: grid; grid-template-columns: 1.2fr 78px 1.2fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
@media (max-width: 600px) { .dpay-row { grid-template-columns: 1fr 74px; } }

/* Live A4 Preview */
.dst-pv-col { position: sticky; top: 122px; min-width: 0; }
.dst-pv-shell { background: var(--el); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.dst-pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; font-size: 11.5px; color: var(--mu); }
.dst-pv-scroll { max-height: calc(100vh - 196px); overflow: auto; padding: 2px; }
.a4-paper {
  background: #ffffff !important; color: #0f172a !important;
  border-radius: 6px; box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.45);
  padding: 24px 26px; font-family: Vazirmatn, Tahoma, sans-serif; font-size: 11.5px; line-height: 1.7;
  direction: rtl; text-align: right; min-height: 680px; position: relative; overflow: hidden;
  -webkit-user-select: text !important; user-select: text !important;
}
.a4-topbar { height: 6px; margin: -24px -26px 18px; background: var(--da, #0f766e); }
.a4-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 2px solid var(--da, #0f766e); margin-bottom: 14px; }
.a4-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.a4-logo { width: 50px; height: 50px; border-radius: 10px; object-fit: contain; border: 1px solid #e2e8f0; padding: 3px; background: #fff; flex: none; }
.a4-mono { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--da, #0f766e); color: #fff; font-weight: 800; font-size: 18px; flex: none; }
.a4-co { font-size: 15px; font-weight: 800; color: #0f172a; }
.a4-sub { font-size: 10.5px; color: #475569; margin-top: 2px; }
.a4-meta { text-align: right; min-width: 175px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 9px; padding: 8px 11px; }
.a4-doc-t { font-size: 14px; font-weight: 800; color: var(--da, #0f766e); margin-bottom: 4px; text-align: center; }
.a4-meta-r { display: flex; justify-content: space-between; gap: 10px; font-size: 10.5px; color: #334155; line-height: 1.7; }
.a4-meta-r b { color: #0f172a; }
.a4-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.a4-pbox { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 9px; padding: 9px 11px; }
.a4-pbox-h { font-size: 11px; font-weight: 800; color: var(--da, #0f766e); padding-bottom: 4px; margin-bottom: 6px; border-bottom: 1px dashed #cbd5e1; }
.a4-pr { font-size: 10.5px; color: #334155; line-height: 1.65; } .a4-pr b { color: #0f172a; }
.a4-tbl { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 10.5px; min-width: 0 !important; }
.a4-tbl th { background: var(--da, #0f766e) !important; color: #fff !important; padding: 7px; font-weight: 700; text-align: right; border: 1px solid var(--da, #0f766e); position: static !important; }
.a4-tbl td { padding: 6.5px 7px; border: 1px solid #e2e8f0; color: #0f172a; vertical-align: middle; }
.a4-tbl tbody tr:nth-child(even) { background: #f8fafc !important; }
.a4-tbl .num { text-align: center; white-space: nowrap; }
.a4-tbl .amt { text-align: left; direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-weight: 700; }
.a4-bot { display: grid; grid-template-columns: 1.2fr .9fr; gap: 12px; margin-bottom: 14px; align-items: start; }
.a4-notes { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 9px; padding: 9px 11px; font-size: 10.5px; color: #334155; }
.a4-notes h5 { margin: 0 0 4px; font-size: 11px; font-weight: 800; color: #0f172a; }
.a4-sum { border: 1px solid #e2e8f0; border-radius: 9px; overflow: hidden; font-size: 11px; }
.a4-sum-r { display: flex; justify-content: space-between; padding: 5.5px 10px; border-bottom: 1px solid #e2e8f0; color: #334155; background: #fff; }
.a4-sum-r:last-child { border-bottom: 0; }
.a4-sum-r.grand { background: var(--da, #0f766e); color: #fff; font-weight: 800; font-size: 12px; padding: 8px 10px; }
.a4-words { background: #f1f5f9; border: 1px solid #cbd5e1; border-right: 3px solid var(--da, #0f766e); border-radius: 7px; padding: 7px 11px; font-size: 11px; font-weight: 700; color: #0f172a; margin-bottom: 14px; }
.a4-bank { background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 8px; padding: 8px 11px; font-size: 10.5px; color: #334155; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.a4-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; padding-top: 10px; }
.a4-sig { border: 1px solid #e2e8f0; border-radius: 9px; padding: 10px 12px; min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; text-align: center; }
.a4-sig b { font-size: 11px; color: #0f172a; } .a4-sig small { font-size: 10px; color: #64748b; }
.a4-stamp { max-height: 54px; max-width: 120px; object-fit: contain; margin: 4px auto; }
.a4-foot { margin-top: 14px; padding-top: 8px; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-between; font-size: 9.5px; color: #64748b; }
.a4-bism { text-align: center; font-size: 11px; font-weight: 700; color: #475569; margin-bottom: 4px; }
.a4-cnt-hd { text-align: center; padding-bottom: 12px; border-bottom: 2px solid var(--da, #0f766e); margin-bottom: 14px; }
.a4-cnt-hd h1 { font-size: 16px; font-weight: 800; color: var(--da, #0f766e); margin: 2px 0 6px; }
.a4-cnt-meta { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-size: 10.5px; color: #334155; }
.a4-clause { margin-bottom: 11px; }
.a4-clause-t { font-size: 11.5px; font-weight: 800; color: var(--da, #0f766e); margin-bottom: 3px; display: flex; align-items: center; gap: 5px; }
.a4-clause-t::before { content: "◆"; font-size: 8px; }
.a4-clause-b { font-size: 11px; color: #1e293b; text-align: justify; line-height: 1.85; padding-inline-start: 12px; }
.pv-modal-body { max-height: 74vh; overflow: auto; padding: 12px; background: var(--el); border-radius: 10px; border: 1px solid var(--bd); margin: 10px 0; }
.img-up-box { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; background: var(--el); border: 1px dashed var(--gb); }
.img-up-box img { width: 46px; height: 46px; object-fit: contain; border-radius: 7px; background: #fff; border: 1px solid var(--bd); padding: 2px; flex: none; }
.img-up-lbl { display: inline-flex; align-items: center; gap: 6px; height: 29px; padding: 0 10px; border-radius: 7px; background: var(--surface); border: 1px solid var(--gb); color: var(--tx); font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.img-up-lbl input { display: none; }
.img-up-st { font-size: 11px; color: var(--mu); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Modals, Customer Inspector, Settings, Copilot, Toast, Minimal Quick Trigger
   ========================================================================== */
#dr-bg { position: fixed; inset: 0; z-index: 28; background: rgba(5, 6, 12, 0.65); backdrop-filter: none; opacity: 0; pointer-events: none; transition: opacity .15s; }
#dr-bg.open { opacity: 1; pointer-events: auto; }
#dr {
  position: fixed; top: 50%; left: 50%;
  width: min(1000px, 95vw); max-height: 90vh;
  transform: translate(-50%, -48%) scale(.98); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 29;
  border-radius: 16px; border: 1px solid var(--gb); background: var(--gm);
  box-shadow: 0 28px 70px -18px rgba(0, 0, 0, 0.72);
  overflow: hidden; display: flex; flex-direction: column;
}
#dr.open { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.cm-hd { padding: 16px 22px 12px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.cm-hd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cm-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.cm-id-txt b { font-size: 16px; font-weight: 800; color: var(--tx); display: inline-flex; align-items: center; gap: 6px; }
.cm-id-txt small { display: block; font-size: 11.5px; color: var(--mu); }
.cm-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cm-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cm-chips { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cm-score { display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px; border-radius: 8px; background: var(--el); border: 1px solid var(--bd); font-size: 11.5px; }
.cm-score .bar { width: 68px; height: 5px; }
.cm-tabs { display: flex; align-items: center; gap: 6px; padding: 8px 22px 0; border-bottom: 1px solid var(--line); background: var(--gm); flex: none; }
.cm-tabs button { height: 36px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--mu); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px; }
.cm-tabs button:hover { color: var(--tx); }
.cm-tabs button.on { color: var(--lt); border-bottom-color: var(--ac); }
.cm-tabs .cnt { font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--g1); color: var(--lt); font-weight: 800; }
.cm-body { padding: 16px 22px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.cm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .cm-grid { grid-template-columns: 1fr; } .cm-hd, .cm-body, .cm-tabs { padding-inline: 14px; } }
.cm-card { background: var(--el); border: 1px solid var(--bd); border-radius: 11px; padding: 14px 15px; margin-bottom: 12px; }
.cm-card:last-child { margin-bottom: 0; }
.cm-card h4 { margin: 0 0 10px; font-size: 12.5px; font-weight: 800; color: var(--tx); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cm-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; font-size: 12px; }
@media (max-width: 520px) { .cm-info-grid { grid-template-columns: 1fr; } }
.cm-info-item small { display: block; font-size: 10.5px; color: var(--mu); }
.cm-info-item b { display: block; font-size: 12px; color: var(--tx); font-weight: 700; word-break: break-word; }
.cm-deal-row, .cm-fu-item, .cm-tl-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--bd); margin-bottom: 6px; }
.cm-deal-row { justify-content: space-between; }
.cm-deal-row:last-child, .cm-fu-item:last-child, .cm-tl-item:last-child { margin-bottom: 0; }
.cm-fu-item.late { border-color: rgba(244, 63, 94, 0.45); }
.cm-fu-main { flex: 1; min-width: 0; }
.cm-fu-main b { display: block; font-size: 12px; color: var(--tx); }
.cm-fu-main small { display: block; font-size: 10.5px; color: var(--mu); }
.cm-tl-flts { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 9px; }
.cm-tl-flts button { height: 24px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--bd); background: var(--surface); color: var(--mu); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.cm-tl-flts button.on { background: var(--ac); border-color: var(--ac); color: #fff; }
.cm-tl-item { align-items: flex-start; }
.cm-tl-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--g1); flex: none; font-size: 12px; }
.cm-tl-txt { flex: 1; min-width: 0; }
.cm-tl-txt b { display: block; font-size: 12px; color: var(--tx); }
.cm-tl-txt small { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 10.5px; color: var(--mu); margin-top: 2px; }
.nt { background: var(--surface); border: 1px dashed var(--gb); border-radius: 8px; padding: 8px 10px; font-size: 12px; }

.cm-docs-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cm-docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 10px; }
.dr-doc-card { background: var(--el); border: 1px solid var(--bd); border-radius: 10px; padding: 13px 14px; display: flex; flex-direction: column; gap: 7px; }
.dr-doc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dr-doc-no { font-size: 11px; font-weight: 800; color: var(--mu); }
.dr-doc-title { font-size: 13px; font-weight: 800; color: var(--tx); cursor: pointer; }
.dr-doc-title:hover { color: var(--lt); }
.dr-doc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.dr-doc-acts { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--bd); margin-top: auto; }
.dr-doc-acts .mi { height: 27px; padding: 0 8px; font-size: 11px; background: var(--surface); }
.dr-doc-acts select { width: auto !important; height: 27px !important; font-size: 11px; padding: 0 7px; border-radius: 7px; margin-inline-start: auto; }

#md { display: none; }
.mb { position: fixed; inset: 0; background: rgba(5, 6, 12, 0.68); backdrop-filter: none; z-index: 35; display: grid; place-items: start center; padding: 5vh 12px; overflow: auto; }
.mc { background: var(--gm); border: 1px solid var(--gb); border-radius: 15px; padding: 20px; width: min(460px, 100%); box-shadow: 0 28px 70px -18px rgba(0, 0, 0, 0.72); }
.mc.wide { width: min(650px, 100%); }
.mc.pv-wide { width: min(880px, 100%); padding: 18px; }
.mc .row { display: flex; gap: 8px; margin-top: 14px; }
.mh { margin-bottom: 11px; padding-bottom: 9px; border-bottom: 1px solid var(--bd); }
.mh h3 { font-size: 15px; margin: 0; }
.fg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.fg .lb { display: block; margin: 3px 0; font-size: 11.5px; color: var(--mu); font-weight: 600; }
.fg .lb > span:first-child { display: block; margin-bottom: 4px; }
.fg .wf { grid-column: 1 / -1; }
.fs { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 11px; color: var(--lt); margin-top: 9px; }
.fs:first-child { margin-top: 0; }
.fs::after { content: ""; flex: 1; height: 1px; background: var(--bd); }
.pk { display: flex; gap: 5px; }
.pk label { flex: 1; position: relative; margin: 0; }
.pk input { position: absolute; opacity: 0; width: 0; height: 0; }
.pk span { display: block; text-align: center; padding: 6px 8px; border: 1px solid var(--bd); border-radius: 8px; cursor: pointer; background: var(--el); color: var(--tx); font-size: 11.5px; font-weight: 600; }
.pk input:checked + span { background: var(--ac); border-color: var(--ac); color: #fff; }
@media (max-width: 560px) { .fg { grid-template-columns: 1fr; } }

.sg { align-items: stretch; }
.sg > .cd { display: flex; flex-direction: column; min-width: 0; }
.sf { margin-top: auto; padding-top: 12px; gap: 10px; align-items: center; }
.st-row { display: grid; grid-template-columns: 30px 1fr 84px; gap: 7px; align-items: center; margin-bottom: 6px; }
.st-num { width: 30px; height: 30px; border-radius: 7px; background: var(--el); border: 1px solid var(--bd); display: grid; place-items: center; font-weight: 800; color: var(--lt); font-size: 11.5px; }
.tag-box { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; min-height: 30px; padding: 5px; background: var(--el); border: 1px solid var(--bd); border-radius: 8px; }
.tag-i { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--bd); padding: 1px 9px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
.tag-i button { border: 0; background: 0; color: var(--bad); cursor: pointer; font-size: 13px; padding: 0 2px; line-height: 1; }

/* Copilot v5 + Jalali Date Picker */
.cpf summary { cursor: pointer; font-weight: 700; list-style: none; }
.cpf textarea { width: 100%; margin: 9px 0; resize: vertical; font: inherit; }
.qcg { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 11px; margin: 12px 0; align-items: end; }
.qcg label { display: grid; gap: 4px; font-size: 11.5px; color: var(--mu); font-weight: 600; }
.qcu { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.qcp { margin-top: 10px; padding: 14px; background: var(--el); }
.qcw { margin: 9px 0 0; padding: 8px 11px; border-radius: 8px; font-size: 12px; color: var(--wn); background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); }
.qcx { display: flex; gap: 7px; align-items: center; }
.qcx input { flex: 1; height: 40px !important; font-size: 13px; }
.qcx .btn.mic-btn { width: 40px; height: 40px; flex: none; font-size: 16px; padding: 0; }
.qcx .btn.mic-live { background: var(--bad) !important; border-color: var(--bad) !important; color: #fff !important; animation: micPulse 1.2s ease-in-out infinite; }
@keyframes micPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.55); } 50% { box-shadow: 0 0 0 9px rgba(244, 63, 94, 0); } }
.qcx-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.qcx-wrap input { width: 100%; padding-inline-end: 32px !important; }
.qcx-clr { position: absolute; inset-inline-end: 7px; width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent; color: var(--mu); cursor: pointer; display: none; place-items: center; font-size: 11px; }
.qcx-clr:hover { background: var(--el2); color: var(--tx); }
.qcx-wrap.has-v .qcx-clr { display: grid; }
.qc-vstat { display: none; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 11px; border-radius: 8px; font-size: 11.5px; font-weight: 600; background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.3); color: #fb7185; }
.qc-vstat.on { display: flex; }
.qc-waves { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.qc-waves i { display: block; width: 3px; height: 6px; border-radius: 9px; background: var(--bad); animation: qcWave .7s ease-in-out infinite; }
.qc-waves i:nth-child(2) { animation-delay: .15s; } .qc-waves i:nth-child(3) { animation-delay: .3s; } .qc-waves i:nth-child(4) { animation-delay: .45s; }
@keyframes qcWave { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.qc-hints { margin-top: 10px; padding: 11px 13px; border-radius: 10px; background: var(--el); border: 1px solid var(--bd); }
.qc-hints-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; color: var(--tx); }
.qc-hgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 6px; }
.qc-hi { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--bd); cursor: pointer; }
.qc-hi:hover { border-color: var(--ac); background: var(--g1); }
.qc-hi i { font-style: normal; font-size: 13px; flex: none; }
.qc-hi div { min-width: 0; flex: 1; }
.qc-hi b { display: block; font-size: 11px; color: var(--tx); }
.qc-hi small { display: block; font-size: 10px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-hist { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--bd); }
.ch[data-t], .ch.pickc { cursor: pointer; height: 24px; background: var(--surface); border: 1px solid var(--bd); color: var(--tx); }
.ch[data-t]:hover, .ch.pickc:hover { border-color: var(--ac); color: var(--lt); }
.qc-ans { margin-top: 10px; padding: 14px; border-radius: 10px; background: var(--el); border: 1px solid rgba(15, 138, 125, 0.3); }
.qc-ans h4 { margin: 0 0 8px; font-size: 13.5px; color: var(--tx); }
.qc-ans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 7px; margin: 9px 0; }
.qc-stat { background: var(--surface); border: 1px solid var(--bd); border-radius: 8px; padding: 8px 10px; }
.qc-stat small { display: block; font-size: 10.5px; color: var(--mu); }
.qc-stat b { font-size: 14px; color: var(--tx); font-weight: 800; }
.qc-kbd { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--el); border: 1px solid var(--bd); color: var(--mu); margin-inline-start: 6px; }

.jdp-box { position: relative; display: flex; align-items: center; }
.jdp-box input { padding-inline-end: 30px !important; direction: ltr; text-align: right; font-weight: 600; cursor: pointer; }
.jdp-btn { position: absolute; inset-inline-end: 4px; width: 25px; height: 25px; border: 0; border-radius: 6px; background: transparent; color: var(--lt); cursor: pointer; display: grid; place-items: center; font-size: 12px; }
.jdp-pop { display: none; position: absolute; top: calc(100% + 5px); inset-inline-start: 0; z-index: 50; width: 256px; padding: 10px; border-radius: 11px; background: var(--gm); border: 1px solid var(--gb); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6); }
.jdp-pop.open { display: block; }
.jdp-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.jdp-hd b { font-size: 12px; color: var(--tx); font-weight: 800; }
.jdp-hd button { width: 25px; height: 25px; border-radius: 6px; border: 1px solid var(--bd); background: var(--el); color: var(--tx); cursor: pointer; }
.jdp-q { display: flex; gap: 4px; margin-bottom: 7px; }
.jdp-q button { flex: 1; height: 23px; border-radius: 6px; border: 1px solid var(--bd); background: var(--el); color: var(--mu); font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; }
.jdp-q button:hover { border-color: var(--ac); color: var(--lt); }
.jdp-wk, .jdp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-wk span { font-size: 10px; color: var(--mu); font-weight: 700; padding: 2px 0; }
.jdp-days button { height: 27px; border: 0; border-radius: 6px; background: transparent; color: var(--tx); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.jdp-days button:hover { background: var(--g1); color: var(--lt); }
.jdp-days button.td { border: 1px solid var(--or); color: var(--or); }
.jdp-days button.on { background: var(--ac) !important; color: #fff !important; font-weight: 800; }
.jdp-days button.fr { color: var(--bad); }
.jdp-days span { height: 27px; }

#ts {
  position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%;
  transform: translate(-50%, 24px); opacity: 0;
  background: var(--gm); border: 1px solid var(--gb);
  padding: 9px 15px; border-radius: 10px; z-index: 50;
  transition: .18s; pointer-events: none; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 600;
}
#ts.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#ts a { color: var(--or); font-weight: 800; }
.td2 { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.gr div { padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.gr div:hover { background: var(--g1); }
#bk { margin-bottom: 10px; gap: 8px; flex-wrap: wrap; border-color: var(--ac); }
#bk select { width: auto; }

/* Subtle Matte Quick-Add Trigger (Not an AI neon bubble) */
.fab {
  position: fixed; inset-inline-end: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 20; display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
body.locked .fab { display: none; }
.fab .fm {
  display: none; flex-direction: column; gap: 3px; align-items: stretch;
  min-width: 192px; padding: 6px; border-radius: 11px;
  background: var(--gm); border: 1px solid var(--gb);
  box-shadow: 0 18px 42px -12px rgba(0, 0, 0, 0.7);
}
.fab.open .fm { display: flex; }
.fab .fm button {
  width: 100%; height: 34px; padding: 0 10px; border-radius: 7px;
  justify-content: flex-start; gap: 8px; font-size: 12px; font-weight: 600;
  background: transparent; border: 0; color: var(--tx2);
}
.fab .fm button:hover { background: var(--g1); color: var(--tx); }
.fab .fb {
  width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--gb); font-size: 20px; line-height: 1;
  color: var(--tx); background: var(--el2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer; transition: transform .16s, border-color .16s, background .16s;
  display: grid; place-items: center;
}
.fab .fb:hover { border-color: var(--ac); background: var(--ac); color: #fff; }
.fab.open .fb { transform: rotate(45deg); }

/* Demo & Security Curtain */
.demo-tmr { display: none; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 11.5px; font-weight: 800; background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.35); color: #fbbf24; white-space: nowrap; }
.demo-tmr.low { background: rgba(244, 63, 94, 0.16); border-color: var(--bad); color: #fb7185; }
.demo-ro-pill { display: none; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 11px; font-weight: 700; background: var(--g1); border: 1px solid rgba(15, 138, 125, 0.3); color: var(--lt); white-space: nowrap; }
body.demo-ro .demo-ro-pill { display: inline-flex; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 14px; margin-bottom: 12px; border-radius: 10px; font-size: 12px; font-weight: 700; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.28); color: var(--tx); }
.demo-banner span { display: inline-flex; align-items: center; gap: 6px; color: #fbbf24; }
.demo-banner small { font-weight: 500; color: var(--mu); }
body.demo-ro .dc, body.demo-ro .cal-cell, body.demo-ro .doc-litem { cursor: default !important; }
body.demo-ro input:disabled, body.demo-ro select:disabled, body.demo-ro textarea:disabled { opacity: .72; cursor: not-allowed; }

#sec-lock { display: none; position: fixed; inset: 0; z-index: 2147483647; place-items: center; padding: 24px; text-align: center; background: #080910; color: #f1f2f8; }
body.dt-open { overflow: hidden !important; }
body.dt-open .app-shell, body.dt-open #auth-gate, body.dt-open #dr, body.dt-open #dr-bg, body.dt-open #md, body.dt-open .fab, body.dt-open #ts { display: none !important; visibility: hidden !important; pointer-events: none !important; }
body.dt-open #sec-lock { display: grid !important; }
.sec-card { width: min(420px, 100%); padding: 28px 24px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(244, 63, 94, 0.35); }
.sec-ic { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: rgba(244, 63, 94, 0.14); font-size: 22px; }
.sec-card h3 { justify-content: center; font-size: 16px; color: #fff; margin-bottom: 8px; }
.sec-card p { font-size: 12.5px; line-height: 1.8; color: #cbd0e6; margin-bottom: 8px; }
.sec-card small { display: block; font-size: 11px; color: #8287a3; }

/* Auth Gate */
body.locked { overflow: hidden; }
body.locked .app-shell, body.locked .fab { visibility: hidden; }
#auth-gate {
  position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; padding: 22px; overflow-y: auto;
  background-color: var(--bg);
  background-image: radial-gradient(50% 45% at 80% 10%, rgba(15, 138, 125, 0.16), transparent 65%), radial-gradient(45% 45% at 20% 90%, rgba(56, 189, 248, 0.09), transparent 65%);
  transition: opacity .22s, transform .22s;
}
#auth-gate.hide { opacity: 0; transform: scale(1.015); pointer-events: none; }
.ag-wrap { width: min(390px, 100%); }
.ag-card {
  position: relative; width: 100%; padding: 30px 26px 22px;
  border-radius: 16px; border: 1px solid var(--gb); background: var(--surface);
  box-shadow: 0 28px 70px -20px rgba(0, 0, 0, 0.72);
}
.ag-card.shake { animation: agShake .32s ease; }
@keyframes agShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.ag-th { position: absolute; top: 14px; left: 14px; width: 30px; height: 30px; padding: 0; border-radius: 8px; background: var(--el); border: 1px solid var(--bd); color: var(--mu); display: grid; place-items: center; cursor: pointer; }
.ag-th:hover { color: var(--lt); border-color: var(--ac); }
.ag-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 22px; }
.ag-logo { width: 48px; height: 48px; border-radius: 13px; margin-bottom: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #0f8a7d, #0f766e); color: #fff; }
.ag-head b { font-size: 21px; font-weight: 800; color: var(--tx); line-height: 1.2; }
.ag-head b i { color: var(--lt); font-style: normal; }
.ag-head small { margin-top: 5px; font-size: 11.5px; color: var(--mu); }
.ag-div { width: 56px; height: 1px; margin: 14px auto 0; background: var(--line); }
.ag-f { display: flex; flex-direction: column; gap: 13px; }
.ag-lb { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--tx); }
.ag-inp-wrap { position: relative; display: flex; align-items: center; }
.ag-ico { position: absolute; right: 12px; width: 15px; height: 15px; color: var(--mu); pointer-events: none; }
.ag-inp-wrap:focus-within .ag-ico { color: var(--lt); }
.ag-card input { width: 100%; height: 42px !important; padding: 0 36px 0 38px !important; font-size: 13px; border-radius: 9px; direction: ltr; text-align: left; }
.ag-eye { position: absolute; left: 6px; width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--mu); cursor: pointer; display: grid; place-items: center; }
.ag-eye:hover { color: var(--tx); background: var(--g1); }
.ag-caps { display: none; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--wn); }
.ag-caps.on { display: inline-flex; }
.ag-err { padding: 8px 11px; border-radius: 8px; font-size: 11.5px; font-weight: 700; color: #fb7185; background: rgba(244, 63, 94, 0.13); border: 1px solid rgba(244, 63, 94, 0.28); text-align: center; }
.ag-err:empty { display: none; }
.ag-btn { height: 42px !important; width: 100%; margin-top: 2px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.ag-spin { animation: agSpin .85s linear infinite; }
@keyframes agSpin { to { transform: rotate(360deg); } }
.ag-foot { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--bd); display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; color: var(--mu); }
.ag-foot a { color: var(--lt); font-weight: 700; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .desk-row-mid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-row-mid > .desk-pane:nth-child(2) { grid-column: 1 / -1; order: -1; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .desk-row-bot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-row-bot > .desk-pane:last-child { grid-column: 1 / -1; border-inline-end: 0; border-top: 1px solid var(--line); }
  .cal-workspace { grid-template-columns: 1fr; }
  .cal-matrix-wrap { border-inline-end: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 1024px) {
  .sidebar { position: fixed; top: 0; bottom: 0; right: 0; width: 224px !important; transform: translateX(104%); box-shadow: -14px 0 42px rgba(0, 0, 0, 0.72); }
  body.sb-col .sidebar { padding: 12px 9px 10px; }
  body.sb-col .sb-brand-txt, body.sb-col .sb-nav button span, body.sb-col .sb-grp, body.sb-col .sb-util span, body.sb-col .sb-brand-l { display: flex; }
  body.sb-col .sb-brand-txt { display: block; }
  body.sb-col .sb-nav button, body.sb-col .sb-util { justify-content: flex-start; padding: 0 9px; }
  body.sb-open .sidebar { transform: translateX(0); }
  body.sb-open .sb-ov { display: block; }
  .sb-toggle, .sb-close { display: grid; }
  .sb-collapse { display: none; }
  .desk-frame > .mstrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desk-frame > .mstrip .mcell:nth-child(2n) { border-inline-end: 0; }
  .desk-frame > .mstrip .mcell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 740px) {
  .topbar { padding: 0 12px; }
  main { padding: 12px 12px 24px; }
  .desk-row-mid, .desk-row-bot { grid-template-columns: 1fr; }
  .desk-pane { border-inline-end: 0 !important; border-bottom: 1px solid var(--line); }
  .desk-pane:last-child { border-bottom: 0; }
  .desk-row-mid > .desk-pane:nth-child(2) { order: 0; }
  .hero-strip { padding: 16px; }
  .hero-goal-inline { border-inline-end: 0; padding-inline-end: 0; width: 100%; }
  .tb-u-info, .top-search kbd { display: none; }
  .tb-user { padding: 0 5px; }
  .donut-layout { flex-direction: column; }
  .sched-split { grid-template-columns: 1fr; }
  .today-stamp { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 12px; }
  .today-stamp b { font-size: 18px; margin: 0; }
  .cal-cell { min-height: 68px; padding: 5px; }
}


/* ==========================================================================
   Lyso CRM v14 — Architectural Upgrades (Centered Sidebar, Header Daily Strip,
   Brand Accent Presets, Focus Mode, Density, Distinct Leads/Customers,
   Slide-Over Dossier, Continuous Jalali Timeline, Minimal Calendar & Hover Peek)
   ========================================================================== */

/* 1. Brand Accent Presets (Visual #2) */
:root[data-accent="steel"] {
  --ac: #3b82f6; --ac2: #2563eb; --lt: #60a5fa;
  --g1: rgba(59, 130, 246, 0.13); --g2: rgba(59, 130, 246, 0.24);
  --ring: 0 0 0 2.5px rgba(59, 130, 246, 0.28);
}
:root[data-accent="emerald"] {
  --ac: #10b981; --ac2: #059669; --lt: #34d399;
  --g1: rgba(16, 185, 129, 0.13); --g2: rgba(16, 185, 129, 0.24);
  --ring: 0 0 0 2.5px rgba(16, 185, 129, 0.28);
}
:root[data-accent="amber"] {
  --ac: #d97706; --ac2: #b45309; --lt: #fbbf24;
  --g1: rgba(217, 119, 6, 0.14); --g2: rgba(217, 119, 6, 0.25);
  --ring: 0 0 0 2.5px rgba(217, 119, 6, 0.28);
}
:root[data-accent="mono"] {
  --ac: #94a3b8; --ac2: #64748b; --lt: #cbd5e1;
  --g1: rgba(148, 163, 184, 0.14); --g2: rgba(148, 163, 184, 0.24);
  --ring: 0 0 0 2.5px rgba(148, 163, 184, 0.28);
}
:root[data-theme="light"][data-accent="mono"] {
  --ac: #334155; --ac2: #1e293b; --lt: #334155;
  --g1: rgba(51, 65, 85, 0.10); --g2: rgba(51, 65, 85, 0.18);
}

/* 2. Tabular Numbers Everywhere (Visual #6) */
.tnum, td, .mcell-val, .dcv, .dl-pct, .fn-lbl b, .a4-tbl .amt, .dit .dit-sum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.num-neg { color: var(--bad) !important; font-weight: 700; }

/* 3. Vertically Centered Sidebar Navigation */
.sidebar {
  justify-content: space-between;
}
.sb-nav {
  flex: 1 0 auto;
  justify-content: center;
  padding-block: 10px;
}

/* 4. Upgraded 3-Zone Topbar with Daily Greeting, Date & Compact Monthly Goal */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(180px, 310px) auto;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 22px;
}
.tb-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-center { display: flex; justify-content: center; min-width: 0; }
.tb-center .top-search { width: 100%; max-width: 310px; }
.tb-left { display: flex; align-items: center; gap: 7px; justify-content: flex-end; }

.tb-daily {
  display: flex; align-items: center; gap: 14px; min-width: 0; overflow: hidden;
}
.tb-greet-row {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-greet-row b {
  font-size: 13.5px; font-weight: 800; color: var(--tx); letter-spacing: -.15px;
}
.tb-greet-row b span { color: var(--lt); }
.tb-greet-row span { font-size: 11.5px; color: var(--mu); }
.tb-sep-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--mu2); flex: none; }

.tb-goal-mini {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 9px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--bd);
  font-size: 11px; color: var(--mu); white-space: nowrap; cursor: pointer;
  transition: border-color .14s;
}
.tb-goal-mini:hover { border-color: var(--ac); }
.tb-goal-mini:empty { display: none; }
.tb-goal-bar { width: 48px; height: 4px; border-radius: 99px; background: var(--el2); overflow: hidden; }
.tb-goal-bar i { display: block; height: 100%; border-radius: 99px; background: var(--ac); }
.tb-goal-mini b { color: var(--tx); font-size: 11px; }

@media (max-width: 1180px) {
  .tb-goal-mini { display: none; }
  .topbar { grid-template-columns: minmax(0, 1fr) minmax(160px, 240px) auto; }
}
@media (max-width: 820px) {
  .topbar { display: flex; justify-content: space-between; gap: 8px; height: 52px; padding: 0 12px; }
  .tb-center { flex: 0 1 170px; }
  .tb-greet-row span, .tb-sep-dot { display: none; }
}
@media (max-width: 560px) {
  .tb-center .top-search span, .tb-center .top-search kbd { display: none; }
  .tb-center { flex: none; }
  .tb-center .top-search { width: 34px; padding: 0; justify-content: center; }
}

/* 5. Focus Mode (Visual #7) */
body.focus-mode .sidebar,
body.focus-mode .topbar,
body.focus-mode footer,
body.focus-mode .fab { display: none !important; }
body.focus-mode main { max-width: 100% !important; padding: 14px 18px 24px !important; }
body.focus-mode .dst-bar { top: 10px; }
body.focus-mode .dst-pv-col { top: 72px; }
.focus-exit {
  display: none; position: fixed; bottom: 18px; left: 18px; z-index: 45;
  height: 34px; padding: 0 14px; border-radius: 9px;
  background: var(--gm); border: 1px solid var(--ac); color: var(--tx);
  font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}
.focus-exit:hover { background: var(--ac); color: #fff; }
body.focus-mode .focus-exit { display: inline-flex; align-items: center; gap: 6px; }

/* 6. Growth Chart Crosshair (Visual #8) */
.dg-crosshair {
  stroke: var(--lt); stroke-width: 1.2; stroke-dasharray: 3 3;
  opacity: 0; transition: opacity .12s; pointer-events: none;
}
.dg-crosshair.on { opacity: .65; }

/* 7. Pipeline Hover Peek Popover (Visual #4) & Deal Age Bar (Visual #9) & Stage Checklist */
.hover-peek {
  position: fixed; z-index: 42; pointer-events: none;
  width: 248px; padding: 11px 13px; border-radius: 10px;
  background: var(--gm); border: 1px solid var(--gb);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.62);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
  font-size: 11.5px;
}
.hover-peek.on { opacity: 1; transform: none; }
.hp-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.hp-hd b { font-size: 12.5px; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 11px; color: var(--mu); }
.hp-grid b { color: var(--tx2); font-weight: 600; text-align: left; }

.dc { position: relative; overflow: hidden; padding-bottom: 10px; }
.dc-age-bar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--bd);
}
.dc-age-bar i { display: block; height: 100%; border-radius: 0; transition: width .2s; }
.dc-chk-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding-top: 3px; margin-top: 1px; border-top: 1px dashed var(--bd); font-size: 10px; color: var(--mu);
}
.dc-chk-btn {
  border: 0; background: transparent; color: var(--lt); font: inherit; font-size: 10px; font-weight: 700;
  cursor: pointer; padding: 1px 4px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px;
}
.dc-chk-btn:hover { background: var(--g1); }

/* 8. Editorial Empty States (Visual #5) */
.empty-box {
  padding: 34px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--mu);
}
.empty-ic {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--el); border: 1px solid var(--bd);
  display: grid; place-items: center; font-size: 18px; color: var(--lt);
}
.empty-box b { font-size: 13px; color: var(--tx); }
.empty-box small { font-size: 11.5px; max-width: 340px; line-height: 1.6; }

/* 9. BRAND-NEW LEADS WORKSPACE (Split-Pane Qualification Queue + Live Preview) */
.lead-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  min-height: 520px;
}
.lq-pane {
  display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--line);
  min-width: 0;
}
.lq-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  background: var(--el); font-size: 11px; font-weight: 700; color: var(--mu);
}
.lq-hd-r { display: flex; align-items: center; gap: 10px; }
.lq-list { display: flex; flex-direction: column; max-height: 68vh; overflow-y: auto; }
.lq-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1.45fr) minmax(110px, 0.85fr) minmax(105px, 0.75fr) auto auto;
  align-items: center;
  gap: 10px 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--bd);
  cursor: pointer;
  transition: background .1s;
  border-inline-start: 2.5px solid transparent;
}
body.dense .lq-row { padding: 6.5px 12px; }
.lq-row:last-child { border-bottom: 0; }
.lq-row:hover { background: rgba(255, 255, 255, 0.024); }
:root[data-theme="light"] .lq-row:hover { background: var(--surface2); }
.lq-row.sel { background: var(--g1); border-inline-start-color: var(--ac); }
.lq-row.pr-h { border-inline-start-color: var(--bad); }
.lq-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.lq-who-txt { min-width: 0; }
.lq-who-txt b { display: block; font-size: 12.5px; font-weight: 700; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lq-who-txt small { display: block; font-size: 10.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lq-stage { min-width: 0; }
.lq-stage span { display: block; font-size: 11px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lq-fu { min-width: 0; font-size: 11px; }
.lq-val { text-align: left; font-size: 12px; font-weight: 800; color: var(--lt); white-space: nowrap; }
.lq-val small { display: block; font-size: 10px; font-weight: 500; color: var(--mu); }

/* Left Live Qualification Inspector */
.lq-preview {
  display: flex; flex-direction: column;
  background: rgba(0, 0, 0, 0.14);
  padding: 16px 18px; gap: 13px;
  min-width: 0; overflow-y: auto; max-height: 72vh;
}
:root[data-theme="light"] .lq-preview { background: #fafbfe; }
.lqp-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--bd); }
.lqp-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lqp-id b { display: block; font-size: 14.5px; font-weight: 800; color: var(--tx); }
.lqp-id small { display: block; font-size: 11px; color: var(--mu); }
.lqp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding-bottom: 11px; border-bottom: 1px solid var(--bd); }
.lqp-meta div small { display: block; font-size: 10px; color: var(--mu); }
.lqp-meta div b { display: block; font-size: 12px; color: var(--tx); font-weight: 600; word-break: break-word; }
.lqp-pin { padding: 8px 10px; border-radius: 8px; background: rgba(245, 158, 11, 0.10); border: 1px solid rgba(245, 158, 11, 0.25); font-size: 11.5px; color: var(--tx); }
.lqp-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--bd); }

@media (max-width: 1120px) {
  .lead-desk { grid-template-columns: 1fr; }
  .lq-pane { border-inline-end: 0; }
  .lq-preview { display: none; }
}
@media (max-width: 720px) {
  .lq-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .lq-stage, .lq-fu, .lq-row .rg { display: none; }
}

/* 10. BRAND-NEW CUSTOMERS PORTFOLIO DIRECTORY (Tier Filter Bar + Account Ledger) */
.cust-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.cust-tier-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--el);
}
.cust-tier-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cust-tier-tabs button {
  height: 27px; padding: 0 11px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--mu); font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.cust-tier-tabs button:hover { background: var(--surface); color: var(--tx); }
.cust-tier-tabs button.on { background: var(--surface); color: var(--tx); border-color: var(--gb); font-weight: 700; }
.cust-tier-tabs em { font-style: normal; font-size: 10px; color: var(--mu); }

.cust-ledger { display: flex; flex-direction: column; max-height: 70vh; overflow-y: auto; }
.cust-row {
  display: grid;
  grid-template-columns: auto minmax(200px, 1.55fr) minmax(150px, 1fr) minmax(145px, 1fr) minmax(115px, 0.8fr) minmax(110px, 0.7fr) auto;
  align-items: center; gap: 10px 14px;
  padding: 12px 15px; border-bottom: 1px solid var(--bd);
  cursor: pointer; transition: background .1s;
}
body.dense .cust-row { padding: 7px 13px; }
.cust-row:last-child { border-bottom: 0; }
.cust-row:hover { background: var(--g1); }
.cust-ltv { min-width: 0; }
.cust-ltv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.cust-ltv-top b { font-size: 12.5px; color: var(--ok); }
.cust-ltv-top small { font-size: 10px; color: var(--mu); }
.cust-fin { font-size: 11px; }
.cust-fin b { display: block; font-size: 11.5px; }
.cust-fin small { display: block; font-size: 10px; color: var(--mu); }
.cust-health { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.cust-docs-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--tx2);
  padding: 3px 8px; border-radius: 6px; background: var(--el); border: 1px solid var(--bd);
}
@media (max-width: 1020px) {
  .cust-row { grid-template-columns: auto minmax(0, 1.4fr) minmax(110px, 1fr) auto; }
  .cust-row .cust-fin, .cust-row .cust-hide-sm { display: none; }
}

/* 11. BRAND-NEW EDITORIAL SLIDE-OVER CUSTOMER DOSSIER (Replaces Centered Modal!) */
#dr {
  top: 0 !important; bottom: 0 !important; left: 0 !important; right: auto !important;
  width: min(940px, 96vw) !important; max-height: 100vh !important; height: 100vh !important;
  border-radius: 0 !important; border: 0 !important;
  border-inline-start: 1px solid var(--gb) !important;
  transform: translateX(-104%) !important;
  opacity: 1 !important;
  transition: transform .22s cubic-bezier(.22, 1, .36, 1) !important;
}
#dr.open { transform: translateX(0) !important; }

.dos-wrap {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}
.dos-rail {
  border-inline-end: 1px solid var(--line);
  background: var(--sb-bg);
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.dos-rail-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dos-identity { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.dos-identity b { font-size: 16px; font-weight: 800; color: var(--tx); line-height: 1.3; }
.dos-identity small { font-size: 11.5px; color: var(--mu); }
.dos-kpis {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
}
.dos-kpi { background: var(--surface); padding: 9px 10px; }
.dos-kpi small { display: block; font-size: 10px; color: var(--mu); }
.dos-kpi b { display: block; font-size: 12.5px; font-weight: 800; color: var(--tx); margin-top: 2px; }
.dos-kv { display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; }
.dos-kv-row { display: flex; flex-direction: column; gap: 1px; padding-bottom: 7px; border-bottom: 1px solid var(--bd); }
.dos-kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dos-kv-row small { font-size: 10px; color: var(--mu); }
.dos-kv-row b { font-size: 12px; color: var(--tx); font-weight: 600; word-break: break-word; }
.dos-rail-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--bd); }

.dos-main {
  display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden;
  background: var(--bg);
}
.dos-topbar {
  padding: 12px 20px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.dos-top-acts { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.dos-tabs { display: flex; align-items: center; gap: 4px; overflow-x: auto; }
.dos-tabs button {
  height: 34px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--mu); font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px;
}
.dos-tabs button:hover { color: var(--tx); }
.dos-tabs button.on { color: var(--lt); border-bottom-color: var(--ac); }
.dos-tabs .cnt { font-size: 10px; padding: 0 6px; border-radius: 99px; background: var(--g1); color: var(--lt); }

/* Sticky Pinned Note Banner (Feature #9) */
.pin-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 20px;
  background: rgba(245, 158, 11, 0.09);
  border-bottom: 1px solid rgba(245, 158, 11, 0.24);
  font-size: 12px; color: var(--tx); flex: none;
}
.pin-banner-txt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pin-banner-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-banner.empty { background: var(--surface); border-bottom-color: var(--bd); color: var(--mu); font-size: 11.5px; }

.dos-content { flex: 1; overflow-y: auto; padding: 18px 20px 26px; display: flex; flex-direction: column; gap: 14px; }

/* Real Continuous Vertical Jalali Monthly Timeline (Visual #3) */
.tl-month-grp { margin-bottom: 14px; }
.tl-month-hd {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; color: var(--lt);
  padding: 2px 10px; border-radius: 99px; background: var(--g1);
  margin-bottom: 10px;
}
.tl-rail {
  position: relative;
  padding-inline-start: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.tl-rail::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; inset-inline-start: 6px;
  width: 1.5px; background: var(--line);
}
.tl-node {
  position: relative;
  padding: 9px 12px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--bd);
}
.tl-node::before {
  content: ""; position: absolute; top: 14px; inset-inline-start: -19.5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--nc, var(--ac));
  border: 2px solid var(--bg);
}
.tl-node b { display: block; font-size: 12px; font-weight: 600; color: var(--tx); line-height: 1.5; }
.tl-node small { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--mu); margin-top: 3px; }

/* Installments / Payment Tracking (Feature #3) */
.pay-box {
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; margin-bottom: 10px;
}
.pay-box-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--el); border-bottom: 1px solid var(--line);
}
.pay-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 14px; border-bottom: 1px solid var(--bd); font-size: 12px;
}
.pay-row:last-child { border-bottom: 0; }
.pay-row.paid { opacity: .72; }
.pay-row.paid b { text-decoration: line-through; }

/* Links & Tracking Codes (Feature #10) */
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 9px; background: var(--surface); border: 1px solid var(--bd);
  margin-bottom: 7px;
}
.link-row b { display: block; font-size: 12px; color: var(--tx); }
.link-row small { display: block; font-size: 10.5px; color: var(--mu); direction: ltr; text-align: right; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 820px) {
  .dos-wrap { grid-template-columns: 1fr; overflow-y: auto; }
  .dos-rail { border-inline-end: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .dos-main { height: auto; overflow: visible; }
  .dos-content { overflow: visible; }
}

/* 12. BRAND-NEW ULTRA-MINIMAL CALENDAR FROM SCRATCH (Zero Left Sidebar, Clean Canvas) */
.mcal-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.mcal-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.mcal-nav { display: flex; align-items: center; gap: 6px; }
.mcal-title { font-size: 15px; font-weight: 800; color: var(--tx); min-width: 124px; text-align: center; }
.mcal-nav button {
  height: 29px; min-width: 29px; padding: 0 9px;
  border-radius: 7px; border: 1px solid var(--bd);
  background: transparent; color: var(--tx2); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.mcal-nav button:hover { background: var(--el); border-color: var(--gb); color: var(--tx); }
.mcal-flts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mcal-f {
  height: 26px; padding: 0 9px; border-radius: 6px;
  border: 1px solid transparent; background: transparent;
  color: var(--mu); font: inherit; font-size: 11px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.mcal-f:hover { background: var(--el); color: var(--tx); }
.mcal-f.on { background: var(--g1); color: var(--lt); border-color: rgba(15, 138, 125, 0.25); }
.mcal-f i { width: 6px; height: 6px; border-radius: 50%; }

.mcal-wk {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--el);
}
.mcal-wk span {
  padding: 8px 6px; text-align: center; font-size: 11px; font-weight: 700; color: var(--mu);
}
.mcal-wk span:last-child { color: #fb7185; }

.mcal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.mcal-day {
  min-height: 102px;
  padding: 8px 9px;
  border-inline-end: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  cursor: pointer;
  display: flex; flex-direction: column; gap: 5px;
  transition: background .12s;
  min-width: 0;
}
.mcal-day:nth-child(7n) { border-inline-end: 0; }
.mcal-day:hover { background: rgba(255, 255, 255, 0.024); }
:root[data-theme="light"] .mcal-day:hover { background: var(--surface2); }
.mcal-day.out { opacity: .28; }
.mcal-day.fri { background: rgba(244, 63, 94, 0.022); }
.mcal-day-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.mcal-dnum {
  width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--tx2);
}
.mcal-day.fri .mcal-dnum { color: #fb7185; }
.mcal-day.td .mcal-dnum { background: var(--ac); color: #fff; font-weight: 800; }
.mcal-cnt { font-size: 10px; color: var(--mu2); font-weight: 700; }
.mcal-evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mcal-ev {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--tx2); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 1px 4px; border-radius: 4px;
}
.mcal-ev i { width: 5px; height: 5px; border-radius: 50%; flex: none; background: var(--ec, var(--ac)); }
.mcal-ev.late { color: #fb7185; background: rgba(244, 63, 94, 0.10); }
.mcal-ev.done { opacity: .42; text-decoration: line-through; }
.mcal-more { font-size: 10px; color: var(--mu); padding-inline-start: 4px; }

@media (max-width: 720px) {
  .mcal-day { min-height: 70px; padding: 5px; }
  .mcal-ev { font-size: 9.5px; }
}

/* 13. Settings Accent Swatches & Product Catalog Table */
.acc-swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.acc-sw {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--bd); background: var(--el); color: var(--tx2);
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.acc-sw i { width: 12px; height: 12px; border-radius: 50%; }
.acc-sw.on { border-color: var(--ac); background: var(--g1); color: var(--tx); font-weight: 700; }

.cat-row {
  display: grid; grid-template-columns: 74px 1.4fr 84px 115px auto;
  gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--bd);
  font-size: 12px;
}
.cat-row:last-child { border-bottom: 0; }


/* ==========================================================================
   Lyso CRM v15 — Minimal Floating Centered Sidebar, Distinct Light Mode,
   Refined Leads & Customers, Centered Profile Modal, New Minimal Calendar
   & Selected Visual Refinements (#1, #2, #3, #4, #6, #7, #8, #9)
   ========================================================================== */

/* 1. LAYERED LIGHT MODE CONTRAST (Unmistakable Visual Separation Between Canvas, Sidebar & Panels) */
:root[data-theme="light"] {
  --bg: #e6ebf2;
  --bgs: #ffffff;
  --sb-bg: #f6f8fc;
  --surface: #ffffff;
  --surface2: #f1f4fa;
  --cd: #ffffff;
  --cd-solid: #ffffff;
  --el: #edf1f7;
  --el2: #e1e6f0;
  --bd: rgba(15, 23, 42, 0.095);
  --line: rgba(15, 23, 42, 0.14);
  --gb: rgba(15, 23, 42, 0.18);
  --gm: #ffffff;
  --gl: rgba(230, 235, 242, 0.90);
  --tx: #101426;
  --tx2: #303754;
  --mu: #5d6482;
  --mu2: #858cab;
  --sd: 0 2px 10px -4px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05);
}
:root[data-theme="light"] .desk-frame,
:root[data-theme="light"] .cd,
:root[data-theme="light"] .tb,
:root[data-theme="light"] .pipe-bar,
:root[data-theme="light"] .mstrip,
:root[data-theme="light"] .doc-launch-strip,
:root[data-theme="light"] .ld-wrap,
:root[data-theme="light"] .cu-wrap,
:root[data-theme="light"] .cal2-wrap,
:root[data-theme="light"] .tkb,
:root[data-theme="light"] .col {
  box-shadow: 0 2px 10px -4px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
}
:root[data-theme="light"] .sidebar {
  box-shadow: 0 14px 36px -14px rgba(15, 23, 42, 0.16), 0 1px 3px rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .top-search,
:root[data-theme="light"] .tb-ico-btn,
:root[data-theme="light"] .tb-user,
:root[data-theme="light"] .tb-goal-mini {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.13);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* 2. FLOATING FIT-CONTENT VERTICALLY CENTERED SIDEBAR (No empty top/bottom filler!) */
.app-shell {
  display: block;
  min-height: 100vh;
}
.sidebar {
  position: fixed !important;
  top: 50% !important;
  right: 14px !important;
  bottom: auto !important;
  height: auto !important;
  max-height: calc(100vh - 28px) !important;
  transform: translateY(-50%) !important;
  width: var(--sb-w);
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: var(--sb-bg);
  padding: 12px 9px 10px !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.65);
  transition: width .2s cubic-bezier(.22, 1, .36, 1), transform .22s cubic-bezier(.22, 1, .36, 1);
}
.sb-nav {
  flex: 0 1 auto !important;
  justify-content: flex-start !important;
  padding-block: 2px !important;
}
.sb-foot {
  margin-top: 2px !important;
}
.app-main {
  margin-inline-start: calc(var(--sb-w) + 26px);
  width: auto !important;
  min-height: 100vh;
  transition: margin-inline-start .2s cubic-bezier(.22, 1, .36, 1);
}
body.sb-col .sidebar {
  width: var(--sb-w-col);
  padding-inline: 7px !important;
}
body.sb-col .app-main {
  margin-inline-start: calc(var(--sb-w-col) + 26px);
}
body.focus-mode .app-main {
  margin-inline-start: 0 !important;
}

@media (max-width: 1024px) {
  .app-main, body.sb-col .app-main { margin-inline-start: 0 !important; }
  .sidebar {
    right: 12px !important;
    width: 220px !important;
    transform: translate(118%, -50%) !important;
  }
  body.sb-open .sidebar { transform: translate(0, -50%) !important; }
}

/* 3. SMART CONTEXTUAL BREADCRUMB (Visual #1) */
.bc-wrap {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 10px 22px 0;
}
.bc-wrap:empty { display: none; }
.bc-bar {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--mu);
}
.bc-bar a { color: var(--mu); font-weight: 600; }
.bc-bar a:hover { color: var(--lt); }
.bc-bar span.bc-sep { color: var(--mu2); font-size: 10px; }
.bc-bar b { color: var(--tx); font-weight: 700; }
@media (max-width: 740px) { .bc-wrap { padding: 8px 12px 0; } }

/* 4. SOFT COLOR-CODED TAGS (Visual #3) */
.tg-c {
  display: inline-flex; align-items: center; height: 20px;
  padding: 0 7px; border-radius: 5px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
  background: var(--tbg, var(--el)); color: var(--tcol, var(--tx2));
  border: 1px solid var(--tbd, var(--bd));
}

/* 5. SEARCH MATCH HIGHLIGHT (Visual #7) */
mark.hl {
  background: color-mix(in srgb, var(--ac) 26%, transparent);
  color: var(--tx);
  border-radius: 3px;
  padding: 0 2px;
}

/* 6. TACTILE MICRO-ANIMATION ON TASK & INSTALLMENT CHECK (Visual #4) */
@keyframes ckPop {
  0% { transform: scale(.82); }
  55% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.ckb { transition: background .15s, border-color .15s, transform .15s; }
.ckb.on { animation: ckPop .24s cubic-bezier(.22, 1, .36, 1); }
input[type="checkbox"].pay-chk:checked { animation: ckPop .22s cubic-bezier(.22, 1, .36, 1); }

/* 7. MINIATURE SOURCE CHANNEL INDICATOR ON AVATAR (Visual #9) */
.av-wrap {
  position: relative; display: inline-flex; flex: none;
}
.av-src {
  position: absolute; bottom: -2px; left: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--surface);
  color: var(--src-c, var(--lt));
  display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.av-src svg { width: 9px; height: 9px; }

/* 8. CONTRACT TIMELINE BAR (Visual #2) */
.ct-bar {
  margin-top: 8px; padding: 7px 10px; border-radius: 8px;
  background: var(--el); border: 1px solid var(--bd);
  display: flex; flex-direction: column; gap: 4px;
}
.ct-bar-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 10.5px; color: var(--mu);
}
.ct-bar-hd b { font-weight: 700; }
.ct-track {
  height: 4px; border-radius: 99px; background: var(--el2); overflow: hidden;
}
.ct-track i { display: block; height: 100%; border-radius: 99px; background: var(--ac); }
.ct-track i.warn { background: var(--wn); }
.ct-track i.exp { background: var(--bad); }

/* 9. RESIZABLE SPLIT HANDLE IN DOCS STUDIO (Visual #6) */
.dst-grid.has-resizer {
  grid-template-columns: var(--dst-l, 1.04fr) 10px var(--dst-r, 1fr);
  gap: 8px;
}
.dst-resizer {
  align-self: stretch;
  cursor: col-resize;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background .14s;
  min-height: 240px;
}
.dst-resizer::before {
  content: ""; width: 2px; height: 52px; border-radius: 99px;
  background: var(--gb); transition: background .14s, height .14s;
}
.dst-resizer:hover::before, body.resizing .dst-resizer::before {
  background: var(--ac); height: 90px;
}
body.resizing { cursor: col-resize !important; }
@media (max-width: 1180px) {
  .dst-grid.has-resizer { grid-template-columns: 1fr !important; }
  .dst-resizer { display: none !important; }
}

/* ==========================================================================
   10. REDESIGNED MINIMAL LEADS DIRECTORY (Clean, Crisp, Human-Crafted)
   ========================================================================== */
.ld-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.ld-stabs {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--el);
}
.ld-stabs-r { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.ld-stab {
  height: 27px; padding: 0 10px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--mu); font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .12s;
}
.ld-stab:hover { color: var(--tx); background: var(--surface); }
.ld-stab.on { background: var(--surface); color: var(--tx); border-color: var(--gb); font-weight: 700; }
.ld-stab em { font-style: normal; font-size: 10px; color: var(--mu); }
.ld-stabs-l { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--mu); }

.ld-list { display: flex; flex-direction: column; }
.ld-row {
  display: grid;
  grid-template-columns: 20px minmax(200px, 1.55fr) 128px minmax(125px, 0.9fr) minmax(115px, 0.85fr) 96px 76px 116px;
  align-items: center; gap: 10px 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--bd);
  cursor: pointer; transition: background .1s;
  border-inline-start: 2.5px solid transparent;
}
body.dense .ld-row { padding: 7px 12px; }
.ld-row:last-child { border-bottom: 0; }
.ld-row:hover { background: var(--surface2); }
.ld-row.pr-h { border-inline-start-color: var(--bad); }
.ld-chk { opacity: .28; transition: opacity .12s; }
.ld-row:hover .ld-chk, .ld-chk:checked { opacity: 1; }

.ld-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ld-person-t { min-width: 0; }
.ld-name-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ld-name-line b { font-size: 12.5px; font-weight: 700; color: var(--tx); }
.ld-person-t small {
  display: block; font-size: 10.5px; color: var(--mu);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.ld-phone {
  font-size: 11.5px; color: var(--tx2); direction: ltr; text-align: right;
  white-space: nowrap; cursor: pointer;
}
.ld-phone:hover { color: var(--lt); }
.ld-phone small { display: block; font-size: 10px; color: var(--mu); direction: rtl; }

.ld-stage { min-width: 0; }
.ld-stage-n { display: block; font-size: 11px; color: var(--tx2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }

.ld-fu { min-width: 0; font-size: 11px; }
.ld-val { text-align: left; font-size: 12px; font-weight: 800; color: var(--tx); white-space: nowrap; }
.ld-val small { display: block; font-size: 9.5px; font-weight: 500; color: var(--mu); }

.ld-score {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 4px;
  height: 23px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 800;
  background: var(--el); color: var(--tx2);
}
.ld-score.ok { background: rgba(16, 185, 129, 0.13); color: var(--ok); }
.ld-score.wn { background: rgba(245, 158, 11, 0.13); color: var(--wn); }
.ld-score.bad { background: rgba(244, 63, 94, 0.13); color: var(--bad); }

.ld-acts {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  opacity: .55; transition: opacity .12s;
}
.ld-row:hover .ld-acts { opacity: 1; }

@media (max-width: 1180px) {
  .ld-row { grid-template-columns: 20px minmax(0, 1.4fr) 115px minmax(100px, .85fr) 86px 70px; }
  .ld-row .ld-fu, .ld-row .ld-acts { display: none; }
}
@media (max-width: 740px) {
  .ld-row { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .ld-row .ld-phone, .ld-row .ld-stage, .ld-row .ld-score { display: none; }
}

/* ==========================================================================
   11. REDESIGNED MINIMAL CUSTOMERS DIRECTORY (2-Column Hairline Account Roster)
   ========================================================================== */
.cu-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.cu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cu-cell {
  padding: 15px 18px;
  border-bottom: 1px solid var(--bd);
  border-inline-end: 1px solid var(--bd);
  cursor: pointer;
  display: flex; flex-direction: column; gap: 11px;
  transition: background .12s;
  min-width: 0;
}
body.dense .cu-cell { padding: 10px 14px; gap: 7px; }
.cu-cell:nth-child(2n) { border-inline-end: 0; }
.cu-cell:hover { background: var(--surface2); }

.cu-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cu-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.cu-id-t { min-width: 0; }
.cu-id-t b { font-size: 13px; font-weight: 800; color: var(--tx); display: inline-flex; align-items: center; gap: 6px; }
.cu-id-t small { display: block; font-size: 11px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cu-top-l { display: flex; align-items: center; gap: 6px; flex: none; }

.cu-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; padding: 9px 11px; border-radius: 8px;
  background: var(--el); border: 1px solid var(--bd);
}
.cu-stat small { display: block; font-size: 10px; color: var(--mu); }
.cu-stat b { display: block; font-size: 12px; font-weight: 800; color: var(--tx); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cu-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.cu-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.cu-acts { display: flex; align-items: center; gap: 4px; opacity: .65; transition: opacity .12s; }
.cu-cell:hover .cu-acts { opacity: 1; }

@media (max-width: 960px) {
  .cu-grid { grid-template-columns: 1fr; }
  .cu-cell { border-inline-end: 0; }
}

/* ==========================================================================
   12. CENTERED EDITORIAL CUSTOMER PROFILE MODAL (Back to Center of Screen!)
   ========================================================================== */
#dr {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: min(940px, 94vw) !important;
  height: auto !important;
  max-height: 87vh !important;
  border-radius: 16px !important;
  border: 1px solid var(--gb) !important;
  background: var(--gm) !important;
  box-shadow: 0 32px 84px -20px rgba(0, 0, 0, 0.72) !important;
  transform: translate(-50%, -48%) scale(.975) !important;
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease !important;
  display: flex; flex-direction: column; overflow: hidden;
}
#dr.open {
  transform: translate(-50%, -50%) scale(1) !important;
  opacity: 1 !important;
  pointer-events: auto;
}
.cmod-hd {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.cmod-hd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cmod-id { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.cmod-id-t b { font-size: 16px; font-weight: 800; color: var(--tx); display: inline-flex; align-items: center; gap: 6px; }
.cmod-id-t small { display: block; font-size: 11.5px; color: var(--mu); margin-top: 1px; }
.cmod-acts { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cmod-sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cmod-tabs {
  display: flex; align-items: center; gap: 4px; padding: 6px 20px 0;
  border-bottom: 1px solid var(--line); background: var(--surface); flex: none; overflow-x: auto;
}
.cmod-tabs button {
  height: 35px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--mu); font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -1px;
}
.cmod-tabs button:hover { color: var(--tx); }
.cmod-tabs button.on { color: var(--lt); border-bottom-color: var(--ac); }
.cmod-tabs .cnt { font-size: 10px; padding: 0 6px; border-radius: 99px; background: var(--g1); color: var(--lt); }
.cmod-body {
  padding: 18px 20px 22px; overflow-y: auto; flex: 1; min-height: 0;
  background: var(--bg);
}
.cmod-split {
  display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start;
}
.cmod-info-panel {
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 14px 15px;
  display: flex; flex-direction: column; gap: 12px;
}
@media (max-width: 780px) {
  .cmod-split { grid-template-columns: 1fr; }
  .cmod-hd, .cmod-body, .cmod-tabs { padding-inline: 14px; }
}

/* ==========================================================================
   13. BRAND-NEW MINIMAL CALENDAR (Month + Week Views, Ultra-Calm Architecture)
   ========================================================================== */
.cal2-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.cal2-hd {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.cal2-nav {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.cal2-title {
  font-size: 15px; font-weight: 800; color: var(--tx); min-width: 145px; text-align: center;
}
.cal2-nav button {
  height: 28px; min-width: 28px; padding: 0 9px; border-radius: 7px;
  border: 1px solid var(--bd); background: transparent; color: var(--tx2);
  font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.cal2-nav button:hover { background: var(--el); border-color: var(--gb); color: var(--tx); }

.cal2-right { display: flex; align-items: center; gap: 6px; }
.cal2-left { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cal2-flt-sel { width: auto !important; height: 29px !important; font-size: 11.5px !important; padding: 0 9px !important; }

/* Month View */
.cal2-wk-hd {
  display: grid; grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--el);
}
.cal2-wk-hd span {
  padding: 8px 6px; text-align: center; font-size: 11px; font-weight: 700; color: var(--mu);
}
.cal2-wk-hd span:last-child { color: #fb7185; }

.cal2-month {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
}
.cal2-mcell {
  position: relative;
  min-height: 106px; padding: 8px 9px;
  border-inline-end: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  cursor: pointer; display: flex; flex-direction: column; gap: 5px;
  transition: background .1s; min-width: 0;
}
.cal2-mcell:nth-child(7n) { border-inline-end: 0; }
.cal2-mcell:hover { background: var(--surface2); }
.cal2-mcell.out { opacity: .28; }
.cal2-mcell.fri { background: rgba(244, 63, 94, 0.024); }
.cal2-mcell.td::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--ac);
}
.cal2-mnum {
  font-size: 12px; font-weight: 700; color: var(--tx2); line-height: 1.4;
  display: inline-flex; align-items: center; gap: 5px;
}
.cal2-mcell.fri .cal2-mnum { color: #fb7185; }
.cal2-mcell.td .cal2-mnum { color: var(--ac); font-weight: 800; }
.cal2-td-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ac); }
.cal2-mevs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal2-mev {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--tx2); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 1px 5px; border-radius: 4px; background: var(--el);
}
.cal2-mev i { width: 5px; height: 5px; border-radius: 50%; flex: none; background: var(--ec, var(--ac)); }
.cal2-mev.late { color: #fb7185; background: rgba(244, 63, 94, 0.10); }
:root[data-theme="light"] .cal2-mev.late { color: #be123c; }
.cal2-mev.done { opacity: .44; text-decoration: line-through; }
.cal2-more { font-size: 10px; color: var(--mu); padding-inline-start: 4px; }

/* Week View (7-Column Vertical Minimal Schedule) */
.cal2-week {
  display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr));
  overflow-x: auto; min-height: 460px;
}
.cal2-wcol {
  border-inline-end: 1px solid var(--bd);
  display: flex; flex-direction: column; min-width: 0;
}
.cal2-wcol:last-child { border-inline-end: 0; }
.cal2-wcol.fri { background: rgba(244, 63, 94, 0.02); }
.cal2-whd {
  padding: 11px 10px; text-align: center;
  border-bottom: 1px solid var(--line);
  background: var(--el);
  position: relative;
}
.cal2-wcol.td .cal2-whd::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2.5px; background: var(--ac);
}
.cal2-whd small { display: block; font-size: 10.5px; color: var(--mu); font-weight: 700; }
.cal2-whd b { display: block; font-size: 17px; font-weight: 800; color: var(--tx); margin-top: 2px; line-height: 1.2; }
.cal2-wcol.td .cal2-whd b { color: var(--ac); }
.cal2-wcol.fri .cal2-whd small, .cal2-wcol.fri .cal2-whd b { color: #fb7185; }

.cal2-wbody {
  padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.cal2-witem {
  padding: 8px 9px; border-radius: 8px;
  background: var(--el); border: 1px solid var(--bd);
  border-inline-start: 2.5px solid var(--ec, var(--ac));
  display: flex; align-items: flex-start; gap: 7px;
}
.cal2-witem.done { opacity: .48; }
.cal2-witem.late { border-inline-start-color: var(--bad); }
.cal2-witem-t { flex: 1; min-width: 0; }
.cal2-witem-t b { display: block; font-size: 11.5px; font-weight: 600; color: var(--tx); line-height: 1.4; }
.cal2-witem.done .cal2-witem-t b { text-decoration: line-through; }
.cal2-witem-t small { display: block; font-size: 10px; color: var(--mu); margin-top: 2px; }
.cal2-wadd {
  margin-top: auto; width: 100%; height: 28px;
  border-radius: 7px; border: 1px dashed var(--bd);
  background: transparent; color: var(--mu); font: inherit; font-size: 11px;
  cursor: pointer; transition: border-color .12s, color .12s, background .12s;
}
.cal2-wadd:hover { border-color: var(--ac); color: var(--lt); background: var(--g1); }

@media (max-width: 820px) {
  .cal2-hd { grid-template-columns: 1fr; justify-items: center; }
  .cal2-mcell { min-height: 70px; padding: 5px; }
}


/* ==========================================================================
   Lyso CRM v16 — Authentic Minimal Human-Crafted Architecture
   (Complete Card Overhaul, Minimal Headered Tables for Leads & Customers,
    Zero AI Colored Top/Side Stripes, Single Modal Close, Scrollbar-Free Tabs,
    Executive Analytical Reports Suite)
   ========================================================================== */

/* 1. RESTRAINED MATTE AVATARS & FLAT BARS (No Rainbow Gradients) */
.av {
  background: var(--abg, var(--el2)) !important;
  color: var(--atx, var(--tx)) !important;
  border: 1px solid var(--bd);
  font-weight: 700;
}
:root[data-theme="light"] .av {
  background: #edf1f7 !important;
  color: #334155 !important;
  border-color: rgba(15, 23, 42, 0.11);
}
.bar i {
  background: var(--ac) !important;
}
.tb-u-av {
  background: var(--el2) !important;
  color: var(--tx) !important;
  border: 1px solid var(--gb);
}
:root[data-theme="light"] .tb-u-av {
  background: #edf1f7 !important;
  color: #1e293b !important;
}

/* 2. REMOVE ALL AI COLORED TOP BORDERS & LOUD SIDE STRIPES */
.col, .tkb {
  border-top: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--surface) !important;
  padding: 12px !important;
}
.col.ov {
  outline: 1.5px dashed var(--ac) !important;
}
.cal2-witem {
  border-inline-start: 1px solid var(--bd) !important;
  background: var(--bg) !important;
}
:root[data-theme="light"] .cal2-witem {
  background: #f8fafc !important;
}
.cal2-witem.late {
  border-color: rgba(244, 63, 94, 0.35) !important;
}

/* 3. COMPLETE OVERHAUL OF ALL CARDS (Flat, Quiet, Tactile, High-Craft) */
.cd, .rep-panel, .min-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
:root[data-theme="light"] .min-shell,
:root[data-theme="light"] .rep-panel {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
}

/* Metric Strip — Clean Typographic Hierarchy Without Dots/Emojis */
.mstrip {
  border-radius: 10px !important;
}
.mcell-lbl {
  font-size: 11px; font-weight: 600; color: var(--mu);
}
.mcell-val {
  font-size: 20px; font-weight: 800; letter-spacing: -.2px;
}

/* Pipeline Deal Card — Completely Redesigned */
.dc {
  background: var(--bg) !important;
  border: 1px solid var(--bd) !important;
  border-radius: 8px !important;
  padding: 11px 12px !important;
  gap: 8px !important;
  transition: border-color .14s, background .14s;
}
:root[data-theme="light"] .dc {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}
.dc:hover {
  border-color: var(--gb) !important;
  background: var(--surface2) !important;
}
:root[data-theme="light"] .dc:hover {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.22) !important;
}
.dc-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.dc-title {
  font-size: 12.5px; font-weight: 700; color: var(--tx); line-height: 1.4;
  display: inline-flex; align-items: center; gap: 5px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dc-price {
  font-size: 11.5px; font-weight: 700; color: var(--tx2); white-space: nowrap; flex: none;
}
.dc-person {
  display: flex; align-items: center; gap: 7px; cursor: pointer; min-width: 0;
}
.dc-pname {
  font-size: 11.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .12s;
}
.dc-person:hover .dc-pname { color: var(--tx); }
.dc-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding-top: 7px; border-top: 1px solid var(--bd);
}
.dc-age {
  font-size: 10.5px; color: var(--mu);
}
.dc-age.bad { color: var(--bad); font-weight: 700; }
.dc-chk-btn {
  font-size: 10px !important; color: var(--mu) !important;
  background: var(--el) !important; padding: 2px 6px !important; border-radius: 4px !important;
}
.dc-chk-btn:hover { color: var(--tx) !important; background: var(--el2) !important; }
.dca { opacity: .45; transition: opacity .14s; }
.dc:hover .dca { opacity: 1; }
.pri-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--bad); flex: none; display: inline-block;
}

/* Task Cards — Completely Redesigned */
.tkc {
  background: var(--bg) !important;
  border: 1px solid var(--bd) !important;
  border-radius: 8px !important;
  padding: 10px 11px !important;
}
:root[data-theme="light"] .tkc {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}
.tkc:hover {
  border-color: var(--gb) !important;
}

/* Docs Cards inside Profile Modal */
.dr-doc-card {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 9px !important;
  padding: 13px 15px !important;
}

/* Clean Low-Saturation Status Pills */
.st-pill {
  display: inline-flex; align-items: center; height: 21px; padding: 0 7px;
  border-radius: 5px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
  background: var(--el); color: var(--tx2); border: 1px solid var(--bd);
}
.st-pill.ok { background: rgba(16, 185, 129, 0.10); color: #10b981; border-color: rgba(16, 185, 129, 0.22); }
.st-pill.wn { background: rgba(245, 158, 11, 0.10); color: #d97706; border-color: rgba(245, 158, 11, 0.22); }
.st-pill.bad { background: rgba(244, 63, 94, 0.10); color: #f43f5e; border-color: rgba(244, 63, 94, 0.22); }
.st-pill.lt { background: var(--g1); color: var(--lt); border-color: rgba(15, 138, 125, 0.22); }
.st-pill.mu { background: var(--el); color: var(--mu); border-color: var(--bd); }

/* 4. REDESIGNED MINIMAL HEADERED TABLES (LEADS & CUSTOMERS) */
.min-shell {
  overflow: hidden;
}
.min-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 14px; flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.min-tabs {
  display: flex; align-items: center; gap: 3px; flex-wrap: wrap;
}
.min-tab {
  height: 29px; padding: 0 10px; border-radius: 7px;
  border: 1px solid transparent; background: transparent;
  color: var(--mu); font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s, color .12s;
}
.min-tab:hover { color: var(--tx); background: var(--el); }
.min-tab.on {
  background: var(--el); color: var(--tx); border-color: var(--gb); font-weight: 700;
}
.min-tab em { font-style: normal; font-size: 10px; color: var(--mu); }

.min-tools {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; justify-content: flex-end;
}
.min-search {
  width: min(240px, 100%) !important; height: 31px !important; font-size: 12px !important;
}
.min-tools select {
  width: auto !important; height: 31px !important; font-size: 11.5px !important; padding: 0 8px !important;
}
.min-cnt {
  font-size: 11px; color: var(--mu); white-space: nowrap; padding-inline-start: 4px;
}

.min-tbl {
  width: 100%; border-collapse: collapse; min-width: 780px;
}
.min-tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--el);
  color: var(--mu);
  font-size: 11px; font-weight: 700;
  text-align: right;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.min-tbl tbody td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--bd);
  vertical-align: middle;
  font-size: 12.5px;
  color: var(--tx);
}
.min-tbl tbody tr:last-child td { border-bottom: 0; }
.min-tbl tbody tr.min-row { cursor: pointer; transition: background .1s; }
.min-tbl tbody tr.min-row:hover { background: var(--surface2); }

.min-tbl .col-chk { width: 34px; text-align: center !important; padding-inline: 8px; }
.min-tbl .col-num { text-align: left !important; white-space: nowrap; }
.min-tbl .col-cen { text-align: center !important; white-space: nowrap; }
.min-tbl .col-act { text-align: left !important; width: 132px; white-space: nowrap; }

.min-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.min-person-t { min-width: 0; }
.min-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.min-name b { font-size: 12.5px; font-weight: 700; color: var(--tx); }
.min-person-t small {
  display: block; font-size: 10.5px; color: var(--mu); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px;
}
.min-phone {
  display: inline-block; direction: ltr; font-size: 12px; font-weight: 600; color: var(--tx2);
  cursor: pointer;
}
.min-phone:hover { color: var(--ac); }
.min-stage-t { display: block; font-size: 11.5px; font-weight: 600; color: var(--tx2); margin-bottom: 3px; }
.min-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.min-fin b { display: block; font-size: 12px; font-weight: 700; }
.min-acts {
  display: inline-flex; align-items: center; gap: 4px;
  opacity: .52; transition: opacity .12s;
}
.min-row:hover .min-acts { opacity: 1; }

/* 5. PROFILE MODAL — SINGLE CLOSE BUTTON & ZERO TAB SCROLLBAR */
.cmod-vsep {
  display: inline-block; width: 1px; height: 20px; background: var(--line); margin: 0 3px;
}
.cmod-close {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid transparent; background: transparent;
  color: var(--mu); font-size: 14px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
  transition: background .12s, color .12s, border-color .12s;
}
.cmod-close:hover { background: var(--el); color: var(--tx); border-color: var(--bd); }

.cmod-tabs {
  overflow: visible !important;
  flex-wrap: wrap !important;
  scrollbar-width: none !important;
  padding: 6px 20px 0 !important;
  gap: 2px !important;
}
.cmod-tabs::-webkit-scrollbar { display: none !important; }
.cmod-tabs button {
  height: 36px; padding: 0 11px; font-size: 12px;
}

/* Clean Minimal Timeline Nodes */
.tl-node {
  background: var(--surface) !important;
  border: 1px solid var(--bd) !important;
}
.tl-node::before {
  background: var(--ac) !important;
  width: 7px !important; height: 7px !important;
  inset-inline-start: -18.5px !important;
}
.cm-deal-row, .cm-fu-item, .link-row {
  background: var(--surface) !important;
  border: 1px solid var(--bd) !important;
  border-radius: 8px !important;
}

/* 6. CLEAN FUNNEL & RADAR TAG (Dashboard & Reports) */
.fn-clean {
  display: flex; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 3px 0;
}
.fn-clean-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12px;
}
.fn-clean-top span { color: var(--tx2); font-weight: 600; }
.fn-clean-top b { color: var(--tx); font-weight: 700; }
.fn-clean-top small { font-weight: 500; color: var(--mu); }
.fn-clean-track {
  height: 6px; border-radius: 99px; background: var(--el); overflow: hidden;
}
.fn-clean-track i {
  display: block; height: 100%; border-radius: 99px; background: var(--ac);
}
.radar-tag {
  font-size: 10px; font-weight: 700; color: var(--mu);
  padding: 2px 7px; border-radius: 5px; background: var(--el); border: 1px solid var(--bd);
  white-space: nowrap; flex: none;
}

/* 7. REBUILT ANALYTICAL REPORTS LAYOUT & CHARTS */
.rep-grid-top {
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 12px; margin-bottom: 12px;
}
.rep-grid-2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; margin-bottom: 12px; align-items: start;
}
.rep-grid-3 {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-bottom: 12px; align-items: stretch;
}
.rep-panel {
  padding: 16px 18px;
  display: flex; flex-direction: column; min-width: 0;
}
.rep-svg-box {
  position: relative; width: 100%; min-height: 210px; display: flex; align-items: center;
}
.rep-svg-box svg {
  width: 100%; height: 220px; overflow: visible; display: block;
}
.rep-hist {
  width: 100%; height: 165px; display: block; overflow: visible; margin-top: auto;
}
.rep-hbars {
  display: flex; flex-direction: column; gap: 11px;
}
.rep-hbar-row {
  display: flex; flex-direction: column; gap: 4px;
}
.rep-hbar-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 12px;
}
.rep-hbar-lbl {
  color: var(--tx2); font-weight: 600; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rep-hbar-lbl small { color: var(--mu); font-weight: 500; margin-inline-start: 4px; }
.rep-hbar-top b { color: var(--tx); font-weight: 700; white-space: nowrap; }
.rep-hbar-track {
  height: 6px; border-radius: 99px; background: var(--el); overflow: hidden;
}
.rep-hbar-track i {
  display: block; height: 100%; border-radius: 99px; background: var(--ac); opacity: .82;
}
.rep-tbl-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.rep-tbl-hd b { font-size: 13px; font-weight: 800; color: var(--tx); }
.rep-empty {
  padding: 28px 12px; text-align: center; font-size: 11.5px; color: var(--mu);
}

@media (max-width: 1120px) {
  .rep-grid-top, .rep-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .rep-grid-2 { grid-template-columns: 1fr; }
}


/* ==========================================================================
   Lyso CRM v17 — Soft Tinted Pipeline Columns, Fixed Profile Modal Dimensions,
   and Perfectly Aligned Zero-Overflow Reports Layout with Internal Scrolling
   ========================================================================== */

/* 1. SUBTLE TINTED BACKGROUNDS FOR PIPELINE COLUMNS (Dark & Light Mode) */
.kb .col[data-col="0"] {
  background: rgba(15, 138, 125, 0.055) !important;
  border-color: rgba(15, 138, 125, 0.16) !important;
}
.kb .col[data-col="1"] {
  background: rgba(56, 189, 248, 0.055) !important;
  border-color: rgba(56, 189, 248, 0.16) !important;
}
.kb .col[data-col="2"] {
  background: rgba(16, 185, 129, 0.055) !important;
  border-color: rgba(16, 185, 129, 0.16) !important;
}
.kb .col[data-col="3"] {
  background: rgba(245, 158, 11, 0.055) !important;
  border-color: rgba(245, 158, 11, 0.16) !important;
}
.kb .col[data-col="4"] {
  background: rgba(236, 72, 153, 0.055) !important;
  border-color: rgba(236, 72, 153, 0.16) !important;
}

/* Crisp deal cards resting cleanly on the softly tinted columns */
.kb .col .dc {
  background: var(--surface) !important;
}

:root[data-theme="light"] .kb .col[data-col="0"] {
  background: #f5f3ff !important;
  border-color: rgba(15, 138, 125, 0.20) !important;
}
:root[data-theme="light"] .kb .col[data-col="1"] {
  background: #eff7ff !important;
  border-color: rgba(59, 130, 246, 0.20) !important;
}
:root[data-theme="light"] .kb .col[data-col="2"] {
  background: #eefaf4 !important;
  border-color: rgba(16, 185, 129, 0.20) !important;
}
:root[data-theme="light"] .kb .col[data-col="3"] {
  background: #fef8eb !important;
  border-color: rgba(245, 158, 11, 0.22) !important;
}
:root[data-theme="light"] .kb .col[data-col="4"] {
  background: #fdf1f6 !important;
  border-color: rgba(236, 72, 153, 0.20) !important;
}
:root[data-theme="light"] .kb .col .dc {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.10) !important;
}
:root[data-theme="light"] .kb .col .col-flt input {
  background: rgba(255, 255, 255, 0.85);
}

/* 2. FIXED, STABLE DIMENSIONS FOR CUSTOMER PROFILE MODAL (Zero Resize Jump on Tab Switch) */
#dr {
  width: min(920px, 94vw) !important;
  height: min(670px, 86vh) !important;
  max-height: 86vh !important;
  min-height: min(520px, 82vh) !important;
}
.cmod-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

/* 3. REBUILT ALIGNED ZERO-OVERFLOW REPORTS ARCHITECTURE */
.rep-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.rep-row-1 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}
.rep-row-2 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}
.rep-row-3 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}
.rep-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.rep-tbl-panel {
  padding: 0 !important;
}
.rep-tbl-hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.rep-tbl-hd b { font-size: 13px; font-weight: 800; color: var(--tx); }

/* Strictly Contained Internal Scrollbox */
.rep-scroll {
  height: 275px;
  overflow-y: auto;
  overflow-x: auto;
  width: 100%;
  min-width: 0;
}
.rep-tbl {
  width: 100%;
  min-width: 0 !important;
  border-collapse: collapse;
}
.rep-tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--el);
  color: var(--mu);
  font-size: 11px; font-weight: 700;
  text-align: right;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.rep-tbl tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--bd);
  vertical-align: middle;
  font-size: 12px;
  color: var(--tx);
}
.rep-tbl tbody tr:last-child td { border-bottom: 0; }
.rep-tbl tbody tr.min-row { cursor: pointer; }
.rep-tbl tbody tr.min-row:hover { background: var(--surface2); }
.rep-tbl .col-cen { text-align: center !important; white-space: nowrap; }
.rep-tbl .col-num { text-align: left !important; white-space: nowrap; }

/* Compact Ring Chart Layout Inside 3-Col Panels (Zero Horizontal Overflow) */
.rep-ring-wrap {
  display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0;
}
.rep-ring-box {
  position: relative; width: 112px; height: 112px; flex: none; display: grid; place-items: center;
}
.rep-ring-box svg {
  width: 112px; height: 112px; transform: rotate(-90deg); overflow: visible;
}
.rep-ring-leg {
  display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0;
}
.rep-ring-leg .dl-row {
  padding: 2px 5px; font-size: 11.5px;
}

@media (max-width: 1240px) {
  .rep-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rep-row-2 > .rep-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
  .rep-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .rep-row-1, .rep-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 740px) {
  .rep-row-2 { grid-template-columns: 1fr; }
  .rep-row-2 > .rep-panel:last-child { grid-column: auto; }
  .rep-ring-wrap { flex-direction: column; }
  .rep-ring-leg { width: 100%; }
}


/* ==========================================================================
   Lyso CRM v18 — Complete Palette Overhaul (Warm Graphite + Petrol Teal /
   Stone Alabaster Light Mode), Split Editorial Login Page, Fixed Top-Right
   Favicon Brand Corner, Brighter Distinct Pipeline Columns, Dead-Center Avatars
   ========================================================================== */

/* 1. MASTER COLOR PALETTE — ZERO AI PURPLE (Dark + Light Mode) */
:root, :root[data-theme="dark"] {
  --bg: #0f1114;
  --bgs: #13161b;
  --sb-bg: #14171c;
  --surface: #171a20;
  --surface2: #1e222a;
  --cd: #171a20;
  --cd-solid: #171a20;
  --el: #20242d;
  --el2: #282d38;
  --gm: #181c22;
  --gl: rgba(15, 17, 20, 0.88);
  --bd: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.095);
  --gb: rgba(255, 255, 255, 0.14);

  --tx: #f3f4f6;
  --tx2: #cbd2dc;
  --mu: #8b94a3;
  --mu2: #626b7a;

  /* Default Brand Accent: Petrol Teal */
  --ac: #0f8a7d;
  --ac2: #0d7368;
  --lt: #2dd4bf;
  --g1: rgba(20, 184, 166, 0.12);
  --g2: rgba(20, 184, 166, 0.22);
  --ring: 0 0 0 2.5px rgba(20, 184, 166, 0.28);

  --ok: #10b981;
  --wn: #d97706;
  --bad: #e11d48;
  --sky: #38bdf8;
  --k1: #14b8a6;
  --k2: #d97706;
  --k3: #10b981;
  --k4: #3b82f6;
  --k5: #64748b;
  --k6: #e11d48;
}

:root[data-theme="light"] {
  --bg: #eceff2;
  --bgs: #ffffff;
  --sb-bg: #f7f8fa;
  --surface: #ffffff;
  --surface2: #f3f5f8;
  --cd: #ffffff;
  --cd-solid: #ffffff;
  --el: #eff2f5;
  --el2: #e3e7ed;
  --gm: #ffffff;
  --gl: rgba(236, 239, 242, 0.92);
  --bd: rgba(15, 23, 42, 0.085);
  --line: rgba(15, 23, 42, 0.13);
  --gb: rgba(15, 23, 42, 0.18);

  --tx: #111827;
  --tx2: #374151;
  --mu: #5f6978;
  --mu2: #8791a1;

  --ac: #0f766e;
  --ac2: #115e59;
  --lt: #0f766e;
  --g1: rgba(15, 118, 110, 0.09);
  --g2: rgba(15, 118, 110, 0.16);
  --ring: 0 0 0 2.5px rgba(15, 118, 110, 0.20);
}

/* Accent Theme Presets (Dark & Light) */
:root[data-accent="copper"] {
  --ac: #c2410c; --ac2: #9a3412; --lt: #fb923c;
  --g1: rgba(194, 65, 12, 0.14); --g2: rgba(194, 65, 12, 0.24);
  --ring: 0 0 0 2.5px rgba(194, 65, 12, 0.28);
}
:root[data-theme="light"][data-accent="copper"] {
  --lt: #c2410c;
  --g1: rgba(194, 65, 12, 0.09); --g2: rgba(194, 65, 12, 0.17);
}
:root[data-theme="light"][data-accent="steel"] { --ac: #2563eb; --ac2: #1d4ed8; --lt: #2563eb; }
:root[data-theme="light"][data-accent="emerald"] { --ac: #059669; --ac2: #047857; --lt: #059669; }
:root[data-theme="light"][data-accent="amber"] { --ac: #b45309; --ac2: #92400e; --lt: #b45309; }

/* 2. FIXED TOP-RIGHT BRAND / FAVICON CORNER (Fills the top-right slot cleanly) */
.brand-corner {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 24;
  width: var(--sb-w);
  height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--sb-bg);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: width .2s cubic-bezier(.22, 1, .36, 1), border-color .14s;
  overflow: hidden;
}
:root[data-theme="light"] .brand-corner {
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.brand-corner:hover { border-color: var(--gb); }
.brand-fav, .sb-logo-img, .tb-mob-logo {
  width: 28px; height: 28px;
  border-radius: 7px;
  object-fit: contain;
  display: block;
  flex: none;
}
.brand-corner-txt { min-width: 0; line-height: 1.15; }
.brand-corner-txt b { display: block; font-size: 13.5px; font-weight: 800; color: var(--tx); letter-spacing: -.2px; white-space: nowrap; }
.brand-corner-txt b i { color: var(--lt); font-style: normal; }
.brand-corner-txt small { display: block; font-size: 9.5px; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

body.locked .brand-corner,
body.dt-open .brand-corner { display: none !important; }

/* Collapsed Sidebar Rail Sync */
body.sb-col .brand-corner {
  width: var(--sb-w-col);
  padding: 0;
  justify-content: center;
}
body.sb-col .brand-corner-txt { display: none; }

/* On desktop, hide duplicate brand inside floating sidebar — show only collapse toggle cleanly */
@media (min-width: 1025px) {
  .sidebar .sb-brand {
    padding: 0 2px 8px;
    min-height: 32px;
    justify-content: flex-end;
  }
  .sidebar .sb-brand-l { display: none !important; }
  body.sb-col .sidebar .sb-brand { justify-content: center; padding: 0 0 8px; }
  .tb-mob-logo { display: none; }
}
@media (max-width: 1024px) {
  .brand-corner { display: none !important; }
  .tb-mob-logo { display: block; cursor: pointer; }
}

/* 3. DEAD-CENTER AVATAR INITIALS (Fixes off-center Persian glyphs like م) */
.av {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  padding: 0 !important;
  letter-spacing: 0 !important;
  overflow: hidden;
  flex: none !important;
}
.av .av-ch, .tb-u-av .av-ch {
  display: block;
  line-height: 1;
  transform: translateY(-0.07em);
}
.av.lg {
  width: 44px; height: 44px;
  font-size: 17px;
  border-radius: 10px;
}
.tb-u-av {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 !important;
}

/* 4. BRIGHTER, CLEARLY DISTINCT PIPELINE COLUMN BACKGROUNDS (Dark & Light) */
.kb .col[data-col="0"] {
  background: #1b2434 !important;
  border-color: #304566 !important;
}
.kb .col[data-col="1"] {
  background: #162b2c !important;
  border-color: #255356 !important;
}
.kb .col[data-col="2"] {
  background: #2b2418 !important;
  border-color: #574427 !important;
}
.kb .col[data-col="3"] {
  background: #2d1e21 !important;
  border-color: #5b353c !important;
}
.kb .col[data-col="4"] {
  background: #162a21 !important;
  border-color: #26543e !important;
}

/* High-contrast crisp deal cards resting cleanly on brighter tinted columns */
.kb .col .dc {
  background: #12151a !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
}
.kb .col .dc:hover {
  background: #181c23 !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}
.kb .col .col-flt input {
  background: rgba(15, 17, 20, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
}

:root[data-theme="light"] .kb .col[data-col="0"] {
  background: #e2ecf8 !important;
  border-color: #bcd2ed !important;
}
:root[data-theme="light"] .kb .col[data-col="1"] {
  background: #ddf2ef !important;
  border-color: #b0dcd5 !important;
}
:root[data-theme="light"] .kb .col[data-col="2"] {
  background: #f9edd5 !important;
  border-color: #e6cc99 !important;
}
:root[data-theme="light"] .kb .col[data-col="3"] {
  background: #f8e3e0 !important;
  border-color: #e6bdb7 !important;
}
:root[data-theme="light"] .kb .col[data-col="4"] {
  background: #dcf2e5 !important;
  border-color: #addbc0 !important;
}
:root[data-theme="light"] .kb .col .dc {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.11) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
:root[data-theme="light"] .kb .col .dc:hover {
  border-color: rgba(15, 23, 42, 0.24) !important;
}
:root[data-theme="light"] .kb .col .col-flt input {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

/* 5. COMPLETELY REDESIGNED HUMAN-CRAFTED SPLIT EDITORIAL LOGIN PAGE */
#auth-gate {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999 !important;
  padding: 0 !important;
  display: block;
  background: var(--bg) !important;
  background-image: none !important;
  overflow-y: auto !important;
}
.ag-shell {
  min-height: 100vh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(380px, 470px) minmax(0, 1fr);
}
.ag-pane-form {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 42px 24px;
  background: var(--surface) !important;
  border: 0 !important;
  border-inline-end: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.ag-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ag-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ag-brand-img {
  width: 34px; height: 34px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
}
.ag-brand-t { line-height: 1.2; }
.ag-brand-t b { display: block; font-size: 16px; font-weight: 800; color: var(--tx); letter-spacing: -.2px; }
.ag-brand-t b i { color: var(--lt); font-style: normal; }
.ag-brand-t small { display: block; font-size: 10px; color: var(--mu); }

.ag-pane-form .ag-th {
  position: static !important;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--el);
  border: 1px solid var(--bd);
  color: var(--mu);
  display: grid; place-items: center; cursor: pointer;
}
.ag-pane-form .ag-th:hover { color: var(--tx); border-color: var(--gb); }

.ag-form-body {
  width: 100%;
  max-width: 340px;
  margin: auto 0;
  padding: 28px 0;
}
.ag-intro { margin-bottom: 24px; }
.ag-intro h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--tx);
  letter-spacing: -.3px;
  margin-bottom: 6px;
}
.ag-intro p {
  font-size: 12.5px;
  color: var(--mu);
  line-height: 1.65;
}
.ag-pane-form .ag-f { gap: 15px; }
.ag-pane-form .ag-lb { gap: 6px; font-size: 12px; font-weight: 600; color: var(--tx2); }
.ag-pane-form input {
  height: 40px !important;
  padding: 0 12px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  direction: ltr;
  text-align: left;
}
.ag-pane-form .ag-pw input { padding-left: 38px !important; }
:root[data-theme="light"] .ag-pane-form input {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
}
.ag-pane-form input:focus {
  background: var(--surface) !important;
  border-color: var(--ac) !important;
}
.ag-pane-form .ag-btn {
  height: 41px !important;
  border-radius: 7px !important;
  margin-top: 4px;
  font-size: 13px;
}
.ag-pane-form .ag-foot {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid var(--bd);
  justify-content: flex-start;
  font-size: 11px;
}

/* Left Editorial Brand Panel (Clean Solid Surface — Zero Gridlines) */
.ag-pane-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 56px 28px;
  background: #12151a;
}
:root[data-theme="light"] .ag-pane-side {
  background: #e6eaef;
}
.ag-side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--mu);
}
.ag-side-main {
  max-width: 520px;
  margin: auto 0;
}
.ag-side-main h2 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--tx);
  letter-spacing: -.3px;
  margin-bottom: 12px;
}
.ag-side-main > p {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--mu);
  margin-bottom: 30px;
}
.ag-ledger {
  border-top: 1px solid var(--line);
}
.ag-ledger-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.ag-ledger-row > span {
  font-size: 11px;
  font-weight: 700;
  color: var(--lt);
  font-variant-numeric: tabular-nums;
}
.ag-ledger-row b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 2px;
}
.ag-ledger-row small {
  display: block;
  font-size: 11.5px;
  color: var(--mu);
  line-height: 1.6;
}
.ag-side-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--mu);
  padding-top: 14px;
  border-top: 1px solid var(--bd);
}

@media (max-width: 920px) {
  .ag-shell { grid-template-columns: 1fr; }
  .ag-pane-side { display: none; }
  .ag-pane-form {
    padding: 24px 22px;
    border-inline-end: 0 !important;
    align-items: center;
  }
  .ag-top-bar, .ag-foot { width: 100%; max-width: 360px; }
  .ag-form-body { max-width: 360px; }
}


/* ==========================================================================
   Lyso CRM v19 — Distinct Minimal Customers Hairline Account Portfolio
   ========================================================================== */
.cust-selall {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 31px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--bd);
  background: var(--el);
  color: var(--mu);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cust-selall:hover { color: var(--tx); border-color: var(--gb); }

.cust-dir-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface);
}
.cust-empty {
  grid-column: 1 / -1;
}
.cust-tile {
  padding: 16px 18px;
  border-bottom: 1px solid var(--bd);
  border-inline-end: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: background .12s;
  min-width: 0;
}
.cust-tile:nth-child(2n) { border-inline-end: 0; }
.cust-tile:hover { background: var(--surface2); }

.cust-tile-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.cust-tile-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.cust-tile-who { min-width: 0; }
.cust-tile-who b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-tile-who small {
  display: block;
  font-size: 11px;
  color: var(--mu);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.cust-tile-st {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.cust-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
  padding: 9px 0;
}
.cust-m {
  padding-inline: 10px;
  border-inline-end: 1px solid var(--bd);
  min-width: 0;
}
.cust-m:first-child { padding-inline-start: 0; }
.cust-m:last-child { border-inline-end: 0; padding-inline-end: 0; }
.cust-m small {
  display: block;
  font-size: 10px;
  color: var(--mu);
}
.cust-m b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--tx);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-m span {
  display: block;
  font-size: 10px;
  color: var(--mu);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cust-tile-ft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.cust-tile-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}
.cust-tile-acts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  opacity: .55;
  transition: opacity .12s;
}
.cust-tile:hover .cust-tile-acts { opacity: 1; }

@media (max-width: 960px) {
  .cust-dir-grid { grid-template-columns: 1fr; }
  .cust-tile { border-inline-end: 0; }
}
@media (max-width: 520px) {
  .cust-metrics { grid-template-columns: 1fr; gap: 6px; }
  .cust-m { border-inline-end: 0; padding-inline: 0; }
}


/* ==========================================================================
   Lyso CRM v20 — Clearly Separated Minimal Customer Cards (Dark & Light)
   + Airy, Minimal & High-Utility Customer Profile Modal
   ========================================================================== */

/* 1. CUSTOMERS GRID — UNMISTAKABLE VISUAL SEPARATION BETWEEN RECORDS */
.cust-dir-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  padding: 14px !important;
  background: #0c0e12 !important;
}
:root[data-theme="light"] .cust-dir-grid {
  background: #dfe4eb !important;
}

.cust-tile {
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 11px !important;
  background: #171b22 !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  border-inline-start: 3px solid var(--tier-c, #64748b) !important;
  overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s, background .15s !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}
.cust-tile:nth-child(2n) {
  border-inline-end: 1px solid rgba(255, 255, 255, 0.11) !important;
}
.cust-tile:hover {
  background: #1b2029 !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  border-inline-start-color: var(--tier-c, var(--ac)) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.48);
}

/* Subtle Semantic Tier Edge Colors (Calm, Architectural) */
.cust-tile.tone-gold { --tier-c: #d97706; }
.cust-tile.tone-silver { --tier-c: #0f8a7d; }
.cust-tile.tone-bronze { --tier-c: #64748b; }
.cust-tile.tone-risk { --tier-c: #e11d48; }

:root[data-theme="light"] .cust-tile {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  border-inline-start: 3px solid var(--tier-c, #64748b) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .cust-tile:nth-child(2n) {
  border-inline-end: 1px solid rgba(15, 23, 42, 0.14) !important;
}
:root[data-theme="light"] .cust-tile:hover {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.26) !important;
  border-inline-start-color: var(--tier-c, var(--ac)) !important;
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.13);
}

/* Distinct Card Header, Body & Footer Zones */
.cust-tile-hd {
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--bd);
  align-items: center !important;
}
:root[data-theme="light"] .cust-tile-hd {
  background: #f6f8fa;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}
.cust-idx {
  font-size: 10px;
  font-weight: 700;
  color: var(--mu2);
  padding-inline-start: 4px;
}

.cust-tile-body {
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cust-tile-body .cust-metrics {
  border-top: 0 !important;
  border-bottom: 0 !important;
  padding: 0 !important;
}

.cust-tile-ft {
  padding: 9px 15px;
  background: rgba(0, 0, 0, 0.14);
  border-top: 1px solid var(--bd);
  margin-top: auto;
}
:root[data-theme="light"] .cust-tile-ft {
  background: #f8fafc;
  border-top-color: rgba(15, 23, 42, 0.07);
}
.cust-tile-acts { opacity: .78 !important; }
.cust-tile:hover .cust-tile-acts { opacity: 1 !important; }

@media (max-width: 960px) {
  .cust-dir-grid { grid-template-columns: 1fr !important; padding: 10px !important; gap: 10px !important; }
}

/* 2. STREAMLINED, MINIMAL & HIGH-UTILITY CUSTOMER PROFILE MODAL */
.cmod-hd {
  padding: 14px 20px !important;
}
.cmod-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cmod-name-row b {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--tx);
  margin-inline-end: 2px;
}
.cmod-id-t small {
  margin-top: 3px !important;
}

.pin-banner {
  padding: 7px 20px !important;
  font-size: 11.5px !important;
}
.pin-banner-txt b {
  color: var(--wn);
  font-weight: 700;
  flex: none;
}

.cmod-tabs {
  padding: 2px 20px 0 !important;
}
.cmod-tabs button {
  height: 36px !important;
  font-size: 12px !important;
}

.cmod-body {
  padding: 16px 20px 20px !important;
}
.cmod-split {
  grid-template-columns: 262px minmax(0, 1fr) !important;
  gap: 16px !important;
}
.cmod-info-panel {
  padding: 14px !important;
  gap: 11px !important;
  border-radius: 10px !important;
}
.cmod-copy {
  cursor: pointer;
  transition: color .12s;
}
.cmod-copy:hover { color: var(--lt) !important; }
.cmod-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 2px;
}
.cmod-side-acts {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--bd);
}
.cmod-side-acts .btn {
  height: 29px !important;
  font-size: 11.5px !important;
  padding: 0 10px !important;
}

/* Right Timeline Column: Next Follow-Up Strip + 1-Line Quick Logger */
.cmod-timeline-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.cmod-next {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--ac);
}
.cmod-next.late {
  border-inline-start-color: var(--bad);
  background: rgba(225, 29, 72, 0.06);
}
.cmod-next-t {
  flex: 1;
  min-width: 0;
}
.cmod-next-t > span {
  display: block;
  font-size: 10.5px;
  color: var(--mu);
}
.cmod-next-t > b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmod-qlog {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.cmod-qlog select {
  width: 90px !important;
  height: 30px !important;
  font-size: 11.5px !important;
  padding: 0 7px !important;
  border-radius: 6px !important;
  flex: none;
}
.cmod-qlog input {
  flex: 1;
  height: 30px !important;
  font-size: 12px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 6px !important;
}
.cmod-qlog .btn {
  height: 30px !important;
  padding: 0 12px !important;
  font-size: 11.5px !important;
  flex: none;
}

.cmod-tl-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.cmod-tl-hd > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--mu);
}

.cmod-msg-box {
  margin: 0 !important;
  padding: 13px 15px !important;
}
.cmod-msg-box summary {
  font-size: 12.5px;
  color: var(--tx);
}

@media (max-width: 780px) {
  .cmod-split { grid-template-columns: 1fr !important; }
  .cmod-qlog { flex-wrap: wrap; }
  .cmod-qlog select { width: 100% !important; }
}


/* ==========================================================================
   Lyso CRM v21 — Rich, Lively & Eye-Friendly Design Overhaul
   1) Soft Warm-Mist Light Mode (Zero Blinding Stark White)
   2) Deep Ocean-Slate Dark Mode with Vibrant Teal/Emerald/Amber/Sky Accents
   3) ZERO AI Colored Side Stripes on Customer Cards -> Soft, Tasteful Tinted
      Header Band & Whisper-Soft Card Tint for Clear Visual Separation
   4) Lively Color-Rich Avatars, Pills, Tabs, Buttons & Dashboard Surfaces
   ========================================================================== */

/* 1. LIVELY, RICH DARK MODE (Deep Ocean-Slate — No Dead Charcoal Grey) */
:root, :root[data-theme="dark"] {
  --bg: #0b1118;
  --bgs: #0f1720;
  --sb-bg: #111b25;
  --surface: #14202c;
  --surface2: #1b2b3b;
  --cd: #14202c;
  --cd-solid: #14202c;
  --el: #1b2a38;
  --el2: #243749;
  --gm: #131e29;
  --gl: rgba(11, 17, 24, 0.88);

  --bd: rgba(136, 192, 212, 0.11);
  --line: rgba(136, 192, 212, 0.16);
  --gb: rgba(136, 192, 212, 0.25);

  --tx: #f1f6f9;
  --tx2: #cbe0ec;
  --mu: #8aa5b8;
  --mu2: #5d798d;

  /* Vibrant Oceanic Teal Primary Accent */
  --ac: #0d9488;
  --ac2: #0f766e;
  --lt: #2dd4bf;
  --g1: rgba(20, 184, 166, 0.16);
  --g2: rgba(20, 184, 166, 0.28);
  --ring: 0 0 0 2.5px rgba(45, 212, 191, 0.30);

  /* Crisp, Lively Semantic Palette */
  --ok: #10b981;
  --wn: #f59e0b;
  --bad: #f43f5e;
  --sky: #38bdf8;
  --k1: #14b8a6;
  --k2: #f59e0b;
  --k3: #10b981;
  --k4: #0ea5e9;
  --k5: #64748b;
  --k6: #f43f5e;
}

/* 2. COMFORTABLE, LOW-GLARE LIGHT MODE (Soft Mist & Pearl — NO Blinding Pure White!) */
:root[data-theme="light"] {
  --bg: #d9e2e7;
  --bgs: #e8eff3;
  --sb-bg: #e5edf1;
  --surface: #eef3f5;
  --surface2: #e2ebf0;
  --cd: #eef3f5;
  --cd-solid: #eef3f5;
  --el: #e1eaef;
  --el2: #d2dfe6;
  --gm: #eef3f5;
  --gl: rgba(217, 226, 231, 0.92);

  --bd: rgba(15, 44, 58, 0.105);
  --line: rgba(15, 44, 58, 0.16);
  --gb: rgba(15, 44, 58, 0.24);

  --tx: #0d1f29;
  --tx2: #213c4b;
  --mu: #4b6575;
  --mu2: #728c9c;

  /* Rich Deep Teal Primary Accent */
  --ac: #0c7e75;
  --ac2: #09635c;
  --lt: #0a6e66;
  --g1: rgba(12, 126, 117, 0.13);
  --g2: rgba(12, 126, 117, 0.22);
  --ring: 0 0 0 2.5px rgba(12, 126, 117, 0.22);

  --ok: #059669;
  --wn: #d97706;
  --bad: #e11d48;
  --sky: #0284c7;
}

/* Eliminate blinding #ffffff overrides in light mode across UI chrome */
:root[data-theme="light"] .brand-corner,
:root[data-theme="light"] .top-search,
:root[data-theme="light"] .tb-ico-btn,
:root[data-theme="light"] .tb-user,
:root[data-theme="light"] .tb-goal-mini {
  background: #edf3f5 !important;
  border-color: rgba(15, 44, 58, 0.15) !important;
  box-shadow: 0 1px 3px rgba(15, 44, 58, 0.06);
}
:root[data-theme="light"] .brand-corner:hover,
:root[data-theme="light"] .top-search:hover,
:root[data-theme="light"] .tb-ico-btn:hover,
:root[data-theme="light"] .tb-user:hover {
  background: #f3f7f9 !important;
  border-color: rgba(12, 126, 117, 0.38) !important;
}
:root[data-theme="light"] .sidebar {
  background: #e5edf1 !important;
  border-color: rgba(15, 44, 58, 0.16) !important;
  box-shadow: 0 14px 34px -14px rgba(15, 44, 58, 0.18), 0 1px 3px rgba(15, 44, 58, 0.07);
}
:root[data-theme="light"] .desk-frame,
:root[data-theme="light"] .cd,
:root[data-theme="light"] .rep-panel,
:root[data-theme="light"] .min-shell,
:root[data-theme="light"] .tb,
:root[data-theme="light"] .pipe-bar,
:root[data-theme="light"] .mstrip,
:root[data-theme="light"] .doc-launch-strip,
:root[data-theme="light"] .cal2-wrap,
:root[data-theme="light"] .tkb {
  background: #eef3f5 !important;
  border-color: rgba(15, 44, 58, 0.15) !important;
}
:root[data-theme="light"] .tkc,
:root[data-theme="light"] .cal2-witem,
:root[data-theme="light"] .cm-deal-row,
:root[data-theme="light"] .cm-fu-item,
:root[data-theme="light"] .link-row,
:root[data-theme="light"] .tl-node,
:root[data-theme="light"] .dr-doc-card {
  background: #f4f8fa !important;
  border-color: rgba(15, 44, 58, 0.12) !important;
}
:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
  background: #f5f9fa !important;
}

/* 3. LIVELY, COLOR-RICH AVATARS IN BOTH DARK & LIGHT MODES (Zero Dead Grey!) */
.av {
  background: var(--abg, #123836) !important;
  color: var(--atx, #5eead4) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  font-weight: 800 !important;
}
:root[data-theme="light"] .av {
  background: var(--lbg, #ccebe7) !important;
  color: var(--ltx, #0a635c) !important;
  border: 1px solid rgba(15, 44, 58, 0.10) !important;
}
.tb-u-av {
  background: linear-gradient(135deg, var(--ac), var(--ac2)) !important;
  color: #ffffff !important;
  border: 0 !important;
  font-weight: 800 !important;
}
:root[data-theme="light"] .tb-u-av {
  background: linear-gradient(135deg, var(--ac), var(--ac2)) !important;
  color: #ffffff !important;
  border: 0 !important;
}

/* 4. VIBRANT, TACTILE BUTTONS, ACTIVE TABS, SIDEBAR & STATUS PILLS */
.btn.p {
  background: linear-gradient(180deg, var(--ac) 0%, var(--ac2) 100%) !important;
  border-color: var(--ac) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px -2px rgba(13, 148, 136, 0.42);
}
.btn.p:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px -2px rgba(13, 148, 136, 0.52);
}
.btn {
  background: var(--el);
  border-color: var(--line);
}
.btn:hover, .mi:hover {
  border-color: var(--ac);
  background: var(--g1);
  color: var(--tx);
}

.sb-nav button.on {
  background: var(--g1) !important;
  color: var(--tx) !important;
  font-weight: 700;
}
.sb-nav button.on svg {
  color: var(--lt) !important;
  opacity: 1 !important;
}
.sb-nav button:hover {
  background: var(--g1);
}

.min-tab.on {
  background: var(--g1) !important;
  color: var(--lt) !important;
  border-color: rgba(20, 184, 166, 0.34) !important;
  font-weight: 700 !important;
}
:root[data-theme="light"] .min-tab.on {
  background: rgba(12, 126, 117, 0.14) !important;
  color: #095e57 !important;
  border-color: rgba(12, 126, 117, 0.30) !important;
}
.min-tab.on em { color: inherit !important; opacity: .82; }

.min-tbl thead th,
.rep-tbl thead th,
.docs-tbl thead th {
  background: rgba(20, 184, 166, 0.065) !important;
  color: var(--tx2) !important;
}
:root[data-theme="light"] .min-tbl thead th,
:root[data-theme="light"] .rep-tbl thead th,
:root[data-theme="light"] .docs-tbl thead th {
  background: #dde8ec !important;
  color: #213c4b !important;
}

/* Richer Semantic Status Pills (Alive, Clear, Zero Dead Wash) */
.st-pill.ok {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.32) !important;
}
.st-pill.wn {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.32) !important;
}
.st-pill.bad {
  background: rgba(244, 63, 94, 0.16) !important;
  color: #fb7185 !important;
  border-color: rgba(244, 63, 94, 0.34) !important;
}
.st-pill.lt {
  background: rgba(20, 184, 166, 0.16) !important;
  color: #2dd4bf !important;
  border-color: rgba(20, 184, 166, 0.32) !important;
}
.st-pill.mu {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #93c5fd !important;
  border-color: rgba(56, 189, 248, 0.22) !important;
}
:root[data-theme="light"] .st-pill.ok {
  background: rgba(5, 150, 105, 0.13) !important;
  color: #047857 !important;
  border-color: rgba(5, 150, 105, 0.28) !important;
}
:root[data-theme="light"] .st-pill.wn {
  background: rgba(217, 119, 6, 0.14) !important;
  color: #b45309 !important;
  border-color: rgba(217, 119, 6, 0.30) !important;
}
:root[data-theme="light"] .st-pill.bad {
  background: rgba(225, 29, 72, 0.13) !important;
  color: #be123c !important;
  border-color: rgba(225, 29, 72, 0.28) !important;
}
:root[data-theme="light"] .st-pill.lt {
  background: rgba(12, 126, 117, 0.13) !important;
  color: #09635c !important;
  border-color: rgba(12, 126, 117, 0.28) !important;
}
:root[data-theme="light"] .st-pill.mu {
  background: rgba(2, 132, 199, 0.10) !important;
  color: #0369a1 !important;
  border-color: rgba(2, 132, 199, 0.22) !important;
}

/* Lively KPI Strip Hover & Indicator */
.mcell:hover {
  background: rgba(20, 184, 166, 0.055) !important;
}
:root[data-theme="light"] .mcell:hover {
  background: rgba(12, 126, 117, 0.065) !important;
}
.today-stamp {
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.18) 0%, var(--el) 100%) !important;
  border-color: rgba(20, 184, 166, 0.30) !important;
}
:root[data-theme="light"] .today-stamp {
  background: linear-gradient(180deg, rgba(12, 126, 117, 0.15) 0%, #e1eaef 100%) !important;
  border-color: rgba(12, 126, 117, 0.28) !important;
}

/* 5. CUSTOMERS TAB — ZERO AI SIDE STRIPE, VERY SOFT TINTED HEADER & CARD WASH */
.cust-dir-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  padding: 15px !important;
  background: #0a1017 !important;
}
:root[data-theme="light"] .cust-dir-grid {
  background: #cfd9df !important;
}

/* Remove AI colored side stripe completely! */
.cust-tile {
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 12px !important;
  background: var(--ct-bg, #15212d) !important;
  border: 1px solid var(--ct-bd, rgba(136, 192, 212, 0.18)) !important;
  border-inline-start: 1px solid var(--ct-bd, rgba(136, 192, 212, 0.18)) !important;
  border-inline-end: 1px solid var(--ct-bd, rgba(136, 192, 212, 0.18)) !important;
  overflow: hidden;
  box-shadow: 0 3px 10px -4px rgba(0, 0, 0, 0.32) !important;
  transition: border-color .16s, transform .16s, box-shadow .16s !important;
}
.cust-tile:nth-child(2n) {
  border-inline-end: 1px solid var(--ct-bd, rgba(136, 192, 212, 0.18)) !important;
}
.cust-tile:hover {
  transform: translateY(-2px);
  border-color: var(--ct-bd-h, rgba(45, 212, 191, 0.42)) !important;
  border-inline-start-color: var(--ct-bd-h, rgba(45, 212, 191, 0.42)) !important;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.52) !important;
}

/* Soft, Delicate Tints per Customer Tier (Dark Mode) */
.cust-tile.tone-gold {
  --ct-bg: #1c1d19;
  --ct-hd: rgba(245, 158, 11, 0.13);
  --ct-ft: rgba(245, 158, 11, 0.05);
  --ct-bd: rgba(245, 158, 11, 0.24);
  --ct-bd-h: rgba(245, 158, 11, 0.50);
}
.cust-tile.tone-silver {
  --ct-bg: #122126;
  --ct-hd: rgba(20, 184, 166, 0.14);
  --ct-ft: rgba(20, 184, 166, 0.05);
  --ct-bd: rgba(45, 212, 191, 0.24);
  --ct-bd-h: rgba(45, 212, 191, 0.50);
}
.cust-tile.tone-bronze {
  --ct-bg: #14202d;
  --ct-hd: rgba(56, 189, 248, 0.12);
  --ct-ft: rgba(56, 189, 248, 0.045);
  --ct-bd: rgba(56, 189, 248, 0.22);
  --ct-bd-h: rgba(56, 189, 248, 0.48);
}
.cust-tile.tone-risk {
  --ct-bg: #21171e;
  --ct-hd: rgba(244, 63, 94, 0.14);
  --ct-ft: rgba(244, 63, 94, 0.05);
  --ct-bd: rgba(244, 63, 94, 0.26);
  --ct-bd-h: rgba(244, 63, 94, 0.52);
}

/* Soft, Delicate Tints per Customer Tier (Eye-Friendly Light Mode — Zero Stark White!) */
:root[data-theme="light"] .cust-tile {
  box-shadow: 0 2px 8px -3px rgba(15, 44, 58, 0.10) !important;
}
:root[data-theme="light"] .cust-tile:hover {
  box-shadow: 0 8px 20px -8px rgba(15, 44, 58, 0.18) !important;
}
:root[data-theme="light"] .cust-tile.tone-gold {
  --ct-bg: #f4f0e6;
  --ct-hd: #ebe0c7;
  --ct-ft: #eee7d6;
  --ct-bd: rgba(180, 110, 12, 0.24);
  --ct-bd-h: rgba(180, 110, 12, 0.48);
}
:root[data-theme="light"] .cust-tile.tone-silver {
  --ct-bg: #e7f2f0;
  --ct-hd: #d2e8e4;
  --ct-ft: #dfecea;
  --ct-bd: rgba(12, 126, 117, 0.24);
  --ct-bd-h: rgba(12, 126, 117, 0.48);
}
:root[data-theme="light"] .cust-tile.tone-bronze {
  --ct-bg: #e8eff4;
  --ct-hd: #d5e3ed;
  --ct-ft: #e0e9f0;
  --ct-bd: rgba(14, 116, 168, 0.22);
  --ct-bd-h: rgba(14, 116, 168, 0.45);
}
:root[data-theme="light"] .cust-tile.tone-risk {
  --ct-bg: #f3e9ec;
  --ct-hd: #ebd4da;
  --ct-ft: #eee0e4;
  --ct-bd: rgba(205, 36, 74, 0.24);
  --ct-bd-h: rgba(205, 36, 74, 0.48);
}

.cust-tile-hd {
  padding: 12px 16px !important;
  background: var(--ct-hd) !important;
  border-bottom: 1px solid var(--ct-bd) !important;
}
.cust-tile-body {
  padding: 13px 16px !important;
  background: transparent !important;
}
.cust-tile-ft {
  padding: 9px 16px !important;
  background: var(--ct-ft) !important;
  border-top: 1px solid var(--bd) !important;
}

/* Remove AI side stripe on .cmod-next inside Profile Modal -> Clean Soft Tinted Banner */
.cmod-next {
  border-inline-start: 1px solid rgba(20, 184, 166, 0.30) !important;
  background: rgba(20, 184, 166, 0.09) !important;
  border-color: rgba(20, 184, 166, 0.26) !important;
}
.cmod-next.late {
  border-inline-start: 1px solid rgba(244, 63, 94, 0.35) !important;
  background: rgba(244, 63, 94, 0.09) !important;
  border-color: rgba(244, 63, 94, 0.32) !important;
}

/* 6. PIPELINE COLUMNS — HARMONIZED & EYE-FRIENDLY IN BOTH MODES */
.kb .col .dc {
  background: #101922 !important;
  border-color: rgba(136, 192, 212, 0.14) !important;
}
.kb .col .dc:hover {
  background: #15212e !important;
  border-color: rgba(45, 212, 191, 0.36) !important;
}
:root[data-theme="light"] .kb .col[data-col="0"] {
  background: #d7e5f2 !important;
  border-color: #afc9e3 !important;
}
:root[data-theme="light"] .kb .col[data-col="1"] {
  background: #d2ebe6 !important;
  border-color: #9fd2c9 !important;
}
:root[data-theme="light"] .kb .col[data-col="2"] {
  background: #f1e3c6 !important;
  border-color: #dac08c !important;
}
:root[data-theme="light"] .kb .col[data-col="3"] {
  background: #f0d7d5 !important;
  border-color: #d9ada9 !important;
}
:root[data-theme="light"] .kb .col[data-col="4"] {
  background: #d2ebd9 !important;
  border-color: #9ed0ae !important;
}
:root[data-theme="light"] .kb .col .dc {
  background: #f2f6f8 !important;
  border-color: rgba(15, 44, 58, 0.13) !important;
}
:root[data-theme="light"] .kb .col .dc:hover {
  background: #f7fafb !important;
  border-color: rgba(12, 126, 117, 0.38) !important;
}
:root[data-theme="light"] .kb .col .col-flt input {
  background: rgba(242, 246, 248, 0.85) !important;
}

/* 7. LOGIN PAGE — HARMONIZED RICH OCEAN-SLATE (DARK) & RESTFUL MIST (LIGHT) */
.ag-pane-form {
  background: var(--surface) !important;
}
.ag-pane-side {
  background: #0d1721 !important;
}
:root[data-theme="light"] .ag-pane-side {
  background: #cfdce2 !important;
}
:root[data-theme="light"] .ag-pane-form input {
  background: #e4edf1 !important;
  border-color: rgba(15, 44, 58, 0.18) !important;
}
:root[data-theme="light"] .ag-pane-form input:focus {
  background: #f4f8fa !important;
}


/* ==========================================================================
   Lyso CRM v23 — High-Performance 60 FPS Glassmorphism + Dual Wave Wallpapers
   - True Dark Mode (panel-bg-dark.jpg) & Soft Light Mode (panel-bg-light.jpg)
   - Zero CSS filter on wallpaper & zero nested/per-card backdrop-filter blur
     => Eliminates scrolling/rendering lag completely while keeping smooth
        translucent glass panels, crisp borders & unified Customer cards.
   ========================================================================== */

/* 1. TRUE DARK MODE & COMFORTABLE LIGHT MODE TOKENS */
:root, :root[data-theme="dark"] {
  --bg: #070b14;
  --bgs: rgba(11, 17, 32, 0.78);
  --sb-bg: rgba(10, 16, 30, 0.74);
  --surface: rgba(12, 19, 36, 0.76);
  --surface2: rgba(20, 31, 56, 0.84);
  --cd: rgba(12, 19, 36, 0.76);
  --cd-solid: #0f172a;
  --el: rgba(20, 30, 54, 0.74);
  --el2: rgba(28, 42, 74, 0.84);
  --gm: rgba(11, 17, 32, 0.90);
  --gl: rgba(8, 13, 25, 0.74);

  --bd: rgba(148, 180, 236, 0.13);
  --line: rgba(148, 180, 236, 0.19);
  --gb: rgba(168, 198, 250, 0.28);

  --tx: #f2f5fc;
  --tx2: #cdd9ef;
  --mu: #8ca2c6;
  --mu2: #6279a1;

  --ac: #3b82f6;
  --ac2: #2563eb;
  --lt: #60a5fa;
  --g1: rgba(59, 130, 246, 0.18);
  --g2: rgba(59, 130, 246, 0.30);
  --ring: 0 0 0 2.5px rgba(96, 165, 250, 0.32);

  --ok: #10b981;
  --wn: #f59e0b;
  --bad: #f43f5e;
  --sky: #38bdf8;
  --glass-spec: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

:root[data-theme="light"] {
  --bg: #dce3ee;
  --bgs: rgba(242, 246, 252, 0.78);
  --sb-bg: rgba(238, 243, 251, 0.76);
  --surface: rgba(244, 247, 252, 0.76);
  --surface2: rgba(232, 239, 250, 0.86);
  --cd: rgba(244, 247, 252, 0.76);
  --cd-solid: #eef3fa;
  --el: rgba(228, 236, 248, 0.76);
  --el2: rgba(213, 224, 242, 0.84);
  --gm: rgba(244, 247, 253, 0.92);
  --gl: rgba(236, 242, 250, 0.74);

  --bd: rgba(24, 46, 92, 0.11);
  --line: rgba(24, 46, 92, 0.17);
  --gb: rgba(24, 46, 92, 0.25);

  --tx: #0f1b33;
  --tx2: #263b63;
  --mu: #4f648a;
  --mu2: #758ab0;

  --ac: #2563eb;
  --ac2: #1d4ed8;
  --lt: #1d4ed8;
  --g1: rgba(37, 99, 235, 0.13);
  --g2: rgba(37, 99, 235, 0.22);
  --ring: 0 0 0 2.5px rgba(37, 99, 235, 0.22);
  --glass-spec: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Keep Teal accent preset crisp if selected in Settings */
:root[data-accent="teal"] {
  --ac: #0d9488; --ac2: #0f766e; --lt: #2dd4bf;
  --g1: rgba(20, 184, 166, 0.17); --g2: rgba(20, 184, 166, 0.28);
  --ring: 0 0 0 2.5px rgba(45, 212, 191, 0.32);
}
:root[data-theme="light"][data-accent="teal"] {
  --ac: #0c7e75; --ac2: #09635c; --lt: #0a6e66;
  --g1: rgba(12, 126, 117, 0.13); --g2: rgba(12, 126, 117, 0.22);
}

/* 2. ULTRA-LIGHTWEIGHT DUAL WALLPAPER (Zero CSS filter = Zero GPU Lag!) */
html {
  background-color: var(--bg);
}
body {
  background-color: transparent !important;
  position: relative;
  z-index: 0;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('../img/panel-bg-dark.jpg');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  will-change: auto;
}
:root[data-theme="light"] body::before {
  background-image: url('../img/panel-bg-light.jpg');
}

/* 3. FAST 60-FPS GLASSMORPHISM
   - Lightweight blur(8px) ONLY on static floating chrome (sidebar, topbar, brand, open modals)
   - Zero blur on scrolling content panels, cards, columns, or nested buttons (smooth translucent
     glass over soft pre-smoothed waves = identical visual depth at full 60 FPS!) */
.sidebar,
.brand-corner {
  background: var(--sb-bg) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--glass-spec), 0 12px 28px -14px rgba(2, 6, 18, 0.52) !important;
}
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .brand-corner {
  background: rgba(240, 244, 252, 0.76) !important;
  border-color: rgba(24, 46, 92, 0.15) !important;
  box-shadow: var(--glass-spec), 0 10px 26px -14px rgba(15, 32, 68, 0.16) !important;
}

.topbar {
  background: var(--gl) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-bottom: 1px solid var(--line) !important;
}

/* NO nested backdrop-filter inside topbar! */
.top-search,
.tb-ico-btn,
.tb-user,
.tb-goal-mini {
  background: rgba(20, 30, 56, 0.62) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: var(--line) !important;
  box-shadow: var(--glass-spec) !important;
}
:root[data-theme="light"] .top-search,
:root[data-theme="light"] .tb-ico-btn,
:root[data-theme="light"] .tb-user,
:root[data-theme="light"] .tb-goal-mini {
  background: rgba(246, 249, 254, 0.78) !important;
  border-color: rgba(24, 46, 92, 0.15) !important;
}

/* Content Surfaces — Smooth Translucent Glass (Zero scroll lag!) */
.desk-frame,
.cd,
.rep-panel,
.min-shell,
.tb,
.pipe-bar,
.mstrip,
.doc-launch-strip,
.cal2-wrap,
.tkb,
.dst-sec,
.dst-pv-shell {
  background: var(--surface) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--glass-spec), 0 10px 26px -16px rgba(2, 6, 18, 0.48) !important;
}
:root[data-theme="light"] .desk-frame,
:root[data-theme="light"] .cd,
:root[data-theme="light"] .rep-panel,
:root[data-theme="light"] .min-shell,
:root[data-theme="light"] .tb,
:root[data-theme="light"] .pipe-bar,
:root[data-theme="light"] .mstrip,
:root[data-theme="light"] .doc-launch-strip,
:root[data-theme="light"] .cal2-wrap,
:root[data-theme="light"] .tkb,
:root[data-theme="light"] .dst-sec,
:root[data-theme="light"] .dst-pv-shell {
  background: rgba(244, 248, 253, 0.76) !important;
  border-color: rgba(24, 46, 92, 0.15) !important;
  box-shadow: var(--glass-spec), 0 8px 22px -14px rgba(15, 32, 68, 0.14) !important;
}

.desk-frame > .mstrip {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
}

.min-top {
  background: rgba(16, 25, 48, 0.56) !important;
}
:root[data-theme="light"] .min-top {
  background: rgba(226, 235, 248, 0.66) !important;
}

.tkc,
.cal2-witem,
.cm-deal-row,
.cm-fu-item,
.link-row,
.tl-node,
.dr-doc-card,
.cmod-info-panel,
.cmod-qlog,
.pay-box {
  background: rgba(18, 28, 52, 0.68) !important;
  border-color: var(--bd) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
:root[data-theme="light"] .tkc,
:root[data-theme="light"] .cal2-witem,
:root[data-theme="light"] .cm-deal-row,
:root[data-theme="light"] .cm-fu-item,
:root[data-theme="light"] .link-row,
:root[data-theme="light"] .tl-node,
:root[data-theme="light"] .dr-doc-card,
:root[data-theme="light"] .cmod-info-panel,
:root[data-theme="light"] .cmod-qlog,
:root[data-theme="light"] .pay-box {
  background: rgba(247, 250, 254, 0.84) !important;
  border-color: rgba(24, 46, 92, 0.13) !important;
}

.min-tbl thead th,
.rep-tbl thead th,
.docs-tbl thead th,
.cal2-wk-hd,
.cal2-whd {
  background: rgba(22, 33, 62, 0.74) !important;
  color: var(--tx2) !important;
}
:root[data-theme="light"] .min-tbl thead th,
:root[data-theme="light"] .rep-tbl thead th,
:root[data-theme="light"] .docs-tbl thead th,
:root[data-theme="light"] .cal2-wk-hd,
:root[data-theme="light"] .cal2-whd {
  background: rgba(220, 230, 246, 0.78) !important;
  color: #1e3358 !important;
}

input, select, textarea {
  background: rgba(12, 19, 36, 0.72);
  border-color: var(--line);
}
input:focus, select:focus, textarea:focus {
  background: rgba(16, 26, 48, 0.90);
}
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: rgba(232, 239, 250, 0.76);
  border-color: rgba(24, 46, 92, 0.16);
}
:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
  background: rgba(250, 252, 255, 0.94) !important;
}
option { background: var(--cd-solid); color: var(--tx); }

.btn.p {
  box-shadow: 0 3px 12px -3px color-mix(in srgb, var(--ac) 52%, transparent) !important;
}

/* Modals & Overlays — Lightweight Blur Only on Modal Box, Instant Dim Overlay */
#dr-bg, .mb, .sb-ov {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(4, 7, 16, 0.58) !important;
}
:root[data-theme="light"] #dr-bg,
:root[data-theme="light"] .mb,
:root[data-theme="light"] .sb-ov {
  background: rgba(15, 28, 56, 0.34) !important;
}

#dr,
.mc {
  background: var(--gm) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border-color: var(--gb) !important;
  box-shadow: var(--glass-spec), 0 24px 64px -18px rgba(0, 4, 16, 0.72) !important;
}
.hover-peek,
.jdp-pop,
.fab .fm,
#ts,
.dst-bar {
  background: var(--gm) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: var(--gb) !important;
  box-shadow: var(--glass-spec), 0 16px 40px -14px rgba(0, 4, 16, 0.62) !important;
}
.cmod-hd, .cmod-tabs {
  background: rgba(16, 25, 48, 0.76) !important;
}
.cmod-body {
  background: rgba(9, 14, 28, 0.56) !important;
}
:root[data-theme="light"] .cmod-hd,
:root[data-theme="light"] .cmod-tabs {
  background: rgba(232, 239, 250, 0.84) !important;
}
:root[data-theme="light"] .cmod-body {
  background: rgba(224, 233, 246, 0.54) !important;
}
.fab .fb {
  background: rgba(20, 31, 58, 0.86) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-color: var(--gb) !important;
}
:root[data-theme="light"] .fab .fb {
  background: rgba(242, 246, 253, 0.90) !important;
}
footer {
  background: rgba(8, 12, 24, 0.48);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme="light"] footer {
  background: rgba(232, 239, 249, 0.62);
}

/* 4. CUSTOMERS TAB — ONE UNIFIED DISTINCT GLASS COLOR FOR ALL CARDS (60 FPS!) */
.cust-dir-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  padding: 15px !important;
  background: rgba(6, 10, 22, 0.36) !important;
}
:root[data-theme="light"] .cust-dir-grid {
  background: rgba(196, 209, 232, 0.36) !important;
}

.cust-tile {
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 13px !important;
  background: rgba(24, 36, 66, 0.80) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(148, 182, 246, 0.25) !important;
  border-inline-start: 1px solid rgba(148, 182, 246, 0.25) !important;
  border-inline-end: 1px solid rgba(148, 182, 246, 0.25) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 6px 18px -10px rgba(2, 6, 18, 0.56) !important;
  overflow: hidden;
  contain: layout style;
  transition: border-color .14s, transform .14s, background .14s !important;
}
.cust-tile:nth-child(2n) {
  border-inline-end: 1px solid rgba(148, 182, 246, 0.25) !important;
}
.cust-tile:hover {
  background: rgba(30, 45, 82, 0.88) !important;
  border-color: rgba(147, 197, 253, 0.50) !important;
  border-inline-start-color: rgba(147, 197, 253, 0.50) !important;
  transform: translateY(-1px);
}
.cust-tile-hd {
  padding: 12px 16px !important;
  background: rgba(38, 56, 98, 0.68) !important;
  border-bottom: 1px solid rgba(148, 182, 246, 0.18) !important;
}
.cust-tile-body {
  padding: 13px 16px !important;
  background: transparent !important;
}
.cust-tile-ft {
  padding: 9px 16px !important;
  background: rgba(13, 20, 40, 0.56) !important;
  border-top: 1px solid rgba(148, 182, 246, 0.13) !important;
}

/* Unified Customer Cards in Light Mode (Soft Elevated Frost — Zero Green, Zero Glare) */
:root[data-theme="light"] .cust-tile {
  background: rgba(246, 249, 254, 0.86) !important;
  border: 1px solid rgba(30, 58, 115, 0.19) !important;
  border-inline-start: 1px solid rgba(30, 58, 115, 0.19) !important;
  border-inline-end: 1px solid rgba(30, 58, 115, 0.19) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 5px 15px -9px rgba(15, 32, 68, 0.16) !important;
}
:root[data-theme="light"] .cust-tile:nth-child(2n) {
  border-inline-end: 1px solid rgba(30, 58, 115, 0.19) !important;
}
:root[data-theme="light"] .cust-tile:hover {
  background: rgba(250, 252, 255, 0.94) !important;
  border-color: rgba(37, 99, 235, 0.42) !important;
  border-inline-start-color: rgba(37, 99, 235, 0.42) !important;
}
:root[data-theme="light"] .cust-tile-hd {
  background: rgba(221, 232, 248, 0.78) !important;
  border-bottom: 1px solid rgba(30, 58, 115, 0.14) !important;
}
:root[data-theme="light"] .cust-tile-ft {
  background: rgba(232, 240, 251, 0.72) !important;
  border-top: 1px solid rgba(30, 58, 115, 0.10) !important;
}

/* 5. PIPELINE COLUMNS — FAST TRANSLUCENT TINTS (Zero blur lag!) */
.kb .col {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: var(--glass-spec), 0 8px 22px -14px rgba(2, 6, 18, 0.50) !important;
}
.kb .col[data-col="0"] { background: rgba(22, 36, 66, 0.74) !important; border-color: rgba(96, 165, 250, 0.26) !important; }
.kb .col[data-col="1"] { background: rgba(16, 40, 54, 0.74) !important; border-color: rgba(56, 189, 248, 0.26) !important; }
.kb .col[data-col="2"] { background: rgba(44, 36, 22, 0.74) !important; border-color: rgba(245, 158, 11, 0.26) !important; }
.kb .col[data-col="3"] { background: rgba(46, 24, 36, 0.74) !important; border-color: rgba(244, 63, 94, 0.26) !important; }
.kb .col[data-col="4"] { background: rgba(15, 42, 35, 0.74) !important; border-color: rgba(16, 185, 129, 0.26) !important; }
.kb .col .dc {
  background: rgba(11, 17, 32, 0.80) !important;
  border-color: rgba(148, 180, 236, 0.15) !important;
  contain: layout style;
}
.kb .col .dc:hover {
  background: rgba(17, 26, 48, 0.90) !important;
  border-color: rgba(147, 197, 253, 0.42) !important;
}

:root[data-theme="light"] .kb .col[data-col="0"] { background: rgba(219, 232, 249, 0.78) !important; border-color: rgba(59, 130, 246, 0.26) !important; }
:root[data-theme="light"] .kb .col[data-col="1"] { background: rgba(214, 239, 239, 0.78) !important; border-color: rgba(14, 165, 233, 0.26) !important; }
:root[data-theme="light"] .kb .col[data-col="2"] { background: rgba(246, 234, 210, 0.80) !important; border-color: rgba(217, 119, 6, 0.26) !important; }
:root[data-theme="light"] .kb .col[data-col="3"] { background: rgba(246, 222, 226, 0.80) !important; border-color: rgba(225, 29, 72, 0.24) !important; }
:root[data-theme="light"] .kb .col[data-col="4"] { background: rgba(214, 240, 226, 0.80) !important; border-color: rgba(16, 185, 129, 0.26) !important; }
:root[data-theme="light"] .kb .col .dc {
  background: rgba(248, 251, 255, 0.88) !important;
  border-color: rgba(24, 46, 92, 0.13) !important;
}

/* 6. LOGIN PAGE — CLEAN DUAL-THEME GLASS OVER SOFT WAVES */
#auth-gate {
  background: transparent !important;
}
.ag-pane-form {
  background: rgba(10, 16, 30, 0.80) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-inline-end: 1px solid rgba(148, 180, 236, 0.20) !important;
}
.ag-pane-side {
  background: rgba(7, 11, 22, 0.22) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
:root[data-theme="light"] .ag-pane-form {
  background: rgba(244, 248, 253, 0.82) !important;
  border-inline-end-color: rgba(24, 46, 92, 0.16) !important;
}
:root[data-theme="light"] .ag-pane-side {
  background: rgba(224, 234, 248, 0.24) !important;
}


/* ==========================================================================
   Lyso CRM v24 — Bottom-Right FAB, Full-Proportion Top-Right Brand Corner
   with Recolored 3D Theme Logo, & Vibrant Colorful Light / Deep Dark Glass
   ========================================================================== */

/* 1. FLOATING '+' BUTTON MOVED TO BOTTOM-RIGHT */
.fab {
  right: 18px !important;
  left: auto !important;
  inset-inline-start: 18px !important;
  inset-inline-end: auto !important;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  align-items: flex-start !important; /* RTL cross-start = flush right edge */
  z-index: 26 !important;
}
.fab .fb {
  width: 44px !important;
  height: 44px !important;
  border-radius: 13px !important;
  font-size: 21px !important;
}

/* 2. PROPORTIONAL TOP-RIGHT BRAND CORNER (Fills Corner Cleanly in Height & Alignment) */
.brand-corner {
  top: 12px !important;
  right: 14px !important;
  width: var(--sb-w) !important;
  height: 84px !important;
  padding: 10px 14px !important;
  border-radius: 16px !important;
  gap: 11px !important;
  align-items: center !important;
  justify-content: flex-start !important;
}
.brand-fav {
  width: 56px !important;
  height: 56px !important;
  border-radius: 10px !important;
  object-fit: contain !important;
  flex: none !important;
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.28));
}
.brand-corner-txt {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.brand-corner-txt b {
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -.25px !important;
}
.brand-corner-txt small {
  font-size: 10.5px !important;
  line-height: 1.2 !important;
}

/* Sync Collapsed Icon-Only Rail Mode */
body.sb-col .brand-corner {
  width: var(--sb-w-col) !important;
  height: 60px !important;
  padding: 6px !important;
  justify-content: center !important;
}
body.sb-col .brand-fav {
  width: 42px !important;
  height: 42px !important;
}

/* Clean Logo Sizing on Login Page & Mobile */
.ag-brand-img {
  width: 44px !important;
  height: 44px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.24));
}
.sb-logo-img {
  width: 36px !important;
  height: 36px !important;
  object-fit: contain !important;
}
.tb-mob-logo {
  width: 34px !important;
  height: 34px !important;
  object-fit: contain !important;
}

/* 3. REFINED TRANSLUCENCY OVER VIBRANT COLORFUL LIGHT & DEEP DARK WALLPAPERS */
:root[data-theme="light"] {
  --sb-bg: rgba(246, 249, 255, 0.72);
  --surface: rgba(248, 250, 255, 0.74);
  --gl: rgba(244, 247, 254, 0.72);
}
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .brand-corner {
  background: rgba(246, 249, 255, 0.74) !important;
}
:root[data-theme="light"] .desk-frame,
:root[data-theme="light"] .cd,
:root[data-theme="light"] .rep-panel,
:root[data-theme="light"] .min-shell,
:root[data-theme="light"] .tb,
:root[data-theme="light"] .pipe-bar,
:root[data-theme="light"] .mstrip,
:root[data-theme="light"] .doc-launch-strip,
:root[data-theme="light"] .cal2-wrap,
:root[data-theme="light"] .tkb,
:root[data-theme="light"] .dst-sec,
:root[data-theme="light"] .dst-pv-shell {
  background: rgba(248, 250, 255, 0.74) !important;
}
:root[data-theme="light"] .cust-tile {
  background: rgba(250, 252, 255, 0.84) !important;
}
:root[data-theme="light"] .cust-tile-hd {
  background: rgba(226, 236, 252, 0.76) !important;
}

/* Clean Customer Card Index Badge Without '#' */
.cust-idx {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  color: var(--mu) !important;
  padding-inline-start: 4px;
}


/* ==========================================================================
   Lyso CRM v25 — Flush Header-Aligned Brand Corner (Exact 56px Topbar Match)
   - Aligns .brand-corner identically with .topbar (top: 0, height: 56px)
   - Seamless unbroken horizontal bottom border across full viewport width
   - Perfect vertical axis alignment with both expanded & collapsed sidebar
   ========================================================================== */
.brand-corner {
  top: 0 !important;
  right: 0 !important;
  height: 56px !important;
  width: calc(var(--sb-w) + 26px) !important;
  padding: 0 18px 0 14px !important;
  border-radius: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-inline-end: 1px solid var(--line) !important;
  background: var(--gl) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: none !important;
  gap: 10px !important;
  align-items: center !important;
  justify-content: flex-start !important;
}
.brand-corner:hover {
  background: rgba(18, 28, 52, 0.82) !important;
  border-bottom-color: var(--line) !important;
  border-inline-end-color: var(--line) !important;
}
:root[data-theme="light"] .brand-corner {
  background: var(--gl) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-inline-end: 1px solid var(--line) !important;
  box-shadow: none !important;
}
:root[data-theme="light"] .brand-corner:hover {
  background: rgba(246, 249, 255, 0.88) !important;
  border-bottom-color: var(--line) !important;
  border-inline-end-color: var(--line) !important;
}

.brand-fav {
  width: 38px !important;
  height: 38px !important;
  border-radius: 8px !important;
  object-fit: contain !important;
  flex: none !important;
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.28));
}
.brand-corner-txt b {
  font-size: 15px !important;
  line-height: 1.18 !important;
}
.brand-corner-txt small {
  font-size: 10px !important;
  line-height: 1.18 !important;
}

/* Collapsed Sidebar Rail: Exact 84px width meeting topbar + center aligned with 58px sidebar below */
body.sb-col .brand-corner {
  width: calc(var(--sb-w-col) + 26px) !important;
  height: 56px !important;
  padding: 0 14px 0 12px !important;
  justify-content: center !important;
}
body.sb-col .brand-fav {
  width: 38px !important;
  height: 38px !important;
}
body.focus-mode .brand-corner {
  display: none !important;
}


/* ==========================================================================
   Lyso CRM v26 — Complete Master Accent Engine (All 6 Theme Colors Active
   Everywhere in Dark & Light Mode) + Mobile FAB Layering Fix
   ========================================================================== */

/* 1. ALL 6 ACCENT PRESETS (Placed AFTER all theme blocks so nothing overrides them!) */
:root[data-accent="teal"],
:root[data-theme="dark"][data-accent="teal"] {
  --ac: #0d9488;
  --ac2: #0f766e;
  --lt: #2dd4bf;
  --g1: rgba(20, 184, 166, 0.17);
  --g2: rgba(20, 184, 166, 0.28);
  --ring: 0 0 0 2.5px rgba(45, 212, 191, 0.32);
}
:root[data-theme="light"][data-accent="teal"] {
  --ac: #0c7e75;
  --ac2: #09635c;
  --lt: #0a6e66;
  --g1: rgba(12, 126, 117, 0.13);
  --g2: rgba(12, 126, 117, 0.22);
  --ring: 0 0 0 2.5px rgba(12, 126, 117, 0.22);
}

:root[data-accent="steel"],
:root[data-theme="dark"][data-accent="steel"] {
  --ac: #3b82f6;
  --ac2: #2563eb;
  --lt: #60a5fa;
  --g1: rgba(59, 130, 246, 0.18);
  --g2: rgba(59, 130, 246, 0.30);
  --ring: 0 0 0 2.5px rgba(96, 165, 250, 0.32);
}
:root[data-theme="light"][data-accent="steel"] {
  --ac: #2563eb;
  --ac2: #1d4ed8;
  --lt: #1d4ed8;
  --g1: rgba(37, 99, 235, 0.13);
  --g2: rgba(37, 99, 235, 0.22);
  --ring: 0 0 0 2.5px rgba(37, 99, 235, 0.22);
}

:root[data-accent="emerald"],
:root[data-theme="dark"][data-accent="emerald"] {
  --ac: #10b981;
  --ac2: #059669;
  --lt: #34d399;
  --g1: rgba(16, 185, 129, 0.18);
  --g2: rgba(16, 185, 129, 0.30);
  --ring: 0 0 0 2.5px rgba(52, 211, 153, 0.32);
}
:root[data-theme="light"][data-accent="emerald"] {
  --ac: #059669;
  --ac2: #047857;
  --lt: #047857;
  --g1: rgba(5, 150, 105, 0.13);
  --g2: rgba(5, 150, 105, 0.22);
  --ring: 0 0 0 2.5px rgba(5, 150, 105, 0.22);
}

:root[data-accent="amber"],
:root[data-theme="dark"][data-accent="amber"] {
  --ac: #d97706;
  --ac2: #b45309;
  --lt: #fbbf24;
  --g1: rgba(217, 119, 6, 0.19);
  --g2: rgba(217, 119, 6, 0.31);
  --ring: 0 0 0 2.5px rgba(251, 191, 36, 0.32);
}
:root[data-theme="light"][data-accent="amber"] {
  --ac: #b45309;
  --ac2: #92400e;
  --lt: #b45309;
  --g1: rgba(180, 83, 9, 0.13);
  --g2: rgba(180, 83, 9, 0.22);
  --ring: 0 0 0 2.5px rgba(180, 83, 9, 0.22);
}

:root[data-accent="copper"],
:root[data-theme="dark"][data-accent="copper"] {
  --ac: #ea580c;
  --ac2: #c2410c;
  --lt: #fb923c;
  --g1: rgba(234, 88, 12, 0.19);
  --g2: rgba(234, 88, 12, 0.31);
  --ring: 0 0 0 2.5px rgba(251, 146, 60, 0.32);
}
:root[data-theme="light"][data-accent="copper"] {
  --ac: #c2410c;
  --ac2: #9a3412;
  --lt: #c2410c;
  --g1: rgba(194, 65, 12, 0.12);
  --g2: rgba(194, 65, 12, 0.21);
  --ring: 0 0 0 2.5px rgba(194, 65, 12, 0.22);
}

:root[data-accent="mono"],
:root[data-theme="dark"][data-accent="mono"] {
  --ac: #475569;
  --ac2: #334155;
  --lt: #cbd5e1;
  --g1: rgba(148, 163, 184, 0.18);
  --g2: rgba(148, 163, 184, 0.30);
  --ring: 0 0 0 2.5px rgba(148, 163, 184, 0.32);
}
:root[data-theme="light"][data-accent="mono"] {
  --ac: #334155;
  --ac2: #1e293b;
  --lt: #1e293b;
  --g1: rgba(51, 65, 85, 0.12);
  --g2: rgba(51, 65, 85, 0.20);
  --ring: 0 0 0 2.5px rgba(51, 65, 85, 0.22);
}

/* 2. ENSURE EVERY ACCENTED COMPONENT FOLLOWS var(--ac) / var(--lt) / var(--g1) */
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ac) 52%, transparent);
}

.btn.p:hover {
  box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--ac) 58%, transparent) !important;
}
.btn:hover,
.mi:hover {
  border-color: color-mix(in srgb, var(--ac) 55%, transparent);
}

.min-tab.on,
:root[data-theme="light"] .min-tab.on {
  background: var(--g1) !important;
  color: var(--lt) !important;
  border-color: color-mix(in srgb, var(--ac) 36%, transparent) !important;
}

.st-pill.lt,
:root[data-theme="light"] .st-pill.lt {
  background: var(--g1) !important;
  color: var(--lt) !important;
  border-color: color-mix(in srgb, var(--ac) 34%, transparent) !important;
}

.mcell:hover,
:root[data-theme="light"] .mcell:hover {
  background: color-mix(in srgb, var(--ac) 7%, transparent) !important;
}

.today-stamp {
  background: linear-gradient(180deg, var(--g1) 0%, var(--el) 100%) !important;
  border-color: color-mix(in srgb, var(--ac) 32%, transparent) !important;
}
:root[data-theme="light"] .today-stamp {
  background: linear-gradient(180deg, var(--g1) 0%, var(--el) 100%) !important;
  border-color: color-mix(in srgb, var(--ac) 28%, transparent) !important;
}

.cmod-next {
  background: var(--g1) !important;
  border-color: color-mix(in srgb, var(--ac) 32%, transparent) !important;
  border-inline-start-color: color-mix(in srgb, var(--ac) 45%, transparent) !important;
}

.cust-tile:hover,
:root[data-theme="light"] .cust-tile:hover {
  border-color: color-mix(in srgb, var(--ac) 46%, transparent) !important;
  border-inline-start-color: color-mix(in srgb, var(--ac) 46%, transparent) !important;
}

.kb .col .dc:hover,
:root[data-theme="light"] .kb .col .dc:hover {
  border-color: color-mix(in srgb, var(--ac) 44%, transparent) !important;
}

:root[data-theme="light"] .top-search:hover,
:root[data-theme="light"] .tb-ico-btn:hover,
:root[data-theme="light"] .tb-user:hover {
  border-color: color-mix(in srgb, var(--ac) 40%, transparent) !important;
}

.dst-words,
.qc-ans,
.demo-ro-pill,
.cal-flt-btn.on,
.mcal-f.on {
  border-color: color-mix(in srgb, var(--ac) 35%, transparent);
}

.brand-fav,
.ag-brand-img {
  filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--ac) 32%, transparent));
}

/* 3. FIX MOBILE FAB Z-INDEX (Stay below open mobile sidebar & overlay) */
.fab {
  z-index: 20 !important;
}


/* ==========================================================================
   Lyso CRM v27 — Pipeline Flex-Shrink Fix, FAB Layering Fix, Auto Logo Tint,
   Density Mode, Collapsed Glass Tooltips, Interactive Stepper, Micro-Animations,
   Collapsible Pipeline Columns, Mobile Filter Drawer & 3 Docs A4 Templates
   ========================================================================== */

/* 1. CRITICAL BUG FIX #1: STOP PIPELINE CARDS FROM SQUISHING/CLIPPING INSIDE .kcl */
.kb .col .kcl {
  max-height: calc(100vh - 275px);
  padding-bottom: 6px;
}
.kb .col .kcl .dc {
  flex: none !important;
  flex-shrink: 0 !important;
  height: auto !important;
  min-height: fit-content !important;
  overflow: visible !important;
}

/* 2. CRITICAL BUG FIX #2: FAB '+' ALWAYS ABOVE SIDEBAR ON DESKTOP, CLEAN ON MOBILE */
.fab {
  z-index: 27 !important;
}
.fab .fm {
  z-index: 28 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}
@media (max-width: 1024px) {
  body.sb-open .fab {
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* 3. UI UPGRADE #1: AUTO-SYNCED LOGO TINT WITH ALL 6 THEME ACCENTS */
:root[data-accent="steel"] .brand-fav,
:root[data-accent="steel"] .ag-brand-img,
:root[data-accent="steel"] .sb-logo-img,
:root[data-accent="steel"] .tb-mob-logo {
  filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--ac) 34%, transparent));
}
:root[data-accent="teal"] .brand-fav,
:root[data-accent="teal"] .ag-brand-img,
:root[data-accent="teal"] .sb-logo-img,
:root[data-accent="teal"] .tb-mob-logo {
  filter: hue-rotate(-40deg) saturate(1.06) drop-shadow(0 3px 8px color-mix(in srgb, var(--ac) 34%, transparent));
}
:root[data-accent="emerald"] .brand-fav,
:root[data-accent="emerald"] .ag-brand-img,
:root[data-accent="emerald"] .sb-logo-img,
:root[data-accent="emerald"] .tb-mob-logo {
  filter: hue-rotate(-60deg) saturate(1.12) drop-shadow(0 3px 8px color-mix(in srgb, var(--ac) 34%, transparent));
}
:root[data-accent="amber"] .brand-fav,
:root[data-accent="amber"] .ag-brand-img,
:root[data-accent="amber"] .sb-logo-img,
:root[data-accent="amber"] .tb-mob-logo {
  filter: hue-rotate(-178deg) saturate(1.22) brightness(1.05) drop-shadow(0 3px 8px color-mix(in srgb, var(--ac) 34%, transparent));
}
:root[data-accent="copper"] .brand-fav,
:root[data-accent="copper"] .ag-brand-img,
:root[data-accent="copper"] .sb-logo-img,
:root[data-accent="copper"] .tb-mob-logo {
  filter: hue-rotate(-196deg) saturate(1.24) drop-shadow(0 3px 8px color-mix(in srgb, var(--ac) 34%, transparent));
}
:root[data-accent="mono"] .brand-fav,
:root[data-accent="mono"] .ag-brand-img,
:root[data-accent="mono"] .sb-logo-img,
:root[data-accent="mono"] .tb-mob-logo {
  filter: saturate(0.10) brightness(1.08) drop-shadow(0 3px 8px color-mix(in srgb, var(--ac) 30%, transparent));
}

/* 4. UI UPGRADE #2: COMPACT / COMFORTABLE DENSITY MODE */
.tb-ico-btn.on {
  border-color: var(--ac) !important;
  color: var(--lt) !important;
  background: var(--g1) !important;
}
body.dense main { padding: 12px 18px 22px; }
body.dense .ph { margin-bottom: 10px; }
body.dense .mcell { padding: 9px 12px !important; }
body.dense .mcell-val { font-size: 16.5px !important; }
body.dense .min-tbl thead th { padding: 7px 10px; }
body.dense .min-tbl tbody td { padding: 6.5px 10px; font-size: 12px; }
body.dense .cust-dir-grid { gap: 10px !important; padding: 10px !important; }
body.dense .cust-tile-hd { padding: 8px 12px !important; }
body.dense .cust-tile-body { padding: 8px 12px !important; }
body.dense .cust-tile-ft { padding: 6px 12px !important; }
body.dense .dc { padding: 8px 10px !important; gap: 5px !important; }
body.dense .tkc { padding: 7px 9px !important; }
body.dense .ledger-row { padding: 5.5px 4px; }
body.dense .desk-pane { padding: 13px 15px; }

/* 5. UI UPGRADE #3: VIEW SWITCHER PILL */
.view-sw {
  height: 31px;
  align-items: center;
  flex: none;
}
.view-sw button {
  height: 25px;
  padding: 0 9px;
  font-size: 11px;
}

/* 6. UI UPGRADE #5: CUSTOM FROSTED-GLASS TOOLTIP FOR COLLAPSED SIDEBAR */
.sb-tip {
  position: fixed;
  z-index: 48;
  pointer-events: none;
  transform: translate(6px, -50%);
  opacity: 0;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--tx);
  background: var(--gm);
  border: 1px solid var(--gb);
  box-shadow: 0 10px 26px -8px rgba(0, 4, 16, 0.55);
  transition: opacity .12s ease, transform .12s ease;
}
.sb-tip.on {
  opacity: 1;
  transform: translate(0, -50%);
}

/* 7. UI UPGRADE #6: INTERACTIVE 5-STAGE HORIZONTAL STEPPER IN PROFILE MODAL */
.cmod-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--bd);
  background: rgba(14, 22, 44, 0.56);
  flex: none;
}
:root[data-theme="light"] .cmod-stepper {
  background: rgba(226, 236, 250, 0.58);
}
.cstep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 29px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--bd);
  background: var(--el);
  color: var(--mu);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
  transition: background .13s, border-color .13s, color .13s;
}
.cstep span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cstep:hover:not(:disabled) {
  border-color: var(--ac);
  color: var(--tx);
  background: var(--g1);
}
.cstep:disabled { cursor: default; }
.cstep-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  background: var(--el2);
  color: var(--mu);
}
.cstep.done {
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  background: rgba(16, 185, 129, 0.11);
  color: var(--ok);
}
.cstep.done .cstep-dot {
  background: var(--ok);
  color: #fff;
}
.cstep.cur {
  border-color: var(--ac);
  background: var(--g1);
  color: var(--lt);
  font-weight: 700;
}
.cstep.cur .cstep-dot {
  background: var(--ac);
  color: #fff;
}
@media (max-width: 680px) {
  .cmod-stepper { padding: 8px 12px; gap: 4px; }
  .cstep span { display: none; }
}

/* 8. UI UPGRADE #7: LIGHTWEIGHT MICRO-ANIMATIONS (TAB SWITCH & PIPELINE DRAG) */
@keyframes tabIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
main.tab-anim {
  animation: tabIn .14s ease-out;
}
.dc.dragging {
  opacity: .48 !important;
  transform: scale(.98);
  border-color: var(--ac) !important;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.65);
}

/* 9. UI UPGRADE #8: COLLAPSIBLE PIPELINE COLUMNS */
.col-fold-btn {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  padding: 0 !important;
  font-size: 10px !important;
  opacity: .72;
}
.col-fold-btn:hover { opacity: 1; }
.col-rail { display: none; }
.kb .col.col-folded {
  padding: 10px 6px !important;
  align-items: center;
  min-height: 360px;
}
.kb .col.col-folded .col-hd,
.kb .col.col-folded .col-flt,
.kb .col.col-folded .kcl,
.kb .col.col-folded .kcl-e {
  display: none !important;
}
.kb .col.col-folded .col-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.col-rail-cnt {
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--g1);
  color: var(--lt);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.col-rail-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  font-weight: 700;
  color: var(--tx2);
  white-space: nowrap;
  letter-spacing: .2px;
}

/* 10. UI UPGRADE #9: MOBILE COLLAPSIBLE FILTER TRAY (<= 740px) */
.mob-flt-btn { display: none !important; height: 31px !important; font-size: 11.5px !important; padding: 0 10px !important; }
.mob-flt-cnt {
  display: inline-grid; place-items: center;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--ac); color: #fff; font-style: normal; font-size: 9.5px; font-weight: 800;
}
.flt-tray {
  display: contents;
}
@media (max-width: 740px) {
  .mob-flt-btn { display: inline-flex !important; }
  .flt-tray {
    display: none;
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 7px;
    margin-top: 4px;
    border-top: 1px dashed var(--line);
  }
  .flt-open > .flt-tray { display: flex; }
  .flt-tray > select,
  .flt-tray > .seg { flex: 1 1 130px; }
}

/* 11. UI UPGRADE #10: 3 LIVE A4 PRINT TEMPLATES (OFFICIAL / CLASSIC / MINIMAL) */
.a4-style-classic {
  border: 3px double var(--da, #0f766e);
  padding: 20px 22px !important;
  border-radius: 3px !important;
}
.a4-style-classic .a4-topbar { display: none; }
.a4-style-classic .a4-hd { border-bottom: 2px double var(--da, #0f766e); }
.a4-style-classic .a4-pbox,
.a4-style-classic .a4-meta,
.a4-style-classic .a4-notes,
.a4-style-classic .a4-sig {
  border-radius: 2px;
  background: #ffffff;
  border-color: #94a3b8;
}
.a4-style-classic .a4-tbl th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #64748b !important;
  border-bottom: 2px solid var(--da, #0f766e) !important;
}
.a4-style-classic .a4-tbl td { border-color: #cbd5e1; }
.a4-style-classic .a4-sum-r.grand {
  background: #f1f5f9;
  color: #0f172a;
  border-top: 2px solid var(--da, #0f766e);
}

.a4-style-minimal .a4-topbar { height: 2px; }
.a4-style-minimal .a4-hd { border-bottom: 1px solid #e2e8f0; }
.a4-style-minimal .a4-pbox,
.a4-style-minimal .a4-meta,
.a4-style-minimal .a4-notes,
.a4-style-minimal .a4-bank {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  padding: 6px 0;
}
.a4-style-minimal .a4-tbl th {
  background: transparent !important;
  color: #0f172a !important;
  border: 0 !important;
  border-bottom: 2px solid var(--da, #0f766e) !important;
}
.a4-style-minimal .a4-tbl td {
  border: 0;
  border-bottom: 1px solid #e2e8f0;
}
.a4-style-minimal .a4-tbl tbody tr:nth-child(even) { background: transparent !important; }
.a4-style-minimal .a4-words {
  background: transparent;
  border: 0;
  border-right: 2px solid var(--da, #0f766e);
  border-radius: 0;
}
.a4-style-minimal .a4-sum {
  border: 0;
  border-top: 1px solid #cbd5e1;
  border-radius: 0;
}
.a4-style-minimal .a4-sum-r.grand {
  background: transparent;
  color: var(--da, #0f766e);
  border-top: 2px solid var(--da, #0f766e);
  font-size: 13px;
}
.a4-style-minimal .a4-sig {
  border: 0;
  border-top: 1px dashed #cbd5e1;
  border-radius: 0;
}

/* Ensure Jalali date picker popover inside modals never clips */
.mc { overflow: visible !important; }
.jdp-box { width: 100%; }


/* ==========================================================================
   Lyso CRM v28 — Inline Stage Checklist Editor in Settings (Always Compact)
   ========================================================================== */
.chk-cfg-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chk-cfg-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
}
.chk-cfg-row input {
  height: 32px !important;
  font-size: 12px !important;
}
.chk-cfg-row .mi {
  height: 30px;
  min-width: 28px;
}


/* ==========================================================================
   Lyso CRM v29 — Side-by-Side Catalog & Checklists in Settings (Zero Overflow)
   ========================================================================== */
.cat-list {
  display: flex;
  flex-direction: column;
  max-height: 250px;
  overflow-y: auto;
}
.cat-row {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto !important;
  gap: 7px !important;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--bd);
  font-size: 12px;
}
.cat-row > b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-row .cat-u {
  font-size: 11px;
  color: var(--mu);
  white-space: nowrap;
}
.cat-row .cat-p {
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}
.cat-add-grid {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--bd);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(90px, 0.75fr);
  gap: 6px;
}
.cat-add-grid #cat_unit {
  grid-column: 1 / 2;
}
.cat-add-grid #cat_price {
  grid-column: 2 / 3;
}
.cat-add-grid > button {
  grid-column: 1 / -1;
  height: 32px;
}
@media (min-width: 1280px) {
  .cat-add-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(88px, 0.7fr) minmax(72px, 0.55fr);
  }
  .cat-add-grid #cat_name { grid-column: 1 / 3; }
  .cat-add-grid #cat_code { grid-column: 3 / 4; }
  .cat-add-grid #cat_unit { grid-column: 1 / 2; }
  .cat-add-grid #cat_price { grid-column: 2 / 3; }
  .cat-add-grid > button { grid-column: 3 / 4; }
}
.chk-cfg-list {
  max-height: 220px;
  overflow-y: auto;
}


/* ==========================================================================
   Lyso CRM v31 — Universal Responsive & Multi-Monitor Engine
   - Fixes Vertical / Portrait Monitors (1080x1920, 1440x2560): Sidebar stays
     cleanly top-anchored right under the 56px header — NEVER drops down!
   - Fixes Tablet & Mobile Slide-In Drawer (Full-Height 100dvh, Clean Labels)
   - Fixes Mobile/Tablet 2-Col Override Bug on Customer & Lead Cards
   - Full Viewport Responsiveness: Ultrawide, Desktop, Vertical, Tablet, Mobile
   ========================================================================== */

/* 1. DESKTOP SIDEBAR: TOP-ANCHORED DIRECTLY UNDER 56px HEADER (NO top: 50% DROP!) */
@media (min-width: 1025px) {
  .sidebar {
    top: 70px !important;
    bottom: auto !important;
    right: 14px !important;
    height: auto !important;
    max-height: calc(100dvh - 84px) !important;
    transform: none !important;
  }
  body.sb-col .sidebar {
    top: 70px !important;
    transform: none !important;
  }
}

/* 2. SMART VIEWPORT-SAFE JALALI DATE PICKER POPOVER */
.jdp-pop {
  max-width: calc(100vw - 28px);
}
.jdp-pop.jdp-up {
  top: auto !important;
  bottom: calc(100% + 5px) !important;
}
.jdp-pop.jdp-end {
  inset-inline-start: auto !important;
  inset-inline-end: 0 !important;
}

/* 3. ULTRAWIDE / 4K MONITORS (>= 1800px) */
@media (min-width: 1800px) {
  main, .bc-wrap {
    max-width: 1840px;
  }
  .cust-dir-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* 4. VERTICAL / PORTRAIT MONITORS & COMPACT DESKTOP (1025px – 1220px) */
@media (min-width: 1025px) and (max-width: 1220px) {
  :root {
    --sb-w: 176px;
  }
  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 230px) auto;
    padding: 0 16px;
    gap: 10px;
  }
  .tb-greet-row span,
  .tb-sep-dot,
  .tb-goal-mini {
    display: none;
  }
  body.dense main {
    padding: 12px 14px 22px;
  }
  .desk-frame > .mstrip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .desk-frame > .mstrip .mcell:nth-child(2n) { border-inline-end: 0; }
  .desk-frame > .mstrip .mcell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .g2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  }
}

/* Vertical Monitor Login Page (e.g., 1080x1920 or 1440x2560 Portrait Monitor) */
@media (max-aspect-ratio: 4/5) and (min-width: 921px) {
  .ag-shell {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
  }
  .ag-pane-form {
    border-inline-end: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    align-items: center;
    padding: 32px 28px 26px !important;
  }
  .ag-top-bar, .ag-form-body, .ag-foot {
    width: 100%;
    max-width: 420px;
  }
  .ag-pane-side {
    padding: 34px 40px 28px !important;
    align-items: center;
  }
  .ag-side-top, .ag-side-main, .ag-side-bot {
    width: 100%;
    max-width: 580px;
  }
}

/* 5. TABLETS & MOBILE DRAWER (<= 1024px — iPad Mini, iPad Air, iPad Pro Portrait, Phones) */
@media (max-width: 1024px) {
  body.sb-open {
    overflow: hidden;
  }
  .app-main,
  body.sb-col .app-main {
    margin-inline-start: 0 !important;
  }
  .sidebar,
  body.sb-col .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: min(264px, 82vw) !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 16px 0 0 16px !important;
    border-inline-end: 0 !important;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    transform: translateX(106%) !important;
    transition: transform .22s cubic-bezier(.22, 1, .36, 1) !important;
    z-index: 32 !important;
    box-shadow: -16px 0 44px rgba(0, 4, 16, 0.72) !important;
  }
  body.sb-open .sidebar,
  body.sb-col.sb-open .sidebar {
    transform: translateX(0) !important;
  }
  .sb-ov {
    z-index: 31 !important;
  }
  /* Always show full labels & brand inside mobile/tablet drawer even if desktop rail was collapsed */
  body.sb-col .sb-brand {
    justify-content: space-between !important;
    padding: 3px 5px 11px !important;
  }
  body.sb-col .sb-brand-l {
    display: flex !important;
  }
  body.sb-col .sb-brand-txt {
    display: block !important;
  }
  body.sb-col .sb-nav button,
  body.sb-col .sb-util {
    justify-content: flex-start !important;
    padding: 0 10px !important;
  }
  body.sb-col .sb-nav button span,
  body.sb-col .sb-util span {
    display: inline !important;
  }
  body.sb-col .sb-grp {
    display: block !important;
  }

  .brand-corner {
    display: none !important;
  }
  .sb-toggle,
  .sb-close {
    display: grid !important;
  }
  .sb-collapse {
    display: none !important;
  }
  .tb-mob-logo {
    display: block !important;
    cursor: pointer;
  }
  .topbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 54px;
    padding: 0 14px;
  }
  .tb-right {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }
  .tb-center {
    flex: 0 1 220px;
  }
  .tb-goal-mini,
  .tb-greet-row span,
  .tb-sep-dot {
    display: none !important;
  }
  .dst-bar {
    top: 58px !important;
  }
  .dst-pv-col {
    position: static !important;
  }
  .dst-pv-scroll {
    max-height: 70dvh !important;
  }

  /* Clean 2x2 KPI Strip on Tablets */
  .mstrip.compact,
  .desk-frame > .mstrip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .mstrip.compact .mcell:nth-child(2n),
  .desk-frame > .mstrip .mcell:nth-child(2n) {
    border-inline-end: 0 !important;
  }
  .mstrip.compact .mcell:nth-child(-n+2),
  .desk-frame > .mstrip .mcell:nth-child(-n+2) {
    border-bottom: 1px solid var(--line) !important;
  }

  /* Tablet Customer Profile Modal */
  #dr {
    width: min(92vw, 840px) !important;
    height: min(86dvh, 720px) !important;
    max-height: 88dvh !important;
  }
  .cal2-mcell {
    min-height: 82px;
  }
}

/* 6. FIX CRITICAL BUG: SINGLE-COLUMN CUSTOMER & LEAD CARDS BELOW 960px */
@media (max-width: 960px) {
  .cust-dir-grid {
    grid-template-columns: 1fr !important;
    padding: 10px !important;
    gap: 10px !important;
  }
  .g2 {
    grid-template-columns: 1fr !important;
  }
  .min-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .min-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .min-tabs::-webkit-scrollbar { display: none; }
  .min-tab { flex: none; }
  .min-tools {
    width: 100%;
    justify-content: flex-start;
  }
  .min-search {
    flex: 1 1 160px !important;
    width: auto !important;
  }
  .cal2-hd {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 8px;
  }
  .cal2-right,
  .cal2-nav,
  .cal2-left {
    justify-content: center;
  }
  /* Preserve real A4 layout inside scrollable preview on tablets/phones */
  .dst-pv-scroll .a4-paper,
  .pv-modal-body .a4-paper {
    min-width: 600px;
  }
}

/* 7. MOBILE PHONES (<= 740px) */
@media (max-width: 740px) {
  body.dense main {
    padding: 10px 10px 24px !important;
  }
  .topbar {
    height: 52px;
    padding: 0 10px;
    gap: 6px;
  }
  .tb-center {
    flex: none;
  }
  .tb-center .top-search {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .tb-center .top-search span,
  .tb-center .top-search kbd {
    display: none;
  }
  .tb-u-info {
    display: none;
  }
  .tb-user {
    padding: 0 5px;
  }
  .ph h2 {
    font-size: 16px;
  }
  .ph .acts {
    width: 100%;
    justify-content: flex-start;
  }

  /* Smooth Horizontal Touch Kanban on Mobile */
  .kb {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    grid-template-columns: repeat(5, minmax(242px, 82vw)) !important;
  }
  .kb .col {
    scroll-snap-align: start;
  }
  .col-fold-btn { display: none !important; }
  .kb .col.col-folded {
    padding: 12px !important;
    align-items: stretch !important;
    min-height: auto !important;
  }
  .kb .col.col-folded .col-rail { display: none !important; }
  .kb .col.col-folded .col-hd,
  .kb .col.col-folded .col-flt,
  .kb .col.col-folded .kcl { display: flex !important; }
  .kb .col.col-folded.em .kcl-e { display: block !important; }
  .kb .col .kcl {
    max-height: 62dvh !important;
  }

  /* Calendar Mobile Polish */
  .cal2-wk-hd span {
    font-size: 9.5px;
    padding: 6px 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cal2-mcell {
    min-height: 62px;
    padding: 4px;
    gap: 3px;
  }
  .cal2-mnum {
    font-size: 11px;
  }
  .cal2-mev {
    font-size: 9.5px;
    padding: 1px 3px;
  }

  /* Docs & Tables Touch Scroll */
  .tw, .dit-wrap, .rep-scroll {
    -webkit-overflow-scrolling: touch;
  }
  .dst-bar {
    position: static !important;
    padding: 10px !important;
  }

  /* Floating Action Button Safe Spacing */
  .fab {
    right: 14px !important;
    inset-inline-start: 14px !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* 8. SMALL PHONES & FULL-SCREEN NATIVE-STYLE PROFILE MODAL (<= 640px) */
@media (max-width: 640px) {
  #dr {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
    border-radius: 0 !important;
    border: 0 !important;
    transform: translateY(16px) !important;
  }
  #dr.open {
    transform: translateY(0) !important;
  }
  .cmod-hd {
    padding: 12px 14px !important;
  }
  .cmod-acts {
    width: 100%;
    justify-content: flex-end;
  }
  .cmod-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 2px 12px 0 !important;
  }
  .cmod-body {
    padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .mb {
    padding: 12px 8px;
  }
  .mc {
    padding: 15px 14px;
    border-radius: 13px;
  }
  .tkg {
    grid-template-columns: 1fr !important;
  }
  .cat-row {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
  }
  .cat-row .cat-u {
    display: none;
  }
  .cat-row .cat-p {
    grid-column: 2 / 3;
    text-align: right;
    color: var(--lt);
  }
}

/* 9. EXTRA-SMALL PHONES (<= 480px — 320px–430px) */
@media (max-width: 480px) {
  .tb-daily,
  .demo-ro-pill {
    display: none !important;
  }
  .mstrip.compact,
  .desk-frame > .mstrip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body.dense .mcell {
    padding: 8px 9px !important;
  }
  body.dense .mcell-val {
    font-size: 14.5px !important;
  }
  .mcell-lbl,
  .mcell-sub {
    font-size: 10px !important;
  }
  .view-sw {
    order: 2;
  }
  .min-cnt {
    order: 3;
    margin-inline-start: auto;
  }
}


/* ==========================================================================
   Lyso CRM v32 — Exact Midpoint Sidebar Between Header & Viewport Bottom
   (All Desktop & Vertical Monitors) + Native-App Mobile Bottom Bar & Sheet
   ========================================================================== */

/* 1. DESKTOP & VERTICAL MONITORS (>= 1025px):
      Exact Vertical Center Between 56px Header and Bottom of Viewport
      Midpoint = 56px + (100dvh - 56px) / 2 = calc(50dvh + 28px)
      Safe max-height prevents ANY collision with header (top) or '+' FAB (bottom)! */
@media (min-width: 1025px) {
  .sidebar,
  body.sb-col .sidebar {
    position: fixed !important;
    top: calc(50dvh + 28px) !important;
    bottom: auto !important;
    right: 14px !important;
    height: auto !important;
    max-height: calc(100dvh - 188px) !important;
    transform: translateY(-50%) !important;
  }
}
/* Safety adjustment on very short landscape windows (<= 630px height):
   Shifts midpoint slightly up to stay clear of both header & bottom-right '+' button */
@media (min-width: 1025px) and (max-height: 630px) {
  .sidebar,
  body.sb-col .sidebar {
    top: calc(50dvh - 2px) !important;
    max-height: calc(100dvh - 136px) !important;
  }
}

/* 2. MOBILE NATIVE-APP BOTTOM TAB BAR & BOTTOM SHEET (Default Hidden on Desktop/Tablet) */
.mob-nav,
.mob-sheet,
.mob-sheet-bg {
  display: none;
}

@media (max-width: 768px) {
  /* Hide desktop/tablet slide-in sidebar & hamburger button on phones */
  .sidebar,
  .sb-ov,
  .sb-toggle {
    display: none !important;
  }

  /* Hide mobile nav when locked, devtools-locked, or focus-mode */
  body.locked .mob-nav,
  body.locked .mob-sheet,
  body.locked .mob-sheet-bg,
  body.dt-open .mob-nav,
  body.dt-open .mob-sheet,
  body.dt-open .mob-sheet-bg,
  body.focus-mode .mob-nav,
  body.focus-mode .mob-sheet,
  body.focus-mode .mob-sheet-bg {
    display: none !important;
  }

  body.mob-sheet-open {
    overflow: hidden;
  }

  /* Fixed Frosted-Glass Bottom Tab Bar */
  .mob-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    background: var(--gl);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 26px -12px rgba(2, 6, 18, 0.55);
  }
  :root[data-theme="light"] .mob-nav {
    background: rgba(244, 248, 254, 0.88);
    box-shadow: 0 -6px 20px -10px rgba(15, 32, 68, 0.16);
  }
  .mob-nav button {
    position: relative;
    border: 0;
    background: transparent;
    color: var(--mu);
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 10px;
    cursor: pointer;
    padding: 4px 2px;
    transition: color .14s, background .14s;
    min-width: 0;
  }
  .mob-nav button svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.85;
    flex: none;
  }
  .mob-nav button span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.2;
  }
  .mob-nav button.on,
  .mob-nav button.sheet-on {
    color: var(--lt);
    font-weight: 800;
    background: var(--g1);
  }
  .mob-nav button.on::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24%;
    right: 24%;
    height: 2.5px;
    border-radius: 99px;
    background: var(--ac);
  }

  /* Bottom Sheet Backdrop */
  .mob-sheet-bg {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(4, 7, 16, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  :root[data-theme="light"] .mob-sheet-bg {
    background: rgba(15, 28, 56, 0.34);
  }
  body.mob-sheet-open .mob-sheet-bg {
    opacity: 1;
    pointer-events: auto;
  }

  /* Slide-Up Glass Bottom Sheet */
  .mob-sheet {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 31;
    padding: 8px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    background: var(--gm);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--gb);
    box-shadow: 0 -18px 48px -12px rgba(0, 4, 16, 0.72);
    transform: translateY(105%);
    transition: transform .22s cubic-bezier(.22, 1, .36, 1);
  }
  body.mob-sheet-open .mob-sheet {
    transform: translateY(0);
  }
  .ms-handle {
    display: flex;
    justify-content: center;
    padding: 2px 0 4px;
    cursor: pointer;
  }
  .ms-handle i {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 99px;
    background: var(--gb);
  }
  .ms-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px 6px;
    border-bottom: 1px solid var(--bd);
  }
  .ms-hd b {
    font-size: 13px;
    font-weight: 800;
    color: var(--tx);
  }
  .ms-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .ms-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 6px;
    border-radius: 12px;
    border: 1px solid var(--bd);
    background: var(--el);
    color: var(--tx2);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
  }
  .ms-tile svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.85;
  }
  .ms-tile.on {
    background: var(--g1);
    border-color: color-mix(in srgb, var(--ac) 45%, transparent);
    color: var(--lt);
    font-weight: 800;
  }
  .ms-tile.out {
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.24);
    background: rgba(244, 63, 94, 0.08);
  }
  :root[data-theme="light"] .ms-tile.out {
    color: #be123c;
  }

  /* Lift FAB '+' & Toast cleanly above the Mobile Bottom Tab Bar */
  .fab {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px !important;
    inset-inline-start: 14px !important;
  }
  body.mob-sheet-open .fab {
    opacity: 0 !important;
    pointer-events: none !important;
  }
  #ts {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }
  footer {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* ==========================================================================
   Lyso CRM v33 — Ultra-Fast Zero-Reflow Sidebar Toggle & Performance Engine
   - Eliminates slow width / margin-inline-start layout thrashing on desktop
   - Locks exact sidebar vertical height across expanded & collapsed states
     (Zero vertical jump!) + crisp 95ms GPU fade-in on labels
   - Removes expensive backdrop-filter blur on moving drawers, sheets & modals
   - Fixes Pipeline toolbar wrapping cleanly on Vertical Monitors (<= 1200px)
   ========================================================================== */

/* 1. DESKTOP SIDEBAR: INSTANT 1-FRAME LAYOUT + ZERO VERTICAL JUMP + CRISP MICRO-FADE */
@keyframes sbLblIn {
  from { opacity: 0; transform: translateX(4px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (min-width: 1025px) {
  .app-main,
  body.sb-col .app-main {
    transition: none !important;
  }
  .sidebar,
  body.sb-col .sidebar {
    transition: none !important;
    contain: layout style;
  }
  .brand-corner,
  body.sb-col .brand-corner {
    transition: background-color .12s ease !important;
  }
  .sb-collapse svg {
    transition: transform .14s cubic-bezier(.2, .8, .2, 1);
  }
  /* Keep exact vertical height of .sb-brand & .sb-grp in BOTH states so icons NEVER jump! */
  .sidebar .sb-brand,
  body.sb-col .sidebar .sb-brand {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 2px 6px !important;
    align-items: center !important;
  }
  body.sb-col .sb-collapse {
    margin-top: 0 !important;
  }
  .sb-grp {
    height: 22px !important;
    line-height: 22px !important;
    padding: 0 8px !important;
    display: flex !important;
    align-items: center;
    overflow: hidden;
  }
  body.sb-col .sb-grp {
    display: flex !important;
    justify-content: center;
    padding: 0 !important;
    font-size: 0 !important;
    color: transparent !important;
  }
  body.sb-col .sb-grp::after {
    content: "";
    width: 18px;
    height: 1px;
    border-radius: 99px;
    background: var(--line);
  }
  /* Subtle, instant 95ms fade-in on text labels when expanded */
  body:not(.sb-col) .sb-nav button span,
  body:not(.sb-col) .sb-util span,
  body:not(.sb-col) .brand-corner-txt {
    animation: sbLblIn .095s ease-out;
  }
}

/* 2. GPU-ACCELERATED TABLET DRAWER (769px–1024px) & MOBILE SHEET (<= 768px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .sidebar,
  body.sb-col .sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(11, 17, 32, 0.96) !important;
    transform: translate3d(106%, 0, 0) !important;
    transition: transform .15s cubic-bezier(.2, .9, .3, 1) !important;
    will-change: transform;
  }
  :root[data-theme="light"] .sidebar,
  :root[data-theme="light"] body.sb-col .sidebar {
    background: rgba(245, 248, 254, 0.97) !important;
  }
  body.sb-open .sidebar,
  body.sb-col.sb-open .sidebar {
    transform: translate3d(0, 0, 0) !important;
  }
}

@media (max-width: 768px) {
  .mob-sheet {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(11, 17, 32, 0.96) !important;
    transform: translate3d(0, 105%, 0);
    transition: transform .15s cubic-bezier(.2, .9, .3, 1);
    will-change: transform;
  }
  :root[data-theme="light"] .mob-sheet {
    background: rgba(246, 249, 255, 0.97) !important;
  }
  body.mob-sheet-open .mob-sheet {
    transform: translate3d(0, 0, 0);
  }
}

/* 3. ZERO-STALL MODALS & POPUPS (Replace heavy backdrop-filter with crisp high-opacity glass) */
#dr,
.mc,
.fab .fm {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(12, 19, 36, 0.96) !important;
}
:root[data-theme="light"] #dr,
:root[data-theme="light"] .mc,
:root[data-theme="light"] .fab .fm {
  background: rgba(246, 249, 255, 0.97) !important;
}

/* Lighter static chrome blur (6px instead of 8–14px = smoother GPU compositing) */
.topbar,
.brand-corner {
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}
@media (min-width: 1025px) {
  .sidebar {
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
  }
}
@media (max-width: 768px) {
  .mob-nav {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }
}

/* 4. VERTICAL MONITOR TOOLBAR FIX (Wrap Pipeline Filter Bar Cleanly <= 1200px) */
@media (max-width: 1200px) {
  .pipe-bar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .pipe-bar .sbx {
    flex: 1 1 260px;
  }
}

/* 5. FAST SCROLLING & CHEAP TRANSITIONS ON LARGE LISTS */
.cust-tile {
  content-visibility: auto;
  contain-intrinsic-size: auto 156px;
}
.tkc {
  content-visibility: auto;
  contain-intrinsic-size: auto 56px;
}
.sb-collapse,
.sb-close,
.cal-flt-btn,
.ld-stab {
  transition: background-color .12s, border-color .12s, color .12s !important;
}

/* === Lyso CRM v3 Multi-Tenant Polish (Preserves 100% Original Theme & Backgrounds) === */
footer,
[data-theme="light"] footer,
[data-theme="dark"] footer {
  background: transparent !important;
  border-top: none !important;
  box-shadow: none !important;
  padding: 16px 20px 20px !important;
  font-size: 11.5px;
  opacity: 0.72;
  transition: opacity .18s ease;
}
footer:hover { opacity: 1; }
footer a {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
footer a:hover { background: rgba(148, 163, 184, 0.14); }

.mt-sub-banner{background:linear-gradient(90deg,rgba(245,158,11,.18),rgba(239,68,68,.16));border-bottom:1px solid rgba(245,158,11,.35);color:#fde68a;padding:8px 18px;font-size:12.5px;text-align:center;font-weight:600}
[data-theme="light"] .mt-sub-banner{color:#92400e;background:rgba(245,158,11,.14)}
.mt-sync-pill{font-size:11.5px;font-weight:600;padding:3px 9px;border-radius:999px;display:inline-flex;align-items:center;gap:4px;opacity:.92}
.mt-sync-pill:empty{display:none}
.mt-sync-pill.ok{color:#10b981;background:rgba(16,185,129,.12)}
.mt-sync-pill.busy{color:var(--ac);background:rgba(56,189,248,.12)}
.mt-sync-pill.err{color:#ef4444;background:rgba(239,68,68,.14)}
.mt-subtabs{display:flex;align-items:center;justify-content:flex-start;gap:8px;flex-wrap:wrap;margin:14px 0 12px}
.mt-acts-inline{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.mt-prod-add{display:grid;grid-template-columns:minmax(180px,2fr) minmax(110px,1fr) minmax(85px,.7fr) minmax(130px,1fr) auto;gap:8px;align-items:center}
@media (max-width:860px){.mt-prod-add{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.mt-prod-add{grid-template-columns:1fr}}
.mt-perm-card{border:1px solid var(--bd);border-radius:12px;padding:13px;margin-bottom:10px;background:rgba(255,255,255,.02)}
.mt-perm-row{display:flex;align-items:center;justify-content:flex-start;gap:14px;flex-wrap:wrap;margin-bottom:8px;font-size:12.5px}
.mt-perm-tabs{display:flex;align-items:center;justify-content:flex-start;gap:6px;flex-wrap:wrap;padding-top:8px;border-top:1px solid var(--bd)}
.mt-chk-lbl{display:inline-flex;align-items:center;gap:5px;cursor:pointer}
.mt-mbody{margin-top:8px}
.ag-forgot-link{background:none;border:none;color:var(--mu);font-family:inherit;font-size:12px;cursor:pointer;padding:6px 4px;text-align:center;width:100%;transition:color .15s}
.ag-forgot-link:hover{color:var(--ac)}
.ag-sub-hint{font-size:12.5px;color:var(--mu);margin:0 0 8px;line-height:1.7}
.mt-afk-ov{position:fixed;inset:0;z-index:9999;background:rgba(2,6,23,.72);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;padding:16px}
.mt-afk-box{width:100%;max-width:420px;background:var(--sf);border:1px solid var(--bd);border-radius:16px;padding:22px;box-shadow:0 24px 60px rgba(0,0,0,.45)}
.mt-afk-box h3{margin:0 0 8px;font-size:16px}
.mt-afk-box p{margin:0;font-size:13px;color:var(--mu);line-height:1.7}

/* === Lyso CRM v4 — Dynamic Floating Sidebar Expansion (Adapts Cleanly to Tab Count) === */
@media (min-width: 1025px) {
  .sidebar,
  body.sb-col .sidebar {
    position: fixed !important;
    top: calc(50dvh + 28px) !important;
    bottom: auto !important;
    right: 14px !important;
    height: auto !important;
    max-height: calc(100dvh - 84px) !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .sidebar .sb-brand,
  .sidebar .sb-foot {
    flex: 0 0 auto !important;
  }
  .sidebar .sb-nav {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    justify-content: flex-start !important;
    padding-block: 4px !important;
  }
}
@media (min-width: 1025px) and (max-height: 780px) {
  .sidebar .sb-nav button {
    height: 30px !important;
    font-size: 12px !important;
  }
  .sidebar .sb-grp {
    margin-top: 2px !important;
    margin-bottom: 2px !important;
  }
}
@media (min-width: 1025px) and (max-height: 640px) {
  .sidebar,
  body.sb-col .sidebar {
    top: 66px !important;
    transform: none !important;
    max-height: calc(100dvh - 76px) !important;
  }
  .sidebar .sb-nav button {
    height: 28px !important;
    font-size: 11.5px !important;
  }
}

/* === Lyso CRM v5 — Bottom-Left FAB (Zero Sidebar Collision) + Clean Drawer Integration === */
.fab {
  left: 20px !important;
  right: auto !important;
  inset-inline-start: auto !important;
  inset-inline-end: 20px !important;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  align-items: flex-end !important;
  z-index: 27 !important;
}
.fab .fm {
  align-self: flex-end !important;
  min-width: 205px;
}
@media (max-width: 1024px) {
  .fab {
    left: 14px !important;
    right: auto !important;
    inset-inline-start: auto !important;
    inset-inline-end: 14px !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
@media (max-width: 768px) {
  .fab {
    left: 14px !important;
    right: auto !important;
    inset-inline-start: auto !important;
    inset-inline-end: 14px !important;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
.mt-dr-sec {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--bd);
}
