/* ============================================================
   ArCRM – Styles (v1.2 "میز کار")
   Calm, dense, keyboard-first Persian RTL workspace.
   Light and dark themes share the tokens below; Bootstrap's own
   variables are mapped onto them so its components follow along.
   ============================================================ */

/* ----- Fonts (self-hosted, Persian digits) ----- */
@font-face { font-family: 'Vazirmatn'; font-weight: 400; font-display: swap; src: url(../vendor/fonts/Vazirmatn-FD-Regular.woff2) format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 500; font-display: swap; src: url(../vendor/fonts/Vazirmatn-FD-Medium.woff2) format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 600; font-display: swap; src: url(../vendor/fonts/Vazirmatn-FD-SemiBold.woff2) format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 700 900; font-display: swap; src: url(../vendor/fonts/Vazirmatn-FD-Bold.woff2) format('woff2'); }

/* ----- Design tokens ----- */
:root, [data-bs-theme="light"] {
  --body-bg:        #f4f5f2;
  --surface:        #ffffff;
  --surface-2:      #f8f9f6;
  --surface-3:      #eef0ec;
  --border:         #e3e6e1;
  --border-strong:  #cfd5cf;

  --text:           #1a211f;
  --text-muted:     #67706c;
  --text-faint:     #9aa29e;

  --accent:         #0f766e;
  --accent-dark:    #115e59;
  --accent-soft:    #e2f1ee;
  --accent-rgb:     15,118,110;
  --on-accent:      #ffffff;

  --success:        #15803d;
  --success-soft:   #e6f4ea;
  --warning:        #b45309;
  --warning-soft:   #fdf1e1;
  --danger:         #c62828;
  --danger-soft:    #fbe9e9;
  --info:           #0369a1;
  --info-soft:      #e4f0f8;
  --neutral-soft:   #eceeea;

  --sidebar-width:  236px;
  --sidebar-mini:   68px;
  --topbar-height:  60px;
  --bottombar-height: 62px;
  --radius:         6px;
  --radius-sm:      4px;
  --shadow-sm:      0 1px 2px rgba(20,28,25,.05);
  --shadow-md:      0 6px 20px rgba(20,28,25,.08);
  --shadow-lg:      0 18px 48px rgba(20,28,25,.16);
  --transition:     .18s ease;

  --bs-body-bg: var(--body-bg);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--text-muted);
  --bs-tertiary-color: var(--text-faint);
  --bs-secondary-bg: var(--surface-3);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--border);
  --bs-border-color-translucent: var(--border);
  --bs-primary: var(--accent);
  --bs-primary-rgb: var(--accent-rgb);
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: var(--accent-rgb);
  --bs-link-hover-color: var(--accent-dark);
  --bs-body-font-family: 'Vazirmatn', system-ui, sans-serif;
  --bs-body-font-size: 14px;
  --bs-border-radius: var(--radius-sm);
  --bs-focus-ring-color: rgba(var(--accent-rgb), .22);
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --body-bg:        #0f1312;
  --surface:        #171c1b;
  --surface-2:      #1c2220;
  --surface-3:      #242b29;
  --border:         #2a3230;
  --border-strong:  #3a4441;

  --text:           #e4e8e6;
  --text-muted:     #9aa49f;
  --text-faint:     #6d7773;

  --accent:         #2cc4b0;
  --accent-dark:    #5fd6c6;
  --accent-soft:    rgba(44,196,176,.13);
  --accent-rgb:     44,196,176;
  --on-accent:      #06201c;

  --success:        #4ade80;
  --success-soft:   rgba(74,222,128,.12);
  --warning:        #fbbf24;
  --warning-soft:   rgba(251,191,36,.12);
  --danger:         #f87171;
  --danger-soft:    rgba(248,113,113,.13);
  --info:           #60a5fa;
  --info-soft:      rgba(96,165,250,.13);
  --neutral-soft:   rgba(255,255,255,.07);

  --shadow-sm:      0 1px 2px rgba(0,0,0,.4);
  --shadow-md:      0 8px 24px rgba(0,0,0,.45);
  --shadow-lg:      0 20px 60px rgba(0,0,0,.6);

  --bs-body-bg: var(--body-bg);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--text-muted);
  --bs-tertiary-color: var(--text-faint);
  --bs-secondary-bg: var(--surface-3);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--border);
  --bs-border-color-translucent: var(--border);
  --bs-primary: var(--accent);
  --bs-primary-rgb: var(--accent-rgb);
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: var(--accent-rgb);
  --bs-link-hover-color: var(--accent-dark);
  --bs-focus-ring-color: rgba(var(--accent-rgb), .25);
  color-scheme: dark;
}

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

