/*
 * Dashtrans CRM Premium UI Kit
 * Designed as a non-destructive premium layer over Dashtrans Bootstrap 5.
 * Components are prefixed with crm- to avoid collisions with the original template.
 */
:root {
  --crm-bg: #08131f;
  --crm-surface: rgba(255,255,255,.085);
  --crm-surface-strong: rgba(255,255,255,.13);
  --crm-surface-soft: rgba(6,16,25,.22);
  --crm-line: rgba(255,255,255,.13);
  --crm-line-strong: rgba(255,255,255,.19);
  --crm-text: #f8fbff;
  --crm-muted: rgba(244,249,255,.60);
  --crm-subtle: rgba(244,249,255,.42);
  --crm-blue: #5b9cff;
  --crm-cyan: #58d8ff;
  --crm-violet: #8178ff;
  --crm-success: #62dcba;
  --crm-warning: #ffc766;
  --crm-danger: #ff768a;
  --crm-radius: 18px;
  --crm-radius-sm: 12px;
  --crm-shadow: 0 18px 50px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.08);
  --crm-fast: .18s;
  --crm-normal: .32s;
}

html { scroll-behavior: smooth; }
body.crm-app { color: var(--crm-text); }
body.crm-app .switcher-wrapper { display: none !important; }
body.crm-app .page-wrapper { min-height: calc(100vh - 60px); }
body.crm-app .page-content { padding-bottom: 84px; }
body.crm-app .page-footer { background: rgba(7,17,27,.42); border-top-color: rgba(255,255,255,.08); }
/* Important: do not apply filters/transforms to .sidebar-wrapper.
   Dashtrans keeps .sidebar-header fixed inside it; a filter creates a new containing block
   and shifts the fixed header down by the wrapper's 60px top offset. */
body.crm-app .sidebar-header,
body.crm-app .topbar { backdrop-filter: blur(18px) saturate(120%); -webkit-backdrop-filter: blur(18px) saturate(120%); }
body.crm-app .sidebar-wrapper { background: rgba(6,15,24,.33); }
body.crm-app .sidebar-header { background: rgba(6,15,24,.38); top: 0; }
body.crm-app .topbar { background: rgba(6,15,24,.24); }
body.crm-app .topbar.bg-dark { background: rgba(6,15,24,.78) !important; }
body.crm-app .metismenu a { border-radius: 10px; margin: 2px 8px; }
body.crm-app .metismenu .mm-active > a,
body.crm-app .metismenu a:hover { background: rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
body.crm-app .menu-label { color: rgba(255,255,255,.34); letter-spacing: .11em; font-size: 10px; }

/* Generic glass surfaces */
.crm-surface,
.crm-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--crm-line);
  border-radius: var(--crm-radius);
  background: linear-gradient(145deg, rgba(255,255,255,.115), rgba(255,255,255,.052));
  box-shadow: var(--crm-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.crm-card::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -85px;
  top: -100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,156,255,.13), transparent 68%);
  pointer-events: none;
}
.crm-card-head { padding: 20px 20px 0; position: relative; z-index: 1; }
.crm-card-body { padding: 20px; position: relative; z-index: 1; }
.crm-card-title { margin: 0; font-size: 15px; font-weight: 500; color: var(--crm-text); }
.crm-card-copy { margin: 5px 0 0; font-size: 11px; line-height: 1.55; color: var(--crm-muted); }

/* Page header */
.crm-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.crm-page-breadcrumb { margin: 0 0 6px; color: var(--crm-subtle); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.crm-page-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.crm-page-title { margin: 0; color: var(--crm-text); font-size: clamp(23px, 3vw, 31px); font-weight: 500; letter-spacing: -.025em; }
.crm-page-subtitle { margin: 7px 0 0; max-width: 720px; color: var(--crm-muted); font-size: 12px; line-height: 1.6; }
.crm-page-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 10px; color: var(--crm-subtle); font-size: 10px; }
.crm-page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* Buttons */
.crm-btn {
  appearance: none;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  padding: 8px 13px;
  color: rgba(255,255,255,.92);
  background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.065));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 8px 18px rgba(0,0,0,.07);
  font: 500 12px/1.2 Roboto, Arial, sans-serif;
  transition: transform var(--crm-fast) ease, background var(--crm-fast) ease, border-color var(--crm-fast) ease, box-shadow var(--crm-fast) ease;
  cursor: pointer;
}
.crm-btn:hover { color: white; background: linear-gradient(145deg, rgba(255,255,255,.19), rgba(255,255,255,.085)); transform: translateY(-1px); border-color: rgba(255,255,255,.23); }
.crm-btn:active { transform: translateY(0); }
.crm-btn:focus-visible { outline: 2px solid rgba(88,216,255,.8); outline-offset: 2px; }
.crm-btn-primary { color: #fff; background: linear-gradient(135deg, #55c8ff, #5d82ff 62%, #786fff); border-color: rgba(255,255,255,.25); box-shadow: 0 9px 24px rgba(71,125,255,.24), inset 0 1px 0 rgba(255,255,255,.28); }
.crm-btn-primary:hover { background: linear-gradient(135deg, #6ad0ff, #6f90ff 62%, #897eff); box-shadow: 0 12px 28px rgba(71,125,255,.3), inset 0 1px 0 rgba(255,255,255,.3); }
.crm-btn-danger { color: #fff; background: linear-gradient(135deg, #ff8797, #ed627a); border-color: rgba(255,255,255,.22); box-shadow: 0 9px 24px rgba(237,98,122,.18), inset 0 1px 0 rgba(255,255,255,.22); }
.crm-btn-ghost { background: rgba(5,14,23,.12); }
.crm-btn-sm { min-height: 32px; padding: 6px 10px; border-radius: 9px; font-size: 11px; }
.crm-icon-btn { width: 36px; height: 36px; padding: 0; flex: 0 0 36px; border-radius: 11px; }
.crm-icon-btn i { font-size: 18px; }

/* Status pills */
.crm-status { --status:#aab6c4; display: inline-flex; align-items: center; gap: 7px; min-height: 25px; padding: 4px 9px; border: 1px solid color-mix(in srgb, var(--status) 28%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--status) 10%, rgba(6,15,24,.2)); color: color-mix(in srgb, var(--status) 82%, white); font-size: 10px; font-weight: 500; white-space: nowrap; }
.crm-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 6px; background: var(--status); box-shadow: 0 0 0 3px color-mix(in srgb, var(--status) 12%, transparent), 0 0 10px color-mix(in srgb, var(--status) 34%, transparent); }
.crm-status-success { --status: var(--crm-success); }
.crm-status-warning { --status: var(--crm-warning); }
.crm-status-danger { --status: var(--crm-danger); }
.crm-status-info { --status: var(--crm-cyan); }
.crm-status-violet { --status: #9e91ff; }
.crm-status-neutral { --status: #aab6c4; }
.crm-status.is-muted::before { box-shadow: none; opacity: .7; }

/* KPI cards */
.crm-kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.crm-kpi { min-height: 132px; padding: 17px; }
.crm-kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.crm-kpi-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: rgba(255,255,255,.88); font-size: 18px; }
.crm-kpi-label { margin-top: 13px; color: var(--crm-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.crm-kpi-value { margin-top: 4px; color: #fff; font-size: clamp(20px,2vw,27px); line-height: 1.15; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.crm-kpi-foot { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--crm-subtle); font-size: 10px; }
.crm-trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.crm-trend-up { color: #7fe5ca; }
.crm-trend-down { color: #ff91a1; }
.crm-sparkline { width: 64px; height: 23px; opacity: .82; }

/* Progress */
.crm-progress { --crm-p1: var(--crm-cyan); --crm-p2: var(--crm-blue); margin-bottom: 20px; }
.crm-progress:last-child { margin-bottom: 0; }
.crm-progress[data-tone="success"] { --crm-p1: #75e7c8; --crm-p2: #3acfa8; }
.crm-progress[data-tone="warning"] { --crm-p1: #ffe08b; --crm-p2: #ffb44f; }
.crm-progress[data-tone="danger"] { --crm-p1: #ff9aa9; --crm-p2: #ff617c; }
.crm-progress[data-tone="violet"] { --crm-p1: #9b8cff; --crm-p2: #6f73ff; }
.crm-progress-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.crm-progress-meta { min-width: 0; flex: 1; }
.crm-progress-label { color: rgba(255,255,255,.94); font-size: 12px; font-weight: 500; }
.crm-progress-note { margin-top: 3px; color: rgba(255,255,255,.48); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-progress-value { flex: none; min-width: 46px; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); background: rgba(7,17,26,.25); color: rgba(255,255,255,.9); text-align: center; font-size: 10px; font-variant-numeric: tabular-nums; }
.crm-progress-track { position: relative; height: 10px; overflow: hidden; border-radius: 999px; border: 1px solid rgba(255,255,255,.09); background: rgba(5,13,20,.28); box-shadow: inset 0 1px 4px rgba(0,0,0,.26), 0 1px 0 rgba(255,255,255,.045); }
.crm-progress-track::after { content: ""; position: absolute; inset: 1px; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,.045), transparent 70%); pointer-events: none; }
.crm-progress-fill { --value:0%; position: absolute; inset: 1px auto 1px 1px; width: calc(var(--value) - 2px); min-width: 5px; max-width: calc(100% - 2px); border-radius: inherit; background: linear-gradient(90deg,var(--crm-p1),var(--crm-p2)); box-shadow: 0 0 16px color-mix(in srgb,var(--crm-p2) 48%,transparent); transition: width .55s cubic-bezier(.22,.75,.2,1); }
.crm-progress-fill::before { content:""; position:absolute; inset:0; border-radius:inherit; background:linear-gradient(180deg,rgba(255,255,255,.34),rgba(255,255,255,0) 65%); }
.crm-progress-fill::after { content:""; position:absolute; top:50%; right:1px; width:7px; height:7px; transform:translateY(-50%); border-radius:50%; background:rgba(255,255,255,.92); box-shadow:0 0 0 3px rgba(255,255,255,.11),0 0 12px rgba(255,255,255,.58); }
.crm-progress.is-indeterminate .crm-progress-fill { width:34%; animation:crm-indeterminate 1.45s cubic-bezier(.55,.1,.45,.9) infinite; }
.crm-progress-sm .crm-progress-track { height:7px; }
.crm-progress-sm .crm-progress-fill::after { width:5px; height:5px; }

/* Financial progress */
.crm-financial-progress { display:grid; grid-template-columns:44px 1fr auto; gap:12px; align-items:center; padding:13px 0; border-bottom:1px solid rgba(255,255,255,.075); }
.crm-financial-progress:first-child { padding-top:0; }
.crm-financial-progress:last-child { border-bottom:0; padding-bottom:0; }
.crm-financial-icon { width:40px; height:40px; border-radius:12px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.06); font-size:18px; }
.crm-financial-title { font-size:12px; font-weight:500; margin-bottom:6px; }
.crm-financial-side { text-align:end; }
.crm-financial-amount { font-size:12px; font-weight:500; font-variant-numeric:tabular-nums; }
.crm-financial-caption { margin-top:2px; font-size:9px; color:var(--crm-subtle); }

/* Invoice workflow */
.crm-workflow { display:grid; grid-template-columns:repeat(4,1fr); position:relative; padding-top:5px; }
.crm-workflow::before { content:""; position:absolute; left:8%; right:8%; top:21px; height:2px; background:rgba(255,255,255,.11); border-radius:999px; }
.crm-workflow-line { position:absolute; left:8%; top:21px; width:var(--workflow,0%); max-width:84%; height:2px; border-radius:999px; background:linear-gradient(90deg,var(--crm-cyan),var(--crm-blue),var(--crm-violet)); box-shadow:0 0 12px rgba(91,156,255,.34); transition:width .45s ease; }
.crm-step { position:relative; z-index:1; text-align:center; }
.crm-step-dot { width:34px; height:34px; margin:0 auto 8px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.13); border-radius:12px; background:rgba(9,20,30,.54); color:rgba(255,255,255,.44); box-shadow:inset 0 1px 0 rgba(255,255,255,.05); font-size:16px; }
.crm-step.is-done .crm-step-dot { color:#061a18; background:var(--crm-success); border-color:rgba(255,255,255,.3); box-shadow:0 0 20px rgba(98,220,186,.2); }
.crm-step.is-active .crm-step-dot { color:white; background:linear-gradient(145deg,var(--crm-cyan),var(--crm-blue)); border-color:rgba(255,255,255,.42); box-shadow:0 0 0 5px rgba(91,156,255,.08),0 0 24px rgba(91,156,255,.28); }
.crm-step-label { font-size:10px; color:rgba(255,255,255,.48); }
.crm-step.is-active .crm-step-label,.crm-step.is-done .crm-step-label { color:rgba(255,255,255,.9); }
.crm-step-date { margin-top:2px; font-size:8px; color:rgba(255,255,255,.34); }

/* Table / DataTables premium layer */
.crm-table-shell { overflow:hidden; }
.crm-table-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; padding:15px 16px; border-bottom:1px solid rgba(255,255,255,.085); }
.crm-table-tools { display:flex; flex:1; min-width:260px; flex-wrap:wrap; align-items:center; gap:8px; }
.crm-search { position:relative; min-width:240px; flex:1 1 280px; }
.crm-search i { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:rgba(255,255,255,.42); font-size:17px; pointer-events:none; }
.crm-search input { width:100%; height:38px; border:1px solid rgba(255,255,255,.12); border-radius:11px; background:rgba(5,14,23,.20); color:white; padding:8px 12px 8px 37px; font-size:11px; outline:0; transition:border var(--crm-fast),box-shadow var(--crm-fast),background var(--crm-fast); }
.crm-search input::placeholder { color:rgba(255,255,255,.34); }
.crm-search input:focus { border-color:rgba(88,216,255,.45); background:rgba(5,14,23,.28); box-shadow:0 0 0 3px rgba(88,216,255,.08); }
.crm-filter-btn { min-height:38px; padding:7px 10px; border:1px solid rgba(255,255,255,.12); border-radius:11px; background:rgba(5,14,23,.16); color:rgba(255,255,255,.78); font-size:10px; }
.crm-active-filters { display:flex; flex-wrap:wrap; gap:6px; padding:0 16px 13px; }
.crm-filter-chip { display:inline-flex; align-items:center; gap:6px; padding:5px 8px; border:1px solid rgba(88,216,255,.18); border-radius:999px; background:rgba(88,216,255,.07); color:rgba(221,248,255,.84); font-size:9px; }
.crm-table-responsive { overflow-x:auto; }
.crm-table { width:100%; min-width:820px; border-collapse:separate; border-spacing:0; color:rgba(255,255,255,.84); }
.crm-table thead th { padding:11px 14px; border-bottom:1px solid rgba(255,255,255,.10); color:rgba(255,255,255,.42); font-size:9px; font-weight:500; text-transform:uppercase; letter-spacing:.08em; white-space:nowrap; }
.crm-table tbody td { padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.065); font-size:11px; vertical-align:middle; }
.crm-table tbody tr { transition:background var(--crm-fast); }
.crm-table tbody tr:hover { background:rgba(255,255,255,.045); }
.crm-table tbody tr:last-child td { border-bottom:0; }
.crm-table-number { color:white; font-weight:500; }
.crm-table-sub { display:block; margin-top:2px; color:var(--crm-subtle); font-size:9px; }
.crm-money { font-variant-numeric:tabular-nums; white-space:nowrap; text-align:end; }
.crm-table-actions { display:flex; justify-content:flex-end; gap:5px; }
.crm-table-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-top:1px solid rgba(255,255,255,.075); color:var(--crm-subtle); font-size:9px; }
.crm-pagination { display:flex; gap:5px; }
.crm-page-btn { width:30px; height:30px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.10); border-radius:9px; color:rgba(255,255,255,.62); background:rgba(5,14,23,.14); }
.crm-page-btn.is-active { color:white; border-color:rgba(88,216,255,.30); background:linear-gradient(135deg,rgba(88,216,255,.18),rgba(91,156,255,.22)); box-shadow:0 0 18px rgba(91,156,255,.08); }

/* Skeletons */
.crm-skeleton { position:relative; overflow:hidden; border-radius:8px; background:rgba(255,255,255,.075); }
.crm-skeleton::after { content:""; position:absolute; inset:0; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.10),transparent); animation:crm-shimmer 1.45s ease-in-out infinite; }
.crm-skeleton-line { height:9px; margin:7px 0; }
.crm-skeleton-circle { width:38px; height:38px; border-radius:50%; }
.crm-skeleton-row { display:grid; grid-template-columns:42px 1.3fr 1fr .8fr 90px; gap:12px; align-items:center; padding:12px 15px; border-bottom:1px solid rgba(255,255,255,.055); }

/* Forms */
.crm-form-label { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; color:rgba(255,255,255,.68); font-size:10px; font-weight:500; }
.crm-required { color:#ff9aaa; }
.crm-input,.crm-select,.crm-textarea { width:100%; min-height:40px; border:1px solid rgba(255,255,255,.12); border-radius:11px; background:rgba(5,14,23,.20); color:rgba(255,255,255,.92); padding:9px 11px; font:400 11px/1.4 Roboto,Arial,sans-serif; outline:0; box-shadow:inset 0 1px 0 rgba(255,255,255,.035); transition:border var(--crm-fast),background var(--crm-fast),box-shadow var(--crm-fast); }
.crm-input::placeholder,.crm-textarea::placeholder { color:rgba(255,255,255,.31); }
.crm-input:focus,.crm-select:focus,.crm-textarea:focus { border-color:rgba(88,216,255,.43); background:rgba(5,14,23,.29); box-shadow:0 0 0 3px rgba(88,216,255,.075); }
.crm-textarea { min-height:90px; resize:vertical; }
.crm-field-help { margin-top:5px; color:var(--crm-subtle); font-size:9px; line-height:1.45; }
.crm-input-group { display:flex; align-items:stretch; }
.crm-input-group .crm-input { border-radius:11px 0 0 11px; }
.crm-input-addon { min-width:58px; display:grid; place-items:center; padding:0 10px; border:1px solid rgba(255,255,255,.12); border-left:0; border-radius:0 11px 11px 0; background:rgba(255,255,255,.065); color:rgba(255,255,255,.65); font-size:10px; }
.crm-money-input { text-align:end; font-variant-numeric:tabular-nums; }
.crm-field-error .crm-input { border-color:rgba(255,118,138,.48); box-shadow:0 0 0 3px rgba(255,118,138,.07); }
.crm-field-error .crm-field-help { color:#ff9aaa; }

/* Autocomplete / select */
.crm-autocomplete { position:relative; }
.crm-autocomplete-menu { position:absolute; z-index:1000; left:0; right:0; top:calc(100% + 6px); max-height:260px; overflow:auto; border:1px solid rgba(255,255,255,.14); border-radius:13px; background:rgba(10,22,34,.96); box-shadow:0 18px 48px rgba(0,0,0,.32),inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter:blur(18px); display:none; }
.crm-autocomplete.is-open .crm-autocomplete-menu { display:block; animation:crm-pop .16s ease-out; }
.crm-autocomplete-item { display:flex; align-items:center; gap:10px; padding:10px 11px; border-bottom:1px solid rgba(255,255,255,.06); cursor:pointer; }
.crm-autocomplete-item:last-child { border-bottom:0; }
.crm-autocomplete-item:hover,.crm-autocomplete-item.is-active { background:rgba(255,255,255,.06); }
.crm-client-avatar { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; background:linear-gradient(145deg,rgba(88,216,255,.20),rgba(91,156,255,.20)); border:1px solid rgba(88,216,255,.16); color:white; font-size:10px; }
.crm-autocomplete-name { color:white; font-size:11px; font-weight:500; }
.crm-autocomplete-meta { margin-top:2px; color:var(--crm-subtle); font-size:9px; }

/* Repeater / invoice line editor */
.crm-repeater { display:flex; flex-direction:column; gap:10px; }
.crm-line-item { border:1px solid rgba(255,255,255,.10); border-radius:14px; background:rgba(5,14,23,.12); padding:12px; transition:border var(--crm-fast),background var(--crm-fast),transform var(--crm-fast); }
.crm-line-item:hover { border-color:rgba(255,255,255,.15); background:rgba(5,14,23,.18); }
.crm-line-item.is-dragging { opacity:.55; transform:scale(.995); }
.crm-line-top { display:grid; grid-template-columns:28px 1fr auto; gap:9px; align-items:center; margin-bottom:10px; }
.crm-drag-handle { width:28px; height:30px; display:grid; place-items:center; color:rgba(255,255,255,.32); cursor:grab; }
.crm-line-description { min-width:0; }
.crm-line-grid { display:grid; grid-template-columns:1fr .8fr 1.1fr .8fr 1fr; gap:8px; align-items:end; }
.crm-line-total { min-height:40px; display:flex; align-items:center; justify-content:flex-end; padding:0 10px; border:1px solid rgba(255,255,255,.08); border-radius:11px; background:rgba(255,255,255,.035); color:white; font-size:11px; font-weight:500; font-variant-numeric:tabular-nums; }
.crm-line-menu { display:flex; gap:5px; }
.crm-add-line { width:100%; min-height:42px; margin-top:2px; border:1px dashed rgba(88,216,255,.26); border-radius:12px; color:rgba(215,246,255,.76); background:rgba(88,216,255,.045); transition:background var(--crm-fast),border var(--crm-fast); }
.crm-add-line:hover { background:rgba(88,216,255,.085); border-color:rgba(88,216,255,.38); }

/* Invoice layout */
.crm-invoice-layout { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:16px; align-items:start; }
.crm-invoice-summary { position:sticky; top:78px; }
.crm-summary-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; color:var(--crm-muted); font-size:11px; border-bottom:1px solid rgba(255,255,255,.055); }
.crm-summary-row:last-child { border-bottom:0; }
.crm-summary-row strong { color:white; font-weight:500; font-variant-numeric:tabular-nums; }
.crm-summary-total { margin-top:4px; padding-top:13px; font-size:14px; }
.crm-summary-total strong { font-size:19px; }
.crm-save-state { display:inline-flex; align-items:center; gap:6px; color:var(--crm-muted); font-size:9px; }
.crm-save-state::before { content:""; width:6px; height:6px; border-radius:50%; background:var(--crm-success); box-shadow:0 0 10px rgba(98,220,186,.35); }
.crm-save-state.is-saving::before { background:var(--crm-warning); animation:crm-pulse .95s infinite; }

/* Tabs */
.crm-tabs { display:flex; flex-wrap:wrap; gap:4px; padding:4px; border:1px solid rgba(255,255,255,.10); border-radius:12px; background:rgba(5,14,23,.14); }
.crm-tab { min-height:32px; display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border:0; border-radius:9px; color:rgba(255,255,255,.50); background:transparent; font-size:10px; }
.crm-tab:hover { color:rgba(255,255,255,.78); background:rgba(255,255,255,.04); }
.crm-tab.is-active { color:white; background:rgba(255,255,255,.10); box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 6px 15px rgba(0,0,0,.07); }
.crm-tab-count { min-width:18px; height:18px; display:grid; place-items:center; border-radius:999px; background:rgba(255,255,255,.09); font-size:8px; }
.crm-tab-panel { display:none; }
.crm-tab-panel.is-active { display:block; animation:crm-fade .2s ease-out; }

/* Timeline */
.crm-timeline { position:relative; padding-left:25px; }
.crm-timeline::before { content:""; position:absolute; left:7px; top:7px; bottom:8px; width:1px; background:linear-gradient(rgba(88,216,255,.28),rgba(255,255,255,.06)); }
.crm-timeline-item { position:relative; padding:0 0 18px 8px; }
.crm-timeline-item:last-child { padding-bottom:0; }
.crm-timeline-dot { position:absolute; left:-24px; top:3px; width:12px; height:12px; border:3px solid rgba(7,17,27,.96); border-radius:50%; background:var(--crm-blue); box-shadow:0 0 0 1px rgba(91,156,255,.25),0 0 12px rgba(91,156,255,.28); }
.crm-timeline-item.is-done .crm-timeline-dot { background:var(--crm-success); }
.crm-timeline-title { color:rgba(255,255,255,.9); font-size:11px; font-weight:500; }
.crm-timeline-meta { margin-top:2px; color:var(--crm-subtle); font-size:9px; }
.crm-timeline-detail { margin-top:5px; color:var(--crm-muted); font-size:10px; line-height:1.45; }

/* Empty state */
.crm-empty { padding:42px 20px; text-align:center; }
.crm-empty-icon { width:58px; height:58px; margin:0 auto 13px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.12); border-radius:18px; background:linear-gradient(145deg,rgba(88,216,255,.11),rgba(129,120,255,.08)); color:rgba(255,255,255,.82); font-size:27px; box-shadow:inset 0 1px 0 rgba(255,255,255,.08); }
.crm-empty-title { margin:0; color:white; font-size:14px; font-weight:500; }
.crm-empty-copy { max-width:380px; margin:6px auto 14px; color:var(--crm-muted); font-size:10px; line-height:1.55; }

/* Dropdown menu */
.crm-action-menu { min-width:190px; padding:6px; border:1px solid rgba(255,255,255,.13); border-radius:12px; background:rgba(9,20,31,.96); box-shadow:0 20px 48px rgba(0,0,0,.30); backdrop-filter:blur(16px); }
.crm-action-menu .dropdown-item { display:flex; align-items:center; gap:9px; min-height:34px; border-radius:8px; color:rgba(255,255,255,.74); font-size:10px; }
.crm-action-menu .dropdown-item:hover { color:white; background:rgba(255,255,255,.07); }
.crm-action-menu .dropdown-item.is-danger { color:#ff9aaa; }
.crm-action-menu .dropdown-divider { border-color:rgba(255,255,255,.08); }

/* Date range */
.crm-date-range { position:relative; }
.crm-date-popover { position:absolute; z-index:1040; right:0; top:calc(100% + 7px); width:min(440px,calc(100vw - 34px)); display:none; padding:12px; border:1px solid rgba(255,255,255,.14); border-radius:14px; background:rgba(9,20,31,.97); box-shadow:0 24px 60px rgba(0,0,0,.32); backdrop-filter:blur(18px); }
.crm-date-range.is-open .crm-date-popover { display:block; animation:crm-pop .16s ease-out; }
.crm-date-presets { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
.crm-date-fields { display:grid; grid-template-columns:1fr 1fr; gap:8px; }

/* Command palette / global search */
.crm-command-backdrop { position:fixed; inset:0; z-index:100000; display:flex; justify-content:center; align-items:flex-start; padding:10vh 16px 20px; background:rgba(2,8,14,.58); backdrop-filter:blur(10px); opacity:0; visibility:hidden; transition:opacity .18s ease,visibility .18s ease; }
.crm-command-backdrop.is-open { opacity:1; visibility:visible; }
.crm-command { width:min(620px,100%); overflow:hidden; border:1px solid rgba(255,255,255,.16); border-radius:17px; background:rgba(10,22,34,.96); box-shadow:0 32px 90px rgba(0,0,0,.42),inset 0 1px 0 rgba(255,255,255,.07); transform:translateY(-8px) scale(.99); transition:transform .18s ease; }
.crm-command-backdrop.is-open .crm-command { transform:translateY(0) scale(1); }
.crm-command-search { position:relative; padding:12px; border-bottom:1px solid rgba(255,255,255,.08); }
.crm-command-search i { position:absolute; left:23px; top:50%; transform:translateY(-50%); color:rgba(255,255,255,.42); font-size:19px; }
.crm-command-search input { width:100%; height:44px; border:0; outline:0; border-radius:11px; background:rgba(255,255,255,.045); color:white; padding:9px 44px 9px 42px; font-size:13px; }
.crm-command-search kbd { position:absolute; right:22px; top:50%; transform:translateY(-50%); border:1px solid rgba(255,255,255,.10); border-radius:6px; background:rgba(0,0,0,.17); color:rgba(255,255,255,.42); padding:3px 6px; font-size:8px; }
.crm-command-list { max-height:360px; overflow:auto; padding:7px; }
.crm-command-group { padding:8px 9px 5px; color:rgba(255,255,255,.32); font-size:8px; text-transform:uppercase; letter-spacing:.11em; }
.crm-command-item { display:flex; align-items:center; gap:11px; width:100%; padding:9px; border:0; border-radius:10px; background:transparent; color:rgba(255,255,255,.72); text-align:left; }
.crm-command-item:hover,.crm-command-item.is-active { background:rgba(255,255,255,.065); color:white; }
.crm-command-icon { width:31px; height:31px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.09); border-radius:9px; background:rgba(255,255,255,.04); font-size:15px; }
.crm-command-main { min-width:0; flex:1; }
.crm-command-title { font-size:10px; font-weight:500; }
.crm-command-sub { margin-top:2px; color:var(--crm-subtle); font-size:8px; }
.crm-command-key { color:rgba(255,255,255,.30); font-size:8px; }
.crm-command-empty { padding:30px 15px; text-align:center; color:var(--crm-muted); font-size:10px; }

/* Demo loader; visually identical to Pace */
.crm-loader-demo {
  position: fixed; inset: 0; z-index: 999999; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 43%, rgba(98,166,255,.13), transparent 24rem), rgba(8,18,27,.84);
  backdrop-filter: blur(16px) saturate(118%); -webkit-backdrop-filter: blur(16px) saturate(118%);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
}
.crm-loader-demo.is-visible { opacity: 1; visibility: visible; }
.crm-loader-card {
  width: 156px; height: 184px; border-radius: 28px; position: relative;
  border: 1px solid rgba(255,255,255,.16);
  background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.045) 55%, rgba(255,255,255,.025));
  box-shadow: 0 28px 70px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.18);
}
.crm-loader-doc {
  position: absolute; left: 50%; top: 38px; width: 58px; height: 72px; margin-left: -29px;
  border: 1px solid rgba(255,255,255,.33); border-radius: 13px 13px 16px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.055));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 12px 30px rgba(0,0,0,.18), 0 0 28px rgba(91,156,255,.11);
  animation: crm-document-float 1.7s ease-in-out infinite;
}
.crm-loader-lines { position:absolute; left:13px; right:13px; top:18px; height:28px; border-radius:4px;
  background: linear-gradient(90deg, rgba(110,202,255,.95), rgba(119,126,255,.95)) 0 0 / 72% 3px no-repeat,
  linear-gradient(90deg, rgba(255,255,255,.66), rgba(255,255,255,.18)) 0 11px / 100% 2px no-repeat,
  linear-gradient(90deg, rgba(255,255,255,.48), rgba(255,255,255,.13)) 0 22px / 78% 2px no-repeat;
  animation: crm-invoice-lines 1.55s ease-in-out infinite;
}
.crm-loader-pulse { position:absolute; right:-7px; bottom:-7px; width:20px; height:20px; border-radius:50%; border:4px solid rgba(10,23,34,.9); background:var(--crm-success); animation:crm-status-pulse 1.35s ease-out infinite; }
.crm-loader-label { position:absolute; left:50%; bottom:24px; width:200px; transform:translateX(-50%); text-align:center; color:rgba(255,255,255,.74); font-size:10px; font-weight:500; letter-spacing:.12em; text-transform:uppercase; }
.crm-loader-topline { position:absolute; left:0; top:0; width:42%; height:3px; background:linear-gradient(90deg,var(--crm-cyan),var(--crm-blue),var(--crm-violet)); box-shadow:0 0 16px rgba(91,156,255,.7); animation:crm-topline 1.4s ease-in-out infinite alternate; }


