:root{
  --bg:#07131e;
  --bg2:#102232;
  --surface:#152737;
  --surface-2:#1b3145;
  --surface-3:#223a50;
  --border:rgba(255,255,255,.12);
  --text:#ffffff;
  --muted:rgba(255,255,255,.68);
  --accent:#4da3ff;
  --accent2:#8fc5ff;
  --success:#10b981;
  --warning:#f59e0b;
  --danger:#ef4444;
  --purple:#8b5cf6;
  --shadow:0 16px 40px rgba(0,0,0,.20);
  --radius:18px;
}

*{
  box-sizing:border-box;
}

html,
body{
  min-height:100%;
}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:linear-gradient(180deg,var(--bg2),var(--bg));
  color:var(--text);
}

body.light{
  --bg:#eef3f8;
  --bg2:#f8fbfd;
  --surface:#ffffff;
  --surface-2:#f6f9fc;
  --surface-3:#eef5fb;
  --border:rgba(15,23,42,.10);
  --text:#0f172a;
  --muted:rgba(15,23,42,.62);
  --accent:#2563eb;
  --accent2:#3b82f6;
  --shadow:0 12px 30px rgba(15,23,42,.08);

  background:
    radial-gradient(circle at top left, rgba(37,99,235,.06), transparent 22%),
    linear-gradient(180deg,var(--bg2),var(--bg));
}

body.modal-open{
  overflow:hidden;
}

a{
  color:inherit;
}

h1,h2,h3,h4{
  margin-top:0;
}

img{
  max-width:100%;
}

.muted{
  color:var(--muted);
}

/* =========================
TOPBAR
========================= */

.topbar{
  height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:0 20px;
  border-bottom:1px solid var(--border);
  background:rgba(0,0,0,.18);
  backdrop-filter:blur(10px);
}

body.light .topbar{
  background:rgba(255,255,255,.88);
}

.topbar-left{
  display:flex;
  align-items:center;
  min-width:0;
}

.topnav{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.inline-form{
  display:inline;
}

.theme-btn{
  width:38px;
  height:38px;
  border-radius:50%;
  border:1px solid var(--border);
  background:rgba(27,49,69,.95);
  color:var(--text);
  cursor:pointer;
}

body.light .theme-btn{
  background:#fff;
}

.avatar{
  width:38px;
  height:38px;
  border-radius:50%;
  background:var(--accent);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  color:#fff;
  box-shadow:0 10px 24px rgba(77,163,255,.22);
}

.topbar-user{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 10px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
}

body.light .topbar-user{
  background:rgba(37,99,235,.05);
  border-color:rgba(37,99,235,.10);
}

.topbar-user-copy{
  display:flex;
  flex-direction:column;
  line-height:1.15;
}

.topbar-user-copy strong{
  font-size:13px;
}

.topbar-user-copy span{
  font-size:11px;
  color:var(--muted);
}

/* =========================
BRAND
========================= */

.brand2{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  text-decoration:none;
  padding:8px 12px;
  border-radius:14px;
  transition:transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.brand2:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.06);
  box-shadow:0 10px 24px rgba(0,0,0,.14);
  text-decoration:none;
}

body.light .brand2:hover{
  background:rgba(37,99,235,.08);
  box-shadow:0 10px 24px rgba(15,23,42,.08);
}

.mark2{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:12px;
  font-size:18px;
  color:#fff;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  box-shadow:
    0 10px 22px rgba(77,163,255,.24),
    inset 0 1px 0 rgba(255,255,255,.18);
  animation:brandGlow 3.2s ease-in-out infinite;
}

.brand2-copy{
  display:flex;
  align-items:baseline;
  gap:8px;
  min-width:0;
}

.brand2-name{
  font-weight:900;
  letter-spacing:.08em;
  white-space:nowrap;
}

.brand2-tag{
  font-size:12px;
  opacity:.72;
  letter-spacing:.12em;
  display:none;
  white-space:nowrap;
}

@media (min-width:900px){
  .brand2-tag{
    display:inline;
  }
}

@keyframes brandGlow{
  0%,100%{
    box-shadow:
      0 10px 22px rgba(77,163,255,.24),
      inset 0 1px 0 rgba(255,255,255,.18);
  }
  50%{
    box-shadow:
      0 12px 28px rgba(77,163,255,.34),
      0 0 0 4px rgba(77,163,255,.08),
      inset 0 1px 0 rgba(255,255,255,.22);
  }
}

/* =========================
LAYOUT
========================= */

.shell{
  display:flex;
  min-height:calc(100vh - 72px);
}

.content{
  flex:1;
  padding:24px;
  animation:pageFade .28s ease;
}

@keyframes pageFade{
  from{
    opacity:0;
    transform:translateY(8px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

.page-head{
  margin-bottom:16px;
}

.row-between{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  flex-wrap:wrap;
}

/* =========================
SIDEBAR
========================= */

.sidebar{
  width:250px;
  padding:18px 14px;
  background:rgba(0,0,0,.16);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap:18px;
  transition:width .22s ease, padding .22s ease;
}

body.light .sidebar{
  background:rgba(255,255,255,.85);
}

.sidebar.collapsed{
  width:84px;
  padding:18px 10px;
}

.sidebar-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-bottom:10px;
}

.sidebar.collapsed .sidebar-top{
  justify-content:center;
}

.sidebar-logo{
  font-weight:900;
  font-size:18px;
  letter-spacing:.08em;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  transition:opacity .18s ease, width .18s ease;
}

.sidebar.collapsed .sidebar-logo{
  opacity:0;
  width:0;
}

.sidebar-toggle{
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  font-size:16px;
}

body.light .sidebar-toggle{
  background:#fff;
}

.sidebar.collapsed .sidebar-toggle{
  margin:0 auto;
}

.sidebar-menu{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.side-icon{
  width:22px;
  min-width:22px;
  text-align:center;
  font-size:15px;
  opacity:.92;
}

.side-link{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 12px;
  border-radius:14px;
  color:var(--text);
  text-decoration:none;
  font-weight:600;
  border:1px solid transparent;
  transition:transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.side-link:hover{
  background:rgba(255,255,255,.08);
  transform:translateX(4px);
}

body.light .side-link:hover{
  background:rgba(37,99,235,.08);
}

.side-link.active{
  background:rgba(77,163,255,.14);
  border-color:rgba(77,163,255,.28);
  box-shadow:0 8px 18px rgba(77,163,255,.12);
}

.side-link.active::before{
  content:"";
  position:absolute;
  left:-6px;
  top:8px;
  bottom:8px;
  width:3px;
  border-radius:999px;
  background:linear-gradient(180deg,var(--accent),var(--accent2));
}

body.light .side-link.active{
  background:rgba(37,99,235,.12);
  border-color:rgba(37,99,235,.20);
  box-shadow:0 8px 18px rgba(37,99,235,.10);
}

.side-label{
  white-space:nowrap;
  transition:opacity .18s ease, transform .18s ease, width .18s ease;
}

.sidebar.collapsed .side-label{
  opacity:0;
  width:0;
  overflow:hidden;
  transform:translateX(-4px);
}

.sidebar.collapsed .side-link{
  justify-content:center;
  padding:11px 10px;
}

.side-group{
  display:grid;
  gap:6px;
}

.side-group-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:11px 12px;
  border:none;
  border-radius:14px;
  background:transparent;
  color:var(--text);
  cursor:pointer;
  font:inherit;
  font-weight:600;
  border:1px solid transparent;
  transition:background .18s ease, transform .18s ease, border-color .18s ease;
}

.side-group-toggle:hover{
  background:rgba(255,255,255,.08);
  transform:translateX(3px);
}

body.light .side-group-toggle:hover{
  background:rgba(37,99,235,.08);
}

.side-group-main{
  display:flex;
  align-items:center;
  gap:12px;
}

.side-chevron{
  font-size:12px;
  opacity:.8;
  transition:transform .2s ease;
}

.side-group.open .side-chevron{
  transform:rotate(180deg);
}

.side-submenu{
  max-height:0;
  overflow:hidden;
  display:grid;
  gap:6px;
  transition:max-height .24s ease;
  padding-left:10px;
}

.side-sublink{
  margin-left:14px;
  padding-left:14px;
  background:rgba(255,255,255,.02);
}

body.light .side-sublink{
  background:rgba(37,99,235,.03);
}

.side-sublink .side-icon{
  font-size:13px;
  opacity:.8;
}

.sidebar.collapsed .side-chevron,
.sidebar.collapsed .side-submenu{
  display:none;
}

.sidebar.collapsed .side-group-toggle{
  justify-content:center;
  padding:11px 10px;
}

.sidebar.collapsed .side-group-main{
  justify-content:center;
}

/* =========================
CARDS / PANELS
========================= */

.kpi-card,
.panel,
.plan-card,
.form-card,
.havexa-visual-card{
  background:rgba(21,39,55,.95);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

body.light .kpi-card,
body.light .panel,
body.light .plan-card,
body.light .form-card,
body.light .havexa-visual-card{
  background:#fff;
}

.kpi-card,
.panel,
.plan-card,
.form-card{
  padding:18px;
}

.card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

/* =========================
GRIDS
========================= */

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:16px;
  width:100%;
}

.plans-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}

.charts-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin-top:16px;
}

.crm-grid{
  display:grid;
  grid-template-columns:420px 1fr;
  gap:18px;
}

.roof-ai-layout{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:18px;
}

.roof-ai-left,
.roof-ai-right{
  min-height:100%;
}

/* =========================
KPI
========================= */

.kpi-card{
  position:relative;
  padding:22px;
  border-radius:20px;
  transition:transform .16s ease, box-shadow .16s ease;
}

.kpi-card:hover{
  transform:translateY(-2px);
}

.kpi-top{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}

.kpi-icon{
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14);
}

.kpi-label{
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.kpi-value{
  font-size:38px;
  font-weight:900;
  line-height:1;
}

.kpi-link{
  color:inherit;
  text-decoration:none;
  display:inline-block;
  font-size:inherit;
  font-weight:inherit;
}

.kpi-link:hover{
  transform:scale(1.03);
  text-decoration:none;
}

.kpi-card::after{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:4px;
  border-radius:20px 0 0 20px;
  opacity:.95;
}

.kpi-card-users::after{
  background:linear-gradient(180deg,#8fc5ff,#4da3ff);
}

.kpi-card-users .kpi-icon{
  background:rgba(77,163,255,.16);
  color:#9ad0ff;
}

.kpi-card-customers::after{
  background:linear-gradient(180deg,#86efac,#10b981);
}

.kpi-card-customers .kpi-icon{
  background:rgba(16,185,129,.16);
  color:#86efac;
}

.kpi-card-quotes::after{
  background:linear-gradient(180deg,#c4b5fd,#8b5cf6);
}

.kpi-card-quotes .kpi-icon{
  background:rgba(139,92,246,.16);
  color:#d8c7ff;
}

body.light .kpi-card-users .kpi-icon{
  background:rgba(37,99,235,.10);
  color:#2563eb;
}

body.light .kpi-card-customers .kpi-icon{
  background:rgba(16,185,129,.10);
  color:#059669;
}

body.light .kpi-card-quotes .kpi-icon{
  background:rgba(139,92,246,.10);
  color:#7c3aed;
}

/* =========================
CHARTS
========================= */

.chart-box{
  position:relative;
  width:100%;
}

.compact-chart{
  height:220px;
}

.compact-chart canvas{
  width:100% !important;
  height:100% !important;
  display:block;
}

/* =========================
TABLES
========================= */

.table{
  width:100%;
  border-collapse:collapse;
}

.table th,
.table td{
  padding:12px 10px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}

.table a{
  color:var(--accent);
  text-decoration:none;
}

.table a:hover{
  text-decoration:underline;
}

.table td .btn{
  margin-right:6px;
}


.table thead th{
  background:var(--surface-2);
  color:var(--text);
  font-size:13px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  border-bottom:1px solid var(--border);
}

.table thead th:first-child{
  border-top-left-radius:14px;
}

.table thead th:last-child{
  border-top-right-radius:14px;
}

.table thead th button{
  appearance:none;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:inherit;
  letter-spacing:inherit;
  text-transform:inherit;
  cursor:pointer;
  padding:0;
}

body:not(.light) .table thead th{
  background:linear-gradient(180deg, rgba(30,51,73,.96), rgba(19,35,50,.96));
  color:rgba(255,255,255,.92);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}

body:not(.light) .table thead th button:hover,
body:not(.light) .table thead th button:focus-visible{
  color:#ffffff;
}

body.light .table thead th{
  background:#edf3f9;
  color:rgba(15,23,42,.78);
}

.crm-name{
  font-weight:800;
}

.crm-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

/* =========================
BUTTONS
========================= */

.btn{
  display:inline-block;
  padding:10px 16px;
  border-radius:12px;
  border:none;
  cursor:pointer;
  font-weight:700;
  text-decoration:none;
}

.btn.primary{
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:#fff;
}

.btn.ghost{
  background:transparent;
  border:1px solid var(--border);
  color:var(--text);
}

body.light .btn.ghost{
  background:#fff;
}

.btn-sm{
  padding:8px 12px;
  font-size:13px;
}

/* =========================
FORMS
========================= */

.form-grid{
  display:grid;
  gap:12px;
}

.form-grid label{
  display:grid;
  gap:6px;
  font-size:14px;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.search-input,
.command-input{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(27,49,69,.95);
  color:var(--text);
}

body.light .form-grid input,
body.light .form-grid select,
body.light .form-grid textarea,
body.light .search-input,
body.light .command-input{
  background:#fff;
}

.form-row-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.search-form{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

/* =========================
BADGES / STATUS / CALC
========================= */

.badge-soft{
  padding:6px 10px;
  border-radius:999px;
  background:rgba(77,163,255,.16);
  color:#dcecff;
  font-size:12px;
  font-weight:700;
}

body.light .badge-soft{
  background:rgba(37,99,235,.10);
  color:#1d4ed8;
}

.badge-draft,
.badge-viewed,
.badge-approved,
.badge-rejected{
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}

.badge-draft{
  background:rgba(255,180,0,.14);
  border:1px solid rgba(255,180,0,.35);
  color:#ffcc66;
}

.badge-viewed{
  background:rgba(167,139,250,.18);
  border:1px solid rgba(167,139,250,.30);
  color:#d8c7ff;
}

.badge-approved{
  background:rgba(16,185,129,.18);
  border:1px solid rgba(16,185,129,.30);
  color:#86efac;
}

.badge-rejected{
  background:rgba(239,68,68,.18);
  border:1px solid rgba(239,68,68,.30);
  color:#fca5a5;
}

.calc-box{
  padding:14px;
  border-radius:16px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
}

body.light .calc-box{
  background:#f8fbff;
  border:1px solid rgba(37,99,235,.12);
}

/* =========================
TOASTS
========================= */

.alert{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,80,80,.14);
  border:1px solid rgba(255,80,80,.24);
  margin-bottom:12px;
}

.toast{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  margin-bottom:14px;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  animation:toastSlideIn .22s ease;
}

.toast-success{
  background:rgba(80,200,120,.12);
  border-color:rgba(80,200,120,.28);
}

.toast-error{
  background:rgba(255,80,80,.12);
  border-color:rgba(255,80,80,.24);
}

body.light .toast-success{
  background:rgba(80,200,120,.10);
}

body.light .toast-error{
  background:rgba(255,80,80,.10);
}

.toast-body{
  display:grid;
  gap:4px;
}

.toast-body strong{
  font-size:14px;
}

.toast-body span{
  font-size:14px;
  color:var(--text);
}

.toast-close{
  width:30px;
  height:30px;
  border:none;
  border-radius:10px;
  cursor:pointer;
  background:transparent;
  color:var(--text);
  font-size:18px;
  line-height:1;
}

.mail-submit-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:96px;
  gap:8px;
}

.btn-spinner{
  width:14px;
  height:14px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  animation:spin .7s linear infinite;
  display:none;
}

.mail-form.is-loading .btn-spinner{
  display:inline-block;
}

.mail-form.is-loading .btn-label{
  opacity:.85;
}

.mail-form.is-loading .mail-submit-btn{
  pointer-events:none;
  opacity:.92;
}

@keyframes spin{
  to{ transform:rotate(360deg); }
}

@keyframes toastSlideIn{
  from{
    opacity:0;
    transform:translateY(-8px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

/* =========================
PLANS
========================= */

.plan-card{
  position:relative;
}

.active-plan{
  border:2px solid var(--accent);
  box-shadow:0 0 0 2px rgba(77,163,255,.2),0 18px 50px rgba(0,0,0,.35);
}

body.light .active-plan{
  box-shadow:0 0 0 3px rgba(37,99,235,.10),0 16px 30px rgba(15,23,42,.08);
}

.plan-badge{
  position:absolute;
  top:14px;
  right:14px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:var(--accent);
  color:#fff;
}

/* =========================
ROOF TOOL
========================= */

.roof-tool-grid{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:18px;
}

.roof-toolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.roof-map{
  width:100%;
  height:560px;
  border-radius:16px;
  border:1px solid var(--border);
  overflow:hidden;
  background:var(--surface-2);
  box-shadow:var(--shadow);
}

.roof-help{
  margin-top:12px;
}

.ai-calc-results{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.ai-calc-results-rich .calc-box{
  min-height:92px;
}

.roof-preset-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-bottom:16px;
}

.roof-preset-card{
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  border-radius:16px;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:6px;
  cursor:pointer;
  text-align:left;
  transition:all .18s ease;
}

.roof-preset-card:hover{
  transform:translateY(-2px);
  border-color:rgba(77,163,255,.35);
  box-shadow:0 10px 24px rgba(0,0,0,.14);
}

.roof-preset-card.active{
  background:rgba(77,163,255,.14);
  border-color:rgba(77,163,255,.40);
  box-shadow:0 10px 24px rgba(77,163,255,.14);
}

.roof-preset-icon{
  font-size:22px;
  line-height:1;
}

/* =========================
ROOF AI FOTO
========================= */

.ai-upload-form{
  position:relative;
}

.roof-dropzone{
  position:relative;
  border:1.5px dashed rgba(77,163,255,.35);
  border-radius:20px;
  background:rgba(255,255,255,.04);
  min-height:260px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  cursor:pointer;
  transition:border-color .18s ease, transform .18s ease, background .18s ease, box-shadow .18s ease;
  overflow:hidden;
}

.roof-dropzone:hover,
.roof-dropzone.is-dragover{
  border-color:rgba(77,163,255,.65);
  background:rgba(77,163,255,.08);
  box-shadow:0 14px 34px rgba(77,163,255,.12);
  transform:translateY(-1px);
}

.roof-dropzone.has-image .roof-dropzone-inner{
  opacity:0;
  pointer-events:none;
}

.roof-dropzone-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
  transition:opacity .18s ease;
}

.roof-dropzone-icon{
  font-size:34px;
  line-height:1;
}

.roof-dropzone-meta{
  font-size:12px;
  color:var(--muted);
}

.roof-dropzone-large{
  min-height:360px;
}

.roof-preview-wrap{
  position:absolute;
  inset:0;
  display:none;
}

.roof-preview-wrap.is-visible{
  display:block;
}

.roof-ai-preview{
  width:100%;
  max-height:340px;
  object-fit:cover;
  border-radius:14px;
  border:1px solid var(--border);
}

.roof-ai-preview-fill{
  width:100%;
  height:100%;
  max-height:none;
  object-fit:cover;
  border-radius:18px;
}

.roof-ai-preview-static{
  width:100%;
  max-height:320px;
  object-fit:cover;
  border-radius:14px;
  cursor:zoom-in;
}

.roof-preview-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  padding:14px;
  background:linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.38) 100%);
  opacity:0;
  transition:opacity .18s ease;
}

.roof-dropzone:hover .roof-preview-overlay,
.roof-preview-wrap:hover .roof-preview-overlay{
  opacity:1;
}

.roof-preview-overlay-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-left:auto;
}

.roof-ai-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.roof-ai-notes-list{
  margin:10px 0 0 18px;
  padding:0;
  display:grid;
  gap:8px;
}

.roof-ai-empty-state{
  min-height:140px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.roof-ai-server-preview{
  margin-top:14px;
}

.roof-ai-server-preview-image-wrap{
  margin-top:10px;
}

.ai-loader{
  display:none;
  gap:12px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(77,163,255,.18);
  background:rgba(77,163,255,.08);
}

.ai-loader.is-active{
  display:grid;
}

.ai-loader-top{
  display:flex;
  align-items:center;
  gap:12px;
}

.ai-loader-spinner{
  width:22px;
  height:22px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.24);
  border-top-color:#fff;
  animation:aiSpin .8s linear infinite;
}

.ai-progress{
  width:100%;
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.08);
}

.ai-progress-bar{
  width:0%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, var(--accent), var(--accent2));
  transition:width .35s ease;
  position:relative;
}

.ai-progress-bar::after{
  content:"";
  position:absolute;
  top:0;
  right:0;
  width:38px;
  height:100%;
  background:linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.35));
}

#autoQuoteLink.is-loading{
  opacity:.8;
  pointer-events:none;
}

@keyframes aiSpin{
  to{
    transform:rotate(360deg);
  }
}

.image-zoom-modal{
  position:fixed;
  inset:0;
  z-index:10000;
  display:none;
}

.image-zoom-modal.is-open{
  display:block;
}

.image-zoom-backdrop{
  position:absolute;
  inset:0;
  background:rgba(4, 10, 18, .82);
  backdrop-filter:blur(8px);
}

.image-zoom-dialog{
  position:relative;
  z-index:1;
  width:min(1100px, calc(100% - 32px));
  height:min(86vh, 900px);
  margin:40px auto;
  display:flex;
  align-items:center;
  justify-content:center;
}

.image-zoom-target{
  max-width:100%;
  max-height:100%;
  border-radius:18px;
  box-shadow:0 24px 60px rgba(0,0,0,.36);
}

.image-zoom-close{
  position:absolute;
  top:-10px;
  right:-4px;
  width:42px;
  height:42px;
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.10);
  color:#fff;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}

/* =========================
COMMAND PALETTE
========================= */

.command-palette{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:none;
  align-items:flex-start;
  justify-content:center;
  padding-top:140px;
  z-index:5000;
}

.command-palette.open{
  display:flex;
}

.command-box{
  width:520px;
  max-width:calc(100% - 24px);
  background:#0f2233;
  border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.4);
  padding:16px;
  border:1px solid rgba(255,255,255,.10);
}

body.light .command-box{
  background:#ffffff;
}

.command-input{
  margin-bottom:12px;
}

.command-results{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.command-results a{
  padding:10px;
  border-radius:8px;
  text-decoration:none;
  color:var(--text);
}

.command-results a:hover{
  background:rgba(77,163,255,.15);
}

/* =========================
PRICING MODAL
========================= */

.pricing-modal{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
}

.pricing-modal.is-open{
  display:block;
}

.pricing-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(3, 10, 18, .66);
  backdrop-filter:blur(8px);
}

.pricing-modal-dialog{
  position:relative;
  z-index:1;
  width:min(1180px, calc(100% - 32px));
  margin:48px auto;
  padding:26px;
  border-radius:24px;
  border:1px solid rgba(255,255,255,.14);
  background:linear-gradient(180deg, rgba(19,41,59,.96), rgba(11,23,34,.96));
  box-shadow:0 28px 70px rgba(0,0,0,.35);
  max-height:calc(100vh - 96px);
  overflow:auto;
}

.pricing-modal-head{
  margin-bottom:18px;
}

.pricing-modal-head h2{
  margin:0 0 8px;
  font-size:32px;
}

.pricing-modal-close{
  position:absolute;
  top:14px;
  right:14px;
  width:40px;
  height:40px;
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  font-size:26px;
  line-height:1;
  cursor:pointer;
}

.pricing-modal-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}

.pricing-plan{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.pricing-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:10px;
}

.pricing-plan .btn{
  margin-top:auto;
}

/* =========================
AUTH / LOGIN
========================= */

.auth-page{
  background:
    radial-gradient(circle at top left, rgba(77,163,255,.18), transparent 28%),
    linear-gradient(180deg,#13293b 0%,#0b1722 100%) !important;
  color:#fff !important;
}

.auth-wrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
}

.auth-page .form-grid input,
.auth-page .form-grid select,
.auth-page .form-grid textarea{
  background:rgba(27,49,69,.82);
  color:#fff;
  border:1px solid rgba(255,255,255,.14);
}

.auth-page .muted,
.auth-page .havexa-subtitle{
  color:rgba(255,255,255,.78);
}

.havexa-hero{
  position:relative;
  overflow:hidden;
  width:min(1200px,100%);
  padding:32px;
  border-radius:24px;
  background:
    radial-gradient(circle at top left, rgba(77,163,255,.20), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255,255,255,.05), transparent 24%),
    linear-gradient(180deg,#13293b 0%,#0b1722 100%);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 24px 60px rgba(0,0,0,.28);
}

.premium-login{
  isolation:isolate;
}

.premium-login-polish{
  position:relative;
  isolation:isolate;
}

.havexa-hero-grid{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:.95fr 1.05fr;
  gap:32px;
  align-items:stretch;
}

.havexa-animated-gradient{
  position:absolute;
  inset:-20%;
  background:
    radial-gradient(circle at 20% 20%, rgba(77,163,255,.20), transparent 28%),
    radial-gradient(circle at 80% 30%, rgba(143,197,255,.14), transparent 24%),
    radial-gradient(circle at 60% 80%, rgba(99,102,241,.14), transparent 26%);
  filter:blur(26px);
  animation:gradientDrift 16s ease-in-out infinite alternate;
  pointer-events:none;
  z-index:0;
}

@keyframes gradientDrift{
  0%{ transform:translate3d(-2%, -1%, 0) scale(1); }
  50%{ transform:translate3d(2%, 2%, 0) scale(1.04); }
  100%{ transform:translate3d(-1%, 3%, 0) scale(1.02); }
}

.havexa-bg-grid{
  position:absolute;
  inset:0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size:36px 36px;
  mask-image:radial-gradient(circle at center, black, transparent 85%);
  pointer-events:none;
  z-index:0;
}

.animated-grid{
  animation:gridDrift 24s linear infinite;
  opacity:.9;
}

@keyframes gridDrift{
  0%{ transform:translate3d(0,0,0); }
  100%{ transform:translate3d(36px,18px,0); }
}

.havexa-grid-glow{
  position:absolute;
  inset:0;
  z-index:0;
  background:
    radial-gradient(circle at 20% 30%, rgba(77,163,255,.08), transparent 22%),
    radial-gradient(circle at 80% 70%, rgba(143,197,255,.06), transparent 24%);
  pointer-events:none;
  animation:gridGlowPulse 8s ease-in-out infinite alternate;
}

@keyframes gridGlowPulse{
  0%{ opacity:.55; transform:scale(1); }
  100%{ opacity:.9; transform:scale(1.03); }
}

.havexa-bg-orb{
  position:absolute;
  border-radius:50%;
  filter:blur(40px);
  opacity:.55;
  pointer-events:none;
  animation:havexaFloat 9s ease-in-out infinite;
  z-index:0;
}

.havexa-bg-orb-1{
  width:260px;
  height:260px;
  top:-40px;
  left:-50px;
  background:rgba(77,163,255,.28);
}

.havexa-bg-orb-2{
  width:220px;
  height:220px;
  bottom:-50px;
  right:-40px;
  background:rgba(143,197,255,.18);
  animation-delay:-3s;
}

.havexa-bg-orb-3{
  width:180px;
  height:180px;
  top:18%;
  left:42%;
  background:rgba(99,102,241,.14);
  animation-delay:-5s;
}

@keyframes havexaFloat{
  0%,100%{ transform:translateY(0) translateX(0); }
  50%{ transform:translateY(16px) translateX(8px); }
}

.havexa-light-reflection{
  position:absolute;
  z-index:1;
  pointer-events:none;
  border-radius:999px;
  filter:blur(20px);
  opacity:.18;
  mix-blend-mode:screen;
}

.havexa-light-reflection-1{
  top:40px;
  left:8%;
  width:280px;
  height:70px;
  background:linear-gradient(90deg, rgba(255,255,255,.22), rgba(255,255,255,0));
  transform:rotate(-10deg);
  animation:reflectionMove1 10s ease-in-out infinite;
}

.havexa-light-reflection-2{
  right:6%;
  bottom:90px;
  width:220px;
  height:60px;
  background:linear-gradient(90deg, rgba(143,197,255,.24), rgba(255,255,255,0));
  transform:rotate(12deg);
  animation:reflectionMove2 12s ease-in-out infinite;
}

@keyframes reflectionMove1{
  0%,100%{
    transform:translate3d(0,0,0) rotate(-10deg);
    opacity:.14;
  }
  50%{
    transform:translate3d(10px,6px,0) rotate(-8deg);
    opacity:.24;
  }
}

@keyframes reflectionMove2{
  0%,100%{
    transform:translate3d(0,0,0) rotate(12deg);
    opacity:.12;
  }
  50%{
    transform:translate3d(-12px,-8px,0) rotate(10deg);
    opacity:.22;
  }
}

.premium-form-card{
  position:relative;
  z-index:2;
  min-height:620px;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:48px;
  background:linear-gradient(180deg, rgba(21,39,55,.88), rgba(21,39,55,.72));
  border:1px solid rgba(255,255,255,.14);
  border-radius:24px;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  box-shadow:
    0 24px 60px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.08);
  transition:box-shadow .22s ease, transform .22s ease;
}

.premium-form-card::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:24px;
  pointer-events:none;
  background:linear-gradient(
    180deg,
    rgba(255,255,255,.05),
    transparent 22%,
    transparent 78%,
    rgba(255,255,255,.03)
  );
}

.login-card-glow{
  position:relative;
  overflow:hidden;
  box-shadow:
    0 24px 60px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 0 28px rgba(77,163,255,.10);
}

.login-card-glow::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:24px;
  padding:1px;
  background:linear-gradient(
    135deg,
    rgba(255,255,255,.16),
    rgba(77,163,255,.10),
    rgba(255,255,255,.04)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite:xor;
  mask-composite:exclude;
  pointer-events:none;
}

.login-card-shine{
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:24px;
  background:linear-gradient(
    120deg,
    rgba(255,255,255,.10) 0%,
    rgba(255,255,255,0) 20%,
    rgba(255,255,255,.05) 45%,
    rgba(255,255,255,0) 70%
  );
  transform:translateX(-20%);
  animation:loginShineSweep 9s ease-in-out infinite;
}

@keyframes loginShineSweep{
  0%{ transform:translateX(-28%); opacity:.65; }
  50%{ transform:translateX(8%); opacity:.9; }
  100%{ transform:translateX(22%); opacity:.6; }
}

.havexa-title{
  margin:0;
  font-size:clamp(38px,5vw,72px);
  line-height:.96;
  letter-spacing:-.03em;
  font-weight:900;
}

.havexa-title span{
  display:block;
  color:#8fc5ff;
}

.havexa-subtitle{
  max-width:650px;
  font-size:18px;
  line-height:1.6;
}

.havexa-hero-points{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  margin-top:22px;
  color:rgba(255,255,255,.75);
  font-size:14px;
  font-weight:600;
}

.premium-demo{
  margin-top:20px;
  font-size:12px;
  opacity:.72;
}

.premium-login-btn{
  margin-top:4px;
  min-height:48px;
  font-size:15px;
  letter-spacing:.01em;
  box-shadow:0 12px 24px rgba(77,163,255,.24);
}

.glow-btn{
  position:relative;
  overflow:hidden;
  box-shadow:
    0 12px 26px rgba(77,163,255,.28),
    0 0 0 1px rgba(255,255,255,.08) inset;
}

.glow-btn::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:linear-gradient(135deg, rgba(255,255,255,.28), transparent 30%, transparent 70%, rgba(255,255,255,.12));
  opacity:.8;
  pointer-events:none;
}

.glow-btn::after{
  content:"";
  position:absolute;
  top:-30%;
  left:-60%;
  width:40%;
  height:160%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform:rotate(18deg);
  animation:btnShine 4s ease-in-out infinite;
  pointer-events:none;
}

.glow-btn span{
  position:relative;
  z-index:1;
}

@keyframes btnShine{
  0%{ left:-60%; }
  100%{ left:130%; }
}

.glass-visual-card{
  position:relative;
  overflow:hidden;
  min-height:620px;
  height:100%;
  padding:20px;
  background:linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.20);
  border-radius:24px;
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  box-shadow:
    0 24px 60px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.18);
  transform-style:preserve-3d;
}

.glass-visual-card::before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(
    120deg,
    rgba(255,255,255,.08) 0%,
    rgba(255,255,255,0) 28%,
    rgba(255,255,255,.04) 52%,
    rgba(255,255,255,0) 72%
  );
  transform:translateX(-30%);
  animation:glassSweep 7s ease-in-out infinite;
  pointer-events:none;
  z-index:1;
}

@keyframes glassSweep{
  0%{ transform:translateX(-40%); }
  50%{ transform:translateX(10%); }
  100%{ transform:translateX(35%); }
}

.floating-dashboard{
  position:relative;
  z-index:2;
}

.glass-orb{
  position:absolute;
  border-radius:50%;
  filter:blur(24px);
  pointer-events:none;
}

.glass-orb-1{
  width:180px;
  height:180px;
  top:-30px;
  right:-20px;
  background:rgba(77,163,255,.32);
}

.glass-orb-2{
  width:140px;
  height:140px;
  bottom:80px;
  left:-20px;
  background:rgba(143,197,255,.20);
}

.glass-panel,
.glass-chart-card{
  position:relative;
  z-index:2;
  border-radius:20px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.08);
  box-shadow:
    0 16px 40px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.10);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

.glass-panel-top{
  padding:16px;
  margin-bottom:16px;
}

.glass-panel-bottom{
  padding:14px;
  margin-bottom:18px;
}

.glass-panel-label{
  font-size:12px;
  letter-spacing:.10em;
  text-transform:uppercase;
  color:rgba(255,255,255,.72);
  margin-bottom:12px;
  font-weight:700;
}

.glass-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
}

.glass-kpi{
  padding:12px;
  border-radius:16px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
}

.glass-kpi span{
  display:block;
  font-size:11px;
  color:rgba(255,255,255,.60);
  margin-bottom:6px;
}

.glass-kpi strong{
  font-size:20px;
  color:#fff;
  font-weight:800;
}

.count-up,
.count-up-money{
  display:inline-block;
  min-width:48px;
}

.glass-chart-card{
  padding:16px;
  margin-bottom:16px;
}

.glass-chart-header{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
  font-size:12px;
  color:rgba(255,255,255,.72);
  letter-spacing:.04em;
}

.glass-bars{
  height:140px;
  display:flex;
  align-items:flex-end;
  gap:10px;
}

.glass-bars span{
  flex:1;
  border-radius:14px 14px 6px 6px;
  background:linear-gradient(180deg,#9ad0ff,#4da3ff);
  box-shadow:0 12px 22px rgba(77,163,255,.22);
}

.chart-pulse-card::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:20px;
  box-shadow:0 0 0 0 rgba(77,163,255,.12);
  animation:chartPulse 2.8s ease-in-out infinite;
  pointer-events:none;
}

@keyframes chartPulse{
  0%{ box-shadow:0 0 0 0 rgba(77,163,255,.00); }
  50%{ box-shadow:0 0 0 8px rgba(77,163,255,.08); }
  100%{ box-shadow:0 0 0 0 rgba(77,163,255,.00); }
}

.live-bars span{
  animation:barFloat 3s ease-in-out infinite;
}

.live-bars span:nth-child(1){ animation-delay:0s; }
.live-bars span:nth-child(2){ animation-delay:.15s; }
.live-bars span:nth-child(3){ animation-delay:.3s; }
.live-bars span:nth-child(4){ animation-delay:.45s; }
.live-bars span:nth-child(5){ animation-delay:.6s; }
.live-bars span:nth-child(6){ animation-delay:.75s; }
.live-bars span:nth-child(7){ animation-delay:.9s; }

@keyframes barFloat{
  0%,100%{ transform:translateY(0); filter:brightness(1); }
  50%{ transform:translateY(-3px); filter:brightness(1.08); }
}

.glass-list-row{
  display:grid;
  grid-template-columns:1.4fr .8fr;
  gap:12px;
  align-items:center;
  padding:10px 8px;
  color:rgba(255,255,255,.88);
  font-size:13px;
}

.glass-list-head{
  color:rgba(255,255,255,.54);
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:11px;
  padding-top:0;
}

.status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  width:max-content;
}

.status-pill.sent{
  background:rgba(59,130,246,.18);
  color:#93c5fd;
}

.status-pill.viewed{
  background:rgba(167,139,250,.18);
  color:#c4b5fd;
}

.status-pill.approved{
  background:rgba(16,185,129,.18);
  color:#86efac;
}

.havexa-image-havexa{
  margin-top:auto;
  height:40vh;
  min-height:240px;
  padding:8px;

  
  background-image:url("/img/havexa.png");
  background-size:92%;
  background-repeat:no-repeat;
  background-position:center;

  border-radius:16px;
}

.havexa-visual-card .havexa-image-havexa{
  position:relative;
  z-index:2;
  height:220px;
  min-height:220px;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 18px 40px rgba(0,0,0,.18);
}

.floating-card{
  animation:floatingCard 6s ease-in-out infinite;
  will-change:transform;
}

@keyframes floatingCard{
  0%,100%{ transform:translateY(0px); }
  50%{ transform:translateY(-8px); }
}

[data-parallax],
[data-parallax-bg]{
  transition:transform .22s ease-out;
  will-change:transform;
}

/* =========================
MISC
========================= */

.logo-preview{
  max-height:70px;
  max-width:220px;
  object-fit:contain;
  display:block;
}

/* =========================
RESPONSIVE
========================= */

@media (max-width:1100px){
  .crm-grid,
  .plans-grid,
  .charts-grid,
  .havexa-hero-grid,
  .form-row-2,
  .roof-tool-grid,
  .pricing-modal-grid,
  .roof-ai-layout{
    grid-template-columns:1fr;
  }

  .premium-form-card,
  .glass-visual-card{
    min-height:auto;
  }

  .glass-kpis{
    grid-template-columns:1fr;
  }

  .roof-map{
    height:420px;
  }

  .pricing-modal-dialog{
    margin:24px auto;
  }
}

@media (max-width:980px){
  .topbar{
    height:auto;
    padding:14px 16px;
    align-items:flex-start;
    flex-direction:column;
  }

  .topnav{
    width:100%;
    justify-content:flex-start;
  }

  .shell{
    flex-direction:column;
  }

  .sidebar{
    width:100%;
    border-right:none;
    border-bottom:1px solid var(--border);
  }

  .sidebar.collapsed{
    width:100%;
    padding:18px 14px;
  }

  .sidebar.collapsed .sidebar-logo,
  .sidebar.collapsed .side-label{
    opacity:1;
    width:auto;
    overflow:visible;
    transform:none;
  }

  .sidebar.collapsed .side-link{
    justify-content:flex-start;
    padding:11px 12px;
  }

  .sidebar.collapsed .sidebar-top{
    justify-content:space-between;
  }

  .side-submenu{
    max-height:none !important;
    overflow:visible;
  }
}

@media (max-width:900px){
  .premium-form-card{
    padding:28px;
  }

  .glass-list-row,
  .roof-preset-grid,
  .ai-calc-results{
    grid-template-columns:1fr;
  }

  .animated-grid,
  .havexa-grid-glow,
  .havexa-light-reflection,
  .login-card-shine,
  .glow-btn::after,
  .chart-pulse-card::after{
    animation-duration:0s;
  }

  .havexa-light-reflection{
    display:none;
  }

  .brand2-tag{
    display:none;
  }

  .topbar-user-copy{
    display:none;
  }

  .roof-dropzone-large{
    min-height:280px;
  }
}

@media (max-width:700px){
  .image-zoom-dialog{
    width:min(100% - 20px, 1100px);
    height:min(82vh, 900px);
    margin:24px auto;
  }
}

body.light .panel,
body.light .kpi-card,
body.light .plan-card,
body.light .form-card,
body.light .havexa-visual-card{
  box-shadow:0 12px 30px rgba(15,23,42,.08);
}

body.light .table th{
  color:#334155;
  background:rgba(37,99,235,.03);
}

body.light .table td{
  color:#0f172a;
}

body.light .muted,
body.light .crm-sub{
  color:rgba(15,23,42,.62);
}

body.light .calc-box{
  background:#f8fbff;
  border:1px solid rgba(37,99,235,.10);
}

body.light .badge-draft{
  background:rgba(245,158,11,.10);
  border-color:rgba(245,158,11,.18);
  color:#b45309;
}

body.light .badge-viewed{
  background:rgba(139,92,246,.10);
  border-color:rgba(139,92,246,.18);
  color:#6d28d9;
}

body.light .badge-approved{
  background:rgba(16,185,129,.10);
  border-color:rgba(16,185,129,.18);
  color:#047857;
}

body.light .badge-rejected{
  background:rgba(239,68,68,.10);
  border-color:rgba(239,68,68,.18);
  color:#b91c1c;
}

body.light .command-results a:hover{
  background:rgba(37,99,235,.08);
}

body.light .sidebar{
  box-shadow:inset -1px 0 0 rgba(15,23,42,.06);
}

body.light .topbar{
  box-shadow:inset 0 -1px 0 rgba(15,23,42,.06);
}

/* =========================
LIGHT LOGIN MODE
========================= */

body.auth-page{
  background:
    radial-gradient(circle at top left, rgba(77,163,255,.18), transparent 40%),
    radial-gradient(circle at bottom right, rgba(143,197,255,.15), transparent 45%),
    linear-gradient(180deg,#eef5fb 0%,#e6eff7 100%) !important;

  color:#0f172a;
}

/* HERO CARD */

body.auth-page .havexa-hero{
  background:
    radial-gradient(circle at top left, rgba(77,163,255,.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(143,197,255,.10), transparent 30%),
    linear-gradient(180deg,#ffffff 0%,#f3f8fd 100%);

  border:1px solid rgba(37,99,235,.12);
  box-shadow:0 30px 80px rgba(15,23,42,.12);
}

/* LOGIN CARD */

body.auth-page .premium-form-card{
  background:rgba(255,255,255,.78);
  backdrop-filter:blur(16px);
  border:1px solid rgba(37,99,235,.14);

  box-shadow:
    0 20px 50px rgba(15,23,42,.10),
    inset 0 1px 0 rgba(255,255,255,.6);
}

/* TEXT */

body.auth-page .havexa-title{
  color:#0f172a;
}

body.auth-page .havexa-title span{
  color:#2563eb;
}

body.auth-page .havexa-subtitle{
  color:#334155;
}

body.auth-page .havexa-hero-points{
  color:#475569;
}

/* INPUTS */

body.auth-page input{
  background:#ffffff;
  border:1px solid rgba(37,99,235,.16);
  color:#0f172a;
}

body.auth-page input:focus{
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}

/* BUTTON */

body.auth-page .premium-login-btn{
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  box-shadow:0 10px 30px rgba(37,99,235,.25);
}

/* VISUAL DASHBOARD CARD */

body.auth-page .glass-visual-card{
  background:rgba(255,255,255,.65);
  border:1px solid rgba(37,99,235,.14);

  backdrop-filter:blur(18px);

  box-shadow:
    0 20px 50px rgba(15,23,42,.12),
    inset 0 1px 0 rgba(255,255,255,.8);
}

/* KPI GLASS */

body.auth-page .glass-kpi{
  background:rgba(37,99,235,.05);
  border:1px solid rgba(37,99,235,.08);
}

body.auth-page .glass-kpi strong{
  color:#0f172a;
}

/* LIST */

body.auth-page .glass-list-row{
  color:#0f172a;
}

body.auth-page .glass-list-head{
  color:#64748b;
}

/* ORBS */

body.auth-page .glass-orb-1{
  background:rgba(37,99,235,.20);
}

body.auth-page .glass-orb-2{
  background:rgba(143,197,255,.18);
}

.auth-page-light-premium{
  background:
    radial-gradient(circle at top left, rgba(77,163,255,.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(143,197,255,.14), transparent 38%),
    linear-gradient(180deg,#eef5fb 0%,#e8f0f8 100%) !important;
  color:#0f172a !important;
}

.premium-login-light{
  background:
    radial-gradient(circle at top left, rgba(77,163,255,.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(143,197,255,.10), transparent 30%),
    linear-gradient(180deg,#ffffff 0%,#f4f8fc 100%);
  border:1px solid rgba(37,99,235,.12);
  box-shadow:0 30px 80px rgba(15,23,42,.10);
}

.premium-form-card-light{
  background:rgba(255,255,255,0.45);

  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);

  border:1px solid rgba(255,255,255,0.35);

  box-shadow:
    0 20px 50px rgba(15,23,42,.08),
    inset 0 1px 0 rgba(255,255,255,.6);

  transition:all .25s ease;
}

.havexa-title-light{
  color:#0f172a;
}

.havexa-title-light span{
  color:#2563eb;
}

.havexa-subtitle-light{
  color:#334155;
}

.premium-form-card-light .form-grid input{
  background:#ffffff;
  border:1px solid rgba(37,99,235,.14);
  color:#0f172a;
}

.premium-form-card-light .form-grid input:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.10);
}

.login-btn-light{
  box-shadow:0 12px 28px rgba(37,99,235,.20);
}

.login-ghost-light{
  background:rgba(255,255,255,.75);
  border:1px solid rgba(37,99,235,.14);
  color:#0f172a;
}

.login-ghost-light:hover{
  background:#ffffff;
}

.premium-demo-light{
  color:#64748b;
}

.login-chip-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.login-chip{
  padding:7px 10px;
  border-radius:999px;
  background:rgba(37,99,235,.08);
  border:1px solid rgba(37,99,235,.10);
  color:#1d4ed8;
  font-size:12px;
  font-weight:700;
}

.login-alert-light{
  background:rgba(239,68,68,.08);
  border:1px solid rgba(239,68,68,.16);
  color:#991b1b;
}

.premium-visual-light{
  background:rgba(255,255,255,.60);
  border:1px solid rgba(37,99,235,.12);
  box-shadow:
    0 20px 50px rgba(15,23,42,.10),
    inset 0 1px 0 rgba(255,255,255,.85);
}

.premium-glass-light{
  background:rgba(255,255,255,.60);
  border:1px solid rgba(37,99,235,.10);
  backdrop-filter:blur(12px);
}

.premium-glass-light .glass-panel-label,
.premium-glass-light .glass-chart-header,
.premium-glass-light .glass-list-head{
  color:#64748b;
}

.premium-glass-light .glass-kpi span{
  color:#64748b;
}

.premium-glass-light .glass-kpi strong,
.premium-glass-light .glass-list-row{
  color:#0f172a;
}

.login-feature-strip{
  margin-top:auto;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  position:relative;
  z-index:2;
}

.login-feature-item{
  padding:14px;
  border-radius:16px;
  background:rgba(255,255,255,.56);
  border:1px solid rgba(37,99,235,.10);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.login-feature-item strong{
  display:block;
  color:#0f172a;
  font-size:16px;
  margin-bottom:4px;
}

.login-feature-item span{
  color:#64748b;
  font-size:12px;
}

@media (max-width:1100px){
  .login-feature-strip{
    grid-template-columns:1fr;
  }
}

.premium-form-card-light .form-grid select{
  background:#ffffff;
  border:1px solid rgba(37,99,235,.14);
  color:#0f172a;
}

.premium-form-card-light .form-grid select:focus{
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.10);
}

/* ============================= */
/* HAVEXA LIGHT PRICING CARDS   */
/* ============================= */

body.light .plan-card{
  background:#ffffff;
  color:#0f172a;
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 14px 40px rgba(0,0,0,.06);
}

body.light .plan-card h3{
  color:#0f172a;
}

body.light .plan-card h2{
  color:#2563eb;
}

body.light .pricing-list{
  color:#334155;
}

body.light .pricing-list li{
  border-bottom:1px solid rgba(0,0,0,.05);
}

body.light .plan-badge{
  background:#2563eb;
  color:#fff;
}

body.light .plan-card .btn.primary{
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  color:#fff;
}

body.light .plan-card .btn.primary:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 16px rgba(37,99,235,.25);
}

body.light .plan-card .btn.ghost{
  border:1px solid rgba(0,0,0,.08);
  color:#0f172a;
}

body.light .plan-card .btn.ghost:hover{
  background:#f1f5f9;
}

/* ============================= */
/* LOGIN BRAND LIGHT MODE       */
/* ============================= */

.auth-page-light-premium .brand2{
  color:#0f172a;
}

.auth-page-light-premium .brand2-name{
  color:#0f172a;
}

.auth-page-light-premium .brand2-tag{
  color:#64748b;
}

.auth-page-light-premium .mark2{
  color:#2563eb;
}

/* ============================= */
/* LOGIN BUTTONS - LIGHT MODE   */
/* ============================= */

.auth-page-light-premium .btn.ghost,
.auth-page-light-premium .login-ghost-light{
  color:#0f172a;
  border:1px solid rgba(0,0,0,.12);
  background:#ffffff;
}

.auth-page-light-premium .btn.ghost:hover,
.auth-page-light-premium .login-ghost-light:hover{
  background:#f1f5f9;
  border-color:#cbd5e1;
}

.auth-page-light-premium .btn.primary{
  background:linear-gradient(135deg,#2563eb,#3b82f6);
  color:#fff;
}

.auth-page-light-premium .btn.primary:hover{
  transform:translateY(-1px);
  box-shadow:0 6px 16px rgba(37,99,235,.25);
}

/* ============================= */
/* LOGIN PREMIUM BUTTON         */
/* ============================= */

.glow-btn{
  position:relative;
  overflow:hidden;
}

.glow-btn::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:12px;
  background:linear-gradient(120deg,#2563eb,#3b82f6,#60a5fa);
  opacity:.25;
  filter:blur(10px);
  z-index:-1;
}

.glow-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 28px rgba(37,99,235,.35);
}

/* ============================= */
/* LOGIN MINI PRICING           */
/* ============================= */

.login-pricing-preview{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin-top:20px;
}

.login-mini-plan{
  padding:10px;
  border-radius:10px;
  background:#ffffff;
  border:1px solid rgba(0,0,0,.08);
  text-align:center;
  font-size:13px;
}

.login-mini-plan strong{
  display:block;
  color:#2563eb;
  font-size:14px;
}

.login-mini-plan span{
  color:#64748b;
  font-size:12px;
}

/* ============================= */
/* LOGIN PRICING FLOATING CARDS */
/* ============================= */

.login-pricing-preview{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-top:18px;
  position:relative;
  z-index:3;
}

.login-mini-plan{
  padding:12px;
  border-radius:12px;

  background:rgba(255,255,255,.65);
  backdrop-filter:blur(8px);

  border:1px solid rgba(255,255,255,.35);

  box-shadow:
    0 10px 30px rgba(0,0,0,.12),
    inset 0 1px 0 rgba(255,255,255,.5);

  text-align:center;

  transition:all .25s ease;
}

.login-mini-plan strong{
  display:block;
  font-size:14px;
  color:#2563eb;
  margin-bottom:3px;
}

.login-mini-plan span{
  font-size:12px;
  color:#334155;
}

/* hover lift */

.login-mini-plan:hover{
  transform:translateY(-3px);
  box-shadow:
    0 14px 40px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.6);
}

.login-mini-plan:nth-child(2){
  background:linear-gradient(180deg, rgba(37,99,235,.14), rgba(255,255,255,.78));
  border:1px solid rgba(37,99,235,.20);
  box-shadow:
    0 14px 36px rgba(37,99,235,.14),
    inset 0 1px 0 rgba(255,255,255,.6);
  transform:translateY(-2px);
}

.login-mini-plan:nth-child(2) strong::after{
  content:"Populair";
  display:block;
  margin-top:6px;
  font-size:10px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#1d4ed8;
}

/* modal */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(2,6,23,.54);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:5000;
  opacity:0;
  animation:modalFadeIn .18s ease forwards;
}
.modal-card{
  width:min(520px, 100%);
  border-radius:20px;
  background:var(--surface);
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  overflow:hidden;
  transform:translateY(8px);
  animation:modalLiftIn .18s ease forwards;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:18px 20px 10px;
}
.modal-body{
  padding:4px 20px 18px;
  color:var(--text);
  line-height:1.7;
}
.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:0 20px 20px;
}
.modal-close{
  width:36px;
  height:36px;
  border-radius:999px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  cursor:pointer;
}
.modal-success .modal-head h3{ color:var(--success); }
.modal-error .modal-head h3{ color:var(--danger); }

@keyframes modalFadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes modalLiftIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.kpi-card-link{
  text-decoration:none;
  color:inherit;
}
.kpi-card-link:hover{
  transform:translateY(-2px);
}

/* safari friendliness */
.topbar{
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
}
.panel, .calc-box, .topbar-user, .command-box, .modal-card{
  -webkit-backdrop-filter:saturate(100%);
}
input, select, textarea, button{
  -webkit-appearance:none;
  appearance:none;
}
select{
  background-image:none;
}
.mapboxgl-canvas{
  image-rendering:auto;
}

/* global modal feedback */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(2,6,23,.58);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:5000;
  opacity:0;
  animation:modalFadeIn .18s ease forwards;
}
.modal-card{
  width:min(560px, 100%);
  border-radius:22px;
  background:var(--surface);
  border:1px solid var(--border);
  box-shadow:0 24px 70px rgba(2,6,23,.28);
  overflow:hidden;
  transform:translateY(8px) scale(.985);
  animation:modalLiftIn .18s ease forwards;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:18px 20px 10px;
}
.modal-head h3{
  margin:0;
}
.modal-body{
  padding:6px 20px 18px;
  color:var(--text);
  line-height:1.75;
}
.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:0 20px 20px;
}
.modal-close{
  width:38px;
  height:38px;
  border-radius:999px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  cursor:pointer;
  font-size:20px;
  line-height:1;
}
.modal-success .modal-head h3{ color:var(--success); }
.modal-error .modal-head h3{ color:var(--danger); }
.modal-warning .modal-head h3{ color:var(--warning); }
.modal-info .modal-head h3{ color:var(--accent); }

@keyframes modalFadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes modalLiftIn { from { opacity:0; transform:translateY(8px) scale(.985); } to { opacity:1; transform:translateY(0) scale(1); } }

/* toast stack + reusable skeleton helpers */
.toast-stack{
  position:fixed;
  top:88px;
  right:18px;
  width:min(380px, calc(100vw - 24px));
  z-index:5000;
  display:grid;
  gap:12px;
}

.toast{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  margin:0;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
  animation:toastSlideIn .22s ease;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  opacity:1;
  transition:opacity .18s ease, transform .18s ease;
}

.toast.is-leaving{
  opacity:0;
  transform:translateY(-6px);
}

body:not(.light) .toast{
  background:rgba(21,39,55,.94);
}

body.light .toast{
  background:rgba(255,255,255,.96);
}

.skeleton-shimmer{
  position:relative;
  overflow:hidden;
}

.skeleton-shimmer::after{
  content:"";
  position:absolute;
  inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  animation:skeletonShimmer 1.2s ease-in-out infinite;
}

body.light .skeleton-shimmer::after{
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent);
}

@keyframes skeletonShimmer{
  100%{ transform:translateX(100%); }
}

@media (max-width: 720px){
  .toast-stack{
    top:auto;
    right:12px;
    left:12px;
    bottom:12px;
    width:auto;
  }
}

/* kanban */
.kanban-board{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.kanban-column{
  min-height:320px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  border-radius:18px;
  padding:12px;
}
body.light .kanban-column{
  background:#f8fbff;
}
.kanban-column-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.kanban-column-head h4{
  margin:0;
}
.kanban-dropzone{
  min-height:240px;
  display:grid;
  gap:10px;
  padding:6px;
  border-radius:14px;
  transition:background .18s ease, border-color .18s ease;
}
.kanban-dropzone.is-over{
  background:rgba(77,163,255,.10);
}
.kanban-card{
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:16px;
  padding:14px;
  cursor:grab;
  box-shadow:var(--shadow);
}
body.light .kanban-card{
  background:#fff;
}
.kanban-card.is-dragging{
  opacity:.65;
}
.kanban-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.kanban-card-actions{
  margin-top:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

@media (max-width: 1100px){
  .kanban-board{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width: 700px){
  .kanban-board{
    grid-template-columns:1fr;
  }
}

/* billing PRO v2 */
.billing-pro-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.billing-pro-stat{
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  background:rgba(255,255,255,.03);
}
body.light .billing-pro-stat{
  background:#f8fbff;
}
.pro-plans-grid{
  align-items:stretch;
}
.billing-plan-price{
  font-size:34px;
  font-weight:800;
  margin:8px 0 14px;
}
.billing-plan-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:16px;
}
.plan-featured{
  box-shadow:0 18px 40px rgba(77,163,255,.16);
}
@media (max-width: 760px){
  .billing-pro-grid{
    grid-template-columns:1fr;
  }
}

/* billing v3 */
.billing-plan-actions .btn{
  min-width:128px;
  justify-content:center;
}
.active-plan .billing-plan-actions .btn[disabled]{
  opacity:1;
}

/* Safari auth parity */
body.auth-page.light{
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 24%),
    linear-gradient(180deg,#f8fbfd,#eef3f8);
  color:#0f172a;
}
body.auth-page.light .form-card,
body.auth-page.light .glass-visual-card{
  background:rgba(255,255,255,.88);
  border-color:rgba(15,23,42,.10);
  box-shadow:0 16px 40px rgba(15,23,42,.10);
}
body.auth-page.light .brand2,
body.auth-page.light .havexa-title,
body.auth-page.light .form-grid label,
body.auth-page.light .btn.ghost{
  color:#0f172a;
}
body.auth-page.light .havexa-subtitle,
body.auth-page.light .premium-demo{
  color:rgba(15,23,42,.72);
}
body.auth-page.light .form-grid input{
  background:#fff;
  color:#0f172a;
  border-color:rgba(15,23,42,.12);
}
body.auth-page.light .glass-kpi,
body.auth-page.light .glass-list-row,
body.auth-page.light .login-mini-plan{
  background:rgba(37,99,235,.04);
  border-color:rgba(15,23,42,.08);
}

/* remove extra arrow spacing Safari */
.lang-select::-ms-expand { display: none; }

/* language dropdown */
.lang-dropdown{
  position:relative;
}
.lang-dropdown-trigger{
  min-width:152px;
  height:38px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:2px solid var(--accent);
  border-radius:999px;
  background:var(--surface);
  color:var(--text);
  font-weight:700;
  cursor:pointer;
}
body.light .lang-dropdown-trigger{
  background:#fff;
}
.lang-dropdown-current{
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.lang-dropdown-chevron{
  font-size:12px;
  opacity:.8;
}
.lang-dropdown-menu{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  min-width:220px;
  padding:8px;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--surface);
  box-shadow:0 18px 40px rgba(15,23,42,.18);
  display:none;
  z-index:120;
}
body.light .lang-dropdown-menu{
  background:#fff;
}
.lang-dropdown.is-open .lang-dropdown-menu{
  display:grid;
  gap:6px;
}
.lang-dropdown-item{
  width:100%;
  display:grid;
  grid-template-columns:24px 1fr auto;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:none;
  border-radius:14px;
  background:transparent;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.lang-dropdown-item:hover,
.lang-dropdown-item.is-active{
  background:rgba(77,163,255,.12);
}
.lang-flag{
  font-size:16px;
}
.lang-name{
  font-weight:700;
}
.lang-code{
  font-size:12px;
  opacity:.65;
  letter-spacing:.08em;
}


/* language dropdown stacking fix */
.topbar{
  position: relative;
  z-index: 2000;
}
.topnav{
  position: relative;
  z-index: 2001;
}
.lang-dropdown{
  position: relative;
  z-index: 2100;
}
.lang-dropdown-trigger{
  position: relative;
  z-index: 2101;
}
.lang-dropdown-menu{
  z-index: 2500 !important;
}
.panel,
.card,
.calc-box,
.crm-grid,
.ai-calc-results,
.table,
.kanban-board,
.kanban-column{
  position: relative;
  z-index: 1;
}



body.modal-open .topbar,
body.modal-open .topnav,
body.modal-open .topbar-user{
  filter:none !important;
  opacity:1 !important;
}

.modal-overlay[data-profile-modal]{
  align-items:center !important;
  justify-content:center !important;
}

body.light .profile-modal-card .btn.primary{
  color:#fff !important;
  background:linear-gradient(135deg,#2563eb 0%,#3b82f6 100%) !important;
  border-color:#2563eb !important;
}




html, body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  min-height: 100vh;
}

.shell {
  min-height: calc(100vh - 72px);
  align-items: stretch;
}

.content {
  min-width: 0;
  min-height: calc(100vh - 72px);
  overflow: visible;
}

.panel,
.card,
.widget,
.stat-card,
.calc-box {
  min-width: 0;
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay[data-profile-modal] {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px;
  z-index: 6000 !important;
}

.modal-overlay[data-profile-modal][data-open="1"] {
  display: flex !important;
}

.profile-modal-card {
  width: min(760px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 48px) !important;
  overflow: auto !important;
  margin: 0 auto !important;
}

body.light .profile-modal-card .btn.primary,
body.light .modal-card .btn.primary {
  color: #fff !important;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%) !important;
  border-color: #2563eb !important;
}

body.modal-open .topbar,
body.modal-open .topnav,
body.modal-open .topbar-user {
  opacity: 1 !important;
  filter: none !important;
}


/* havexa-v6-scroll-real-fix */
html {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

.shell {
  display: flex;
  min-height: calc(100vh - 72px);
  align-items: flex-start;
}

.content {
  flex: 1;
  min-width: 0;
  min-height: auto;
  overflow: visible;
}

@media (max-width: 980px) {
  .shell {
    min-height: auto;
  }

  .content {
    min-height: auto;
  }
}

/* only lock scroll while a modal is actually open */
body.modal-open {
  overflow: hidden;
}

/* profile modal centering without breaking page scroll */
.modal-overlay[data-profile-modal] {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px;
  z-index: 6000 !important;
}

.modal-overlay[data-profile-modal][data-open="1"] {
  display: flex !important;
}

.profile-modal-card {
  width: min(760px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 48px) !important;
  overflow: auto !important;
  margin: 0 auto !important;
}



.topbar-user{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid var(--border);
  background:transparent;
  text-align:left;
  min-width:220px;
  max-width:min(340px,36vw);
  width:auto;
  cursor:pointer;
}

.topbar-user-copy{
  min-width:0;
}

.topbar-user-copy strong{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}



.topbar-user.profile-trigger{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid var(--border) !important;
  background:transparent;
  text-align:left;
  width:auto;
  min-width:fit-content;
  max-width:min(520px, 48vw);
  padding-right:20px !important;
  cursor:pointer;
  flex:0 1 auto;
}

.topbar-user.profile-trigger .avatar{
  flex:0 0 auto;
}

.topbar-user.profile-trigger .topbar-user-copy{
  min-width:0;
  flex:1 1 auto;
}

.topbar-user.profile-trigger .topbar-user-copy strong{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* dark mode readability */
body:not(.light) .topbar-user.profile-trigger .topbar-user-copy strong{
  color:#f8fafc !important;
}

body:not(.light) .topbar-user.profile-trigger{
  border-color:rgba(255,255,255,.14) !important;
  background:rgba(15,23,42,.18) !important;
}

/* light mode keep dynamic width too */
body.light .topbar-user.profile-trigger .topbar-user-copy strong{
  color:#0f172a !important;
}


/* topbar profile trigger final */
.topbar-user.profile-trigger{
  appearance:none;
  -webkit-appearance:none;
  display:inline-flex;
  align-items:center;
  gap:12px;
  border:1px solid var(--border) !important;
  background:rgba(255,255,255,.04);
  text-align:left;
  width:auto;
  min-width:unset;
  max-width:none;
  padding:6px 16px 6px 10px;
  cursor:pointer;
  flex:0 0 auto;
}

body.light .topbar-user.profile-trigger{
  background:rgba(37,99,235,.05) !important;
}

.topbar-user.profile-trigger .avatar{
  flex:0 0 auto;
}

.topbar-user.profile-trigger .topbar-user-copy{
  min-width:0;
  flex:0 1 auto;
}

.topbar-user.profile-trigger .topbar-user-copy strong{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

body:not(.light) .topbar-user.profile-trigger .topbar-user-copy strong{
  color:#f8fafc !important;
}

body.light .topbar-user.profile-trigger .topbar-user-copy strong{
  color:#0f172a !important;
}

/* profile modal */
.modal-overlay[data-profile-modal]{
  display:none;
}

.modal-overlay[data-profile-modal][data-open="1"]{
  display:flex !important;
}


/* user edit premium */
.user-edit-shell{
  display:grid;
  gap:18px;
}

.user-edit-head{
  align-items:center;
}

.user-edit-kicker{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:10px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  background:rgba(77,163,255,.14);
  color:var(--accent);
  border:1px solid rgba(77,163,255,.22);
}

body.light .user-edit-kicker{
  background:rgba(37,99,235,.10);
  border-color:rgba(37,99,235,.18);
  color:#2563eb;
}

.user-edit-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  padding:22px;
  overflow:hidden;
  position:relative;
}

.user-edit-hero::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(77,163,255,.12), transparent 58%),
    radial-gradient(340px 140px at 100% 0%, rgba(139,92,246,.10), transparent 50%);
}

body.light .user-edit-hero::before{
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(37,99,235,.10), transparent 58%),
    radial-gradient(340px 140px at 100% 0%, rgba(59,130,246,.08), transparent 50%);
}

.user-edit-hero-main,
.user-edit-logo-card{
  position:relative;
  z-index:1;
}

.user-edit-hero-main{
  display:flex;
  gap:18px;
  align-items:flex-start;
}

.user-edit-avatar{
  width:78px;
  height:78px;
  min-width:78px;
  border-radius:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:32px;
  font-weight:900;
  color:#fff;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  box-shadow:
    0 18px 38px rgba(77,163,255,.24),
    inset 0 1px 0 rgba(255,255,255,.20);
}

body.light .user-edit-avatar{
  box-shadow:
    0 18px 38px rgba(37,99,235,.18),
    inset 0 1px 0 rgba(255,255,255,.25);
}

.user-edit-hero-copy{
  min-width:0;
  display:grid;
  gap:10px;
}

.user-edit-title-row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.user-edit-title-row h2{
  margin:0;
  font-size:32px;
  line-height:1.05;
}

.user-edit-hero-copy p{
  margin:0;
  color:var(--muted);
  font-size:15px;
}

.user-role-badge.admin{
  background:rgba(139,92,246,.12);
  color:#a78bfa;
  border-color:rgba(139,92,246,.24);
}

body.light .user-role-badge.admin{
  color:#7c3aed;
}

.user-edit-meta{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:6px;
}

.user-edit-meta-card,
.user-edit-logo-card{
  padding:14px 16px;
  border-radius:18px;
  background:rgba(255,255,255,.05);
  border:1px solid var(--border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}

body.light .user-edit-meta-card,
body.light .user-edit-logo-card{
  background:rgba(255,255,255,.82);
}

.user-edit-meta-label,
.user-edit-logo-label{
  display:block;
  margin-bottom:6px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.user-edit-logo-card{
  min-width:220px;
  align-self:stretch;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.user-edit-logo-preview{
  max-height:78px;
  max-width:220px;
  object-fit:contain;
}

.user-edit-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.user-edit-card{
  padding:20px;
  border-radius:22px;
}

.user-edit-card .card-head{
  margin-bottom:16px;
}

.user-edit-upload{
  display:grid;
  gap:8px;
}

.user-edit-upload span{
  font-weight:700;
}

.user-edit-savebar{
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.user-edit-save-copy h3{
  margin:0 0 6px 0;
}

.user-edit-save-copy p{
  margin:0;
}

.user-edit-save-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width: 1100px){
  .user-edit-grid{
    grid-template-columns:1fr;
  }

  .user-edit-savebar{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width: 900px){
  .user-edit-hero{
    grid-template-columns:1fr;
  }

  .user-edit-hero-main{
    flex-direction:column;
  }

  .user-edit-meta{
    grid-template-columns:1fr;
  }

  .user-edit-logo-card{
    min-width:0;
  }
}


/* crm edit premium */
.crm-edit-shell{
  display:grid;
  gap:18px;
}

.crm-edit-head{
  align-items:center;
}

.crm-edit-kicker{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:10px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  background:rgba(16,185,129,.14);
  color:#10b981;
  border:1px solid rgba(16,185,129,.22);
}

body.light .crm-edit-kicker{
  background:rgba(16,185,129,.10);
  border-color:rgba(16,185,129,.18);
  color:#059669;
}

.crm-edit-hero{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:18px;
  padding:22px;
  overflow:hidden;
  position:relative;
}

.crm-edit-hero::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(16,185,129,.12), transparent 58%),
    radial-gradient(340px 140px at 100% 0%, rgba(77,163,255,.10), transparent 50%);
}

body.light .crm-edit-hero::before{
  background:
    radial-gradient(420px 180px at 0% 0%, rgba(16,185,129,.10), transparent 58%),
    radial-gradient(340px 140px at 100% 0%, rgba(37,99,235,.08), transparent 50%);
}

.crm-edit-hero-main{
  position:relative;
  z-index:1;
  display:flex;
  gap:18px;
  align-items:flex-start;
}

.crm-edit-avatar{
  width:78px;
  height:78px;
  min-width:78px;
  border-radius:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:32px;
  font-weight:900;
  color:#fff;
  background:linear-gradient(135deg,#10b981,#34d399);
  box-shadow:
    0 18px 38px rgba(16,185,129,.24),
    inset 0 1px 0 rgba(255,255,255,.20);
}

.crm-edit-hero-copy{
  min-width:0;
  display:grid;
  gap:10px;
}

.crm-edit-title-row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.crm-edit-title-row h2{
  margin:0;
  font-size:32px;
  line-height:1.05;
}

.crm-edit-hero-copy p{
  margin:0;
  color:var(--muted);
  font-size:15px;
}

.crm-stage-badge{
  background:rgba(16,185,129,.12);
  color:#34d399;
  border-color:rgba(16,185,129,.24);
}

body.light .crm-stage-badge{
  color:#059669;
}

.crm-edit-meta{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:6px;
}

.crm-edit-meta-card{
  padding:14px 16px;
  border-radius:18px;
  background:rgba(255,255,255,.05);
  border:1px solid var(--border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}

body.light .crm-edit-meta-card{
  background:rgba(255,255,255,.82);
}

.crm-edit-meta-label{
  display:block;
  margin-bottom:6px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}

.crm-edit-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.crm-edit-card{
  padding:20px;
  border-radius:22px;
}

.crm-edit-card .card-head{
  margin-bottom:16px;
}

.crm-edit-savebar{
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.crm-edit-save-copy h3{
  margin:0 0 6px 0;
}

.crm-edit-save-copy p{
  margin:0;
}

.crm-edit-save-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width: 1100px){
  .crm-edit-grid{
    grid-template-columns:1fr;
  }

  .crm-edit-savebar{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (max-width: 900px){
  .crm-edit-hero-main{
    flex-direction:column;
  }

  .crm-edit-meta{
    grid-template-columns:1fr;
  }
}




  .crm-edit-map-frame-wrap,
  .crm-edit-map-frame{
    min-height:260px;
    height:260px;
  }
}


.crm-edit-map-card{
  display:flex;
  flex-direction:column;
}

.crm-edit-map-shell{
  display:grid;
  grid-template-rows:minmax(260px, 1fr) auto;
  gap:16px;
  height:100%;
  min-height:100%;
}

.crm-edit-map-frame{
  width:100%;
  min-height:320px;
  height:100%;
  border-radius:20px;
  overflow:hidden;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}

body.light .crm-edit-map-frame{
  background:rgba(255,255,255,.82);
}


@media (max-width: 1100px){
  .crm-edit-map-frame{
    min-height:280px;
  }
}


/* crm map card overflow fix */
.crm-edit-card{
  min-width: 0;
}

.crm-edit-map-card{
  min-width: 0;
  overflow: hidden;
}

.crm-edit-map-shell{
  display: grid;
  grid-template-rows: minmax(260px, 1fr);
  gap: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
}

.crm-edit-map-frame{
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 320px;
  height: 320px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.crm-edit-map-frame .mapboxgl-map,
.crm-edit-map-frame canvas{
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 1100px){
  .crm-edit-map-frame{
    min-height: 280px;
    height: 280px;
  }
}


/* crm map card final cleanup */
.crm-edit-card{
  min-width: 0;
}

.crm-edit-map-card{
  min-width: 0;
  overflow: hidden;
}

.crm-edit-map-shell{
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 20px;
}

.crm-edit-map-frame{
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 320px;
  height: 320px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.crm-edit-map-frame .mapboxgl-map,
.crm-edit-map-frame .mapboxgl-canvas-container,
.crm-edit-map-frame canvas{
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  display: block;
}

@media (max-width: 1100px){
  .crm-edit-map-shell,
  .crm-edit-map-frame{
    min-height: 280px;
    height: 280px;
  }
}


/* scroll background overlap fix */
html{
  min-height:100%;
  background:
    linear-gradient(180deg,var(--bg2),var(--bg));
  background-repeat:no-repeat;
  background-attachment:scroll;
}

body{
  min-height:100vh;
  background:
    radial-gradient(circle at top left, rgba(77,163,255,.08), transparent 22%),
    linear-gradient(180deg,var(--bg2),var(--bg));
  background-repeat:no-repeat;
  background-size:100% 100%;
  background-attachment:scroll;
}

body.light{
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.06), transparent 22%),
    linear-gradient(180deg,var(--bg2),var(--bg));
  background-repeat:no-repeat;
  background-size:100% 100%;
  background-attachment:scroll;
}

.shell{
  background:transparent;
  min-height:calc(100vh - 72px);
}

.content{
  background:transparent;
}

@media (min-height: 1200px){
  body,
  body.light{
    background-size:100% max(100vh, 1800px);
  }
}


.form-row-3{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

@media (max-width: 900px){
  .form-row-3{
    grid-template-columns:1fr;
  }
}


.user-edit-map-card{
  display:flex;
  flex-direction:column;
}

.user-edit-map-shell{
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  height:320px;
  overflow:hidden;
  border-radius:20px;
}

.user-edit-map-frame{
  display:block;
  width:100%;
  min-width:0;
  max-width:100%;
  min-height:320px;
  height:320px;
  border-radius:20px;
  overflow:hidden;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}

body.light .user-edit-map-frame{
  background:rgba(255,255,255,.82);
}

.user-edit-map-frame .mapboxgl-map,
.user-edit-map-frame .mapboxgl-canvas-container,
.user-edit-map-frame canvas{
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  display:block;
}

@media (max-width: 1100px){
  .user-edit-map-shell,
  .user-edit-map-frame{
    min-height:280px;
    height:280px;
  }
}


.faq-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.faq-card{
  min-height:220px;
}

@media (max-width: 900px){
  .faq-grid{
    grid-template-columns:1fr;
  }
}


.dashboard-map-panel{
  overflow:hidden;
}

.dashboard-customer-map-shell{
  width:100%;
  min-width:0;
  max-width:100%;
  height:420px;
  border-radius:22px;
  overflow:hidden;
}

.dashboard-customer-map{
  width:100%;
  height:420px;
  border-radius:22px;
  border:1px solid var(--border);
  overflow:hidden;
  background:rgba(255,255,255,.04);
}

.dashboard-customer-map .mapboxgl-map,
.dashboard-customer-map .mapboxgl-canvas-container,
.dashboard-customer-map canvas{
  width:100% !important;
  height:100% !important;
  display:block;
}

.dashboard-map-popup strong{
  display:block;
  font-size:14px;
  line-height:1.4;
}

@media (max-width: 900px){
  .dashboard-customer-map-shell,
  .dashboard-customer-map{
    height:320px;
  }
}


.dashboard-map-legend{
  display:flex;
  gap:10px 16px;
  flex-wrap:wrap;
  align-items:center;
  margin:0 0 14px;
}

.dashboard-map-legend-item{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  color:var(--text-muted, rgba(255,255,255,.74));
}

.dashboard-map-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  display:inline-block;
  box-shadow:0 0 0 3px rgba(255,255,255,.08);
}

.dashboard-map-dot.is-lead{ background:#f59e0b; }
.dashboard-map-dot.is-active{ background:#2563eb; }
.dashboard-map-dot.is-prospect{ background:#10b981; }
.dashboard-map-dot.is-lost{ background:#ef4444; }

body.light .dashboard-map-legend-item{
  color:rgba(15,23,42,.72);
}

body.light .dashboard-map-dot{
  box-shadow:0 0 0 3px rgba(15,23,42,.06);
}


/* dakmeting map render fix */
#roofEngineMap{
  position:relative;
  isolation:isolate;
  background:transparent;
}

#roofEngineMap .mapboxgl-map,
#roofEngineMap .mapboxgl-canvas-container,
#roofEngineMap .mapboxgl-canvas{
  width:100% !important;
  height:100% !important;
  display:block;
}

#roofEngineMap .mapboxgl-canvas{
  background:transparent !important;
}


/* dakmeting overlay visibility fix */
#roofEngineMap .mapboxgl-control-container{
  position:relative;
  z-index:4;
}










/* clean debug mapbox */
#roofEngineMap{
  position:relative;
  isolation:isolate;
  background:transparent;
}

.roof-debug-toolbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.roof-debug-panel{
  margin:0 0 12px;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(15,23,42,.88);
  color:#dbeafe;
  font-size:12px;
  line-height:1.5;
  max-height:220px;
  overflow:auto;
  white-space:pre-wrap;
}

body.light .roof-debug-panel{
  background:#0f172a;
  color:#e2e8f0;
}


/* clean debug mapbox fix */
#roofEngineMap{
  background: transparent !important;
}


/* no camera move fix */
#roofEngineMap{background:transparent !important;}


/* clean reset build */
#roofEngineMap{
  position:relative;
  background:transparent !important;
}

#roofEngineMap .mapboxgl-map,
#roofEngineMap .mapboxgl-canvas-container,
#roofEngineMap .mapboxgl-canvas{
  width:100% !important;
  height:100% !important;
  display:block;
  background:transparent !important;
}



/* canvas overlay polygon fix */
.roof-overlay-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

#roofEngineMap .mapboxgl-control-container{
  z-index: 5;
}




/* map container empty fix */
.roof-map-wrap{
  position: relative;
}

.roof-map-wrap #roofEngineMap{
  position: relative;
  z-index: 1;
}

.roof-map-wrap .roof-overlay-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.roof-map-wrap .mapboxgl-control-container{
  z-index: 5;
}




/* polygon probe overlay */
.roof-overlay-probe{
  position:absolute;
  left:10px;
  bottom:10px;
  z-index:6;
  margin:0;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(15,23,42,.82);
  color:#e5e7eb;
  font-size:11px;
  line-height:1.35;
  max-width:360px;
  max-height:170px;
  overflow:auto;
  pointer-events:none;
  white-space:pre-wrap;
}



/* =========================
IPHONE / SMALL MOBILE FIXES
========================= */
@media (max-width: 820px){
  .topbar{
    height:auto;
    min-height:72px;
    padding:12px 14px;
    align-items:flex-start;
    flex-direction:column;
    gap:12px;
  }

  .topbar-left,
  .topnav{
    width:100%;
    min-width:0;
  }

  .topnav{
    justify-content:flex-start;
    gap:10px;
  }

  .brand2{
    width:100%;
    padding:6px 0;
  }

  .brand2-copy{
    min-width:0;
  }

  .brand2-name{
    font-size:15px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .shell{
    flex-direction:column;
    min-height:calc(100vh - 72px);
  }

  .sidebar,
  .sidebar.collapsed{
    width:100%;
    padding:12px;
    border-right:none;
    border-bottom:1px solid var(--border);
    border-radius:0 0 18px 18px;
  }

  .sidebar-top{
    padding-bottom:8px;
    margin-bottom:4px;
  }

  .sidebar-logo,
  .sidebar.collapsed .sidebar-logo{
    opacity:1;
    width:auto;
  }

  .sidebar-menu{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }

  .side-link,
  .side-group-toggle{
    min-width:0;
  }

  .content{
    padding:16px 14px 24px;
    min-width:0;
  }

  .panel,
  .card,
  .widget,
  .stat-card,
  .calc-box{
    border-radius:16px;
  }

  .row-between{
    align-items:flex-start;
  }

  table{
    display:block;
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
}

@media (max-width: 640px){
  html{
    -webkit-text-size-adjust:100%;
  }

  .topbar{
    padding:10px 12px;
    gap:10px;
  }

  .topnav{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
  }

  .topnav > *{
    min-width:0;
  }

  .lang-dropdown{
    width:100%;
  }

  .lang-dropdown-trigger{
    width:100%;
    min-width:0;
    justify-content:space-between;
  }

  .topbar-user{
    width:100%;
    justify-content:flex-start;
  }

  .topbar-user-copy{
    min-width:0;
  }

  .topbar-user-copy strong{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .theme-btn,
  .topbar .btn,
  .topbar form,
  .topbar form .btn{
    width:100%;
  }

  .sidebar,
  .sidebar.collapsed{
    padding:10px 12px;
  }

  .sidebar-menu{
    grid-template-columns:1fr;
  }

  .content{
    padding:14px 12px 20px;
  }

  .page-head{
    margin-bottom:12px;
  }

  h1{
    font-size:clamp(28px, 8vw, 38px);
  }

  h2{
    font-size:clamp(22px, 6vw, 30px);
  }

  .form-grid,
  .crm-grid,
  .user-form-grid,
  .quote-grid,
  .dashboard-grid,
  .stats-grid{
    grid-template-columns:1fr !important;
  }

  .btn{
    width:100%;
    justify-content:center;
  }

  .btn-group,
  .crm-card-actions,
  .user-actions,
  .quote-actions{
    flex-direction:column;
    align-items:stretch;
  }

  input,
  select,
  textarea{
    font-size:16px;
  }
}


/* =========================
IPHONE / MOBILE TOP MENU REDUCTION
========================= */
@media (max-width: 820px){
  .topbar{
    position:sticky;
    top:0;
    z-index:1200;
    padding:10px 12px 8px;
    gap:8px;
    background:rgba(7,19,30,.92);
    backdrop-filter:blur(10px);
    -webkit-backdrop-filter:blur(10px);
  }

  body.light .topbar{
    background:rgba(255,255,255,.94);
  }

  .topbar-left{
    display:flex;
    align-items:center;
    justify-content:space-between;
  }

  .brand2{
    width:auto;
    padding:4px 0;
    gap:8px;
  }

  .mark2{
    width:28px;
    height:28px;
    border-radius:10px;
    font-size:15px;
  }

  .brand2-name{
    font-size:14px;
    letter-spacing:.06em;
  }

  .brand2-tag{
    display:none !important;
  }

  .topnav{
    display:flex;
    flex-wrap:nowrap;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    gap:8px;
    padding:2px 0 2px;
    justify-content:flex-start;
    scrollbar-width:none;
  }

  .topnav::-webkit-scrollbar{
    display:none;
  }

  .topnav > *{
    flex:0 0 auto;
  }

  .lang-dropdown-trigger,
  .theme-btn,
  .topbar .btn,
  .topbar-user{
    min-height:36px;
    height:36px;
    padding:0 10px;
    border-radius:12px;
  }

  .lang-dropdown-trigger{
    min-width:132px;
  }

  .lang-dropdown-current{
    font-size:13px;
    gap:6px;
  }

  .topbar-user{
    max-width:160px;
  }

  .topbar-user-copy strong{
    font-size:12px;
  }

  .avatar{
    width:30px;
    height:30px;
    min-width:30px;
    font-size:12px;
  }

  .shell{
    min-height:calc(100vh - 60px);
  }

  .sidebar,
  .sidebar.collapsed{
    display:none !important;
  }

  .content{
    width:100%;
    padding:14px 12px 22px;
    min-height:calc(100vh - 60px);
  }

  .page-head{
    margin-bottom:12px;
  }

  .page-head h1,
  .page-head h2{
    margin-bottom:6px;
  }
}

@media (max-width: 640px){
  .topbar{
    padding:8px 10px 6px;
    gap:6px;
  }

  .topbar-left{
    width:100%;
  }

  .brand2-name{
    font-size:13px;
  }

  .topnav{
    gap:6px;
    padding-bottom:1px;
  }

  .lang-dropdown-trigger,
  .theme-btn,
  .topbar .btn,
  .topbar-user{
    min-height:34px;
    height:34px;
    padding:0 9px;
    border-radius:11px;
  }

  .lang-dropdown-trigger{
    min-width:120px;
  }

  .topbar-user{
    max-width:136px;
  }

  .topbar-user-copy span{
    display:none;
  }

  .topbar .inline-form{
    display:block;
  }

  .topbar .inline-form .btn{
    width:auto;
  }

  .content{
    padding:12px 10px 18px;
  }
}


/* Mapbox hard render fix */
.dashboard-customer-map,
#dashboardCustomerMap,
.roof-map,
#roofEngineMap{
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.dashboard-customer-map .mapboxgl-map,
.dashboard-customer-map .mapboxgl-canvas-container,
.dashboard-customer-map .mapboxgl-canvas,
#dashboardCustomerMap .mapboxgl-map,
#dashboardCustomerMap .mapboxgl-canvas-container,
#dashboardCustomerMap .mapboxgl-canvas,
#roofEngineMap .mapboxgl-map,
#roofEngineMap .mapboxgl-canvas-container,
#roofEngineMap .mapboxgl-canvas{
  width:100% !important;
  height:100% !important;
  display:block !important;
}


/* =========================
MOBILE OFF-CANVAS MENU
========================= */
.mobile-menu-backdrop{
  position:fixed;
  inset:0;
  background:rgba(2, 6, 23, .42);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
  z-index:1198;
}
.mobile-menu-backdrop.is-open{
  opacity:1;
  pointer-events:auto;
}

.mobile-menu-toggle{
  display:none;
  width:40px;
  height:40px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  font-size:20px;
  align-items:center;
  justify-content:center;
  flex:0 0 40px;
}
body.light .mobile-menu-toggle{
  background:#fff;
}

@media (max-width: 900px){
  html.mobile-menu-open,
  body.mobile-menu-open{
    overflow:hidden;
    overscroll-behavior:none;
    touch-action:none;
  }

  .topbar{
    position:sticky;
    top:0;
    z-index:1200;
  }

  .mobile-menu-toggle{
    display:inline-flex;
  }

  .topbar-left{
    gap:10px;
  }

  .brand2{
    width:auto;
    min-width:0;
  }

  .brand2-tag{
    display:none !important;
  }

  .shell{
    display:block;
    min-height:auto;
  }

  .sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    width:min(82vw, 340px);
    max-width:340px;
    transform:translateX(-104%);
    transition:transform .2s ease;
    z-index:1199;
    border-right:1px solid var(--border);
    border-bottom:none;
    border-radius:0 22px 22px 0;
    padding:18px 12px;
    overflow:auto;
    box-shadow:0 26px 70px rgba(0,0,0,.28);
  }

  .sidebar.is-mobile-open{
    transform:translateX(0);
  }

  .sidebar.collapsed{
    width:min(82vw, 340px);
    padding:18px 12px;
  }

  .sidebar.collapsed .sidebar-logo{
    opacity:1;
    width:auto;
  }

  .sidebar-top{
    position:sticky;
    top:0;
    z-index:2;
    background:inherit;
    padding-bottom:12px;
    margin-bottom:8px;
  }

  .sidebar-menu{
    display:flex;
    flex-direction:column;
    gap:6px;
  }

  .content{
    padding:14px 12px 22px;
    min-height:auto;
  }
}

@media (max-width: 640px){
  .topbar{
    padding:10px 12px;
  }

  .topnav{
    display:flex;
    flex-wrap:nowrap;
    overflow-x:auto;
    gap:8px;
    justify-content:flex-start;
    scrollbar-width:none;
  }

  .topnav::-webkit-scrollbar{
    display:none;
  }

  .topnav > *{
    flex:0 0 auto;
  }

  .topbar-user{
    max-width:170px;
  }

  .lang-dropdown-trigger,
  .theme-btn,
  .topbar .btn,
  .topbar-user{
    min-height:36px;
    height:36px;
  }
}


/* =========================
MOBILE OFF-CANVAS SIDEBAR VISIBILITY FIX
========================= */
@media (max-width: 900px){
  .sidebar{
    display:flex !important;
    flex-direction:column;
  }

  .sidebar:not(.is-mobile-open){
    transform:translateX(-104%) !important;
  }

  .sidebar.is-mobile-open{
    display:flex !important;
    transform:translateX(0) !important;
    visibility:visible !important;
    opacity:1 !important;
  }

  .sidebar .side-group-panel,
  .sidebar .sidebar-menu,
  .sidebar .sidebar-top{
    opacity:1 !important;
    visibility:visible !important;
  }

  .sidebar.collapsed .side-label,
  .sidebar.collapsed .side-chevron{
    display:inline !important;
    opacity:1 !important;
    width:auto !important;
  }

  .sidebar.collapsed .side-link,
  .sidebar.collapsed .side-group-toggle{
    justify-content:flex-start !important;
    padding-left:14px !important;
    padding-right:14px !important;
  }
}


/* =========================
MOBILE TOP SPACING FIX
========================= */
@media (max-width: 900px){
  .topbar{
    margin-bottom:0 !important;
    border-bottom-width:1px;
  }

  .content{
    padding-top:8px !important;
  }

  .page-head{
    margin-top:0 !important;
  }

  .shell{
    gap:0 !important;
  }

  body.light .topbar{
    box-shadow:0 8px 22px rgba(15,23,42,.06) !important;
  }
}

@media (max-width: 640px){
  .topbar{
    padding-bottom:8px !important;
  }

  .content{
    padding-top:6px !important;
  }

  .page-head h1,
  .page-head h2{
    margin-top:0 !important;
  }

  .subscription-banner,
  .calc-box:first-child,
  .panel:first-child{
    margin-top:0 !important;
  }
}


/* =========================
MOBILE LIGHT MODE DASHBOARD COMPACT FIX
========================= */
@media (max-width: 900px){
  body.light .content{
    padding-top:0 !important;
    margin-top:0 !important;
  }

  body.light .content > *:first-child{
    margin-top:0 !important;
  }

  body.light .content .page-head{
    margin-top:0 !important;
    padding-top:0 !important;
  }

  body.light .content .page-head h1,
  body.light .content .page-head h2,
  body.light .content .page-head p{
    margin-top:0 !important;
  }

  body.light .content .calc-box:first-child,
  body.light .content .panel:first-child,
  body.light .content .kpi-grid:first-child,
  body.light .content section:first-child,
  body.light .content div:first-child{
    margin-top:0 !important;
  }

  body.light .kpi-grid,
  body.light .charts-grid{
    margin-top:12px !important;
  }
}

@media (max-width: 640px){
  body.light .topbar{
    padding-bottom:6px !important;
  }

  body.light .content{
    padding:0 10px 18px !important;
    margin-top:0 !important;
  }

  body.light .content > .calc-box:first-child{
    margin-top:8px !important;
  }

  body.light .content > .page-head{
    margin-top:8px !important;
    margin-bottom:10px !important;
  }

  body.light .content > .page-head + *{
    margin-top:0 !important;
  }
}


/* =========================
MOBILE TOPBAR CONTROLS INLINE FIX
========================= */
@media (max-width: 900px){
  .topbar{
    padding:10px 12px 8px !important;
    gap:8px !important;
  }

  .topbar-left{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }

  .brand2{
    flex:0 1 auto;
    max-width:calc(100% - 56px);
  }

  .topnav{
    width:100%;
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:center;
    justify-content:flex-start;
    gap:8px !important;
    overflow-x:auto;
    overflow-y:hidden;
    padding:2px 0 2px;
    scrollbar-width:none;
  }

  .topnav::-webkit-scrollbar{
    display:none;
  }

  .topnav > *{
    flex:0 0 auto;
  }

  .lang-dropdown{
    flex:0 0 auto;
    min-width:0;
  }

  .lang-dropdown-trigger{
    min-width:0 !important;
    width:auto !important;
    max-width:180px;
    padding:0 10px !important;
    gap:8px !important;
  }

  .lang-dropdown-current{
    gap:6px !important;
    font-size:13px !important;
    max-width:132px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .lang-dropdown-menu{
    right:auto !important;
    left:0 !important;
    min-width:220px;
    max-width:min(92vw, 280px);
  }

  .theme-btn{
    width:36px !important;
    height:36px !important;
    min-width:36px !important;
    flex:0 0 36px;
  }

  .topbar-user{
    width:auto !important;
    max-width:190px !important;
    padding:4px 10px !important;
    gap:8px !important;
  }

  .avatar{
    width:32px !important;
    height:32px !important;
    min-width:32px !important;
  }

  .topbar-user-copy{
    min-width:0;
  }

  .topbar-user-copy strong{
    font-size:12px !important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:110px;
  }

  .topbar .inline-form{
    display:inline-flex !important;
    flex:0 0 auto;
  }

  .topbar .inline-form .btn{
    width:auto !important;
    min-width:unset !important;
    height:36px !important;
    padding:0 12px !important;
    white-space:nowrap;
  }
}

@media (max-width: 640px){
  .topbar{
    padding:8px 10px 6px !important;
    gap:6px !important;
  }

  .brand2{
    max-width:calc(100% - 52px);
    padding:6px 8px !important;
  }

  .mark2{
    width:30px !important;
    height:30px !important;
    min-width:30px !important;
  }

  .brand2-name{
    font-size:12px !important;
    letter-spacing:.04em !important;
  }

  .topnav{
    gap:6px !important;
  }

  .lang-dropdown-trigger{
    max-width:150px !important;
    height:34px !important;
    padding:0 9px !important;
    border-radius:11px !important;
  }

  .lang-dropdown-current{
    max-width:104px !important;
    font-size:12px !important;
  }

  .theme-btn{
    width:34px !important;
    height:34px !important;
    min-width:34px !important;
  }

  .topbar-user{
    max-width:152px !important;
    height:34px !important;
    padding:3px 8px !important;
    border-radius:11px !important;
  }

  .avatar{
    width:28px !important;
    height:28px !important;
    min-width:28px !important;
    font-size:11px !important;
  }

  .topbar-user-copy strong{
    max-width:84px !important;
    font-size:11px !important;
  }

  .topbar .inline-form .btn{
    height:34px !important;
    padding:0 10px !important;
    border-radius:11px !important;
    font-size:12px !important;
  }
}


/* =========================
MOBILE TOPBAR CONTROLS SMALLER FIX
========================= */
@media (max-width: 900px){
  .topnav{
    gap:6px !important;
  }

  .lang-dropdown-trigger{
    max-width:138px !important;
    height:34px !important;
    min-height:34px !important;
    padding:0 8px !important;
    border-radius:11px !important;
  }

  .lang-dropdown-current{
    max-width:92px !important;
    font-size:12px !important;
  }

  .theme-btn{
    width:32px !important;
    height:32px !important;
    min-width:32px !important;
    flex:0 0 32px !important;
    border-radius:11px !important;
    font-size:15px !important;
  }

  .topbar-user{
    max-width:138px !important;
    height:32px !important;
    min-height:32px !important;
    padding:2px 8px !important;
    gap:6px !important;
    border-radius:11px !important;
  }

  .avatar{
    width:24px !important;
    height:24px !important;
    min-width:24px !important;
    font-size:10px !important;
  }

  .topbar-user-copy strong{
    max-width:72px !important;
    font-size:10px !important;
    line-height:1 !important;
  }

  .topbar .inline-form .btn{
    height:32px !important;
    min-height:32px !important;
    padding:0 9px !important;
    border-radius:11px !important;
    font-size:11px !important;
    font-weight:700 !important;
  }
}

@media (max-width: 640px){
  .topbar{
    padding:8px 8px 6px !important;
  }

  .topnav{
    gap:5px !important;
  }

  .lang-dropdown-trigger{
    max-width:126px !important;
    height:30px !important;
    min-height:30px !important;
    padding:0 7px !important;
    border-radius:10px !important;
  }

  .lang-dropdown-current{
    max-width:80px !important;
    font-size:11px !important;
  }

  .theme-btn{
    width:30px !important;
    height:30px !important;
    min-width:30px !important;
    flex:0 0 30px !important;
    border-radius:10px !important;
    font-size:14px !important;
  }

  .topbar-user{
    max-width:122px !important;
    height:30px !important;
    min-height:30px !important;
    padding:2px 7px !important;
    gap:5px !important;
    border-radius:10px !important;
  }

  .avatar{
    width:22px !important;
    height:22px !important;
    min-width:22px !important;
    font-size:9px !important;
  }

  .topbar-user-copy strong{
    max-width:58px !important;
    font-size:9px !important;
  }

  .topbar .inline-form .btn{
    height:30px !important;
    min-height:30px !important;
    padding:0 8px !important;
    border-radius:10px !important;
    font-size:10px !important;
  }
}


/* =========================
MOBILE TOPBAR ICONS VISIBLE FIX
========================= */
@media (max-width: 640px){
  .topbar{
    overflow:visible !important;
  }

  .topnav{
    display:grid !important;
    grid-template-columns:minmax(0, 1fr) auto auto auto !important;
    align-items:center !important;
    gap:6px !important;
    width:100% !important;
    overflow:visible !important;
  }

  .topnav > *{
    min-width:0 !important;
  }

  .lang-dropdown{
    width:auto !important;
    min-width:0 !important;
    flex:none !important;
  }

  .lang-dropdown-trigger{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
  }

  .lang-dropdown-current{
    max-width:none !important;
  }

  .theme-btn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }

  .topbar-user{
    width:auto !important;
    min-width:0 !important;
    max-width:110px !important;
    justify-content:flex-start !important;
  }

  .topbar .inline-form{
    display:inline-flex !important;
    min-width:0 !important;
  }

  .topbar .inline-form .btn{
    width:auto !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }
}

/* extra small phones */
@media (max-width: 420px){
  .topnav{
    grid-template-columns:minmax(0, 1fr) 30px 98px 68px !important;
    gap:5px !important;
  }

  .lang-dropdown-trigger{
    height:30px !important;
    padding:0 8px !important;
  }

  .lang-dropdown-current{
    font-size:11px !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }

  .theme-btn{
    width:30px !important;
    height:30px !important;
    min-width:30px !important;
  }

  .topbar-user{
    max-width:98px !important;
    height:30px !important;
    padding:2px 6px !important;
  }

  .topbar-user-copy strong{
    max-width:46px !important;
  }

  .topbar .inline-form .btn{
    height:30px !important;
    padding:0 7px !important;
    font-size:10px !important;
  }
}


/* =========================
MOBILE LANGUAGE DROPDOWN SMALLER
========================= */
@media (max-width: 640px){
  .topnav{
    grid-template-columns:minmax(0, .88fr) auto auto auto !important;
  }

  .lang-dropdown-trigger{
    max-width:168px !important;
    padding:0 8px !important;
  }

  .lang-dropdown-current{
    max-width:110px !important;
  }
}

@media (max-width: 420px){
  .topnav{
    grid-template-columns:minmax(0, .82fr) 30px 98px 68px !important;
  }

  .lang-dropdown-trigger{
    max-width:142px !important;
    padding:0 7px !important;
  }

  .lang-dropdown-current{
    max-width:92px !important;
  }
}


/* =========================
LIGHT MODE MOBILE SPACING FINAL FIX
========================= */
@media (max-width: 900px){
  body.light{
    background:#eef3f8 !important;
  }

  body.light .shell{
    min-height:auto !important;
  }

  body.light .content{
    padding:0 12px 18px !important;
    margin-top:0 !important;
    min-height:auto !important;
  }

  body.light .content::before{
    content:none !important;
  }

  body.light .content > *:first-child{
    margin-top:0 !important;
  }

  body.light .page-head{
    margin:8px 0 12px !important;
  }

  body.light .page-head + *{
    margin-top:0 !important;
  }

  body.light .kpi-grid,
  body.light .charts-grid{
    margin-top:0 !important;
  }

  body.light .calc-box,
  body.light .panel,
  body.light .kpi-card,
  body.light .widget,
  body.light .stat-card{
    margin-top:0 !important;
  }
}

@media (max-width: 640px){
  body.light .topbar{
    margin-bottom:0 !important;
    padding:8px 10px 6px !important;
    border-bottom:1px solid rgba(15,23,42,.08) !important;
  }

  body.light .topnav{
    margin-bottom:0 !important;
  }

  body.light .content{
    padding:0 10px 16px !important;
  }

  body.light .content > .calc-box:first-child{
    margin-top:6px !important;
  }

  body.light .content > .page-head{
    margin-top:6px !important;
    margin-bottom:10px !important;
  }

  body.light .content > .kpi-grid:first-child,
  body.light .content > .charts-grid:first-child,
  body.light .content > .panel:first-child{
    margin-top:6px !important;
  }
}


/* =========================
FORCE FIX MOBILE LIGHT WHITESPACE
========================= */
@media (max-width: 900px){
  .shell{
    display:block !important;
    min-height:auto !important;
    gap:0 !important;
  }

  .shell > .sidebar{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    bottom:0 !important;
    width:min(82vw, 340px) !important;
    max-width:340px !important;
    margin:0 !important;
    z-index:1199 !important;
  }

  .shell > .content{
    display:block !important;
    width:100% !important;
    min-height:auto !important;
    margin:0 !important;
    padding:8px 12px 22px !important;
  }

  body.light .shell > .content{
    padding:8px 12px 22px !important;
  }

  body.light .shell > .content > *{
    margin-top:0 !important;
  }

  body.light .shell > .content > *:first-child{
    margin-top:0 !important;
  }
}

@media (max-width: 640px){
  .shell > .content{
    padding:6px 10px 18px !important;
  }

  body.light .shell > .content{
    padding:6px 10px 18px !important;
  }
}


/* =========================
IPHONE OFF-CANVAS MENU FIX
========================= */
.mobile-menu-backdrop{
  position:fixed;
  inset:0;
  background:rgba(2, 6, 23, .42);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
  z-index:1198;
}
.mobile-menu-backdrop.is-open{
  opacity:1;
  pointer-events:auto;
}

.sidebar-mobile-close{
  display:none;
}

@media (max-width: 900px){
  body.mobile-menu-open{
    overflow:hidden !important;
  }

  .shell{
    display:block !important;
  }

  .mobile-menu-toggle{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }

  .sidebar{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    bottom:0 !important;
    width:min(84vw, 340px) !important;
    max-width:340px !important;
    transform:translateX(-110%) !important;
    transition:transform .22s ease !important;
    z-index:1199 !important;
    display:flex !important;
    flex-direction:column !important;
    visibility:visible !important;
    opacity:1 !important;
    overflow:auto !important;
    border-radius:0 22px 22px 0 !important;
    margin:0 !important;
    border-right:1px solid var(--border) !important;
    border-bottom:none !important;
  }

  .sidebar.is-mobile-open{
    transform:translateX(0) !important;
  }

  .sidebar:not(.is-mobile-open){
    pointer-events:none;
  }

  .sidebar.is-mobile-open{
    pointer-events:auto;
  }

  .sidebar-top{
    position:sticky;
    top:0;
    z-index:2;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px;
    padding-bottom:12px;
    margin-bottom:8px;
    background:inherit;
  }

  .sidebar-mobile-close{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:36px;
    height:36px;
    min-width:36px;
    border-radius:12px;
    border:1px solid var(--border);
    background:rgba(255,255,255,.06);
    color:var(--text);
    cursor:pointer;
    font-size:18px;
    line-height:1;
    order:2;
  }

  body.light .sidebar-mobile-close{
    background:#fff;
  }

  .sidebar-logo{
    order:1;
  }

  .sidebar-toggle{
    display:none !important;
  }

  .sidebar-menu,
  .side-group-panel{
    display:flex !important;
    flex-direction:column !important;
    opacity:1 !important;
    visibility:visible !important;
  }
}

@media (max-width: 640px){
  .topbar{
    padding:8px 10px 6px !important;
  }

  .topbar-left{
    align-items:center !important;
  }

  .mobile-menu-toggle{
    width:34px !important;
    height:34px !important;
    min-width:34px !important;
    border-radius:12px !important;
    font-size:18px !important;
  }

  .sidebar{
    width:min(88vw, 320px) !important;
  }
}


/* =========================
IPHONE LAYOUT HARD FIX
========================= */
@media (max-width: 900px){
  html, body{
    overflow-x:hidden !important;
  }

  .shell{
    display:block !important;
    min-height:auto !important;
  }

  .content{
    width:100% !important;
    margin:0 !important;
    padding:8px 12px 22px !important;
    min-height:auto !important;
  }

  .sidebar{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    bottom:0 !important;
    width:min(86vw, 330px) !important;
    max-width:330px !important;
    margin:0 !important;
    transform:translate3d(-112%,0,0) !important;
    -webkit-transform:translate3d(-112%,0,0) !important;
    transition:transform .22s ease !important;
    z-index:1300 !important;
    border-radius:0 24px 24px 0 !important;
    overflow:auto !important;
    box-shadow:0 26px 70px rgba(0,0,0,.30) !important;
    pointer-events:none !important;
  }

  .sidebar.is-mobile-open{
    transform:translate3d(0,0,0) !important;
    -webkit-transform:translate3d(0,0,0) !important;
    pointer-events:auto !important;
  }

  .sidebar.collapsed{
    width:min(86vw, 330px) !important;
    max-width:330px !important;
    padding:18px 12px !important;
  }

  .sidebar-toggle{
    display:none !important;
  }

  .sidebar-mobile-close{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }

  .topbar{
    position:sticky !important;
    top:0 !important;
    z-index:1200 !important;
    padding:10px 12px 8px !important;
    gap:8px !important;
  }

  .topbar-left{
    width:100% !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
  }

  .brand2{
    margin-left:auto !important;
  }
}

@media (max-width: 640px){
  .topbar{
    padding:8px 10px 6px !important;
  }

  .topnav{
    display:grid !important;
    grid-template-columns:minmax(0, 1fr) auto auto auto !important;
    gap:6px !important;
    align-items:center !important;
    width:100% !important;
    overflow:visible !important;
  }

  .lang-dropdown-trigger{
    width:100% !important;
    max-width:150px !important;
    min-width:0 !important;
    height:32px !important;
    min-height:32px !important;
    padding:0 8px !important;
  }

  .lang-dropdown-current{
    max-width:92px !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
    font-size:12px !important;
  }

  .theme-btn{
    width:32px !important;
    height:32px !important;
    min-width:32px !important;
  }

  .topbar-user{
    max-width:126px !important;
    height:32px !important;
    min-height:32px !important;
    padding:3px 8px !important;
  }

  .topbar-user-copy strong{
    max-width:62px !important;
    font-size:10px !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }

  .topbar .inline-form .btn{
    height:32px !important;
    min-height:32px !important;
    padding:0 9px !important;
    font-size:11px !important;
  }

  .content{
    padding:6px 10px 18px !important;
  }
}

@media (max-width: 420px){
  .topnav{
    grid-template-columns:minmax(0, 1fr) 32px 118px 74px !important;
    gap:5px !important;
  }

  .lang-dropdown-trigger{
    max-width:138px !important;
  }

  .lang-dropdown-current{
    max-width:84px !important;
    font-size:11px !important;
  }

  .topbar-user{
    max-width:118px !important;
  }

  .topbar-user-copy strong{
    max-width:54px !important;
    font-size:9px !important;
  }

  .topbar .inline-form .btn{
    padding:0 8px !important;
    font-size:10px !important;
  }
}


/* global pro UX helpers */
.btn.is-loading,
button.is-loading,
input[type="submit"].is-loading{
  position:relative;
  pointer-events:none;
  opacity:.88;
}

.btn.is-loading .btn-spinner,
button.is-loading .btn-spinner,
input[type="submit"].is-loading .btn-spinner{
  display:inline-flex;
}

.btn-spinner{
  width:16px;
  height:16px;
  border-radius:999px;
  border:2px solid currentColor;
  border-right-color:transparent;
  display:none;
  flex:0 0 auto;
  animation:hxSpin .7s linear infinite;
}

.btn-label,
.btn-loading-label{
  display:inline-flex;
  align-items:center;
}

.form-feedback{
  margin-top:6px;
  font-size:12px;
  color:var(--danger);
}

.hx-invalid,
.was-validated :invalid,
.was-validated select:invalid,
.was-validated textarea:invalid{
  border-color:rgba(239,68,68,.72) !important;
  box-shadow:0 0 0 3px rgba(239,68,68,.12) !important;
}

.hx-field-error{
  color:var(--danger);
}

.hx-submit-pending{
  cursor:progress;
}

@keyframes hxSpin{
  to{ transform:rotate(360deg); }
}


/* HAVEXA modal system polish */
.hx-modal-overlay{backdrop-filter: blur(14px) saturate(1.05);}
.hx-modal-shell{position:relative; overflow:hidden; border-radius:28px !important;}
.hx-modal-shell::before{content:""; position:absolute; inset:0 0 auto 0; height:1px; background:linear-gradient(90deg, rgba(59,130,246,0), rgba(59,130,246,.28), rgba(59,130,246,0)); pointer-events:none;}
.hx-modal-shell--sm{max-width:560px;}
.hx-modal-shell--md{max-width:760px;}
.hx-modal-shell--lg{max-width:1040px;}
.hx-modal-subtitle{margin:8px 0 0; max-width:60ch; font-size:.98rem; line-height:1.6; color:rgba(15,23,42,.68);}
body:not(.light) .hx-modal-subtitle{color:rgba(255,255,255,.76);}
.hx-modal-intro{display:grid; gap:8px;}
.hx-modal-section-stack{display:grid; gap:18px;}
.hx-form-section{background:linear-gradient(180deg, rgba(248,250,252,.98), rgba(241,245,249,.9)); border:1px solid rgba(148,163,184,.18); border-radius:22px; padding:18px; box-shadow:0 14px 32px rgba(15,23,42,.05);}
body:not(.light) .hx-form-section{
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.035));
  border:1px solid rgba(148,163,184,.24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 0 0 1px rgba(15,23,42,.12);
}
.hx-form-section__head{display:grid; gap:4px; margin-bottom:14px;}
.hx-form-section__title{margin:0; font-size:1rem; font-weight:800; letter-spacing:.01em;}
.hx-form-section__desc{margin:0; font-size:.92rem; color:rgba(15,23,42,.6);}
body:not(.light) .hx-form-section__desc{color:rgba(255,255,255,.66);}

body:not(.light) .hx-form-section__head{
  padding-bottom:10px;
  margin-bottom:16px;
  border-bottom:1px solid rgba(148,163,184,.18);
}
body:not(.light) .hx-form-section__title{
  color:#f8fafc;
}
body:not(.light) .hx-form-section__desc{
  color:rgba(226,232,240,.72);
}

.hx-form-actions{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end;}
.hx-modal-footer{position:sticky; bottom:0; z-index:2; background:linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.98) 28%); backdrop-filter: blur(14px); padding-bottom:calc(8px + env(safe-area-inset-bottom, 0px));}
body:not(.light) .hx-modal-footer{background:linear-gradient(180deg, rgba(15,23,42,.55), rgba(15,23,42,.94) 28%);}
.hx-modal-note{font-size:.92rem; line-height:1.5; color:rgba(15,23,42,.65);}
body:not(.light) .hx-modal-note{color:rgba(255,255,255,.7);}
.hx-profile-summary{display:flex; align-items:center; gap:14px; margin-bottom:18px; padding:14px 16px; border-radius:22px; background:linear-gradient(135deg, rgba(59,130,246,.1), rgba(14,165,233,.07)); border:1px solid rgba(59,130,246,.12);}
body:not(.light) .hx-profile-summary{background:linear-gradient(135deg, rgba(59,130,246,.18), rgba(14,165,233,.1)); border-color:rgba(96,165,250,.18);}
.hx-profile-avatar{display:grid; place-items:center; width:52px; height:52px; border-radius:18px; font-weight:800; letter-spacing:.04em; background:#0f172a; color:#fff; box-shadow:0 18px 32px rgba(15,23,42,.2); flex:0 0 auto;}
body:not(.light) .hx-profile-avatar{background:#fff; color:#0f172a;}
.hx-profile-summary__copy{display:grid; gap:2px; min-width:0;}
.hx-profile-summary__copy strong{font-size:1rem;}
.hx-profile-summary__copy span{font-size:.92rem; color:rgba(15,23,42,.62);}
body:not(.light) .hx-profile-summary__copy span{color:rgba(255,255,255,.68);}
.hx-confirm-icon{display:grid; place-items:center; width:52px; height:52px; border-radius:18px; margin-bottom:14px; font-size:1.3rem; font-weight:800; background:linear-gradient(135deg, rgba(239,68,68,.18), rgba(248,113,113,.1)); color:#b91c1c; border:1px solid rgba(239,68,68,.16);}
body:not(.light) .hx-confirm-icon{background:linear-gradient(135deg, rgba(248,113,113,.22), rgba(239,68,68,.08)); color:#fecaca; border-color:rgba(248,113,113,.16);}
.hx-modal-shell [type="text"], .hx-modal-shell [type="email"], .hx-modal-shell [type="password"], .hx-modal-shell textarea, .hx-modal-shell select{transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease;}
.hx-modal-shell [type="text"]:focus, .hx-modal-shell [type="email"]:focus, .hx-modal-shell [type="password"]:focus, .hx-modal-shell textarea:focus, .hx-modal-shell select:focus{transform:translateY(-1px);}
@media (max-width: 820px){
  .hx-modal-shell{border-radius:24px !important;}
  .hx-form-section{padding:16px; border-radius:20px;}
  .hx-modal-footer{padding-bottom:calc(10px + env(safe-area-inset-bottom, 0px));}
  .hx-form-actions{justify-content:stretch;}
  .hx-form-actions .btn{width:100%;}
  .hx-modal-subtitle{max-width:none;}
}

/* =========================
HAVEXA PRO SURFACES / INPUTS / BUTTONS / CARDS
========================= */
:root{
  --hx-ring:0 0 0 4px rgba(59,130,246,.12);
  --hx-card-bg:linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(248,250,255,.92) 100%);
  --hx-card-border:rgba(15,23,42,.08);
  --hx-card-shadow:0 16px 40px rgba(15,23,42,.08);
  --hx-card-shadow-hover:0 22px 48px rgba(15,23,42,.10);
}

.page-head,
.row-between{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.page-head h1,
.row-between h1{
  margin:0 0 6px;
  letter-spacing:-.03em;
}

.page-head .muted,
.row-between .muted{
  max-width:900px;
}

.btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:44px;
  padding:11px 16px;
  border-radius:15px;
  border:1px solid transparent;
  font-weight:800;
  letter-spacing:.01em;
  line-height:1;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease, opacity .16s ease;
  box-shadow:0 8px 20px rgba(15,23,42,.08);
}

.btn:hover{
  transform:translateY(-1px);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible{
  outline:none;
  box-shadow:var(--hx-ring);
}

.btn.primary{
  background:linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow:0 14px 30px rgba(37,99,235,.22);
}

.btn.primary:hover{
  box-shadow:0 18px 34px rgba(37,99,235,.26);
}

.btn.ghost{
  background:rgba(255,255,255,.9);
  border-color:rgba(15,23,42,.08);
  color:var(--text);
  box-shadow:0 8px 20px rgba(15,23,42,.06);
}

.btn.ghost:hover{
  border-color:rgba(37,99,235,.18);
  background:rgba(255,255,255,.98);
}

.btn-sm{
  min-height:38px;
  padding:8px 12px;
  border-radius:12px;
}


body:not(.light) .btn{
  color:#e5edf8;
  background:linear-gradient(180deg, rgba(30,41,59,.92) 0%, rgba(15,23,42,.96) 100%);
  border-color:rgba(148,163,184,.20);
  box-shadow:0 10px 24px rgba(2,6,23,.30);
}

body:not(.light) .btn:hover{
  border-color:rgba(77,163,255,.32);
  box-shadow:0 14px 30px rgba(2,6,23,.36);
}

body:not(.light) .btn.primary{
  color:#f8fbff;
  background:linear-gradient(135deg, #4da3ff, #7dc0ff);
  border-color:rgba(125,192,255,.28);
  box-shadow:0 16px 34px rgba(37,99,235,.28);
}

body:not(.light) .btn.primary:hover{
  box-shadow:0 20px 38px rgba(37,99,235,.34);
}

body:not(.light) .btn.ghost{
  color:#e5edf8;
  background:linear-gradient(180deg, rgba(15,23,42,.88) 0%, rgba(9,14,25,.94) 100%);
  border-color:rgba(148,163,184,.18);
  box-shadow:0 10px 24px rgba(2,6,23,.24);
}

body:not(.light) .btn.ghost:hover{
  background:linear-gradient(180deg, rgba(20,31,53,.94) 0%, rgba(12,18,31,.98) 100%);
  border-color:rgba(77,163,255,.30);
}

body:not(.light) button[disabled],
body:not(.light) .btn[disabled],
body:not(.light) input[type="button"][disabled],
body:not(.light) input[type="submit"][disabled],
body:not(.light) input[type="reset"][disabled],
body:not(.light) button:disabled,
body:not(.light) .btn:disabled{
  color:rgba(255,255,255,.88) !important;
  background:linear-gradient(180deg, rgba(71,85,105,.56) 0%, rgba(51,65,85,.74) 100%) !important;
  border-color:rgba(148,163,184,.26) !important;
  box-shadow:none !important;
  opacity:1 !important;
  cursor:not-allowed;
  text-shadow:none;
}

body:not(.light) .roof-cad-toolbar .btn,
body:not(.light) .roof-toolbar .btn,
body:not(.light) .topbar .btn,
body:not(.light) .inline-form .btn,
body:not(.light) .crm-card-actions .btn,
body:not(.light) .kanban-card-actions .btn,
body:not(.light) .modal-actions .btn{
  color:#eef5ff;
}

.form-grid label,
.crm-form-grid label,
.user-modal-grid label,
.profile-modal-grid label{
  font-weight:700;
  letter-spacing:-.01em;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.search-input,
.command-input,
.crm-form-grid input,
.crm-form-grid select,
.crm-form-grid textarea,
.user-modal-grid input,
.user-modal-grid select,
.user-modal-grid textarea,
.profile-modal-grid input,
.profile-modal-grid select,
.profile-modal-grid textarea{
  min-height:48px;
  border-radius:15px;
  border:1px solid rgba(15,23,42,.08);
  background:rgba(255,255,255,.94);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9), 0 6px 16px rgba(15,23,42,.04);
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

.form-grid textarea,
.crm-form-grid textarea,
.user-modal-grid textarea,
.profile-modal-grid textarea{
  min-height:120px;
}

.form-grid input::placeholder,
.form-grid textarea::placeholder,
.search-input::placeholder,
.command-input::placeholder,
.crm-form-grid input::placeholder,
.crm-form-grid textarea::placeholder,
.user-modal-grid input::placeholder,
.user-modal-grid textarea::placeholder,
.profile-modal-grid input::placeholder,
.profile-modal-grid textarea::placeholder{
  color:#7b8698;
  opacity:1;
}

.form-grid input:hover,
.form-grid select:hover,
.form-grid textarea:hover,
.search-input:hover,
.command-input:hover,
.crm-form-grid input:hover,
.crm-form-grid select:hover,
.crm-form-grid textarea:hover,
.user-modal-grid input:hover,
.user-modal-grid select:hover,
.user-modal-grid textarea:hover,
.profile-modal-grid input:hover,
.profile-modal-grid select:hover,
.profile-modal-grid textarea:hover{
  border-color:rgba(37,99,235,.16);
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.search-input:focus,
.command-input:focus,
.crm-form-grid input:focus,
.crm-form-grid select:focus,
.crm-form-grid textarea:focus,
.user-modal-grid input:focus,
.user-modal-grid select:focus,
.user-modal-grid textarea:focus,
.profile-modal-grid input:focus,
.profile-modal-grid select:focus,
.profile-modal-grid textarea:focus{
  border-color:rgba(37,99,235,.28) !important;
  box-shadow:0 0 0 4px rgba(59,130,246,.10), inset 0 1px 0 rgba(255,255,255,.95), 0 12px 26px rgba(37,99,235,.08) !important;
  background:#fff !important;
}

.panel,
.form-card,
.plan-card,
.havexa-visual-card,
.calc-box,
.users-panel,
.crm-section,
.crm-customer-card,
.crm-kanban-card,
.kanban-column,
.modal-card,
.table-wrap,
.auth-page .premium-form-card,
.auth-page .glass-visual-card{
  border-radius:22px;
}

body.light .panel,
body.light .form-card,
body.light .plan-card,
body.light .havexa-visual-card,
body.light .calc-box,
body.light .users-panel,
body.light .crm-section,
body.light .crm-customer-card,
body.light .crm-kanban-card,
body.light .kanban-column,
body.light .table-wrap,
body.light .modal-card{
  background:var(--hx-card-bg) !important;
  border:1px solid var(--hx-card-border) !important;
  box-shadow:var(--hx-card-shadow) !important;
}

body.light .panel:hover,
body.light .form-card:hover,
body.light .plan-card:hover,
body.light .havexa-visual-card:hover,
body.light .calc-box:hover,
body.light .crm-customer-card:hover,
body.light .crm-kanban-card:hover,
body.light .kanban-column:hover{
  box-shadow:var(--hx-card-shadow-hover) !important;
  transform:translateY(-1px);
}

.table{
  border-collapse:separate;
  border-spacing:0;
}

.table thead th,
.users-table th{
  position:sticky;
  top:0;
  z-index:1;
  background:rgba(248,250,252,.96);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  font-size:.8rem;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.table th,
.table td{
  padding:14px 12px;
}

body.light .table tbody tr:hover td,
body.light .users-row:hover td{
  background:rgba(59,130,246,.045) !important;
}

.badge-soft,
.status-pill,
.badge-draft,
.badge-viewed,
.badge-approved,
.badge-rejected{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45);
}

.search-form,
.users-toolbar,
.grid-enhancer-bar,
.grid-enhancer-pager,
.crm-toolbar,
.card-head{
  gap:12px;
}

body.light .grid-enhancer-sort,
body.light .lang-dropdown-trigger,
body.light .theme-btn,
body.light .mobile-menu-toggle,
body.light .sidebar-toggle{
  background:rgba(255,255,255,.88);
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 8px 18px rgba(15,23,42,.05);
}

body.light .grid-enhancer-sort:hover,
body.light .mobile-menu-toggle:hover,
body.light .sidebar-toggle:hover{
  border-color:rgba(37,99,235,.16);
  transform:translateY(-1px);
}

.users-stat,
.crm-stat,
.kpi-card{
  overflow:hidden;
}

body.light .users-stat,
body.light .crm-stat,
body.light .kpi-card{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,255,.92));
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 14px 30px rgba(15,23,42,.07);
}

body.light .users-stat-label,
body.light .crm-stat-label,
body.light .user-sub,
body.light .crm-sub,
body.light .grid-enhancer-meta,
body.light .table th,
body.light .users-table th{
  color:#64748b !important;
}

body.light .users-hero,
body.light .crm-hero{
  box-shadow:0 24px 56px rgba(15,23,42,.09) !important;
}

@media (max-width: 760px){
  .btn{
    width:100%;
  }

  .search-form,
  .users-toolbar,
  .grid-enhancer-bar,
  .grid-enhancer-controls,
  .grid-enhancer-pager,
  .grid-enhancer-page-actions,
  .crm-toolbar{
    display:grid !important;
    grid-template-columns:1fr;
    align-items:stretch;
  }

  .topnav .btn,
  .user-actions .btn,
  .kanban-card-actions .btn,
  .modal-actions .btn,
  .crm-card-actions .btn{
    width:auto;
  }
}


/* =========================
IPHONE / SMALL SCREEN MENU STABILIZATION FIX
========================= */
@media (max-width: 900px){
  .mobile-menu-toggle,
  .sidebar-mobile-close,
  .side-group-toggle,
  .side-link{
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }

  .topbar{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
    align-items:stretch !important;
    padding:10px 12px !important;
  }

  .topbar-left{
    width:100% !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:10px !important;
  }

  .brand2{
    margin-left:0 !important;
    min-width:0 !important;
    flex:1 1 auto !important;
  }

  .topnav{
    width:100% !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto auto auto !important;
    gap:8px !important;
    align-items:center !important;
    overflow:visible !important;
  }

  .topnav > *{
    min-width:0 !important;
  }

  .topnav .lang-dropdown{
    grid-column:1 / -1 !important;
  }

  .lang-dropdown-trigger{
    width:100% !important;
    min-height:40px !important;
  }

  .sidebar{
    top:0 !important;
    left:0 !important;
    bottom:0 !important;
    width:min(86vw, 330px) !important;
    max-width:330px !important;
    transform:translate3d(-112%,0,0) !important;
    -webkit-transform:translate3d(-112%,0,0) !important;
    visibility:hidden !important;
    pointer-events:none !important;
    z-index:1300 !important;
  }

  .sidebar.is-mobile-open{
    transform:translate3d(0,0,0) !important;
    -webkit-transform:translate3d(0,0,0) !important;
    visibility:visible !important;
    pointer-events:auto !important;
  }

  .sidebar .sidebar-toggle{
    display:none !important;
  }

  .sidebar-mobile-close[hidden]{
    display:none !important;
  }

  .sidebar-mobile-close:not([hidden]){
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }

  .sidebar .side-submenu{
    max-height:0 !important;
    overflow:hidden !important;
    transition:max-height .24s ease !important;
    padding-left:10px !important;
  }

  .sidebar .side-group.open .side-submenu{
    overflow:visible !important;
  }
}

@media (max-width: 640px){
  .topbar{
    padding:8px 10px !important;
  }

  .topnav{
    grid-template-columns:minmax(0,1fr) auto auto auto !important;
    gap:6px !important;
  }

  .lang-dropdown-current{
    font-size:12px !important;
  }

  .topbar-user{
    min-width:44px !important;
    width:44px !important;
    padding:0 !important;
    justify-content:center !important;
  }

  .topbar-user-copy{
    display:none !important;
  }

  .topbar .inline-form .btn,
  .theme-btn,
  .mobile-menu-toggle,
  .topbar-user{
    height:36px !important;
    min-height:36px !important;
  }

  .content{
    padding:8px 10px 18px !important;
  }
}


/* dark mode form-control readability refresh */
body:not(.light) .form-grid input,
body:not(.light) .form-grid select,
body:not(.light) .form-grid textarea,
body:not(.light) .search-input,
body:not(.light) .command-input,
body:not(.light) .crm-form-grid input,
body:not(.light) .crm-form-grid select,
body:not(.light) .crm-form-grid textarea,
body:not(.light) .user-modal-grid input,
body:not(.light) .user-modal-grid select,
body:not(.light) .user-modal-grid textarea,
body:not(.light) .profile-modal-grid input,
body:not(.light) .profile-modal-grid select,
body:not(.light) .profile-modal-grid textarea,
body:not(.light) .users-toolbar input,
body:not(.light) .users-toolbar select,
body:not(.light) .crm-toolbar input,
body:not(.light) .crm-toolbar select,
body:not(.light) .material-filters input,
body:not(.light) .material-filters select,
body:not(.light) .supplier-filters input,
body:not(.light) .supplier-filters select,
body:not(.light) .inline-form input,
body:not(.light) .inline-form select,
body:not(.light) .inline-form textarea,
body:not(.light) .panel input,
body:not(.light) .panel select,
body:not(.light) .panel textarea,
body:not(.light) .form-card input,
body:not(.light) .form-card select,
body:not(.light) .form-card textarea,
body:not(.light) .table-wrap input,
body:not(.light) .table-wrap select,
body:not(.light) .table-wrap textarea{
  color:#eef6ff !important;
  background:linear-gradient(180deg, rgba(13,28,45,.94) 0%, rgba(8,20,34,.98) 100%) !important;
  border-color:rgba(96,165,250,.20) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04), 0 10px 24px rgba(2,6,23,.18) !important;
}

body:not(.light) .form-grid input::placeholder,
body:not(.light) .form-grid textarea::placeholder,
body:not(.light) .search-input::placeholder,
body:not(.light) .command-input::placeholder,
body:not(.light) .crm-form-grid input::placeholder,
body:not(.light) .crm-form-grid textarea::placeholder,
body:not(.light) .user-modal-grid input::placeholder,
body:not(.light) .user-modal-grid textarea::placeholder,
body:not(.light) .profile-modal-grid input::placeholder,
body:not(.light) .profile-modal-grid textarea::placeholder,
body:not(.light) .users-toolbar input::placeholder,
body:not(.light) .crm-toolbar input::placeholder,
body:not(.light) .material-filters input::placeholder,
body:not(.light) .supplier-filters input::placeholder,
body:not(.light) .inline-form input::placeholder,
body:not(.light) .inline-form textarea::placeholder,
body:not(.light) .panel input::placeholder,
body:not(.light) .panel textarea::placeholder,
body:not(.light) .form-card input::placeholder,
body:not(.light) .form-card textarea::placeholder,
body:not(.light) .table-wrap input::placeholder,
body:not(.light) .table-wrap textarea::placeholder{
  color:rgba(214,226,244,.70) !important;
}

body:not(.light) .form-grid input:hover,
body:not(.light) .form-grid select:hover,
body:not(.light) .form-grid textarea:hover,
body:not(.light) .search-input:hover,
body:not(.light) .command-input:hover,
body:not(.light) .crm-form-grid input:hover,
body:not(.light) .crm-form-grid select:hover,
body:not(.light) .crm-form-grid textarea:hover,
body:not(.light) .user-modal-grid input:hover,
body:not(.light) .user-modal-grid select:hover,
body:not(.light) .user-modal-grid textarea:hover,
body:not(.light) .profile-modal-grid input:hover,
body:not(.light) .profile-modal-grid select:hover,
body:not(.light) .profile-modal-grid textarea:hover,
body:not(.light) .users-toolbar input:hover,
body:not(.light) .users-toolbar select:hover,
body:not(.light) .crm-toolbar input:hover,
body:not(.light) .crm-toolbar select:hover,
body:not(.light) .material-filters input:hover,
body:not(.light) .material-filters select:hover,
body:not(.light) .supplier-filters input:hover,
body:not(.light) .supplier-filters select:hover,
body:not(.light) .inline-form input:hover,
body:not(.light) .inline-form select:hover,
body:not(.light) .inline-form textarea:hover,
body:not(.light) .panel input:hover,
body:not(.light) .panel select:hover,
body:not(.light) .panel textarea:hover,
body:not(.light) .form-card input:hover,
body:not(.light) .form-card select:hover,
body:not(.light) .form-card textarea:hover,
body:not(.light) .table-wrap input:hover,
body:not(.light) .table-wrap select:hover,
body:not(.light) .table-wrap textarea:hover{
  border-color:rgba(96,165,250,.34) !important;
  background:linear-gradient(180deg, rgba(16,34,54,.96) 0%, rgba(10,24,40,.99) 100%) !important;
}

body:not(.light) .form-grid input:focus,
body:not(.light) .form-grid select:focus,
body:not(.light) .form-grid textarea:focus,
body:not(.light) .search-input:focus,
body:not(.light) .command-input:focus,
body:not(.light) .crm-form-grid input:focus,
body:not(.light) .crm-form-grid select:focus,
body:not(.light) .crm-form-grid textarea:focus,
body:not(.light) .user-modal-grid input:focus,
body:not(.light) .user-modal-grid select:focus,
body:not(.light) .user-modal-grid textarea:focus,
body:not(.light) .profile-modal-grid input:focus,
body:not(.light) .profile-modal-grid select:focus,
body:not(.light) .profile-modal-grid textarea:focus,
body:not(.light) .users-toolbar input:focus,
body:not(.light) .users-toolbar select:focus,
body:not(.light) .crm-toolbar input:focus,
body:not(.light) .crm-toolbar select:focus,
body:not(.light) .material-filters input:focus,
body:not(.light) .material-filters select:focus,
body:not(.light) .supplier-filters input:focus,
body:not(.light) .supplier-filters select:focus,
body:not(.light) .inline-form input:focus,
body:not(.light) .inline-form select:focus,
body:not(.light) .inline-form textarea:focus,
body:not(.light) .panel input:focus,
body:not(.light) .panel select:focus,
body:not(.light) .panel textarea:focus,
body:not(.light) .form-card input:focus,
body:not(.light) .form-card select:focus,
body:not(.light) .form-card textarea:focus,
body:not(.light) .table-wrap input:focus,
body:not(.light) .table-wrap select:focus,
body:not(.light) .table-wrap textarea:focus{
  color:#ffffff !important;
  background:linear-gradient(180deg, rgba(17,36,59,.98) 0%, rgba(11,26,44,1) 100%) !important;
  border-color:rgba(77,163,255,.52) !important;
  box-shadow:0 0 0 4px rgba(59,130,246,.16), inset 0 1px 0 rgba(255,255,255,.05), 0 16px 30px rgba(2,6,23,.24) !important;
}

body:not(.light) select option,
body:not(.light) optgroup{
  color:#eef6ff;
  background:#0f2134;
}


.analytics-kpis{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:16px;
  margin-bottom:16px;
}
.analytics-kpi-card{display:flex; flex-direction:column; gap:8px;}
.analytics-kpi-value{font-size:2rem; font-weight:800; line-height:1.1;}
.analytics-breakdown-list,.analytics-stack,.analytics-log-list{display:flex; flex-direction:column; gap:12px;}
.analytics-breakdown-item,.analytics-feed-block,.analytics-log-row,.analytics-mini-block{
  border:1px solid rgba(148,163,184,.16);
  border-radius:18px;
  padding:14px 16px;
  background:rgba(255,255,255,.025);
}
.analytics-meter{height:10px; border-radius:999px; background:rgba(148,163,184,.12); overflow:hidden; margin-top:10px;}
.analytics-meter span{display:block; height:100%; border-radius:999px; background:linear-gradient(90deg, rgba(96,165,250,.92), rgba(59,130,246,.72));}
.analytics-mini-grid{display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px;}
.analytics-mini-row,.analytics-feed-row,.analytics-log-top{display:flex; align-items:flex-start; justify-content:space-between; gap:14px;}
.analytics-feed-row + .analytics-feed-row,.analytics-log-row + .analytics-log-row{margin-top:10px; padding-top:10px; border-top:1px solid rgba(148,163,184,.12);}
.analytics-feed-meta{font-size:.85rem; color:var(--muted, #8ea4bd); text-align:right;}
.analytics-log-text{margin-top:6px; white-space:pre-wrap; word-break:break-word;}
@media (max-width: 1100px){
  .analytics-kpis,.analytics-mini-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
}
@media (max-width: 720px){
  .analytics-kpis,.analytics-mini-grid{grid-template-columns:1fr;}
  .analytics-feed-row,.analytics-mini-row,.analytics-log-top{flex-direction:column; align-items:flex-start;}
  .analytics-feed-meta{text-align:left;}
}


.analytics-topbar{align-items:flex-start; gap:14px;}
.analytics-filter-pills{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end;}
.analytics-kpi-meta{font-size:.9rem; color:var(--muted, #8ea4bd); gap:12px;}
.analytics-delta{display:inline-flex; align-items:center; justify-content:center; min-width:64px; padding:6px 10px; border-radius:999px; font-weight:700; font-size:.82rem; border:1px solid rgba(148,163,184,.18);}
.analytics-delta.is-up{color:#86efac; background:rgba(34,197,94,.12); border-color:rgba(34,197,94,.22);}
.analytics-delta.is-down{color:#fca5a5; background:rgba(239,68,68,.12); border-color:rgba(239,68,68,.22);}
.analytics-delta.is-flat{color:#cbd5e1; background:rgba(148,163,184,.08);}
.analytics-chart-grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px;}
.analytics-chart-card{border:1px solid rgba(148,163,184,.16); border-radius:20px; padding:16px; background:rgba(255,255,255,.025);}
.analytics-chart-card-wide{grid-column:1 / -1;}
.analytics-bars{display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; align-items:end; min-height:240px; margin-top:16px;}
.analytics-bar-col{display:flex; flex-direction:column; align-items:center; gap:8px; min-width:0;}
.analytics-bar-wrap{width:100%; height:170px; display:flex; align-items:flex-end; padding:0 6px;}
.analytics-bar{width:100%; border-radius:18px 18px 8px 8px; min-height:10px; background:linear-gradient(180deg, rgba(96,165,250,.96) 0%, rgba(37,99,235,.72) 100%); box-shadow:0 18px 28px rgba(37,99,235,.18);}
.analytics-bars-soft .analytics-bar{background:linear-gradient(180deg, rgba(52,211,153,.92) 0%, rgba(16,185,129,.64) 100%); box-shadow:0 18px 28px rgba(16,185,129,.16);}
.analytics-bars-revenue .analytics-bar{background:linear-gradient(180deg, rgba(250,204,21,.92) 0%, rgba(234,179,8,.64) 100%); box-shadow:0 18px 28px rgba(234,179,8,.16);}
.analytics-bar-col strong{font-size:.88rem; line-height:1.2; text-align:center; word-break:break-word;}
.analytics-bar-col span{font-size:.82rem; color:var(--muted, #8ea4bd);}
.analytics-summary-grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px;}
.analytics-meter-tight{height:8px; margin-top:6px; margin-bottom:8px;}
@media (max-width: 1100px){
  .analytics-chart-grid{grid-template-columns:1fr;}
  .analytics-chart-card-wide{grid-column:auto;}
}
@media (max-width: 720px){
  .analytics-topbar{align-items:stretch;}
  .analytics-filter-pills{justify-content:flex-start;}
  .analytics-bars{gap:8px; min-height:210px;}
  .analytics-bar-wrap{height:140px;}
  .analytics-bar-col strong{font-size:.78rem;}
  .analytics-summary-grid{grid-template-columns:1fr;}
}

/* =========================
HAVEXA MODAL FOOTER / ACTION BUTTON POLISH
========================= */
.hx-modal-footer,
.profile-modal-footer,
.user-modal-footer,
.supplier-modal-footer,
.crm-modal-footer{
  background:transparent !important;
  background-image:none !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  box-shadow:none !important;
}

.hx-modal-footer{
  border-top:1px solid rgba(148,163,184,.18) !important;
}

body:not(.light) .hx-modal-footer,
body:not(.light) .profile-modal-footer,
body:not(.light) .user-modal-footer,
body:not(.light) .supplier-modal-footer,
body:not(.light) .crm-modal-footer{
  border-top-color:rgba(255,255,255,.10) !important;
}

.hx-modal-footer .btn,
.profile-modal-footer .btn,
.user-modal-footer .btn,
.supplier-modal-footer .btn,
.crm-modal-footer .btn{
  min-height:60px;
  padding:0 28px;
  border-radius:20px;
  font-weight:800;
  letter-spacing:-.01em;
}

.hx-modal-footer .btn.primary,
.profile-modal-footer .btn.primary,
.user-modal-footer .btn.primary,
.supplier-modal-footer .btn.primary,
.crm-modal-footer .btn.primary{
  color:#ffffff !important;
  background:linear-gradient(135deg, #2f6fe8 0%, #66adff 100%) !important;
  border:1px solid rgba(96,165,250,.28) !important;
  box-shadow:0 14px 30px rgba(37,99,235,.22) !important;
  text-shadow:none !important;
}

.hx-modal-footer .btn.primary:hover,
.profile-modal-footer .btn.primary:hover,
.user-modal-footer .btn.primary:hover,
.supplier-modal-footer .btn.primary:hover,
.crm-modal-footer .btn.primary:hover{
  box-shadow:0 18px 34px rgba(37,99,235,.28) !important;
  filter:brightness(1.02);
}

.hx-modal-footer .btn.ghost,
.profile-modal-footer .btn.ghost,
.user-modal-footer .btn.ghost,
.supplier-modal-footer .btn.ghost,
.crm-modal-footer .btn.ghost{
  color:#0f172a !important;
  background:linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(241,245,249,.98) 100%) !important;
  border:1px solid rgba(148,163,184,.26) !important;
  box-shadow:0 10px 24px rgba(15,23,42,.08) !important;
}

.hx-modal-footer .btn.ghost:hover,
.profile-modal-footer .btn.ghost:hover,
.user-modal-footer .btn.ghost:hover,
.supplier-modal-footer .btn.ghost:hover,
.crm-modal-footer .btn.ghost:hover{
  background:linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,250,252,1) 100%) !important;
  border-color:rgba(59,130,246,.22) !important;
}

body:not(.light) .hx-modal-footer .btn.primary,
body:not(.light) .profile-modal-footer .btn.primary,
body:not(.light) .user-modal-footer .btn.primary,
body:not(.light) .supplier-modal-footer .btn.primary,
body:not(.light) .crm-modal-footer .btn.primary{
  color:#f8fbff !important;
  background:linear-gradient(135deg, #3f8cff 0%, #74bbff 100%) !important;
  border-color:rgba(125,192,255,.30) !important;
  box-shadow:0 16px 34px rgba(37,99,235,.30) !important;
}

body:not(.light) .hx-modal-footer .btn.ghost,
body:not(.light) .profile-modal-footer .btn.ghost,
body:not(.light) .user-modal-footer .btn.ghost,
body:not(.light) .supplier-modal-footer .btn.ghost,
body:not(.light) .crm-modal-footer .btn.ghost{
  color:#f2f7ff !important;
  background:linear-gradient(180deg, rgba(30,41,59,.96) 0%, rgba(15,23,42,.98) 100%) !important;
  border-color:rgba(148,163,184,.22) !important;
  box-shadow:0 12px 26px rgba(2,6,23,.28) !important;
}

body:not(.light) .hx-modal-footer .btn.ghost:hover,
body:not(.light) .profile-modal-footer .btn.ghost:hover,
body:not(.light) .user-modal-footer .btn.ghost:hover,
body:not(.light) .supplier-modal-footer .btn.ghost:hover,
body:not(.light) .crm-modal-footer .btn.ghost:hover{
  background:linear-gradient(180deg, rgba(36,49,71,.98) 0%, rgba(17,24,39,1) 100%) !important;
  border-color:rgba(96,165,250,.34) !important;
}

/* =========================
HAVEXA MODAL HEADER / FOOTER CONSISTENCY PATCH
========================= */
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
  background:linear-gradient(180deg, rgba(248,250,252,.98) 0%, rgba(241,245,249,.96) 100%) !important;
  color:#0f172a !important;
  border-bottom:1px solid rgba(148,163,184,.18) !important;
  box-shadow:none !important;
}

:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) h1,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) h2,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) h3,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) h4,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .user-brand-name,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .user-brand-tag,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .supplier-brand-name,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .supplier-brand-tag,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .crm-brand-name,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .crm-brand-tag,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .profile-brand-name,
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .profile-brand-tag{
  color:#0f172a !important;
}

body:not(.light) :is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar),
body.light :is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
  background:linear-gradient(180deg, rgba(248,250,252,.98) 0%, rgba(241,245,249,.96) 100%) !important;
}

body:not(.light) .hx-modal-subtitle,
body:not(.light) :is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) .hx-modal-subtitle{
  color:rgba(15,23,42,.68) !important;
}

:is(.user-modal-close,.supplier-modal-close,.crm-modal-close,.profile-modal-close){
  background:linear-gradient(180deg, rgba(255,255,255,.96) 0%, rgba(241,245,249,.96) 100%) !important;
  color:#0f172a !important;
  border:1px solid rgba(148,163,184,.24) !important;
  box-shadow:0 10px 24px rgba(15,23,42,.08) !important;
}

:is(.user-modal-close,.supplier-modal-close,.crm-modal-close,.profile-modal-close):hover{
  background:linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,250,252,1) 100%) !important;
  border-color:rgba(59,130,246,.26) !important;
}

.hx-modal-footer,
.profile-modal-footer,
.user-modal-footer,
.supplier-modal-footer,
.crm-modal-footer{
  background:#eef2f7 !important;
  background-image:none !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
  border-top:1px solid rgba(148,163,184,.18) !important;
  box-shadow:none !important;
}

body:not(.light) .hx-modal-footer,
body:not(.light) .profile-modal-footer,
body:not(.light) .user-modal-footer,
body:not(.light) .supplier-modal-footer,
body:not(.light) .crm-modal-footer,
body.light .hx-modal-footer,
body.light .profile-modal-footer,
body.light .user-modal-footer,
body.light .supplier-modal-footer,
body.light .crm-modal-footer{
  background:#eef2f7 !important;
  border-top-color:rgba(148,163,184,.18) !important;
}

.hx-modal-footer .btn.ghost,
.profile-modal-footer .btn.ghost,
.user-modal-footer .btn.ghost,
.supplier-modal-footer .btn.ghost,
.crm-modal-footer .btn.ghost,
body:not(.light) .hx-modal-footer .btn.ghost,
body:not(.light) .profile-modal-footer .btn.ghost,
body:not(.light) .user-modal-footer .btn.ghost,
body:not(.light) .supplier-modal-footer .btn.ghost,
body:not(.light) .crm-modal-footer .btn.ghost{
  color:#0f172a !important;
  background:linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(241,245,249,.98) 100%) !important;
  border:1px solid rgba(148,163,184,.28) !important;
  box-shadow:0 10px 24px rgba(15,23,42,.08) !important;
}

.hx-modal-footer .btn.ghost:hover,
.profile-modal-footer .btn.ghost:hover,
.user-modal-footer .btn.ghost:hover,
.supplier-modal-footer .btn.ghost:hover,
.crm-modal-footer .btn.ghost:hover,
body:not(.light) .hx-modal-footer .btn.ghost:hover,
body:not(.light) .profile-modal-footer .btn.ghost:hover,
body:not(.light) .user-modal-footer .btn.ghost:hover,
body:not(.light) .supplier-modal-footer .btn.ghost:hover,
body:not(.light) .crm-modal-footer .btn.ghost:hover{
  color:#0f172a !important;
  background:linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,250,252,1) 100%) !important;
  border-color:rgba(59,130,246,.24) !important;
}

/* =========================
MODAL HEADER / FOOTER FULL-BLEED REFINE
========================= */
:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
  background:#eef2f7 !important;
  background-image:none !important;
  color:#0f172a !important;
  border-bottom:1px solid rgba(148,163,184,.18) !important;
  box-shadow:none !important;
}

body:not(.light) :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero),
body.light :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
  background:#eef2f7 !important;
  background-image:none !important;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero) :is(h1,h2,h3,h4,.hx-modal-subtitle,.user-brand-name,.user-brand-tag,.supplier-brand-name,.supplier-brand-tag,.crm-brand-name,.crm-brand-tag,.profile-brand-name,.profile-brand-tag){
  color:#0f172a !important;
}

:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
  background:linear-gradient(180deg, rgba(255,255,255,.995), rgba(247,249,255,.98)) !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  margin-left:-30px !important;
  margin-right:-30px !important;
  margin-bottom:-32px !important;
  padding:22px 30px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  border-top:1px solid rgba(148,163,184,.18) !important;
  border-bottom-left-radius:28px !important;
  border-bottom-right-radius:28px !important;
  background:#eef2f7 !important;
  background-image:none !important;
  box-shadow:none !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-modal-note{
  color:rgba(15,23,42,.72) !important;
}

body:not(.light) :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  background:#eef2f7 !important;
}

body:not(.light) :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost{
  color:#0f172a !important;
  background:linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%) !important;
  border-color:rgba(148,163,184,.28) !important;
  box-shadow:0 10px 24px rgba(15,23,42,.08) !important;
}

body:not(.light) :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost:hover{
  background:linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border-color:rgba(59,130,246,.24) !important;
}

@media (max-width: 820px){
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
    margin-left:-18px !important;
    margin-right:-18px !important;
    margin-bottom:-18px !important;
    padding:18px 18px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    border-bottom-left-radius:24px !important;
    border-bottom-right-radius:24px !important;
  }
}

/* =========================
MODAL HEADER / FOOTER FINAL EDGE FIX
========================= */
:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
  background:#eef2f7 !important;
  background-image:none !important;
  color:#0f172a !important;
  border-top-left-radius:28px !important;
  border-top-right-radius:28px !important;
  border-bottom:1px solid rgba(148,163,184,.18) !important;
  box-shadow:none !important;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero) :is(.hx-modal-subtitle,h1,h2,h3,h4,.user-brand-name,.user-brand-tag,.supplier-brand-name,.supplier-brand-tag,.crm-brand-name,.crm-brand-tag,.profile-brand-name,.profile-brand-tag){
  color:#0f172a !important;
}

:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar),
:is(.user-modal-top,.supplier-modal-top,.crm-modal-top,.profile-modal-top),
:is(.user-modal-copy,.supplier-modal-copy,.crm-modal-copy,.profile-modal-copy){
  background:transparent !important;
  box-shadow:none !important;
}

.user-modal-body{ padding:30px 30px 0 !important; }
.supplier-modal-body{ padding:30px 30px 0 !important; }
.crm-modal-body{ padding:24px 24px 0 !important; }
.profile-modal-body{ padding:26px 26px 0 !important; }

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  position:sticky !important;
  bottom:0 !important;
  left:0 !important;
  right:0 !important;
  width:auto !important;
  margin-top:22px !important;
  margin-left:-999px !important;
  margin-right:-999px !important;
  margin-bottom:0 !important;
  padding:22px 999px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  border-top:1px solid rgba(148,163,184,.18) !important;
  border-bottom-left-radius:28px !important;
  border-bottom-right-radius:28px !important;
  background:#eef2f7 !important;
  background-image:none !important;
  box-shadow:none !important;
}

body:not(.light) :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer),
body.light :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  background:#eef2f7 !important;
}

@media (max-width: 820px){
  :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
    border-top-left-radius:24px !important;
    border-top-right-radius:24px !important;
  }

  .user-modal-body,
  .supplier-modal-body,
  .crm-modal-body,
  .profile-modal-body{ padding-bottom:0 !important; }

  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
    padding-bottom:calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    border-bottom-left-radius:24px !important;
    border-bottom-right-radius:24px !important;
  }
}

/* =========================
MODAL CONSISTENCY FINAL POLISH
========================= */
.hx-modal-shell{
  border:1px solid rgba(148,163,184,.42) !important;
  background:#f8fafc !important;
  box-shadow:0 28px 60px rgba(15,23,42,.18) !important;
}
.hx-modal-shell::before{display:none !important;}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero),
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar),
:is(.user-modal-top,.supplier-modal-top,.crm-modal-top,.profile-modal-top),
:is(.user-modal-copy,.supplier-modal-copy,.crm-modal-copy,.profile-modal-copy){
  background:#eef2f7 !important;
  background-image:none !important;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
  border-top-left-radius:28px !important;
  border-top-right-radius:28px !important;
  overflow:hidden !important;
}

:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
  border-top-left-radius:28px !important;
  border-top-right-radius:28px !important;
  overflow:hidden !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:18px !important;
  margin-top:22px !important;
  margin-bottom:0 !important;
  padding:22px 30px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  border-top:1px solid rgba(148,163,184,.22) !important;
  border-bottom-left-radius:28px !important;
  border-bottom-right-radius:28px !important;
  background:#eef2f7 !important;
  background-image:none !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions{
  display:flex !important;
  justify-content:flex-end !important;
  align-items:center !important;
  gap:18px !important;
  width:100% !important;
  margin-left:auto !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-modal-note{
  flex:1 1 auto !important;
  margin-right:auto !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn,
:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions .btn{
  min-width:220px !important;
  min-height:72px !important;
  border-radius:26px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
}

body:not(.light) :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost,
body.light :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid rgba(148,163,184,.26) !important;
  box-shadow:0 8px 20px rgba(15,23,42,.06) !important;
}

@media (max-width: 820px){
  .hx-modal-shell,
  :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero),
  :is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
    border-top-left-radius:24px !important;
    border-top-right-radius:24px !important;
  }

  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
    padding:18px 18px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    border-bottom-left-radius:24px !important;
    border-bottom-right-radius:24px !important;
  }

  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions{
    flex-wrap:wrap !important;
  }

  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn,
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions .btn{
    min-width:0 !important;
    flex:1 1 calc(50% - 9px) !important;
  }
}


/* =========================
MODAL SYSTEM STANDARDIZATION
========================= */
:root{
  --hx-modal-shell-bg:#f8fafc;
  --hx-modal-shell-border:rgba(203,213,225,.96);
  --hx-modal-header-bg:#eef2f7;
  --hx-modal-header-border:rgba(203,213,225,.78);
  --hx-modal-footer-bg:#eef2f7;
  --hx-modal-footer-border:rgba(203,213,225,.78);
}

.hx-modal-shell,
:is(.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell,.crm-modal,.user-modal,.supplier-modal){
  background:var(--hx-modal-shell-bg) !important;
  border:1px solid var(--hx-modal-shell-border) !important;
  border-radius:34px !important;
  box-shadow:0 28px 64px rgba(15,23,42,.18) !important;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
  background:var(--hx-modal-header-bg) !important;
  background-image:none !important;
  border-top-left-radius:34px !important;
  border-top-right-radius:34px !important;
  border-bottom:1px solid var(--hx-modal-header-border) !important;
  overflow:hidden !important;
  padding:20px 24px 20px !important;
}

:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar),
:is(.user-modal-top,.supplier-modal-top,.crm-modal-top,.profile-modal-top),
:is(.user-modal-copy,.supplier-modal-copy,.crm-modal-copy,.profile-modal-copy),
:is(.user-modal-brand,.supplier-modal-brand,.crm-modal-brand,.profile-modal-brand),
:is(.user-brand-copy,.supplier-brand-copy,.crm-brand-copy,.profile-brand-copy){
  background:transparent !important;
  background-image:none !important;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero) :is(h1,h2,h3,h4,.hx-modal-subtitle,.user-brand-name,.user-brand-tag,.supplier-brand-name,.supplier-brand-tag,.crm-brand-name,.crm-brand-tag,.profile-brand-name,.profile-brand-tag){
  color:#0f172a !important;
}

:is(.user-modal-close,.supplier-modal-close,.crm-modal-close,.profile-modal-close){
  background:rgba(255,255,255,.78) !important;
  border:1px solid rgba(203,213,225,.92) !important;
  color:#0f172a !important;
  box-shadow:0 8px 18px rgba(15,23,42,.08) !important;
}
:is(.user-modal-close,.supplier-modal-close,.crm-modal-close,.profile-modal-close):hover{
  background:#ffffff !important;
  border-color:rgba(148,163,184,.9) !important;
}

/* Make modal body + form stretch so footer sits flush at the bottom */
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
  min-height:0 !important;
  padding:30px 30px 0 !important;
  background:linear-gradient(180deg, rgba(255,255,255,.995), rgba(247,249,255,.99)) !important;
}
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .profile-modal-form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .crm-modal-form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .supplier-modal-form{
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
  min-height:0 !important;
}

.hx-modal-section-stack{
  flex:1 1 auto !important;
  min-height:0 !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  margin:24px -30px 0 !important;
  width:calc(100% + 60px) !important;
  align-self:stretch !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:18px !important;
  padding:20px 30px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  border-top:1px solid var(--hx-modal-footer-border) !important;
  border-bottom-left-radius:34px !important;
  border-bottom-right-radius:34px !important;
  background:var(--hx-modal-footer-bg) !important;
  background-image:none !important;
  position:sticky !important;
  bottom:0 !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-modal-note{
  flex:1 1 auto !important;
  margin:0 !important;
  color:#475569 !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions,
:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) > div:last-child{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:18px !important;
  margin-left:auto !important;
  flex:0 0 auto !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn,
:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions .btn{
  min-width:220px !important;
  width:220px !important;
  min-height:68px !important;
  border-radius:24px !important;
  font-weight:800 !important;
  font-size:1rem !important;
  justify-content:center !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.primary{
  background:linear-gradient(135deg, #3563eb 0%, #67a7f1 100%) !important;
  color:#fff !important;
  border:none !important;
  box-shadow:0 16px 30px rgba(59,130,246,.22) !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost,
body:not(.light) :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost,
body.light :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid rgba(203,213,225,.98) !important;
  box-shadow:0 8px 18px rgba(15,23,42,.06) !important;
}

body:not(.light) :is(.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell),
body.light :is(.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell){
  border-color:var(--hx-modal-shell-border) !important;
}
body:not(.light) :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero),
body.light :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero),
body:not(.light) :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer),
body.light :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  background:var(--hx-modal-header-bg) !important;
}

@media (max-width: 820px){
  .hx-modal-shell,
  :is(.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell),
  :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero),
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
    border-radius:24px !important;
  }
  :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
    border-top-left-radius:24px !important;
    border-top-right-radius:24px !important;
    padding:18px 18px 18px !important;
  }
  :is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
    padding:20px 18px 0 !important;
  }
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
    margin:20px -18px 0 !important;
    width:calc(100% + 36px) !important;
    padding:16px 18px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    border-bottom-left-radius:24px !important;
    border-bottom-right-radius:24px !important;
  }
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions,
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) > div:last-child{
    width:100% !important;
    flex-wrap:wrap !important;
  }
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn,
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions .btn{
    width:100% !important;
    min-width:0 !important;
    flex:1 1 100% !important;
  }
}

/* =========================
MODAL SYSTEM FINAL UNIFORMITY PATCH
========================= */
:root{
  --hx-modal-surface:#f1f5f9;
  --hx-modal-surface-2:#e9eef5;
  --hx-modal-border:#cbd5e1;
  --hx-modal-shell-bg:#f8fafc;
  --hx-modal-btn-width:220px;
  --hx-modal-btn-height:68px;
  --hx-modal-radius:34px;
  --hx-modal-inner-radius:26px;
}

body:not(.light),
body.light{
  --hx-modal-surface:#f1f5f9;
  --hx-modal-surface-2:#e9eef5;
  --hx-modal-border:#cbd5e1;
  --hx-modal-shell-bg:#f8fafc;
}

:is(.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell,.hx-modal-shell){
  background:var(--hx-modal-shell-bg) !important;
  border:1px solid var(--hx-modal-border) !important;
  border-radius:var(--hx-modal-radius) !important;
  box-shadow:0 26px 60px rgba(15,23,42,.16) !important;
  overflow:hidden !important;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
  background:var(--hx-modal-surface) !important;
  border-top-left-radius:var(--hx-modal-radius) !important;
  border-top-right-radius:var(--hx-modal-radius) !important;
  border-bottom:1px solid var(--hx-modal-border) !important;
  padding:14px 14px 0 !important;
  overflow:hidden !important;
}

:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
  background:var(--hx-modal-surface) !important;
  border:1px solid rgba(203,213,225,.72) !important;
  border-top-left-radius:var(--hx-modal-inner-radius) !important;
  border-top-right-radius:var(--hx-modal-inner-radius) !important;
  border-bottom-left-radius:0 !important;
  border-bottom-right-radius:0 !important;
  padding:0 !important;
  overflow:hidden !important;
  box-shadow:none !important;
}

:is(.user-modal-top,.supplier-modal-top,.crm-modal-top,.profile-modal-top),
:is(.user-modal-copy,.supplier-modal-copy,.crm-modal-copy,.profile-modal-copy),
:is(.user-modal-brand,.supplier-modal-brand,.crm-modal-brand,.profile-modal-brand){
  background:transparent !important;
}

:is(.user-modal-brand,.supplier-modal-brand,.crm-modal-brand,.profile-modal-brand){
  padding:0 0 6px !important;
}

:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar) > div:first-child{
  min-width:0;
  flex:1 1 auto;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero) :is(h1,h2,h3,h4,.hx-modal-subtitle,.user-brand-name,.user-brand-tag,.supplier-brand-name,.supplier-brand-tag,.crm-brand-name,.crm-brand-tag,.profile-brand-name,.profile-brand-tag){
  color:#0f172a !important;
}

:is(.user-modal-close,.supplier-modal-close,.crm-modal-close,.profile-modal-close){
  align-self:flex-start !important;
  margin:12px 12px 0 0 !important;
}

:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
  min-height:0 !important;
  padding:26px 30px 0 !important;
  background:linear-gradient(180deg, rgba(255,255,255,.995), rgba(247,249,255,.99)) !important;
}

:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .profile-modal-form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .crm-modal-form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .supplier-modal-form{
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
  min-height:0 !important;
}

.hx-modal-section-stack{display:grid !important; gap:18px !important; flex:1 1 auto !important;}
.hx-form-section{border-radius:22px !important;}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  margin:24px -30px -1px !important;
  width:calc(100% + 60px) !important;
  align-self:stretch !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:18px !important;
  padding:18px 30px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  background:var(--hx-modal-surface) !important;
  border-top:1px solid var(--hx-modal-border) !important;
  border-bottom-left-radius:var(--hx-modal-radius) !important;
  border-bottom-right-radius:var(--hx-modal-radius) !important;
  box-shadow:none !important;
  position:sticky !important;
  bottom:0 !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-modal-note{
  color:#475569 !important;
  margin:0 !important;
  flex:1 1 auto !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions,
:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) > div:last-child{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:16px !important;
  width:auto !important;
  margin-left:auto !important;
  flex:0 0 auto !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn,
:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions .btn{
  width:var(--hx-modal-btn-width) !important;
  min-width:var(--hx-modal-btn-width) !important;
  max-width:var(--hx-modal-btn-width) !important;
  min-height:var(--hx-modal-btn-height) !important;
  border-radius:24px !important;
  justify-content:center !important;
  text-align:center !important;
  font-size:1rem !important;
  font-weight:800 !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost,
body:not(.light) :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost,
body.light :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.ghost{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid rgba(203,213,225,.98) !important;
  box-shadow:0 8px 18px rgba(15,23,42,.06) !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn.primary{
  background:linear-gradient(135deg, #3563eb 0%, #67a7f1 100%) !important;
  color:#fff !important;
  border:none !important;
  box-shadow:0 16px 30px rgba(59,130,246,.22) !important;
}

@media (max-width: 820px){
  :root{
    --hx-modal-radius:24px;
    --hx-modal-inner-radius:18px;
    --hx-modal-btn-width:auto;
    --hx-modal-btn-height:60px;
  }

  :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
    padding:10px 10px 0 !important;
  }

  :is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
    padding:20px 18px 0 !important;
  }

  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
    margin:20px -18px -1px !important;
    width:calc(100% + 36px) !important;
    padding:16px 18px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }

  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions,
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) > div:last-child{
    width:100% !important;
  }

  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .btn,
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions .btn{
    flex:1 1 0 !important;
    width:auto !important;
    min-width:0 !important;
    max-width:none !important;
  }
}



/* v43 modal footer + header spacing fix */
:is(.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell,.profile-modal-card){
  display:flex !important;
  flex-direction:column !important;
  max-height:calc(100vh - 48px) !important;
  overflow:hidden !important;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
  flex:0 0 auto !important;
  padding:18px 18px 0 !important;
  background:#eef2f7 !important;
}

:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
  padding:26px 28px 22px !important;
  border-top-left-radius:24px !important;
  border-top-right-radius:24px !important;
}

:is(.user-modal-brand,.supplier-modal-brand,.crm-modal-brand,.profile-modal-brand){
  padding:4px 0 !important;
}

:is(.user-brand-mark,.supplier-brand-mark,.crm-brand-mark,.profile-brand-mark){
  margin-right:12px !important;
}

:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow:auto !important;
  padding:0 30px !important;
  background:linear-gradient(180deg, rgba(255,255,255,.995), rgba(247,249,255,.98)) !important;
}

:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .modal-body,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .profile-modal-form{
  display:flex !important;
  flex-direction:column !important;
  min-height:100% !important;
}

.hx-modal-section-stack{
  display:grid !important;
  gap:18px !important;
  padding:26px 0 28px !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  position:sticky !important;
  bottom:0 !important;
  z-index:3 !important;
  margin:0 -30px 0 !important;
  margin-top:auto !important;
  padding:22px 30px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  border-top:1px solid rgba(148,163,184,.18) !important;
  border-bottom-left-radius:28px !important;
  border-bottom-right-radius:28px !important;
  background:#eef2f7 !important;
  background-image:none !important;
  box-shadow:none !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer) .hx-form-actions{
  justify-content:flex-end !important;
  align-items:center !important;
}

@media (max-width: 820px){
  :is(.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell,.profile-modal-card){
    max-height:calc(100vh - 24px) !important;
  }
  :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
    padding:14px 14px 0 !important;
  }
  :is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
    padding:22px 22px 18px !important;
  }
  :is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
    padding:0 18px !important;
  }
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
    margin-left:-18px !important;
    margin-right:-18px !important;
    padding:18px 18px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* FINAL MODAL POLISH PASS */
:is(.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell,.hx-modal-shell){
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}

:is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
  padding:28px 28px 22px !important;
}
:is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
  padding:6px 6px 0 !important;
}
:is(.user-modal-brand,.supplier-modal-brand,.crm-modal-brand,.profile-modal-brand){
  padding:10px 10px 0 10px !important;
  border-top-left-radius:26px !important;
}
:is(.user-brand-mark,.supplier-brand-mark,.crm-brand-mark,.profile-brand-mark){
  margin-left:2px !important;
  margin-top:2px !important;
}

:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow:auto !important;
  padding:30px 30px 0 !important;
}

:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .profile-modal-form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .crm-modal-form,
:is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .supplier-modal-form{
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
  min-height:max-content !important;
}

.hx-modal-section-stack{
  flex:0 0 auto !important;
}

:is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
  position:static !important;
  bottom:auto !important;
  margin-top:auto !important;
  margin-left:-30px !important;
  margin-right:-30px !important;
  width:calc(100% + 60px) !important;
  align-self:stretch !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:18px !important;
  padding:20px 30px calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  border-top:1px solid var(--hx-modal-footer-border) !important;
  border-bottom-left-radius:34px !important;
  border-bottom-right-radius:34px !important;
  background:var(--hx-modal-footer-bg) !important;
  background-image:none !important;
}

@media (max-width: 820px){
  :is(.user-modal-hero,.supplier-modal-hero,.crm-modal-hero,.profile-modal-hero){
    padding:22px 22px 18px !important;
  }
  :is(.user-modal-headbar,.supplier-modal-headbar,.crm-modal-headbar,.profile-modal-headbar){
    padding:4px 4px 0 !important;
  }
  :is(.user-modal-brand,.supplier-modal-brand,.crm-modal-brand,.profile-modal-brand){
    padding:8px 8px 0 8px !important;
  }
  :is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
    padding:20px 18px 0 !important;
  }
  :is(.hx-modal-footer,.profile-modal-footer,.user-modal-footer,.supplier-modal-footer,.crm-modal-footer){
    margin-left:-18px !important;
    margin-right:-18px !important;
    width:calc(100% + 36px) !important;
    padding:16px 18px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    border-bottom-left-radius:24px !important;
    border-bottom-right-radius:24px !important;
  }
}


body:not(.light) .hx-form-section .hx-form-section__title,
body:not(.light) .crm-form-grid .hx-form-section__title,
body:not(.light) .user-form-grid .hx-form-section__title,
body:not(.light) .supplier-form-grid .hx-form-section__title,
body:not(.light) .profile-form-grid .hx-form-section__title{
  color:#f8fafc !important;
  opacity:1 !important;
}
body:not(.light) .hx-form-section .hx-form-section__desc,
body:not(.light) .crm-form-grid .hx-form-section__desc,
body:not(.light) .user-form-grid .hx-form-section__desc,
body:not(.light) .supplier-form-grid .hx-form-section__desc,
body:not(.light) .profile-form-grid .hx-form-section__desc{
  color:rgba(226,232,240,.82) !important;
  opacity:1 !important;
}
body:not(.light) .hx-form-section .hx-form-section__head{
  border-bottom:1px solid rgba(148,163,184,.22) !important;
}


/* Light-styled modals should keep dark readable section text, even in dark theme */
body:not(.light) .hx-modal .hx-form-section__title,
body:not(.light) .modal .hx-form-section__title,
body:not(.light) .crm-modal .hx-form-section__title,
body:not(.light) .user-modal .hx-form-section__title,
body:not(.light) .supplier-modal .hx-form-section__title,
body:not(.light) .profile-modal .hx-form-section__title{
  color:#0f172a !important;
  opacity:1 !important;
}
body:not(.light) .hx-modal .hx-form-section__desc,
body:not(.light) .modal .hx-form-section__desc,
body:not(.light) .crm-modal .hx-form-section__desc,
body:not(.light) .user-modal .hx-form-section__desc,
body:not(.light) .supplier-modal .hx-form-section__desc,
body:not(.light) .profile-modal .hx-form-section__desc{
  color:rgba(15,23,42,.58) !important;
  opacity:1 !important;
}
body:not(.light) .hx-modal .hx-form-section__head,
body:not(.light) .modal .hx-form-section__head,
body:not(.light) .crm-modal .hx-form-section__head,
body:not(.light) .user-modal .hx-form-section__head,
body:not(.light) .supplier-modal .hx-form-section__head,
body:not(.light) .profile-modal .hx-form-section__head{
  border-bottom:1px solid rgba(15,23,42,.08) !important;
}


/* Profile modal: keep summary card and section headings readable in dark theme */
body:not(.light) .profile-modal .profile-summary,
body:not(.light) .hx-modal .profile-summary{
  background:linear-gradient(180deg, rgba(191,219,254,.22), rgba(219,234,254,.16)) !important;
  border:1px solid rgba(96,165,250,.34) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 12px 28px rgba(15,23,42,.10) !important;
}
body:not(.light) .profile-modal .profile-summary__name,
body:not(.light) .hx-modal .profile-summary__name{
  color:#0f172a !important;
}
body:not(.light) .profile-modal .profile-summary__meta,
body:not(.light) .hx-modal .profile-summary__meta{
  color:rgba(15,23,42,.66) !important;
}
body:not(.light) .profile-modal .profile-summary__avatar,
body:not(.light) .hx-modal .profile-summary__avatar{
  background:rgba(255,255,255,.92) !important;
  color:#0f172a !important;
  border:1px solid rgba(15,23,42,.08) !important;
}

body:not(.light) .profile-modal .hx-form-section,
body:not(.light) .hx-modal .profile-form-grid .hx-form-section{
  border:1px solid rgba(148,163,184,.26) !important;
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.03)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 8px 24px rgba(15,23,42,.06) !important;
}
body:not(.light) .profile-modal .hx-form-section__title,
body:not(.light) .hx-modal .profile-form-grid .hx-form-section__title{
  color:#f8fafc !important;
  opacity:1 !important;
}
body:not(.light) .profile-modal .hx-form-section__desc,
body:not(.light) .hx-modal .profile-form-grid .hx-form-section__desc{
  color:rgba(226,232,240,.82) !important;
  opacity:1 !important;
}
body:not(.light) .profile-modal .hx-form-section__head,
body:not(.light) .hx-modal .profile-form-grid .hx-form-section__head{
  border-bottom:1px solid rgba(148,163,184,.22) !important;
}


/* ===== iPhone sidebar/off-canvas hard fix ===== */
[hidden]{
  display:none !important;
}

@media (max-width: 900px){
  .sidebar-toggle{
    display:none !important;
  }

  .sidebar{
    position:fixed !important;
    top:0 !important;
    left:0 !important;
    bottom:0 !important;
    width:min(84vw, 340px) !important;
    max-width:340px !important;
    margin:0 !important;
    display:flex !important;
    flex-direction:column !important;
    transform:translate3d(-108%, 0, 0) !important;
    visibility:hidden !important;
    opacity:0 !important;
    pointer-events:none !important;
    transition:
      transform .24s ease,
      opacity .18s ease,
      visibility 0s linear .24s !important;
    z-index:1199 !important;
    border-radius:0 22px 22px 0 !important;
    overflow:auto !important;
  }

  .sidebar.is-mobile-open{
    transform:translate3d(0, 0, 0) !important;
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
    transition:
      transform .24s ease,
      opacity .18s ease,
      visibility 0s linear 0s !important;
  }

  .sidebar-top{
    position:sticky !important;
    top:0 !important;
    z-index:2 !important;
    background:inherit !important;
    padding:8px 0 12px !important;
  }

  .sidebar-mobile-close{
    display:none !important;
    align-items:center !important;
    justify-content:center !important;
    width:40px !important;
    height:40px !important;
    border-radius:14px !important;
    border:1px solid var(--border) !important;
    background:rgba(255,255,255,.06) !important;
    color:var(--text) !important;
    font-size:24px !important;
    line-height:1 !important;
  }

  .sidebar.is-mobile-open .sidebar-mobile-close{
    display:inline-flex !important;
  }

  .sidebar:not(.is-mobile-open) .sidebar-mobile-close{
    display:none !important;
  }

  .mobile-menu-backdrop{
    display:block !important;
  }
}


/* Profile modal readability in dark mode */
body:not(.light) .profile-modal,
body:not(.light) .hx-modal.profile-modal{
  color:#f8fafc;
}

body:not(.light) .profile-modal .hx-form-section__title,
body:not(.light) .profile-modal .hx-form-section .hx-form-section__title,
body:not(.light) .profile-modal .profile-section-title{
  color:#f8fafc !important;
  opacity:1 !important;
}

body:not(.light) .profile-modal .hx-form-section__desc,
body:not(.light) .profile-modal .hx-form-section .hx-form-section__desc,
body:not(.light) .profile-modal .profile-section-desc{
  color:rgba(226,232,240,.82) !important;
  opacity:1 !important;
}

body:not(.light) .profile-modal .hx-form-section__head{
  border-bottom:1px solid rgba(148,163,184,.22) !important;
}

body:not(.light) .profile-modal label,
body:not(.light) .profile-modal .form-label,
body:not(.light) .profile-modal .field-label,
body:not(.light) .profile-modal .input-label{
  color:#e2e8f0 !important;
  opacity:1 !important;
}

body:not(.light) .profile-modal .profile-summary__name{
  color:#0f172a !important;
}

body:not(.light) .profile-modal .profile-summary__meta{
  color:rgba(15,23,42,.68) !important;
}


/* Force readable text inside light-styled profile modal while app is in dark mode */
body:not(.light) .profile-modal,
body:not(.light) .profile-modal *{
  --profile-light-text:#0f172a;
  --profile-light-muted:rgba(15,23,42,.64);
}

body:not(.light) .profile-modal .profile-summary,
body:not(.light) .profile-modal .profile-summary *{
  color:inherit;
}

body:not(.light) .profile-modal .profile-summary__name{
  color:#0f172a !important;
}
body:not(.light) .profile-modal .profile-summary__meta{
  color:rgba(15,23,42,.68) !important;
}

body:not(.light) .profile-modal .hx-form-section__title,
body:not(.light) .profile-modal .hx-form-section__title *,
body:not(.light) .profile-modal .profile-section-title,
body:not(.light) .profile-modal .profile-section-title *{
  color:#0f172a !important;
  opacity:1 !important;
  -webkit-text-fill-color:#0f172a !important;
}

body:not(.light) .profile-modal .hx-form-section__desc,
body:not(.light) .profile-modal .hx-form-section__desc *,
body:not(.light) .profile-modal .profile-section-desc,
body:not(.light) .profile-modal .profile-section-desc *{
  color:rgba(15,23,42,.62) !important;
  opacity:1 !important;
  -webkit-text-fill-color:rgba(15,23,42,.62) !important;
}

body:not(.light) .profile-modal label,
body:not(.light) .profile-modal label *,
body:not(.light) .profile-modal .form-label,
body:not(.light) .profile-modal .field-label,
body:not(.light) .profile-modal .input-label{
  color:#0f172a !important;
  opacity:1 !important;
  -webkit-text-fill-color:#0f172a !important;
}

body:not(.light) .profile-modal .hx-form-section{
  color:#0f172a !important;
}

body:not(.light) .profile-modal .hx-form-section__head{
  border-bottom:1px solid rgba(15,23,42,.10) !important;
}


/* Absolute override: profile modal stays light/readable even when app theme is dark */
body:not(.light) #profileModal .modal-content,
body:not(.light) #profileModal .modal-card,
body:not(.light) #profileModal .profile-modal,
body:not(.light) #profileModal .profile-modal *{
  color:inherit;
}

body:not(.light) #profileModal .profile-modal{
  color:#0f172a !important;
}

body:not(.light) #profileModal .profile-summary{
  background:linear-gradient(180deg, rgba(191,219,254,.22), rgba(219,234,254,.16)) !important;
  border:1px solid rgba(96,165,250,.34) !important;
}
body:not(.light) #profileModal .profile-summary__name{
  color:#0f172a !important;
}
body:not(.light) #profileModal .profile-summary__meta{
  color:rgba(15,23,42,.68) !important;
}
body:not(.light) #profileModal .profile-summary__avatar{
  background:rgba(255,255,255,.92) !important;
  color:#0f172a !important;
}

body:not(.light) #profileModal .profile-section-title,
body:not(.light) #profileModal .hx-form-section__title{
  color:#0f172a !important;
  opacity:1 !important;
  -webkit-text-fill-color:#0f172a !important;
  text-shadow:none !important;
  filter:none !important;
}

body:not(.light) #profileModal .profile-section-desc,
body:not(.light) #profileModal .hx-form-section__desc{
  color:rgba(15,23,42,.62) !important;
  opacity:1 !important;
  -webkit-text-fill-color:rgba(15,23,42,.62) !important;
  text-shadow:none !important;
  filter:none !important;
}

body:not(.light) #profileModal label,
body:not(.light) #profileModal .form-label,
body:not(.light) #profileModal .field-label,
body:not(.light) #profileModal .input-label{
  color:#0f172a !important;
  opacity:1 !important;
  -webkit-text-fill-color:#0f172a !important;
}

body:not(.light) #profileModal .hx-form-section__head{
  border-bottom:1px solid rgba(15,23,42,.10) !important;
}


/* Final hard override for profile modal section headings in dark theme */
body:not(.light) #profileEditModal .hx-form-section__title,
body:not(.light) #profileEditModal .hx-form-section__title.profile-section-title,
body:not(.light) #profileEditModal h4.hx-form-section__title,
body:not(.light) #profileEditModal .profile-section-title{
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  opacity:1 !important;
  text-shadow:none !important;
  filter:none !important;
}

body:not(.light) #profileEditModal .hx-form-section__desc,
body:not(.light) #profileEditModal .hx-form-section__desc.profile-section-desc,
body:not(.light) #profileEditModal p.hx-form-section__desc,
body:not(.light) #profileEditModal .profile-section-desc{
  color:rgba(15,23,42,.62) !important;
  -webkit-text-fill-color:rgba(15,23,42,.62) !important;
  opacity:1 !important;
  text-shadow:none !important;
  filter:none !important;
}

body:not(.light) #profileEditModal .hx-form-section__head{
  border-bottom:1px solid rgba(15,23,42,.10) !important;
}

body:not(.light) #profileEditModal .hx-profile-summary__copy strong,
body:not(.light) #profileEditModal .hx-profile-summary__copy span{
  color:#0f172a !important;
}

body:not(.light) #profileEditModal label > span,
body:not(.light) #profileEditModal label small{
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  opacity:1 !important;
}


/* Profile summary card text contrast in dark mode */
body:not(.light) #profileEditModal .profile-summary,
body:not(.light) #profileEditModal .hx-profile-summary,
body:not(.light) #profileEditModal .profile-summary-card{
  background:linear-gradient(180deg, rgba(191,219,254,.22), rgba(219,234,254,.18)) !important;
  border:1px solid rgba(96,165,250,.34) !important;
}

body:not(.light) #profileEditModal .profile-summary__name,
body:not(.light) #profileEditModal .hx-profile-summary__name,
body:not(.light) #profileEditModal .hx-profile-summary__copy strong{
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  opacity:1 !important;
}

body:not(.light) #profileEditModal .profile-summary__meta,
body:not(.light) #profileEditModal .hx-profile-summary__meta,
body:not(.light) #profileEditModal .hx-profile-summary__copy span,
body:not(.light) #profileEditModal .hx-profile-summary__copy small{
  color:rgba(15,23,42,.70) !important;
  -webkit-text-fill-color:rgba(15,23,42,.70) !important;
  opacity:1 !important;
}

body:not(.light) #profileEditModal .profile-summary *,
body:not(.light) #profileEditModal .hx-profile-summary *,
body:not(.light) #profileEditModal .profile-summary-card *{
  text-shadow:none !important;
  filter:none !important;
}


/* Stronger profile summary email contrast in dark mode */
body:not(.light) #profileEditModal .profile-summary__meta,
body:not(.light) #profileEditModal .hx-profile-summary__meta,
body:not(.light) #profileEditModal .profile-summary .profile-summary__meta,
body:not(.light) #profileEditModal .hx-profile-summary .hx-profile-summary__meta,
body:not(.light) #profileEditModal .profile-summary [href^="mailto:"],
body:not(.light) #profileEditModal .hx-profile-summary [href^="mailto:"],
body:not(.light) #profileEditModal .profile-summary a,
body:not(.light) #profileEditModal .hx-profile-summary a,
body:not(.light) #profileEditModal .hx-profile-summary__copy span,
body:not(.light) #profileEditModal .hx-profile-summary__copy small{
  color:#334155 !important;
  -webkit-text-fill-color:#334155 !important;
  opacity:1 !important;
  font-weight:600 !important;
}


/* Explicit profile summary email class for dark-mode readability */
.profile-summary-email{
  color:rgba(15,23,42,.62);
}
body:not(.light) #profileEditModal .profile-summary-email{
  color:#334155 !important;
  -webkit-text-fill-color:#334155 !important;
  opacity:1 !important;
  font-weight:600 !important;
  text-shadow:none !important;
  filter:none !important;
}

/* havexa-mobile-submenu-fix-v72 */
@media (max-width: 900px){
  .sidebar .submenu,
  .sidebar .nav-submenu,
  .sidebar .sidebar-submenu,
  .sidebar .menu-submenu{
    position:static !important;
    transform:none !important;
    width:100% !important;
    max-height:none !important;
    overflow:visible !important;
  }
}


/* havexa-mobile-submenu-fix-v73 */
@media (max-width: 900px){
  .side-group{
    display:grid !important;
    gap:10px !important;
    overflow:visible !important;
  }

  .side-group-toggle{
    width:100% !important;
    min-height:48px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
  }

  .side-submenu{
    position:static !important;
    inset:auto !important;
    transform:none !important;
    width:100% !important;
    overflow:hidden !important;
    display:grid !important;
    gap:10px !important;
    margin:0 !important;
    padding:0 0 0 18px !important;
    background:transparent !important;
    border:0 !important;
    box-shadow:none !important;
    max-height:0 !important;
    opacity:0 !important;
    pointer-events:none !important;
    transition:max-height .24s ease, opacity .18s ease !important;
  }

  .side-group.open .side-submenu{
    max-height:320px !important;
    opacity:1 !important;
    pointer-events:auto !important;
    margin-top:4px !important;
  }

  .side-submenu .side-sublink{
    margin:0 !important;
    padding-left:14px !important;
    min-height:46px !important;
    display:flex !important;
    align-items:center !important;
  }

  .side-group:not(.open) .side-submenu *{
    visibility:hidden !important;
  }

  .side-group.open .side-submenu *{
    visibility:visible !important;
  }
}


/* havexa-mobile-dark-sidebar-opaque-v74 */
@media (max-width: 900px){
  body:not(.light) .sidebar{
    background:#07162a !important;
    background-image:none !important;
    opacity:1 !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
    box-shadow:16px 0 40px rgba(2,6,23,.38) !important;
  }

  body:not(.light) .sidebar::before,
  body:not(.light) .sidebar::after{
    display:none !important;
    content:none !important;
  }

  body:not(.light) .sidebar-top{
    background:#07162a !important;
    background-image:none !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
  }

  body:not(.light) .sidebar-menu,
  body:not(.light) .sidebar nav,
  body:not(.light) .sidebar .side-group,
  body:not(.light) .sidebar .side-submenu{
    background:transparent !important;
    opacity:1 !important;
  }

  body:not(.light) .mobile-menu-backdrop{
    background:rgba(2,6,23,.42) !important;
    backdrop-filter:blur(2px) !important;
    -webkit-backdrop-filter:blur(2px) !important;
  }
}


/* havexa-mobile-sidebar-solid-v82 */
@media (max-width: 900px){
  body:not(.light) .sidebar,
  body:not(.light) aside.sidebar,
  body:not(.light) #sidebar{
    background:#07162a !important;
    background-color:#07162a !important;
    background-image:none !important;
    opacity:1 !important;
    isolation:isolate !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
    box-shadow:18px 0 44px rgba(2,6,23,.42) !important;
  }

  body:not(.light) .sidebar *,
  body:not(.light) aside.sidebar *,
  body:not(.light) #sidebar *{
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
  }

  body:not(.light) .sidebar-top,
  body:not(.light) #sidebar .sidebar-top,
  body:not(.light) .sidebar-menu,
  body:not(.light) #sidebar .sidebar-menu{
    background:#07162a !important;
    background-color:#07162a !important;
    background-image:none !important;
    opacity:1 !important;
  }

  body:not(.light) .side-group,
  body:not(.light) .side-submenu,
  body:not(.light) .side-link,
  body:not(.light) .side-group-toggle{
    background-color:transparent !important;
    background-image:none !important;
  }

  body:not(.light) .shell,
  body:not(.light) .content,
  body:not(.light) main{
    background-clip:padding-box !important;
  }

  body:not(.light) .mobile-menu-backdrop,
  body:not(.light) #mobileMenuBackdrop{
    background:rgba(2,6,23,.50) !important;
    backdrop-filter:blur(2px) !important;
    -webkit-backdrop-filter:blur(2px) !important;
  }
}





/* Dashboard layout safety fix */
.page-head.row-between{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:18px;
}
.page-head.row-between > div:last-child{
  margin-left:auto;
}
@media (max-width: 900px){
  .page-head.row-between{
    align-items:flex-start;
  }
  .page-head.row-between > div:last-child{
    margin-left:0;
    width:100%;
  }
}


/* Global footer */
.site-footer{
  width:100%;
  margin-top:22px;
  padding:10px 18px;
  border-top:1px solid var(--border);
  background:transparent;
}

body.light .site-footer{
  background:linear-gradient(180deg, rgba(255,255,255,.90), rgba(248,250,252,.96));
}

body:not(.light) .site-footer{
  background:linear-gradient(180deg, rgba(2,6,23,.34), rgba(2,6,23,.22));
}

.site-footer__inner{
  width:100%;
  max-width:1280px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  flex-wrap:wrap;
  text-align:center;
  color:var(--muted);
  min-height:68px;
}

.site-footer__mailicon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-size:20px;
  line-height:1;
  transform:translateY(-1px);
}

.site-footer__mail,
.site-footer__year,
.site-footer__dot{
  font-size:14px;
  line-height:1;
}

.site-footer__mail{
  text-decoration:none;
  color:var(--muted);
}

.site-footer__mail:hover{
  color:var(--accent);
}

.site-footer__dot{
  opacity:.6;
}

@media (max-width: 640px){
  .site-footer__inner{
    gap:10px;
  }
  .site-footer__mailicon{
    font-size:18px;
  }
  .site-footer__mail,
  .site-footer__year,
  .site-footer__dot{
    font-size:13px;
  }
}



/* Live notification bell */
.hx-realtime-bell{
  position:fixed;
  top:86px;
  right:18px;
  z-index:1200;
}
.hx-realtime-bell__button{
  position:relative;
  width:48px;
  height:48px;
  border-radius:16px;
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  box-shadow:var(--shadow);
  cursor:pointer;
}
.hx-realtime-bell__icon{
  font-size:20px;
  line-height:1;
}
.hx-realtime-bell__count{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--danger);
  color:#fff;
  font-size:11px;
  font-weight:800;
  box-shadow:0 8px 18px rgba(239,68,68,.28);
}
.hx-realtime-bell__panel{
  position:absolute;
  top:56px;
  right:0;
  width:min(360px, calc(100vw - 32px));
  border-radius:18px;
  border:1px solid var(--border);
  background:var(--surface);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.hx-realtime-bell__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.hx-realtime-bell__clear{
  border:none;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
}
.hx-realtime-bell__list{
  max-height:360px;
  overflow:auto;
  padding:8px;
}
.hx-realtime-item{
  padding:12px 12px;
  border-radius:14px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.05);
}
body.light .hx-realtime-item{
  background:rgba(15,23,42,.03);
  border-color:rgba(15,23,42,.05);
}
.hx-realtime-item + .hx-realtime-item{
  margin-top:8px;
}
.hx-realtime-item__title{
  font-weight:700;
  color:var(--text);
}
.hx-realtime-item__meta{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}
.hx-realtime-empty{
  padding:14px 12px;
  color:var(--muted);
}
.toast.info{
  background:#2563eb;
}
@media (max-width: 900px){
  .hx-realtime-bell{
    top:78px;
    right:14px;
  }
}


.btn.is-loading .btn-label,
button.is-loading .btn-label,
input[type="submit"].is-loading .btn-label,
.btn.is-loading .action-btn-inline,
button.is-loading .action-btn-inline,
input[type="submit"].is-loading .action-btn-inline{
  animation:none !important;
  transform:none !important;
}

/* v348 componentized shared tables */
.hvx-table-shell{
  width:100%;
}
.hvx-table-shell thead tr{
  box-shadow:none;
}
.hvx-table-shell tbody tr{
  transition:transform .15s ease, box-shadow .15s ease;
}
.hvx-table-shell tbody tr:focus-within td{
  outline:none;
}
.hvx-table-shell--users,
.hvx-table-shell--quotes{
  width:100%;
}
.hvx-table-shell .action-btn-inline{
  white-space:nowrap;
}

/* v349 users grid header/pagination polish */
.users-grid-card{
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
}
.users-table-wrap{
  position:relative;
  overflow:visible;
}
.users-table.users-table--advanced,
.hvx-table-shell--users{
  width:100%;
  border-collapse:separate;
  border-spacing:0 14px;
}
.hvx-table-shell--users thead{
  position:relative;
  z-index:5;
}
.hvx-table-shell--users thead tr{
  box-shadow:0 10px 24px rgba(15,23,42,.05);
}
.hvx-table-shell--users thead th{
  position:relative;
  top:auto;
  z-index:5;
  background:rgba(248,250,252,.98);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  padding-top:20px;
  padding-bottom:20px;
}
.hvx-table-shell--users thead th:first-child{
  border-top-left-radius:18px;
  border-bottom-left-radius:18px;
}
.hvx-table-shell--users thead th:last-child{
  border-top-right-radius:18px;
  border-bottom-right-radius:18px;
}
.hvx-table-shell--users tbody{
  position:relative;
  z-index:1;
}
.hvx-table-shell--users tbody::before{
  content:'';
  display:block;
  height:8px;
}
.hvx-table-shell--users tbody tr{
  position:relative;
  z-index:1;
}
.hvx-table-shell--users tbody td{
  background:var(--hx-card-bg,#fff);
}
.hvx-table-shell--users tbody td:first-child{
  border-top-left-radius:18px;
  border-bottom-left-radius:18px;
}
.hvx-table-shell--users tbody td:last-child{
  border-top-right-radius:18px;
  border-bottom-right-radius:18px;
}
.grid-enhancer-pager{
  margin-top:22px;
  margin-bottom:56px;
  padding-bottom:18px;
}
.users-overview-stack + .users-grid-card,
.users-table-wrap + .grid-enhancer-empty,
.grid-enhancer-empty + .grid-enhancer-pager{
  margin-top:0;
}
@media (max-width: 760px){
  .grid-enhancer-pager{
    margin-bottom:72px;
  }
}


/* v351 quote templates power-user upgrade */
.quote-templates-table--advanced [data-template-row]{
  cursor:pointer;
}
.quote-templates-table--advanced .quote-template-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  flex-wrap:wrap;
  opacity:.72;
  transition:opacity .16s ease, transform .16s ease;
}
.quote-templates-table--advanced [data-template-row]:hover .quote-template-actions,
.quote-templates-table--advanced [data-template-row]:focus-within .quote-template-actions{
  opacity:1;
}
.quote-templates-table--advanced [data-template-row].is-selected td{
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.28);
}
.quote-templates-powerbar{
  margin-bottom:14px;
}
.quote-templates-table--advanced .quote-templates-cell--price,
.quote-templates-table--advanced .quote-templates-cell--labor{
  text-align:right;
  white-space:nowrap;
  font-weight:700;
}
.quote-templates-table--advanced .quote-templates-cell--actions{
  min-width:260px;
}
.quote-templates-table--advanced .quote-templates-cell--name .crm-sub{
  max-width:460px;
}
.dark .quote-templates-table--advanced .offertes-checkbox{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.42);
}
.dark .quote-templates-table--advanced .offertes-checkbox:checked{
  background:linear-gradient(135deg,#4f7cff,#6fa3ff);
  border-color:#4f7cff;
}


/* v352 quote templates final polish */
.quote-templates-board{display:grid;gap:18px;}
.qt-summary--modern{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border:1px solid rgba(15,23,42,.08);border-radius:24px;overflow:hidden;background:rgba(255,255,255,.92);box-shadow:0 12px 30px rgba(15,23,42,.05)}
.qt-summary--modern .qt-summary-item{padding:26px 34px;border-right:1px solid rgba(15,23,42,.08)}
.qt-summary--modern .qt-summary-item:last-child{border-right:none}
.qt-toolbar{display:grid;grid-template-columns:minmax(320px,520px) 280px;gap:18px;align-items:center;justify-content:space-between}
.qt-search,.qt-sort{display:flex;align-items:center;gap:12px;padding:18px 20px;border-radius:24px;border:1px solid rgba(15,23,42,.08);background:rgba(255,255,255,.9);box-shadow:0 12px 24px rgba(15,23,42,.04)}
.qt-search svg{width:26px;height:26px;stroke:var(--text);stroke-width:2;fill:none;flex:0 0 auto}
.qt-search input,.qt-sort select,.qt-per-page select{border:none;background:transparent;box-shadow:none;outline:none;font-size:1.05rem;padding:0;width:100%;color:var(--text)}
.qt-search input::placeholder{color:var(--text-muted)}
.qt-sort{justify-self:end;width:100%}
.quote-templates-powerbar{margin:0;display:flex;justify-content:flex-start}
.quote-templates-table-wrap{overflow-x:auto}
.quote-templates-table--advanced{width:100%;border-collapse:separate;border-spacing:0 12px;table-layout:fixed}
.quote-templates-table--advanced thead th{background:rgba(248,250,252,.98);padding:22px 18px;font-size:1rem}
.quote-templates-table--advanced thead th:first-child{border-top-left-radius:18px;border-bottom-left-radius:18px}
.quote-templates-table--advanced thead th:last-child{border-top-right-radius:18px;border-bottom-right-radius:18px}
.quote-templates-table--advanced tbody td{background:var(--hx-card-bg,#fff);padding:22px 18px;vertical-align:middle}
.quote-templates-table--advanced tbody td:first-child{border-top-left-radius:18px;border-bottom-left-radius:18px}
.quote-templates-table--advanced tbody td:last-child{border-top-right-radius:18px;border-bottom-right-radius:18px}
.quote-templates-table--advanced th:nth-child(1),.quote-templates-table--advanced td:nth-child(1){width:54px}
.quote-templates-table--advanced th:nth-child(2),.quote-templates-table--advanced td:nth-child(2){width:38%}
.quote-templates-table--advanced th:nth-child(3),.quote-templates-table--advanced td:nth-child(3){width:14%}
.quote-templates-table--advanced th:nth-child(4),.quote-templates-table--advanced td:nth-child(4){width:12%}
.quote-templates-table--advanced th:nth-child(5),.quote-templates-table--advanced td:nth-child(5){width:12%}
.quote-templates-table--advanced th:nth-child(6),.quote-templates-table--advanced td:nth-child(6){width:11%}
.quote-templates-table--advanced th:nth-child(7),.quote-templates-table--advanced td:nth-child(7){width:180px}
.quote-templates-table--advanced .quote-templates-cell--name .crm-name{font-size:1.45rem;line-height:1.15;margin-bottom:8px}
.quote-templates-table--advanced .quote-templates-cell--name .crm-sub{font-size:1rem;line-height:1.4;max-width:none;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.quote-templates-table--advanced .quote-templates-cell--price,.quote-templates-table--advanced .quote-templates-cell--labor{text-align:right;font-weight:800;font-size:1.05rem}
.quote-templates-table--advanced .quote-templates-cell--status{text-align:center}
.quote-template-actions{display:flex;gap:10px;justify-content:flex-end;align-items:center;opacity:1;transform:none}
.qt-icon-btn{width:52px;height:52px;border-radius:16px;border:1px solid rgba(15,23,42,.08);background:#fff;display:inline-flex;align-items:center;justify-content:center;color:var(--text);box-shadow:0 8px 16px rgba(15,23,42,.04);transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease;cursor:pointer}
.qt-icon-btn:hover{transform:translateY(-1px);box-shadow:0 12px 22px rgba(15,23,42,.08);border-color:rgba(59,130,246,.22)}
.qt-icon-btn svg{width:24px;height:24px;stroke:currentColor;stroke-width:2;fill:none}
.qt-icon-btn--danger{color:#dc2626}
.qt-inline-form{display:inline-flex;margin:0}
.qt-pager{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:8px 2px 20px}
.qt-pager-meta{color:var(--text-muted);font-size:1rem}
.qt-pager-controls{display:flex;align-items:center;gap:12px}
.qt-per-page{display:flex;align-items:center;gap:10px;color:var(--text-muted)}
.qt-page-pill{min-width:50px;height:50px;border-radius:16px;background:linear-gradient(135deg,#3b82f6,#5f9bff);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800}
.qt-select-all input{margin-right:10px!important}
@media (max-width: 1180px){.qt-toolbar{grid-template-columns:1fr 260px}.quote-templates-table--advanced th:nth-child(2),.quote-templates-table--advanced td:nth-child(2){width:34%}}
@media (max-width: 980px){.qt-summary--modern{grid-template-columns:repeat(2,minmax(0,1fr))}.qt-toolbar{grid-template-columns:1fr}.qt-sort{justify-self:stretch}.qt-pager{flex-direction:column;align-items:flex-start}.quote-templates-table--advanced{min-width:1080px}}
@media (max-width: 640px){.qt-summary--modern{grid-template-columns:1fr}}


/* v353 quote templates dark mode polish */
.qt-sort{position:relative}
.qt-sort select,.qt-per-page select{-webkit-appearance:none;-moz-appearance:none;appearance:none}
.qt-sort::after,.qt-per-page::after{content:"";position:absolute;right:18px;top:50%;width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-65%) rotate(45deg);pointer-events:none;opacity:.72}
.qt-per-page{position:relative;padding-right:22px}
.qt-per-page::after{right:56px}

.dark .quote-templates-board{background:transparent;border:none;box-shadow:none}
.dark .quote-templates-board .card-head h3{color:#f8fbff}
.dark .quote-templates-board .badge-soft{background:rgba(59,130,246,.16);color:#9dc0ff;border:1px solid rgba(96,165,250,.18)}
.dark .qt-summary--modern{background:linear-gradient(180deg,rgba(5,16,31,.94),rgba(9,22,42,.88));border:1px solid rgba(71,114,184,.28);box-shadow:0 20px 40px rgba(2,8,23,.24)}
.dark .qt-summary--modern .qt-summary-item{border-right:1px solid rgba(71,114,184,.22)}
.dark .qt-summary-value{color:#f8fbff}
.dark .qt-summary-label{color:#9aa9c0}
.dark .qt-search,.dark .qt-sort{background:rgba(5,16,31,.92);border-color:rgba(71,114,184,.28);box-shadow:0 10px 24px rgba(2,8,23,.16);color:#dfe9f7}
.dark .qt-search svg{stroke:#9db2cf}
.dark .qt-search input,.dark .qt-sort select,.dark .qt-per-page select{color:#eef4ff}
.dark .qt-search input::placeholder{color:#8fa2bf}
.dark .quote-templates-powerbar .btn.ghost,
.dark .qt-pager .btn.ghost,
.dark .qt-select-all{background:rgba(5,16,31,.92);border-color:rgba(71,114,184,.28);color:#eef4ff;box-shadow:0 10px 24px rgba(2,8,23,.14)}
.dark .offertes-selection-pill{background:rgba(5,16,31,.82);border:1px solid rgba(71,114,184,.2);color:#eef4ff}
.dark .quote-templates-table--advanced{border-spacing:0 14px}
.dark .quote-templates-table--advanced thead th{background:linear-gradient(180deg,rgba(9,23,43,.94),rgba(12,29,52,.9));color:#d7e3f7;border-top:1px solid rgba(71,114,184,.28);border-bottom:1px solid rgba(71,114,184,.28)}
.dark .quote-templates-table--advanced tbody td{background:linear-gradient(180deg,rgba(5,16,31,.94),rgba(8,20,38,.9));color:#eef4ff;border-top:1px solid rgba(71,114,184,.18);border-bottom:1px solid rgba(71,114,184,.18)}
.dark .quote-templates-table--advanced .quote-templates-cell--name .crm-name,
.dark .quote-templates-table--advanced strong{color:#f8fbff}
.dark .quote-templates-table--advanced .quote-templates-cell--name .crm-sub{color:#9fb0c9}
.dark .quote-templates-table--advanced .quote-templates-cell--price,
.dark .quote-templates-table--advanced .quote-templates-cell--labor{color:#f8fbff}
.dark .quote-templates-table--advanced .quote-templates-cell--status .badge-soft{background:rgba(59,130,246,.14);border-color:rgba(96,165,250,.18);color:#9dc0ff}
.dark .qt-icon-btn{background:rgba(6,18,34,.96);border-color:rgba(71,114,184,.28);box-shadow:none;color:#eef4ff}
.dark .qt-icon-btn:hover{border-color:rgba(96,165,250,.42);box-shadow:0 14px 28px rgba(2,8,23,.24);background:rgba(10,24,45,.98)}
.dark .qt-icon-btn--danger{color:#fca5a5;border-color:rgba(248,113,113,.26)}
.dark .qt-icon-btn--danger:hover{background:rgba(69,10,10,.55);border-color:rgba(248,113,113,.45)}
.dark .offertes-checkbox{background:rgba(255,255,255,.06);border-color:rgba(157,178,207,.38)}
.dark .offertes-checkbox:hover{background:rgba(255,255,255,.1);border-color:rgba(191,219,254,.55)}
.dark .offertes-checkbox:checked{background:linear-gradient(135deg,#3b82f6,#60a5fa);border-color:#60a5fa}
.dark .qt-pager-meta,.dark .qt-per-page{color:#9fb0c9}
.dark .qt-page-pill{box-shadow:0 10px 24px rgba(37,99,235,.26)}


/* =========================================
   V354 – QUOTE TEMPLATES DARK MODE PIXEL FIX
   ========================================= */

body:not(.light) .quote-templates-page {
  background: linear-gradient(180deg, #08111d 0%, #0b1623 100%) !important;
  border: 1px solid rgba(96, 165, 250, 0.12) !important;
  box-shadow: 0 18px 44px rgba(2, 8, 23, 0.28) !important;
}

body:not(.light) .quote-templates-page > .card-head h1,
body:not(.light) .quote-templates-page > .card-head h3,
body:not(.light) .quote-templates-page .card-head h1,
body:not(.light) .quote-templates-page .card-head h3 {
  color: #f8fafc !important;
}

body:not(.light) .quote-templates-page .muted,
body:not(.light) .quote-templates-page .card-head p,
body:not(.light) .quote-templates-page .card-head .muted {
  color: #8ea4ba !important;
}

body:not(.light) .quote-templates-page .form-grid,
body:not(.light) .quote-templates-page form.form-grid {
  background: transparent !important;
}

body:not(.light) .quote-templates-page form.form-grid label,
body:not(.light) .quote-templates-page form.form-grid span {
  color: #d9e4f1 !important;
}

body:not(.light) .quote-templates-page form.form-grid input,
body:not(.light) .quote-templates-page form.form-grid select,
body:not(.light) .quote-templates-page form.form-grid textarea {
  background: #0f1e2d !important;
  color: #e6edf3 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: none !important;
}

body:not(.light) .quote-templates-page form.form-grid input::placeholder,
body:not(.light) .quote-templates-page form.form-grid textarea::placeholder {
  color: #7f95ab !important;
}

body:not(.light) .quote-templates-board {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

body:not(.light) .qt-summary--modern {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  box-shadow: none !important;
}

body:not(.light) .qt-summary-item {
  background: #0f1e2d !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 20px !important;
  padding: 24px 24px !important;
  box-shadow: none !important;
}

body:not(.light) .qt-summary-item:last-child {
  border-right: 1px solid rgba(255,255,255,0.06) !important;
}

body:not(.light) .qt-summary-value {
  color: #f8fafc !important;
  font-size: 1.9rem !important;
  line-height: 1 !important;
  margin-bottom: 8px !important;
}

body:not(.light) .qt-summary-label {
  color: #8ea4ba !important;
  font-size: .92rem !important;
  line-height: 1.35 !important;
}

body:not(.light) .qt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px !important;
  margin-top: 2px !important;
  margin-bottom: 4px !important;
}

body:not(.light) .qt-search,
body:not(.light) .qt-sort {
  background: #0f1e2d !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

body:not(.light) .qt-search {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px !important;
  padding: 0 16px !important;
}

body:not(.light) .qt-search svg {
  width: 20px !important;
  height: 20px !important;
  stroke: #8ea4ba !important;
  fill: none;
  stroke-width: 2;
  flex: 0 0 20px;
}

body:not(.light) .qt-search input {
  width: 100%;
  border: 0 !important;
  background: transparent !important;
  color: #e6edf3 !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 1rem !important;
}

body:not(.light) .qt-search input::placeholder {
  color: #7f95ab !important;
}

body:not(.light) .qt-sort {
  position: relative;
  min-height: 54px !important;
  display: inline-flex;
  align-items: center;
  padding: 0 16px !important;
}

body:not(.light) .qt-sort select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 52px !important;
  padding: 0 34px 0 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #e6edf3 !important;
  box-shadow: none !important;
  font-size: .98rem !important;
  cursor: pointer;
}

body:not(.light) .qt-sort::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #8ea4ba;
  pointer-events: none;
  font-size: 0.95rem;
  border: none !important;
  width: auto !important;
  height: auto !important;
}

body:not(.light) .quote-templates-powerbar {
  background: transparent !important;
}

body:not(.light) .offertes-powerbar__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

body:not(.light) .quote-templates-powerbar .btn.ghost,
body:not(.light) .quote-templates-powerbar .qt-select-all {
  background: #0f1e2d !important;
  color: #e6edf3 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow: none !important;
}

body:not(.light) .quote-templates-powerbar .btn.ghost:hover,
body:not(.light) .quote-templates-powerbar .qt-select-all:hover {
  background: #12263a !important;
}

body:not(.light) .offertes-selection-pill {
  color: #e6edf3 !important;
  background: transparent !important;
}

body:not(.light) .quote-templates-table-wrap {
  background: transparent !important;
}

body:not(.light) .quote-templates-table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 12px !important;
  table-layout: fixed !important;
  background: transparent !important;
}

body:not(.light) .quote-templates-table thead {
  background: transparent !important;
}

body:not(.light) .quote-templates-table thead tr {
  background: #102132 !important;
}

body:not(.light) .quote-templates-table thead th {
  background: transparent !important;
  color: #8ea4ba !important;
  border: none !important;
  padding: 18px 20px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body:not(.light) .quote-templates-table thead th:first-child {
  border-top-left-radius: 22px;
  border-bottom-left-radius: 22px;
}

body:not(.light) .quote-templates-table thead th:last-child {
  border-top-right-radius: 22px;
  border-bottom-right-radius: 22px;
}

body:not(.light) .quote-templates-table th:nth-child(1),
body:not(.light) .quote-templates-table td:nth-child(1) { width: 54px; }

body:not(.light) .quote-templates-table th:nth-child(2),
body:not(.light) .quote-templates-table td:nth-child(2) { width: 34%; }

body:not(.light) .quote-templates-table th:nth-child(3),
body:not(.light) .quote-templates-table td:nth-child(3) { width: 160px; }

body:not(.light) .quote-templates-table th:nth-child(4),
body:not(.light) .quote-templates-table td:nth-child(4) { width: 160px; }

body:not(.light) .quote-templates-table th:nth-child(5),
body:not(.light) .quote-templates-table td:nth-child(5) { width: 160px; }

body:not(.light) .quote-templates-table th:nth-child(6),
body:not(.light) .quote-templates-table td:nth-child(6) { width: 150px; }

body:not(.light) .quote-templates-table th:nth-child(7),
body:not(.light) .quote-templates-table td:nth-child(7) { width: 210px; }

body:not(.light) .quote-templates-row {
  background: #0f1e2d !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  border-radius: 20px !important;
  box-shadow: none !important;
  transition: background .16s ease, transform .16s ease;
}

body:not(.light) .quote-templates-row:hover {
  background: #12263a !important;
  transform: translateY(-1px);
}

body:not(.light) .quote-templates-row td {
  background: transparent !important;
  color: #e6edf3 !important;
  border: none !important;
  padding: 20px 18px !important;
  vertical-align: middle;
}

body:not(.light) .quote-templates-row td:first-child {
  border-top-left-radius: 20px !important;
  border-bottom-left-radius: 20px !important;
}

body:not(.light) .quote-templates-row td:last-child {
  border-top-right-radius: 20px !important;
  border-bottom-right-radius: 20px !important;
}

body:not(.light) .quote-templates-cell .crm-name {
  color: #f8fafc !important;
  font-weight: 800 !important;
  font-size: 1.02rem !important;
  line-height: 1.2 !important;
}

body:not(.light) .quote-templates-cell .crm-sub {
  color: #7f95ab !important;
  margin-top: 5px !important;
  font-size: .9rem !important;
  line-height: 1.45 !important;
}

body:not(.light) .quote-templates-cell strong {
  color: #e6edf3 !important;
}

body:not(.light) .quote-templates-cell--price,
body:not(.light) .quote-templates-cell--labor {
  color: #f8fafc !important;
  font-weight: 700 !important;
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

body:not(.light) .quote-templates-cell--status {
  text-align: center !important;
}

body:not(.light) .quote-templates-cell--status .badge-soft,
body:not(.light) .quote-templates-cell--status .offertes-status-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px !important;
  border-radius: 999px !important;
  font-size: .82rem !important;
  font-weight: 700 !important;
}

body:not(.light) .offertes-status-badge--approved {
  background: rgba(34,197,94,0.16) !important;
  color: #4ade80 !important;
  border: 0 !important;
  box-shadow: none !important;
}

body:not(.light) .quote-template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px !important;
}

body:not(.light) .qt-icon-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  background: transparent !important;
  color: #9fb3c8 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

body:not(.light) .qt-icon-btn svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

body:not(.light) .qt-icon-btn:hover {
  background: #12263a !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,0.14) !important;
}

body:not(.light) .qt-icon-btn--danger {
  color: #f87171 !important;
  border-color: rgba(248,113,113,0.35) !important;
}

body:not(.light) .qt-icon-btn--danger:hover {
  background: rgba(248,113,113,0.10) !important;
  color: #fecaca !important;
}

body:not(.light) .quote-templates-page .offertes-checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.22) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

body:not(.light) .quote-templates-page .offertes-checkbox:checked {
  background: linear-gradient(135deg, #2563eb, #60a5fa) !important;
  border-color: #3b82f6 !important;
}

body:not(.light) .quote-templates-page .offertes-checkbox:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid #fff;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
}

body:not(.light) .qt-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 18px !important;
  padding: 2px 2px 0 !important;
}

body:not(.light) .qt-pager-meta {
  color: #c7d2de !important;
}

body:not(.light) .qt-pager-controls {
  display: flex;
  align-items: center;
  gap: 8px !important;
}

body:not(.light) .qt-per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px !important;
  color: #c7d2de !important;
  font-size: .92rem !important;
}

body:not(.light) .qt-per-page select {
  background: #0f1e2d !important;
  color: #e6edf3 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 10px;
  min-height: 38px !important;
  min-width: 38px !important;
  padding: 0 12px;
  box-shadow: none !important;
}

body:not(.light) .qt-page-pill,
body:not(.light) .qt-pager .btn.ghost {
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 10px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f1e2d !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  color: #c7d2de !important;
  box-shadow: none !important;
}

body:not(.light) .qt-page-pill {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #fff !important;
}

@media (max-width: 1100px) {
  body:not(.light) .qt-summary--modern {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.light) .qt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  body:not(.light) .qt-search,
  body:not(.light) .qt-sort {
    width: 100%;
  }
}


/* v356 quote templates modal + selection parity */
.quote-templates-header-actions{display:flex;justify-content:flex-end;align-items:center;margin-top:-4px}
.quote-template-modal-overlay{position:fixed;inset:0;z-index:6200;display:none;align-items:center;justify-content:center;padding:24px;background:rgba(2,6,23,.46);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.quote-template-modal-overlay.is-open,.quote-template-modal-overlay[data-open="1"]{display:flex}
.quote-template-modal{width:min(900px,calc(100vw - 32px));max-height:min(90vh,940px);overflow:hidden;border-radius:34px;background:#fff;border:1px solid rgba(226,232,240,.95);box-shadow:0 24px 60px rgba(15,23,42,.16);display:flex;flex-direction:column}
.quote-template-modal__hero{padding:0;background:#eef2f7;border-bottom:1px solid rgba(148,163,184,.18)}
.quote-template-modal__headbar{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:24px 28px 20px}
.quote-template-modal__brand{display:inline-flex;align-items:center;gap:14px;margin:0 0 22px 0}
.quote-template-modal__mark{width:58px;height:58px;border-radius:20px;display:grid;place-items:center;background:linear-gradient(135deg,#2563eb 0%,#4f86ff 100%);color:#fff;font-size:1.7rem;font-weight:800;box-shadow:inset 0 1px 0 rgba(255,255,255,.24)}
.quote-template-modal__brandcopy{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;line-height:1}
.quote-template-modal__brandname{font-size:2rem;font-weight:900;letter-spacing:.02em;color:#0f172a}
.quote-template-modal__brandtag{font-size:.92rem;letter-spacing:.32em;text-transform:uppercase;color:rgba(15,23,42,.72);font-weight:500}
.quote-template-modal__copy h3{margin:0;font-size:1.6rem;line-height:1.06;letter-spacing:-.03em;color:#0f172a}
.quote-template-modal__copy p{margin:8px 0 0;font-size:1rem;line-height:1.55;color:#5b677a;max-width:620px}
.quote-template-modal__close{width:52px;height:52px;border-radius:18px;border:1px solid rgba(148,163,184,.24);background:#fff;color:#0f172a;font-size:2rem;line-height:1;display:grid;place-items:center;cursor:pointer;box-shadow:0 10px 24px rgba(15,23,42,.08)}
.quote-template-modal__body{padding:30px 30px 24px;background:linear-gradient(180deg,rgba(255,255,255,.995),rgba(247,249,255,.98));overflow:auto}
.quote-template-modal__form{background:transparent !important}
.quote-template-modal__checkbox-row{display:flex;align-items:center;gap:10px;color:#0f172a;font-weight:700}
.quote-template-modal__footer{margin-top:auto;background:#eef2f7;border-top:1px solid rgba(148,163,184,.18);padding:22px 30px calc(18px + env(safe-area-inset-bottom,0px))}
.quote-template-modal__footer .hx-form-actions{width:fit-content;max-width:100%;margin-left:auto;display:flex;justify-content:flex-end;align-items:center;gap:18px;padding:0}
.quote-template-modal__footer .btn{min-width:180px;min-height:56px;border-radius:20px;font-weight:800}
.quote-template-modal__footer .btn.primary{background:linear-gradient(135deg,#3563eb 0%,#4f83ff 100%);border:none;box-shadow:0 18px 32px rgba(59,130,246,.24)}
.quote-template-modal__footer .btn.ghost{background:#fff;border:1px solid rgba(15,23,42,.08);box-shadow:0 8px 18px rgba(15,23,42,.05)}
.quote-template-modal__brandblock{min-width:0;flex:1 1 auto}

.quote-templates-table--advanced [data-template-row].is-selected td{box-shadow:none !important}
.quote-templates-row.is-selected{background:rgba(59,130,246,.08)!important;box-shadow:0 0 0 1px rgba(59,130,246,.22) inset !important}
.quote-templates-row.is-selected:hover{background:rgba(59,130,246,.10)!important}
.quote-templates-table--advanced .quote-templates-cell--name .crm-name{font-size:1.16rem;line-height:1.18;margin-bottom:8px;font-weight:800;letter-spacing:-.015em}
.quote-templates-table--advanced .quote-templates-cell--name .crm-sub{font-size:.96rem;line-height:1.52;color:#64748b;max-width:62ch}
.quote-templates-table--advanced .quote-templates-cell--price,.quote-templates-table--advanced .quote-templates-cell--labor{font-size:1.02rem;font-weight:800}
.quote-templates-table--advanced thead th{font-size:.84rem;letter-spacing:.08em}
.quote-template-actions{gap:8px}
.qt-icon-btn{width:44px;height:44px;border-radius:14px}
.qt-icon-btn svg{width:20px;height:20px}

body:not(.light) .quote-template-modal{background:#fff !important;border:1px solid rgba(226,232,240,.95)!important;box-shadow:0 24px 60px rgba(15,23,42,.16)!important}
body:not(.light) .quote-template-modal__hero{background:#eef2f7 !important;border-bottom:1px solid rgba(148,163,184,.18)!important}
body:not(.light) .quote-template-modal__brandname,body:not(.light) .quote-template-modal__brandtag,body:not(.light) .quote-template-modal__copy h3,body:not(.light) .quote-template-modal__copy p{color:#0f172a !important}
body:not(.light) .quote-template-modal__body{background:linear-gradient(180deg,rgba(255,255,255,.995),rgba(247,249,255,.98)) !important;color:#0f172a !important}
body:not(.light) .quote-template-modal__footer{background:#eef2f7 !important}
body:not(.light) .quote-template-modal__close{background:#fff !important;color:#0f172a !important;border:1px solid rgba(148,163,184,.24)!important}

body:not(.light) .quote-templates-row.is-selected{background:#13283d !important;box-shadow:0 0 0 1px rgba(96,165,250,.35) inset !important}
body:not(.light) .quote-templates-row.is-selected:hover{background:#16324a !important}
body:not(.light) .quote-templates-cell .crm-name{font-size:1.08rem !important;font-weight:700 !important;letter-spacing:-0.01em;color:#f1f5f9 !important}
body:not(.light) .quote-templates-cell .crm-sub{font-size:0.92rem !important;color:#94a3b8 !important;line-height:1.5;margin-top:6px}
body:not(.light) .quote-templates-cell--price,body:not(.light) .quote-templates-cell--labor{font-size:1rem;font-weight:600;color:#e2e8f0 !important}
body:not(.light) .quote-templates-table thead th{font-size:0.75rem;letter-spacing:0.08em;color:#94a3b8 !important}

@media (max-width: 900px){
  .quote-template-modal-overlay{padding:12px;align-items:flex-end}
  .quote-template-modal{width:min(100vw - 20px,900px);max-height:min(92vh,100vh - 12px);border-radius:28px 28px 0 0}
  .quote-template-modal__headbar{padding:20px 20px 16px}
  .quote-template-modal__body{padding:20px 20px 22px}
  .quote-template-modal__footer .hx-form-actions{width:100%;display:flex;flex-direction:column-reverse;align-items:stretch;gap:12px}
  .quote-template-modal__footer .btn{width:100%;min-width:0}
}

/* V357 – Quote templates selection + typography + modal parity */
.quote-templates-table--advanced [data-template-row].is-selected td,
.quote-templates-table--advanced [data-template-row].is-selected .quote-templates-cell,
.quote-templates-table--advanced [data-template-row].is-selected .offertes-cell{
  box-shadow:none !important;
  outline:none !important;
  border-left:none !important;
  border-right:none !important;
}

.quote-templates-row.is-selected td{
  background:transparent !important;
}

.quote-templates-table--advanced .quote-templates-cell--name .crm-name{
  font-size:1.12rem;
  line-height:1.18;
  font-weight:800;
  letter-spacing:-0.018em;
}

.quote-templates-table--advanced .quote-templates-cell--name .crm-sub{
  font-size:.95rem;
  line-height:1.55;
  max-width:64ch;
}

.quote-templates-table--advanced thead th{
  font-size:.78rem;
  font-weight:800;
  letter-spacing:.09em;
}

.quote-templates-table--advanced .quote-templates-cell--price,
.quote-templates-table--advanced .quote-templates-cell--labor{
  font-variant-numeric:tabular-nums;
}

.quote-template-actions{
  gap:8px;
}

.qt-icon-btn{
  width:40px;
  height:40px;
  border-radius:12px;
}

.qt-icon-btn svg{
  width:18px;
  height:18px;
}

body:not(.light) .quote-templates-table--advanced [data-template-row].is-selected td,
body:not(.light) .quote-templates-table--advanced [data-template-row].is-selected .quote-templates-cell,
body:not(.light) .quote-templates-table--advanced [data-template-row].is-selected .offertes-cell{
  box-shadow:none !important;
  outline:none !important;
  border-left:none !important;
  border-right:none !important;
}

body:not(.light) .quote-templates-row.is-selected{
  background:#13283d !important;
  box-shadow:0 0 0 1px rgba(96,165,250,.35) inset, 0 10px 26px rgba(2,8,23,.18) !important;
}

body:not(.light) .quote-templates-row.is-selected:hover{
  background:#16324a !important;
}

body:not(.light) .quote-templates-row.is-selected td{
  background:transparent !important;
}

body:not(.light) .quote-templates-table--advanced .quote-templates-cell--name .crm-name{
  color:#f8fafc !important;
  font-size:1.08rem !important;
  font-weight:800 !important;
  letter-spacing:-.015em !important;
}

body:not(.light) .quote-templates-table--advanced .quote-templates-cell--name .crm-sub{
  color:#9bb0c7 !important;
  font-size:.93rem !important;
  line-height:1.55 !important;
}

body:not(.light) .quote-templates-table--advanced .quote-templates-cell--price,
body:not(.light) .quote-templates-table--advanced .quote-templates-cell--labor{
  color:#eef4ff !important;
  font-size:1rem !important;
  font-weight:700 !important;
}

body:not(.light) .quote-template-actions .qt-icon-btn{
  background:transparent !important;
  border:1px solid rgba(255,255,255,.08) !important;
  color:#9fb3c8 !important;
}

body:not(.light) .quote-template-actions .qt-icon-btn:hover{
  background:#12263a !important;
  border-color:rgba(255,255,255,.16) !important;
  color:#fff !important;
}

body:not(.light) .quote-template-actions .qt-icon-btn--danger{
  color:#f87171 !important;
  border-color:rgba(248,113,113,.35) !important;
}

body:not(.light) .quote-template-actions .qt-icon-btn--danger:hover{
  background:rgba(248,113,113,.10) !important;
  color:#fecaca !important;
}



/* =========================================
   HAVEXA PREMIUM TABLE SYSTEM
   users / offertes / quote-templates
   ========================================= */

:root{
  --hx-table-radius: 18px;
  --hx-table-radius-sm: 12px;
  --hx-table-gap: 12px;
  --hx-table-pad-y: 18px;
  --hx-table-pad-x: 18px;
  --hx-table-text: #0f172a;
  --hx-table-muted: #64748b;
  --hx-table-line: rgba(15,23,42,.06);
  --hx-table-hover: rgba(59,130,246,.06);
  --hx-table-selected: rgba(59,130,246,.10);
  --hx-table-selected-ring: rgba(59,130,246,.28);
  --hx-table-head-bg: rgba(255,255,255,.88);
  --hx-table-row-bg: rgba(255,255,255,.92);
  --hx-table-shadow: 0 10px 24px rgba(15,23,42,.05);
  --hx-table-shadow-hover: 0 14px 28px rgba(15,23,42,.08);
}

body:not(.light){
  --hx-table-text: #e5edf6;
  --hx-table-muted: #8ea4ba;
  --hx-table-line: rgba(255,255,255,.06);
  --hx-table-hover: rgba(96,165,250,.08);
  --hx-table-selected: rgba(59,130,246,.12);
  --hx-table-selected-ring: rgba(96,165,250,.34);
  --hx-table-head-bg: #102132;
  --hx-table-row-bg: #0f1e2d;
  --hx-table-shadow: none;
  --hx-table-shadow-hover: none;
}

.hvx-table-wrap,
.quote-templates-table-wrap,
.users-table-wrap,
.offertes-table-wrap{
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.hvx-table-shell,
.offertes-table,
.quote-templates-table,
.users-table{
  width: 100%;
  table-layout: fixed;
  border-collapse: separate !important;
  border-spacing: 0 var(--hx-table-gap) !important;
  background: transparent !important;
}

.hvx-table-shell thead,
.offertes-table thead,
.quote-templates-table thead,
.users-table thead{
  background: transparent !important;
}

.hvx-table-shell thead tr,
.offertes-table thead tr,
.quote-templates-table thead tr,
.users-table thead tr{
  background: var(--hx-table-head-bg) !important;
}

.hvx-table-shell thead th,
.offertes-table thead th,
.quote-templates-table thead th,
.users-table thead th{
  padding: 18px 20px !important;
  background: transparent !important;
  color: var(--hx-table-muted) !important;
  border: none !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: .08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.hvx-table-shell thead th:first-child,
.offertes-table thead th:first-child,
.quote-templates-table thead th:first-child,
.users-table thead th:first-child{
  border-top-left-radius: var(--hx-table-radius);
  border-bottom-left-radius: var(--hx-table-radius);
}

.hvx-table-shell thead th:last-child,
.offertes-table thead th:last-child,
.quote-templates-table thead th:last-child,
.users-table thead th:last-child{
  border-top-right-radius: var(--hx-table-radius);
  border-bottom-right-radius: var(--hx-table-radius);
}

.hvx-table-shell tbody tr,
.offertes-row,
.quote-templates-row,
.users-row,
.users-table tbody tr,
.quote-templates-table tbody tr,
.offertes-table tbody tr{
  background: var(--hx-table-row-bg) !important;
  box-shadow: var(--hx-table-shadow);
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.hvx-table-shell tbody tr:hover,
.offertes-row:hover,
.quote-templates-row:hover,
.users-row:hover,
.users-table tbody tr:hover,
.quote-templates-table tbody tr:hover,
.offertes-table tbody tr:hover{
  background: color-mix(in srgb, var(--hx-table-row-bg) 88%, #3b82f6 12%) !important;
  box-shadow: var(--hx-table-shadow-hover);
  transform: translateY(-1px);
}

.hvx-table-shell tbody td,
.offertes-table tbody td,
.quote-templates-table tbody td,
.users-table tbody td{
  padding: var(--hx-table-pad-y) var(--hx-table-pad-x) !important;
  border: none !important;
  vertical-align: middle;
  color: var(--hx-table-text) !important;
  background: transparent !important;
}

.hvx-table-shell tbody td:first-child,
.offertes-table tbody td:first-child,
.quote-templates-table tbody td:first-child,
.users-table tbody td:first-child{
  border-top-left-radius: var(--hx-table-radius);
  border-bottom-left-radius: var(--hx-table-radius);
}

.hvx-table-shell tbody td:last-child,
.offertes-table tbody td:last-child,
.quote-templates-table tbody td:last-child,
.users-table tbody td:last-child{
  border-top-right-radius: var(--hx-table-radius);
  border-bottom-right-radius: var(--hx-table-radius);
}

.table-title,
.crm-name,
.offerte-title,
.user-name{
  font-size: 1rem !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
  letter-spacing: -.01em;
  color: var(--hx-table-text) !important;
}

.table-sub,
.crm-sub,
.offerte-sub,
.user-sub{
  margin-top: 6px;
  font-size: .9rem !important;
  line-height: 1.5 !important;
  color: var(--hx-table-muted) !important;
}

.offertes-cell--price,
.offertes-cell--total,
.quote-templates-cell--price,
.quote-templates-cell--labor,
.billing-cell--amount,
.users-cell--quota{
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700 !important;
}

.badge-soft,
.offertes-status-badge,
.status-badge{
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px !important;
  border-radius: 999px !important;
  font-size: .82rem !important;
  font-weight: 800 !important;
  border: none !important;
  box-shadow: none !important;
}

.offertes-status-badge--approved,
.status-active{
  background: rgba(34,197,94,.16) !important;
  color: #22c55e !important;
}

.offertes-status-badge--draft,
.status-draft{
  background: rgba(251,191,36,.16) !important;
  color: #fbbf24 !important;
}

.offertes-status-badge--inactive,
.status-inactive{
  background: rgba(148,163,184,.16) !important;
  color: #94a3b8 !important;
}

.quote-template-actions,
.offerte-row-actions,
.user-row-actions,
.hvx-row-actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.qt-icon-btn,
.action-icon-btn,
.hvx-icon-btn{
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 1px solid var(--hx-table-line) !important;
  color: var(--hx-table-muted) !important;
  box-shadow: none !important;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.qt-icon-btn:hover,
.action-icon-btn:hover,
.hvx-icon-btn:hover{
  background: var(--hx-table-hover) !important;
  color: var(--hx-table-text) !important;
  transform: translateY(-1px);
}

.qt-icon-btn svg,
.action-icon-btn svg,
.hvx-icon-btn svg{
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.qt-icon-btn--danger,
.action-icon-btn--danger,
.hvx-icon-btn--danger{
  color: #ef4444 !important;
  border-color: rgba(239,68,68,.24) !important;
}

.qt-icon-btn--danger:hover,
.action-icon-btn--danger:hover,
.hvx-icon-btn--danger:hover{
  background: rgba(239,68,68,.10) !important;
  color: #fecaca !important;
}

.offertes-row.is-selected,
.quote-templates-row.is-selected,
.users-row.is-selected,
.hvx-table-shell tbody tr.is-selected{
  background: var(--hx-table-selected) !important;
  box-shadow: inset 0 0 0 1px var(--hx-table-selected-ring), var(--hx-table-shadow);
}

.offertes-row.is-selected:hover,
.quote-templates-row.is-selected:hover,
.users-row.is-selected:hover,
.hvx-table-shell tbody tr.is-selected:hover{
  background: color-mix(in srgb, var(--hx-table-selected) 84%, #3b82f6 16%) !important;
}

.offertes-checkbox,
.hvx-checkbox,
.users-checkbox{
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff !important;
  border: 1px solid rgba(15,23,42,.18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

body:not(.light) .offertes-checkbox,
body:not(.light) .hvx-checkbox,
body:not(.light) .users-checkbox{
  background: rgba(255,255,255,.06) !important;
  border-color: rgba(255,255,255,.22) !important;
  box-shadow: none;
}

.offertes-checkbox:hover,
.hvx-checkbox:hover,
.users-checkbox:hover{
  border-color: rgba(59,130,246,.45) !important;
}

.offertes-checkbox:checked,
.hvx-checkbox:checked,
.users-checkbox:checked{
  background: linear-gradient(135deg, #2563eb, #60a5fa) !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

body:not(.light) .offertes-checkbox:checked,
body:not(.light) .hvx-checkbox:checked,
body:not(.light) .users-checkbox:checked{
  box-shadow: none;
}

.offertes-checkbox:checked::after,
.hvx-checkbox:checked::after,
.users-checkbox:checked::after{
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid #fff;
  border-top: none;
  border-right: none;
  transform: rotate(-45deg);
}

.hvx-pagination,
.qt-pager,
.users-pager,
.offertes-pager{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 4px;
}

.hvx-pagination .btn,
.qt-pager .btn,
.users-pager .btn,
.offertes-pager .btn{
  border-radius: 10px !important;
}

.offertes-row,
.quote-templates-row,
.users-row{
  cursor: default !important;
}

@media (max-width: 1100px){
  .qt-summary--modern,
  .users-summary,
  .offertes-summary{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
}

@media (max-width: 760px){
  .hvx-table-shell,
  .offertes-table,
  .quote-templates-table,
  .users-table{
    display: block;
    overflow-x: auto;
  }

  .quote-template-actions,
  .offerte-row-actions,
  .user-row-actions,
  .hvx-row-actions{
    justify-content: flex-start;
  }
}


/* ===== HAVEXA NEXT LEVEL TABLES V362 ===== */
:root{
  --hx-table-radius: 18px;
  --hx-table-gap: 12px;
  --hx-table-pad-y: 18px;
  --hx-table-pad-x: 18px;
  --hx-table-text: #0f172a;
  --hx-table-muted: #64748b;
  --hx-table-line: rgba(15,23,42,.06);
  --hx-table-hover: rgba(59,130,246,.06);
  --hx-table-selected: rgba(59,130,246,.10);
  --hx-table-selected-ring: rgba(59,130,246,.28);
  --hx-table-head-bg: rgba(255,255,255,.88);
  --hx-table-row-bg: rgba(255,255,255,.92);
  --hx-table-shadow: 0 10px 24px rgba(15,23,42,.05);
  --hx-table-shadow-hover: 0 14px 28px rgba(15,23,42,.08);
}
body:not(.light){
  --hx-table-text: #e5edf6;
  --hx-table-muted: #8ea4ba;
  --hx-table-line: rgba(255,255,255,.06);
  --hx-table-hover: rgba(96,165,250,.08);
  --hx-table-selected: rgba(59,130,246,.12);
  --hx-table-selected-ring: rgba(96,165,250,.34);
  --hx-table-head-bg: #102132;
  --hx-table-row-bg: #0f1e2d;
  --hx-table-shadow: none;
  --hx-table-shadow-hover: none;
}
.hvx-table-shell,.offertes-table,.quote-templates-table,.users-table{width:100%;table-layout:fixed;border-collapse:separate !important;border-spacing:0 var(--hx-table-gap) !important;background:transparent !important;}
.hvx-table-shell thead tr,.offertes-table thead tr,.quote-templates-table thead tr,.users-table thead tr{background:var(--hx-table-head-bg) !important;}
.hvx-table-shell thead th,.offertes-table thead th,.quote-templates-table thead th,.users-table thead th{padding:18px 20px !important;color:var(--hx-table-muted) !important;border:none !important;font-size:12px !important;font-weight:800 !important;letter-spacing:.08em;text-transform:uppercase;}
.hvx-table-shell tbody tr,.offertes-row,.quote-templates-row,.users-row{background:var(--hx-table-row-bg) !important;box-shadow:var(--hx-table-shadow);transition:background .16s ease, transform .16s ease, box-shadow .16s ease;}
.hvx-table-shell tbody tr:hover,.offertes-row:hover,.quote-templates-row:hover,.users-row:hover{background:color-mix(in srgb, var(--hx-table-row-bg) 88%, #3b82f6 12%) !important;box-shadow:var(--hx-table-shadow-hover);transform:translateY(-1px);}
.hvx-table-shell tbody td,.offertes-table tbody td,.quote-templates-table tbody td,.users-table tbody td{padding:var(--hx-table-pad-y) var(--hx-table-pad-x) !important;border:none !important;color:var(--hx-table-text) !important;background:transparent !important;}
.table-title,.crm-name,.offerte-title,.user-name{font-size:1rem !important;line-height:1.2 !important;font-weight:800 !important;letter-spacing:-.01em;color:var(--hx-table-text) !important;}
.table-sub,.crm-sub,.offerte-sub,.user-sub{margin-top:6px;font-size:.9rem !important;line-height:1.5 !important;color:var(--hx-table-muted) !important;}
.offertes-row.is-selected,.quote-templates-row.is-selected,.users-row.is-selected{background:var(--hx-table-selected) !important;box-shadow:inset 0 0 0 1px var(--hx-table-selected-ring), var(--hx-table-shadow);}
.offertes-checkbox,.hvx-checkbox,.users-checkbox{appearance:none;width:18px;height:18px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;background:#fff !important;border:1px solid rgba(15,23,42,.18) !important;box-shadow:inset 0 1px 0 rgba(255,255,255,.8);}
body:not(.light) .offertes-checkbox,body:not(.light) .hvx-checkbox,body:not(.light) .users-checkbox{background:rgba(255,255,255,.06) !important;border-color:rgba(255,255,255,.22) !important;box-shadow:none;}
.offertes-checkbox:checked,.hvx-checkbox:checked,.users-checkbox:checked{background:linear-gradient(135deg, #2563eb, #60a5fa) !important;border-color:#2563eb !important;box-shadow:0 0 0 3px rgba(59,130,246,.12);}
.offertes-checkbox:checked::after,.hvx-checkbox:checked::after,.users-checkbox:checked::after{content:"";width:9px;height:5px;border:2px solid #fff;border-top:none;border-right:none;transform:rotate(-45deg);}
.hvx-pagination,.qt-pager,.users-pager,.offertes-pager{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:18px;padding-top:4px;}
.offertes-row,.quote-templates-row,.users-row{cursor:default !important;}


/* V363 – quote template modal dark mode */
body:not(.light) .quote-template-modal-overlay{
  background: rgba(2,6,23,.72) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
body:not(.light) .quote-template-modal{
  background:
    radial-gradient(820px 220px at 0% 0%, rgba(59,130,246,.16), transparent 55%),
    linear-gradient(135deg, #0f172a, #1e293b 52%, #1d4ed8 140%) !important;
  border:1px solid rgba(255,255,255,.10)!important;
  box-shadow:0 34px 90px rgba(2,8,23,.42)!important;
  color:#e6edf3!important;
}
body:not(.light) .quote-template-modal__hero{
  background:transparent !important;
  border-bottom:1px solid rgba(255,255,255,.08)!important;
}
body:not(.light) .quote-template-modal__brandname,
body:not(.light) .quote-template-modal__brandtag,
body:not(.light) .quote-template-modal__copy h3{
  color:#ffffff !important;
}
body:not(.light) .quote-template-modal__copy p{
  color:rgba(226,232,240,.78) !important;
}
body:not(.light) .quote-template-modal__close{
  background:rgba(255,255,255,.10)!important;
  color:#ffffff!important;
  border:1px solid rgba(255,255,255,.14)!important;
  box-shadow:none!important;
}
body:not(.light) .quote-template-modal__close:hover{
  background:rgba(255,255,255,.16)!important;
}
body:not(.light) .quote-template-modal__body{
  background:transparent !important;
  color:#e6edf3 !important;
}
body:not(.light) .quote-template-modal__form label,
body:not(.light) .quote-template-modal__form label span,
body:not(.light) .quote-template-modal__checkbox-row{
  color:#dbe7f3 !important;
}
body:not(.light) .quote-template-modal__form input,
body:not(.light) .quote-template-modal__form select,
body:not(.light) .quote-template-modal__form textarea{
  background:rgba(15,23,42,.82)!important;
  color:#f8fafc!important;
  border:1px solid rgba(148,163,184,.18)!important;
  box-shadow:none!important;
}
body:not(.light) .quote-template-modal__form input::placeholder,
body:not(.light) .quote-template-modal__form textarea::placeholder{
  color:#8ea4ba!important;
}
body:not(.light) .quote-template-modal__form input:focus,
body:not(.light) .quote-template-modal__form select:focus,
body:not(.light) .quote-template-modal__form textarea:focus{
  outline:none!important;
  border-color:rgba(96,165,250,.46)!important;
  box-shadow:0 0 0 4px rgba(59,130,246,.14)!important;
}
body:not(.light) .quote-template-modal__footer{
  background:rgba(15,23,42,.38)!important;
  border-top:1px solid rgba(255,255,255,.08)!important;
}
body:not(.light) .quote-template-modal__footer .btn.ghost{
  background:rgba(255,255,255,.06)!important;
  color:#f8fafc!important;
  border:1px solid rgba(255,255,255,.10)!important;
  box-shadow:none!important;
}
body:not(.light) .quote-template-modal__footer .btn.ghost:hover{
  background:rgba(255,255,255,.10)!important;
  border-color:rgba(255,255,255,.16)!important;
}
body:not(.light) .quote-template-modal__footer .btn.primary{
  background:linear-gradient(135deg, #3b82f6 0%, #7cb4ff 100%) !important;
  color:#ffffff!important;
  border:none!important;
  box-shadow:0 16px 30px rgba(59,130,246,.26)!important;
}
body:not(.light) .quote-template-modal input[type="number"]{
  color-scheme: dark;
}



/* ===== v390 injected global modal v389 CSS so it is actually loaded ===== */
/* v389 - force all dark mode modals to exact quote-template modal style */

body:not(.light) {
  --hx-qt-modal-bg:
    radial-gradient(820px 220px at 0% 0%, rgba(59,130,246,.16), transparent 55%),
    linear-gradient(135deg, #0f172a, #1e293b 52%, #1d4ed8 140%);
  --hx-qt-modal-text: #e6edf3;
  --hx-qt-modal-text-strong: #ffffff;
  --hx-qt-modal-text-muted: rgba(226,232,240,.78);
  --hx-qt-modal-line: rgba(255,255,255,.08);
  --hx-qt-modal-input-bg: rgba(15,23,42,.82);
  --hx-qt-modal-input-border: rgba(148,163,184,.18);
  --hx-qt-modal-focus: rgba(96,165,250,.46);
}

body:not(.light) .modal-overlay,
body:not(.light) .hx-modal-overlay,
body:not(.light) .profile-modal-overlay,
body:not(.light) .logout-confirm-modal,
body:not(.light) .delete-modal {
  background: rgba(2,6,23,.72) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

body:not(.light) .profile-modal-shell,
body:not(.light) .hx-modal-shell,
body:not(.light) .user-modal,
body:not(.light) .crm-modal,
body:not(.light) .logout-confirm-card,
body:not(.light) .delete-modal-card,
body:not(.light) .hx-confirm-delete-shell,
body:not(.light) .material-modal,
body:not(.light) .supplier-modal,
body:not(.light) .offer-modal,
body:not(.light) .users-modal,
body:not(.light) .quote-template-modal,
body:not(.light) .qt-modal,
body:not(.light) #quoteTemplateModal .profile-modal-shell,
body:not(.light) #profileEditModal .profile-modal-shell {
  background: var(--hx-qt-modal-bg) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 34px 90px rgba(2,8,23,.42) !important;
  color: var(--hx-qt-modal-text) !important;
  border-radius: 28px !important;
  overflow: hidden !important;
}

body:not(.light) .profile-modal-hero,
body:not(.light) .hx-modal-header,
body:not(.light) .crm-modal-head,
body:not(.light) .crm-modal-header,
body:not(.light) .user-modal-hero,
body:not(.light) .logout-confirm-head,
body:not(.light) .delete-modal-header,
body:not(.light) .hx-confirm-delete-hero,
body:not(.light) .material-modal .modal-header,
body:not(.light) .supplier-modal .modal-header,
body:not(.light) .offer-modal .modal-header,
body:not(.light) .users-modal .modal-header {
  background: transparent !important;
  border-bottom: 1px solid var(--hx-qt-modal-line) !important;
  color: var(--hx-qt-modal-text-strong) !important;
  box-shadow: none !important;
}

body:not(.light) .profile-modal-copy h3,
body:not(.light) .hx-modal-header h1,
body:not(.light) .hx-modal-header h2,
body:not(.light) .hx-modal-header h3,
body:not(.light) .crm-edit-hero h1,
body:not(.light) .crm-edit-hero h2,
body:not(.light) .crm-edit-hero h3,
body:not(.light) .logout-confirm-body h3,
body:not(.light) .delete-modal-copy h3,
body:not(.light) .hx-confirm-delete-copy h3,
body:not(.light) .modal-header h1,
body:not(.light) .modal-header h2,
body:not(.light) .modal-header h3 {
  color: var(--hx-qt-modal-text-strong) !important;
}

body:not(.light) .profile-modal-copy p,
body:not(.light) .hx-modal-header p,
body:not(.light) .crm-edit-hero p,
body:not(.light) .logout-confirm-body p,
body:not(.light) .delete-modal-copy p,
body:not(.light) .hx-confirm-delete-copy p,
body:not(.light) .modal-header p {
  color: var(--hx-qt-modal-text-muted) !important;
}

body:not(.light) .profile-modal-body,
body:not(.light) .hx-modal-body,
body:not(.light) .logout-confirm-body,
body:not(.light) .delete-modal-body,
body:not(.light) .hx-confirm-delete-body,
body:not(.light) .modal-body {
  background: transparent !important;
  color: var(--hx-qt-modal-text) !important;
}

body:not(.light) #profileEditModal .profile-modal-shell,
body:not(.light) #profileEditModal .profile-modal-hero,
body:not(.light) #profileEditModal .profile-modal-body,
body:not(.light) #profileEditModal .profile-modal-footer {
  background: unset !important;
}

body:not(.light) #profileEditModal .profile-modal-shell {
  background: var(--hx-qt-modal-bg) !important;
}

body:not(.light) #profileEditModal .profile-modal-hero {
  background: transparent !important;
  border-bottom: 1px solid var(--hx-qt-modal-line) !important;
}

body:not(.light) #profileEditModal .profile-modal-body {
  background: transparent !important;
}

body:not(.light) #profileEditModal .profile-modal-footer {
  background: rgba(15,23,42,.38) !important;
  border-top: 1px solid var(--hx-qt-modal-line) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

body:not(.light) .hx-form-section,
body:not(.light) .hx-profile-summary,
body:not(.light) .audit-trail__item,
body:not(.light) .panel,
body:not(.light) .card,
body:not(.light) .widget {
  background: rgba(255,255,255,.05) !important;
  border: 1px solid var(--hx-qt-modal-line) !important;
  box-shadow: none !important;
  color: var(--hx-qt-modal-text) !important;
}

body:not(.light) label,
body:not(.light) label span,
body:not(.light) .hx-form-section__title,
body:not(.light) .hx-form-section__desc,
body:not(.light) .profile-section-title,
body:not(.light) .profile-section-desc,
body:not(.light) .profile-summary-email,
body:not(.light) .hx-profile-summary__copy strong {
  color: #dbe7f3 !important;
  -webkit-text-fill-color: #dbe7f3 !important;
  text-shadow: none !important;
  filter: none !important;
}

body:not(.light) .hx-form-section__desc,
body:not(.light) .profile-section-desc,
body:not(.light) .profile-summary-email {
  color: var(--hx-qt-modal-text-muted) !important;
  -webkit-text-fill-color: var(--hx-qt-modal-text-muted) !important;
}

body:not(.light) input,
body:not(.light) textarea,
body:not(.light) select {
  background: var(--hx-qt-modal-input-bg) !important;
  color: #f8fafc !important;
  border: 1px solid var(--hx-qt-modal-input-border) !important;
  box-shadow: none !important;
}

body:not(.light) input::placeholder,
body:not(.light) textarea::placeholder {
  color: #8ea4ba !important;
}

body:not(.light) input:focus,
body:not(.light) textarea:focus,
body:not(.light) select:focus {
  outline: none !important;
  border-color: var(--hx-qt-modal-focus) !important;
  box-shadow: 0 0 0 4px rgba(59,130,246,.14) !important;
}

body:not(.light) input[type="checkbox"] {
  accent-color: #60a5fa;
}

body:not(.light) .profile-modal-footer,
body:not(.light) .hx-modal-footer,
body:not(.light) .logout-confirm-actions,
body:not(.light) .hx-confirm-delete-footer,
body:not(.light) .modal-footer {
  background: rgba(15,23,42,.38) !important;
  border-top: 1px solid var(--hx-qt-modal-line) !important;
}

body:not(.light) .btn.ghost {
  background: rgba(255,255,255,.06) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: none !important;
}

body:not(.light) .btn.ghost:hover {
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.16) !important;
}

body:not(.light) .btn.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #7cb4ff 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 16px 30px rgba(59,130,246,.26) !important;
}

body:not(.light) .profile-modal-close,
body:not(.light) .hx-modal-header-close,
body:not(.light) .crm-modal-header-close,
body:not(.light) .user-modal-header-close,
body:not(.light) .logout-confirm-close,
body:not(.light) .delete-modal-close,
body:not(.light) .hx-confirm-delete-close,
body:not(.light) .modal-close {
  background: rgba(255,255,255,.10) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: none !important;
}

body:not(.light) .profile-modal-close:hover,
body:not(.light) .hx-modal-header-close:hover,
body:not(.light) .crm-modal-header-close:hover,
body:not(.light) .user-modal-header-close:hover,
body:not(.light) .logout-confirm-close:hover,
body:not(.light) .delete-modal-close:hover,
body:not(.light) .hx-confirm-delete-close:hover,
body:not(.light) .modal-close:hover {
  background: rgba(255,255,255,.16) !important;
}

body:not(.light) input[type="number"] {
  color-scheme: dark;
}
/* v391 - unify dark mode modal finish for offerte / leveranciers / users to quote-template modal */
body:not(.light) .quote-create-backdrop,
body:not(.light) .user-modal-overlay,
body:not(.light) .supplier-modal-overlay{
  background: rgba(2,6,23,.72) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

body:not(.light) .quote-edit-modal,
body:not(.light) .supplier-modal,
body:not(.light) .user-modal{
  background: var(--hx-qt-modal-bg) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 34px 90px rgba(2,8,23,.42) !important;
  color: var(--hx-qt-modal-text) !important;
}

body:not(.light) .quote-edit-modal .crm-modal-hero,
body:not(.light) .quote-edit-modal .crm-modal-headbar,
body:not(.light) .supplier-modal-hero,
body:not(.light) .supplier-modal-headbar,
body:not(.light) .user-modal-hero,
body:not(.light) .user-modal-headbar{
  background: transparent !important;
  border-bottom-color: var(--hx-qt-modal-line) !important;
  box-shadow: none !important;
}

body:not(.light) .quote-edit-modal :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle),
body:not(.light) .supplier-modal :is(.supplier-brand-name,.supplier-brand-tag,.supplier-modal-copy h3,.hx-modal-subtitle),
body:not(.light) .user-modal :is(.user-brand-name,.user-brand-tag,.user-modal-copy h3,.hx-modal-subtitle){
  color: var(--hx-qt-modal-text-strong) !important;
}

body:not(.light) .quote-edit-modal .hx-modal-subtitle,
body:not(.light) .supplier-modal .hx-modal-subtitle,
body:not(.light) .user-modal .hx-modal-subtitle,
body:not(.light) .supplier-modal .supplier-modal-copy p,
body:not(.light) .user-modal .user-modal-copy p{
  color: var(--hx-qt-modal-text-muted) !important;
}

body:not(.light) .quote-edit-modal .crm-modal-close,
body:not(.light) .supplier-modal .supplier-modal-close,
body:not(.light) .user-modal .user-modal-close{
  background: rgba(255,255,255,.10) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  box-shadow: none !important;
}

body:not(.light) .quote-edit-modal .crm-modal-close:hover,
body:not(.light) .supplier-modal .supplier-modal-close:hover,
body:not(.light) .user-modal .user-modal-close:hover{
  background: rgba(255,255,255,.16) !important;
}

body:not(.light) .quote-edit-modal .crm-modal-body,
body:not(.light) .supplier-modal .supplier-modal-body,
body:not(.light) .user-modal .user-modal-body,
body:not(.light) .quote-edit-modal .quote-modal-footer,
body:not(.light) .supplier-modal .supplier-modal-footer,
body:not(.light) .user-modal .user-modal-footer{
  background: transparent !important;
  color: var(--hx-qt-modal-text) !important;
}

body:not(.light) .quote-edit-modal .quote-modal-footer,
body:not(.light) .supplier-modal .supplier-modal-footer,
body:not(.light) .user-modal .user-modal-footer{
  background: rgba(15,23,42,.38) !important;
  border-top: 1px solid var(--hx-qt-modal-line) !important;
}

body:not(.light) .quote-edit-modal .quote-create-card,
body:not(.light) .quote-edit-modal .quote-margin-panel,
body:not(.light) .quote-edit-modal .calc-box,
body:not(.light) .supplier-modal .hx-form-section,
body:not(.light) .user-modal .hx-form-section{
  background: rgba(255,255,255,.05) !important;
  border: 1px solid var(--hx-qt-modal-line) !important;
  box-shadow: none !important;
  color: var(--hx-qt-modal-text) !important;
}

body:not(.light) .quote-edit-modal :is(label,strong,.crm-sub,.card-head h3,.badge-soft),
body:not(.light) .supplier-modal :is(label,label span,.hx-form-section__title,.supplier-modal-note),
body:not(.light) .user-modal :is(label,label span,.hx-form-section__title,.user-modal-note){
  color: #dbe7f3 !important;
  -webkit-text-fill-color: #dbe7f3 !important;
}

body:not(.light) .quote-edit-modal :is(.crm-sub,.badge-soft),
body:not(.light) .supplier-modal :is(.hx-form-section__desc,.supplier-modal-note),
body:not(.light) .user-modal :is(.hx-form-section__desc,.user-modal-note){
  color: var(--hx-qt-modal-text-muted) !important;
  -webkit-text-fill-color: var(--hx-qt-modal-text-muted) !important;
}

body:not(.light) .quote-edit-modal input,
body:not(.light) .quote-edit-modal select,
body:not(.light) .quote-edit-modal textarea,
body:not(.light) .supplier-modal input,
body:not(.light) .supplier-modal select,
body:not(.light) .supplier-modal textarea,
body:not(.light) .user-modal input,
body:not(.light) .user-modal select,
body:not(.light) .user-modal textarea{
  background: var(--hx-qt-modal-input-bg) !important;
  color: #f8fafc !important;
  border: 1px solid var(--hx-qt-modal-input-border) !important;
  box-shadow: none !important;
}

body:not(.light) .quote-edit-modal input::placeholder,
body:not(.light) .quote-edit-modal textarea::placeholder,
body:not(.light) .supplier-modal input::placeholder,
body:not(.light) .supplier-modal textarea::placeholder,
body:not(.light) .user-modal input::placeholder,
body:not(.light) .user-modal textarea::placeholder{
  color: #8ea4ba !important;
}

body:not(.light) .quote-edit-modal input:focus,
body:not(.light) .quote-edit-modal select:focus,
body:not(.light) .quote-edit-modal textarea:focus,
body:not(.light) .supplier-modal input:focus,
body:not(.light) .supplier-modal select:focus,
body:not(.light) .supplier-modal textarea:focus,
body:not(.light) .user-modal input:focus,
body:not(.light) .user-modal select:focus,
body:not(.light) .user-modal textarea:focus{
  outline: none !important;
  border-color: var(--hx-qt-modal-focus) !important;
  box-shadow: 0 0 0 4px rgba(59,130,246,.14) !important;
}

body:not(.light) .quote-edit-modal .quote-modal-footer .btn.ghost,
body:not(.light) .supplier-modal .supplier-modal-footer .btn.ghost,
body:not(.light) .user-modal .user-modal-footer .btn.ghost{
  background: rgba(255,255,255,.06) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: none !important;
}

body:not(.light) .quote-edit-modal .quote-modal-footer .btn.ghost:hover,
body:not(.light) .supplier-modal .supplier-modal-footer .btn.ghost:hover,
body:not(.light) .user-modal .user-modal-footer .btn.ghost:hover{
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(255,255,255,.16) !important;
}

body:not(.light) .quote-edit-modal .quote-modal-footer .btn.primary,
body:not(.light) .supplier-modal .supplier-modal-footer .btn.primary,
body:not(.light) .user-modal .user-modal-footer .btn.primary{
  background: linear-gradient(135deg, #3b82f6 0%, #7cb4ff 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 16px 30px rgba(59,130,246,.26) !important;
}

/* v402 - hide remaining top white rim on supplier modal in dark mode */
body:not(.light) .supplier-modal{
  position:relative !important;
}
body:not(.light) .supplier-modal::before{
  content:"";
  position:absolute;
  top:0;
  left:18px;
  right:18px;
  height:1px;
  background:linear-gradient(90deg, rgba(15,23,42,.92), rgba(30,41,59,.92) 55%, rgba(30,64,175,.84));
  pointer-events:none;
  z-index:3;
}

/* v404 - darken only the supplier modal top outer border to match quote-template modal */
body:not(.light) .supplier-modal{
  border-top-color: rgba(100,116,139,.26) !important;
}
body:not(.light) .supplier-modal::before{
  top:1px !important;
  left:20px !important;
  right:20px !important;
  background: linear-gradient(90deg, rgba(15,23,42,.78), rgba(30,41,59,.78) 55%, rgba(30,64,175,.72)) !important;
  opacity: 1 !important;
}

/* v405 - supplier modal: cover exposed top shell rim in dark mode to match quote-template modal */
body:not(.light) .supplier-modal{
  overflow:hidden !important;
}
body:not(.light) .supplier-modal .supplier-modal-hero{
  position:relative !important;
  z-index:1 !important;
  margin-top:-1px !important;
  margin-left:-1px !important;
  margin-right:-1px !important;
  width:calc(100% + 2px) !important;
  border-top-left-radius:28px !important;
  border-top-right-radius:28px !important;
  background:var(--hx-qt-modal-bg) !important;
  border-top:none !important;
}
body:not(.light) .supplier-modal .supplier-modal-hero::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:2px;
  background:var(--hx-qt-modal-bg) !important;
  pointer-events:none;
  z-index:2;
}

/* v407 - supplier modal dark mode: remove bright top shell rim completely */
body:not(.light) #supplierModal .supplier-modal{
  border-top-color: transparent !important;
}
body:not(.light) #supplierModal .supplier-modal-hero{
  margin-top: -1px !important;
  padding-top: 0 !important;
  background: var(--hx-qt-modal-bg) !important;
}
body:not(.light) #supplierModal .supplier-modal-hero::before{
  display: none !important;
  content: none !important;
}

/* v423 - mobile layout refinement pass */
@media (max-width: 900px){
  .shell{
    display:block !important;
  }

  .topbar{
    position:sticky !important;
    top:0 !important;
    z-index:1100 !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
    padding:12px 14px !important;
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
  }

  .topbar-left{
    width:100% !important;
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px !important;
    min-width:0 !important;
  }

  .mobile-menu-toggle,
  .topbar-user,
  .topbar .btn,
  .topbar .inline-form .btn,
  .topnav .btn{
    min-height:44px !important;
    border-radius:14px !important;
  }

  .topnav{
    width:100% !important;
    display:flex !important;
    align-items:center !important;
    flex-wrap:nowrap !important;
    gap:8px !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    padding:2px 1px 6px !important;
    scrollbar-width:none;
  }

  .topnav::-webkit-scrollbar{
    display:none;
  }

  .topnav > *{
    flex:0 0 auto !important;
  }

  .content,
  .shell > .content,
  body.light .shell > .content{
    padding:14px 12px 28px !important;
    margin-left:0 !important;
    min-width:0 !important;
  }

  .panel,
  .kpi-card,
  .plan-card,
  .form-card,
  .calc-box,
  .table-wrap,
  .hvx-table-wrap,
  .users-table-wrap,
  .offertes-table-wrap,
  .quote-templates-table-wrap{
    border-radius:18px !important;
  }

  .page-head,
  .row-between,
  .page-head.row-between{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:12px !important;
  }

  .page-head > div,
  .row-between > div,
  .page-head.row-between > div{
    width:100% !important;
  }

  .page-head h1,
  .page-head h2,
  .row-between h1{
    font-size:clamp(1.45rem, 5vw, 1.95rem) !important;
    line-height:1.12 !important;
  }

  .kpi-grid,
  .plans-grid,
  .charts-grid,
  .glass-kpis,
  .analytics-kpis,
  .dashboard-kpis,
  .roof-loading-grid,
  .roof-compare-grid,
  .roof-tech-grid,
  .pv-kpis{
    grid-template-columns:1fr !important;
  }

  .form-grid,
  .form-row-2,
  .crm-grid,
  .glass-list-row,
  .qt-toolbar,
  .roof-toolbar,
  .roof-cad-toolbar,
  .users-toolbar,
  .crm-toolbar,
  .material-filters,
  .supplier-filters,
  .translation-admin-toolbar,
  .translation-admin-toolbar form{
    grid-template-columns:1fr !important;
    display:grid !important;
    gap:10px !important;
  }

  .users-toolbar > *,
  .crm-toolbar > *,
  .material-filters > *,
  .supplier-filters > *,
  .qt-toolbar > *,
  .roof-toolbar > *,
  .roof-cad-toolbar > *,
  .translation-admin-toolbar > *,
  .translation-admin-toolbar form > *{
    width:100% !important;
    min-width:0 !important;
  }

  .table-wrap,
  .hvx-table-wrap,
  .users-table-wrap,
  .offertes-table-wrap,
  .quote-templates-table-wrap,
  .translation-admin-table-wrap{
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch !important;
    padding-bottom:6px !important;
  }

  .table,
  table.table,
  .quote-templates-table--advanced,
  .users-table,
  .offertes-table,
  .hvx-table{
    min-width:760px !important;
  }

  .table th,
  .table td,
  table th,
  table td{
    white-space:nowrap;
  }

  .btn-group,
  .inline-actions,
  .table-actions,
  .users-table-actions,
  .crm-table-actions{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:8px !important;
  }

  .sidebar{
    width:min(88vw, 332px) !important;
    border-radius:0 20px 20px 0 !important;
  }
}

@media (max-width: 640px){
  .topbar{
    padding:10px 12px !important;
    gap:8px !important;
  }

  .content,
  .shell > .content,
  body.light .shell > .content{
    padding:12px 10px 24px !important;
  }

  .panel,
  .kpi-card,
  .plan-card,
  .form-card,
  .calc-box,
  .table-wrap,
  .hvx-table-wrap,
  .users-table-wrap,
  .offertes-table-wrap,
  .quote-templates-table-wrap{
    border-radius:16px !important;
  }

  .sidebar{
    width:min(92vw, 320px) !important;
  }

  .modal-overlay .modal,
  .modal-overlay .modal-card,
  .hx-modal{
    max-height:min(94vh, 94dvh) !important;
  }

  .table,
  table.table,
  .quote-templates-table--advanced,
  .users-table,
  .offertes-table,
  .hvx-table{
    min-width:680px !important;
  }
}

/* v435 - crm dark modal header bottom border match quote-templates */
body:not(.light) .crm-modal .crm-modal-hero{
  background: transparent !important;
  border-bottom: 1px solid var(--hx-qt-modal-line) !important;
  box-shadow: inset 0 -1px 0 var(--hx-qt-modal-line) !important;
}

body:not(.light) .crm-modal .crm-modal-headbar,
body:not(.light) .crm-modal .crm-modal-top,
body:not(.light) .crm-modal .crm-modal-copy{
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
}

body:not(.light) .crm-modal .crm-modal-body{
  background: transparent !important;
  border-top: 0 !important;
  box-shadow: none !important;
}

/* v443 - mobile proof modal headers and datagrids */
@media (max-width: 760px){
  :root{
    --hx-mobile-safe-x: max(12px, env(safe-area-inset-left));
    --hx-mobile-safe-r: max(12px, env(safe-area-inset-right));
  }

  .modal-overlay,
  .hx-modal-overlay,
  .profile-modal-overlay,
  .quote-template-modal__backdrop,
  .crm-modal-overlay,
  .user-modal-overlay,
  .supplier-modal-overlay{
    align-items:flex-end !important;
    padding:10px var(--hx-mobile-safe-r) max(10px, env(safe-area-inset-bottom)) var(--hx-mobile-safe-x) !important;
    overflow:hidden !important;
  }

  .profile-modal-shell,
  .hx-modal-shell,
  .user-modal,
  .crm-modal,
  .supplier-modal,
  .material-modal,
  .offer-modal,
  .users-modal,
  .quote-template-modal,
  .qt-modal,
  .modal-card,
  .delete-modal-card,
  .hx-confirm-delete-shell{
    width:100% !important;
    max-width:100% !important;
    max-height:min(92vh, 92dvh) !important;
    border-radius:22px 22px 18px 18px !important;
    overflow:hidden !important;
  }

  .profile-modal-hero,
  .user-modal-hero,
  .supplier-modal-hero,
  .crm-modal-hero,
  .quote-template-modal__hero,
  .hx-modal-header,
  .material-modal .modal-header,
  .offer-modal .modal-header,
  .users-modal .modal-header,
  .delete-modal-header,
  .hx-confirm-delete-hero{
    min-height:unset !important;
    padding:14px 16px !important;
    gap:10px !important;
  }

  .profile-modal-hero-main,
  .user-modal-hero-main,
  .supplier-modal-hero-main,
  .crm-modal-hero-main,
  .quote-template-modal__hero-main{
    min-height:unset !important;
    gap:10px !important;
    align-items:center !important;
  }

  .profile-modal-avatar,
  .user-modal-avatar,
  .supplier-modal-avatar,
  .crm-modal-avatar,
  .quote-template-modal__icon,
  .hx-modal-icon,
  .modal-brand-icon,
  .delete-modal-icon,
  .hx-confirm-delete-icon{
    width:42px !important;
    height:42px !important;
    min-width:42px !important;
    border-radius:14px !important;
  }

  .profile-modal-copy h3,
  .user-modal-hero h3,
  .supplier-modal-hero h3,
  .crm-modal-hero h3,
  .quote-template-modal__hero h3,
  .hx-modal-header h1,
  .hx-modal-header h2,
  .hx-modal-header h3,
  .modal-header h1,
  .modal-header h2,
  .modal-header h3{
    font-size:1.05rem !important;
    line-height:1.15 !important;
    margin:0 !important;
  }

  .profile-modal-copy p,
  .user-modal-hero p,
  .supplier-modal-hero p,
  .crm-modal-hero p,
  .quote-template-modal__hero p,
  .hx-modal-header p,
  .modal-header p{
    font-size:.82rem !important;
    line-height:1.3 !important;
    margin-top:3px !important;
    display:-webkit-box !important;
    -webkit-line-clamp:2 !important;
    -webkit-box-orient:vertical !important;
    overflow:hidden !important;
  }

  .profile-modal-close,
  .user-modal-close,
  .supplier-modal-close,
  .crm-modal-close,
  .quote-template-modal__close,
  .modal-close,
  .hx-modal-close{
    width:38px !important;
    height:38px !important;
    min-width:38px !important;
  }

  .profile-modal-body,
  .hx-modal-body,
  .modal-body,
  .quote-template-modal__body,
  .crm-modal-body,
  .user-modal-body,
  .supplier-modal-body{
    max-height:calc(92dvh - 138px) !important;
    overflow:auto !important;
    -webkit-overflow-scrolling:touch !important;
    padding:14px !important;
  }

  .profile-modal-footer,
  .hx-modal-footer,
  .modal-actions,
  .quote-template-modal__footer{
    padding:12px 14px max(12px, env(safe-area-inset-bottom)) !important;
    gap:8px !important;
    flex-wrap:wrap !important;
  }

  .profile-modal-footer .btn,
  .hx-modal-footer .btn,
  .modal-actions .btn,
  .quote-template-modal__footer .btn{
    flex:1 1 140px !important;
    min-height:42px !important;
  }

  .table-wrap,
  .hvx-table-wrap,
  .users-table-wrap,
  .offertes-table-wrap,
  .quote-templates-table-wrap,
  .materials-table-wrap,
  .material-table-wrap,
  .crm-table-wrap,
  .supplier-table-wrap{
    margin-left:-2px !important;
    margin-right:-2px !important;
    overflow-x:auto !important;
    overflow-y:visible !important;
    -webkit-overflow-scrolling:touch !important;
    scrollbar-width:thin !important;
    scroll-snap-type:x proximity !important;
    border-radius:18px !important;
  }

  .table,
  table.table,
  .users-table,
  .offertes-table,
  .quote-templates-table--advanced,
  .hvx-table,
  .hvx-table-shell,
  .materials-table,
  .material-table,
  .crm-table,
  .supplier-table{
    min-width:820px !important;
    width:max-content !important;
  }

  .table th,
  .table td,
  .users-table th,
  .users-table td,
  .offertes-table th,
  .offertes-table td,
  .hvx-table-shell th,
  .hvx-table-shell td{
    padding:12px 10px !important;
    font-size:.86rem !important;
    white-space:nowrap !important;
  }

  .table td:first-child,
  .users-table td:first-child,
  .offertes-table td:first-child,
  .hvx-table-shell td:first-child,
  .table th:first-child,
  .users-table th:first-child,
  .offertes-table th:first-child,
  .hvx-table-shell th:first-child{
    position:sticky !important;
    left:0 !important;
    z-index:3 !important;
    box-shadow:10px 0 18px rgba(15,23,42,.08) !important;
  }

  body:not(.light) .table td:first-child,
  body:not(.light) .users-table td:first-child,
  body:not(.light) .offertes-table td:first-child,
  body:not(.light) .hvx-table-shell td:first-child,
  body:not(.light) .table th:first-child,
  body:not(.light) .users-table th:first-child,
  body:not(.light) .offertes-table th:first-child,
  body:not(.light) .hvx-table-shell th:first-child{
    background:#0f172a !important;
    box-shadow:10px 0 18px rgba(2,6,23,.36) !important;
  }

  body.light .table td:first-child,
  body.light .users-table td:first-child,
  body.light .offertes-table td:first-child,
  body.light .hvx-table-shell td:first-child,
  body.light .table th:first-child,
  body.light .users-table th:first-child,
  body.light .offertes-table th:first-child,
  body.light .hvx-table-shell th:first-child{
    background:#ffffff !important;
  }

  .grid-enhancer-topbar,
  .grid-enhancer-pager,
  .users-grid-toolbar,
  .materials-grid-toolbar,
  .offertes-grid-toolbar,
  .qt-toolbar{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
  }

  .grid-enhancer-topbar input,
  .grid-enhancer-topbar select,
  .grid-enhancer-pager select,
  .users-grid-toolbar input,
  .materials-grid-toolbar input,
  .offertes-grid-toolbar input,
  .qt-toolbar input,
  .qt-toolbar select{
    width:100% !important;
    min-width:0 !important;
  }

  .grid-enhancer-sortbar,
  .grid-sort-buttons,
  .quick-sort-buttons{
    overflow-x:auto !important;
    flex-wrap:nowrap !important;
    justify-content:flex-start !important;
    padding-bottom:4px !important;
    -webkit-overflow-scrolling:touch !important;
  }

  .grid-enhancer-sortbar .btn,
  .grid-sort-buttons .btn,
  .quick-sort-buttons .btn{
    flex:0 0 auto !important;
    white-space:nowrap !important;
  }
}

@media (max-width: 430px){
  .profile-modal-hero,
  .user-modal-hero,
  .supplier-modal-hero,
  .crm-modal-hero,
  .quote-template-modal__hero,
  .hx-modal-header,
  .material-modal .modal-header,
  .offer-modal .modal-header,
  .users-modal .modal-header{
    padding:12px 14px !important;
  }

  .profile-modal-avatar,
  .user-modal-avatar,
  .supplier-modal-avatar,
  .crm-modal-avatar,
  .quote-template-modal__icon,
  .hx-modal-icon,
  .modal-brand-icon{
    width:36px !important;
    height:36px !important;
    min-width:36px !important;
    border-radius:12px !important;
  }

  .profile-modal-copy p,
  .user-modal-hero p,
  .supplier-modal-hero p,
  .crm-modal-hero p,
  .quote-template-modal__hero p,
  .hx-modal-header p,
  .modal-header p{
    -webkit-line-clamp:1 !important;
  }
}

/* v444 - centralized modal cleanup + mobile card grids */
:root{
  --hx-modal-radius: 26px;
  --hx-modal-radius-mobile: 22px;
  --hx-modal-border-light: rgba(15,23,42,.08);
  --hx-modal-border-dark: rgba(96,165,250,.18);
  --hx-modal-divider-light: rgba(15,23,42,.08);
  --hx-modal-divider-dark: rgba(71,85,105,.42);
  --hx-modal-hero-light: linear-gradient(135deg,#ffffff 0%,#f8fbff 55%,#eef6ff 100%);
  --hx-modal-hero-dark: linear-gradient(135deg,rgba(15,23,42,.98) 0%,rgba(15,23,42,.94) 58%,rgba(30,41,59,.92) 100%);
  --hx-modal-shell-light: rgba(255,255,255,.98);
  --hx-modal-shell-dark: linear-gradient(180deg,rgba(15,23,42,.98),rgba(2,6,23,.96));
}

/* A single shared modal treatment. Page-specific overrides can still extend it, but no longer need their own rim fixes. */
.profile-modal-shell,
.hx-modal-shell,
.user-modal,
.crm-modal,
.supplier-modal,
.material-modal,
.offer-modal,
.users-modal,
.quote-template-modal,
.qt-modal,
.modal-card,
.delete-modal-card,
.hx-confirm-delete-shell{
  isolation:isolate;
  border-radius:var(--hx-modal-radius);
  border:1px solid var(--hx-modal-border-light);
  box-shadow:0 30px 80px rgba(15,23,42,.18);
  overflow:hidden;
}
body:not(.light) .profile-modal-shell,
body:not(.light) .hx-modal-shell,
body:not(.light) .user-modal,
body:not(.light) .crm-modal,
body:not(.light) .supplier-modal,
body:not(.light) .material-modal,
body:not(.light) .offer-modal,
body:not(.light) .users-modal,
body:not(.light) .quote-template-modal,
body:not(.light) .qt-modal,
body:not(.light) .modal-card,
body:not(.light) .delete-modal-card,
body:not(.light) .hx-confirm-delete-shell{
  background:var(--hx-modal-shell-dark) !important;
  border-color:var(--hx-modal-border-dark) !important;
  box-shadow:0 30px 90px rgba(2,6,23,.58), inset 0 1px 0 rgba(255,255,255,.035) !important;
}

.profile-modal-hero,
.user-modal-hero,
.supplier-modal-hero,
.crm-modal-hero,
.quote-template-modal__hero,
.hx-modal-header,
.material-modal .modal-header,
.offer-modal .modal-header,
.users-modal .modal-header,
.delete-modal-header,
.hx-confirm-delete-hero{
  background:var(--hx-modal-hero-light);
  border-bottom:1px solid var(--hx-modal-divider-light);
}
body:not(.light) .profile-modal-hero,
body:not(.light) .user-modal-hero,
body:not(.light) .supplier-modal-hero,
body:not(.light) .crm-modal-hero,
body:not(.light) .quote-template-modal__hero,
body:not(.light) .hx-modal-header,
body:not(.light) .material-modal .modal-header,
body:not(.light) .offer-modal .modal-header,
body:not(.light) .users-modal .modal-header,
body:not(.light) .delete-modal-header,
body:not(.light) .hx-confirm-delete-hero{
  background:var(--hx-modal-hero-dark) !important;
  border-color:var(--hx-modal-divider-dark) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025) !important;
}
body:not(.light) .profile-modal-body,
body:not(.light) .hx-modal-body,
body:not(.light) .modal-body,
body:not(.light) .quote-template-modal__body,
body:not(.light) .crm-modal-body,
body:not(.light) .user-modal-body,
body:not(.light) .supplier-modal-body{
  background:transparent !important;
  border-top:0 !important;
}
body:not(.light) .profile-modal-footer,
body:not(.light) .hx-modal-footer,
body:not(.light) .modal-actions,
body:not(.light) .quote-template-modal__footer{
  border-top:1px solid var(--hx-modal-divider-dark) !important;
  background:rgba(2,6,23,.20) !important;
}

@media (max-width: 760px){
  .profile-modal-shell,
  .hx-modal-shell,
  .user-modal,
  .crm-modal,
  .supplier-modal,
  .material-modal,
  .offer-modal,
  .users-modal,
  .quote-template-modal,
  .qt-modal,
  .modal-card,
  .delete-modal-card,
  .hx-confirm-delete-shell{
    border-radius:var(--hx-modal-radius-mobile) var(--hx-modal-radius-mobile) 18px 18px !important;
  }

  /* Mobile datagrids become record cards instead of small desktop tables. */
  .users-table-wrap,
  .offertes-table-wrap,
  .materials-table-wrap,
  .material-table-wrap,
  .crm-table-wrap,
  .supplier-table-wrap,
  .quote-templates-table-wrap,
  .hvx-table-wrap,
  .table-wrap{
    overflow:visible !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }

  .users-table,
  .offertes-table,
  .offertes-table--advanced,
  .materials-table,
  .materials-table--advanced,
  .material-table,
  .crm-table,
  .supplier-table,
  .quote-templates-table--advanced,
  .hvx-table-shell,
  .hvx-table,
  table.table{
    min-width:0 !important;
    width:100% !important;
    border-collapse:separate !important;
    border-spacing:0 12px !important;
    display:block !important;
  }

  .users-table thead,
  .offertes-table thead,
  .offertes-table--advanced thead,
  .materials-table thead,
  .materials-table--advanced thead,
  .material-table thead,
  .crm-table thead,
  .supplier-table thead,
  .quote-templates-table--advanced thead,
  .hvx-table-shell thead,
  .hvx-table thead,
  table.table thead{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    overflow:hidden !important;
    clip:rect(0 0 0 0) !important;
    white-space:nowrap !important;
  }

  .users-table tbody,
  .offertes-table tbody,
  .offertes-table--advanced tbody,
  .materials-table tbody,
  .materials-table--advanced tbody,
  .material-table tbody,
  .crm-table tbody,
  .supplier-table tbody,
  .quote-templates-table--advanced tbody,
  .hvx-table-shell tbody,
  .hvx-table tbody,
  table.table tbody{
    display:grid !important;
    gap:12px !important;
    width:100% !important;
  }

  .users-table tbody tr,
  .offertes-table tbody tr,
  .offertes-table--advanced tbody tr,
  .materials-table tbody tr,
  .materials-table--advanced tbody tr,
  .material-table tbody tr,
  .crm-table tbody tr,
  .supplier-table tbody tr,
  .quote-templates-table--advanced tbody tr,
  .hvx-table-shell tbody tr,
  .hvx-table tbody tr,
  table.table tbody tr{
    display:grid !important;
    gap:9px !important;
    width:100% !important;
    padding:14px !important;
    border:1px solid rgba(15,23,42,.08) !important;
    border-radius:20px !important;
    background:rgba(255,255,255,.92) !important;
    box-shadow:0 12px 32px rgba(15,23,42,.08) !important;
  }

  body:not(.light) .users-table tbody tr,
  body:not(.light) .offertes-table tbody tr,
  body:not(.light) .offertes-table--advanced tbody tr,
  body:not(.light) .materials-table tbody tr,
  body:not(.light) .materials-table--advanced tbody tr,
  body:not(.light) .material-table tbody tr,
  body:not(.light) .crm-table tbody tr,
  body:not(.light) .supplier-table tbody tr,
  body:not(.light) .quote-templates-table--advanced tbody tr,
  body:not(.light) .hvx-table-shell tbody tr,
  body:not(.light) .hvx-table tbody tr,
  body:not(.light) table.table tbody tr{
    background:linear-gradient(180deg,rgba(15,23,42,.94),rgba(15,23,42,.82)) !important;
    border-color:rgba(96,165,250,.18) !important;
    box-shadow:0 16px 38px rgba(2,6,23,.34), inset 0 1px 0 rgba(255,255,255,.025) !important;
  }

  .users-table tbody td,
  .offertes-table tbody td,
  .offertes-table--advanced tbody td,
  .materials-table tbody td,
  .materials-table--advanced tbody td,
  .material-table tbody td,
  .crm-table tbody td,
  .supplier-table tbody td,
  .quote-templates-table--advanced tbody td,
  .hvx-table-shell tbody td,
  .hvx-table tbody td,
  table.table tbody td{
    display:grid !important;
    grid-template-columns:minmax(92px, .38fr) minmax(0, 1fr) !important;
    align-items:center !important;
    gap:10px !important;
    padding:0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    white-space:normal !important;
    position:static !important;
    min-width:0 !important;
  }

  .users-table tbody td::before,
  .offertes-table tbody td::before,
  .offertes-table--advanced tbody td::before,
  .materials-table tbody td::before,
  .materials-table--advanced tbody td::before,
  .material-table tbody td::before,
  .crm-table tbody td::before,
  .supplier-table tbody td::before,
  .quote-templates-table--advanced tbody td::before,
  .hvx-table-shell tbody td::before,
  .hvx-table tbody td::before,
  table.table tbody td::before{
    content:attr(data-label);
    color:#64748b;
    font-size:.75rem;
    line-height:1.2;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.06em;
  }

  body:not(.light) .users-table tbody td::before,
  body:not(.light) .offertes-table tbody td::before,
  body:not(.light) .offertes-table--advanced tbody td::before,
  body:not(.light) .materials-table tbody td::before,
  body:not(.light) .materials-table--advanced tbody td::before,
  body:not(.light) .material-table tbody td::before,
  body:not(.light) .crm-table tbody td::before,
  body:not(.light) .supplier-table tbody td::before,
  body:not(.light) .quote-templates-table--advanced tbody td::before,
  body:not(.light) .hvx-table-shell tbody td::before,
  body:not(.light) .hvx-table tbody td::before,
  body:not(.light) table.table tbody td::before{
    color:#94a3b8;
  }

  .users-table tbody td:first-child,
  .offertes-table tbody td:first-child,
  .offertes-table--advanced tbody td:first-child,
  .materials-table tbody td:first-child,
  .materials-table--advanced tbody td:first-child,
  .material-table tbody td:first-child,
  .crm-table tbody td:first-child,
  .supplier-table tbody td:first-child,
  .quote-templates-table--advanced tbody td:first-child,
  .hvx-table-shell tbody td:first-child,
  .hvx-table tbody td:first-child,
  table.table tbody td:first-child{
    position:static !important;
    grid-template-columns:1fr !important;
    padding-bottom:10px !important;
    margin-bottom:2px !important;
    border-bottom:1px solid rgba(15,23,42,.08) !important;
    background:transparent !important;
    box-shadow:none !important;
  }

  .users-table tbody td:first-child::before,
  .offertes-table tbody td:first-child::before,
  .offertes-table--advanced tbody td:first-child::before,
  .materials-table tbody td:first-child::before,
  .materials-table--advanced tbody td:first-child::before,
  .material-table tbody td:first-child::before,
  .crm-table tbody td:first-child::before,
  .supplier-table tbody td:first-child::before,
  .quote-templates-table--advanced tbody td:first-child::before,
  .hvx-table-shell tbody td:first-child::before,
  .hvx-table tbody td:first-child::before,
  table.table tbody td:first-child::before{
    display:none !important;
  }

  body:not(.light) .users-table tbody td:first-child,
  body:not(.light) .offertes-table tbody td:first-child,
  body:not(.light) .offertes-table--advanced tbody td:first-child,
  body:not(.light) .materials-table tbody td:first-child,
  body:not(.light) .materials-table--advanced tbody td:first-child,
  body:not(.light) .material-table tbody td:first-child,
  body:not(.light) .crm-table tbody td:first-child,
  body:not(.light) .supplier-table tbody td:first-child,
  body:not(.light) .quote-templates-table--advanced tbody td:first-child,
  body:not(.light) .hvx-table-shell tbody td:first-child,
  body:not(.light) .hvx-table tbody td:first-child,
  body:not(.light) table.table tbody td:first-child{
    border-color:rgba(71,85,105,.42) !important;
  }

  .users-table tbody td:last-child,
  .offertes-table tbody td:last-child,
  .offertes-table--advanced tbody td:last-child,
  .materials-table tbody td:last-child,
  .materials-table--advanced tbody td:last-child,
  .material-table tbody td:last-child,
  .crm-table tbody td:last-child,
  .supplier-table tbody td:last-child,
  .quote-templates-table--advanced tbody td:last-child,
  .hvx-table-shell tbody td:last-child,
  .hvx-table tbody td:last-child,
  table.table tbody td:last-child{
    grid-template-columns:1fr !important;
    padding-top:8px !important;
  }

  .users-table tbody td:last-child::before,
  .offertes-table tbody td:last-child::before,
  .offertes-table--advanced tbody td:last-child::before,
  .materials-table tbody td:last-child::before,
  .materials-table--advanced tbody td:last-child::before,
  .material-table tbody td:last-child::before,
  .crm-table tbody td:last-child::before,
  .supplier-table tbody td:last-child::before,
  .quote-templates-table--advanced tbody td:last-child::before,
  .hvx-table-shell tbody td:last-child::before,
  .hvx-table tbody td:last-child::before,
  table.table tbody td:last-child::before{
    display:none !important;
  }

  .user-actions,
  .users-table-actions,
  .material-actions,
  .materials-actions,
  .offer-actions,
  .offerte-actions,
  .crm-actions,
  .supplier-actions,
  .actions{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:8px !important;
    width:100% !important;
  }

  .user-actions .btn,
  .users-table-actions .btn,
  .material-actions .btn,
  .materials-actions .btn,
  .offer-actions .btn,
  .offerte-actions .btn,
  .crm-actions .btn,
  .supplier-actions .btn,
  .actions .btn,
  td:last-child .btn,
  td:last-child button,
  td:last-child a.btn{
    width:100% !important;
    justify-content:center !important;
    min-height:42px !important;
  }
}

/* v453: quote-template modal checkbox + roof type cleanup */
.quote-template-modal__checkbox-row{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:12px !important;
  width:max-content !important;
  max-width:100% !important;
  min-height:auto !important;
  margin-top:2px !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
.quote-template-modal__checkbox-row input[type="checkbox"],
.quote-template-modal__form input[type="checkbox"],
.quote-templates-page form.form-grid input[type="checkbox"]{
  appearance:auto !important;
  -webkit-appearance:auto !important;
  width:22px !important;
  min-width:22px !important;
  max-width:22px !important;
  height:22px !important;
  min-height:22px !important;
  max-height:22px !important;
  margin:0 !important;
  padding:0 !important;
  border-radius:6px !important;
  background-color:initial !important;
  border:initial !important;
  box-shadow:none !important;
  display:inline-block !important;
  flex:0 0 22px !important;
}
.quote-template-modal__checkbox-row span{
  display:inline-flex !important;
  align-items:center !important;
  line-height:1.2 !important;
  color:inherit !important;
}
body:not(.light) .quote-template-modal__checkbox-row{
  color:#f8fafc !important;
}
body:not(.light) .quote-template-modal__form input[type="checkbox"]{
  accent-color:#4b8dff !important;
}

/* v455 quote-template required field validation highlight */
.quote-template-modal__form.was-validated input:invalid,
.quote-template-modal__form.was-validated select:invalid,
.quote-template-modal__form.was-validated textarea:invalid,
.quote-template-modal__form .hx-invalid-field{
  border-color: rgba(239, 68, 68, .9) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .16) !important;
}
.quote-template-modal__form label.hx-required-missing{
  color: #ef4444 !important;
}
.quote-template-modal__form label.hx-required-missing > input,
.quote-template-modal__form label.hx-required-missing > select,
.quote-template-modal__form label.hx-required-missing > textarea{
  border-color: rgba(239, 68, 68, .9) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .16) !important;
}
.dark .quote-template-modal__form label.hx-required-missing{
  color: #ff8a8a !important;
}
.dark .quote-template-modal__form.was-validated input:invalid,
.dark .quote-template-modal__form.was-validated select:invalid,
.dark .quote-template-modal__form.was-validated textarea:invalid,
.dark .quote-template-modal__form .hx-invalid-field{
  border-color: rgba(248, 113, 113, .95) !important;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, .18) !important;
}

/* v466 - Dak AI history missing image fallback */
.roof-ai-thumb-missing{
  width:72px;
  height:52px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(148,163,184,.28);
  background:rgba(148,163,184,.10);
  color:rgba(100,116,139,.95);
  font-weight:900;
}
.roof-ai-thumb-missing span{font-size:20px;line-height:1;}
.roof-ai-image-missing{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:260px;
  padding:24px;
  border:1px dashed rgba(148,163,184,.36);
  background:rgba(148,163,184,.10);
}
body.dark .roof-ai-thumb-missing,
body.dark-mode .roof-ai-thumb-missing,
[data-theme="dark"] .roof-ai-thumb-missing{
  border-color:rgba(148,163,184,.20);
  background:rgba(15,23,42,.62);
  color:rgba(226,232,240,.86);
}
body.dark .roof-ai-image-missing,
body.dark-mode .roof-ai-image-missing,
[data-theme="dark"] .roof-ai-image-missing{
  border-color:rgba(148,163,184,.18);
  background:rgba(15,23,42,.58);
}

/* AI tools local page titles: align above the first content card instead of floating right */
.ai-local-page-title{
  width:100%;
  margin:0 0 18px 0;
  padding:0;
  text-align:left;
}
.ai-local-page-title h1{
  margin:0 0 8px 0;
  color:var(--text, #f8fafc);
  font-size:clamp(2rem, 3.2vw, 2.75rem);
  line-height:1.08;
  letter-spacing:-.04em;
}
.ai-local-page-title .muted{
  margin:0;
  max-width:900px;
}
body.light .ai-local-page-title h1{
  color:#0f172a;
}
@media (max-width: 900px){
  .ai-local-page-title{ margin-bottom:14px; }
  .ai-local-page-title h1{ font-size:clamp(1.6rem, 7vw, 2.2rem); }
}

/* HAVEXA v498 CX package */
.hx-cx-panel{margin:16px 0 18px;padding:20px;border:1px solid rgba(148,163,184,.22);border-radius:26px;background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(239,246,255,.76));box-shadow:0 18px 42px rgba(15,23,42,.07)}
body:not(.light) .hx-cx-panel{background:linear-gradient(135deg,rgba(15,23,42,.94),rgba(30,41,59,.88));border-color:rgba(148,163,184,.18)}
.hx-cx-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;flex-wrap:wrap}.hx-cx-kicker{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.14em;color:#2563eb}.hx-cx-head h2{margin:4px 0 6px;font-size:22px}.hx-cx-head p{margin:0;color:var(--muted,#64748b);max-width:720px}.hx-cx-actions{display:flex;gap:10px;flex-wrap:wrap}.hx-cx-steps{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin-top:16px}.hx-cx-step{position:relative;display:flex;align-items:center;gap:8px;padding:10px;border:1px solid rgba(148,163,184,.22);border-radius:16px;color:inherit;text-decoration:none;background:rgba(255,255,255,.54)}body:not(.light) .hx-cx-step{background:rgba(15,23,42,.42)}.hx-cx-step span{width:26px;height:26px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:rgba(148,163,184,.22);font-weight:900;font-size:12px}.hx-cx-step.is-done span{background:#dbeafe;color:#1d4ed8}.hx-cx-step.is-active{border-color:rgba(37,99,235,.45);box-shadow:0 8px 20px rgba(37,99,235,.12)}.hx-cx-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}.hx-cx-mini{padding:12px;border-radius:18px;background:rgba(255,255,255,.58);border:1px solid rgba(148,163,184,.16)}body:not(.light) .hx-cx-mini{background:rgba(2,6,23,.28)}.hx-cx-mini strong{display:block;margin-bottom:5px}.hx-cx-mini p{margin:0;color:var(--muted,#64748b);font-size:13px;line-height:1.45}.hx-cx-mini kbd{padding:1px 5px;border:1px solid rgba(148,163,184,.34);border-radius:6px;background:rgba(148,163,184,.12)}
.hx-inline-help{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:999px;background:rgba(37,99,235,.12);color:#1d4ed8;font-size:12px;font-weight:900;cursor:help;margin-left:5px}.hx-field-warning{display:block;margin-top:5px;color:#b45309;font-size:12px;font-weight:700}.hx-form-dirty-note{position:fixed;right:18px;bottom:18px;z-index:3300;padding:10px 14px;border-radius:999px;background:#0f172a;color:#fff;font-size:13px;box-shadow:0 16px 40px rgba(15,23,42,.2)}.hx-empty-state{padding:24px;border:1px dashed rgba(148,163,184,.45);border-radius:22px;text-align:center;background:rgba(255,255,255,.38)}.hx-empty-state h3{margin:0 0 6px}.hx-empty-state p{margin:0 0 14px;color:var(--muted,#64748b)}.hx-mobile-sticky-actions{position:sticky;bottom:0;z-index:40;display:flex;gap:10px;flex-wrap:wrap;padding:10px;background:rgba(248,250,252,.88);backdrop-filter:blur(12px);border-top:1px solid rgba(148,163,184,.2)}body:not(.light) .hx-mobile-sticky-actions{background:rgba(15,23,42,.88)}
.command-palette.is-open{display:flex!important}.command-palette{align-items:flex-start;justify-content:center;padding-top:11vh;background:rgba(2,6,23,.48);backdrop-filter:blur(8px)}.command-box{width:min(680px,calc(100% - 28px));border-radius:24px;overflow:hidden;border:1px solid rgba(148,163,184,.26);box-shadow:0 28px 80px rgba(2,6,23,.34)}.command-input{width:100%;border:0!important;border-bottom:1px solid rgba(148,163,184,.2)!important;border-radius:0!important;padding:18px 20px!important;font-size:18px!important}.command-results{display:grid;gap:2px;padding:10px;background:var(--card-bg,#fff)}.command-results a{padding:12px 14px;border-radius:14px;text-decoration:none;color:inherit}.command-results a:hover,.command-results a.is-active{background:rgba(37,99,235,.10)}
@media(max-width:900px){.hx-cx-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.hx-cx-grid{grid-template-columns:1fr}.hx-cx-head{display:block}.hx-cx-actions{margin-top:12px}.quote-page-top-actions,.page-head .quote-page-top-actions{width:100%;justify-content:stretch}.quote-page-top-actions .btn{flex:1 1 160px}.crm-modal .crm-modal-body,.quote-create-card{padding-bottom:calc(16px + env(safe-area-inset-bottom))}}

/* v503 - Light mode modal background consistency
   In light mode the modal content area now uses the same soft grey surface
   as the modal header/footer instead of a white panel. Dark mode remains unchanged. */
body.light :is(.modal-card,.hx-modal-shell,.user-modal,.supplier-modal,.crm-modal,.profile-modal-shell,.profile-modal-card){
  background:var(--hx-modal-surface, #f1f5f9) !important;
}

body.light :is(.modal-body,.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body){
  background:var(--hx-modal-surface, #f1f5f9) !important;
  background-image:none !important;
}

body.light :is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > form,
body.light :is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .profile-modal-form,
body.light :is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .crm-modal-form,
body.light :is(.user-modal-body,.supplier-modal-body,.crm-modal-body,.profile-modal-body) > .supplier-modal-form{
  background:transparent !important;
}

/* v511 full project features */
.projects-page .page-header-left{align-items:flex-start;text-align:left;margin-bottom:1rem}.projects-page .eyebrow{font-size:.78rem;text-transform:uppercase;letter-spacing:.12em;color:var(--primary,#2563eb);font-weight:800;margin:0 0 .25rem}.projects-page .muted{color:var(--muted,#64748b)}.projects-page .mt-lg{margin-top:1.25rem}.projects-page .gap-lg{gap:1.25rem}.projects-page .soft-card{border:1px solid rgba(148,163,184,.24);border-radius:22px;padding:1.15rem;background:rgba(255,255,255,.78);box-shadow:0 14px 34px rgba(15,23,42,.06)}body.dark .projects-page .soft-card,body.dark-mode .projects-page .soft-card{background:rgba(15,23,42,.72);border-color:rgba(148,163,184,.18)}.projects-page .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.9rem}.projects-page label span{display:block;font-size:.84rem;font-weight:700;margin-bottom:.3rem}.projects-page .full,.projects-page .full-span{grid-column:1/-1}.projects-page .stack-sm{display:grid;gap:.7rem}.projects-page .form-actions{display:flex;justify-content:flex-end}.projects-page .workflow-strip{display:flex;gap:.45rem;flex-wrap:wrap;margin:0 0 1rem}.projects-page .workflow-step{padding:.45rem .7rem;border-radius:999px;border:1px solid rgba(148,163,184,.25);font-weight:700;font-size:.82rem;background:rgba(255,255,255,.6)}.projects-page .workflow-step.active{background:rgba(37,99,235,.14);border-color:rgba(37,99,235,.35);color:#1d4ed8}.projects-page .metric-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.6rem;margin-top:1rem}.projects-page .metric-row>div{border-radius:16px;background:rgba(148,163,184,.12);padding:.75rem}.projects-page .metric-row span{display:block;font-size:.78rem;color:var(--muted,#64748b);font-weight:700}.projects-page .metric-row strong{font-size:1.05rem}.projects-page .mini-list,.projects-page .split-list{margin-top:1rem;display:grid;gap:.5rem}.projects-page .split-list{grid-template-columns:1fr 1fr}.projects-page .mini-row{margin:.2rem 0;padding:.45rem .55rem;border-radius:12px;background:rgba(148,163,184,.12)}.projects-page .checkbox-line{display:flex;gap:.5rem;align-items:center;margin-top:.75rem}.projects-page .checkbox-line span,.projects-page .checkbox-card span{margin:0}.projects-page .quality-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.7rem}.projects-page .checkbox-card{display:flex;gap:.55rem;align-items:flex-start;border:1px solid rgba(148,163,184,.25);border-radius:16px;padding:.75rem;background:rgba(148,163,184,.08)}.projects-page .sticky-save-bar{position:sticky;bottom:0;margin-top:1.25rem;padding:.9rem;border-radius:20px;background:rgba(255,255,255,.88);backdrop-filter:blur(10px);display:flex;gap:.65rem;justify-content:flex-end;border:1px solid rgba(148,163,184,.22);box-shadow:0 -10px 28px rgba(15,23,42,.06)}body.dark .projects-page .sticky-save-bar,body.dark-mode .projects-page .sticky-save-bar{background:rgba(15,23,42,.88)}.projects-page .header-actions{display:flex;gap:.6rem;align-items:center}.projects-page .btn-danger{background:#dc2626;color:#fff;border-color:#dc2626}@media(max-width:900px){.projects-page .grid.two-col,.projects-page .form-grid,.projects-page .metric-row,.projects-page .quality-grid,.projects-page .split-list{grid-template-columns:1fr}.projects-page .sticky-save-bar{justify-content:stretch;flex-direction:column}.projects-page .header-actions{width:100%;justify-content:flex-start;flex-wrap:wrap}}

/* v513 fase 1 projectfiche verbeteringen */
.project-calc-lines { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(148,163,184,.22); }
.project-calc-lines h3 { margin: 12px 0 8px; font-size: 14px; }
.calculation-rule-row { margin: 8px 0; padding: 10px; border: 1px solid rgba(148,163,184,.22); border-radius: 14px; background: rgba(248,250,252,.72); }
.pdf-template-preview { margin: 12px 0; padding: 14px; border: 1px solid rgba(148,163,184,.25); border-radius: 16px; background: linear-gradient(135deg, rgba(248,250,252,.9), rgba(241,245,249,.86)); }
.pdf-preview-card { margin-top: 10px; padding: 14px; border-radius: 14px; background: #fff; border-left: 5px solid #111827; box-shadow: 0 10px 30px rgba(15,23,42,.08); display: grid; gap: 4px; }
.pdf-template-preview.template-premium .pdf-preview-card { border-left-color: #0f766e; }
.pdf-template-preview.template-measurement_report .pdf-preview-card { border-left-color: #2563eb; }
.pdf-template-preview.template-customer_portal .pdf-preview-card { border-left-color: #7c3aed; }
.pdf-preview-card span { color: #64748b; font-size: 12px; }
.pdf-preview-card strong { color: #0f172a; font-size: 18px; }
.pdf-preview-card small { color: #334155; }
body:not(.light) .calculation-rule-row, body[data-theme="dark"] .calculation-rule-row { background: rgba(15,23,42,.42); border-color: rgba(96,165,250,.18); }
body:not(.light) .pdf-template-preview, body[data-theme="dark"] .pdf-template-preview { background: linear-gradient(135deg, rgba(15,33,52,.76), rgba(13,38,68,.70)); border-color: rgba(96,165,250,.18); }
body:not(.light) .pdf-preview-card, body[data-theme="dark"] .pdf-preview-card { background: rgba(2,12,27,.62); }
body:not(.light) .pdf-preview-card strong, body[data-theme="dark"] .pdf-preview-card strong { color: #f8fafc; }
body:not(.light) .pdf-preview-card span, body:not(.light) .pdf-preview-card small, body[data-theme="dark"] .pdf-preview-card span, body[data-theme="dark"] .pdf-preview-card small { color: #cbd5e1; }

/* v515 phase 3 operations */
.operation-readiness-card { margin: 0 0 18px; }
.operation-readiness-card .progress { height: 10px; border-radius: 999px; background: rgba(148, 163, 184, .25); overflow: hidden; margin-top: 12px; }
.operation-readiness-card .progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #16a34a, #0f766e); }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; background: rgba(15, 118, 110, .12); color: #0f766e; font-weight: 700; }
body.dark .status-pill, body.dark-mode .status-pill, body[data-theme="dark"] .status-pill { background: rgba(45, 212, 191, .14); color: #5eead4; }

/* FAQ refresh */
.faq-list details.panel-soft{
  border:1px solid var(--line, rgba(148,163,184,.22));
  border-radius:20px;
  padding:16px 18px;
  background:rgba(255,255,255,.04);
}
body.light .faq-list details.panel-soft,
body:not(.dark):not(.dark-mode) .faq-list details.panel-soft{
  background:rgba(248,250,252,.82);
}
.faq-list summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.faq-list summary::-webkit-details-marker{display:none;}
.faq-list summary:after{
  content:'+';
  font-weight:900;
  opacity:.65;
}
.faq-list details[open] summary:after{content:'−';}
.faq-list details p{margin:12px 0 0;}

/* v520 FAQ dark-mode layout cleanup */
.faq-section-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:22px;
  margin-top:22px;
  align-items:start;
}
.faq-section-card{
  min-height:100%;
}
.faq-section-card .faq-list{
  display:grid;
  gap:14px;
  margin-top:18px;
}
.faq-section-card .faq-list p{
  line-height:1.7;
}
.faq-support-card{
  grid-column:span 2;
}
body:not(.light) .faq-list details.panel-soft,
body.dark .faq-list details.panel-soft,
body.dark-mode .faq-list details.panel-soft,
body[data-theme="dark"] .faq-list details.panel-soft{
  background:linear-gradient(135deg, rgba(15,33,52,.72), rgba(13,38,68,.58));
  border-color:rgba(96,165,250,.18);
  color:#f8fafc;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
}
body:not(.light) .faq-list details.panel-soft summary,
body.dark .faq-list details.panel-soft summary,
body.dark-mode .faq-list details.panel-soft summary,
body[data-theme="dark"] .faq-list details.panel-soft summary{
  color:#f8fafc;
}
body:not(.light) .faq-list details.panel-soft .crm-sub,
body.dark .faq-list details.panel-soft .crm-sub,
body.dark-mode .faq-list details.panel-soft .crm-sub,
body[data-theme="dark"] .faq-list details.panel-soft .crm-sub{
  color:#b8c7da;
}
body.light .faq-list details.panel-soft,
body:not(.dark):not(.dark-mode):not([data-theme="dark"]) .faq-list details.panel-soft{
  background:rgba(248,250,252,.82);
  border-color:rgba(15,23,42,.08);
}
@media (max-width: 1100px){
  .faq-section-grid{grid-template-columns:1fr;}
  .faq-support-card{grid-column:auto;}
}

/* v521 dashboard FAQ support layout fixes */
.faq-section-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:22px;
  margin-top:22px;
  align-items:stretch;
}
.faq-section-grid > .faq-section-card{
  min-width:0;
  width:100%;
}
.faq-support-card{
  grid-column:1 / -1;
  width:100%;
}
body:not(.light) .faq-intro-panel,
body.dark .faq-intro-panel,
body.dark-mode .faq-intro-panel,
body[data-theme="dark"] .faq-intro-panel,
body:not(.light) .faq-card,
body.dark .faq-card,
body.dark-mode .faq-card,
body[data-theme="dark"] .faq-card,
body:not(.light) .faq-section-card,
body.dark .faq-section-card,
body.dark-mode .faq-section-card,
body[data-theme="dark"] .faq-section-card{
  background:linear-gradient(135deg, rgba(15,33,52,.86), rgba(13,38,68,.76)) !important;
  border-color:rgba(96,165,250,.20) !important;
  color:#f8fafc !important;
  box-shadow:0 18px 45px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.04);
}
body:not(.light) .faq-card h3,
body.dark .faq-card h3,
body.dark-mode .faq-card h3,
body[data-theme="dark"] .faq-card h3,
body:not(.light) .faq-section-card h2,
body.dark .faq-section-card h2,
body.dark-mode .faq-section-card h2,
body[data-theme="dark"] .faq-section-card h2,
body:not(.light) .faq-intro-panel h2,
body.dark .faq-intro-panel h2,
body.dark-mode .faq-intro-panel h2,
body[data-theme="dark"] .faq-intro-panel h2{
  color:#f8fafc !important;
}
body:not(.light) .faq-card .crm-sub,
body.dark .faq-card .crm-sub,
body.dark-mode .faq-card .crm-sub,
body[data-theme="dark"] .faq-card .crm-sub,
body:not(.light) .faq-section-card .crm-sub,
body.dark .faq-section-card .crm-sub,
body.dark-mode .faq-section-card .crm-sub,
body[data-theme="dark"] .faq-section-card .crm-sub,
body:not(.light) .faq-intro-panel .crm-sub,
body.dark .faq-intro-panel .crm-sub,
body.dark-mode .faq-intro-panel .crm-sub,
body[data-theme="dark"] .faq-intro-panel .crm-sub{
  color:#cbd5e1 !important;
}
body:not(.light) .faq-list details.panel-soft,
body.dark .faq-list details.panel-soft,
body.dark-mode .faq-list details.panel-soft,
body[data-theme="dark"] .faq-list details.panel-soft{
  background:rgba(2,12,27,.48) !important;
  border-color:rgba(148,163,184,.22) !important;
  color:#f8fafc !important;
}
body:not(.light) .faq-list details.panel-soft summary,
body.dark .faq-list details.panel-soft summary,
body.dark-mode .faq-list details.panel-soft summary,
body[data-theme="dark"] .faq-list details.panel-soft summary{
  color:#f8fafc !important;
}
@media (max-width: 900px){
  .faq-section-grid{grid-template-columns:1fr;}
  .faq-support-card{grid-column:auto;}
}

/* V526 projects: customer selector empty-state */
.form-empty-action{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  min-height:4.25rem;
  padding:1rem 1.125rem;
  border:1px solid rgba(96,165,250,.22);
  border-radius:1.125rem;
  background:rgba(8,22,36,.64);
  color:rgba(226,232,240,.86);
  font-weight:800;
}
.form-grid .form-empty-action{ align-self:end; }
body.light .form-empty-action{
  background:rgba(248,250,252,.95);
  border-color:rgba(37,99,235,.18);
  color:#334155;
}
@media (max-width: 760px){
  .form-empty-action{ flex-direction:column; align-items:stretch; }
}

/* v528 - offerte bewerken: force readable dark-mode modal
   The generic modal standardization block was resetting body:not(.light) modal
   variables to light surfaces. Keep light mode unchanged and explicitly restore
   the offerte edit modal to the dark modal palette in all dark-theme variants. */
body:not(.light),
body.dark,
body.dark-mode,
body[data-theme="dark"]{
  --hx-modal-surface: rgba(15,23,42,.96);
  --hx-modal-surface-2: rgba(2,6,23,.92);
  --hx-modal-border: rgba(96,165,250,.20);
  --hx-modal-shell-bg: linear-gradient(180deg,rgba(15,23,42,.98),rgba(2,6,23,.96));
}

body.light{
  --hx-modal-surface:#f1f5f9;
  --hx-modal-surface-2:#e9eef5;
  --hx-modal-border:#cbd5e1;
  --hx-modal-shell-bg:#f8fafc;
}

body:not(.light) .quote-edit-modal,
body.dark .quote-edit-modal,
body.dark-mode .quote-edit-modal,
body[data-theme="dark"] .quote-edit-modal{
  background:linear-gradient(180deg,rgba(15,23,42,.98),rgba(2,6,23,.96)) !important;
  border-color:rgba(96,165,250,.22) !important;
  color:#e5eef8 !important;
  box-shadow:0 30px 90px rgba(2,6,23,.62), inset 0 1px 0 rgba(255,255,255,.04) !important;
}

body:not(.light) .quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar),
body.dark .quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar),
body.dark-mode .quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar),
body[data-theme="dark"] .quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar){
  background:linear-gradient(135deg,rgba(15,33,52,.92),rgba(13,38,68,.76)) !important;
  border-color:rgba(96,165,250,.18) !important;
  color:#f8fafc !important;
}

body:not(.light) .quote-edit-modal .crm-modal-body,
body.dark .quote-edit-modal .crm-modal-body,
body.dark-mode .quote-edit-modal .crm-modal-body,
body[data-theme="dark"] .quote-edit-modal .crm-modal-body{
  background:transparent !important;
  color:#e5eef8 !important;
}

body:not(.light) .quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body.dark .quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body.dark-mode .quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body[data-theme="dark"] .quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box){
  background:rgba(2,12,27,.54) !important;
  border-color:rgba(96,165,250,.18) !important;
  color:#e5eef8 !important;
  box-shadow:none !important;
}

body:not(.light) .quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text),
body.dark .quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text),
body.dark-mode .quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text),
body[data-theme="dark"] .quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text){
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  opacity:1 !important;
}

body:not(.light) .quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit),
body.dark .quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit),
body.dark-mode .quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit),
body[data-theme="dark"] .quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit){
  color:#cbd5e1 !important;
  -webkit-text-fill-color:#cbd5e1 !important;
  opacity:1 !important;
}

body:not(.light) .quote-edit-modal :is(input,select,textarea),
body.dark .quote-edit-modal :is(input,select,textarea),
body.dark-mode .quote-edit-modal :is(input,select,textarea),
body[data-theme="dark"] .quote-edit-modal :is(input,select,textarea){
  background:rgba(2,12,27,.72) !important;
  border-color:rgba(96,165,250,.22) !important;
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03) !important;
}

body:not(.light) .quote-edit-modal :is(input::placeholder,textarea::placeholder),
body.dark .quote-edit-modal :is(input::placeholder,textarea::placeholder),
body.dark-mode .quote-edit-modal :is(input::placeholder,textarea::placeholder),
body[data-theme="dark"] .quote-edit-modal :is(input::placeholder,textarea::placeholder){
  color:#8ea4ba !important;
  -webkit-text-fill-color:#8ea4ba !important;
  opacity:1 !important;
}

body:not(.light) .quote-edit-modal .quote-modal-footer,
body.dark .quote-edit-modal .quote-modal-footer,
body.dark-mode .quote-edit-modal .quote-modal-footer,
body[data-theme="dark"] .quote-edit-modal .quote-modal-footer{
  background:rgba(2,6,23,.74) !important;
  border-top-color:rgba(96,165,250,.18) !important;
}

body:not(.light) .quote-edit-modal .crm-modal-close,
body.dark .quote-edit-modal .crm-modal-close,
body.dark-mode .quote-edit-modal .crm-modal-close,
body[data-theme="dark"] .quote-edit-modal .crm-modal-close{
  background:rgba(255,255,255,.10) !important;
  border-color:rgba(255,255,255,.16) !important;
  color:#ffffff !important;
}

/* V532 - Project detail success alert + workflow dark-mode readability */
.alert.alert-success,
.projects-page .alert.alert-success{
  color:#065f46;
  background:rgba(34,197,94,.14);
  border-color:rgba(34,197,94,.35);
}
.alert.alert-error,
.projects-page .alert.alert-error{
  color:#991b1b;
  background:rgba(239,68,68,.14);
  border-color:rgba(239,68,68,.34);
}
body.dark .alert.alert-success,
body.dark-mode .alert.alert-success,
body[data-theme="dark"] .alert.alert-success,
body:not(.light) .projects-page .alert.alert-success{
  color:#d1fae5 !important;
  background:linear-gradient(135deg, rgba(16,185,129,.20), rgba(5,150,105,.13)) !important;
  border-color:rgba(52,211,153,.42) !important;
  box-shadow:0 14px 32px rgba(5,150,105,.10);
}
body.dark .alert.alert-error,
body.dark-mode .alert.alert-error,
body[data-theme="dark"] .alert.alert-error,
body:not(.light) .projects-page .alert.alert-error{
  color:#fee2e2 !important;
  background:linear-gradient(135deg, rgba(239,68,68,.18), rgba(127,29,29,.16)) !important;
  border-color:rgba(248,113,113,.36) !important;
}
body.dark .projects-page .workflow-step,
body.dark-mode .projects-page .workflow-step,
body[data-theme="dark"] .projects-page .workflow-step,
body:not(.light) .projects-page .workflow-step{
  color:#dbeafe !important;
  background:linear-gradient(135deg, rgba(30,41,59,.92), rgba(15,23,42,.88)) !important;
  border-color:rgba(96,165,250,.24) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 10px 22px rgba(2,6,23,.16);
}
body.dark .projects-page .workflow-step.active,
body.dark-mode .projects-page .workflow-step.active,
body[data-theme="dark"] .projects-page .workflow-step.active,
body:not(.light) .projects-page .workflow-step.active{
  color:#bfdbfe !important;
  background:linear-gradient(135deg, rgba(37,99,235,.44), rgba(30,64,175,.38)) !important;
  border-color:rgba(96,165,250,.58) !important;
  box-shadow:0 12px 26px rgba(37,99,235,.22), inset 0 1px 0 rgba(255,255,255,.09);
}

/* v535 - datagrid Excel export controls */
.hx-table-export-bar{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  margin:0 0 12px 0;
}
.hx-table-export-bar .hx-excel-export-btn{
  min-height:38px;
  padding:9px 14px;
  border-radius:14px;
  white-space:nowrap;
}
body.dark .hx-table-export-bar .hx-excel-export-btn,
body.dark-mode .hx-table-export-bar .hx-excel-export-btn,
body[data-theme="dark"] .hx-table-export-bar .hx-excel-export-btn,
body:not(.light) .hx-table-export-bar .hx-excel-export-btn{
  background:rgba(15,35,55,.82);
  color:#eaf3ff;
  border-color:rgba(100,140,185,.42);
}

/* v560 - CRM edit customer dark-mode light content, matched to stable profile modal treatment */
body:not(.light) .crm-edit-shell .crm-edit-hero{
  background:
    radial-gradient(760px 240px at 0% 0%, rgba(96,165,250,.18), transparent 58%),
    linear-gradient(135deg, #172238 0%, #20345f 58%, #2449a6 145%) !important;
  border:1px solid rgba(96,165,250,.28) !important;
  box-shadow:0 24px 58px rgba(2,8,23,.32) !important;
  color:#ffffff !important;
}
body:not(.light) .crm-edit-shell .crm-edit-hero::before{ display:none !important; }
body:not(.light) .crm-edit-shell .crm-edit-title-row h2,
body:not(.light) .crm-edit-shell .crm-edit-hero-copy p,
body:not(.light) .crm-edit-shell .crm-edit-meta-label,
body:not(.light) .crm-edit-shell .crm-edit-meta-card strong{
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
body:not(.light) .crm-edit-shell .crm-edit-hero-copy p,
body:not(.light) .crm-edit-shell .crm-edit-meta-label{
  color:rgba(226,232,240,.82) !important;
  -webkit-text-fill-color:rgba(226,232,240,.82) !important;
}
body:not(.light) .crm-edit-shell .crm-edit-meta-card{
  background:rgba(255,255,255,.08) !important;
  border-color:rgba(255,255,255,.14) !important;
}

body:not(.light) .crm-edit-shell .crm-edit-card,
body:not(.light) .crm-edit-shell .panel.crm-edit-card{
  background:#f1f5f9 !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 16px 34px rgba(15,23,42,.06) !important;
  color:#0f172a !important;
}
body:not(.light) .crm-edit-shell .crm-edit-card .card-head{
  border-bottom:1px solid #dbe3ee !important;
}
body:not(.light) .crm-edit-shell .crm-edit-card h3,
body:not(.light) .crm-edit-shell .crm-edit-card label,
body:not(.light) .crm-edit-shell .crm-edit-card label span,
body:not(.light) .crm-edit-shell .crm-edit-save-copy h3{
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  text-shadow:none !important;
}
body:not(.light) .crm-edit-shell .crm-edit-card .muted,
body:not(.light) .crm-edit-shell .crm-edit-card .crm-sub,
body:not(.light) .crm-edit-shell .crm-edit-save-copy p{
  color:#526174 !important;
  -webkit-text-fill-color:#526174 !important;
}
body:not(.light) .crm-edit-shell input,
body:not(.light) .crm-edit-shell select,
body:not(.light) .crm-edit-shell textarea{
  background:#ffffff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9), 0 8px 18px rgba(15,23,42,.04) !important;
  color-scheme:light !important;
}
body:not(.light) .crm-edit-shell input::placeholder,
body:not(.light) .crm-edit-shell textarea::placeholder{
  color:#94a3b8 !important;
  -webkit-text-fill-color:#94a3b8 !important;
  opacity:1 !important;
}
body:not(.light) .crm-edit-shell input:focus,
body:not(.light) .crm-edit-shell select:focus,
body:not(.light) .crm-edit-shell textarea:focus{
  border-color:rgba(37,99,235,.50) !important;
  box-shadow:0 0 0 4px rgba(37,99,235,.12), 0 10px 24px rgba(37,99,235,.08) !important;
}
body:not(.light) .crm-edit-shell option{
  background:#ffffff !important;
  color:#0f172a !important;
}
body:not(.light) .crm-edit-shell .crm-logo-upload-card,
body:not(.light) .crm-edit-shell .calc-box{
  background:#ffffff !important;
  border-color:#cbd5e1 !important;
  color:#0f172a !important;
}
body:not(.light) .crm-edit-shell .crm-logo-upload-card *,
body:not(.light) .crm-edit-shell .calc-box *{
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
}
body:not(.light) .crm-edit-shell .crm-edit-savebar{
  background:#ffffff !important;
  border-color:#dbe3ee !important;
}
body:not(.light) .crm-edit-shell .crm-edit-save-actions{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}
body:not(.light) .crm-edit-shell .crm-edit-save-actions .btn.ghost{
  background:#ffffff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 10px 22px rgba(15,23,42,.06) !important;
}
body:not(.light) .crm-edit-shell .crm-edit-save-actions .btn.primary{
  background:linear-gradient(135deg, #2563eb 0%, #60a5fa 100%) !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border:0 !important;
  box-shadow:0 18px 32px rgba(37,99,235,.24) !important;
}

/* v582 — Tablet proof interaction/layout pass
   A dedicated middle layout for iPad/tablet widths so the UI stays touch-friendly
   without falling back to the narrow mobile stack. */
@media (min-width: 768px) and (max-width: 1180px) {
  :root {
    --tablet-rail-width: 88px;
    --tablet-touch: 48px;
  }

  body,
  body.is-tablet {
    font-size: 15px;
  }

  .topbar {
    height: 68px;
    min-height: 68px;
    flex-direction: row !important;
    align-items: center !important;
    padding: 0 16px;
    gap: 12px;
  }

  .topnav {
    width: auto !important;
    margin-left: auto;
    justify-content: flex-end !important;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .brand2 {
    padding: 6px 8px;
  }

  .brand2-tag,
  .topbar-user-copy {
    display: none !important;
  }

  .topbar .btn,
  .topnav .btn,
  .theme-btn,
  .topbar-user,
  .language-switcher,
  .language-switcher select,
  .language-dropdown,
  .language-trigger {
    min-height: var(--tablet-touch);
  }

  .shell {
    flex-direction: row !important;
    min-height: calc(100vh - 68px);
  }

  .sidebar,
  .sidebar.collapsed {
    width: var(--tablet-rail-width) !important;
    min-width: var(--tablet-rail-width);
    padding: 16px 10px !important;
    border-right: 1px solid var(--border) !important;
    border-bottom: 0 !important;
    position: sticky;
    top: 68px;
    align-self: flex-start;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 30;
  }

  .sidebar-logo,
  .side-label,
  .side-chevron,
  .side-submenu,
  .sidebar.collapsed .sidebar-logo,
  .sidebar.collapsed .side-label,
  .sidebar.collapsed .side-chevron,
  .sidebar.collapsed .side-submenu {
    opacity: 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
    transform: translateX(-4px) !important;
    pointer-events: none !important;
  }

  .sidebar-top,
  .sidebar.collapsed .sidebar-top {
    justify-content: center !important;
  }

  .sidebar-toggle,
  .sidebar.collapsed .sidebar-toggle {
    width: var(--tablet-touch);
    height: var(--tablet-touch);
    margin: 0 auto;
  }

  .side-link,
  .side-group-toggle,
  .sidebar.collapsed .side-link {
    justify-content: center !important;
    width: var(--tablet-touch);
    height: var(--tablet-touch);
    min-height: var(--tablet-touch);
    padding: 0 !important;
    margin: 0 auto;
    border-radius: 16px;
  }

  .side-group-main {
    justify-content: center;
  }

  .side-icon {
    width: 24px;
    min-width: 24px;
    font-size: 18px;
  }

  .side-link:hover,
  .side-group-toggle:hover {
    transform: translateX(0) scale(1.03);
  }

  .side-link.active::before {
    left: -8px;
    top: 10px;
    bottom: 10px;
  }

  .content {
    min-width: 0;
    padding: 20px;
  }

  .page-head,
  .panel,
  .form-card,
  .plan-card,
  .kpi-card,
  .premium-form-card,
  .glass-visual-card,
  .crm-table-wrap,
  .materials-table-wrap,
  .users-table-wrap {
    border-radius: 22px;
  }

  .row-between {
    align-items: center;
  }

  .kpi-grid,
  .glass-kpis,
  .stats-grid,
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px;
  }

  .kpi-card {
    min-height: 118px;
    padding: 18px;
  }

  .kpi-value {
    font-size: 34px;
  }

  .crm-grid,
  .plans-grid,
  .charts-grid,
  .havexa-hero-grid,
  .roof-ai-layout {
    grid-template-columns: 1fr !important;
  }

  .form-row-2,
  .modal-form-grid,
  .customer-modal-grid,
  .supplier-modal-grid,
  .material-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .search-input,
  .command-input,
  .btn,
  button,
  .grid-enhancer-sort,
  .pagination-btn,
  .action-btn-inline,
  .table td .btn {
    min-height: var(--tablet-touch);
  }

  input,
  select,
  textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  .table,
  .crm-real-grid,
  .supplier-real-grid,
  .materials-table--advanced,
  .users-table--advanced,
  .offertes-table--advanced {
    font-size: 14px;
  }

  .table th,
  .table td,
  .crm-real-grid th,
  .crm-real-grid td,
  .supplier-real-grid th,
  .supplier-real-grid td,
  .materials-table--advanced th,
  .materials-table--advanced td,
  .users-table--advanced th,
  .users-table--advanced td,
  .offertes-table--advanced th,
  .offertes-table--advanced td {
    padding: 13px 12px;
  }

  .crm-table-wrap,
  .materials-table-wrap,
  .users-table-wrap,
  .table-responsive,
  .hvx-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table td:last-child,
  .crm-real-grid td:last-child,
  .supplier-real-grid td:last-child,
  .materials-table--advanced td:last-child,
  .users-table--advanced td:last-child,
  .offertes-table--advanced td:last-child {
    min-width: 168px;
  }

  .table .btn,
  .action-btn-inline,
  .user-actions .btn,
  .supplier-row-actions .btn,
  .crm-row-actions .btn,
  .materials-row-actions .btn {
    padding-inline: 13px;
    border-radius: 14px;
  }

  /* Tablet modals: desktop-like width, but with touch-friendly sticky controls. */
  .premium-modal,
  .profile-modal,
  .crm-modal,
  .supplier-modal,
  .material-modal,
  .quote-template-modal,
  .modal-card,
  .pricing-modal-dialog {
    width: min(92vw, 1120px) !important;
    max-width: min(92vw, 1120px) !important;
  }

  .profile-modal-body,
  .crm-modal-body,
  .supplier-modal-body,
  .material-modal-body,
  .premium-modal-body,
  .modal-body {
    max-height: min(70vh, 760px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .profile-modal-footer,
  .crm-modal-footer,
  .supplier-modal-footer,
  .material-modal-footer,
  .premium-modal-footer,
  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: flex;
    justify-content: space-between !important;
    align-items: center;
    gap: 18px;
    width: 100%;
  }

  .modal-actions .btn,
  .profile-modal-footer .btn,
  .crm-modal-footer .btn,
  .supplier-modal-footer .btn,
  .material-modal-footer .btn,
  .premium-modal-footer .btn {
    min-width: min(280px, 42%);
    min-height: 56px;
  }

  /* Dakmeting tablet flow: larger map, larger tool buttons, compact accordions. */
  .roof-map,
  #dakMap,
  #manualMap,
  .dakmeting-map,
  .mapboxgl-map {
    min-height: 520px;
  }

  .roof-tool-grid,
  .dakmeting-layout,
  .dakmeting-grid {
    grid-template-columns: 1fr !important;
  }

  .dakmeting-toolbar,
  .manual-draw-toolbar,
  .roof-actions,
  .roof-source-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
  }

  .dakmeting-toolbar .btn,
  .manual-draw-toolbar .btn,
  .roof-actions .btn,
  .roof-source-actions .btn {
    min-height: 52px;
    padding-inline: 18px;
  }

  .compact-section-card,
  .roof-compact-card,
  .dak-card {
    scroll-margin-top: 84px;
  }
}

@media (min-width: 768px) and (max-width: 900px) {
  .content {
    padding: 16px;
  }

  .kpi-grid,
  .glass-kpis,
  .stats-grid,
  .dashboard-kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .form-row-2,
  .modal-form-grid,
  .customer-modal-grid,
  .supplier-modal-grid,
  .material-modal-grid {
    grid-template-columns: 1fr !important;
  }

  .modal-actions,
  .profile-modal-footer,
  .crm-modal-footer,
  .supplier-modal-footer,
  .material-modal-footer,
  .premium-modal-footer {
    flex-direction: row !important;
  }
}

/* v585 - global responsive modal footer alignment fix
   Keep modal action buttons aligned on tablet/small desktop and only stack on very narrow phones. */
@media (max-width: 1180px) {
  :is(
    .profile-modal-footer,
    .crm-modal-footer,
    .supplier-modal-footer,
    .material-modal-footer,
    .premium-modal-footer,
    .quote-modal-footer,
    .quote-template-modal__footer,
    .hx-modal-footer,
    .modal-footer,
    .modal-actions,
    .logout-confirm-actions,
    .hx-confirm-delete-footer,
    .delete-modal-footer
  ) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: clamp(18px, 8vw, 140px) !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  :is(
    .profile-modal-footer,
    .crm-modal-footer,
    .supplier-modal-footer,
    .material-modal-footer,
    .premium-modal-footer,
    .quote-modal-footer,
    .quote-template-modal__footer,
    .hx-modal-footer,
    .modal-footer,
    .modal-actions,
    .logout-confirm-actions,
    .hx-confirm-delete-footer,
    .delete-modal-footer
  ) > :is(.hx-form-actions, .modal-actions) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: clamp(18px, 8vw, 140px) !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  :is(
    .profile-modal-footer,
    .crm-modal-footer,
    .supplier-modal-footer,
    .material-modal-footer,
    .premium-modal-footer,
    .quote-modal-footer,
    .quote-template-modal__footer,
    .hx-modal-footer,
    .modal-footer,
    .modal-actions,
    .logout-confirm-actions,
    .hx-confirm-delete-footer,
    .delete-modal-footer
  ) :is(.btn, button) {
    width: clamp(180px, 28vw, 320px) !important;
    min-width: clamp(180px, 28vw, 320px) !important;
    max-width: clamp(180px, 28vw, 320px) !important;
    flex: 0 0 auto !important;
    min-height: 54px !important;
    margin: 0 !important;
  }

  :is(
    .profile-modal-footer,
    .crm-modal-footer,
    .supplier-modal-footer,
    .material-modal-footer,
    .premium-modal-footer,
    .quote-modal-footer,
    .quote-template-modal__footer,
    .hx-modal-footer,
    .modal-footer,
    .modal-actions,
    .logout-confirm-actions,
    .hx-confirm-delete-footer,
    .delete-modal-footer
  ) :is(.btn.ghost, button.ghost, .btn-secondary, .cancel, [data-modal-cancel]) {
    margin-right: auto !important;
  }

  :is(
    .profile-modal-footer,
    .crm-modal-footer,
    .supplier-modal-footer,
    .material-modal-footer,
    .premium-modal-footer,
    .quote-modal-footer,
    .quote-template-modal__footer,
    .hx-modal-footer,
    .modal-footer,
    .modal-actions,
    .logout-confirm-actions,
    .hx-confirm-delete-footer,
    .delete-modal-footer
  ) :is(.btn.primary, button.primary, .btn-danger, .delete, [type="submit"]) {
    margin-left: auto !important;
  }
}

@media (max-width: 520px) {
  :is(
    .profile-modal-footer,
    .crm-modal-footer,
    .supplier-modal-footer,
    .material-modal-footer,
    .premium-modal-footer,
    .quote-modal-footer,
    .quote-template-modal__footer,
    .hx-modal-footer,
    .modal-footer,
    .modal-actions,
    .logout-confirm-actions,
    .hx-confirm-delete-footer,
    .delete-modal-footer
  ),
  :is(
    .profile-modal-footer,
    .crm-modal-footer,
    .supplier-modal-footer,
    .material-modal-footer,
    .premium-modal-footer,
    .quote-modal-footer,
    .quote-template-modal__footer,
    .hx-modal-footer,
    .modal-footer,
    .modal-actions,
    .logout-confirm-actions,
    .hx-confirm-delete-footer,
    .delete-modal-footer
  ) > :is(.hx-form-actions, .modal-actions) {
    flex-direction: column-reverse !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  :is(
    .profile-modal-footer,
    .crm-modal-footer,
    .supplier-modal-footer,
    .material-modal-footer,
    .premium-modal-footer,
    .quote-modal-footer,
    .quote-template-modal__footer,
    .hx-modal-footer,
    .modal-footer,
    .modal-actions,
    .logout-confirm-actions,
    .hx-confirm-delete-footer,
    .delete-modal-footer
  ) :is(.btn, button) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* v588 - user modals: remove remaining light/white header rim in dark mode */
body:not(.light) #userModal .user-modal,
body:not(.light) .user-modal-overlay .user-modal {
  background: #f8fafc !important;
  border: 1px solid rgba(45, 89, 176, 0.72) !important;
  outline: 0 !important;
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.58), 0 0 0 1px rgba(15, 23, 42, 0.55) !important;
  overflow: hidden !important;
}
body:not(.light) #userModal .user-modal-hero,
body:not(.light) .user-modal-overlay .user-modal-hero {
  background: linear-gradient(135deg, #142238 0%, #1f3766 54%, #24489b 100%) !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  margin: -1px -1px 0 -1px !important;
  width: calc(100% + 2px) !important;
  border-radius: 34px 34px 0 0 !important;
  overflow: hidden !important;
}
body:not(.light) #userModal .user-modal-headbar,
body:not(.light) .user-modal-overlay .user-modal-headbar {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
body:not(.light) #userModal .user-modal-hero::before,
body:not(.light) #userModal .user-modal-hero::after,
body:not(.light) #userModal .user-modal::before,
body:not(.light) #userModal .user-modal::after,
body:not(.light) .user-modal-overlay .user-modal-hero::before,
body:not(.light) .user-modal-overlay .user-modal-hero::after,
body:not(.light) .user-modal-overlay .user-modal::before,
body:not(.light) .user-modal-overlay .user-modal::after {
  content: none !important;
  display: none !important;
}
body:not(.light) #userModal .user-modal-body,
body:not(.light) .user-modal-overlay .user-modal-body {
  border-top: 0 !important;
  background: #f8fafc !important;
}

/* v589 - user modal: remove visible rim around dark header completely */
body:not(.light) #userModal .user-modal,
body:not(.light) .user-modal-overlay#userModal .user-modal {
  border: 0 !important;
  outline: 0 !important;
  background: #f8fbff !important;
  box-shadow: 0 36px 95px rgba(2,8,23,.58) !important;
  overflow: hidden !important;
}
body:not(.light) #userModal .user-modal-hero,
body:not(.light) .user-modal-overlay#userModal .user-modal-hero {
  margin: 0 !important;
  width: 100% !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: linear-gradient(135deg,#111827 0%,#1e293b 52%,#1e3f8f 118%) !important;
  border-radius: 34px 34px 0 0 !important;
  background-clip: border-box !important;
}
body:not(.light) #userModal .user-modal-headbar,
body:not(.light) .user-modal-overlay#userModal .user-modal-headbar {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
body:not(.light) #userDeleteModal .hx-confirm-delete-shell {
  border: 0 !important;
  outline: 0 !important;
  background: #f8fbff !important;
  box-shadow: 0 36px 95px rgba(2,8,23,.58) !important;
  overflow: hidden !important;
}
body:not(.light) #userDeleteModal .hx-confirm-delete-hero {
  margin: 0 !important;
  width: 100% !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: linear-gradient(135deg,#111827 0%,#1e293b 52%,#1e3f8f 118%) !important;
  border-radius: 34px 34px 0 0 !important;
  background-clip: border-box !important;
}

/* v595 - Modern calmer dark-mode hierarchy
   Gradient is reserved for page/module hero sections. Functional cards use a fixed calm surface. */
body:not(.light){
  --hx-dark-hero-bg:
    radial-gradient(circle at 88% 12%, rgba(59,130,246,.24), transparent 34%),
    radial-gradient(circle at 8% 0%, rgba(14,165,233,.10), transparent 38%),
    linear-gradient(135deg, #162334 0%, #102033 48%, #0b1727 100%);
  --hx-dark-card-bg:#172838;
  --hx-dark-card-bg-2:#102033;
  --hx-dark-card-border:rgba(148,163,184,.16);
}

body:not(.light) :is(
  .suppliers-hero,
  .crm-hero,
  .users-hero,
  .projects-hero,
  .offertes-hero,
  .materials-hero,
  .quote-templates-hero,
  .billing-hero,
  .faq-hero,
  .dashboard-hero,
  .module-hero,
  .page-hero,
  .havexa-module-hero
){
  background:var(--hx-dark-hero-bg) !important;
  border-color:rgba(96,165,250,.22) !important;
  box-shadow:0 24px 56px rgba(2,6,23,.34) !important;
}

body:not(.light) :is(
  .suppliers-hero .supplier-stat,
  .crm-hero .stat-card,
  .crm-hero .crm-stat,
  .stat-card,
  .kpi-card,
  .metric-card,
  .summary-card
){
  background:var(--hx-dark-card-bg-2) !important;
  border-color:var(--hx-dark-card-border) !important;
  box-shadow:0 18px 32px rgba(2,6,23,.24) !important;
}

body:not(.light) :is(
  .panel,
  .grid-card,
  .table-card,
  .form-card,
  .users-grid-card,
  .supplier-grid-card,
  .crm-grid-card,
  .materials-grid-card,
  .quote-template-grid-card,
  .card:not(.auth-card):not(.pricing-card),
  .hx-card,
  .data-card
){
  background:var(--hx-dark-card-bg) !important;
  border-color:var(--hx-dark-card-border) !important;
  box-shadow:0 18px 40px rgba(2,6,23,.24) !important;
}

body:not(.light) :is(.suppliers-hero,.crm-hero,.users-hero,.projects-hero,.offertes-hero,.materials-hero,.module-hero,.page-hero) :is(h1,h2,h3,p,.muted,.crm-sub){
  color:#f8fafc !important;
}

body:not(.light) :is(.stat-card,.supplier-stat,.kpi-card,.metric-card,.summary-card) :is(.supplier-stat-label,.stat-label,.kpi-label,.metric-label){
  color:rgba(226,232,240,.76) !important;
}
body:not(.light) :is(.stat-card,.supplier-stat,.kpi-card,.metric-card,.summary-card) :is(.supplier-stat-value,.stat-value,.kpi-value,.metric-value){
  color:#ffffff !important;
}

/* v596 - Gradient page background + calm fixed card surfaces */
body:not(.light){
  --hx-page-gradient:
    radial-gradient(circle at 82% 6%, rgba(59,130,246,.22), transparent 30%),
    radial-gradient(circle at 8% 12%, rgba(14,165,233,.10), transparent 30%),
    linear-gradient(135deg, #0a1220 0%, #102033 44%, #081221 100%);
  --hx-fixed-card-bg:#172838;
  --hx-fixed-card-bg-soft:#122437;
  --hx-fixed-card-border:rgba(148,163,184,.18);
}
body:not(.light){
  background:var(--hx-page-gradient) fixed !important;
}
body:not(.light) :is(.app-main,.main-content,.page-content,.content-shell,.page-shell,.dashboard-shell,.suppliers-shell,.crm-shell,.materials-shell,.users-shell,.projects-shell,.offertes-shell){
  background:transparent !important;
}
body:not(.light) :is(
  .suppliers-hero,.crm-hero,.users-hero,.projects-hero,.offertes-hero,.materials-hero,.quote-templates-hero,.billing-hero,.faq-hero,.dashboard-hero,.module-hero,.page-hero,.havexa-module-hero,
  .panel,.grid-card,.table-card,.form-card,.users-grid-card,.supplier-grid-card,.crm-grid-card,.materials-grid-card,.quote-template-grid-card,.card:not(.auth-card):not(.pricing-card),.hx-card,.data-card
){
  background:var(--hx-fixed-card-bg) !important;
  border-color:var(--hx-fixed-card-border) !important;
  box-shadow:0 18px 42px rgba(2,6,23,.25) !important;
}
body:not(.light) :is(.supplier-stat,.stat-card,.kpi-card,.metric-card,.summary-card,.crm-stat){
  background:var(--hx-fixed-card-bg-soft) !important;
  border-color:var(--hx-fixed-card-border) !important;
  box-shadow:0 16px 32px rgba(2,6,23,.20) !important;
}
body:not(.light) :is(.suppliers-hero,.crm-hero,.users-hero,.projects-hero,.offertes-hero,.materials-hero,.module-hero,.page-hero) :is(h1,h2,h3,p,.muted,.crm-sub){
  color:#f8fafc !important;
}

/* v596 - supplier delete modal like user delete modal */
body:not(.light) #supplierDeleteModal .hx-confirm-delete-shell{
  background:#f8fbff !important;
  border:0 !important;
  outline:0 !important;
  overflow:hidden !important;
  box-shadow:0 36px 95px rgba(2,8,23,.58) !important;
}
body:not(.light) #supplierDeleteModal .hx-confirm-delete-hero{
  margin:0 !important;
  width:100% !important;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background:linear-gradient(135deg,#111827 0%,#1e293b 52%,#1e3f8f 118%) !important;
  border-radius:34px 34px 0 0 !important;
}
body:not(.light) #supplierDeleteModal .hx-confirm-delete-body{
  background:#f8fbff !important;
  color:#0f172a !important;
  padding:28px 32px 0 !important;
}
body:not(.light) #supplierDeleteModal .hx-confirm-delete-details{
  background:#eef4fb !important;
  border:1px solid #cbd8e6 !important;
  border-radius:24px !important;
  padding:20px 22px !important;
  box-shadow:0 14px 30px rgba(15,23,42,.08) !important;
}
#supplierDeleteModal .hx-confirm-delete-meta{
  white-space:pre-line !important;
  line-height:1.55 !important;
}
body:not(.light) #supplierDeleteModal .hx-confirm-delete-meta{
  color:#334155 !important;
}
body:not(.light) #supplierDeleteModal .hx-confirm-delete-footer{
  background:#f8fbff !important;
  border-top:1px solid #d9e2ec !important;
  margin:28px -32px 0 !important;
  padding:28px 32px !important;
}
body:not(.light) #supplierDeleteModal .hx-confirm-delete-footer .hx-form-actions{
  width:100% !important;
  display:flex !important;
  justify-content:space-between !important;
  gap:clamp(24px, 18vw, 220px) !important;
}
body:not(.light) #supplierDeleteModal .hx-confirm-delete-footer .btn{
  min-width:220px !important;
}
@media (max-width:560px){
  body:not(.light) #supplierDeleteModal .hx-confirm-delete-footer .hx-form-actions{ flex-direction:column-reverse !important; gap:12px !important; }
  body:not(.light) #supplierDeleteModal .hx-confirm-delete-footer .btn{ width:100% !important; min-width:0 !important; }
}

/* v597 - Reverse dark-mode page gradient direction (right-to-left) */
body:not(.light){
  --hx-page-gradient:
    radial-gradient(circle at 18% 6%, rgba(59,130,246,.22), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(14,165,233,.10), transparent 30%),
    linear-gradient(225deg, #0a1220 0%, #102033 44%, #081221 100%);
}

/* v600 billing PDF icon light-mode fix */
.billing-pdf-download-btn .billing-pdf-download-icon,
.billing-pdf-download-btn .billing-pdf-download-icon svg{
  width:18px !important;
  height:18px !important;
  min-width:18px !important;
  max-width:18px !important;
  color:currentColor !important;
  display:inline-flex !important;
  flex:0 0 18px !important;
}
.billing-pdf-download-btn .billing-pdf-download-icon svg,
.billing-pdf-download-btn .billing-pdf-download-icon svg *,
.billing-pdf-download-btn svg,
.billing-pdf-download-btn svg *{
  fill:none !important;
  stroke:currentColor !important;
  stroke-width:2 !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
}
body.light .billing-pdf-download-btn,
body.light .billing-pdf-download-btn:visited{
  color:#fff !important;
}
body.light .billing-pdf-download-btn .billing-pdf-download-icon,
body.light .billing-pdf-download-btn .billing-pdf-download-icon svg,
body.light .billing-pdf-download-btn .billing-pdf-download-icon svg *{
  color:#fff !important;
  stroke:#fff !important;
  fill:none !important;
}

/* v603 - Billing detail PDF icon and invoice number interpolation fix */
.billing-pdf-download-btn .billing-pdf-download-icon{
  width:22px !important;
  height:22px !important;
  min-width:22px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  color:#fff !important;
}
.billing-pdf-download-btn .billing-pdf-glyph{
  width:18px !important;
  height:22px !important;
  display:inline-flex !important;
  align-items:flex-end !important;
  justify-content:center !important;
  position:relative !important;
  border:2px solid currentColor !important;
  border-radius:3px !important;
  color:#fff !important;
  background:transparent !important;
  font-size:5px !important;
  font-weight:900 !important;
  line-height:1 !important;
  letter-spacing:-.2px !important;
  padding-bottom:3px !important;
  box-sizing:border-box !important;
}
.billing-pdf-download-btn .billing-pdf-glyph::before{
  content:"" !important;
  position:absolute !important;
  top:-2px !important;
  right:-2px !important;
  width:7px !important;
  height:7px !important;
  background:linear-gradient(135deg, transparent 0 48%, currentColor 50% 58%, transparent 60%) !important;
  border-left:2px solid currentColor !important;
  border-bottom:2px solid currentColor !important;
  transform:translate(-1px,1px) rotate(0deg) !important;
  opacity:.95 !important;
}
.billing-pdf-download-btn svg,
.billing-pdf-download-btn svg *{
  fill:none !important;
  stroke:currentColor !important;
}
body.light .billing-pdf-download-btn .billing-pdf-glyph,
body:not(.light) .billing-pdf-download-btn .billing-pdf-glyph{
  color:#fff !important;
  background:transparent !important;
}

/* v604 - quote templates modal backdrop/topbar blur + corrected create label */
.quote-template-modal-overlay,
.quote-template-modal-overlay.is-open,
.quote-template-modal-overlay[data-open="1"]{
  z-index: 90000 !important;
}
.quote-template-modal-overlay.is-open,
.quote-template-modal-overlay[data-open="1"]{
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.48) !important;
  backdrop-filter: blur(12px) saturate(0.9) !important;
  -webkit-backdrop-filter: blur(12px) saturate(0.9) !important;
}
body.modal-open .quote-template-modal-overlay ~ .topbar,
body.modal-open .quote-template-modal-overlay ~ .topnav{
  filter: none !important;
}
.quote-template-modal{
  position: relative !important;
  z-index: 90001 !important;
}

/* HAVEXA v608 CX dashboard pass */
.cx-dashboard-simple {
  display: grid;
  gap: 18px;
}
.cx-welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(22px, 3vw, 34px);
  border-radius: 28px;
  border: 1px solid rgba(96, 165, 250, .20);
  background:
    radial-gradient(circle at 8% 12%, rgba(59,130,246,.22), transparent 34%),
    linear-gradient(135deg, rgba(22,35,52,.98), rgba(15,29,46,.98) 48%, rgba(10,22,38,.98));
  box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
  color: #fff;
}
body.light .cx-welcome-card,
body:not(.dark):not(.dark-mode)[data-theme="light"] .cx-welcome-card {
  color: #0f172a;
  background: linear-gradient(135deg, #fff, #f3f7ff);
  border-color: rgba(37,99,235,.14);
}
.cx-welcome-card h1 {
  margin: 8px 0 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}
.cx-welcome-card p {
  margin: 0;
  color: rgba(226,232,240,.82);
  font-size: 1.05rem;
}
body.light .cx-welcome-card p { color: #64748b; }
.cx-eyebrow {
  display: inline-flex;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 900;
  font-size: .78rem;
  color: #60a5fa;
}
.cx-primary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cx-action-grid,
.cx-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.cx-flow-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cx-action-card,
.cx-flow-step {
  text-decoration: none;
  color: inherit;
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(255,255,255,.035);
  padding: 18px;
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 7px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.cx-action-card:hover,
.cx-flow-step:hover {
  transform: translateY(-2px);
  border-color: rgba(96,165,250,.42);
  background: rgba(59,130,246,.08);
}
.cx-action-card strong {
  font-size: 2.35rem;
  line-height: 1;
}
.cx-action-card span,
.cx-flow-step strong {
  font-weight: 900;
  font-size: 1.03rem;
}
.cx-action-card small,
.cx-flow-step small {
  color: var(--muted, #94a3b8);
  line-height: 1.35;
}
.cx-flow-step span {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(59,130,246,.16);
  color: #60a5fa;
  font-weight: 900;
}
body.light .cx-action-card,
body.light .cx-flow-step {
  background: #fff;
  border-color: rgba(203,213,225,.9);
  box-shadow: 0 14px 34px rgba(15,23,42,.06);
}
.cx-empty-help {
  border-style: dashed !important;
}
@media (max-width: 1180px) {
  .cx-welcome-card { align-items: flex-start; flex-direction: column; }
  .cx-primary-actions { justify-content: flex-start; width: 100%; }
  .cx-action-grid,
  .cx-flow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .cx-action-grid,
  .cx-flow-grid,
  .cx-simple-kpis { grid-template-columns: 1fr !important; }
  .cx-primary-actions .btn { width: 100%; justify-content: center; }
}

/* v608: simpler navigation for non-admin users */
body:not(.is-admin) .sidebar .side-link[href="/admin/translations"],
body:not(.is-admin) .sidebar .side-link[href="/analytics"],
body:not(.is-admin) .sidebar .side-link[href="/users"] {
  display: none !important;
}

/* v608: tablet/comfort touch polish */
@media (min-width: 768px) and (max-width: 1180px) {
  .btn,
  button,
  .side-link,
  input,
  select,
  textarea {
    min-height: 46px;
  }
  .modal,
  .crm-modal,
  .havexa-modal,
  [role="dialog"] {
    max-width: min(94vw, 1080px) !important;
  }
  .table-shell,
  .data-grid-wrap,
  .grid-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* v610 - Quote templates card background polish
   Make the existing templates area calm and consistent in light and dark mode. */
.quote-templates-page{
  background: transparent !important;
  box-shadow: none !important;
}
.quote-templates-board{
  padding: 26px 28px 30px !important;
  border-radius: 28px !important;
  background: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .08) !important;
  overflow: hidden !important;
}
.quote-templates-board > .card-head{
  margin: 0 0 18px 0 !important;
  padding: 0 !important;
}
.quote-templates-board > .card-head h3{
  color: #0f172a !important;
}
.qt-summary--modern{
  gap: 12px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  box-shadow: none !important;
}
.qt-summary--modern .qt-summary-item{
  min-height: 108px !important;
  padding: 22px 24px !important;
  border: 1px solid rgba(148, 163, 184, .20) !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045) !important;
}
.qt-summary--modern .qt-summary-item:last-child{
  border-right: 1px solid rgba(148, 163, 184, .20) !important;
}
.qt-summary-value{
  color: #0f172a !important;
  font-weight: 800 !important;
}
.qt-summary-label{
  color: #475569 !important;
}
.quote-templates-board .calc-box{
  margin-top: 18px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .045) !important;
}
.quote-templates-board .calc-box strong{
  color: #0f172a !important;
}
.quote-templates-board .calc-box .crm-sub{
  color: #64748b !important;
}
body:not(.light) .quote-templates-board,
.dark .quote-templates-board,
body.dark .quote-templates-board,
body.dark-mode .quote-templates-board,
body[data-theme="dark"] .quote-templates-board{
  background: #172838 !important;
  border: 1px solid rgba(148, 163, 184, .16) !important;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .26) !important;
}
body:not(.light) .quote-templates-board > .card-head h3,
.dark .quote-templates-board > .card-head h3,
body.dark .quote-templates-board > .card-head h3,
body.dark-mode .quote-templates-board > .card-head h3,
body[data-theme="dark"] .quote-templates-board > .card-head h3{
  color: #f8fbff !important;
}
body:not(.light) .qt-summary--modern,
.dark .qt-summary--modern,
body.dark .qt-summary--modern,
body.dark-mode .qt-summary--modern,
body[data-theme="dark"] .qt-summary--modern{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body:not(.light) .qt-summary--modern .qt-summary-item,
.dark .qt-summary--modern .qt-summary-item,
body.dark .qt-summary--modern .qt-summary-item,
body.dark-mode .qt-summary--modern .qt-summary-item,
body[data-theme="dark"] .qt-summary--modern .qt-summary-item{
  background: #102033 !important;
  border: 1px solid rgba(148, 163, 184, .14) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .18) !important;
}
body:not(.light) .qt-summary-value,
.dark .qt-summary-value,
body.dark .qt-summary-value,
body.dark-mode .qt-summary-value,
body[data-theme="dark"] .qt-summary-value{
  color: #f8fbff !important;
}
body:not(.light) .qt-summary-label,
.dark .qt-summary-label,
body.dark .qt-summary-label,
body.dark-mode .qt-summary-label,
body[data-theme="dark"] .qt-summary-label{
  color: #9fb0c6 !important;
}
body:not(.light) .quote-templates-board .calc-box,
.dark .quote-templates-board .calc-box,
body.dark .quote-templates-board .calc-box,
body.dark-mode .quote-templates-board .calc-box,
body[data-theme="dark"] .quote-templates-board .calc-box{
  background: #102033 !important;
  border: 1px solid rgba(148, 163, 184, .14) !important;
  color: #f8fbff !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .18) !important;
}
body:not(.light) .quote-templates-board .calc-box strong,
.dark .quote-templates-board .calc-box strong,
body.dark .quote-templates-board .calc-box strong,
body.dark-mode .quote-templates-board .calc-box strong,
body[data-theme="dark"] .quote-templates-board .calc-box strong{
  color: #f8fbff !important;
}
body:not(.light) .quote-templates-board .calc-box .crm-sub,
.dark .quote-templates-board .calc-box .crm-sub,
body.dark .quote-templates-board .calc-box .crm-sub,
body.dark-mode .quote-templates-board .calc-box .crm-sub,
body[data-theme="dark"] .quote-templates-board .calc-box .crm-sub{
  color: #9fb0c6 !important;
}
@media (max-width: 980px){
  .quote-templates-board{padding: 22px 20px 24px !important;}
  .qt-summary--modern{grid-template-columns: repeat(2, minmax(0, 1fr)) !important;}
}
@media (max-width: 640px){
  .qt-summary--modern{grid-template-columns: 1fr !important;}
}


/* v612 - quote template create/edit modal aligned with supplier modal in dark mode */
body:not(.light) .quote-template-modal{
  background:linear-gradient(135deg,#162334 0%,#213b73 100%) !important;
  border-color:transparent !important;
  box-shadow:0 30px 90px rgba(2,6,23,.58) !important;
  color:#0f172a !important;
  overflow:hidden !important;
}
body:not(.light) .quote-template-modal::before{
  content:"" !important;
  position:absolute !important;
  inset:0 0 auto 0 !important;
  height:clamp(210px,30vh,320px) !important;
  background:linear-gradient(135deg,#162334 0%,#213b73 100%) !important;
  z-index:0 !important;
  pointer-events:none !important;
}
body:not(.light) .quote-template-modal__hero{
  position:relative !important;
  z-index:1 !important;
  background:linear-gradient(135deg,#162334 0%,#213b73 100%) !important;
  border:0 !important;
  border-bottom:1px solid rgba(15,23,42,.12) !important;
  box-shadow:none !important;
}
body:not(.light) .quote-template-modal__headbar{
  background:transparent !important;
}
body:not(.light) .quote-template-modal__brandname,
body:not(.light) .quote-template-modal__brandtag,
body:not(.light) .quote-template-modal__copy h3{
  color:#ffffff !important;
}
body:not(.light) .quote-template-modal__copy p{
  color:rgba(255,255,255,.72) !important;
}
body:not(.light) .quote-template-modal__close{
  background:rgba(255,255,255,.12) !important;
  color:#fff !important;
  border:1px solid rgba(255,255,255,.18) !important;
  box-shadow:none !important;
}
body:not(.light) .quote-template-modal__close:hover{
  background:rgba(255,255,255,.18) !important;
}
body:not(.light) .quote-template-modal__body{
  position:relative !important;
  z-index:1 !important;
  background:#ffffff !important;
  color:#0f172a !important;
  border-top:0 !important;
}
body:not(.light) .quote-template-modal__footer{
  position:relative !important;
  z-index:2 !important;
  background:#ffffff !important;
  border-top:1px solid #e2e8f0 !important;
  padding:24px 30px calc(22px + env(safe-area-inset-bottom,0px)) !important;
}
body:not(.light) .quote-template-modal__footer .hx-form-actions{
  width:100% !important;
  margin:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:clamp(18px,7vw,120px) !important;
}
body:not(.light) .quote-template-modal__footer .btn{
  width:min(320px,42%) !important;
  min-width:220px !important;
  min-height:58px !important;
  border-radius:20px !important;
}
body:not(.light) .quote-template-modal__footer .btn.ghost{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 12px 28px rgba(15,23,42,.08) !important;
}
body:not(.light) .quote-template-modal__footer .btn.ghost:hover{
  background:#f8fafc !important;
  color:#0f172a !important;
  border-color:#b8c4d4 !important;
}
body:not(.light) .quote-template-modal__footer .btn.primary{
  background:linear-gradient(135deg,#2563eb 0%,#60a5fa 100%) !important;
  color:#fff !important;
  border:0 !important;
  box-shadow:0 18px 34px rgba(37,99,235,.24) !important;
}
body:not(.light) .quote-template-modal__form label,
body:not(.light) .quote-template-modal__form label span,
body:not(.light) .quote-template-modal__checkbox-row,
body:not(.light) .quote-template-modal__body h4,
body:not(.light) .quote-template-modal__body strong{
  color:#0f172a !important;
}
body:not(.light) .quote-template-modal__form input,
body:not(.light) .quote-template-modal__form select,
body:not(.light) .quote-template-modal__form textarea{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 10px 24px rgba(15,23,42,.04) !important;
  color-scheme:light !important;
}
body:not(.light) .quote-template-modal__form input:hover,
body:not(.light) .quote-template-modal__form select:hover,
body:not(.light) .quote-template-modal__form textarea:hover{
  background:#ffffff !important;
  border-color:#b8c4d4 !important;
}
body:not(.light) .quote-template-modal__form input:focus,
body:not(.light) .quote-template-modal__form select:focus,
body:not(.light) .quote-template-modal__form textarea:focus{
  background:#ffffff !important;
  color:#0f172a !important;
  border-color:#60a5fa !important;
  box-shadow:0 0 0 4px rgba(59,130,246,.14) !important;
}
body:not(.light) .quote-template-modal__form input::placeholder,
body:not(.light) .quote-template-modal__form textarea::placeholder{
  color:#94a3b8 !important;
}
body:not(.light) .quote-template-modal .calc-box,
body:not(.light) .quote-template-modal .qt-material-rules{
  background:#eef3f9 !important;
  border-color:#d6e0ec !important;
  color:#0f172a !important;
  box-shadow:none !important;
}
body:not(.light) .quote-template-modal .crm-sub,
body:not(.light) .quote-template-modal .qt-material-rules__head p,
body:not(.light) .quote-template-modal .qt-material-rule__hint{
  color:#64748b !important;
}
body:not(.light) .quote-template-modal .qt-material-rule{
  background:#ffffff !important;
  border-color:#d6e0ec !important;
  color:#0f172a !important;
}
@media (max-width:760px){
  body:not(.light) .quote-template-modal__footer .hx-form-actions{
    flex-direction:column-reverse !important;
    gap:12px !important;
  }
  body:not(.light) .quote-template-modal__footer .btn{
    width:100% !important;
    min-width:0 !important;
  }
}


/* v616 - quote template material i18n + light mode footer alignment */
.quote-template-modal__footer .hx-form-actions{
  width:100% !important;
  margin:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:clamp(18px,7vw,120px) !important;
}
.quote-template-modal__footer .btn{
  width:min(320px,42%) !important;
  min-width:220px !important;
  min-height:58px !important;
  border-radius:20px !important;
}
.quote-template-modal__footer .btn.ghost{
  justify-self:flex-start !important;
}
.quote-template-modal__footer .btn.primary{
  justify-self:flex-end !important;
}
@media (max-width:760px){
  .quote-template-modal__footer .hx-form-actions{
    flex-direction:column-reverse !important;
    gap:12px !important;
  }
  .quote-template-modal__footer .btn{
    width:100% !important;
    min-width:0 !important;
  }
}



/* V638 - Offertes new/edit modal: align with shared Havexa modal dark/light treatment */
.quote-create-backdrop{background:rgba(15,23,42,.58) !important; backdrop-filter:blur(10px) !important; -webkit-backdrop-filter:blur(10px) !important;}
.quote-create-modal,
.quote-edit-modal{background:rgba(255,255,255,.98) !important; border:1px solid rgba(15,23,42,.08) !important; box-shadow:0 30px 80px rgba(15,23,42,.18) !important; color:#0f172a !important;}
.quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar),
.quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar){background:linear-gradient(135deg,#ffffff 0%,#f8fbff 55%,#eef6ff 100%) !important; border-bottom:1px solid rgba(15,23,42,.08) !important; color:#0f172a !important;}
.quote-create-modal .crm-modal-body,
.quote-edit-modal .crm-modal-body{background:#f8fafc !important; color:#0f172a !important;}
.quote-create-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
.quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box){background:rgba(255,255,255,.92) !important; border:1px solid rgba(148,163,184,.22) !important; color:#0f172a !important; box-shadow:none !important;}
.quote-create-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name),
.quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name){color:#0f172a !important; -webkit-text-fill-color:#0f172a !important; opacity:1 !important;}
.quote-create-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag),
.quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag){color:#64748b !important; -webkit-text-fill-color:#64748b !important; opacity:1 !important;}
.quote-create-modal :is(input,select,textarea),
.quote-edit-modal :is(input,select,textarea){background:#ffffff !important; border:1px solid rgba(148,163,184,.32) !important; color:#0f172a !important; -webkit-text-fill-color:#0f172a !important; box-shadow:inset 0 1px 2px rgba(15,23,42,.04) !important;}
.quote-create-modal :is(input::placeholder,textarea::placeholder),
.quote-edit-modal :is(input::placeholder,textarea::placeholder){color:#94a3b8 !important; -webkit-text-fill-color:#94a3b8 !important; opacity:1 !important;}
.quote-create-modal .quote-modal-footer,
.quote-edit-modal .quote-modal-footer{background:transparent !important; border-top:1px solid rgba(148,163,184,.18) !important;}
.quote-create-modal .crm-modal-close,
.quote-edit-modal .crm-modal-close{background:#ffffff !important; border:1px solid rgba(15,23,42,.10) !important; color:#0f172a !important; box-shadow:0 8px 22px rgba(15,23,42,.06), inset 0 1px 0 rgba(255,255,255,.8) !important;}
body:not(.light) .quote-create-backdrop{background:rgba(2,6,23,.72) !important;}
body:not(.light) .quote-create-modal,
body:not(.light) .quote-edit-modal,
body.dark .quote-create-modal,
body.dark .quote-edit-modal,
body.dark-mode .quote-create-modal,
body.dark-mode .quote-edit-modal,
body[data-theme="dark"] .quote-create-modal,
body[data-theme="dark"] .quote-edit-modal{background:linear-gradient(180deg,rgba(15,23,42,.98),rgba(2,6,23,.96)) !important; border-color:rgba(96,165,250,.22) !important; color:#e5eef8 !important; box-shadow:0 30px 90px rgba(2,6,23,.62), inset 0 1px 0 rgba(255,255,255,.04) !important;}
body:not(.light) .quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar),
body:not(.light) .quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar),
body.dark .quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar),
body.dark .quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar),
body.dark-mode .quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar),
body.dark-mode .quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar),
body[data-theme="dark"] .quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar),
body[data-theme="dark"] .quote-edit-modal :is(.crm-modal-hero,.crm-modal-headbar){background:linear-gradient(135deg,rgba(15,33,52,.92),rgba(13,38,68,.76)) !important; border-color:rgba(96,165,250,.18) !important; color:#f8fafc !important;}
body:not(.light) .quote-create-modal .crm-modal-body,
body:not(.light) .quote-edit-modal .crm-modal-body,
body.dark .quote-create-modal .crm-modal-body,
body.dark .quote-edit-modal .crm-modal-body,
body.dark-mode .quote-create-modal .crm-modal-body,
body.dark-mode .quote-edit-modal .crm-modal-body,
body[data-theme="dark"] .quote-create-modal .crm-modal-body,
body[data-theme="dark"] .quote-edit-modal .crm-modal-body{background:transparent !important; color:#e5eef8 !important;}
body:not(.light) .quote-create-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body:not(.light) .quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body.dark .quote-create-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body.dark .quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body.dark-mode .quote-create-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body.dark-mode .quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body[data-theme="dark"] .quote-create-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box),
body[data-theme="dark"] .quote-edit-modal :is(.quote-create-card,.quote-margin-panel,.quote-audit-trail,.quote-edit-materials-card,.calc-box){background:rgba(2,12,27,.54) !important; border-color:rgba(96,165,250,.18) !important; color:#e5eef8 !important; box-shadow:none !important;}
body:not(.light) .quote-create-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name),
body:not(.light) .quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name),
body.dark .quote-create-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name),
body.dark .quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name),
body.dark-mode .quote-create-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name),
body.dark-mode .quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name),
body[data-theme="dark"] .quote-create-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name),
body[data-theme="dark"] .quote-edit-modal :is(h1,h2,h3,h4,label,strong,.card-head h3,.quote-field-label,.quote-field-label__text,.crm-brand-name){color:#f8fafc !important; -webkit-text-fill-color:#f8fafc !important; opacity:1 !important;}
body:not(.light) .quote-create-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag),
body:not(.light) .quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag),
body.dark .quote-create-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag),
body.dark .quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag),
body.dark-mode .quote-create-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag),
body.dark-mode .quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag),
body[data-theme="dark"] .quote-create-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag),
body[data-theme="dark"] .quote-edit-modal :is(.hx-modal-subtitle,.crm-sub,.badge-soft,.quote-field-label__unit,.crm-brand-tag){color:#cbd5e1 !important; -webkit-text-fill-color:#cbd5e1 !important; opacity:1 !important;}
body:not(.light) .quote-create-modal :is(input,select,textarea),
body:not(.light) .quote-edit-modal :is(input,select,textarea),
body.dark .quote-create-modal :is(input,select,textarea),
body.dark .quote-edit-modal :is(input,select,textarea),
body.dark-mode .quote-create-modal :is(input,select,textarea),
body.dark-mode .quote-edit-modal :is(input,select,textarea),
body[data-theme="dark"] .quote-create-modal :is(input,select,textarea),
body[data-theme="dark"] .quote-edit-modal :is(input,select,textarea){background:rgba(2,12,27,.72) !important; border-color:rgba(96,165,250,.22) !important; color:#f8fafc !important; -webkit-text-fill-color:#f8fafc !important; box-shadow:inset 0 1px 0 rgba(255,255,255,.03) !important;}
body:not(.light) .quote-create-modal :is(input::placeholder,textarea::placeholder),
body:not(.light) .quote-edit-modal :is(input::placeholder,textarea::placeholder),
body.dark .quote-create-modal :is(input::placeholder,textarea::placeholder),
body.dark .quote-edit-modal :is(input::placeholder,textarea::placeholder),
body.dark-mode .quote-create-modal :is(input::placeholder,textarea::placeholder),
body.dark-mode .quote-edit-modal :is(input::placeholder,textarea::placeholder),
body[data-theme="dark"] .quote-create-modal :is(input::placeholder,textarea::placeholder),
body[data-theme="dark"] .quote-edit-modal :is(input::placeholder,textarea::placeholder){color:#8ea4ba !important; -webkit-text-fill-color:#8ea4ba !important; opacity:1 !important;}
body:not(.light) .quote-create-modal .quote-modal-footer,
body:not(.light) .quote-edit-modal .quote-modal-footer,
body.dark .quote-create-modal .quote-modal-footer,
body.dark .quote-edit-modal .quote-modal-footer,
body.dark-mode .quote-create-modal .quote-modal-footer,
body.dark-mode .quote-edit-modal .quote-modal-footer,
body[data-theme="dark"] .quote-create-modal .quote-modal-footer,
body[data-theme="dark"] .quote-edit-modal .quote-modal-footer{background:rgba(2,6,23,.74) !important; border-top-color:rgba(96,165,250,.18) !important;}
body:not(.light) .quote-create-modal .crm-modal-close,
body:not(.light) .quote-edit-modal .crm-modal-close,
body.dark .quote-create-modal .crm-modal-close,
body.dark .quote-edit-modal .crm-modal-close,
body.dark-mode .quote-create-modal .crm-modal-close,
body.dark-mode .quote-edit-modal .crm-modal-close,
body[data-theme="dark"] .quote-create-modal .crm-modal-close,
body[data-theme="dark"] .quote-edit-modal .crm-modal-close{background:rgba(255,255,255,.10) !important; border-color:rgba(255,255,255,.16) !important; color:#ffffff !important; box-shadow:none !important;}

/* v643-select-polish-visible: make modal dropdowns visibly different from text inputs */
:is(#supplierModal,.quote-create-modal,.quote-edit-modal) select,
:is(#supplierModal,.quote-create-modal,.quote-edit-modal) .supplier-form-grid select,
:is(#supplierModal,.quote-create-modal,.quote-edit-modal) .quote-create-card select,
:is(#supplierModal,.quote-create-modal,.quote-edit-modal) .quote-edit-form select,
:is(#supplierModal,.quote-create-modal,.quote-edit-modal) .quote-material-library-inline select{
  appearance:none !important;
  -webkit-appearance:none !important;
  cursor:pointer !important;
  padding-right:58px !important;
  background-repeat:no-repeat !important;
  background-size:18px 18px, 100% 100% !important;
  background-position:right 22px center, 0 0 !important;
  transition:border-color .16s ease, box-shadow .16s ease, background-color .16s ease, transform .16s ease !important;
}

body.light :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select,
body:not(.dark):not(.dark-mode):not([data-theme="dark"]) :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select{
  background-color:#ffffff !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"),
    linear-gradient(180deg,#ffffff 0%,#f8fbff 100%) !important;
  border:1.5px solid rgba(37,99,235,.22) !important;
  box-shadow:0 1px 2px rgba(15,23,42,.05), 0 0 0 6px rgba(59,130,246,.06) !important;
}

body.light :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:hover,
body:not(.dark):not(.dark-mode):not([data-theme="dark"]) :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:hover{
  border-color:rgba(37,99,235,.42) !important;
  box-shadow:0 8px 20px rgba(37,99,235,.10), 0 0 0 6px rgba(59,130,246,.10) !important;
}

body.light :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:focus,
body:not(.dark):not(.dark-mode):not([data-theme="dark"]) :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:focus{
  outline:none !important;
  border-color:#3b82f6 !important;
  box-shadow:0 0 0 6px rgba(59,130,246,.18), 0 10px 24px rgba(37,99,235,.12) !important;
}

body:not(.light) :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select,
body.dark :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select,
body.dark-mode :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select,
body[data-theme="dark"] :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select{
  background-color:#0b1628 !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"),
    linear-gradient(180deg,rgba(20,35,57,.96) 0%,rgba(8,18,34,.96) 100%) !important;
  border:1.5px solid rgba(96,165,250,.34) !important;
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 5px rgba(59,130,246,.08) !important;
}

body:not(.light) :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:hover,
body.dark :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:hover,
body.dark-mode :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:hover,
body[data-theme="dark"] :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:hover{
  border-color:rgba(147,197,253,.62) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 6px rgba(59,130,246,.14), 0 14px 32px rgba(2,6,23,.28) !important;
}

body:not(.light) :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:focus,
body.dark :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:focus,
body.dark-mode :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:focus,
body[data-theme="dark"] :is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:focus{
  outline:none !important;
  border-color:#60a5fa !important;
  box-shadow:0 0 0 6px rgba(96,165,250,.20), 0 16px 38px rgba(2,6,23,.32) !important;
}

:is(#supplierModal,.quote-create-modal,.quote-edit-modal) select:disabled{
  cursor:not-allowed !important;
  opacity:.66 !important;
  filter:saturate(.75) !important;
}


/* V644 - Offertes modal: proportional form fields like supplier modal */
.quote-create-modal .crm-modal-body,
.quote-edit-modal .crm-modal-body{
  padding:28px 32px !important;
}
.quote-create-modal .quote-create-form,
.quote-edit-modal form{
  gap:18px !important;
}
.quote-create-modal .quote-create-card,
.quote-create-modal .quote-margin-panel,
.quote-edit-modal .quote-create-card,
.quote-edit-modal .quote-margin-panel{
  border-radius:22px !important;
  padding:22px 24px !important;
}
.quote-create-modal .quote-create-card .card-head h3,
.quote-create-modal .quote-margin-panel .card-head h3,
.quote-edit-modal .quote-create-card .card-head h3,
.quote-edit-modal .quote-margin-panel .card-head h3{
  font-size:1.35rem !important;
  line-height:1.15 !important;
  letter-spacing:-.02em !important;
}
.quote-create-modal .form-row-2,
.quote-edit-modal .form-row-2{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  column-gap:22px !important;
  row-gap:16px !important;
  align-items:start !important;
}
.quote-create-modal .quote-create-form label,
.quote-create-modal .quote-create-form .field-label,
.quote-edit-modal label,
.quote-edit-modal .field-label{
  min-width:0 !important;
  display:grid !important;
  gap:8px !important;
  font-size:.95rem !important;
  line-height:1.25 !important;
  font-weight:750 !important;
}
.quote-create-modal :is(input,select,textarea),
.quote-edit-modal :is(input,select,textarea){
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  min-height:54px !important;
  height:auto !important;
  border-radius:16px !important;
  padding:14px 16px !important;
  font-size:1rem !important;
  line-height:1.25 !important;
  font-weight:650 !important;
  box-sizing:border-box !important;
}
.quote-create-modal :is(select),
.quote-edit-modal :is(select){
  padding-right:46px !important;
  background-size:16px 16px, 100% 100% !important;
  background-position:right 16px center, 0 0 !important;
}
.quote-create-modal textarea,
.quote-edit-modal textarea{
  min-height:118px !important;
  resize:vertical !important;
}
.quote-create-modal .quote-create-grid{
  gap:18px !important;
}
.quote-create-modal .quote-create-main{
  gap:18px !important;
}
.quote-create-modal .quote-modal-footer{
  padding:18px 24px !important;
  margin:0 -24px -22px !important;
}
.quote-create-modal .quote-modal-footer .hx-form-actions{
  justify-content:flex-end !important;
  gap:12px !important;
}
.quote-create-modal .quote-modal-footer .btn{
  flex:0 0 auto !important;
  min-height:48px !important;
  min-width:150px !important;
  border-radius:16px !important;
  padding:0 22px !important;
  font-size:1rem !important;
  font-weight:800 !important;
}
.quote-create-modal .quote-modal-footer .btn.primary{
  min-width:180px !important;
}
body.light .quote-create-modal select,
body:not(.dark):not(.dark-mode):not([data-theme="dark"]) .quote-create-modal select,
body.light .quote-edit-modal select,
body:not(.dark):not(.dark-mode):not([data-theme="dark"]) .quote-edit-modal select{
  box-shadow:0 1px 2px rgba(15,23,42,.04) !important;
  border-color:rgba(148,163,184,.36) !important;
}
body.light .quote-create-modal select:focus,
body:not(.dark):not(.dark-mode):not([data-theme="dark"]) .quote-create-modal select:focus,
body.light .quote-edit-modal select:focus,
body:not(.dark):not(.dark-mode):not([data-theme="dark"]) .quote-edit-modal select:focus{
  box-shadow:0 0 0 4px rgba(59,130,246,.14) !important;
}
body:not(.light) .quote-create-modal select,
body.dark .quote-create-modal select,
body.dark-mode .quote-create-modal select,
body[data-theme="dark"] .quote-create-modal select,
body:not(.light) .quote-edit-modal select,
body.dark .quote-edit-modal select,
body.dark-mode .quote-edit-modal select,
body[data-theme="dark"] .quote-edit-modal select{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05) !important;
}
@media (max-width: 760px){
  .quote-create-modal .crm-modal-body,
  .quote-edit-modal .crm-modal-body{padding:18px !important;}
  .quote-create-modal .form-row-2,
  .quote-edit-modal .form-row-2{grid-template-columns:1fr !important; gap:14px !important;}
  .quote-create-modal .quote-modal-footer .hx-form-actions{flex-direction:column-reverse !important;}
  .quote-create-modal .quote-modal-footer .btn{width:100% !important;}
}

/* V646 - Global modal spacing polish: apply the improved quote spacing to every dashboard modal */
:root{
  --hx-v646-modal-body-pad-y:32px;
  --hx-v646-modal-body-pad-x:36px;
  --hx-v646-card-pad-y:26px;
  --hx-v646-card-pad-x:28px;
  --hx-v646-field-gap:10px;
  --hx-v646-row-gap:22px;
  --hx-v646-col-gap:26px;
  --hx-v646-input-height:56px;
  --hx-v646-input-radius:17px;
}

/* Modal bodies: more air around the content */
:is(.crm-modal-body,.supplier-modal-body,.user-modal-body,.materials-modal-body,.profile-modal-body,.quote-template-modal__body),
.hx-modal-shell :is(.crm-modal-body,.supplier-modal-body,.user-modal-body,.materials-modal-body,.profile-modal-body){
  padding:var(--hx-v646-modal-body-pad-y) var(--hx-v646-modal-body-pad-x) !important;
}

/* Modal section stack: consistent vertical rhythm */
:is(.hx-modal-section-stack,.supplier-modal-form,.user-modal-form,.crm-modal-form,.materials-modal-form,.profile-modal-form,.quote-create-form,.quote-edit-form,.quote-template-modal__form){
  gap:var(--hx-v646-row-gap) !important;
}

/* Cards/fieldsets inside modals */
:is(.hx-modal-shell,.quote-template-modal) :is(.form-card,.settings-card,.panel,.quote-create-card,.quote-margin-panel,.supplier-form-section,.user-form-section,.crm-form-section,.materials-form-section,.profile-form-section,.modal-section,.card){
  padding:var(--hx-v646-card-pad-y) var(--hx-v646-card-pad-x) !important;
  border-radius:24px !important;
}

/* Grid layouts inside all modals */
:is(.hx-modal-shell,.quote-template-modal) :is(.form-grid,.form-row-2,.supplier-form-grid,.user-form-grid,.crm-form-grid,.materials-form-grid,.profile-form-grid,.quote-create-grid){
  column-gap:var(--hx-v646-col-gap) !important;
  row-gap:var(--hx-v646-row-gap) !important;
  align-items:start !important;
}

/* Labels: separate label text from controls, avoid cramped fields */
:is(.hx-modal-shell,.quote-template-modal) label,
:is(.hx-modal-shell,.quote-template-modal) .field-label{
  display:grid !important;
  gap:var(--hx-v646-field-gap) !important;
  align-content:start !important;
  line-height:1.3 !important;
}
:is(.hx-modal-shell,.quote-template-modal) label > span:first-child,
:is(.hx-modal-shell,.quote-template-modal) .field-label > span:first-child{
  display:block !important;
  margin-bottom:0 !important;
  font-size:.96rem !important;
  line-height:1.25 !important;
  font-weight:760 !important;
  letter-spacing:-.01em !important;
}

/* Inputs/selects/textareas: consistent sizes in light + dark */
:is(.hx-modal-shell,.quote-template-modal) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  min-height:var(--hx-v646-input-height) !important;
  height:auto !important;
  border-radius:var(--hx-v646-input-radius) !important;
  padding:15px 18px !important;
  font-size:1rem !important;
  line-height:1.25 !important;
  box-sizing:border-box !important;
}
:is(.hx-modal-shell,.quote-template-modal) select{
  padding-right:48px !important;
}
:is(.hx-modal-shell,.quote-template-modal) textarea{
  min-height:124px !important;
  resize:vertical !important;
}

/* Better grouped rows for two-column modal fields */
:is(.hx-modal-shell,.quote-template-modal) :is(.form-row-2,.supplier-form-grid,.user-form-grid,.crm-form-grid,.materials-form-grid,.profile-form-grid){
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
}
:is(.hx-modal-shell,.quote-template-modal) :is(.field-full,.full,.full-width,[data-full="true"]){
  grid-column:1 / -1 !important;
}

/* Footers: supplier-style compact buttons everywhere */
:is(.hx-modal-footer,.supplier-modal-footer,.user-modal-footer,.crm-modal-footer,.materials-modal-footer,.profile-modal-footer,.quote-template-modal__footer){
  padding:20px 28px !important;
}
:is(.hx-modal-footer,.supplier-modal-footer,.user-modal-footer,.crm-modal-footer,.materials-modal-footer,.profile-modal-footer,.quote-template-modal__footer) :is(.hx-form-actions,.form-actions),
:is(.hx-modal-footer,.supplier-modal-footer,.user-modal-footer,.crm-modal-footer,.materials-modal-footer,.profile-modal-footer,.quote-template-modal__footer){
  gap:14px !important;
}
:is(.hx-modal-footer,.supplier-modal-footer,.user-modal-footer,.crm-modal-footer,.materials-modal-footer,.profile-modal-footer,.quote-template-modal__footer) .btn{
  flex:0 0 auto !important;
  min-height:48px !important;
  min-width:150px !important;
  border-radius:16px !important;
  padding:0 22px !important;
  font-size:1rem !important;
  font-weight:800 !important;
}
:is(.hx-modal-footer,.supplier-modal-footer,.user-modal-footer,.crm-modal-footer,.materials-modal-footer,.profile-modal-footer,.quote-template-modal__footer) .btn.primary{
  min-width:180px !important;
}

/* Keep custom checkbox/radio rows compact */
:is(.hx-modal-shell,.quote-template-modal) :is(input[type="checkbox"],input[type="radio"]){
  min-height:0 !important;
  width:auto !important;
  padding:0 !important;
  border-radius:inherit !important;
}

@media (max-width: 760px){
  :root{
    --hx-v646-modal-body-pad-y:20px;
    --hx-v646-modal-body-pad-x:18px;
    --hx-v646-card-pad-y:20px;
    --hx-v646-card-pad-x:18px;
    --hx-v646-row-gap:16px;
    --hx-v646-col-gap:16px;
  }
  :is(.hx-modal-shell,.quote-template-modal) :is(.form-row-2,.supplier-form-grid,.user-form-grid,.crm-form-grid,.materials-form-grid,.profile-form-grid){
    grid-template-columns:1fr !important;
  }
  :is(.hx-modal-footer,.supplier-modal-footer,.user-modal-footer,.crm-modal-footer,.materials-modal-footer,.profile-modal-footer,.quote-template-modal__footer) :is(.hx-form-actions,.form-actions){
    flex-direction:column-reverse !important;
    width:100% !important;
  }
  :is(.hx-modal-footer,.supplier-modal-footer,.user-modal-footer,.crm-modal-footer,.materials-modal-footer,.profile-modal-footer,.quote-template-modal__footer) .btn{
    width:100% !important;
  }
}

/* v647 - Profile/user summary email readability in dark-mode modal with light body */
body:not(.light) #profileEditModal .profile-modal-body .profile-summary-email,
body:not(.light) #profileEditModal .profile-modal-body .hx-profile-summary__copy p,
body:not(.light) #profileEditModal .profile-modal-body .hx-profile-summary__copy .muted,
body:not(.light) .user-edit-hero .user-edit-hero-copy p{
  color:#475569 !important;
  opacity:1 !important;
}
body:not(.light) #profileEditModal .profile-modal-body .hx-profile-summary__copy strong,
body:not(.light) .user-edit-hero .user-edit-title-row h2{
  color:#0f172a !important;
}

/* v704 unified datagrid system */
.hvx-datagrid{
  --hvx-grid-border: rgba(148,163,184,.22);
  --hvx-grid-surface: rgba(255,255,255,.82);
  --hvx-grid-surface-2: rgba(248,250,252,.92);
  --hvx-grid-text: #0f172a;
  --hvx-grid-muted: #64748b;
  --hvx-grid-accent: #2563eb;
  margin: 18px 0 24px;
  border: 1px solid var(--hvx-grid-border);
  border-radius: 24px;
  background: linear-gradient(180deg,var(--hvx-grid-surface),var(--hvx-grid-surface-2));
  box-shadow: 0 18px 45px rgba(15,23,42,.08);
  overflow: hidden;
}
body:not(.light) .hvx-datagrid{
  --hvx-grid-border: rgba(96,165,250,.18);
  --hvx-grid-surface: rgba(15,23,42,.88);
  --hvx-grid-surface-2: rgba(2,6,23,.92);
  --hvx-grid-text: #e5edf8;
  --hvx-grid-muted: #94a3b8;
  --hvx-grid-accent: #60a5fa;
  box-shadow: 0 22px 50px rgba(2,6,23,.42);
}
.hvx-datagrid__toolbar,
.hvx-datagrid__footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 16px;
  border-bottom:1px solid var(--hvx-grid-border);
}
.hvx-datagrid__footer{
  border-top:1px solid var(--hvx-grid-border);
  border-bottom:0;
  flex-wrap:wrap;
}
.hvx-datagrid__searchWrap{ position:relative; flex:1 1 320px; max-width:520px; }
.hvx-datagrid__searchIcon{ position:absolute; left:16px; top:50%; transform:translateY(-50%); color:var(--hvx-grid-muted); pointer-events:none; }
.hvx-datagrid__search{
  width:100%; height:46px; border-radius:16px; border:1px solid var(--hvx-grid-border);
  background:rgba(255,255,255,.72); color:var(--hvx-grid-text); padding:0 16px 0 44px;
  font:inherit; font-weight:650; outline:0; transition:border-color .18s, box-shadow .18s, background .18s;
}
body:not(.light) .hvx-datagrid__search{ background:rgba(15,23,42,.84); }
.hvx-datagrid__search:focus{ border-color:var(--hvx-grid-accent); box-shadow:0 0 0 4px color-mix(in srgb, var(--hvx-grid-accent) 18%, transparent); }
.hvx-datagrid__meta{ color:var(--hvx-grid-muted); font-size:.92rem; font-weight:700; white-space:nowrap; }
.hvx-datagrid__scroll{ overflow:auto; }
.hvx-datagrid table{ width:100%; border-collapse:separate; border-spacing:0; margin:0 !important; background:transparent !important; box-shadow:none !important; border:0 !important; border-radius:0 !important; }
.hvx-datagrid thead th{
  position:sticky; top:0; z-index:2; background:color-mix(in srgb, var(--hvx-grid-surface-2) 92%, transparent) !important;
  color:var(--hvx-grid-muted) !important; font-size:.78rem; letter-spacing:.04em; text-transform:uppercase;
  font-weight:850; padding:14px 16px !important; border-bottom:1px solid var(--hvx-grid-border) !important; white-space:nowrap;
}
.hvx-datagrid tbody td{ color:var(--hvx-grid-text); padding:16px !important; border-top:1px solid color-mix(in srgb, var(--hvx-grid-border) 62%, transparent) !important; vertical-align:middle; }
.hvx-datagrid tbody tr{ transition:background .16s, transform .16s; }
.hvx-datagrid tbody tr:hover{ background:color-mix(in srgb, var(--hvx-grid-accent) 8%, transparent) !important; }
.hvx-datagrid__sortBtn{
  display:inline-flex; align-items:center; gap:8px; width:100%; justify-content:flex-start;
  border:0; background:transparent; color:inherit; font:inherit; text-transform:inherit; letter-spacing:inherit;
  cursor:pointer; padding:0; font-weight:inherit;
}
.hvx-datagrid__sortIcon{ font-size:.88em; opacity:.55; margin-left:auto; }
.hvx-datagrid__sortBtn[aria-sort="ascending"] .hvx-datagrid__sortIcon,
.hvx-datagrid__sortBtn[aria-sort="descending"] .hvx-datagrid__sortIcon{ opacity:1; color:var(--hvx-grid-accent); }
.hvx-datagrid__pageSize{ display:flex; align-items:center; gap:8px; color:var(--hvx-grid-muted); font-weight:700; font-size:.9rem; }
.hvx-datagrid__pageSize select{
  height:38px; border-radius:13px; border:1px solid var(--hvx-grid-border); background:var(--hvx-grid-surface); color:var(--hvx-grid-text); padding:0 12px; font-weight:800;
}
.hvx-datagrid__pager{ display:flex; align-items:center; gap:8px; }
.hvx-datagrid__pager button{
  min-width:38px; height:38px; border-radius:13px; border:1px solid var(--hvx-grid-border); background:var(--hvx-grid-surface);
  color:var(--hvx-grid-text); font-weight:850; cursor:pointer; transition:background .18s, border-color .18s, color .18s, transform .18s;
}
.hvx-datagrid__pager button:hover:not(:disabled){ transform:translateY(-1px); border-color:var(--hvx-grid-accent); color:var(--hvx-grid-accent); }
.hvx-datagrid__pager button.is-active{ background:var(--hvx-grid-accent); border-color:var(--hvx-grid-accent); color:#fff; }
.hvx-datagrid__pager button:disabled{ opacity:.45; cursor:not-allowed; }
.hvx-datagrid__empty{ display:none; padding:28px 16px; text-align:center; color:var(--hvx-grid-muted); font-weight:800; }
.hvx-datagrid.is-empty .hvx-datagrid__empty{ display:block; }
@media (max-width: 760px){
  .hvx-datagrid{ border-radius:20px; }
  .hvx-datagrid__toolbar,.hvx-datagrid__footer{ align-items:stretch; flex-direction:column; }
  .hvx-datagrid__searchWrap{ max-width:none; width:100%; }
  .hvx-datagrid__pager{ justify-content:center; flex-wrap:wrap; }
  .hvx-datagrid thead th,.hvx-datagrid tbody td{ padding:13px 12px !important; }
}

/* v708 - Global dropdown affordance polish: make every select visibly a dropdown */
:root{
  --hx-dropdown-chevron-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.75 7.75L10 12.25L14.25 7.75' stroke='%232563eb' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --hx-dropdown-chevron-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.75 7.75L10 12.25L14.25 7.75' stroke='%2393c5fd' stroke-width='2.35' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select,
.hx-modal-shell select,
.modal select,
.dialog select,
.form-card select,
.form-grid select,
.crm-form-grid select,
.user-modal-grid select,
.profile-modal-grid select,
.supplier-form-grid select,
.materials-form-grid select,
.quote-template-modal select,
.inline-form select,
.panel select,
.table-wrap select,
.users-toolbar select,
.crm-toolbar select,
.material-filters select,
.supplier-filters select,
.hvx-datagrid__pageSize select{
  appearance:none !important;
  -webkit-appearance:none !important;
  -moz-appearance:none !important;
  cursor:pointer !important;
  min-height:48px;
  padding-right:54px !important;
  background-image:var(--hx-dropdown-chevron-light) !important;
  background-repeat:no-repeat !important;
  background-position:right 18px center !important;
  background-size:22px 22px !important;
  border:1px solid rgba(148,163,184,.28) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72), 0 10px 24px rgba(15,23,42,.055) !important;
  transition:border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease !important;
}

body:not(.light) select,
body:not(.light) .hx-modal-shell select,
body:not(.light) .modal select,
body:not(.light) .dialog select,
body:not(.light) .form-card select,
body:not(.light) .form-grid select,
body:not(.light) .crm-form-grid select,
body:not(.light) .user-modal-grid select,
body:not(.light) .profile-modal-grid select,
body:not(.light) .supplier-form-grid select,
body:not(.light) .materials-form-grid select,
body:not(.light) .quote-template-modal select,
body:not(.light) .inline-form select,
body:not(.light) .panel select,
body:not(.light) .table-wrap select,
body:not(.light) .users-toolbar select,
body:not(.light) .crm-toolbar select,
body:not(.light) .material-filters select,
body:not(.light) .supplier-filters select,
body:not(.light) .hvx-datagrid__pageSize select{
  background-image:var(--hx-dropdown-chevron-dark) !important;
  border-color:rgba(147,197,253,.26) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06), 0 14px 28px rgba(2,6,23,.34) !important;
}

select:hover,
.hx-modal-shell select:hover,
.modal select:hover,
.dialog select:hover,
.form-card select:hover,
.form-grid select:hover,
.crm-form-grid select:hover,
.user-modal-grid select:hover,
.profile-modal-grid select:hover,
.supplier-form-grid select:hover,
.materials-form-grid select:hover,
.quote-template-modal select:hover,
.inline-form select:hover,
.panel select:hover,
.table-wrap select:hover,
.users-toolbar select:hover,
.crm-toolbar select:hover,
.material-filters select:hover,
.supplier-filters select:hover,
.hvx-datagrid__pageSize select:hover{
  border-color:rgba(37,99,235,.52) !important;
  box-shadow:0 0 0 4px rgba(59,130,246,.11), 0 14px 30px rgba(15,23,42,.075) !important;
}

select:focus,
select:focus-visible,
.hx-modal-shell select:focus,
.modal select:focus,
.dialog select:focus,
.form-card select:focus,
.form-grid select:focus,
.crm-form-grid select:focus,
.user-modal-grid select:focus,
.profile-modal-grid select:focus,
.supplier-form-grid select:focus,
.materials-form-grid select:focus,
.quote-template-modal select:focus,
.inline-form select:focus,
.panel select:focus,
.table-wrap select:focus,
.users-toolbar select:focus,
.crm-toolbar select:focus,
.material-filters select:focus,
.supplier-filters select:focus,
.hvx-datagrid__pageSize select:focus{
  outline:none !important;
  border-color:#3b82f6 !important;
  box-shadow:0 0 0 5px rgba(59,130,246,.16), 0 16px 34px rgba(37,99,235,.12) !important;
}

select::-ms-expand{ display:none; }

/* Custom dropdown/select buttons used in some modals */
:is(.dropdown-toggle,.select-toggle,.custom-select-toggle,.hx-select-toggle,.combobox-toggle,[role="combobox"]):not(input):not(textarea){
  position:relative;
  cursor:pointer;
  padding-right:54px !important;
}
:is(.dropdown-toggle,.select-toggle,.custom-select-toggle,.hx-select-toggle,.combobox-toggle,[role="combobox"]):not(input):not(textarea)::after{
  content:"";
  position:absolute;
  right:18px;
  top:50%;
  width:22px;
  height:22px;
  transform:translateY(-50%);
  background-image:var(--hx-dropdown-chevron-light);
  background-repeat:no-repeat;
  background-position:center;
  background-size:22px 22px;
  pointer-events:none;
  opacity:.98;
}
body:not(.light) :is(.dropdown-toggle,.select-toggle,.custom-select-toggle,.hx-select-toggle,.combobox-toggle,[role="combobox"]):not(input):not(textarea)::after{
  background-image:var(--hx-dropdown-chevron-dark);
}

/* V709 - Premium motion layer */
:root{
  --hx-ease-spring:cubic-bezier(.2,.85,.25,1);
  --hx-ease-soft:cubic-bezier(.16,1,.3,1);
  --hx-motion-fast:160ms;
  --hx-motion-med:260ms;
  --hx-motion-slow:420ms;
}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.001ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; transition-duration:.001ms !important; }
}
@keyframes hxFadeUp{ from{ opacity:0; transform:translate3d(0,14px,0) scale(.985); } to{ opacity:1; transform:translate3d(0,0,0) scale(1); } }
@keyframes hxModalIn{ from{ opacity:0; transform:translate3d(0,22px,0) scale(.975); filter:blur(2px); } to{ opacity:1; transform:translate3d(0,0,0) scale(1); filter:blur(0); } }
@keyframes hxBackdropIn{ from{ opacity:0; backdrop-filter:blur(0); } to{ opacity:1; backdrop-filter:blur(10px); } }
@keyframes hxPop{ 0%{ transform:scale(.96); opacity:.55; } 60%{ transform:scale(1.025); opacity:1; } 100%{ transform:scale(1); opacity:1; } }
@keyframes hxShimmer{ 0%{ background-position:200% 0; } 100%{ background-position:-200% 0; } }

.modal-backdrop,.hx-modal-backdrop,.dialog-backdrop,.overlay-backdrop{ animation:hxBackdropIn var(--hx-motion-med) var(--hx-ease-soft) both; }
.modal,.hx-modal-shell,.dialog,.modal-dialog,.quote-modal,.supplier-modal,.crm-modal,.profile-modal,.quote-template-modal{
  animation:hxModalIn var(--hx-motion-slow) var(--hx-ease-spring) both;
  transform-origin:50% 48%;
}
.modal-header,.hx-modal-header,.modal-body,.hx-modal-body,.modal-footer,.hx-modal-footer{ animation:hxFadeUp var(--hx-motion-med) var(--hx-ease-soft) both; }
.modal-body,.hx-modal-body{ animation-delay:45ms; }
.modal-footer,.hx-modal-footer{ animation-delay:90ms; }

.card,.panel,.form-card,.dashboard-card,.stat-card,.metric-card,.table-shell,.hvx-datagrid,.grb-card,.material-card,.supplier-card,.customer-card,.quote-card{
  transition:transform var(--hx-motion-med) var(--hx-ease-soft), box-shadow var(--hx-motion-med) var(--hx-ease-soft), border-color var(--hx-motion-fast) ease, background-color var(--hx-motion-fast) ease;
}
.card:hover,.panel:hover,.form-card:hover,.dashboard-card:hover,.stat-card:hover,.metric-card:hover,.grb-card:hover,.material-card:hover,.supplier-card:hover,.customer-card:hover,.quote-card:hover{
  transform:translateY(-2px);
}
button,.btn,.button,.action-btn,.primary-btn,.secondary-btn,.icon-btn,a.btn{
  transition:transform var(--hx-motion-fast) var(--hx-ease-soft), box-shadow var(--hx-motion-fast) ease, background-color var(--hx-motion-fast) ease, border-color var(--hx-motion-fast) ease, opacity var(--hx-motion-fast) ease !important;
}
button:hover,.btn:hover,.button:hover,.action-btn:hover,.primary-btn:hover,.secondary-btn:hover,.icon-btn:hover,a.btn:hover{ transform:translateY(-1px); }
button:active,.btn:active,.button:active,.action-btn:active,.primary-btn:active,.secondary-btn:active,.icon-btn:active,a.btn:active{ transform:translateY(0) scale(.985); }

input,textarea,select,.input,.form-control,.hx-input,[role="combobox"]{
  transition:border-color var(--hx-motion-fast) ease, box-shadow var(--hx-motion-fast) ease, background-color var(--hx-motion-fast) ease, transform var(--hx-motion-fast) var(--hx-ease-soft) !important;
}
input:focus,textarea:focus,select:focus,.input:focus,.form-control:focus,.hx-input:focus,[role="combobox"]:focus{ transform:translateY(-1px); }
.dropdown-menu,.select-menu,.custom-select-menu,.hx-select-menu,.combobox-menu,[role="listbox"]{
  animation:hxFadeUp var(--hx-motion-med) var(--hx-ease-soft) both;
  transform-origin:top center;
}
.dropdown-menu li,.select-menu li,.custom-select-menu li,.hx-select-menu li,[role="option"]{
  transition:background-color var(--hx-motion-fast) ease, color var(--hx-motion-fast) ease, transform var(--hx-motion-fast) var(--hx-ease-soft);
}
.dropdown-menu li:hover,.select-menu li:hover,.custom-select-menu li:hover,.hx-select-menu li:hover,[role="option"]:hover{ transform:translateX(3px); }

.hvx-datagrid tbody tr, table tbody tr{ transition:background-color var(--hx-motion-fast) ease, box-shadow var(--hx-motion-fast) ease, transform var(--hx-motion-fast) var(--hx-ease-soft); }
.hvx-datagrid tbody tr:hover, table tbody tr:hover{ transform:translateX(2px); }
.hvx-datagrid__pagination button[aria-current="page"],.pagination .active,.page-item.active .page-link{ animation:hxPop var(--hx-motion-med) var(--hx-ease-spring) both; }

.toast,.alert,.flash,.notification,.hx-toast{ animation:hxFadeUp var(--hx-motion-med) var(--hx-ease-soft) both; }
.skeleton,.loading-skeleton,.shimmer{
  background:linear-gradient(90deg,rgba(148,163,184,.10),rgba(148,163,184,.22),rgba(148,163,184,.10));
  background-size:200% 100%;
  animation:hxShimmer 1.4s ease-in-out infinite;
}
.mapboxgl-canvas,.dakmeting-map,.roof-map,.grb-preview svg,.manual-drawing-canvas{ transition:filter var(--hx-motion-med) ease, opacity var(--hx-motion-med) ease; }
.grb-reference-line,.roof-edge-line,.polygon-edge,.roof-polygon,.manual-reference-line{ transition:stroke var(--hx-motion-fast) ease, stroke-width var(--hx-motion-fast) ease, opacity var(--hx-motion-fast) ease, filter var(--hx-motion-fast) ease; }
.grb-card:hover .grb-reference-line,.roof-polygon:hover,.manual-reference-line:hover{ filter:drop-shadow(0 6px 10px rgba(37,99,235,.20)); }


/* v711: quote free text is a manual customer-facing text field; control values stay regular weight */
.quote-create-modal .quote-free-text-box,
.quote-edit-modal .quote-free-text-box{
  min-height:168px !important;
  line-height:1.55 !important;
  resize:vertical !important;
  font-weight:400 !important;
}
.quote-create-modal :is(input, select, textarea),
.quote-edit-modal :is(input, select, textarea),
.quote-create-modal :is(input, select, textarea)::placeholder,
.quote-edit-modal :is(input, select, textarea)::placeholder,
.quote-create-modal :is(input, select, textarea) option,
.quote-edit-modal :is(input, select, textarea) option{
  font-weight:400 !important;
}
.quote-create-modal select,
.quote-edit-modal select{
  font-weight:400 !important;
}
.quote-create-modal select option:checked,
.quote-edit-modal select option:checked{
  font-weight:400 !important;
}
.quote-create-modal .quote-field-label,
.quote-edit-modal .quote-field-label{
  font-weight:700 !important;
}


/* v712 quote modal material rows aligned with quote-template material rules */
.quote-material-row--rules{
  padding:18px 20px;
  border:1px solid rgba(148,163,184,.24);
  border-radius:22px;
  background:rgba(255,255,255,.04);
  box-shadow:0 18px 45px rgba(15,23,42,.06);
  margin-top:14px;
}
body.light .quote-material-row--rules{background:#fff; border-color:rgba(203,213,225,.72);}
.quote-material-rule-grid{display:grid; grid-template-columns:1.15fr 1.25fr .78fr .78fr .74fr; gap:14px; align-items:end;}
.quote-material-rule-manual{display:none; grid-template-columns:1.2fr 1fr .75fr; gap:14px; margin-top:14px;}
.quote-material-row--rules.is-custom .quote-material-rule-manual{display:grid;}
.quote-material-row--rules label.is-disabled{opacity:.54;}
.quote-material-rule-actions{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:14px;}
.quote-material-rule-actions .quote-material-total{max-width:150px; text-align:right;}
.quote-material-row--rules input,
.quote-material-row--rules select{font-weight:500 !important;}
@media (max-width: 1100px){.quote-material-rule-grid{grid-template-columns:1fr 1fr}.quote-material-rule-manual{grid-template-columns:1fr}.quote-material-rule-actions{align-items:stretch; flex-direction:column}.quote-material-rule-actions .quote-material-total{max-width:none;}}

/* v712: quote controls use normal value weight and readable font */
.quote-create-form input,
.quote-create-form select,
.quote-create-form textarea,
.quote-edit-form input,
.quote-edit-form select,
.quote-edit-form textarea{
  font-weight:500 !important;
  font-family:inherit !important;
  letter-spacing:normal !important;
}
.quote-free-text-box::placeholder{color:transparent !important;}


/* V713: dropdown/control values should never render bold; labels stay bold. */
select,
select option,
select optgroup,
.hx-select,
.hx-select__trigger,
.hx-select__value,
.hx-select__option,
.custom-select,
.custom-select-trigger,
.custom-select-option,
.dropdown-menu,
.dropdown-menu option,
.form-grid select,
.crm-form-grid select,
.user-modal-grid select,
.profile-modal-grid select,
.panel select,
.form-card select,
.inline-form select,
.table-wrap select{
  font-weight:400 !important;
}

.form-grid input,
.form-grid textarea,
.crm-form-grid input,
.crm-form-grid textarea,
.user-modal-grid input,
.user-modal-grid textarea,
.profile-modal-grid input,
.profile-modal-grid textarea,
.panel input,
.panel textarea,
.form-card input,
.form-card textarea{
  font-weight:400 !important;
}

.hx-dropdown-value,
.hx-dropdown-item,
[data-dropdown-value],
[data-dropdown-item]{
  font-weight:400 !important;
}

/* V713: dakmeting building-year card */
.roof-building-year-card{
  margin:18px 0;
}
.roof-building-year-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:8px;
}
.roof-building-year-status{
  color:#64748b;
  font-weight:400;
}
body:not(.light) .roof-building-year-status{
  color:#b8c7dc;
}


/* v732: quote template action buttons show labels in all languages */
.quote-template-actions{
  display:flex!important;
  gap:10px!important;
  justify-content:flex-end!important;
  align-items:center!important;
  flex-wrap:wrap!important;
}
.quote-template-actions .qt-inline-form{display:inline-flex!important;margin:0!important;}
.quote-template-actions .qt-icon-btn{
  width:auto!important;
  min-width:104px!important;
  height:44px!important;
  padding:0 14px!important;
  gap:8px!important;
  border-radius:14px!important;
  font-size:13px!important;
  font-weight:700!important;
  line-height:1!important;
  white-space:nowrap!important;
}
.quote-template-actions .qt-icon-btn svg{
  width:18px!important;
  height:18px!important;
  flex:0 0 18px!important;
}
.quote-template-actions .qt-action-label{display:inline-block!important;}
@media (max-width: 900px){
  .quote-template-actions{justify-content:flex-start!important;}
  .quote-template-actions .qt-icon-btn{min-width:0!important;padding:0 12px!important;}
}

/* V740 - dashboard action button icons */
.hx-dashboard-action-buttons .hx-btn-with-icon,
.hx-btn-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hx-dashboard-action-buttons .hx-btn-icon,
.hx-btn-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  background: rgba(255,255,255,.20);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
body.light .hx-dashboard-action-buttons .btn.ghost .hx-btn-icon,
body.light .btn.ghost .hx-btn-icon {
  background: rgba(37,99,235,.08);
  border-color: rgba(37,99,235,.18);
  color: #2563eb;
}
.hx-dashboard-action-buttons .btn.primary .hx-btn-icon,
.btn.primary .hx-btn-icon {
  color: #fff;
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.28);
}
@media (max-width: 720px) {
  .hx-dashboard-action-buttons .hx-btn-with-icon { width: 100%; justify-content: center; }
}

/* v771: quote edit material line restore and total alignment */
.quote-edit-modal .quote-material-rule-actions{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto auto !important;
  align-items:center !important;
  gap:16px !important;
}
.quote-edit-modal .quote-material-rule-actions .quote-material-total{
  min-width:230px !important;
  max-width:none !important;
  justify-self:end !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:18px !important;
  padding:14px 18px !important;
}
.quote-edit-modal .quote-material-total__value{
  white-space:nowrap !important;
  text-align:right !important;
  font-variant-numeric:tabular-nums !important;
}
.quote-edit-modal .quote-material-rule-actions .qt-material-remove{
  justify-self:end !important;
  min-width:150px !important;
}
.quote-edit-modal .qt-material-rule__hint{
  min-width:0 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
@media (max-width:900px){
  .quote-edit-modal .quote-material-rule-actions{
    grid-template-columns:1fr !important;
    align-items:stretch !important;
  }
  .quote-edit-modal .quote-material-rule-actions .quote-material-total,
  .quote-edit-modal .quote-material-rule-actions .qt-material-remove{
    width:100% !important;
    justify-self:stretch !important;
  }
}

/* v780: Offerte new/edit modal dark-mode parity with leverancier modal */
body:not(.light) :is(.quote-create-modal,.quote-edit-modal),
body.dark :is(.quote-create-modal,.quote-edit-modal),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal){
  display:flex !important;
  flex-direction:column !important;
  background:#ffffff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:initial !important;
  border:1px solid rgba(96,165,250,.30) !important;
  box-shadow:0 34px 90px rgba(2,8,23,.42) !important;
  overflow:hidden !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero,.crm-modal-headbar),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero,.crm-modal-headbar),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero,.crm-modal-headbar),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero,.crm-modal-headbar){
  background:
    radial-gradient(820px 220px at 0% 0%, rgba(59,130,246,.18), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #1d4ed8 140%) !important;
  color:#ffffff !important;
  border-bottom:1px solid rgba(96,165,250,.18) !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) .crm-modal-body,
body.dark :is(.quote-create-modal,.quote-edit-modal) .crm-modal-body,
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) .crm-modal-body,
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) .crm-modal-body{
  flex:1 1 auto !important;
  overflow:auto !important;
  background:linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  color:#0f172a !important;
  -webkit-text-fill-color:initial !important;
  padding:30px 36px 0 !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row){
  background:#f1f5f9 !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 18px 34px rgba(15,23,42,.06) !important;
  color:#0f172a !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(label,strong,h1,h2,h3,h4,.field-label,.quote-field-label,.quote-field-label__text,.card-head h3,.crm-modal-copy h3),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(label,strong,h1,h2,h3,h4,.field-label,.quote-field-label,.quote-field-label__text,.card-head h3,.crm-modal-copy h3),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(label,strong,h1,h2,h3,h4,.field-label,.quote-field-label,.quote-field-label__text,.card-head h3,.crm-modal-copy h3),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(label,strong,h1,h2,h3,h4,.field-label,.quote-field-label,.quote-field-label__text,.card-head h3,.crm-modal-copy h3){
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero .crm-brand-name,.crm-modal-hero .crm-brand-tag,.crm-modal-hero .crm-modal-copy h3,.crm-modal-hero .hx-modal-subtitle,.crm-modal-headbar .crm-brand-name,.crm-modal-headbar .crm-brand-tag,.crm-modal-headbar .crm-modal-copy h3,.crm-modal-headbar .hx-modal-subtitle),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero .crm-brand-name,.crm-modal-hero .crm-brand-tag,.crm-modal-hero .crm-modal-copy h3,.crm-modal-hero .hx-modal-subtitle,.crm-modal-headbar .crm-brand-name,.crm-modal-headbar .crm-brand-tag,.crm-modal-headbar .crm-modal-copy h3,.crm-modal-headbar .hx-modal-subtitle),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero .crm-brand-name,.crm-modal-hero .crm-brand-tag,.crm-modal-hero .crm-modal-copy h3,.crm-modal-hero .hx-modal-subtitle,.crm-modal-headbar .crm-brand-name,.crm-modal-headbar .crm-brand-tag,.crm-modal-headbar .crm-modal-copy h3,.crm-modal-headbar .hx-modal-subtitle),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero .crm-brand-name,.crm-modal-hero .crm-brand-tag,.crm-modal-hero .crm-modal-copy h3,.crm-modal-hero .hx-modal-subtitle,.crm-modal-headbar .crm-brand-name,.crm-modal-headbar .crm-brand-tag,.crm-modal-headbar .crm-modal-copy h3,.crm-modal-headbar .hx-modal-subtitle){
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.crm-sub,small,.card-head p,.quote-field-label__unit,.badge-soft),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.crm-sub,small,.card-head p,.quote-field-label__unit,.badge-soft),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.crm-sub,small,.card-head p,.quote-field-label__unit,.badge-soft),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.crm-sub,small,.card-head p,.quote-field-label__unit,.badge-soft){
  color:#475569 !important;
  -webkit-text-fill-color:#475569 !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea){
  background:#ffffff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 8px 20px rgba(15,23,42,.04) !important;
  color-scheme:light !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea)::placeholder,
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea)::placeholder,
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea)::placeholder,
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea)::placeholder{
  color:#94a3b8 !important;
  -webkit-text-fill-color:#94a3b8 !important;
  opacity:1 !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea):focus,
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea):focus,
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea):focus,
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(input,select,textarea):focus{
  background:#ffffff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  border-color:rgba(59,130,246,.45) !important;
  box-shadow:0 0 0 4px rgba(59,130,246,.12) !important;
  outline:none !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer){
  position:sticky !important;
  bottom:0 !important;
  z-index:30 !important;
  margin:0 -36px 0 !important;
  padding:26px 36px 34px !important;
  background:#ffffff !important;
  border-top:1px solid #e2e8f0 !important;
  box-shadow:0 -18px 42px rgba(15,23,42,.06) !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .hx-form-actions,
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .hx-form-actions,
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .hx-form-actions,
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .hx-form-actions{
  width:100% !important;
  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
  gap:28px !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .btn,
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .btn,
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .btn,
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .btn{
  width:min(360px, 42%) !important;
  min-height:72px !important;
  height:72px !important;
  border-radius:22px !important;
  justify-content:center !important;
}
body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .btn.ghost,
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .btn.ghost,
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .btn.ghost,
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.quote-modal-footer,.crm-modal-footer,.hx-modal-footer) .btn.ghost{
  background:#ffffff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 12px 24px rgba(15,23,42,.05) !important;
}


/* v783: Offerte new/edit dark-mode supplier-reference finishing pass: light dropdowns, non-white card borders. Light mode untouched. */
html:not([data-theme="light"]) body:not(.light).quote-create-modal-open .quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar) :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle),
body.dark.quote-create-modal-open .quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar) :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle),
body.dark-mode.quote-create-modal-open .quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar) :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle),
body[data-theme="dark"].quote-create-modal-open .quote-create-modal :is(.crm-modal-hero,.crm-modal-headbar) :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle),
html:not([data-theme="light"]) body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero,.crm-modal-headbar) :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero,.crm-modal-headbar) :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero,.crm-modal-headbar) :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.crm-modal-hero,.crm-modal-headbar) :is(.crm-brand-name,.crm-brand-tag,.crm-modal-copy h3,.hx-modal-subtitle){color:#ffffff !important;-webkit-text-fill-color:#ffffff !important;}
html:not([data-theme="light"]) body:not(.light).quote-create-modal-open .quote-create-modal :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row,.calc-box),
body.dark.quote-create-modal-open .quote-create-modal :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row,.calc-box),
body.dark-mode.quote-create-modal-open .quote-create-modal :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row,.calc-box),
body[data-theme="dark"].quote-create-modal-open .quote-create-modal :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row,.calc-box),
html:not([data-theme="light"]) body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row,.calc-box),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row,.calc-box),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row,.calc-box),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.quote-material-library-card,.quote-material-source-card,.quote-material-builder,.quote-audit-trail,.quote-material-row,.calc-box){background:#f1f5f9 !important;border-color:#cbd5e1 !important;box-shadow:0 18px 34px rgba(15,23,42,.06) !important;}
html:not([data-theme="light"]) body:not(.light).quote-create-modal-open .quote-create-modal :is(select,input,textarea),
body.dark.quote-create-modal-open .quote-create-modal :is(select,input,textarea),
body.dark-mode.quote-create-modal-open .quote-create-modal :is(select,input,textarea),
body[data-theme="dark"].quote-create-modal-open .quote-create-modal :is(select,input,textarea),
html:not([data-theme="light"]) body:not(.light) :is(.quote-create-modal,.quote-edit-modal) :is(select,input,textarea),
body.dark :is(.quote-create-modal,.quote-edit-modal) :is(select,input,textarea),
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) :is(select,input,textarea),
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) :is(select,input,textarea){background:#fff !important;background-color:#fff !important;color:#0f172a !important;-webkit-text-fill-color:#0f172a !important;border:1px solid #cbd5e1 !important;box-shadow:0 8px 20px rgba(15,23,42,.04) !important;color-scheme:light !important;}
html:not([data-theme="light"]) body:not(.light).quote-create-modal-open .quote-create-modal select option,
body.dark.quote-create-modal-open .quote-create-modal select option,
body.dark-mode.quote-create-modal-open .quote-create-modal select option,
body[data-theme="dark"].quote-create-modal-open .quote-create-modal select option,
html:not([data-theme="light"]) body:not(.light) :is(.quote-create-modal,.quote-edit-modal) select option,
body.dark :is(.quote-create-modal,.quote-edit-modal) select option,
body.dark-mode :is(.quote-create-modal,.quote-edit-modal) select option,
body[data-theme="dark"] :is(.quote-create-modal,.quote-edit-modal) select option{background:#fff !important;color:#0f172a !important;-webkit-text-fill-color:#0f172a !important;}



/* v784-offertes-native-select-light-dark-fix */
/* v784: native offerte selects in dark mode must match leveranciers modal: light controls in a light body. Scoped to quote modals only; light mode untouched. */
html:not([data-theme="light"]) body:not(.light).quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]),
body.dark.quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]),
body.dark-mode.quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]),
body[data-theme="dark"].quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]),
html:not([data-theme="light"]) body:not(.light) .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]),
body.dark .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]),
body.dark-mode .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]),
body[data-theme="dark"] .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]){
  appearance:none !important;
  -webkit-appearance:none !important;
  background-color:#ffffff !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5.5 7.5L10 12l4.5-4.5' stroke='%2393c5fd' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-position:right 22px center !important;
  background-size:20px 20px !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  box-shadow:0 8px 20px rgba(15,23,42,.04), 0 0 0 4px rgba(59,130,246,.06) !important;
  color-scheme:light !important;
  padding-right:58px !important;
}
html:not([data-theme="light"]) body:not(.light).quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]):focus,
body.dark.quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]):focus,
body.dark-mode.quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]):focus,
body[data-theme="dark"].quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]):focus,
html:not([data-theme="light"]) body:not(.light) .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]):focus,
body.dark .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]):focus,
body.dark-mode .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]):focus,
body[data-theme="dark"] .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]):focus{
  background-color:#ffffff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  border-color:#93c5fd !important;
  box-shadow:0 0 0 4px rgba(59,130,246,.14), 0 8px 20px rgba(15,23,42,.04) !important;
  outline:none !important;
}
html:not([data-theme="light"]) body:not(.light).quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]) option,
body.dark.quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]) option,
body.dark-mode.quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]) option,
body[data-theme="dark"].quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell select:not([multiple]) option,
html:not([data-theme="light"]) body:not(.light) .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]) option,
body.dark .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]) option,
body.dark-mode .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]) option,
body[data-theme="dark"] .quote-edit-modal.crm-modal.hx-modal-shell select:not([multiple]) option{
  background:#ffffff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
}
html:not([data-theme="light"]) body:not(.light).quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell :is(.quote-create-card,.quote-margin-panel,.crm-section,.calc-box),
body.dark.quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell :is(.quote-create-card,.quote-margin-panel,.crm-section,.calc-box),
body.dark-mode.quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell :is(.quote-create-card,.quote-margin-panel,.crm-section,.calc-box),
body[data-theme="dark"].quote-create-modal-open .quote-create-modal.crm-modal.hx-modal-shell :is(.quote-create-card,.quote-margin-panel,.crm-section,.calc-box),
html:not([data-theme="light"]) body:not(.light) .quote-edit-modal.crm-modal.hx-modal-shell :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.calc-box),
body.dark .quote-edit-modal.crm-modal.hx-modal-shell :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.calc-box),
body.dark-mode .quote-edit-modal.crm-modal.hx-modal-shell :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.calc-box),
body[data-theme="dark"] .quote-edit-modal.crm-modal.hx-modal-shell :is(.quote-create-card,.quote-margin-panel,.crm-section,.quote-edit-materials-card,.calc-box){
  background:#f1f5f9 !important;
  border-color:#cbd5e1 !important;
}


/* V793 - Project detail dark-mode depth cleanup
   Keep light mode untouched. Project detail was inheriting broad card/input
   dark-mode overrides that made the page look washed-out/blue. Re-apply a
   darker, more solid Havexa dark palette specifically for the project fiche. */
body:not(.light) .project-detail-page,
body.dark .project-detail-page,
body.dark-mode .project-detail-page,
body[data-theme="dark"] .project-detail-page{
  color:#f8fafc;
}

body:not(.light) .project-detail-page .page-header,
body.dark .project-detail-page .page-header,
body.dark-mode .project-detail-page .page-header,
body[data-theme="dark"] .project-detail-page .page-header{
  background:transparent !important;
  border-color:transparent !important;
  box-shadow:none !important;
}

body:not(.light) .project-detail-page .soft-card,
body.dark .project-detail-page .soft-card,
body.dark-mode .project-detail-page .soft-card,
body[data-theme="dark"] .project-detail-page .soft-card{
  background:linear-gradient(180deg, rgba(15,34,50,.96), rgba(10,25,38,.96)) !important;
  border:1px solid rgba(96,165,250,.16) !important;
  box-shadow:0 18px 42px rgba(2,6,23,.30), inset 0 1px 0 rgba(255,255,255,.035) !important;
  color:#f8fafc !important;
}

body:not(.light) .project-detail-page .operation-readiness-card,
body.dark .project-detail-page .operation-readiness-card,
body.dark-mode .project-detail-page .operation-readiness-card,
body[data-theme="dark"] .project-detail-page .operation-readiness-card{
  background:linear-gradient(180deg, rgba(15,35,51,.98), rgba(11,28,42,.98)) !important;
  border-color:rgba(20,184,166,.20) !important;
}

body:not(.light) .project-detail-page .soft-card h2,
body:not(.light) .project-detail-page .soft-card h3,
body:not(.light) .project-detail-page label,
body:not(.light) .project-detail-page label span,
body.dark .project-detail-page .soft-card h2,
body.dark .project-detail-page .soft-card h3,
body.dark .project-detail-page label,
body.dark .project-detail-page label span,
body.dark-mode .project-detail-page .soft-card h2,
body.dark-mode .project-detail-page .soft-card h3,
body.dark-mode .project-detail-page label,
body.dark-mode .project-detail-page label span,
body[data-theme="dark"] .project-detail-page .soft-card h2,
body[data-theme="dark"] .project-detail-page .soft-card h3,
body[data-theme="dark"] .project-detail-page label,
body[data-theme="dark"] .project-detail-page label span{
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
}

body:not(.light) .project-detail-page .muted,
body.dark .project-detail-page .muted,
body.dark-mode .project-detail-page .muted,
body[data-theme="dark"] .project-detail-page .muted{
  color:rgba(226,232,240,.70) !important;
  -webkit-text-fill-color:rgba(226,232,240,.70) !important;
}

body:not(.light) .project-detail-page :is(input,select,textarea,.input),
body.dark .project-detail-page :is(input,select,textarea,.input),
body.dark-mode .project-detail-page :is(input,select,textarea,.input),
body[data-theme="dark"] .project-detail-page :is(input,select,textarea,.input){
  background:linear-gradient(180deg, #071421, #06111d) !important;
  border:1px solid rgba(96,165,250,.18) !important;
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035), 0 10px 24px rgba(2,6,23,.18) !important;
  color-scheme:dark;
}

body:not(.light) .project-detail-page :is(input,select,textarea,.input):focus,
body.dark .project-detail-page :is(input,select,textarea,.input):focus,
body.dark-mode .project-detail-page :is(input,select,textarea,.input):focus,
body[data-theme="dark"] .project-detail-page :is(input,select,textarea,.input):focus{
  border-color:rgba(96,165,250,.48) !important;
  box-shadow:0 0 0 4px rgba(37,99,235,.16), inset 0 1px 0 rgba(255,255,255,.04) !important;
}

body:not(.light) .project-detail-page :is(.metric-row>div,.mini-row,.checkbox-card,.pdf-template-preview,.project-calc-lines,.calculation-rule-row),
body.dark .project-detail-page :is(.metric-row>div,.mini-row,.checkbox-card,.pdf-template-preview,.project-calc-lines,.calculation-rule-row),
body.dark-mode .project-detail-page :is(.metric-row>div,.mini-row,.checkbox-card,.pdf-template-preview,.project-calc-lines,.calculation-rule-row),
body[data-theme="dark"] .project-detail-page :is(.metric-row>div,.mini-row,.checkbox-card,.pdf-template-preview,.project-calc-lines,.calculation-rule-row){
  background:rgba(2,12,27,.28) !important;
  border-color:rgba(96,165,250,.14) !important;
}

body:not(.light) .project-detail-page .sticky-save-bar,
body.dark .project-detail-page .sticky-save-bar,
body.dark-mode .project-detail-page .sticky-save-bar,
body[data-theme="dark"] .project-detail-page .sticky-save-bar{
  background:rgba(7,19,30,.94) !important;
  border-color:rgba(96,165,250,.18) !important;
  box-shadow:0 -16px 38px rgba(2,6,23,.36) !important;
}

/* V796 - Project detail bouwjaar dropdown, quote-template select and card spacing polish
   Scope: project detail only. Keeps the dark depth from V793 while improving field ergonomics. */
.project-detail-page .grid.two-col.gap-lg{
  row-gap:2rem !important;
  column-gap:1.35rem !important;
}

.project-detail-page .building-year-actions{
  display:flex !important;
  align-items:center !important;
  gap:1rem !important;
  flex-wrap:wrap !important;
  margin-top:.25rem !important;
}

.project-detail-page .building-year-actions .btn{
  flex:0 0 auto !important;
}

.project-detail-page #projectBuildingYearStatus{
  display:inline-flex !important;
  align-items:center !important;
  min-height:2.75rem !important;
  margin-left:.1rem !important;
}

.project-detail-page .project-year-select,
.project-detail-page .project-pdf-template-select{
  min-height:3.35rem !important;
  border-radius:16px !important;
  padding-inline:1rem 2.75rem !important;
}

.project-detail-page .project-pdf-template-field{
  display:block !important;
  max-width:320px !important;
  margin-bottom:1rem !important;
}

.project-detail-page .project-pdf-template-select{
  width:100% !important;
  box-shadow:0 10px 22px rgba(15,23,42,.06) !important;
}

.project-detail-page .project-pdf-template-select:focus{
  outline:none !important;
}

body:not(.light) .project-detail-page .building-year-actions,
body.dark .project-detail-page .building-year-actions,
body.dark-mode .project-detail-page .building-year-actions,
body[data-theme="dark"] .project-detail-page .building-year-actions{
  color:rgba(226,232,240,.74) !important;
}

body:not(.light) .project-detail-page .project-pdf-template-field,
body.dark .project-detail-page .project-pdf-template-field,
body.dark-mode .project-detail-page .project-pdf-template-field,
body[data-theme="dark"] .project-detail-page .project-pdf-template-field{
  max-width:300px !important;
}

body:not(.light) .project-detail-page .project-year-select,
body:not(.light) .project-detail-page .project-pdf-template-select,
body.dark .project-detail-page .project-year-select,
body.dark .project-detail-page .project-pdf-template-select,
body.dark-mode .project-detail-page .project-year-select,
body.dark-mode .project-detail-page .project-pdf-template-select,
body[data-theme="dark"] .project-detail-page .project-year-select,
body[data-theme="dark"] .project-detail-page .project-pdf-template-select{
  background:#102234 !important;
  border:1px solid rgba(148,163,184,.28) !important;
  color:#f8fafc !important;
  -webkit-text-fill-color:#f8fafc !important;
  box-shadow:none !important;
}

body:not(.light) .project-detail-page .project-year-select:focus,
body:not(.light) .project-detail-page .project-pdf-template-select:focus,
body.dark .project-detail-page .project-year-select:focus,
body.dark .project-detail-page .project-pdf-template-select:focus,
body.dark-mode .project-detail-page .project-year-select:focus,
body.dark-mode .project-detail-page .project-pdf-template-select:focus,
body[data-theme="dark"] .project-detail-page .project-year-select:focus,
body[data-theme="dark"] .project-detail-page .project-pdf-template-select:focus{
  border-color:rgba(96,165,250,.46) !important;
  box-shadow:0 0 0 3px rgba(37,99,235,.18) !important;
}

body:not(.light) .project-detail-page .pdf-template-preview,
body.dark .project-detail-page .pdf-template-preview,
body.dark-mode .project-detail-page .pdf-template-preview,
body[data-theme="dark"] .project-detail-page .pdf-template-preview{
  margin-top:1rem !important;
}


/* V798 - Project detail bouwjaar, CSRF lookup support and stronger card spacing
   Bouwjaar dropdown now stops at 1900 in the template. This CSS makes the spacing visible even when older grid/card rules override gap. */
.project-detail-page .project-feature-form > .grid.two-col.gap-lg{
  display:grid !important;
  gap:2.35rem 1.5rem !important;
  row-gap:2.35rem !important;
}

.project-detail-page .project-feature-form > .grid.two-col.gap-lg > .card.soft-card{
  margin:0 0 2.35rem 0 !important;
}

.project-detail-page .project-feature-form > .grid.two-col.gap-lg > .card.soft-card + .card.soft-card{
  margin-top:.35rem !important;
}

.project-detail-page .building-year-actions{
  gap:1.45rem !important;
  margin-top:.45rem !important;
  margin-bottom:.35rem !important;
}

.project-detail-page #projectBuildingYearStatus{
  padding-left:.15rem !important;
}

body:not(.light) .project-detail-page .project-feature-form > .grid.two-col.gap-lg > .card.soft-card,
body.dark .project-detail-page .project-feature-form > .grid.two-col.gap-lg > .card.soft-card,
body.dark-mode .project-detail-page .project-feature-form > .grid.two-col.gap-lg > .card.soft-card,
body[data-theme="dark"] .project-detail-page .project-feature-form > .grid.two-col.gap-lg > .card.soft-card{
  border-color:rgba(96,165,250,.18) !important;
}

/* V799 - Project detail card spacing and readable automatic check chips */
.project-detail-page .project-feature-form > .grid.two-col.gap-lg{
  gap:1.45rem 1.5rem !important;
  row-gap:1.45rem !important;
}

.project-detail-page .project-feature-form > .grid.two-col.gap-lg > .card.soft-card{
  margin:0 0 1.15rem 0 !important;
}

.project-detail-page .project-feature-form > .grid.two-col.gap-lg > .card.soft-card + .card.soft-card{
  margin-top:0 !important;
}

.project-detail-page .project-check-panel{
  border:1px solid rgba(148,163,184,.22);
  border-radius:18px;
  padding:.9rem;
  background:rgba(148,163,184,.08);
}

.project-detail-page .project-check-title{
  font-weight:800;
  margin-bottom:.35rem;
}

.project-detail-page .project-check-help{
  margin:.1rem 0 .75rem !important;
  font-size:.92rem;
}

.project-detail-page .project-check-list{
  display:flex;
  gap:.55rem;
  flex-wrap:wrap;
  align-items:flex-start;
}

.project-detail-page .project-check-chip{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  border-radius:999px;
  padding:.42rem .62rem;
  font-size:.86rem;
  line-height:1.2;
  border:1px solid rgba(148,163,184,.24);
  background:rgba(255,255,255,.72);
  color:#0f172a;
}

.project-detail-page .project-check-chip strong{
  font-size:.74rem;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.project-detail-page .project-check-chip.is-ok{
  border-color:rgba(34,197,94,.28);
  background:rgba(34,197,94,.10);
}

.project-detail-page .project-check-chip.is-ok strong{
  color:#15803d;
}

.project-detail-page .project-check-chip.needs-attention{
  border-color:rgba(245,158,11,.36);
  background:rgba(245,158,11,.12);
}

.project-detail-page .project-check-chip.needs-attention strong{
  color:#b45309;
}

.project-detail-page .compact-quality-grid{
  grid-template-columns:repeat(2,minmax(0,280px));
}

body:not(.light) .project-detail-page .project-check-panel,
body.dark .project-detail-page .project-check-panel,
body.dark-mode .project-detail-page .project-check-panel,
body[data-theme="dark"] .project-detail-page .project-check-panel{
  background:rgba(2,12,27,.20) !important;
  border-color:rgba(96,165,250,.14) !important;
}

body:not(.light) .project-detail-page .project-check-chip,
body.dark .project-detail-page .project-check-chip,
body.dark-mode .project-detail-page .project-check-chip,
body[data-theme="dark"] .project-detail-page .project-check-chip{
  background:rgba(15,34,50,.82) !important;
  border-color:rgba(148,163,184,.20) !important;
  color:#e2e8f0 !important;
}

body:not(.light) .project-detail-page .project-check-chip.is-ok,
body.dark .project-detail-page .project-check-chip.is-ok,
body.dark-mode .project-detail-page .project-check-chip.is-ok,
body[data-theme="dark"] .project-detail-page .project-check-chip.is-ok{
  background:rgba(34,197,94,.10) !important;
  border-color:rgba(34,197,94,.28) !important;
}

body:not(.light) .project-detail-page .project-check-chip.is-ok strong,
body.dark .project-detail-page .project-check-chip.is-ok strong,
body.dark-mode .project-detail-page .project-check-chip.is-ok strong,
body[data-theme="dark"] .project-detail-page .project-check-chip.is-ok strong{
  color:#86efac !important;
}

body:not(.light) .project-detail-page .project-check-chip.needs-attention,
body.dark .project-detail-page .project-check-chip.needs-attention,
body.dark-mode .project-detail-page .project-check-chip.needs-attention,
body[data-theme="dark"] .project-detail-page .project-check-chip.needs-attention{
  background:rgba(245,158,11,.12) !important;
  border-color:rgba(245,158,11,.34) !important;
}

body:not(.light) .project-detail-page .project-check-chip.needs-attention strong,
body.dark .project-detail-page .project-check-chip.needs-attention strong,
body.dark-mode .project-detail-page .project-check-chip.needs-attention strong,
body[data-theme="dark"] .project-detail-page .project-check-chip.needs-attention strong{
  color:#fbbf24 !important;
}