body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  background: var(--body-bg);
  color: var(--text);
  font-size: 14px;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
}
code, kbd, .font-mono, input[type="password"], .link-code { font-family: ui-monospace, Consolas, monospace; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
::selection { background: rgba(var(--accent-rgb), .25); }
.text-muted { color: var(--text-muted) !important; }
.bg-light { background-color: var(--surface-2) !important; }
.bg-white { background-color: var(--surface) !important; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--border) !important; }
hr { border-color: var(--border); opacity: 1; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  background: var(--body-bg);
  background-image: radial-gradient(circle at 85% 10%, rgba(var(--accent-rgb), .12), transparent 45%),
                    radial-gradient(circle at 10% 90%, rgba(var(--accent-rgb), .08), transparent 40%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-container { width: 100%; max-width: 400px; padding: 1rem; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; overflow: hidden; box-shadow: var(--shadow-md);
}
.login-header { text-align: center; padding: 2.25rem 2rem 0; color: var(--text); }
.login-header h4, .login-header h3 { font-weight: 800; }
.login-header p, .login-header small { color: var(--text-muted); opacity: 1 !important; }
.login-logo {
  width: 56px; height: 56px; background: var(--accent); color: var(--on-accent);
  border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: .75rem;
}
.login-logo i { font-size: 24px !important; color: var(--on-accent) !important; }
.login-body-inner { padding: 1.75rem 2rem 2rem; }
.login-card .input-group-text { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }

/* ============================================================
   SIDEBAR (full height, right side, collapsible to icons)
   ============================================================ */
.crm-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 1045;
  display: flex; flex-direction: column;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}
.sidebar-brand {
  height: var(--topbar-height); flex-shrink: 0;
  display: flex; align-items: center; gap: .65rem; padding: 0 1.1rem;
  color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.05rem; white-space: nowrap;
}
.sidebar-brand:hover { color: var(--text); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0;
  background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800;
}
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .25rem .65rem 1rem; }
.sidebar-group { font-size: 11.5px; font-weight: 600; color: var(--text-faint); padding: 1rem .6rem .35rem; white-space: nowrap; }
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-item { margin: 1px 0; }
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .55rem .65rem; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; font-weight: 500; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.sidebar-link:hover { background: var(--surface-3); color: var(--text); }
.sidebar-item.active .sidebar-link { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.sidebar-icon { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.sidebar-footer {
  border-top: 1px solid var(--border); padding: .5rem .65rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  color: var(--text-faint); font-size: 12px; white-space: nowrap;
}
.sidebar-collapse-btn {
  border: none; background: transparent; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: var(--surface-3); color: var(--text); }

/* Collapsed (desktop): icons only, labels as tooltips via title */
html.sb-collapsed .crm-sidebar { width: var(--sidebar-mini); }
html.sb-collapsed .sidebar-link span,
html.sb-collapsed .sidebar-brand span,
html.sb-collapsed .sidebar-group,
html.sb-collapsed .sidebar-version { display: none; }
html.sb-collapsed .sidebar-group-sep { display: block; }
html.sb-collapsed .sidebar-link { justify-content: center; padding: .6rem 0; }
html.sb-collapsed .sidebar-brand { justify-content: center; padding: 0; }
html.sb-collapsed .sidebar-footer { justify-content: center; }
html.sb-collapsed .sidebar-collapse-btn i { transform: scaleX(-1); }
.sidebar-group-sep { display: none; height: 1px; background: var(--border); margin: .6rem .5rem; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10,14,13,.45); z-index: 1044;
}

/* ============================================================
   TOPBAR (inside the content column)
   ============================================================ */
.crm-wrapper {
  padding-right: var(--sidebar-width);
  min-height: 100vh;
  transition: padding var(--transition);
}
html.sb-collapsed .crm-wrapper { padding-right: var(--sidebar-mini); }

.crm-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-height);
  display: flex; align-items: center; gap: .6rem;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--body-bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { display: none; align-items: center; gap: .5rem; font-weight: 800; color: var(--text); text-decoration: none; }
.cmdk-trigger {
  display: flex; align-items: center; gap: .6rem;
  flex: 0 1 420px; height: 38px; padding: 0 .8rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-faint); font: inherit; text-align: right; cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.cmdk-trigger:hover { border-color: var(--border-strong); color: var(--text-muted); }