/* SweetAlert2 premium overrides */
.swal2-container { backdrop-filter:blur(8px); }
.swal2-popup.crm-swal,
body.crm-app .swal2-popup { border:1px solid rgba(255,255,255,.14) !important; border-radius:18px !important; background:linear-gradient(145deg,rgba(20,34,48,.97),rgba(8,20,31,.98)) !important; color:white !important; box-shadow:0 28px 80px rgba(0,0,0,.40),inset 0 1px 0 rgba(255,255,255,.06) !important; }
body.crm-app .swal2-title { color:white !important; font-size:18px !important; font-weight:500 !important; }
body.crm-app .swal2-html-container { color:rgba(255,255,255,.60) !important; font-size:11px !important; line-height:1.6 !important; }
body.crm-app .swal2-confirm { border:1px solid rgba(255,255,255,.20) !important; border-radius:10px !important; background:linear-gradient(135deg,#55c8ff,#5d82ff) !important; box-shadow:0 9px 24px rgba(71,125,255,.20) !important; font-size:11px !important; }
body.crm-app .swal2-cancel { border:1px solid rgba(255,255,255,.12) !important; border-radius:10px !important; background:rgba(255,255,255,.07) !important; color:rgba(255,255,255,.74) !important; font-size:11px !important; }
body.crm-app .swal2-toast { border:1px solid rgba(255,255,255,.13) !important; border-radius:13px !important; background:rgba(10,22,34,.96) !important; color:white !important; box-shadow:0 18px 45px rgba(0,0,0,.30) !important; }
body.crm-app .swal2-timer-progress-bar { background:linear-gradient(90deg,var(--crm-cyan),var(--crm-blue)) !important; }

/* Demo / utility */
.crm-section-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.crm-section-grid-3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.crm-section-title { margin:0 0 13px; color:white; font-size:13px; font-weight:500; }
.crm-separator { height:1px; margin:17px 0; background:rgba(255,255,255,.075); }
.crm-note { padding:10px 12px; border:1px solid rgba(88,216,255,.13); border-radius:11px; background:rgba(88,216,255,.045); color:rgba(220,247,255,.62); font-size:9px; line-height:1.55; }
.crm-demo-toolbar { display:flex; flex-wrap:wrap; gap:8px; }
.crm-code { padding:2px 6px; border-radius:6px; background:rgba(0,0,0,.18); color:#bdefff; font-family:monospace; font-size:9px; }
.animated { animation-duration:.35s; animation-fill-mode:both; }
.fadeIn { animation-name:crm-fade; }

/* Mobile fixed action dock */
.crm-mobile-actions { display:none; position:fixed; z-index:100; left:10px; right:10px; bottom:10px; padding:8px; border:1px solid rgba(255,255,255,.14); border-radius:15px; background:rgba(8,19,30,.88); box-shadow:0 18px 45px rgba(0,0,0,.30); backdrop-filter:blur(18px); }
.crm-mobile-actions .crm-btn { flex:1; }

/* RTL */
html[dir="rtl"] .crm-search i { left:auto; right:12px; }
html[dir="rtl"] .crm-search input { padding-left:12px; padding-right:37px; }
html[dir="rtl"] .crm-command-search i { left:auto; right:23px; }
html[dir="rtl"] .crm-command-search input { padding-left:44px; padding-right:42px; }
html[dir="rtl"] .crm-command-search kbd { right:auto; left:22px; }
html[dir="rtl"] .crm-command-item { text-align:right; }
html[dir="rtl"] .crm-timeline { padding-left:0; padding-right:25px; }
html[dir="rtl"] .crm-timeline::before { left:auto; right:7px; }
html[dir="rtl"] .crm-timeline-dot { left:auto; right:-24px; }
html[dir="rtl"] .crm-input-group .crm-input { border-radius:0 11px 11px 0; }
html[dir="rtl"] .crm-input-addon { border-left:1px solid rgba(255,255,255,.12); border-right:0; border-radius:11px 0 0 11px; }
html[dir="rtl"] .crm-progress-fill { inset:1px 1px 1px auto; }
html[dir="rtl"] .crm-progress-fill::after { right:auto; left:1px; }
html[dir="rtl"] .crm-workflow-line { left:auto; right:8%; }
html[dir="rtl"] .crm-date-popover { right:auto; left:0; }
html[dir="rtl"] .crm-financial-side { text-align:left; }
html[dir="rtl"] .crm-table-actions { justify-content:flex-start; }

/* Responsive */
@media (max-width:1199.98px) {
  .crm-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm-invoice-layout { grid-template-columns:minmax(0,1fr) 280px; }
}
@media (max-width:991.98px) {
  .crm-page-header { flex-direction:column; }
  .crm-page-actions { justify-content:flex-start; }
  .crm-invoice-layout { grid-template-columns:1fr; }
  .crm-invoice-summary { position:static; }
  .crm-section-grid,.crm-section-grid-3 { grid-template-columns:1fr; }
  .crm-line-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:767.98px) {
  body.crm-app .page-content { padding-left:14px; padding-right:14px; }
  .crm-kpi-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .crm-kpi { min-height:120px; padding:14px; }
  .crm-kpi-value { font-size:20px; }
  .crm-card-head,.crm-card-body { padding-left:15px; padding-right:15px; }
  .crm-table-toolbar { align-items:stretch; }
  .crm-table-tools { min-width:100%; }
  .crm-search { min-width:100%; flex-basis:100%; }
  .crm-workflow { gap:2px; }
  .crm-step-label { font-size:8px; }
  .crm-step-date { display:none; }
  .crm-financial-progress { grid-template-columns:40px 1fr; }
  .crm-financial-side { grid-column:2; text-align:start; margin-top:-5px; }
  .crm-mobile-actions { display:flex; gap:7px; }
  .crm-page-actions .crm-btn-primary[data-mobile-sticky="true"] { display:none; }
}
@media (max-width:575.98px) {
  .crm-kpi-grid { grid-template-columns:1fr; }
  .crm-page-title { font-size:24px; }
  .crm-line-grid { grid-template-columns:1fr 1fr; }
  .crm-line-grid > :first-child { grid-column:span 2; }
  .crm-date-fields { grid-template-columns:1fr; }
  .crm-table-footer { flex-direction:column; align-items:flex-start; }
  .crm-command-backdrop { padding-top:5vh; }
}

/* Motion */
@keyframes crm-shimmer { to { transform:translateX(100%); } }
@keyframes crm-fade { from{opacity:0;transform:translateY(3px)} to{opacity:1;transform:translateY(0)} }
@keyframes crm-pop { from{opacity:0;transform:translateY(-4px) scale(.99)} to{opacity:1;transform:none} }
@keyframes crm-pulse { 0%,100%{opacity:.55} 50%{opacity:1} }
@keyframes crm-indeterminate { from{left:-36%} to{left:104%} }
@keyframes crm-topline { from{width:18%} to{width:88%} }
@keyframes crm-document-float { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-5px) scale(1.015)} }
@keyframes crm-invoice-lines { 0%,100%{opacity:.62;transform:translateY(0)} 45%{opacity:1;transform:translateY(1px)} }
@keyframes crm-status-pulse { 0%{box-shadow:0 0 0 0 rgba(98,220,186,.46),0 0 16px rgba(98,220,186,.34)} 75%,100%{box-shadow:0 0 0 12px rgba(98,220,186,0),0 0 16px rgba(98,220,186,.28)} }

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; }
  .crm-skeleton::after,.crm-progress-fill,.crm-loader-doc,.crm-loader-lines,.crm-loader-pulse,.crm-loader-topline,.crm-save-state.is-saving::before { animation:none !important; transition:none !important; }
}