.cmdk-trigger .cmdk-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd, .kbd {
  font-family: ui-monospace, Consolas, monospace; font-size: 11px; direction: ltr;
  background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; box-shadow: none;
}
.topbar-actions { display: flex; align-items: center; gap: .35rem; margin-inline-start: auto; }
.topbar-btn {
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.topbar-btn:hover, .topbar-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.topbar-btn.btn-new { width: auto; padding: 0 .85rem; gap: .4rem; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.topbar-btn.btn-new:hover, .topbar-btn.btn-new[aria-expanded="true"] { background: var(--accent-dark); color: var(--on-accent); }
.topbar-user { width: auto; padding: 0 .35rem 0 .6rem; gap: .5rem; color: var(--text); font-weight: 600; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: 13px;
}
.avatar-lg { width: 56px; height: 56px; font-size: 22px; border-radius: 5px; }
.reminder-dot {
  position: absolute; top: 4px; left: 4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}

/* ============================================================
   MAIN
   ============================================================ */
.crm-main { padding: 1.5rem; max-width: 1400px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem;
}
.page-header h2 { margin: 0; font-size: 1.3rem; font-weight: 800; color: var(--text); }
.page-header h2 i { color: var(--text-faint); font-size: .9em; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  --bs-card-bg: var(--surface);
  --bs-card-border-color: var(--border);
  --bs-card-cap-bg: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: none; background: var(--surface);
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--border);
  font-weight: 700; padding: .8rem 1.1rem;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-header > span > i:first-child, .card-header > i:first-child { color: var(--text-faint) !important; }
.card-footer { background: transparent; border-top: 1px solid var(--border); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { border-radius: var(--radius-sm); font-weight: 600; }
.btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: var(--on-accent);
  --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark); --bs-btn-hover-color: var(--on-accent);
  --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark); --bs-btn-active-color: var(--on-accent);
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); --bs-btn-disabled-color: var(--on-accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-bg: var(--accent-soft); --bs-btn-hover-border-color: var(--accent); --bs-btn-hover-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-soft); --bs-btn-active-border-color: var(--accent); --bs-btn-active-color: var(--accent-dark);
}
.btn-outline-secondary, .btn-light {
  --bs-btn-color: var(--text); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-border-color: var(--border-strong); --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--surface-3); --bs-btn-active-border-color: var(--border-strong); --bs-btn-active-color: var(--text);
}
.btn-outline-danger { --bs-btn-color: var(--danger); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-bg: var(--danger); --bs-btn-hover-border-color: var(--danger); }
.btn-outline-success { --bs-btn-color: var(--success); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-bg: var(--success); --bs-btn-hover-border-color: var(--success); }
.btn-outline-info { --bs-btn-color: var(--info); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-bg: var(--info); --bs-btn-hover-border-color: var(--info); }
.btn-link { text-decoration: none; }
.btn-xs { padding: .1rem .45rem; font-size: 12px; }

/* ============================================================
   TABLES (dense, actions reveal on row hover)
   ============================================================ */
.table {
  --bs-table-bg: transparent; --bs-table-color: var(--text);
  --bs-table-border-color: var(--border); --bs-table-hover-bg: var(--surface-2);
  --bs-table-striped-bg: var(--surface-2); --bs-table-hover-color: var(--text);
  margin-bottom: 0;
}
.table > :not(caption) > * > * { padding: .6rem .85rem; }
.table thead th, .crm-table thead th {
  background: var(--surface-2); color: var(--text-muted);
  font-weight: 600; font-size: 12.5px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.crm-table tbody td { vertical-align: middle; border-color: var(--border); }
.crm-table tbody tr { transition: background var(--transition); }
.crm-table tbody tr:hover > * { background: var(--surface-2); }
.table-light { --bs-table-bg: var(--surface-2); --bs-table-color: var(--text-muted); --bs-table-border-color: var(--border); }
@media (hover: hover) and (min-width: 992px) {
  .crm-table tbody td:last-child .btn { opacity: .3; transition: opacity var(--transition); }
  .crm-table tbody tr:hover td:last-child .btn, .crm-table tbody td:last-child .btn:focus { opacity: 1; }
}
/* Sticky table headers on wide screens */
@media (min-width: 1200px) {
  .card .table-responsive { overflow-x: visible; }
  .card .table-responsive > .table > thead th { position: sticky; top: var(--topbar-height); z-index: 2; }
}

/* ============================================================
   BADGES (soft)
   ============================================================ */
.badge { font-weight: 600; padding: .35em .65em; border-radius: 4px; }
.bg-primary   { background-color: var(--accent-soft)  !important; color: var(--accent-dark) !important; }
.bg-success   { background-color: var(--success-soft) !important; color: var(--success) !important; }
.bg-warning   { background-color: var(--warning-soft) !important; color: var(--warning) !important; }
.bg-info      { background-color: var(--info-soft)    !important; color: var(--info) !important; }
.bg-danger    { background-color: var(--danger-soft)  !important; color: var(--danger) !important; }
.bg-secondary { background-color: var(--neutral-soft) !important; color: var(--text-muted) !important; }
.bg-dark      { background-color: var(--text) !important; color: var(--surface) !important; }
.reminder-dot.bg-danger, .badge.rounded-pill.bg-danger { background-color: var(--danger) !important; color: #fff !important; }
.text-primary { color: var(--accent)  !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger)  !important; }
.text-info    { color: var(--info)    !important; }
.text-warning { color: var(--warning) !important; }
.list-group-item-danger { --bs-list-group-bg: var(--danger-soft); --bs-list-group-color: var(--text); }

/* ============================================================
   STAT TILES
   ============================================================ */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1rem; text-decoration: none; color: var(--text); display: block;
  transition: border-color var(--transition);
}
a.stat:hover { border-color: var(--border-strong); color: var(--text); }
.stat-label { font-size: 12.5px; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; }
.stat-label i { color: var(--text-faint); }
.stat-value { font-size: 1.35rem; font-weight: 800; margin-top: .15rem; line-height: 1.5; white-space: nowrap; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.stat-sub { font-size: 12px; color: var(--text-faint); }
.stat.is-danger .stat-value { color: var(--danger); }
.stat.is-success .stat-value { color: var(--success); }

/* Legacy KPI classes */
.kpi-value { font-size: 1.6rem; font-weight: 800; }
.kpi-label { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   AGENDA (dashboard "today")
   ============================================================ */
.greeting h2 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.greeting .sub { color: var(--text-muted); font-size: 13px; }
.quick-add {
  display: flex; align-items: center; gap: .5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .35rem .4rem .35rem .35rem; transition: border-color var(--transition), box-shadow var(--transition);
}
.quick-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.quick-add > i { color: var(--text-faint); margin-inline-start: .6rem; }
.quick-add input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); font: inherit; padding: .4rem 0; min-width: 0; }
.quick-add input::placeholder { color: var(--text-faint); }
.quick-add .qa-when { border: none; background: var(--surface-3); color: var(--text-muted); border-radius: 4px; font: inherit; font-size: 12.5px; padding: .3rem .5rem; }

.agenda-section { padding: .25rem 0 .5rem; }
.agenda-head {
  display: flex; align-items: center; gap: .5rem; padding: .7rem 1.1rem .35rem;
  font-size: 12.5px; font-weight: 700; color: var(--text-muted);
}
.agenda-head .count { font-weight: 600; color: var(--text-faint); }
.agenda-head.is-danger { color: var(--danger); }
.agenda-item {
  display: flex; align-items: center; gap: .75rem; padding: .55rem 1.1rem;
  color: var(--text); text-decoration: none; border-radius: 0; position: relative;
}
.agenda-item:hover { background: var(--surface-2); color: var(--text); }
.agenda-kind {
  width: 30px; height: 30px; border-radius: 5px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.k-task    { background: var(--accent-soft);  color: var(--accent-dark); }
.k-event   { background: var(--info-soft);    color: var(--info); }
.k-install { background: var(--warning-soft); color: var(--warning); }
.k-late    { background: var(--danger-soft);  color: var(--danger); }
.agenda-main { flex: 1; min-width: 0; }
.agenda-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-meta a { color: inherit; }
.agenda-meta a:hover { color: var(--accent); }
.agenda-side { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; text-align: left; }
.agenda-side .money { color: var(--text); font-weight: 700; }
.agenda-check {
  width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--border-strong);
  background: transparent; flex-shrink: 0; padding: 0; color: transparent; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.agenda-check:hover { border-color: var(--accent); color: var(--accent); }
.agenda-item.done .agenda-check { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.agenda-item.done .agenda-title { text-decoration: line-through; color: var(--text-faint); }
.agenda-empty { padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); }
.agenda-empty i { font-size: 1.8rem; color: var(--accent); opacity: .7; margin-bottom: .5rem; display: block; }
.mini-list .agenda-item { padding: .5rem 1rem; }

.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; }

/* ============================================================
   TIMELINE (customer activity)
   ============================================================ */
.timeline { position: relative; padding: 0; }
.timeline::before { content: ''; position: absolute; right: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-item { display: flex; gap: .85rem; margin-bottom: 1rem; position: relative; }
.timeline-icon {
  width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; font-size: 13px;
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
  box-shadow: 0 0 0 4px var(--surface);
}
.timeline-icon.bg-primary, .timeline-icon.bg-success, .timeline-icon.bg-info,
.timeline-icon.bg-warning, .timeline-icon.bg-danger, .timeline-icon.bg-secondary { box-shadow: 0 0 0 4px var(--surface); }
.timeline-content {
  background: var(--surface-2); border-radius: var(--radius-sm); padding: .6rem .85rem;
  flex: 1; border: 1px solid var(--border); min-width: 0;
}
.timeline-date { font-size: 12px; color: var(--text-muted); margin-bottom: .2rem; }
.tl-filter .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: 12.5px; }
.tl-filter .btn.active { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent); }