/* DataTables plugin bridge */
.crm-datatable-host .dataTables_wrapper { color: var(--crm-muted); }
.crm-datatable-host .dataTables_wrapper .row { margin: 0; }
.crm-datatable-host .dataTables_info { padding: 13px 16px !important; color: var(--crm-subtle) !important; font-size: 9px; }
.crm-datatable-host .dataTables_paginate { padding: 8px 14px 10px !important; }
.crm-datatable-host .page-link { min-width: 30px; height: 30px; display:grid; place-items:center; padding:0 8px; margin:0 2px; border:1px solid rgba(255,255,255,.10) !important; border-radius:9px !important; color:rgba(255,255,255,.62) !important; background:rgba(5,14,23,.14) !important; box-shadow:none !important; font-size:9px; }
.crm-datatable-host .page-item.active .page-link { color:white !important; border-color:rgba(88,216,255,.30) !important; background:linear-gradient(135deg,rgba(88,216,255,.18),rgba(91,156,255,.22)) !important; }
.crm-datatable-host .page-item.disabled .page-link { opacity:.35; }
.crm-datatable-host table.dataTable { margin-top:0 !important; margin-bottom:0 !important; border-collapse:separate !important; border-spacing:0 !important; }
.crm-datatable-host table.dataTable thead th { border-bottom:1px solid rgba(255,255,255,.10) !important; }
.crm-datatable-host .dataTables_empty { color:var(--crm-muted); padding:32px !important; }
/* V1.30 — le message vide est un état UI global, y compris pour les modules. */
.dataTables_wrapper.crm-datatable-host td.dataTables_empty {
  padding: 34px 18px !important;
  text-align: center !important;
  color: rgba(225, 241, 251, .76) !important;
  background: linear-gradient(180deg, rgba(10, 42, 65, .20), rgba(4, 24, 40, .10)) !important;
  font-size: .9rem !important;
  font-weight: 600;
  letter-spacing: .01em;
}
.dataTables_wrapper.crm-datatable-host td.dataTables_empty.crm-empty-state {
  border-bottom: 0 !important;
}

@media (max-width:767.98px) {
  .crm-table-cards { min-width:0; }
  .crm-table-cards thead { display:none; }
  .crm-table-cards tbody,.crm-table-cards tr,.crm-table-cards td { display:block; width:100%; }
  .crm-table-cards tbody { padding:10px; }
  .crm-table-cards tbody tr { margin-bottom:10px; padding:7px 11px; border:1px solid rgba(255,255,255,.10); border-radius:13px; background:rgba(5,14,23,.15); }
  .crm-table-cards tbody tr:last-child { margin-bottom:0; }
  .crm-table-cards tbody td { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:7px 0; border-bottom:1px solid rgba(255,255,255,.055); text-align:end; }
  .crm-table-cards tbody td:last-child { border-bottom:0; }
  .crm-table-cards tbody td::before { flex:0 0 74px; text-align:start; color:var(--crm-subtle); font-size:8px; text-transform:uppercase; letter-spacing:.07em; }
  .crm-table-cards tbody td:nth-child(1)::before { content:"N°"; }
  .crm-table-cards tbody td:nth-child(2)::before { content:"Client"; }
  .crm-table-cards tbody td:nth-child(3)::before { content:"Date"; }
  .crm-table-cards tbody td:nth-child(4)::before { content:"Échéance"; }
  .crm-table-cards tbody td:nth-child(5)::before { content:"Montant"; }
  .crm-table-cards tbody td:nth-child(6)::before { content:"Statut"; }
  .crm-table-cards tbody td:nth-child(7)::before { content:"Actions"; }
  .crm-table-cards .crm-table-sub { text-align:end; }
  .crm-table-cards .crm-table-actions { justify-content:flex-end; }
}


/* ==========================================================================\n   v1.3 — bg-theme1 compatibility & CRM controls\n   Targeted overrides only. Keeps the Dashtrans theme1 background untouched.\n   ========================================================================== */
body.crm-app.bg-theme1 {
  --crm-t1-navy: #071b2d;
  --crm-t1-navy-2: #0b2742;
  --crm-t1-control: rgba(4, 30, 51, .64);
  --crm-t1-control-hover: rgba(8, 42, 69, .76);
  --crm-t1-border: rgba(200, 232, 255, .25);
  --crm-t1-border-strong: rgba(200, 232, 255, .42);
  --crm-t1-text: #f4f9ff;
  --crm-t1-muted: rgba(235, 246, 255, .70);
  --crm-t1-cyan: #59d9ff;
  --crm-t1-blue: #4f8dff;
}