/* Customer header */
.cust-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cust-head h2 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.cust-sub { color: var(--text-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: .25rem .9rem; align-items: center; }
.cust-sub a { color: inherit; text-decoration: none; }
.cust-sub a:hover { color: var(--accent); }
.info-list { margin: 0; }
.info-list dt { font-weight: 500; color: var(--text-muted); font-size: 12.5px; }
.info-list dd { margin-bottom: .65rem; }

/* ============================================================
   DROPDOWNS / REMINDERS
   ============================================================ */
.dropdown-menu {
  --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface-3);
  --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-link-active-bg: var(--accent-soft);
  --bs-dropdown-link-active-color: var(--accent-dark); --bs-dropdown-divider-bg: var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); padding: .35rem;
}
.dropdown-item { border-radius: 4px; padding: .45rem .7rem; }
.dropdown-item i { width: 18px; color: var(--text-faint); }
.dropdown-header { font-size: 12px; color: var(--text-faint); }
.reminder-item { padding: .6rem .85rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.reminder-item:hover { background: var(--surface-2); }
.reminder-item:last-child { border-bottom: none; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
  border-radius: var(--radius-sm); border-color: var(--border-strong);
  background-color: var(--surface); color: var(--text);
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus, .form-select:focus {
  border-color: var(--accent); background-color: var(--surface); color: var(--text);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15);
}
.form-control:disabled, .form-control[readonly]:not(.jdp-display) { background-color: var(--surface-2); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); border-color: var(--accent); }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-muted); }
.form-label { font-weight: 600; color: var(--text); margin-bottom: .3rem; font-size: 13px; }
.form-label.required::after { content: ' *'; color: var(--danger); }

/* Tabs */
.nav-tabs { border-bottom: 1px solid var(--border); padding: 0 .5rem; gap: .25rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs .nav-link {
  color: var(--text-muted); font-weight: 600; border: none; white-space: nowrap;
  border-bottom: 2px solid transparent; padding: .8rem .75rem; background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--text); border-color: transparent; }
.nav-tabs .nav-link.active { color: var(--accent-dark); background: transparent; border-bottom: 2px solid var(--accent); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--accent-soft); --bs-nav-pills-link-active-color: var(--accent-dark); }
.nav-link { color: var(--text-muted); }

/* Select2 */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 38px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.select2-container--default .select2-selection--single { height: 38px; display: flex; align-items: center; }
.select2-container--default .select2-selection--single .select2-selection__rendered { padding-right: 12px; padding-left: 30px; color: var(--text); }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection { border-color: var(--accent); }
.select2-dropdown { background: var(--surface); border-color: var(--border-strong); color: var(--text); z-index: 2100; }
.select2-container--default .select2-search--dropdown .select2-search__field { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--accent); color: var(--on-accent); }
.select2-container--default .select2-results__option--selected { background: var(--surface-3); }
.select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--surface-3); border-color: var(--border); color: var(--text); }

/* Modals */
.modal-content {
  --bs-modal-bg: var(--surface); --bs-modal-border-color: var(--border);
  border: 1px solid var(--border); border-radius: 5px; box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--border); }
.modal-header .modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-footer { border-top: 1px solid var(--border); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.modal-backdrop.show { opacity: .4; }

/* Pagination, list groups, alerts */
.pagination { --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-color: var(--text);
  --bs-pagination-hover-bg: var(--surface-3); --bs-pagination-hover-color: var(--text); --bs-pagination-hover-border-color: var(--border);
  --bs-pagination-active-bg: var(--accent); --bs-pagination-active-border-color: var(--accent); --bs-pagination-active-color: var(--on-accent);
  --bs-pagination-disabled-bg: var(--surface-2); --bs-pagination-disabled-border-color: var(--border); --bs-pagination-disabled-color: var(--text-faint);
  --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-color: var(--text); --bs-list-group-border-color: var(--border);
  --bs-list-group-action-hover-bg: var(--surface-2); --bs-list-group-action-hover-color: var(--text);
  --bs-list-group-action-color: var(--text); --bs-list-group-action-active-bg: var(--surface-3); }

/* Toastr / SweetAlert2 follow the theme */
#toast-container > div { font-family: inherit; border-radius: 4px; box-shadow: var(--shadow-md); opacity: 1; }
#toast-container > .toast-success { background-color: #15803d; }
#toast-container > .toast-error   { background-color: #c62828; }
#toast-container > .toast-info    { background-color: #0369a1; }
#toast-container > .toast-warning { background-color: #b45309; }
.swal2-popup { font-family: inherit !important; border-radius: 8px !important; background: var(--surface) !important; color: var(--text) !important; }
.swal2-title, .swal2-html-container { color: var(--text) !important; }
.swal2-styled.swal2-confirm { background: var(--accent) !important; color: var(--on-accent) !important; }
.swal2-input, .swal2-textarea, .swal2-select { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border-strong) !important; }

/* ============================================================
   FULLCALENDAR
   ============================================================ */
.fc { --fc-border-color: var(--border); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--surface-2);
      --fc-today-bg-color: rgba(var(--accent-rgb), .08); --fc-list-event-hover-bg-color: var(--surface-2); color: var(--text); }
.fc .fc-toolbar-title { font-size: 1.1rem !important; font-weight: 800; color: var(--text); }
.fc .fc-button { font-family: inherit !important; font-weight: 600; }
.fc .fc-button-primary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.fc .fc-button-primary:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fc .fc-button-primary:disabled { background: var(--surface-2); border-color: var(--border); color: var(--text-faint); }
.fc-daygrid-event { border-radius: 5px !important; padding: 1px 4px; }

/* ============================================================
   COMMAND PALETTE (Ctrl+K)
   ============================================================ */
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: 2050; background: rgba(10,14,13,.45);
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem;
}
.cmdk-backdrop.open { display: flex; }
.cmdk {
  width: 100%; max-width: 600px; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 5px; box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column; max-height: 70vh;
}
.cmdk-input-wrap { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.cmdk-input-wrap i { color: var(--text-faint); }
.cmdk-input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 15px; }
.cmdk-list { overflow-y: auto; padding: .35rem; }
.cmdk-group { font-size: 11.5px; font-weight: 600; color: var(--text-faint); padding: .6rem .7rem .25rem; }
.cmdk-item {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 5px;
  cursor: pointer; color: var(--text);
}
.cmdk-item i { width: 18px; text-align: center; color: var(--text-faint); }
.cmdk-item .cmdk-hint { margin-inline-start: auto; font-size: 12px; color: var(--text-faint); }
.cmdk-item.active { background: var(--accent-soft); color: var(--accent-dark); }
.cmdk-item.active i { color: var(--accent); }
.cmdk-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); }
.cmdk-foot { border-top: 1px solid var(--border); padding: .5rem 1rem; font-size: 12px; color: var(--text-faint); display: flex; gap: 1rem; }

/* ============================================================
   SKELETON LOADING + EMPTY STATES
   ============================================================ */
.sk { display: block; padding: .5rem 0; }
.sk i {
  display: block; height: 12px; border-radius: 4px; margin: .55rem 0;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
  background-size: 200% 100%; animation: sk-shimmer 1.3s infinite linear;
}
.sk i:nth-child(1) { width: 85%; }
.sk i:nth-child(2) { width: 65%; }
.sk i:nth-child(3) { width: 75%; }
.p-3 > .sk:only-child, td > .sk { padding: 0; }
@keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk i { animation: none; } }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty-state > i { font-size: 2rem; margin-bottom: .75rem; color: var(--text-faint); display: block; }

/* ============================================================
   MOBILE: off-canvas sidebar + bottom tab bar
   ============================================================ */