/* Bootstrap modal: no fallback to the old black/grey palette */
body.crm-app.bg-theme1 .modal-content {
  color: var(--crm-t1-text);
  border: 1px solid rgba(203, 231, 255, .20);
  border-radius: 20px;
  background:
    radial-gradient(circle at 86% 0%, rgba(112, 104, 255, .15), transparent 34%),
    linear-gradient(145deg, rgba(8, 38, 64, .97), rgba(5, 22, 38, .98));
  box-shadow: 0 30px 90px rgba(2, 11, 22, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow: hidden;
}
body.crm-app.bg-theme1 .modal-header,
body.crm-app.bg-theme1 .modal-footer { border-color: rgba(218, 239, 255, .12); }
body.crm-app.bg-theme1 .modal-title,
body.crm-app.bg-theme1 .modal-body label,
body.crm-app.bg-theme1 .modal-body .form-label { color: var(--crm-t1-text); }
body.crm-app.bg-theme1 .modal-body { color: var(--crm-t1-muted); }
body.crm-app.bg-theme1 .modal-header .btn-close {
  opacity: .78;
  filter: invert(1) grayscale(1) brightness(1.8);
}
body.crm-app.bg-theme1 .modal-header .btn-close:hover { opacity: 1; }
body.crm-app.bg-theme1 .modal-backdrop.show {
  opacity: .68;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Native Bootstrap controls on theme1 */
body.crm-app.bg-theme1 .form-control,
body.crm-app.bg-theme1 .form-select,
body.crm-app.bg-theme1 .input-group-text {
  color: var(--crm-t1-text) !important;
  border-color: var(--crm-t1-border) !important;
  background-color: var(--crm-t1-control) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
body.crm-app.bg-theme1 .form-control::placeholder { color: rgba(226, 242, 255, .48) !important; }
body.crm-app.bg-theme1 .form-control:focus,
body.crm-app.bg-theme1 .form-select:focus {
  color: #fff !important;
  border-color: rgba(89, 217, 255, .72) !important;
  background-color: rgba(4, 34, 58, .82) !important;
  box-shadow: 0 0 0 .2rem rgba(64, 177, 255, .14) !important;
}
body.crm-app.bg-theme1 .form-control[readonly],
body.crm-app.bg-theme1 .form-control:disabled,
body.crm-app.bg-theme1 .form-select:disabled {
  color: rgba(244, 249, 255, .66) !important;
  background-color: rgba(255, 255, 255, .09) !important;
  border-color: rgba(255, 255, 255, .14) !important;
  opacity: 1;
}
body.crm-app.bg-theme1 .form-select {
  padding-right: 2.65rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23DDF3FF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-position: right .85rem center !important;
  background-size: 16px 12px !important;
}
body.crm-app.bg-theme1 .form-select option {
  color: #f5f9ff;
  background: #0a2944;
}
body.crm-app.bg-theme1 .form-check-input {
  border-color: rgba(214, 239, 255, .36);
  background-color: rgba(3, 26, 44, .68);
}
body.crm-app.bg-theme1 .form-check-input:checked {
  border-color: #4d9cff;
  background-color: #4d9cff;
}

/* V1.30 — état OFF des switches lisible sur fond sombre. */
body.crm-app.bg-theme1 .form-switch .form-check-input {
  width: 2.65rem;
  min-width: 2.65rem;
  height: 1.42rem;
  border-width: 1px !important;
  opacity: 1 !important;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.22), 0 0 0 1px rgba(255,255,255,.025);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
body.crm-app.bg-theme1 .form-switch .form-check-input:not(:checked) {
  border-color: rgba(174, 222, 247, .58) !important;
  background-color: rgba(16, 53, 76, .96) !important;
}
body.crm-app.bg-theme1 .form-switch .form-check-input:not(:checked):hover {
  border-color: rgba(191, 232, 252, .82) !important;
  background-color: rgba(20, 65, 91, .98) !important;
}
body.crm-app.bg-theme1 .form-switch .form-check-input:checked {
  border-color: rgba(94, 192, 255, .92) !important;
  background-color: #318dff !important;
  box-shadow: 0 0 0 3px rgba(49,141,255,.09), inset 0 1px 0 rgba(255,255,255,.16);
}

/* V1.33 — checkbox/switch : contraste OFF + espacement label universel. */
body.crm-app.bg-theme1 .form-check {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 1.55rem;
  padding-inline-start: 0 !important;
}
body.crm-app.bg-theme1 .form-check .form-check-input {
  float: none !important;
  flex: 0 0 auto;
  margin: 0 !important;
}
body.crm-app.bg-theme1 .form-check .form-check-label {
  margin: 0 !important;
  line-height: 1.35;
}
body.crm-app.bg-theme1 .form-check-input[type="checkbox"]:not(:checked) {
  border-color: rgba(190, 229, 250, .64) !important;
  background-color: rgba(10, 42, 65, .94) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.24), 0 0 0 1px rgba(255,255,255,.02);
}
body.crm-app.bg-theme1 .form-switch .form-check-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6' fill='%23DDF3FF'/%3E%3C/svg%3E") !important;
  background-size: 1rem 1rem !important;
  background-repeat: no-repeat !important;
}
body.crm-app.bg-theme1 .form-switch .form-check-input:not(:checked) {
  background-position: left .16rem center !important;
}
body.crm-app.bg-theme1 .form-switch .form-check-input:checked {
  background-position: right .16rem center !important;
}
html[dir="rtl"] body.crm-app.bg-theme1 .form-switch .form-check-input:not(:checked) {
  background-position: right .16rem center !important;
}
html[dir="rtl"] body.crm-app.bg-theme1 .form-switch .form-check-input:checked {
  background-position: left .16rem center !important;
}

html[dir="rtl"] body.crm-app.bg-theme1 .form-select {
  padding-right: .75rem;
  padding-left: 2.65rem;
  background-position: left .85rem center !important;
}

/* Premium Bootstrap tabs: no cropped first tab and no desktop phantom scrollbar */
body.crm-app.bg-theme1 .nav-tabs {
  display: flex;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px;
  overflow: visible !important;
  border: 1px solid rgba(205, 234, 255, .12) !important;
  border-radius: 13px;
  background: rgba(5, 31, 53, .40);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
body.crm-app.bg-theme1 .nav-tabs .nav-item { margin: 0 !important; }
body.crm-app.bg-theme1 .nav-tabs .nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 !important;
  padding: 8px 14px;
  white-space: nowrap;
  color: rgba(240, 248, 255, .78) !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: transparent !important;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
body.crm-app.bg-theme1 .nav-tabs .nav-link:hover {
  color: #fff !important;
  border-color: rgba(217, 240, 255, .12) !important;
  background: rgba(255, 255, 255, .065) !important;
}
body.crm-app.bg-theme1 .nav-tabs .nav-link.active,
body.crm-app.bg-theme1 .nav-primary.nav-tabs .nav-link.active,
body.crm-app.bg-theme1 .nav-success.nav-tabs .nav-link.active,
body.crm-app.bg-theme1 .nav-warning.nav-tabs .nav-link.active,
body.crm-app.bg-theme1 .nav-danger.nav-tabs .nav-link.active {
  color: #fff !important;
  border-color: rgba(177, 225, 255, .32) !important;
  background: linear-gradient(135deg, rgba(36, 126, 203, .46), rgba(92, 105, 213, .40)) !important;
  box-shadow: 0 8px 20px rgba(4, 23, 43, .18), inset 0 1px 0 rgba(255, 255, 255, .09);
}
@media (max-width: 575.98px) {
  body.crm-app.bg-theme1 .nav-tabs {
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  body.crm-app.bg-theme1 .nav-tabs::-webkit-scrollbar { display: none; }
  body.crm-app.bg-theme1 .nav-tabs .nav-link { flex: 0 0 auto; }
}

/* Theme1-friendly Bootstrap utility states */
body.crm-app.bg-theme1 .bg-light-secondary,
body.crm-app.bg-theme1 .bg-light-secondary.text-secondary {
  color: #eef6ff !important;
  background-color: rgba(26, 46, 70, .68) !important;
  border: 1px solid rgba(216, 235, 255, .16);
}
body.crm-app.bg-theme1 .bg-light-success {
  color: #b6f6da !important;
  background-color: rgba(11, 94, 73, .46) !important;
  border: 1px solid rgba(105, 227, 186, .23);
}
body.crm-app.bg-theme1 table .bg-light-success,
body.crm-app.bg-theme1 .table .bg-light-success {
  color: #63e4a8 !important;
  background-color: rgb(23 160 14 / .11) !important;
  border-color: rgba(99, 228, 168, .10);
}
body.crm-app.bg-theme1 .bg-light-warning { color: #ffe09a !important; }
body.crm-app.bg-theme1 .bg-light-info { color: #aeeeff !important; }
body.crm-app.bg-theme1 .bg-light-danger { color: #ffb0bc !important; }

/* Bootstrap outline buttons corrected for the bright cyan/violet areas of theme1 */
body.crm-app.bg-theme1 .btn-outline-primary {
  color: #e9f7ff !important;
  border-color: rgba(90, 203, 255, .72) !important;
  background: rgba(5, 40, 68, .36) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}
body.crm-app.bg-theme1 .btn-outline-primary:hover,
body.crm-app.bg-theme1 .btn-outline-primary:focus,
body.crm-app.bg-theme1 .btn-outline-primary:active,
body.crm-app.bg-theme1 .btn-outline-primary.active {
  color: #fff !important;
  border-color: rgba(202, 239, 255, .74) !important;
  background: linear-gradient(135deg, #157fd3, #526ee7) !important;
  box-shadow: 0 9px 22px rgba(17, 92, 169, .24) !important;
}
body.crm-app.bg-theme1 .btn-outline-secondary {
  color: rgba(245, 250, 255, .82) !important;
  border-color: rgba(230, 241, 255, .30) !important;
  background: rgba(10, 34, 55, .28) !important;
}
body.crm-app.bg-theme1 .btn-outline-secondary:hover {
  color: #fff !important;
  border-color: rgba(240, 248, 255, .45) !important;
  background: rgba(255, 255, 255, .10) !important;
}
body.crm-app.bg-theme1 .btn-outline-danger {
  color: #ffb6c1 !important;
  border-color: rgba(255, 115, 137, .76) !important;
  background: rgba(84, 18, 37, .22) !important;
}
body.crm-app.bg-theme1 .btn-outline-danger:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #d94f68, #ee657c) !important;
}

/* Additional reusable premium button classes for the CRM */
.crm-btn-soft-primary { color:#dff6ff; border-color:rgba(89,217,255,.28); background:rgba(38,129,205,.24); }
.crm-btn-soft-primary:hover { color:#fff; border-color:rgba(89,217,255,.46); background:rgba(38,129,205,.36); }
.crm-btn-soft-success { color:#c6f8e6; border-color:rgba(98,220,186,.26); background:rgba(23,130,99,.22); }
.crm-btn-soft-success:hover { color:#fff; border-color:rgba(98,220,186,.44); background:rgba(23,130,99,.34); }
.crm-btn-soft-warning { color:#ffe6ad; border-color:rgba(255,199,102,.28); background:rgba(151,101,21,.22); }
.crm-btn-soft-warning:hover { color:#fff6e2; border-color:rgba(255,199,102,.48); background:rgba(151,101,21,.34); }
.crm-btn-soft-danger { color:#ffc0ca; border-color:rgba(255,118,138,.28); background:rgba(137,36,60,.22); }
.crm-btn-soft-danger:hover { color:#fff; border-color:rgba(255,118,138,.48); background:rgba(137,36,60,.35); }
.crm-btn-link { min-height:auto; padding:4px 3px; border-color:transparent; border-radius:7px; background:transparent; box-shadow:none; color:#aeeaff; }
.crm-btn-link:hover { background:rgba(89,217,255,.08); color:#fff; transform:none; }

/* Context-aware premium badges */
.crm-badge {
  display:inline-flex; align-items:center; gap:6px; min-height:26px; padding:4px 9px;
  border:1px solid rgba(255,255,255,.13); border-radius:999px; font-size:10px; font-weight:600; line-height:1.1;
}
.crm-badge-primary { color:#d9f5ff; background:rgba(36,126,203,.38); border-color:rgba(89,217,255,.24); }
.crm-badge-success { color:#c7f9e7; background:rgba(15,105,79,.44); border-color:rgba(98,220,186,.22); }
.crm-badge-warning { color:#ffe6af; background:rgba(134,91,21,.42); border-color:rgba(255,199,102,.22); }
.crm-badge-danger { color:#ffc2cc; background:rgba(124,31,53,.43); border-color:rgba(255,118,138,.22); }
.crm-badge-neutral { color:#edf5ff; background:rgba(27,45,66,.56); border-color:rgba(220,238,255,.14); }

/* DataTables: localized controls stay outside the horizontal scrolling area */
body.crm-app .dataTables_wrapper { width:100%; min-width:0; }
body.crm-app .dataTables_wrapper .dataTables_filter { text-align:right !important; }
body.crm-app .dataTables_wrapper .dataTables_filter label {
  display:inline-flex; align-items:center; justify-content:flex-end; gap:8px; margin:0; color:rgba(244,249,255,.84);
}
body.crm-app .dataTables_wrapper .dataTables_filter input {
  width:220px; max-width:100%; margin-left:0 !important;
}
body.crm-app .dataTables_wrapper .dataTables_length label {
  display:inline-flex; align-items:center; gap:7px; margin:0; color:rgba(244,249,255,.84);
}
body.crm-app .dataTables_wrapper .dataTables_length select { width:auto; min-width:68px; }
body.crm-app .crm-datatable-scroll {
  width:100%; max-width:100%; overflow-x:auto; overflow-y:hidden; margin-top:.25rem;
  -webkit-overflow-scrolling:touch; scrollbar-width:thin; scrollbar-color:rgba(214,235,255,.26) rgba(3,20,34,.20);
}
body.crm-app .crm-datatable-scroll::-webkit-scrollbar { height:8px; }
body.crm-app .crm-datatable-scroll::-webkit-scrollbar-track { background:rgba(3,20,34,.20); border-radius:999px; }
body.crm-app .crm-datatable-scroll::-webkit-scrollbar-thumb { background:rgba(214,235,255,.26); border-radius:999px; }
body.crm-app .crm-datatable-scroll > table.dataTable { width:100% !important; min-width:760px; margin-top:0 !important; margin-bottom:0 !important; }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter input,
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_length select {
  color:#f7fbff !important; border:1px solid var(--crm-t1-border) !important; background-color:var(--crm-t1-control) !important;
}
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_info { color:rgba(241,248,255,.76) !important; }
body.crm-app.bg-theme1 .dataTables_wrapper .page-link {
  color:#eaf7ff; border-color:rgba(215,236,255,.16); background:rgba(5,32,54,.45);
}
body.crm-app.bg-theme1 .dataTables_wrapper .page-item.active .page-link {
  color:#fff; border-color:rgba(112,205,255,.50); background:linear-gradient(135deg,#1688dd,#506de6);
}
body.crm-app.bg-theme1 .dataTables_wrapper .page-item.disabled .page-link { color:rgba(240,248,255,.38); background:rgba(5,32,54,.25); }
html[dir="rtl"] body.crm-app .dataTables_wrapper .dataTables_filter { text-align:left !important; }
@media (max-width:767.98px) {
  body.crm-app .dataTables_wrapper .dataTables_filter,
  body.crm-app .dataTables_wrapper .dataTables_length { text-align:left !important; margin-top:8px; }
  body.crm-app .dataTables_wrapper .dataTables_filter label,
  body.crm-app .dataTables_wrapper .dataTables_length label { width:100%; justify-content:flex-start; }
  body.crm-app .dataTables_wrapper .dataTables_filter input { flex:1 1 auto; width:100%; min-width:0; }
}

/* Main sidebar state: URL-active parent remains visible when a secondary configuration menu is selected */
body.crm-app .sidebar-wrapper .metismenu a.crm-url-active,
body.crm-app .sidebar-wrapper .metismenu > li.mm-active > a {
  color:#fff !important;
  background:linear-gradient(135deg, rgba(58,135,199,.27), rgba(89,106,189,.22));
  box-shadow:inset 0 0 0 1px rgba(210,236,255,.07), inset 0 1px 0 rgba(255,255,255,.05);
}

/* SweetAlert2 — theme1: explicit high contrast and consistent button palette */
body.crm-app.bg-theme1 .swal2-container { background:rgba(2,12,23,.48) !important; }
body.crm-app.bg-theme1 .swal2-popup,
body.crm-app.bg-theme1 .swal2-popup.crm-swal {
  width:min(520px, calc(100vw - 28px)) !important;
  max-width:520px !important;
  padding:24px 24px 22px !important;
  color:#f8fbff !important;
  border:1px solid rgba(198,231,255,.20) !important;
  border-radius:22px !important;
  background:
    radial-gradient(circle at 84% 0%, rgba(106,103,255,.16), transparent 36%),
    linear-gradient(145deg, rgba(8,39,65,.985), rgba(4,20,35,.99)) !important;
  box-shadow:0 32px 90px rgba(0,8,18,.58), inset 0 1px 0 rgba(255,255,255,.07) !important;
}
body.crm-app.bg-theme1 .swal2-popup.crm-swal-wide { width:min(760px, calc(100vw - 28px)) !important; max-width:760px !important; }
body.crm-app.bg-theme1 .swal2-popup.crm-swal-form { width:min(920px, calc(100vw - 28px)) !important; max-width:920px !important; }
body.crm-app.bg-theme1 .swal2-title,
body.crm-app.bg-theme1 .crm-swal-title {
  margin-top:6px !important;
  color:#fff !important;
  font-size:24px !important;
  font-weight:600 !important;
  line-height:1.25 !important;
  letter-spacing:-.02em;
}
body.crm-app.bg-theme1 .swal2-html-container,
body.crm-app.bg-theme1 .crm-swal-copy {
  margin-top:10px !important;
  color:rgba(238,247,255,.76) !important;
  font-size:14px !important;
  line-height:1.55 !important;
}
body.crm-app.bg-theme1 .swal2-icon { width:5em; height:5em; margin:1.25em auto .75em; }
body.crm-app.bg-theme1 .swal2-icon.swal2-warning { color:#ffc64d !important; border-color:rgba(255,198,77,.88) !important; }
body.crm-app.bg-theme1 .swal2-icon.swal2-error { color:#ff7b90 !important; border-color:#ff7b90 !important; }
body.crm-app.bg-theme1 .swal2-icon.swal2-success { color:#68dfbd !important; border-color:#68dfbd !important; }
body.crm-app.bg-theme1 .swal2-actions,
body.crm-app.bg-theme1 .crm-swal-actions { gap:9px !important; margin-top:22px !important; }
body.crm-app.bg-theme1 .swal2-styled,
body.crm-app.bg-theme1 .crm-swal-btn {
  min-width:126px; min-height:42px; margin:0 !important; padding:9px 16px !important;
  border-radius:11px !important; font-size:13px !important; font-weight:600 !important;
  box-shadow:none !important; transition:transform .16s ease, background .16s ease, border-color .16s ease !important;
}
body.crm-app.bg-theme1 .swal2-confirm,
body.crm-app.bg-theme1 .crm-swal-confirm {
  color:#fff !important; border:1px solid rgba(203,239,255,.26) !important;
  background:linear-gradient(135deg,#168cdd,#526fe8) !important;
  box-shadow:0 10px 24px rgba(31,102,194,.24) !important;
}
body.crm-app.bg-theme1 .swal2-cancel,
body.crm-app.bg-theme1 .crm-swal-cancel {
  color:#edf7ff !important; border:1px solid rgba(222,239,255,.22) !important;
  background:rgba(255,255,255,.075) !important;
}
body.crm-app.bg-theme1 .swal2-confirm:hover,
body.crm-app.bg-theme1 .crm-swal-confirm:hover { transform:translateY(-1px); filter:brightness(1.07); }
body.crm-app.bg-theme1 .swal2-cancel:hover,
body.crm-app.bg-theme1 .crm-swal-cancel:hover { transform:translateY(-1px); background:rgba(255,255,255,.12) !important; }
body.crm-app.bg-theme1 .swal2-close { color:rgba(235,247,255,.58) !important; }
body.crm-app.bg-theme1 .swal2-close:hover { color:#fff !important; }
body.crm-app.bg-theme1 .swal2-toast { width:360px !important; max-width:calc(100vw - 24px) !important; padding:12px 14px !important; }


/* Optional: keep the actions column visible while wide DataTables scroll horizontally */
body.crm-app.bg-theme1 .crm-datatable-scroll table.crm-sticky-actions th:last-child,
body.crm-app.bg-theme1 .crm-datatable-scroll table.crm-sticky-actions td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: rgba(7, 35, 58, .97);
  box-shadow: -14px 0 22px -18px rgba(0, 0, 0, .9);
}
body.crm-app.bg-theme1 .crm-datatable-scroll table.crm-sticky-actions thead th:last-child { z-index: 3; background: rgba(8, 40, 66, .99); }
html[dir="rtl"] body.crm-app.bg-theme1 .crm-datatable-scroll table.crm-sticky-actions th:last-child,
html[dir="rtl"] body.crm-app.bg-theme1 .crm-datatable-scroll table.crm-sticky-actions td:last-child {
  right: auto;
  left: 0;
  box-shadow: 14px 0 22px -18px rgba(0, 0, 0, .9);
}

/* Small refinements for Theme 1 modal secondary actions and SweetAlert toasts */
body.crm-app.bg-theme1 .modal .btn-light,
body.crm-app.bg-theme1 .modal .btn-secondary {
  color: #eef7ff !important;
  border-color: rgba(223, 239, 255, .20) !important;
  background: rgba(255, 255, 255, .075) !important;
}
body.crm-app.bg-theme1 .modal .btn-light:hover,
body.crm-app.bg-theme1 .modal .btn-secondary:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, .12) !important;
}
body.crm-app.bg-theme1 .swal2-toast .swal2-title {
  margin: 0 !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}
body.crm-app.bg-theme1 .swal2-toast .swal2-html-container {
  margin: 2px 0 0 !important;
  font-size: 11px !important;
}
body.crm-app.bg-theme1 .swal2-toast .swal2-icon {
  width: 1.85em !important;
  height: 1.85em !important;
  margin: 0 .65em 0 0 !important;
  flex: 0 0 1.85em;
}

/* ==========================================================================
   v1.4 — Theme 1 Premium Finance polish
   A deliberate, high-contrast component layer for .bg-theme1.
   ========================================================================== */
body.crm-app.bg-theme1 {
  --crm-t1-deep: #061827;
  --crm-t1-deep-2: #08243a;
  --crm-t1-panel: rgba(7, 32, 54, .76);
  --crm-t1-panel-strong: rgba(6, 27, 47, .91);
  --crm-t1-panel-soft: rgba(255, 255, 255, .075);
  --crm-t1-line: rgba(196, 229, 255, .15);
  --crm-t1-line-hover: rgba(204, 236, 255, .28);
  --crm-t1-white: #f8fbff;
  --crm-t1-copy: #d7e8f5;
  --crm-t1-muted-2: #9fb8ca;
  --crm-t1-accent: #62d7ff;
  --crm-t1-accent-2: #6e77ff;
  --crm-t1-success-2: #64e0ba;
  --crm-t1-warning-2: #ffc85c;
  --crm-t1-danger-2: #ff7188;
}

/* Premium glass surfaces — richer than the generic template cards, still subtle */
body.crm-app.bg-theme1 .crm-card,
body.crm-app.bg-theme1 .crm-premium-panel {
  border: 1px solid var(--crm-t1-line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.085), rgba(255,255,255,.025) 48%, rgba(4,24,41,.16)),
    rgba(5,29,49,.58);
  box-shadow:
    0 22px 54px rgba(2, 13, 24, .20),
    inset 0 1px 0 rgba(255,255,255,.075);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}
body.crm-app.bg-theme1 .crm-card::before { opacity:.72; }
body.crm-app.bg-theme1 .crm-card-head { padding:22px 22px 0; }
body.crm-app.bg-theme1 .crm-card-body { padding:22px; }
body.crm-app.bg-theme1 .crm-card-title { font-size:16px; font-weight:650; letter-spacing:-.015em; color:#fff; }
body.crm-app.bg-theme1 .crm-card-copy { margin-top:6px; color:rgba(226,240,250,.66); font-size:12px; }

/* Showcase-only hero */
.crm-premium-hero {
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  min-height:178px;
  margin-bottom:18px;
  padding:28px;
  border:1px solid rgba(210,238,255,.18);
  border-radius:26px;
  background:
    radial-gradient(circle at 78% 14%, rgba(114,106,255,.34), transparent 28%),
    radial-gradient(circle at 52% 108%, rgba(62,222,236,.24), transparent 38%),
    linear-gradient(135deg, rgba(5,37,62,.92), rgba(22,63,109,.75) 56%, rgba(50,54,131,.72));
  box-shadow:0 28px 70px rgba(2,12,22,.25), inset 0 1px 0 rgba(255,255,255,.12);
}
.crm-premium-hero::after {
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.20;
  background-image:linear-gradient(rgba(255,255,255,.11) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(90deg,rgba(0,0,0,.7),transparent 72%);
  -webkit-mask-image:linear-gradient(90deg,rgba(0,0,0,.7),transparent 72%);
}
.crm-premium-hero > * { position:relative; z-index:1; }
.crm-premium-eyebrow { display:flex; align-items:center; gap:8px; margin-bottom:10px; color:#9ce9ff; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.15em; }
.crm-premium-eyebrow::before { content:""; width:22px; height:1px; background:linear-gradient(90deg,#61dcff,transparent); }
.crm-premium-hero h1 { margin:0; color:#fff; font-size:clamp(27px,3vw,39px); line-height:1.05; font-weight:700; letter-spacing:-.035em; }
.crm-premium-hero p { max-width:760px; margin:11px 0 0; color:rgba(235,247,255,.76); font-size:13px; line-height:1.65; }
.crm-premium-hero-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.crm-premium-metrics { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.crm-premium-metric { display:inline-flex; align-items:center; gap:7px; min-height:29px; padding:5px 10px; border:1px solid rgba(210,239,255,.16); border-radius:999px; background:rgba(3,19,34,.24); color:rgba(240,249,255,.82); font-size:10px; box-shadow:inset 0 1px 0 rgba(255,255,255,.05); }
.crm-premium-metric i { color:#76dcff; font-size:14px; }

/* Buttons — premium, tactile, compact */
body.crm-app.bg-theme1 .crm-btn {
  min-height:40px;
  padding:9px 14px;
  gap:8px;
  border:1px solid rgba(211,236,255,.15);
  border-radius:12px;
  background:linear-gradient(145deg,rgba(255,255,255,.095),rgba(255,255,255,.045));
  color:#edf8ff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.085),0 7px 18px rgba(0,0,0,.08);
  font-size:12px;
  font-weight:650;
  letter-spacing:.005em;
}
body.crm-app.bg-theme1 .crm-btn i { font-size:16px; opacity:.92; }
body.crm-app.bg-theme1 .crm-btn:hover { border-color:rgba(219,241,255,.27); background:linear-gradient(145deg,rgba(255,255,255,.145),rgba(255,255,255,.07)); box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 10px 22px rgba(0,0,0,.11); }
body.crm-app.bg-theme1 .crm-btn-primary {
  color:#fff;
  border-color:rgba(210,241,255,.24);
  background:linear-gradient(135deg,#17a2e8 0%,#3a8eef 48%,#6968ea 100%);
  box-shadow:0 12px 28px rgba(39,110,220,.28),inset 0 1px 0 rgba(255,255,255,.28);
}
body.crm-app.bg-theme1 .crm-btn-primary:hover { background:linear-gradient(135deg,#2cb0ef,#4b99f4 48%,#7773f0); box-shadow:0 15px 34px rgba(39,110,220,.34),inset 0 1px 0 rgba(255,255,255,.31); }
body.crm-app.bg-theme1 .crm-btn-soft-primary { color:#dff8ff; border-color:rgba(93,216,255,.26); background:linear-gradient(135deg,rgba(19,132,201,.26),rgba(82,93,219,.18)); }
body.crm-app.bg-theme1 .crm-btn-soft-primary:hover { color:#fff; border-color:rgba(105,222,255,.42); background:linear-gradient(135deg,rgba(24,150,222,.38),rgba(92,103,231,.27)); }
body.crm-app.bg-theme1 .crm-btn-soft-success { color:#d7ffef; border-color:rgba(102,225,189,.23); background:linear-gradient(135deg,rgba(24,133,101,.28),rgba(25,94,88,.19)); }
body.crm-app.bg-theme1 .crm-btn-soft-success:hover { border-color:rgba(107,232,195,.39); background:linear-gradient(135deg,rgba(27,154,116,.39),rgba(28,111,101,.27)); }
body.crm-app.bg-theme1 .crm-btn-soft-warning { color:#fff1c5; border-color:rgba(255,204,96,.24); background:linear-gradient(135deg,rgba(169,112,18,.27),rgba(118,75,17,.18)); }
body.crm-app.bg-theme1 .crm-btn-soft-warning:hover { border-color:rgba(255,210,109,.42); background:linear-gradient(135deg,rgba(188,126,21,.39),rgba(136,86,18,.26)); }
body.crm-app.bg-theme1 .crm-btn-soft-danger { color:#ffd7de; border-color:rgba(255,113,137,.25); background:linear-gradient(135deg,rgba(151,38,67,.27),rgba(107,29,50,.19)); }
body.crm-app.bg-theme1 .crm-btn-soft-danger:hover { border-color:rgba(255,126,147,.43); background:linear-gradient(135deg,rgba(172,43,75,.40),rgba(126,34,58,.28)); }
body.crm-app.bg-theme1 .crm-btn-link { color:#9de7ff; padding-inline:7px; border-color:transparent; background:transparent; box-shadow:none; }
body.crm-app.bg-theme1 .crm-btn-link:hover { color:#fff; background:rgba(92,218,255,.09); }
body.crm-app.bg-theme1 .crm-btn-sm { min-height:34px; padding:7px 10px; border-radius:10px; font-size:11px; }
body.crm-app.bg-theme1 .crm-icon-btn { width:38px; min-width:38px; height:38px; padding:0; }

/* Bootstrap outline buttons are mapped to the same premium visual language */
body.crm-app.bg-theme1 .btn-outline-primary,
body.crm-app.bg-theme1 .btn-outline-secondary,
body.crm-app.bg-theme1 .btn-outline-danger {
  min-height:40px;
  border-radius:12px;
  font-weight:600;
  transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
body.crm-app.bg-theme1 .btn-outline-primary { color:#a7e9ff !important; border-color:rgba(89,215,255,.42) !important; background:rgba(13,89,137,.14) !important; }
body.crm-app.bg-theme1 .btn-outline-primary:hover { color:#fff !important; border-color:rgba(108,225,255,.64) !important; background:linear-gradient(135deg,rgba(20,139,207,.42),rgba(72,91,213,.30)) !important; box-shadow:0 9px 24px rgba(28,108,190,.14); }
body.crm-app.bg-theme1 .btn-outline-secondary { color:#e2edf6 !important; border-color:rgba(218,237,251,.25) !important; background:rgba(255,255,255,.045) !important; }
body.crm-app.bg-theme1 .btn-outline-secondary:hover { color:#fff !important; border-color:rgba(228,242,252,.38) !important; background:rgba(255,255,255,.10) !important; }
body.crm-app.bg-theme1 .btn-outline-danger { color:#ffb7c3 !important; border-color:rgba(255,112,136,.43) !important; background:rgba(121,26,51,.13) !important; }
body.crm-app.bg-theme1 .btn-outline-danger:hover { color:#fff !important; border-color:rgba(255,124,145,.64) !important; background:rgba(164,39,70,.36) !important; box-shadow:0 9px 24px rgba(153,33,64,.12); }

/* Status pills — elegant semantic tone with an illuminated dot */
body.crm-app.bg-theme1 .crm-badge,
body.crm-app.bg-theme1 .rounded-pill.bg-light-secondary,
body.crm-app.bg-theme1 .rounded-pill.bg-light-success,
body.crm-app.bg-theme1 .rounded-pill.bg-light-warning,
body.crm-app.bg-theme1 .rounded-pill.bg-light-info,
body.crm-app.bg-theme1 .rounded-pill.bg-light-danger {
  min-height:27px;
  padding:5px 10px !important;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  letter-spacing:.01em;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}
body.crm-app.bg-theme1 .bg-light-secondary { color:#e5eff7 !important; background:rgba(109,135,155,.22) !important; border:1px solid rgba(205,227,243,.15); }
body.crm-app.bg-theme1 .bg-light-success { color:#c8ffea !important; background:rgba(19,119,87,.34) !important; border:1px solid rgba(99,225,188,.18); }
body.crm-app.bg-theme1 .bg-light-warning { color:#ffe9ae !important; background:rgba(148,99,19,.34) !important; border:1px solid rgba(255,202,92,.18); }
body.crm-app.bg-theme1 .bg-light-info { color:#c5f5ff !important; background:rgba(17,110,160,.34) !important; border:1px solid rgba(89,216,255,.18); }
body.crm-app.bg-theme1 .bg-light-danger { color:#ffd0d8 !important; background:rgba(136,33,59,.34) !important; border:1px solid rgba(255,113,137,.18); }
body.crm-app.bg-theme1 .table .bg-light-success { color:#c8ffea !important; background:rgba(20,112,83,.27) !important; }

/* Inputs/selects — deep translucent controls with clear affordances */
body.crm-app.bg-theme1 .form-label { margin-bottom:7px; color:#e9f4fb; font-size:11px; font-weight:650; letter-spacing:.015em; }
body.crm-app.bg-theme1 .form-control,
body.crm-app.bg-theme1 .form-select,
body.crm-app.bg-theme1 .input-group-text {
  min-height:43px;
  border:1px solid rgba(188,224,250,.20) !important;
  border-radius:12px;
  color:#f8fbff !important;
  background-color:rgba(3,25,43,.58) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 5px 16px rgba(0,0,0,.04);
}
body.crm-app.bg-theme1 .form-control:hover,
body.crm-app.bg-theme1 .form-select:hover { border-color:rgba(193,229,253,.31) !important; background-color:rgba(4,31,52,.67) !important; }
body.crm-app.bg-theme1 .form-control:focus,
body.crm-app.bg-theme1 .form-select:focus {
  border-color:rgba(96,215,255,.66) !important;
  background-color:rgba(3,28,48,.78) !important;
  box-shadow:0 0 0 3px rgba(72,193,244,.11),inset 0 1px 0 rgba(255,255,255,.05) !important;
}
body.crm-app.bg-theme1 .form-control[readonly],
body.crm-app.bg-theme1 .form-control:disabled,
body.crm-app.bg-theme1 .form-select:disabled { color:#d4e1eb !important; background-color:rgba(156,176,190,.15) !important; border-color:rgba(214,231,242,.14) !important; opacity:1; }
body.crm-app.bg-theme1 .form-select {
  padding-right:2.65rem;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d8f5ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") !important;
  background-size:16px 16px !important;
  background-position:right .9rem center !important;
}
html[dir="rtl"] body.crm-app.bg-theme1 .form-select { padding-right:.85rem; padding-left:2.65rem; background-position:left .9rem center !important; }
body.crm-app.bg-theme1 .form-select option { color:#eff8ff; background:#0a263d; }

/* Tabs — premium segmented navigation, no clipping */
body.crm-app.bg-theme1 .nav-tabs {
  display:flex;
  align-items:center;
  gap:5px;
  width:max-content;
  max-width:100%;
  margin:0;
  padding:5px;
  overflow:visible;
  border:1px solid rgba(205,233,252,.13) !important;
  border-radius:14px;
  background:rgba(3,24,41,.36);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
body.crm-app.bg-theme1 .nav-tabs .nav-link {
  position:relative;
  min-height:37px;
  margin:0 !important;
  padding:8px 14px !important;
  border:1px solid transparent !important;
  border-radius:10px !important;
  color:#b8ccda !important;
  background:transparent !important;
  font-size:11px;
  font-weight:650;
  white-space:nowrap;
  box-shadow:none !important;
}
body.crm-app.bg-theme1 .nav-tabs .nav-link:hover { color:#effaff !important; background:rgba(255,255,255,.055) !important; }
body.crm-app.bg-theme1 .nav-tabs .nav-link.active,
body.crm-app.bg-theme1 .nav-primary.nav-tabs .nav-link.active,
body.crm-app.bg-theme1 .nav-success.nav-tabs .nav-link.active,
body.crm-app.bg-theme1 .nav-warning.nav-tabs .nav-link.active,
body.crm-app.bg-theme1 .nav-danger.nav-tabs .nav-link.active {
  color:#fff !important;
  border-color:rgba(196,235,255,.18) !important;
  background:linear-gradient(135deg,rgba(43,142,208,.50),rgba(84,88,194,.42)) !important;
  box-shadow:0 7px 18px rgba(8,35,66,.18),inset 0 1px 0 rgba(255,255,255,.13) !important;
}
@media (max-width:767.98px) {
  body.crm-app.bg-theme1 .nav-tabs { width:100%; overflow-x:auto; overflow-y:hidden; flex-wrap:nowrap; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  body.crm-app.bg-theme1 .nav-tabs::-webkit-scrollbar { display:none; }
  body.crm-app.bg-theme1 .nav-tabs .nav-link { flex:0 0 auto; }
}

/* Action bars used above tables / in configuration screens */
.crm-action-bar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:12px 14px;
  border:1px solid rgba(201,232,253,.12);
  border-radius:15px;
  background:rgba(3,24,41,.27);
}
.crm-action-bar-group { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.crm-selection-counter { display:inline-flex; align-items:center; gap:8px; color:#c9dce9; font-size:11px; }
.crm-selection-counter strong { min-width:25px; height:25px; display:grid; place-items:center; border-radius:8px; color:#8fe7ff; background:rgba(24,124,184,.23); font-size:10px; }
.crm-search-shell { position:relative; min-width:250px; }
.crm-search-shell > i { position:absolute; left:13px; top:50%; transform:translateY(-50%); z-index:2; color:#8eb0c4; font-size:17px; }
.crm-search-shell .form-control { padding-left:39px; }
html[dir="rtl"] .crm-search-shell > i { left:auto; right:13px; }
html[dir="rtl"] .crm-search-shell .form-control { padding-left:.85rem; padding-right:39px; }

/* DataTables — clean finance table: fixed toolbar, compact head, refined pagination */
body.crm-app.bg-theme1 .dataTables_wrapper > .row:first-child { align-items:center; margin-bottom:14px; }
body.crm-app.bg-theme1 .dataTables_wrapper > .row:last-child { align-items:center; margin-top:13px; }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_length,
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter { color:#b8cbd9; font-size:11px; }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter { text-align:right !important; }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter label { position:relative; display:inline-flex; align-items:center; margin:0; }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter label .crm-dt-search-icon { position:absolute; left:12px; z-index:2; color:#7fa8bf; font-size:16px; line-height:1; pointer-events:none; }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter input {
  width:250px;
  min-height:40px;
  margin:0 !important;
  padding-left:36px !important;
  border:1px solid rgba(190,224,248,.18) !important;
  border-radius:12px !important;
  color:#f6fbff !important;
  background:rgba(3,25,43,.50) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025) !important;
}
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter input:focus { border-color:rgba(92,212,255,.52) !important; box-shadow:0 0 0 3px rgba(65,188,240,.09) !important; }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_length label { display:inline-flex; align-items:center; gap:7px; margin:0; color:#a8c0d0; }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_length select { min-width:68px; min-height:36px; border-radius:10px !important; }
body.crm-app.bg-theme1 table.dataTable { border-collapse:separate !important; border-spacing:0; }
body.crm-app.bg-theme1 table.dataTable thead th {
  padding-top:13px !important;
  padding-bottom:13px !important;
  border-top:1px solid rgba(200,230,249,.11) !important;
  border-bottom:1px solid rgba(214,237,252,.20) !important;
  color:#dcecf6 !important;
  background:rgba(2,20,35,.20);
  font-size:10px;
  font-weight:750;
  text-transform:uppercase;
  letter-spacing:.055em;
}
body.crm-app.bg-theme1 table.dataTable tbody td { padding-top:13px !important; padding-bottom:13px !important; border-bottom:1px solid rgba(205,231,248,.085) !important; color:#e7f2f9; vertical-align:middle; }
body.crm-app.bg-theme1 table.dataTable tbody tr { background:rgba(255,255,255,.025) !important; transition:background .14s ease,box-shadow .14s ease; }
body.crm-app.bg-theme1 table.dataTable tbody tr:nth-child(even) { background:rgba(255,255,255,.043) !important; }
body.crm-app.bg-theme1 table.dataTable tbody tr:hover { background:rgba(83,186,230,.095) !important; box-shadow:inset 3px 0 0 rgba(92,215,255,.40); }
body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_info { padding-top:0 !important; color:#a8c0d0 !important; font-size:10px; }
body.crm-app.bg-theme1 .dataTables_wrapper .pagination { gap:5px; }
body.crm-app.bg-theme1 .dataTables_wrapper .page-link { min-width:34px; min-height:34px; display:grid; place-items:center; padding:5px 9px; border:1px solid rgba(205,233,251,.12) !important; border-radius:9px !important; color:#cfe0ec !important; background:rgba(3,24,41,.40) !important; box-shadow:none !important; }
body.crm-app.bg-theme1 .dataTables_wrapper .page-item.active .page-link { color:#fff !important; border-color:rgba(110,220,255,.34) !important; background:linear-gradient(135deg,#168ed4,#586ee2) !important; box-shadow:0 7px 18px rgba(43,102,199,.20) !important; }
body.crm-app.bg-theme1 .dataTables_wrapper .page-item.disabled .page-link { opacity:.42; }
body.crm-app.bg-theme1 .crm-datatable-scroll { border:1px solid rgba(201,232,251,.10); border-radius:15px; background:rgba(3,23,39,.18); }
body.crm-app.bg-theme1 .crm-datatable-scroll::-webkit-scrollbar { height:7px; }
body.crm-app.bg-theme1 .crm-datatable-scroll::-webkit-scrollbar-track { background:rgba(1,16,28,.26); }
body.crm-app.bg-theme1 .crm-datatable-scroll::-webkit-scrollbar-thumb { background:linear-gradient(90deg,rgba(86,195,233,.34),rgba(112,111,232,.34)); border-radius:999px; }
html[dir="rtl"] body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter { text-align:left !important; }
html[dir="rtl"] body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter label .crm-dt-search-icon { left:auto; right:12px; }
html[dir="rtl"] body.crm-app.bg-theme1 .dataTables_wrapper .dataTables_filter input { padding-left:12px !important; padding-right:36px !important; }

/* Optional true mobile cards for DataTables */
@media (max-width:767.98px) {
  body.crm-app .dataTables_wrapper .dataTables_filter,
  body.crm-app .dataTables_wrapper .dataTables_length { width:100%; text-align:left !important; }
  body.crm-app .dataTables_wrapper .dataTables_filter label,
  body.crm-app .dataTables_wrapper .dataTables_filter input { width:100%; }
  body.crm-app .dataTables_wrapper .dataTables_filter { margin-top:8px; }
  body.crm-app .crm-datatable-scroll.crm-mobile-cards-wrap { overflow:visible; border:0; background:transparent; }
  body.crm-app table.crm-mobile-cards { min-width:0 !important; width:100% !important; }
  body.crm-app table.crm-mobile-cards thead { display:none; }
  body.crm-app table.crm-mobile-cards tbody { display:grid; gap:10px; }
  body.crm-app table.crm-mobile-cards tbody tr { display:block; overflow:hidden; border:1px solid rgba(203,232,251,.12); border-radius:15px; background:rgba(5,31,52,.56) !important; box-shadow:inset 0 1px 0 rgba(255,255,255,.035); }
  body.crm-app table.crm-mobile-cards tbody td { display:grid; grid-template-columns:minmax(95px,38%) 1fr; gap:12px; width:100% !important; padding:10px 13px !important; text-align:right; border-bottom:1px solid rgba(204,232,250,.075) !important; white-space:normal !important; }
  body.crm-app table.crm-mobile-cards tbody td::before { content:attr(data-label); color:#91aec1; font-size:9px; font-weight:700; text-align:left; text-transform:uppercase; letter-spacing:.055em; }
  body.crm-app table.crm-mobile-cards tbody td:last-child { border-bottom:0 !important; }
  body.crm-app table.crm-mobile-cards.crm-sticky-actions th:last-child,
  body.crm-app table.crm-mobile-cards.crm-sticky-actions td:last-child { position:static !important; background:transparent !important; box-shadow:none !important; }
}

/* Sticky actions use a solid-enough glass surface so text never bleeds through */
body.crm-app.bg-theme1 .crm-datatable-scroll table.crm-sticky-actions th:last-child,
body.crm-app.bg-theme1 .crm-datatable-scroll table.crm-sticky-actions td:last-child { background:rgba(6,31,52,.96) !important; backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); }
body.crm-app.bg-theme1 .crm-datatable-scroll table.crm-sticky-actions thead th:last-child { background:rgba(5,28,48,.985) !important; }

/* Parent navigation active state — main section remains unmistakably selected */
body.crm-app.bg-theme1 .sidebar-wrapper .metismenu a.crm-url-active,
body.crm-app.bg-theme1 .sidebar-wrapper .metismenu > li.mm-active > a {
  position:relative;
  color:#fff !important;
  border:1px solid rgba(198,231,252,.11);
  background:linear-gradient(135deg,rgba(43,132,191,.28),rgba(81,90,188,.21));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 8px 20px rgba(0,0,0,.06);
}
body.crm-app.bg-theme1 .sidebar-wrapper .metismenu a.crm-url-active::before,
body.crm-app.bg-theme1 .sidebar-wrapper .metismenu > li.mm-active > a::before { content:""; position:absolute; left:0; top:10px; bottom:10px; width:2px; border-radius:999px; background:linear-gradient(#74e1ff,#6875ff); box-shadow:0 0 12px rgba(91,215,255,.55); }
html[dir="rtl"] body.crm-app.bg-theme1 .sidebar-wrapper .metismenu a.crm-url-active::before,
html[dir="rtl"] body.crm-app.bg-theme1 .sidebar-wrapper .metismenu > li.mm-active > a::before { left:auto; right:0; }

/* Modal — premium finance dialog, not a black legacy panel */
body.crm-app.bg-theme1 .modal-content {
  border:1px solid rgba(207,235,253,.17) !important;
  border-radius:23px !important;
  background:
    radial-gradient(circle at 96% -5%,rgba(104,98,239,.20),transparent 32%),
    linear-gradient(150deg,rgba(8,37,61,.985),rgba(4,22,38,.992)) !important;
  box-shadow:0 38px 110px rgba(1,9,18,.64),inset 0 1px 0 rgba(255,255,255,.075) !important;
}
body.crm-app.bg-theme1 .modal-header { padding:19px 22px; border-bottom:1px solid rgba(211,236,252,.11) !important; }
body.crm-app.bg-theme1 .modal-body { padding:22px; }
body.crm-app.bg-theme1 .modal-footer { padding:15px 22px; border-top:1px solid rgba(211,236,252,.10) !important; background:rgba(1,18,31,.18); }
body.crm-app.bg-theme1 .modal-title { font-size:17px; font-weight:700; letter-spacing:-.015em; }
body.crm-app.bg-theme1 .modal-backdrop.show { opacity:.74; background:#020b14; backdrop-filter:blur(7px); -webkit-backdrop-filter:blur(7px); }

/* SweetAlert2 — premium compact confirmation card */
body.crm-app.bg-theme1 .swal2-container { background:rgba(1,8,16,.63) !important; backdrop-filter:blur(7px); -webkit-backdrop-filter:blur(7px); }
body.crm-app.bg-theme1 .swal2-popup.crm-swal {
  position:relative;
  overflow:hidden;
  width:min(470px,calc(100vw - 28px)) !important;
  max-width:470px !important;
  padding:25px 26px 24px !important;
  border:1px solid rgba(206,234,252,.17) !important;
  border-radius:24px !important;
  color:#f8fbff !important;
  background:
    radial-gradient(circle at 88% -2%,rgba(106,99,239,.18),transparent 31%),
    linear-gradient(150deg,rgba(8,38,63,.995),rgba(4,20,35,.998)) !important;
  box-shadow:0 42px 120px rgba(0,7,15,.68),inset 0 1px 0 rgba(255,255,255,.075) !important;
}
body.crm-app.bg-theme1 .swal2-popup.crm-swal::before { content:""; position:absolute; inset:0 0 auto; height:2px; background:linear-gradient(90deg,#55d9ff,#6876ff 62%,transparent); opacity:.88; }
body.crm-app.bg-theme1 .swal2-icon {
  width:64px !important;
  height:64px !important;
  margin:1px auto 16px !important;
  border:0 !important;
  border-radius:18px !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 12px 28px rgba(0,0,0,.12) !important;
}
body.crm-app.bg-theme1 .swal2-icon.swal2-warning { color:#ffcd62 !important; background:rgba(164,108,20,.24) !important; }
body.crm-app.bg-theme1 .swal2-icon.swal2-error { color:#ff8194 !important; background:rgba(144,35,61,.24) !important; }
body.crm-app.bg-theme1 .swal2-icon.swal2-success { color:#72e4c2 !important; background:rgba(21,117,88,.24) !important; }
body.crm-app.bg-theme1 .swal2-icon.swal2-info,
body.crm-app.bg-theme1 .swal2-icon.swal2-question { color:#6edcff !important; background:rgba(16,102,154,.24) !important; }
body.crm-app.bg-theme1 .swal2-icon .swal2-icon-content { font-size:42px !important; font-weight:500; }
body.crm-app.bg-theme1 .swal2-title,
body.crm-app.bg-theme1 .crm-swal-title { margin:0 !important; padding:0 4px !important; color:#fff !important; font-size:21px !important; line-height:1.3 !important; font-weight:720 !important; letter-spacing:-.025em; }
body.crm-app.bg-theme1 .swal2-html-container,
body.crm-app.bg-theme1 .crm-swal-copy { margin:9px auto 0 !important; padding:0 8px !important; max-width:390px; color:#b9cedc !important; font-size:13px !important; line-height:1.6 !important; }
body.crm-app.bg-theme1 .swal2-actions,
body.crm-app.bg-theme1 .crm-swal-actions { width:100% !important; display:grid !important; grid-template-columns:1fr 1fr; gap:9px !important; margin:22px 0 0 !important; }
body.crm-app.bg-theme1 .swal2-styled,
body.crm-app.bg-theme1 .crm-swal-btn { width:100%; min-width:0 !important; min-height:42px; margin:0 !important; border-radius:12px !important; font-size:12px !important; font-weight:700 !important; }
body.crm-app.bg-theme1 .swal2-confirm,
body.crm-app.bg-theme1 .crm-swal-confirm { color:#fff !important; border:1px solid rgba(202,239,255,.20) !important; background:linear-gradient(135deg,#168ed5,#536fe5) !important; box-shadow:0 10px 24px rgba(32,104,199,.23) !important; }
body.crm-app.bg-theme1 .swal2-cancel,
body.crm-app.bg-theme1 .crm-swal-cancel { color:#d9e8f2 !important; border:1px solid rgba(211,235,251,.16) !important; background:rgba(255,255,255,.055) !important; box-shadow:inset 0 1px 0 rgba(255,255,255,.035) !important; }
body.crm-app.bg-theme1 .swal2-popup.crm-swal-danger::before { background:linear-gradient(90deg,#ff7088,#ffb35b 70%,transparent); }
body.crm-app.bg-theme1 .swal2-popup.crm-swal-danger .swal2-confirm { background:linear-gradient(135deg,#e74f6a,#c93f5b) !important; box-shadow:0 10px 24px rgba(173,42,70,.22) !important; }
body.crm-app.bg-theme1 .swal2-close { color:#7792a5 !important; }
body.crm-app.bg-theme1 .swal2-close:hover { color:#fff !important; }
body.crm-app.bg-theme1 .swal2-toast.crm-swal { width:360px !important; padding:12px 14px !important; border-radius:15px !important; }
body.crm-app.bg-theme1 .swal2-toast .swal2-icon { width:31px !important; height:31px !important; margin:0 9px 0 0 !important; border-radius:9px !important; }
body.crm-app.bg-theme1 .swal2-toast .swal2-title { font-size:12px !important; text-align:left; }

/* Visual samples / micro-components used by boutons-crm.html */
.crm-showcase-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:14px; }
.crm-showcase-span-8 { grid-column:span 8; }
.crm-showcase-span-7 { grid-column:span 7; }
.crm-showcase-span-6 { grid-column:span 6; }
.crm-showcase-span-5 { grid-column:span 5; }
.crm-showcase-span-4 { grid-column:span 4; }
.crm-component-label { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.crm-component-kicker { color:#89aabd; font-size:9px; font-weight:750; letter-spacing:.12em; text-transform:uppercase; }
.crm-component-title { margin:3px 0 0; color:#fff; font-size:16px; font-weight:680; letter-spacing:-.018em; }
.crm-component-note { color:#8daabd; font-size:10px; }
.crm-demo-surface { padding:16px; border:1px solid rgba(204,233,251,.10); border-radius:16px; background:rgba(2,21,37,.23); }
.crm-demo-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.crm-segmented-actions { display:inline-flex; gap:3px; padding:4px; border:1px solid rgba(203,232,251,.11); border-radius:13px; background:rgba(2,20,35,.32); }
.crm-segmented-actions .crm-btn { min-height:34px; border:0; border-radius:9px; box-shadow:none; background:transparent; }
.crm-segmented-actions .crm-btn.is-active { background:rgba(79,158,214,.23); color:#fff; box-shadow:inset 0 1px 0 rgba(255,255,255,.06); }
.crm-field-hint { margin-top:6px; color:#7596aa; font-size:9px; }
.crm-status-dot { display:inline-block; width:6px; height:6px; margin-right:5px; border-radius:50%; background:currentColor; box-shadow:0 0 9px currentColor; vertical-align:1px; opacity:.9; }
.crm-mini-stat { padding:14px; border:1px solid rgba(202,232,251,.10); border-radius:15px; background:rgba(3,23,40,.22); }
.crm-mini-stat-label { color:#86a4b8; font-size:9px; text-transform:uppercase; letter-spacing:.09em; }
.crm-mini-stat-value { margin-top:5px; color:#fff; font-size:18px; font-weight:680; letter-spacing:-.02em; }
.crm-mini-stat-foot { margin-top:6px; color:#78dcbf; font-size:9px; }
@media (max-width:991.98px) {
  .crm-premium-hero { align-items:flex-start; flex-direction:column; min-height:0; }
  .crm-premium-hero-actions { justify-content:flex-start; }
  .crm-showcase-span-8,.crm-showcase-span-7,.crm-showcase-span-6,.crm-showcase-span-5,.crm-showcase-span-4 { grid-column:span 12; }
}
@media (max-width:575.98px) {
  .crm-premium-hero { padding:21px 18px; border-radius:20px; }
  .crm-premium-hero h1 { font-size:27px; }
  .crm-card-head,.crm-card-body { padding-left:16px !important; padding-right:16px !important; }
  .crm-action-bar { align-items:stretch; }
  .crm-action-bar-group { width:100%; }
  .crm-search-shell { width:100%; min-width:0; }
  body.crm-app.bg-theme1 .swal2-actions,body.crm-app.bg-theme1 .crm-swal-actions { grid-template-columns:1fr; }
}


/* ==========================================================================
   v1.5 — Full application shell RTL
   Mirrors the complete Dashtrans shell, not only component text direction.
   Sidebar, topbar, page offsets, footer, off-canvas mobile states and the
   built-in Chat / E-mail mini-apps all follow the active document direction.
   ========================================================================== */

html[dir="rtl"] body.crm-app {
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
}

/* Bootstrap 5 LTR bundle: restore logical start/end utilities in RTL. */
html[dir="rtl"] body.crm-app .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir="rtl"] body.crm-app .me-auto { margin-right: 0 !important; margin-left: auto !important; }
html[dir="rtl"] body.crm-app .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
html[dir="rtl"] body.crm-app .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
html[dir="rtl"] body.crm-app .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
html[dir="rtl"] body.crm-app .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
html[dir="rtl"] body.crm-app .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir="rtl"] body.crm-app .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir="rtl"] body.crm-app .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
html[dir="rtl"] body.crm-app .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
html[dir="rtl"] body.crm-app .ps-1 { padding-left: 0 !important; padding-right: .25rem !important; }
html[dir="rtl"] body.crm-app .ps-2 { padding-left: 0 !important; padding-right: .5rem !important; }
html[dir="rtl"] body.crm-app .ps-3 { padding-left: 0 !important; padding-right: 1rem !important; }
html[dir="rtl"] body.crm-app .ps-4 { padding-left: 0 !important; padding-right: 1.5rem !important; }
html[dir="rtl"] body.crm-app .pe-1 { padding-right: 0 !important; padding-left: .25rem !important; }
html[dir="rtl"] body.crm-app .pe-2 { padding-right: 0 !important; padding-left: .5rem !important; }
html[dir="rtl"] body.crm-app .pe-3 { padding-right: 0 !important; padding-left: 1rem !important; }
html[dir="rtl"] body.crm-app .pe-4 { padding-right: 0 !important; padding-left: 1.5rem !important; }
html[dir="rtl"] body.crm-app .text-start { text-align: right !important; }
html[dir="rtl"] body.crm-app .text-end { text-align: left !important; }
html[dir="rtl"] body.crm-app .float-start { float: right !important; }
html[dir="rtl"] body.crm-app .float-end { float: left !important; }

/* Main Dashtrans shell — desktop. */
html[dir="rtl"] body.crm-app .sidebar-wrapper {
  left: auto !important;
  right: 0 !important;
  border-right: 0 !important;
  border-left: 1px solid rgb(255 255 255 / 15%);
}
html[dir="rtl"] body.crm-app .sidebar-header {
  left: auto !important;
  right: 0 !important;
}
html[dir="rtl"] body.crm-app .sidebar-header .logo-text {
  margin-left: 0 !important;
  margin-right: 10px !important;
}
html[dir="rtl"] body.crm-app .sidebar-header .toggle-icon {
  margin-left: 0 !important;
  margin-right: auto !important;
}
html[dir="rtl"] body.crm-app .sidebar-wrapper .simplebar-track.simplebar-vertical {
  right: auto !important;
  left: 0 !important;
}
html[dir="rtl"] body.crm-app .topbar {
  left: 0 !important;
  right: 250px !important;
}
html[dir="rtl"] body.crm-app .topbar .navbar { direction: rtl; }
html[dir="rtl"] body.crm-app .page-wrapper {
  margin-left: 0 !important;
  margin-right: 250px !important;
}
html[dir="rtl"] body.crm-app .page-footer {
  left: 0 !important;
  right: 250px !important;
}
html[dir="rtl"] body.crm-app .wrapper.toggled .topbar {
  left: 0 !important;
  right: 70px !important;
}
html[dir="rtl"] body.crm-app .wrapper.toggled .page-wrapper {
  margin-left: 0 !important;
  margin-right: 70px !important;
}
html[dir="rtl"] body.crm-app .wrapper.toggled .page-footer {
  left: 0 !important;
  right: 70px !important;
}

/* Main navigation internals. */
html[dir="rtl"] body.crm-app .sidebar-wrapper .metismenu,
html[dir="rtl"] body.crm-app .sidebar-wrapper .metismenu ul { direction: rtl; }
html[dir="rtl"] body.crm-app .sidebar-wrapper .metismenu a {
  justify-content: flex-start;
  text-align: right;
}
html[dir="rtl"] body.crm-app .sidebar-wrapper .metismenu a .menu-title {
  margin-left: 0 !important;
  margin-right: 10px !important;
}
html[dir="rtl"] body.crm-app .sidebar-wrapper .metismenu ul a i {
  margin-right: 0 !important;
  margin-left: 10px !important;
}
html[dir="rtl"] body.crm-app .sidebar-wrapper .metismenu ul ul a { padding: 8px 30px 8px 15px; }
html[dir="rtl"] body.crm-app .sidebar-wrapper .metismenu ul ul ul a { padding: 8px 45px 8px 15px; }
html[dir="rtl"] body.crm-app .menu-label {
  padding: 20px 5px 5px 15px;
  text-align: right;
}
html[dir="rtl"] body.crm-app .metismenu .has-arrow::after {
  right: auto !important;
  left: 15px !important;
  transform: rotate(135deg) translateY(-50%) !important;
}
html[dir="rtl"] body.crm-app .metismenu .mm-active > .has-arrow::after,
html[dir="rtl"] body.crm-app .metismenu .has-arrow[aria-expanded="true"]::after {
  transform: rotate(225deg) translateY(-50%) !important;
}

/* Topbar details and dropdown anchoring. */
html[dir="rtl"] body.crm-app .search-control,
html[dir="rtl"] body.crm-app .search-control:focus {
  padding-right: .75rem;
  padding-left: 2.5rem;
}
html[dir="rtl"] body.crm-app .search-show,
html[dir="rtl"] body.crm-app .search-close {
  right: auto !important;
  left: 15px !important;
}
html[dir="rtl"] body.crm-app .user-box {
  border-left: 0;
  border-right: 1px solid rgb(255 255 255 / 15%);
  margin-left: 0;
  margin-right: 1rem;
}
html[dir="rtl"] body.crm-app .user-box .dropdown-menu i {
  margin-right: 0;
  margin-left: 10px;
}
html[dir="rtl"] body.crm-app .dropdown-menu-end {
  right: auto !important;
  left: 0 !important;
}
html[dir="rtl"] body.crm-app .dropdown-menu-start {
  left: auto !important;
  right: 0 !important;
}
html[dir="rtl"] body.crm-app .topbar .navbar .dropdown-menu::after,
html[dir="rtl"] body.crm-app .topbar .navbar .dropdown-large .dropdown-menu::after {
  right: auto !important;
  left: 16px !important;
}

/* Breadcrumbs and physical direction icons. */
html[dir="rtl"] body.crm-app .breadcrumb-title {
  border-right: 0;
  border-left: 1.5px solid rgb(255 255 255 / 34%);
}
html[dir="rtl"] body.crm-app .page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  padding-right: 0;
  padding-left: .5rem;
  transform: scaleX(-1);
}
html[dir="rtl"] body.crm-app .bx-right-arrow-alt,
html[dir="rtl"] body.crm-app .bx-left-arrow-alt,
html[dir="rtl"] body.crm-app .bx-chevron-right,
html[dir="rtl"] body.crm-app .bx-chevron-left {
  transform: scaleX(-1);
}
html[dir="rtl"] body.crm-app .back-to-top {
  right: auto;
  left: 12px;
}

/* Native Bootstrap modal alignment. */
html[dir="rtl"] body.crm-app .modal-header .btn-close {
  margin: -.5rem auto -.5rem -.5rem;
}
html[dir="rtl"] body.crm-app .modal-footer { justify-content: flex-start; }
html[dir="rtl"] body.crm-app .input-group > :not(:first-child):not(.dropdown-menu) {
  margin-left: 0;
  margin-right: -1px;
}

/* DataTables: controls remain outside horizontal table scrolling and mirror naturally. */
html[dir="rtl"] body.crm-app .dataTables_wrapper .dataTables_length,
html[dir="rtl"] body.crm-app .dataTables_wrapper .dataTables_info { text-align: right !important; }
html[dir="rtl"] body.crm-app .dataTables_wrapper .dataTables_filter,
html[dir="rtl"] body.crm-app .dataTables_wrapper .dataTables_paginate { text-align: left !important; }
html[dir="rtl"] body.crm-app table.dataTable thead > tr > th.sorting::before,
html[dir="rtl"] body.crm-app table.dataTable thead > tr > th.sorting::after {
  right: auto;
}

/* Dashtrans chat mini-app. */
html[dir="rtl"] body.crm-app .chat-sidebar {
  left: auto;
  right: 0;
  border-right: 0;
  border-left: 1px solid rgb(255 255 255 / 15%);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: .25rem;
  border-bottom-right-radius: .25rem;
}
html[dir="rtl"] body.crm-app .chat-content { margin-left: 0; margin-right: 340px; }
html[dir="rtl"] body.crm-app .chat-header,
html[dir="rtl"] body.crm-app .chat-footer {
  left: 0;
  right: 340px;
}
html[dir="rtl"] body.crm-app .chat-header { border-top-right-radius: 0; border-top-left-radius: .25rem; }
html[dir="rtl"] body.crm-app .chat-footer { border-bottom-right-radius: 0; border-bottom-left-radius: .25rem; }
html[dir="rtl"] body.crm-app .chat-toggle-btn { margin-right: 0; margin-left: 15px; }
html[dir="rtl"] body.crm-app .chat-sidebar-header .chat-user-online::before { left: auto; right: 40px; }
html[dir="rtl"] body.crm-app .chat-list .chat-user-online::before { left: auto; right: 36px; }

/* Dashtrans e-mail mini-app. */
html[dir="rtl"] body.crm-app .email-sidebar {
  left: auto;
  right: 0;
  border-right: 0;
  border-left: 1px solid rgb(255 255 255 / 14%);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: .25rem;
  border-bottom-right-radius: .25rem;
}
html[dir="rtl"] body.crm-app .email-header {
  left: 0;
  right: 250px;
  border-top-right-radius: 0;
  border-top-left-radius: .25rem;
}
html[dir="rtl"] body.crm-app .email-content {
  margin-left: 0;
  margin-right: 250px;
}
html[dir="rtl"] body.crm-app .email-toggle-btn { margin-right: 0; margin-left: 10px; }
html[dir="rtl"] body.crm-app .email-hangout .chat-user-online::before { left: auto; right: 37px; }
html[dir="rtl"] body.crm-app .compose-mail-popup { right: auto; left: 30px; }

/* True mobile RTL off-canvas behavior. The sidebar and its header enter from the right. */
@media screen and (max-width: 1024px) {
  html[dir="rtl"] body.crm-app .topbar {
    left: 0 !important;
    right: 0 !important;
  }
  html[dir="rtl"] body.crm-app .sidebar-wrapper {
    left: auto !important;
    right: -300px !important;
    border-left: 1px solid rgb(255 255 255 / 12%);
  }
  html[dir="rtl"] body.crm-app .sidebar-wrapper .sidebar-header {
    position: absolute;
    top: -60px;
    bottom: auto !important;
    left: auto !important;
    right: 0 !important;
  }
  html[dir="rtl"] body.crm-app .page-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html[dir="rtl"] body.crm-app .page-footer {
    left: 0 !important;
    right: 0 !important;
  }
  html[dir="rtl"] body.crm-app .wrapper.toggled .sidebar-wrapper { right: 0 !important; }
  html[dir="rtl"] body.crm-app .wrapper.toggled .page-wrapper { margin-right: 0 !important; }
  html[dir="rtl"] body.crm-app .wrapper.toggled .topbar { right: 0 !important; }
  html[dir="rtl"] body.crm-app .wrapper.toggled .page-footer { right: 0 !important; }
  html[dir="rtl"] body.crm-app .full-search-bar { left: 0; right: 0; }

  html[dir="rtl"] body.crm-app .chat-sidebar { left: auto; right: -370px; }
  html[dir="rtl"] body.crm-app .chat-content { margin-left: 0; margin-right: 0; }
  html[dir="rtl"] body.crm-app .chat-header,
  html[dir="rtl"] body.crm-app .chat-footer { left: 0; right: 0; }
  html[dir="rtl"] body.crm-app .chat-toggled .chat-sidebar { left: auto; right: 0; }
  html[dir="rtl"] body.crm-app .chat-toggled .overlay { left: 0; right: 340px; }

  html[dir="rtl"] body.crm-app .email-sidebar { left: auto; right: -280px; }
  html[dir="rtl"] body.crm-app .email-content { margin-left: 0; margin-right: 0; }
  html[dir="rtl"] body.crm-app .email-header { left: 0; right: 0; }
  html[dir="rtl"] body.crm-app .email-toggled .email-sidebar { left: auto; right: 0; }
  html[dir="rtl"] body.crm-app .email-toggled .overlay { left: 0; right: 250px; }

  html[dir="rtl"] body.crm-app .compose-mail-popup { right: 12px; left: 12px; width: auto; }
  html[dir="rtl"] body.crm-app .back-to-top { left: 12px; right: auto; }
}

/* Mobile card tables: label/value alignment follows the reading direction. */
@media (max-width: 767.98px) {
  html[dir="rtl"] body.crm-app table.crm-mobile-cards tbody td { text-align: left; }
  html[dir="rtl"] body.crm-app table.crm-mobile-cards tbody td::before { text-align: right; }
  html[dir="rtl"] body.crm-app .crm-table-cards tbody td { text-align: start; }
  html[dir="rtl"] body.crm-app .crm-table-cards tbody td::before { text-align: right; }
  html[dir="rtl"] body.crm-app .crm-table-cards .crm-table-sub { text-align: start; }
  html[dir="rtl"] body.crm-app .crm-table-cards .crm-table-actions { justify-content: flex-start; }
}

/* ==========================================================================
   v1.6 — Mobile polish, premium steppers, multilingual date picker & calendar
   ========================================================================== */

/* ---------- Mobile action containment: never let a button escape its card ---------- */
.crm-demo-surface,
.crm-demo-actions,
.crm-segmented-actions,
.crm-action-bar,
.crm-action-bar-group { min-width: 0; max-width: 100%; }

.crm-btn,
.btn { max-width: 100%; }

@media (max-width: 575.98px) {
  body.crm-app .crm-demo-surface { padding: 13px; }
  body.crm-app .crm-demo-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  body.crm-app .crm-demo-actions .crm-btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-inline: 10px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
  body.crm-app .crm-segmented-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
  }
  body.crm-app .crm-segmented-actions .crm-btn {
    width: 100%;
    min-width: 0;
    padding-inline: 6px;
    justify-content: center;
    white-space: normal;
  }
  body.crm-app .crm-card-body > .d-flex.flex-wrap.gap-2 > .btn,
  body.crm-app .crm-card-body > .d-flex.flex-wrap.gap-2 > .crm-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    white-space: normal;
  }
  body.crm-app .crm-premium-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  body.crm-app .crm-premium-hero-actions .crm-btn { width: 100%; justify-content: center; }
}

@media (max-width: 359.98px) {
  body.crm-app .crm-demo-actions { grid-template-columns: 1fr; }
  body.crm-app .crm-card-body > .d-flex.flex-wrap.gap-2 > .btn,
  body.crm-app .crm-card-body > .d-flex.flex-wrap.gap-2 > .crm-btn { flex-basis: 100%; }
}

/* ---------- Mobile sidebar: opaque enough to remain readable ---------- */
@media screen and (max-width: 1024px) {
  body.crm-app .sidebar-wrapper {
    background:
      linear-gradient(180deg, rgba(5, 25, 42, .995), rgba(4, 37, 56, .995)) !important;
    box-shadow: 24px 0 52px rgba(0, 0, 0, .38) !important;
  }
  body.crm-app .sidebar-header {
    background: rgba(4, 22, 38, .995) !important;
    border-bottom: 1px solid rgba(205, 235, 252, .11);
  }
  html[dir="rtl"] body.crm-app .sidebar-wrapper {
    box-shadow: -24px 0 52px rgba(0, 0, 0, .38) !important;
  }
  body.crm-app .wrapper.toggled .overlay {
    opacity: .72 !important;
    background: #020913 !important;
  }
}

/* ---------- DataTables/cards: values must wrap instead of being clipped ---------- */
@media (max-width: 767.98px) {
  body.crm-app table.crm-mobile-cards tbody tr { width: 100%; min-width: 0; }
  body.crm-app table.crm-mobile-cards tbody td {
    grid-template-columns: minmax(82px, 34%) minmax(0, 1fr);
    min-width: 0;
    overflow: visible;
  }
  body.crm-app table.crm-mobile-cards tbody td > * {
    min-width: 0;
    max-width: 100%;
  }
  body.crm-app table.crm-mobile-cards tbody td,
  body.crm-app table.crm-mobile-cards tbody td > *,
  body.crm-app table.crm-mobile-cards tbody td strong,
  body.crm-app table.crm-mobile-cards tbody td span:not(.crm-status-dot) {
    overflow-wrap: anywhere;
    word-break: normal;
  }
  body.crm-app table.crm-mobile-cards tbody td .crm-badge,
  body.crm-app table.crm-mobile-cards tbody td .rounded-pill,
  body.crm-app table.crm-mobile-cards tbody td .crm-status {
    width: max-content;
    max-width: 100%;
    justify-self: end;
    white-space: normal;
    text-align: center;
  }
  body.crm-app table.crm-mobile-cards tbody td:last-child {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: left !important;
    background: rgba(2, 20, 34, .68) !important;
  }
  body.crm-app table.crm-mobile-cards tbody td:last-child::before {
    display: block;
    width: 100%;
  }
  body.crm-app table.crm-mobile-cards tbody td:last-child > .d-flex,
  body.crm-app table.crm-mobile-cards tbody td:last-child .crm-table-actions {
    width: 100%;
    display: flex !important;
    flex-wrap: wrap;
    gap: 7px !important;
    justify-content: flex-start;
  }
  body.crm-app table.crm-mobile-cards tbody td:last-child .crm-btn:not(.crm-icon-btn) {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    white-space: normal;
  }
  body.crm-app table.crm-mobile-cards tbody td:last-child .crm-icon-btn {
    flex: 0 0 38px;
  }

  /* Native premium table cards used in crm-invoices.html */
  body.crm-app .crm-table-cards tbody td,
  body.crm-app .crm-table-cards tbody td > * {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  body.crm-app .crm-table-cards .crm-table-actions { flex-wrap: wrap; }
}

html[dir="rtl"] body.crm-app table.crm-mobile-cards tbody td .crm-badge,
html[dir="rtl"] body.crm-app table.crm-mobile-cards tbody td .rounded-pill,
html[dir="rtl"] body.crm-app table.crm-mobile-cards tbody td .crm-status { justify-self: start; }

/* ---------- Universal number input stepper ---------- */
body.crm-app input[type="number"]::-webkit-inner-spin-button,
body.crm-app input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body.crm-app input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.crm-number-field {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid rgba(203, 233, 251, .16);
  border-radius: 13px;
  background: rgba(3, 24, 41, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.crm-number-field:focus-within {
  border-color: rgba(91, 217, 255, .52);
  background: rgba(3, 28, 48, .48);
  box-shadow: 0 0 0 3px rgba(64, 190, 242, .09), inset 0 1px 0 rgba(255,255,255,.06);
}
.crm-number-field > input[type="number"] {
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 7px 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  color: #f5fbff !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.crm-number-step {
  appearance: none;
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
  border: 0;
  color: #c9e9f9;
  background: rgba(255, 255, 255, .045);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: color .14s ease, background .14s ease;
}
.crm-number-step:first-child { border-right: 1px solid rgba(205, 233, 250, .10); }
.crm-number-step:last-child { border-left: 1px solid rgba(205, 233, 250, .10); }
.crm-number-step:hover { color: #fff; background: rgba(78, 185, 232, .16); }
.crm-number-step:active { background: rgba(78, 185, 232, .25); }
.crm-number-step:focus-visible { outline: 2px solid rgba(91,217,255,.75); outline-offset: -3px; }
.crm-number-step:disabled { opacity: .32; cursor: not-allowed; }
.input-group > .crm-number-field { flex: 1 1 auto; width: 1%; }
.input-group > .crm-number-field:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .crm-number-field + .input-group-text { border-top-left-radius: 0; border-bottom-left-radius: 0; }
html[dir="rtl"] .crm-number-step:first-child { border-right: 0; border-left: 1px solid rgba(205, 233, 250, .10); }
html[dir="rtl"] .crm-number-step:last-child { border-left: 0; border-right: 1px solid rgba(205, 233, 250, .10); }

@media (max-width: 575.98px) {
  .crm-number-field { grid-template-columns: 46px minmax(0, 1fr) 46px; min-height: 48px; }
  .crm-number-field > input[type="number"] { height: 46px !important; min-height: 46px !important; font-size: 16px !important; }
  .crm-number-step { width: 46px; min-width: 46px; font-size: 22px; }
}

/* ---------- CRM Premium multilingual date picker ---------- */
.crm-datepicker-shell { position: relative; width: 100%; min-width: 0; }
.crm-datepicker-shell > input { padding-inline-end: 42px !important; cursor: pointer; }
.crm-datepicker-trigger {
  position: absolute;
  top: 50%;
  right: 7px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  color: #ccecff;
  background: transparent;
  cursor: pointer;
}
.crm-datepicker-trigger:hover { color: #fff; background: rgba(89, 213, 255, .10); }
html[dir="rtl"] .crm-datepicker-shell > input { padding-right: 13px !important; padding-left: 42px !important; }
html[dir="rtl"] .crm-datepicker-trigger { right: auto; left: 7px; }

.crm-datepicker-backdrop { display: none; }
.crm-datepicker-popover {
  position: absolute;
  z-index: 1090;
  top: calc(100% + 8px);
  left: 0;
  width: min(330px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid rgba(204, 235, 253, .17);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 0%, rgba(110, 101, 255, .20), transparent 30%),
    linear-gradient(155deg, rgba(5, 30, 50, .995), rgba(11, 42, 69, .995));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255,255,255,.07);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px) scale(.985);
  transform-origin: top left;
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.crm-datepicker-shell.is-open .crm-datepicker-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
html[dir="rtl"] .crm-datepicker-popover { left: auto; right: 0; transform-origin: top right; }
.crm-datepicker-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; align-items: center; gap: 7px; margin-bottom: 12px; }
.crm-datepicker-nav {
  width: 36px; height: 36px; display:grid; place-items:center; padding:0;
  border:1px solid rgba(204,235,253,.12); border-radius:10px;
  color:#d9effb; background:rgba(255,255,255,.045); cursor:pointer;
}
.crm-datepicker-nav:hover { color:#fff; border-color:rgba(91,216,255,.29); background:rgba(79,176,225,.14); }
.crm-datepicker-title { min-width:0; text-align:center; color:#fff; font-size:13px; font-weight:700; text-transform:capitalize; }
.crm-datepicker-weekdays,
.crm-datepicker-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; }
.crm-datepicker-weekdays { margin-bottom:5px; }
.crm-datepicker-weekday { padding:4px 0; color:#7799ad; font-size:9px; font-weight:750; text-align:center; text-transform:uppercase; letter-spacing:.04em; }
.crm-datepicker-day {
  aspect-ratio:1;
  min-width:0;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid transparent;
  border-radius:10px;
  color:#d9e9f3;
  background:transparent;
  font-size:11px;
  font-weight:600;
  cursor:pointer;
  font-variant-numeric:tabular-nums;
}
.crm-datepicker-day:hover { color:#fff; border-color:rgba(88,214,255,.22); background:rgba(72,178,224,.11); }
.crm-datepicker-day.is-outside { color:#4d6c80; }
.crm-datepicker-day.is-today { border-color:rgba(89,216,255,.34); color:#b8efff; }
.crm-datepicker-day.is-selected {
  color:#fff;
  border-color:rgba(215,242,255,.24);
  background:linear-gradient(135deg,#159bdc,#4f81ec 56%,#716de9);
  box-shadow:0 7px 17px rgba(42,111,211,.25),inset 0 1px 0 rgba(255,255,255,.24);
}
.crm-datepicker-day:disabled { opacity:.25; cursor:not-allowed; }
.crm-datepicker-foot { display:flex; align-items:center; justify-content:space-between; gap:7px; margin-top:11px; padding-top:10px; border-top:1px solid rgba(204,233,250,.09); }
.crm-datepicker-foot button { min-height:32px; padding:5px 9px; border:1px solid rgba(202,232,250,.12); border-radius:9px; color:#bcd5e4; background:rgba(255,255,255,.04); font-size:10px; font-weight:650; cursor:pointer; }
.crm-datepicker-foot button:hover { color:#fff; background:rgba(82,184,231,.12); }
.crm-datepicker-foot .crm-datepicker-today { color:#b5eeff; border-color:rgba(90,215,255,.20); }

@media (max-width: 575.98px) {
  .crm-datepicker-backdrop {
    position: fixed;
    z-index: 1088;
    inset: 0;
    display: block;
    background: rgba(1, 8, 15, .74);
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s ease, visibility .15s ease;
  }
  .crm-datepicker-shell.is-open .crm-datepicker-backdrop { opacity:1; visibility:visible; }
  .crm-datepicker-popover,
  html[dir="rtl"] .crm-datepicker-popover {
    position: fixed;
    z-index: 1090;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    padding: 15px;
    border-radius: 21px;
    transform: translateY(18px) scale(.99);
    transform-origin: bottom center;
  }
  .crm-datepicker-shell.is-open .crm-datepicker-popover { transform:translateY(0) scale(1); }
  .crm-datepicker-day { min-height:40px; aspect-ratio:auto; border-radius:11px; font-size:13px; }
  .crm-datepicker-weekday { font-size:10px; }
  .crm-datepicker-title { font-size:14px; }
  .crm-datepicker-nav { width:40px; height:40px; }
  .crm-datepicker-head { grid-template-columns:40px minmax(0,1fr) 40px; }
  .crm-datepicker-foot button { min-height:38px; padding-inline:13px; }
}

/* ---------- FullCalendar premium treatment ---------- */
body.crm-app .crm-calendar-shell,
body.crm-app #calendar {
  min-width: 0;
}
body.crm-app .fc { color:#e8f3f9; font-size:12px; }
body.crm-app .fc .fc-toolbar { gap:10px; margin-bottom:15px !important; }
body.crm-app .fc .fc-toolbar-chunk { display:flex; align-items:center; gap:6px; min-width:0; }
body.crm-app .fc .fc-toolbar-title { color:#fff; font-size:clamp(18px,2.1vw,24px); font-weight:700; letter-spacing:-.025em; text-transform:capitalize; }
body.crm-app .fc .fc-button-primary {
  min-height:38px;
  padding:7px 11px;
  border:1px solid rgba(206,235,252,.16) !important;
  border-radius:10px !important;
  color:#ddecf6 !important;
  background:rgba(6,35,57,.58) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.045) !important;
  font-size:11px !important;
  font-weight:650 !important;
  text-transform:none !important;
}
body.crm-app .fc .fc-button-primary:hover,
body.crm-app .fc .fc-button-primary:focus { color:#fff !important; border-color:rgba(91,216,255,.33) !important; background:rgba(43,128,183,.32) !important; box-shadow:none !important; }
body.crm-app .fc .fc-button-primary:not(:disabled).fc-button-active { color:#fff !important; background:linear-gradient(135deg,#148fd1,#546ee2) !important; }
body.crm-app .fc .fc-button-group { gap:5px; }
body.crm-app .fc .fc-button-group > .fc-button { margin:0 !important; border-radius:10px !important; }
body.crm-app .fc-theme-standard td,
body.crm-app .fc-theme-standard th,
body.crm-app .fc-theme-standard .fc-scrollgrid { border-color:rgba(207,234,250,.10) !important; }
body.crm-app .fc-theme-standard .fc-scrollgrid { overflow:hidden; border-radius:16px; background:rgba(3,24,41,.24); }
body.crm-app .fc .fc-col-header-cell { background:rgba(4,28,47,.70); }
body.crm-app .fc .fc-col-header-cell-cushion { padding:10px 5px; color:#a9c0cf; font-size:10px; font-weight:750; text-transform:uppercase; letter-spacing:.045em; }
body.crm-app .fc .fc-daygrid-day-number { padding:7px 8px; color:#dcebf4; font-size:11px; }
body.crm-app .fc .fc-day-today { background:rgba(74,176,224,.09) !important; }
body.crm-app .fc .fc-day-other { background:rgba(0,0,0,.08); }
body.crm-app .fc .fc-day-other .fc-daygrid-day-number { opacity:.35; }
body.crm-app .fc .fc-event {
  margin:2px 4px;
  padding:3px 5px;
  border:1px solid rgba(209,237,253,.12) !important;
  border-radius:7px;
  color:#fff !important;
  background:linear-gradient(135deg,rgba(18,142,207,.86),rgba(86,102,226,.83)) !important;
  box-shadow:0 5px 12px rgba(20,77,143,.15);
  font-size:9px;
}
body.crm-app .fc .fc-daygrid-more-link { color:#99e4ff; font-size:9px; font-weight:700; }
body.crm-app .fc .fc-list { border:0 !important; border-radius:15px; overflow:hidden; background:rgba(3,24,41,.30); }
body.crm-app .fc .fc-list-day-cushion { padding:9px 11px; color:#dff5ff; background:rgba(8,48,76,.84); }
body.crm-app .fc .fc-list-event td { padding:11px 9px; border-color:rgba(205,233,250,.08); color:#e7f2f8; }
body.crm-app .fc .fc-list-event:hover td { background:rgba(74,177,225,.08); }
body.crm-app .fc .fc-list-event-dot { border-color:#5ddcff; }

@media (max-width:767.98px) {
  body.crm-app .fc .fc-toolbar {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:8px;
  }
  body.crm-app .fc .fc-toolbar-chunk { justify-content:center; width:100%; }
  body.crm-app .fc .fc-toolbar-title { font-size:19px; text-align:center; }
  body.crm-app .fc .fc-button-primary { min-height:40px; }
  body.crm-app .fc .fc-list-event td { padding:12px 8px; font-size:11px; }
  body.crm-app .fc .fc-list-event-time { width:72px; color:#93b4c8; }
  body.crm-app .fc .fc-list-event-title a { white-space:normal; overflow-wrap:anywhere; }
}

/* Date/time showcase page cards */
.crm-datepicker-showcase { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.crm-datepicker-preview { padding:18px; border:1px solid rgba(204,233,251,.11); border-radius:17px; background:rgba(3,24,41,.26); }
@media (max-width:767.98px) { .crm-datepicker-showcase { grid-template-columns:1fr; } }

/* v1.6 patch: premium number field inside CRM's own input group */
.crm-input-group > .crm-number-field { flex:1 1 auto; width:1%; border-top-right-radius:0; border-bottom-right-radius:0; }
.crm-input-group > .crm-number-field + .crm-input-addon { border-top-left-radius:0; border-bottom-left-radius:0; }
html[dir="rtl"] .crm-input-group > .crm-number-field { border-radius:0 11px 11px 0; }
html[dir="rtl"] .crm-input-group > .crm-number-field + .crm-input-addon { border-radius:11px 0 0 11px; }

/* Date pickers may live inside glass cards; temporarily release clipping while open. */
body.crm-app .crm-card:has(.crm-datepicker-shell.is-open),
body.crm-app .card:has(.crm-datepicker-shell.is-open) { overflow:visible; position:relative; z-index:30; }
.crm-datepicker-shell.is-align-end .crm-datepicker-popover { left:auto; right:0; transform-origin:top right; }
.crm-datepicker-shell.is-drop-up .crm-datepicker-popover { top:auto; bottom:calc(100% + 8px); transform-origin:bottom left; }
.crm-datepicker-shell.is-drop-up.is-align-end .crm-datepicker-popover { transform-origin:bottom right; }
html[dir="rtl"] .crm-datepicker-shell.is-align-end .crm-datepicker-popover { right:auto; left:0; }
@media (max-width:575.98px) {
  .crm-datepicker-shell.is-align-end .crm-datepicker-popover,
  .crm-datepicker-shell.is-drop-up .crm-datepicker-popover,
  .crm-datepicker-shell.is-drop-up.is-align-end .crm-datepicker-popover { left:10px; right:10px; top:auto; bottom:max(10px, env(safe-area-inset-bottom)); transform-origin:bottom center; }
}

/* ========================================================================== 
   V1.27 — Modal & Form UI Contract
   Une seule identité visuelle pour Core + modules. Les modules structurent
   le contenu mais ne rethèment pas les primitives Bootstrap/Select2.
   ========================================================================== */
body.crm-app.bg-theme1 .modal.crm-modal .modal-content,
body.crm-app.bg-theme1 .modal .modal-content {
  overflow:hidden;
  color:var(--crm-t1-white,#f8fbff);
}
body.crm-app.bg-theme1 .modal .modal-header,
body.crm-app.bg-theme1 .modal .modal-body,
body.crm-app.bg-theme1 .modal .modal-footer { position:relative; z-index:1; }
body.crm-app.bg-theme1 .modal .modal-header {
  min-height:68px;
  background:rgba(2,20,35,.36);
}
body.crm-app.bg-theme1 .modal .modal-footer {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.65rem;
  min-height:72px;
  background:rgba(2,18,31,.58) !important;
}
body.crm-app.bg-theme1 .modal .modal-footer > .btn,
body.crm-app.bg-theme1 .modal .modal-footer > .crm-btn { margin:0; }
body.crm-app.bg-theme1 .modal .modal-footer > .btn.btn-secondary {
  border:1px solid rgba(194,227,249,.20) !important;
  color:#e9f5fc !important;
  background:rgba(10,43,68,.72) !important;
  border-radius:12px !important;
}
body.crm-app.bg-theme1 .modal .modal-footer > .btn.btn-primary {
  border:1px solid rgba(119,214,255,.40) !important;
  color:#fff !important;
  background:linear-gradient(135deg,#269ee7,#6a68f4) !important;
  border-radius:12px !important;
  box-shadow:0 9px 24px rgba(45,126,227,.19) !important;
}
body.crm-app.bg-theme1 .modal .form-label {
  color:#edf7fd !important;
  font-size:12px;
  font-weight:680;
}
body.crm-app.bg-theme1 .modal .form-text,
body.crm-app.bg-theme1 .modal .crm-form-help {
  color:rgba(205,226,240,.68) !important;
}
body.crm-app.bg-theme1 .modal .invalid-feedback { color:#ff9aae !important; }
body.crm-app.bg-theme1 .modal .form-control,
body.crm-app.bg-theme1 .modal .form-select,
body.crm-app.bg-theme1 .modal .input-group-text {
  border-color:rgba(194,229,252,.22) !important;
  color:#f8fbff !important;
  background-color:rgba(5,31,51,.88) !important;
}
body.crm-app.bg-theme1 .modal .form-control:hover:not(:disabled):not([readonly]),
body.crm-app.bg-theme1 .modal .form-select:hover:not(:disabled) {
  border-color:rgba(111,215,255,.39) !important;
  background-color:rgba(6,38,62,.94) !important;
}
body.crm-app.bg-theme1 .modal .form-control:focus,
body.crm-app.bg-theme1 .modal .form-select:focus {
  border-color:rgba(98,216,255,.72) !important;
  background-color:rgba(4,35,58,.98) !important;
  box-shadow:0 0 0 3px rgba(72,193,244,.12) !important;
}
body.crm-app.bg-theme1 .modal .form-control[readonly],
body.crm-app.bg-theme1 .modal .form-control:disabled,
body.crm-app.bg-theme1 .modal .form-select:disabled,
body.crm-app.bg-theme1 .modal.crm-modal-readonly .form-control,
body.crm-app.bg-theme1 .modal.crm-modal-readonly .form-select {
  color:#d7e6f0 !important;
  -webkit-text-fill-color:#d7e6f0 !important;
  background-color:rgba(139,164,183,.13) !important;
  border-color:rgba(207,231,246,.15) !important;
  opacity:1 !important;
  cursor:default;
}
body.crm-app.bg-theme1 .modal.crm-modal-readonly .form-select,
body.crm-app.bg-theme1 .modal .form-select:disabled {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23aec6d8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") !important;
}
body.crm-app.bg-theme1 .modal .form-select option {
  color:#eff8ff !important;
  background:#0a263d !important;
}
.crm-form-section {
  padding:1rem;
  border:1px solid rgba(196,229,255,.12);
  border-radius:15px;
  background:rgba(255,255,255,.025);
}
.crm-readonly-control {
  min-height:43px;
  display:flex;
  align-items:center;
  width:100%;
  padding:.65rem .85rem;
  border:1px solid rgba(207,231,246,.15);
  border-radius:12px;
  color:#d7e6f0;
  background:rgba(139,164,183,.13);
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Select2 — même contrat visuel que form-select, en page et surtout en modal. */
body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 { width:100% !important; }
body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection,
body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection {
  min-height:43px !important;
  border:1px solid rgba(194,229,252,.22) !important;
  border-radius:12px !important;
  color:#f8fbff !important;
  background:rgba(5,31,51,.88) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035) !important;
}
body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection--single .select2-selection__rendered {
  min-height:41px;
  display:flex;
  align-items:center;
  padding:0 2.5rem 0 .85rem !important;
  color:#f8fbff !important;
  line-height:1.35 !important;
}
html[dir="rtl"] body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
html[dir="rtl"] body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding:0 .85rem 0 2.5rem !important;
}
body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection__placeholder,
body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection__placeholder { color:rgba(215,232,244,.50) !important; }
body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow,
body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection--single .select2-selection__arrow {
  width:2.35rem !important;
  height:41px !important;
  right:.2rem !important;
}
html[dir="rtl"] body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow,
html[dir="rtl"] body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection--single .select2-selection__arrow { right:auto !important; left:.2rem !important; }
body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b,
body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color:#d9f4ff transparent transparent transparent !important;
}
body.crm-app.bg-theme1 .modal .select2-container--focus .select2-selection,
body.crm-app.bg-theme1 .modal .select2-container--open .select2-selection {
  border-color:rgba(98,216,255,.72) !important;
  background:rgba(4,35,58,.98) !important;
  box-shadow:0 0 0 3px rgba(72,193,244,.12) !important;
}
body.crm-app.bg-theme1 .modal .select2-container--disabled .select2-selection,
body.crm-app.bg-theme1 .modal.crm-modal-readonly .select2-selection {
  border-color:rgba(207,231,246,.15) !important;
  color:#d7e6f0 !important;
  background:rgba(139,164,183,.13) !important;
  opacity:1 !important;
}
body.crm-app.bg-theme1 .modal .select2-container--disabled .select2-selection__rendered,
body.crm-app.bg-theme1 .modal.crm-modal-readonly .select2-selection__rendered { color:#d7e6f0 !important; }
body.crm-app.bg-theme1 .select2-container--open .select2-dropdown {
  overflow:hidden;
  border:1px solid rgba(167,218,250,.24) !important;
  border-radius:12px !important;
  color:#eef8ff !important;
  background:#08243a !important;
  box-shadow:0 20px 48px rgba(0,8,17,.48) !important;
}
body.crm-app.bg-theme1 .select2-container--open .select2-search--dropdown { padding:.55rem !important; background:#08243a !important; }
body.crm-app.bg-theme1 .select2-container--open .select2-search__field {
  min-height:40px;
  border:1px solid rgba(194,229,252,.22) !important;
  border-radius:10px !important;
  color:#f8fbff !important;
  background:rgba(3,25,43,.94) !important;
  outline:0 !important;
}
body.crm-app.bg-theme1 .select2-container--open .select2-results__options { background:#08243a !important; }
body.crm-app.bg-theme1 .select2-container--open .select2-results__option { color:#dcecf7 !important; padding:.62rem .75rem !important; }
body.crm-app.bg-theme1 .select2-container--open .select2-results__option[aria-selected="true"] { color:#fff !important; background:rgba(63,131,183,.30) !important; }
body.crm-app.bg-theme1 .select2-container--open .select2-results__option--highlighted[aria-selected] { color:#fff !important; background:linear-gradient(135deg,rgba(39,147,218,.78),rgba(102,94,231,.72)) !important; }

@media(max-width:767.98px){
  body.crm-app.bg-theme1 .modal .modal-header{padding:16px 17px;min-height:60px}
  body.crm-app.bg-theme1 .modal .modal-body{padding:17px}
  body.crm-app.bg-theme1 .modal .modal-footer{padding:13px 17px;min-height:64px;flex-wrap:wrap}
  body.crm-app.bg-theme1 .modal .modal-footer>.btn,
  body.crm-app.bg-theme1 .modal .modal-footer>.crm-btn{flex:1 1 150px;min-width:0}
}

/* ================================================================
   V1.28 — Native Select Chevron + Shared Rich Text Editor Contract
   ================================================================ */
body.crm-app.bg-theme1 .modal .form-select {
  padding-right:2.75rem !important;
  background-position:right .95rem center !important;
  background-size:16px 12px !important;
  background-repeat:no-repeat !important;
}
html[dir="rtl"] body.crm-app.bg-theme1 .modal .form-select {
  padding-right:.85rem !important;
  padding-left:2.75rem !important;
  background-position:left .95rem center !important;
}
body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow,
body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection--single .select2-selection__arrow {
  top:50% !important;
  height:auto !important;
  min-height:0 !important;
  transform:translateY(-50%) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
body.crm-app.bg-theme1 .modal .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b,
body.crm-app.bg-theme1 .modal .select2-container--default .select2-selection--single .select2-selection__arrow b {
  position:static !important;
  margin:0 !important;
}

.crm-rich-editor {
  overflow:hidden;
  border:1px solid rgba(194,229,252,.22);
  border-radius:14px;
  background:rgba(3,25,43,.96);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}
.crm-rich-view-tabs {
  display:flex;
  gap:.35rem;
  padding:.55rem .65rem 0;
  border-bottom:1px solid rgba(194,229,252,.12);
  background:rgba(5,31,51,.84);
}
.crm-rich-view {
  border:1px solid transparent;
  border-radius:9px 9px 0 0;
  padding:.42rem .75rem;
  color:rgba(216,232,244,.72);
  background:transparent;
  font-size:.79rem;
  font-weight:700;
}
.crm-rich-view:hover,.crm-rich-view:focus-visible { color:#fff; background:rgba(64,154,215,.12); outline:0; }
.crm-rich-view.active {
  color:#fff;
  border-color:rgba(105,208,255,.25);
  border-bottom-color:rgba(3,25,43,.96);
  background:rgba(3,25,43,.96);
}
.crm-rich-toolbar {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.28rem;
  padding:.62rem;
  border-bottom:1px solid rgba(194,229,252,.14);
  background:rgba(6,35,57,.96);
}
.crm-rich-format {
  min-width:145px;
  height:36px;
  padding:.25rem 2.2rem .25rem .65rem;
  border:1px solid rgba(194,229,252,.22);
  border-radius:9px;
  color:#f3f9fd;
  background-color:rgba(5,31,51,.96);
}
html[dir="rtl"] .crm-rich-format { padding-right:.65rem; padding-left:2.2rem; }
.crm-rich-tool,.crm-rich-color {
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  position:relative;
  border:1px solid rgba(194,229,252,.20);
  border-radius:9px;
  color:#eaf6ff;
  background:rgba(5,31,51,.78);
  cursor:pointer;
}
.crm-rich-tool:hover,.crm-rich-tool:focus-visible,.crm-rich-color:hover {
  color:#fff;
  border-color:rgba(108,211,255,.48);
  background:rgba(23,74,111,.78);
  outline:0;
}
.crm-rich-color input[type="color"] {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:pointer;
}
.crm-rich-surface,.crm-rich-source {
  width:100%;
  min-height:250px;
  max-height:58vh;
  overflow:auto;
  padding:1rem 1.05rem;
  border:0 !important;
  border-radius:0 !important;
  color:#f2f8fc !important;
  background:rgba(2,19,33,.96) !important;
  box-shadow:none !important;
  outline:0 !important;
  overflow-wrap:anywhere;
}
.crm-rich-surface:focus,.crm-rich-source:focus { box-shadow:inset 0 0 0 2px rgba(91,200,255,.34) !important; }
.crm-rich-surface:empty:before { content:attr(data-placeholder); color:rgba(204,226,240,.44); pointer-events:none; }
.crm-rich-source {
  display:none;
  resize:vertical;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  font-size:.82rem;
  line-height:1.55;
  white-space:pre;
  tab-size:2;
}
.crm-rich-editor.is-source .crm-rich-toolbar,.crm-rich-editor.is-source .crm-rich-surface { display:none; }
.crm-rich-editor.is-source .crm-rich-source { display:block; }
.crm-rich-meta {
  display:flex;
  justify-content:space-between;
  gap:.75rem;
  padding:.46rem .75rem;
  border-top:1px solid rgba(194,229,252,.12);
  color:rgba(207,226,239,.70);
  background:rgba(8,37,59,.92);
  font-size:.74rem;
}
.crm-rich-editor.is-readonly .crm-rich-view-tabs,.crm-rich-editor.is-readonly .crm-rich-toolbar { display:none; }
.crm-rich-editor.is-readonly .crm-rich-surface { min-height:120px; cursor:default; }
.crm-rich-surface h1,.crm-rich-surface h2,.crm-rich-surface h3,.crm-rich-surface h4,.crm-rich-surface h5,.crm-rich-surface h6 { color:#fff; margin:.75em 0 .35em; line-height:1.2; }
.crm-rich-surface h1{font-size:1.65rem}.crm-rich-surface h2{font-size:1.4rem}.crm-rich-surface h3{font-size:1.2rem}.crm-rich-surface h4{font-size:1.05rem}.crm-rich-surface h5{font-size:.95rem}.crm-rich-surface h6{font-size:.88rem}
.crm-rich-surface p { margin:.35rem 0 .8rem; }
.crm-rich-surface ul,.crm-rich-surface ol { padding-inline-start:1.55rem; margin:.45rem 0 .85rem; }
.crm-rich-surface blockquote { margin:.65rem 0; padding:.7rem .9rem; border-inline-start:3px solid rgba(104,204,255,.55); background:rgba(11,52,79,.64); border-radius:8px; color:#c9dae7; }
.crm-rich-surface pre,.crm-rich-surface code { font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; }
.crm-rich-surface pre { white-space:pre-wrap; padding:.75rem; border:1px solid rgba(194,229,252,.14); border-radius:9px; background:rgba(0,13,24,.72); }
.crm-rich-surface a { color:#7dc8ff; text-decoration:underline; }
.crm-rich-surface table { width:100%; border-collapse:collapse; margin:.75rem 0; }
.crm-rich-surface th,.crm-rich-surface td { border:1px solid rgba(145,203,240,.28); padding:.48rem .55rem; vertical-align:top; }
.crm-rich-surface th { background:rgba(11,54,83,.86); }
.crm-rich-surface hr { border:0; border-top:1px solid rgba(186,224,248,.28); margin:1rem 0; }
.crm-rich-surface mark { padding:.05em .2em; border-radius:.18em; }
html[dir="rtl"] .crm-rich-toolbar,html[dir="rtl"] .crm-rich-view-tabs { direction:rtl; }
html[dir="rtl"] .crm-rich-surface { text-align:right; }
@media(max-width:767.98px){
  .crm-rich-view-tabs{overflow-x:auto}
  .crm-rich-toolbar{gap:.22rem;padding:.48rem}
  .crm-rich-format{flex:1 1 100%;min-width:0}
  .crm-rich-tool,.crm-rich-color{width:34px;height:34px}
  .crm-rich-surface,.crm-rich-source{min-height:190px;max-height:52vh;padding:.85rem}
  .crm-rich-meta{align-items:flex-start;flex-direction:column;gap:.2rem}
}
.crm-rich-text-glyph{font-family:inherit;font-size:.8rem;font-weight:800;letter-spacing:-.03em}


/* V1.34 — feedback inline lisible sur les surfaces Premium sombres. */
.crm-feedback-panel {
  --crm-feedback-accent: #9fb2c8;
  --crm-feedback-bg: rgba(29, 52, 76, .78);
  --crm-feedback-border: rgba(159, 178, 200, .42);
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .9rem 1rem;
  border: 1px solid var(--crm-feedback-border);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--crm-feedback-bg), rgba(8, 31, 52, .92));
  color: #f4f8fc;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16), inset 3px 0 0 var(--crm-feedback-accent);
}
.crm-feedback-panel-success {
  --crm-feedback-accent: #72e6aa;
  --crm-feedback-bg: rgba(31, 111, 82, .24);
  --crm-feedback-border: rgba(114, 230, 170, .46);
}
.crm-feedback-panel-warning {
  --crm-feedback-accent: #ffd27a;
  --crm-feedback-bg: rgba(128, 92, 25, .26);
  --crm-feedback-border: rgba(255, 210, 122, .48);
}
.crm-feedback-panel-danger {
  --crm-feedback-accent: var(--crm-danger, #ff768a);
  --crm-feedback-bg: rgba(137, 39, 58, .26);
  --crm-feedback-border: rgba(255, 118, 138, .5);
}
.crm-feedback-icon {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--crm-feedback-accent) 16%, transparent);
  color: var(--crm-feedback-accent);
  font-size: 1.3rem;
}
.crm-feedback-content { min-width: 0; flex: 1 1 auto; }
.crm-feedback-kicker {
  margin-bottom: .12rem;
  color: var(--crm-feedback-accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.crm-feedback-title,
.crm-feedback-message,
.crm-feedback-detail { overflow-wrap: anywhere; }
.crm-feedback-title { color: #fff; font-size: .98rem; }
.crm-feedback-message { margin-top: .15rem; color: #f2f6fb; line-height: 1.45; }
.crm-feedback-detail { margin-top: .35rem; color: #c7d5e3; font-size: .86rem; line-height: 1.45; }
html[dir="rtl"] .crm-feedback-panel {
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16), inset -3px 0 0 var(--crm-feedback-accent);
}
@media (max-width: 575.98px) {
  .crm-feedback-panel { padding: .8rem; gap: .65rem; }
  .crm-feedback-icon { flex-basis: 1.8rem; width: 1.8rem; height: 1.8rem; }
}