.bottom-nav { display: none; }
@media (max-width: 991.98px) {
  .crm-wrapper, html.sb-collapsed .crm-wrapper { padding-right: 0; padding-bottom: calc(var(--bottombar-height) + env(safe-area-inset-bottom)); }
  .crm-sidebar, html.sb-collapsed .crm-sidebar { width: 270px; transform: translateX(100%); }
  html.sb-collapsed .sidebar-link span, html.sb-collapsed .sidebar-brand span, html.sb-collapsed .sidebar-group { display: initial; }
  html.sb-collapsed .sidebar-link { justify-content: flex-start; padding: .55rem .65rem; }
  .crm-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.open { display: block; }
  .sidebar-collapse-btn { display: none; }
  .crm-topbar { padding: 0 1rem; }
  .topbar-brand { display: flex; }
  .cmdk-trigger { flex: 0 0 auto; width: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .cmdk-trigger .cmdk-label, .cmdk-trigger kbd { display: none; }
  .topbar-btn.btn-new, .topbar-user .user-name { display: none; }
  .crm-main { padding: 1rem; }
  .page-header h2 { font-size: 1.15rem; }

  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040;
    height: calc(var(--bottombar-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .bottom-nav > a, .bottom-nav > button, .bottom-nav .dropup > button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 600;
    border: none; background: transparent; padding: 0; width: 100%; height: 100%;
  }
  .bottom-nav .dropup { flex: 1; display: flex; }
  .bottom-nav i { font-size: 18px; }
  .bottom-nav .active { color: var(--accent); }
  .bottom-nav .bn-add i {
    width: 42px; height: 42px; border-radius: 5px; background: var(--accent); color: var(--on-accent);
    display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
  }
  .bottom-nav .dropdown-menu { margin-bottom: .5rem !important; min-width: 220px; }
  #toast-container.toast-top-left { top: 70px; }
}

/* ============================================================
   SCROLLBAR + UTILITIES
   ============================================================ */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid var(--body-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
.text-nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }

/* ============================================================
   v1.1 additions
   ============================================================ */

/* ----- Jalali date picker ----- */
.jdp-display { text-align: right; cursor: pointer; background-color: var(--surface); }
.jdp-display[readonly] { background-color: var(--surface); }
.jdp-popup {
  position: fixed; z-index: 2000; display: none; width: 284px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem; font-size: 14px; user-select: none;
}
.jdp-head { display: flex; align-items: center; justify-content: space-between; gap: .35rem; margin-bottom: .4rem; }
.jdp-title { display: flex; gap: .3rem; flex: 1; justify-content: center; }
.jdp-title select, .jdp-title input {
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; font: inherit; font-weight: 600;
  background: var(--surface-2); color: var(--text);
}
.jdp-title input { width: 72px; text-align: center; }
.jdp-nav {
  border: none; background: var(--accent-soft); color: var(--accent-dark); width: 30px; height: 30px;
  border-radius: 5px; font-size: 20px; line-height: 1; font-weight: 700;
}
.jdp-nav:hover { background: var(--accent); color: var(--on-accent); }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-wd { font-size: 12px; color: var(--text-muted); padding: 4px 0; font-weight: 600; }
.jdp-day {
  border: none; background: transparent; border-radius: 5px; height: 34px; font: inherit; color: var(--text);
}
.jdp-day:hover { background: var(--accent-soft); }
.jdp-fri { color: var(--danger); }
.jdp-today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.jdp-sel, .jdp-sel:hover { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.jdp-time {
  display: flex; align-items: center; justify-content: center; gap: .35rem; direction: ltr;
  margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--border);
}
.jdp-time span { direction: rtl; color: var(--text-muted); font-size: 13px; margin-left: .3rem; }
.jdp-time select { border: 1px solid var(--border); border-radius: 5px; padding: 2px 4px; font: inherit; }
.jdp-foot { display: flex; justify-content: space-between; margin-top: .35rem; }
.jdp-foot .btn-link { text-decoration: none; font-weight: 600; padding: 2px 6px; }

/* Jalali month view on the calendar page */
.fc .fc-daygrid-day-number { text-decoration: none; color: var(--text); display: flex; align-items: baseline; gap: 6px; padding: 4px 6px; }
.fc .fc-col-header-cell-cushion { text-decoration: none; color: var(--text-muted); font-weight: 600; }
.fc-jday { font-size: 15px; font-weight: 700; }
.fc-gday { font-size: 10px; color: var(--text-muted); font-weight: 400; }
.fc .fc-day-other-jmonth { background: var(--surface-2); }
.fc .fc-day-other-jmonth .fc-jday { color: var(--text-faint); font-weight: 500; }

/* ----- Tags & source ----- */
.tag-badge {
  display: inline-block; padding: .2em .6em; border-radius: 4px; font-size: 12px; font-weight: 600;
  color: #fff; margin: 1px 0 1px 3px; line-height: 1.5; white-space: nowrap;
}
.source-chip {
  display: inline-block; padding: .15em .55em; border-radius: 4px; font-size: 12px;
  background: var(--accent-soft); color: var(--accent-dark); white-space: nowrap;
}

/* ----- Invoices ----- */
.items-table td, .items-table th { vertical-align: middle; }
.items-table input { min-width: 70px; }
.items-table .col-desc { min-width: 220px; }
.money { direction: ltr; unicode-bidi: plaintext; font-feature-settings: "tnum"; white-space: nowrap; }
.invoice-totals { max-width: 380px; margin-inline-start: auto; }
.invoice-totals .row-total { font-size: 1.15rem; font-weight: 800; border-top: 2px solid var(--border); padding-top: .4rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 4px; }
.installment-paid td { color: var(--text-muted); }
.installment-overdue td:first-child { box-shadow: inset -3px 0 0 var(--danger); }

/* ----- Settings / profile ----- */
.settings-nav .nav-link { border-radius: var(--radius-sm); color: var(--text); font-weight: 600; text-align: right; }
.settings-nav .nav-link.active { background: var(--accent-soft); color: var(--accent-dark); }
.settings-nav .nav-link i { width: 22px; }
.bot-status { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; font-weight: 600; }
.bot-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.bot-status.ok .dot { background: var(--success); }
.bot-status.warn .dot { background: var(--warning); }
.link-code { font-size: 1.6rem; font-weight: 800; letter-spacing: .25em; direction: ltr; font-family: monospace; }
.logo-preview { max-height: 72px; max-width: 220px; border: 1px dashed var(--border); border-radius: 5px; padding: 4px; }

/* ----- Printable invoice sheet (A4) ----- */
.invoice-paper {
  background: #fff; color: #111; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 28px 30px; font-size: 13px; line-height: 1.8;
  max-width: 820px; margin: 0 auto;
}
.ip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
           border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 14px; }
.ip-brand { display: flex; align-items: center; gap: 12px; }
.ip-logo { max-height: 64px; max-width: 150px; object-fit: contain; }
.ip-biz-name { font-size: 18px; font-weight: 800; }
.ip-biz-sub { color: #555; font-size: 12px; }
.ip-title { text-align: left; }
.ip-doc { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.ip-meta td { padding: 0 4px; font-size: 12.5px; }
.ip-meta td:first-child { color: #555; }
.ip-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ip-party { border: 1px solid #ccc; border-radius: 5px; padding: 8px 12px; font-size: 12.5px; }
.ip-party-title { font-weight: 800; font-size: 12px; color: #555; margin-bottom: 2px; }
.ip-items { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.ip-items th { background: #f1f3f6; font-weight: 700; font-size: 12px; }
.ip-items th, .ip-items td { border: 1px solid #c8ccd2; padding: 5px 8px; }
.ip-items td.c, .ip-items th { text-align: center; }
.ip-items td.n { text-align: left; direction: ltr; font-feature-settings: "tnum"; white-space: nowrap; }
.ip-items td.l { text-align: left; font-weight: 600; }
.ip-items tfoot td { background: #fafbfc; }
.ip-items .ip-grand td { font-weight: 800; font-size: 14px; background: #eef0f4; }
.ip-words { font-weight: 600; margin-bottom: 12px; }
.ip-section-title { font-weight: 800; margin: 10px 0 4px; }
.ip-inst th, .ip-inst td { font-size: 12px; }
.ip-notes { border: 1px dashed #bbb; border-radius: 5px; padding: 8px 12px; margin: 10px 0; font-size: 12.5px; }
.ip-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 26px; text-align: center; }
.ip-sign div { border-top: 1px solid #999; padding-top: 6px; min-height: 70px; color: #555; font-size: 12px; }
.ip-footer { margin-top: 14px; padding-top: 8px; border-top: 1px solid #ddd; text-align: center; color: #555; font-size: 11.5px; }

/* html2pdf renders the sheet without the card look */
.invoice-paper.pdf-mode { border: none; box-shadow: none; border-radius: 0; max-width: none; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .crm-topbar, .crm-sidebar, .sidebar-overlay, .no-print, .toast-top-left { display: none !important; }
  .crm-main { margin: 0 !important; padding: 0 !important; }
  .crm-wrapper { display: block !important; padding: 0 !important; }
  .row > [class*="col-"] { width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; }
  .invoice-paper { border: none; box-shadow: none; padding: 0; max-width: none; }
}

/* ----- v1.2 additions to the v1.1 parts ----- */
.jdp-popup { box-shadow: var(--shadow-md); }
.invoice-paper { border-color: #e3e6e1; }
@media print {
  .bottom-nav, .cmdk-backdrop { display: none !important; }
  .crm-wrapper, html.sb-collapsed .crm-wrapper { padding: 0 !important; }
}
.badge.bg-light, .bg-light.text-dark { background-color: var(--surface-3) !important; color: var(--text) !important; }
.text-dark { color: var(--text) !important; }
#toast-container.toast-top-left { top: calc(var(--topbar-height) + 10px); }
.card-header a { text-decoration: none; }
.agenda-kind.k-check { background: transparent; }
.agenda-kind.k-check .agenda-check { width: 22px; height: 22px; }
@media (max-width: 575.98px) {
  .stat-strip { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .stat { padding: .7rem .75rem; }
  .stat-value { font-size: 1.05rem; white-space: normal; }
  .stat-value small { display: block; font-size: 11px; line-height: 1.2; }
  .stat-sub { font-size: 11px; }
  .agenda-item { padding: .55rem .85rem; gap: .6rem; }
  .agenda-head { padding-inline: .85rem; }
}
@media (max-width: 575.98px) {
  .cust-head { flex-wrap: nowrap; gap: .65rem; align-items: flex-start; }
  .cust-head .avatar-lg { width: 44px; height: 44px; font-size: 18px; border-radius: 4px; }
  .cust-head h2 { font-size: 1.1rem; }
}
