
:root {
  --text: #172033;
  --muted: #64748b;
  --blue: #3b82f6;
  --green: #22c55e;
  --amber: #f59e0b;
  --pink: #ec4899;
  --violet: #8b5cf6;
  --red: #ef4444;
  --cyan: #06b6d4;
  --bg: #f7f9ff;
  --sidebar: rgba(255,255,255,.82);
  --panel: rgba(255,255,255,.90);
  --panel-solid: #ffffff;
  --border: rgba(30,41,59,.12);
  --shadow: 0 24px 80px rgba(30,41,59,.12);
  --shadow-soft: 0 14px 38px rgba(30,41,59,.09);
  --radius: 26px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 4%, rgba(59,130,246,.18), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(236,72,153,.14), transparent 24%),
    radial-gradient(circle at 72% 88%, rgba(34,197,94,.15), transparent 26%),
    radial-gradient(circle at 16% 86%, rgba(245,158,11,.13), transparent 22%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button { font: inherit; }

.orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  opacity: .22;
  z-index: -1;
}

.orb-a { width: 360px; height: 360px; background: var(--blue); top: -100px; left: 14%; }
.orb-b { width: 300px; height: 300px; background: var(--pink); right: 8%; top: 22%; }
.orb-c { width: 240px; height: 240px; background: var(--green); bottom: 4%; left: 40%; }

.app-shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.72));
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  box-shadow: 16px 0 55px rgba(30,41,59,.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  padding: 2px;
  background: conic-gradient(from 180deg, var(--blue), var(--green), var(--amber), var(--pink), var(--violet), var(--blue));
  box-shadow: 0 16px 42px rgba(59,130,246,.22);
}

.brand-logo span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  background: #ffffff;
  font-weight: 950;
  font-size: 25px;
  color: #111827;
}

.brand-title {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -.03em;
  color: #0f172a;
}

.brand-subtitle,
.mini-text {
  color: var(--muted);
  font-size: 12px;
}

.tenant-pill {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  border-radius: 999px;
  color: #334155;
  font-size: 12px;
  box-shadow: var(--shadow-soft);
}

.dot {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(34,197,94,.75);
}

.nav-link {
  color: #475569;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 760;
  background: transparent;
  transition: .18s ease;
}

.nav-link:hover {
  color: #0f172a;
  background: rgba(255,255,255,.84);
  border-color: rgba(30,41,59,.08);
  box-shadow: var(--shadow-soft);
  transform: translateX(2px);
}

.nav-pills .nav-link.active {
  background:
    linear-gradient(135deg, rgba(59,130,246,.13), rgba(236,72,153,.10)),
    #ffffff;
  border-color: rgba(59,130,246,.22);
  box-shadow: 0 18px 45px rgba(59,130,246,.13);
  color: #0f172a;
}

.sidebar-footer {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
}

.mini-label,
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #2563eb;
  font-weight: 900;
}

.main {
  padding: 32px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.topbar h1 {
  font-size: clamp(32px,4vw,56px);
  line-height: .96;
  letter-spacing: -.06em;
  margin: .2rem 0 .6rem;
  color: #0f172a;
}

.topbar p,
.panel-caption,
.panel p,
.subtitle {
  color: var(--muted);
}

.login-card,
.panel,
.kpi-card,
.kpi,
.hero-card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  border-radius: var(--radius);
}

.login-card {
  padding: 18px;
  min-width: min(520px, 100%);
}

.form-label {
  font-size: 12px;
  color: #334155;
  font-weight: 850;
}

.form-control,
.form-select {
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(30,41,59,.16) !important;
  color: #0f172a !important;
  border-radius: 14px;
}

.form-control::placeholder { color: #94a3b8; }

.btn {
  border-radius: 14px;
  font-weight: 850;
}

.btn-primary-gradient {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet) 50%, var(--pink));
  box-shadow: 0 16px 40px rgba(139,92,246,.20);
}

.btn-soft {
  border: 1px solid var(--border);
  color: #334155;
  background: rgba(255,255,255,.82);
}

.btn-soft:hover {
  background: #fff;
  color: #0f172a;
  box-shadow: var(--shadow-soft);
}

.rainbow-strip {
  height: 7px;
  border-radius: 99px;
  display: grid;
  grid-template-columns: repeat(5,1fr);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(30,41,59,.12);
}

.rainbow-strip div:nth-child(1) { background: var(--blue); }
.rainbow-strip div:nth-child(2) { background: var(--green); }
.rainbow-strip div:nth-child(3) { background: var(--amber); }
.rainbow-strip div:nth-child(4) { background: var(--pink); }
.rainbow-strip div:nth-child(5) { background: var(--violet); }

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

.kpi-card,
.kpi {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.kpi:before,
.kpi-card:before {
  content: "";
  position: absolute;
  inset: auto -20px -35px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  opacity: .20;
  background: var(--accent, var(--blue));
}

.kpi span,
.kpi .label,
.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.kpi strong,
.kpi .value,
.kpi-card strong {
  display: block;
  font-size: 34px;
  letter-spacing: -.04em;
  margin: 6px 0;
  font-weight: 950;
  color: #0f172a;
}

.kpi small,
.kpi .hint,
.kpi-card small {
  color: #64748b;
  font-size: 13px;
}

.module-hero {
  margin-bottom: 18px;
}

.hero-card {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.hero-card:after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -100px;
  top: -110px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
  opacity: .14;
}

.hero-title {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -.04em;
  margin: 0;
  color: #0f172a;
}

.hero-description {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 780px;
}

.hero-badge {
  position: relative;
  z-index: 1;
  padding: 10px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-weight: 850;
  color: #0f172a;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

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

.dashboard-grid.equal {
  grid-template-columns: 1fr 1fr;
}

.panel {
  padding: 22px;
  min-width: 0;
}

.panel-head,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: 22px;
  letter-spacing: -.04em;
  margin: 0;
  color: #0f172a;
  font-weight: 950;
}

.badge-soft {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(59,130,246,.11);
  border: 1px solid rgba(59,130,246,.20);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.badge-soft.green { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.24); color: #047857; }
.badge-soft.yellow { background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.24); color: #92400e; }
.badge-soft.red { background: rgba(239,68,68,.11); border-color: rgba(239,68,68,.22); color: #b91c1c; }
.badge-soft.pink { background: rgba(236,72,153,.11); border-color: rgba(236,72,153,.22); color: #be185d; }
.badge-soft.purple { background: rgba(139,92,246,.12); border-color: rgba(139,92,246,.24); color: #6d28d9; }
.badge-soft.cyan { background: rgba(6,182,212,.12); border-color: rgba(6,182,212,.24); color: #0e7490; }

.action-stack {
  display: grid;
  gap: 12px;
}

.action-card,
.quick-item,
.mini-card,
.event-item,
.workflow-line {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.70);
  padding: 16px;
  border-radius: 18px;
  color: #172033;
}

.action-card {
  font-weight: 850;
}

.action-card:hover,
.btn-mini:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.timeline,
.event-stream,
.cards-list,
.workflow-matrix,
.quick-list {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.70);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  margin-top: 5px;
  background: linear-gradient(135deg,var(--blue),var(--pink));
}

.timeline-title {
  font-weight: 850;
  color: #0f172a;
}

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

.table-wrap,
.table-responsive {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: #172033;
  --bs-table-border-color: rgba(30,41,59,.08);
  margin: 0;
}

.table th {
  color: #2563eb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.table td {
  vertical-align: middle;
}

.text-muted {
  color: var(--muted) !important;
}

.status-pill,
.badge-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(59,130,246,.10);
  border: 1px solid rgba(59,130,246,.20);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 850;
}

.json-card {
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  color: #334155;
  font-size: 12px;
}

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

.profit-cell {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--border);
}

.profit-cell span {
  color: var(--muted);
  font-size: 12px;
}

.profit-cell strong {
  display: block;
  font-size: 24px;
  letter-spacing: -.04em;
  color: #0f172a;
}

.good { color: #047857; }
.bad { color: #b91c1c; }

.health {
  width: 96px;
  height: 9px;
  background: rgba(30,41,59,.10);
  border-radius: 999px;
  overflow: hidden;
}

.health span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg,var(--green),var(--blue));
}

.mini-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.event-item strong,
.quick-item strong,
.mini-card strong {
  display: block;
  color: #0f172a;
}

.event-item span,
.quick-item span,
.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.workflow-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workflow-node {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.16);
  color: #1e3a8a;
}

.arrow {
  color: var(--muted);
  font-weight: 900;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-mini {
  border: 1px solid var(--border);
  color: #334155;
  background: rgba(255,255,255,.82);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
}

.nallium-modal {
  border: 1px solid var(--border);
  border-radius: 26px;
  background: #ffffff;
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header,
.modal-footer {
  border-color: rgba(30,41,59,.10);
}

.modal-header {
  background:
    linear-gradient(135deg, rgba(59,130,246,.10), rgba(236,72,153,.08)),
    #ffffff;
}

.btn-close-white {
  filter: none;
}

.toast {
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border) !important;
}

#toastZone {
  z-index: 1080;
  width: min(420px,100%);
}

canvas {
  max-width: 100%;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .topbar { flex-direction: column; }
  .grid-kpi { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid,
  .dashboard-grid.equal { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .main { padding: 18px; }
  .grid-kpi,
  .profit-grid { grid-template-columns: 1fr; }
}


/* v9 CRM graph/todo refinements */
.crm-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}


/* v10 CRUD actions */
.btn-mini.danger {
  color: #b91c1c;
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.20);
}
.btn-mini.danger:hover {
  background: rgba(239,68,68,.14);
}


/* v11 secure delete modal + contextual locked fields */
.delete-token-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.22);
  color: #991b1b;
  font-weight: 900;
  word-break: break-word;
}
.btn-danger-gradient {
  border: 0;
  color: white;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 16px 40px rgba(239,68,68,.20);
}
.form-select:disabled,
.form-control:disabled {
  opacity: 1;
  background: #f1f5f9 !important;
  color: #64748b !important;
  cursor: not-allowed;
}


/* v12 reliable contextual locked fields */
.form-select:disabled + input[type="hidden"] + .mini-text,
.form-control:disabled + input[type="hidden"] + .mini-text {
  color: #2563eb;
  font-weight: 700;
}


/* v16 CRM selected company filter */
.crm-filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.82);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
.crm-filter-bar strong,
.crm-filter-bar span {
  display: block;
}
.crm-filter-bar span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.selected-row {
  background: rgba(59,130,246,.08);
  outline: 2px solid rgba(59,130,246,.18);
  outline-offset: -2px;
}
@media (max-width: 680px) {
  .crm-filter-bar {
    display: block;
  }
  .crm-filter-bar .action-row {
    margin-top: 12px;
  }
}


/* v18 accounting dashboard */
.accounting-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.84);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
.accounting-toolbar strong,
.accounting-toolbar span {
  display: block;
}
.accounting-toolbar span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.accounting-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: end;
}
.accounting-filters .form-select {
  width: auto;
  min-width: 145px;
}
.invoice-preview h4 {
  margin: 4px 0;
  font-weight: 950;
  letter-spacing: -.04em;
}
.invoice-legal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.invoice-legal-grid div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}
.invoice-legal-grid strong,
.invoice-legal-grid span {
  display: block;
}
.invoice-legal-grid span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
@media print {
  .sidebar,
  .topbar,
  .module-hero,
  .grid-kpi,
  .accounting-toolbar,
  .btn,
  .btn-mini {
    display: none !important;
  }
  .app-shell {
    display: block !important;
  }
  .main {
    padding: 0 !important;
    max-width: none !important;
  }
  .panel {
    box-shadow: none !important;
    break-inside: avoid;
  }
}
@media (max-width: 900px) {
  .accounting-toolbar {
    display: block;
  }
  .accounting-filters {
    margin-top: 12px;
    justify-content: start;
  }
  .invoice-legal-grid {
    grid-template-columns: 1fr;
  }
}


/* v19 SIG table */
.sig-scroll {
  overflow: auto;
  max-width: 100%;
  border-radius: 18px;
  border: 1px solid var(--border);
}
.sig-table {
  min-width: 1280px;
  margin: 0;
}
.sig-table th {
  position: sticky;
  top: 0;
  background: #f8fbff !important;
  z-index: 1;
  white-space: nowrap;
}
.sig-table th:first-child,
.sig-table td:first-child {
  position: sticky;
  left: 0;
  background: #fff !important;
  z-index: 2;
  min-width: 280px;
}
.sig-table td {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sig-table td:first-child {
  text-align: left;
}
.sig-strong td {
  font-weight: 900;
  background: rgba(59,130,246,.06) !important;
}
.sig-strong td:first-child {
  background: #eef6ff !important;
}


/* v20 scoped exports */
.export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.export-fallback {
  display: none;
}
@media print {
  .export-fallback {
    display: block;
  }
}


/* v21 always-visible export toolbar */
.accounting-controls {
  display: grid;
  gap: 10px;
  min-width: min(100%, 720px);
}
.accounting-export-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(59,130,246,.16);
  border-radius: 16px;
  background: rgba(239,246,255,.82);
}
.accounting-export-toolbar .btn-mini,
.export-actions .btn-mini {
  white-space: nowrap;
}
.btn-mini.export-main {
  background: linear-gradient(135deg, rgba(59,130,246,.14), rgba(139,92,246,.12));
  border-color: rgba(59,130,246,.24);
  color: #1d4ed8;
  font-weight: 900;
}
.accounting-toolbar {
  align-items: flex-start;
  overflow: visible;
}
.accounting-filters {
  justify-content: flex-start !important;
}
.export-actions {
  justify-content: flex-start !important;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
}
@media (max-width: 1100px) {
  .accounting-toolbar {
    display: block !important;
  }
  .accounting-controls {
    margin-top: 12px;
    min-width: 0;
  }
}
@media (max-width: 560px) {
  .accounting-filters .form-select,
  .accounting-filters .btn-mini,
  .accounting-export-toolbar .btn-mini {
    width: 100%;
  }
  .accounting-export-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }
}


/* v22 layout overflow fix: keep wide SIG/table content inside cards */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.app-shell,
.main,
.content,
.dashboard-grid,
.panel,
.panel-body,
.accounting-toolbar,
.accounting-controls,
.accounting-export-toolbar {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.main {
  width: 100%;
  overflow-x: hidden;
}

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

.panel {
  overflow: hidden;
}

.panel-body {
  overflow: hidden;
}

.table-responsive,
.sig-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.sig-table {
  width: max-content;
  min-width: 1280px;
  max-width: none;
}

.sig-table th,
.sig-table td {
  box-sizing: border-box;
}

.accounting-toolbar {
  width: 100%;
}

.accounting-export-toolbar {
  position: sticky;
  top: 10px;
  z-index: 20;
}

.accounting-filters,
.accounting-export-toolbar,
.action-row,
.export-actions {
  max-width: 100%;
}

.chart-wrap,
canvas {
  max-width: 100% !important;
}

@media (max-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .main {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .accounting-export-toolbar {
    position: static;
  }
}


/* v23 PDF downloads */
.btn-mini.export-main::before {
  content: "⬇ ";
}


/* v26 categorization and balance */
#categorizationModal .context-lock {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#categorizationModal .context-lock div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(248,251,255,.9);
}
#categorizationModal .context-lock strong,
#categorizationModal .context-lock span {
  display: block;
}
#categorizationModal .context-lock span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
@media (max-width: 720px) {
  #categorizationModal .context-lock {
    grid-template-columns: 1fr;
  }
}


/* v27 sexy categorization modal */
.category-badge-link {
  appearance: none;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.86);
  border-radius: 999px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  max-width: 100%;
  transition: .18s ease;
}
.category-badge-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15,23,42,.12);
  border-color: rgba(59,130,246,.25);
}
.category-badge-link .dot,
.current-group .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.category-badge-link strong {
  font-size: 12px;
}
.category-badge-link small {
  color: var(--muted);
  font-size: 11px;
}
.categorization-pro-modal .modal-body {
  background:
    radial-gradient(circle at 10% 20%, rgba(59,130,246,.08), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(236,72,153,.08), transparent 30%),
    #ffffff;
}
.categorization-layout {
  display: grid;
  grid-template-columns: 300px minmax(0,1fr);
  gap: 22px;
  min-height: 540px;
}
.categorization-receipt {
  position: relative;
  border-radius: 26px;
  background: linear-gradient(180deg,#f8fafc,#eef6ff);
  border: 1px solid var(--border);
  padding: 80px 22px 22px;
  text-align: center;
  overflow: hidden;
}
.receipt-help {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 82px;
  height: 82px;
  border-radius: 28px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 16px 40px rgba(15,23,42,.08);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  color: #fb923c;
}
.categorization-receipt h4 {
  font-size: 30px;
  font-weight: 950;
  margin-bottom: 8px;
  color: #172033;
}
.categorization-receipt p {
  color: #475569;
  font-weight: 800;
  line-height: 1.35;
}
.categorization-receipt > span {
  color: #94a3b8;
  font-weight: 700;
}
.current-group {
  margin-top: 22px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 18px;
  display: grid;
  gap: 5px;
  justify-items: center;
}
.current-group strong,
.current-group small {
  display: block;
}
.current-group small {
  color: var(--muted);
  font-size: 12px;
}
.suggestion-card {
  margin-top: 18px;
  text-align: left;
  border: 1px solid rgba(59,130,246,.18);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.9);
  display: grid;
  gap: 12px;
}
.suggestion-card strong,
.suggestion-card small {
  display: block;
}
.suggestion-card small {
  color: var(--muted);
  margin-top: 4px;
}
.category-search-row {
  max-width: 620px;
  margin: 0 auto 20px;
}
.category-search-row .form-control {
  border-radius: 999px;
  border: 0;
  background: #f1f5f9;
  height: 48px;
  padding-left: 22px;
  font-weight: 700;
}
.category-browser-grid {
  columns: 3 260px;
  column-gap: 26px;
}
.category-group-card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
}
.category-group-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 9px;
}
.category-group-title .group-dot {
  width: 14px;
  height: 14px;
  background: var(--group-color);
  border-radius: 50%;
  margin-top: 4px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--group-color) 15%, transparent);
}
.category-group-title strong {
  color: var(--group-color);
  font-size: 15px;
  letter-spacing: .01em;
}
.category-group-title small {
  color: var(--muted);
  display: block;
  line-height: 1.25;
  margin-top: 2px;
}
.category-account-list {
  display: grid;
  gap: 4px;
}
.category-account-link {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 12px;
  padding: 7px 8px;
  color: #64748b;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
  align-items: start;
  transition: .15s ease;
}
.category-account-link span {
  font-weight: 900;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.category-account-link em {
  font-style: normal;
  color: #64748b;
  line-height: 1.28;
}
.category-account-link:hover,
.category-account-link.selected {
  background: #f8fbff;
  box-shadow: inset 3px 0 0 var(--blue);
}
.category-account-link.selected span,
.category-account-link.selected em {
  color: #1d4ed8;
}
.advanced-accounting-box {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(248,251,255,.72);
  padding: 12px;
}
.advanced-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-weight: 900;
  text-align: left;
  padding: 4px;
}
.sticky-footer {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  z-index: 5;
}
.empty-state-mini {
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state-mini strong,
.empty-state-mini span {
  display: block;
}
@media (max-width: 992px) {
  .categorization-layout {
    grid-template-columns: 1fr;
  }
  .categorization-receipt {
    min-height: 260px;
  }
  .category-browser-grid {
    columns: 2 240px;
  }
}
@media (max-width: 640px) {
  .category-browser-grid {
    columns: 1;
  }
  .category-account-link {
    grid-template-columns: 70px 1fr;
  }
}


/* v29 macro accounting dashboard */
.macro-indicator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.macro-indicator-header h2 {
  margin: 0;
  font-weight: 950;
  letter-spacing: -.04em;
}
.macro-indicator-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.info-dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #d1d5db;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
.macro-mode-toggle {
  display: inline-flex;
  border-radius: 12px;
  background: #f1f5f9;
  overflow: hidden;
  border: 1px solid var(--border);
}
.macro-mode-toggle button {
  border: 0;
  background: transparent;
  padding: 9px 14px;
  color: #94a3b8;
  font-weight: 900;
}
.macro-mode-toggle button.active {
  background: #666;
  color: #fff;
}
.macro-legend {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 10vw, 170px);
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.macro-legend div {
  display: grid;
  grid-template-columns: 12px auto;
  column-gap: 10px;
  align-items: center;
}
.macro-legend span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.macro-legend em {
  font-style: normal;
  color: #334155;
  font-weight: 700;
}
.macro-legend strong {
  grid-column: 2;
  font-weight: 950;
  font-size: 16px;
}
.macro-balance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.macro-balance-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.86);
  min-width: 0;
}
.macro-balance-card span,
.macro-balance-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.macro-balance-card strong {
  display: block;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.03em;
  margin: 3px 0;
}
.macro-balance-card.positive strong { color: #16a34a; }
.macro-balance-card.negative strong { color: #dc2626; }
.macro-balance-card.focus {
  background: linear-gradient(135deg, rgba(59,130,246,.10), rgba(139,92,246,.08));
  border-color: rgba(59,130,246,.22);
}
@media (max-width: 900px) {
  .macro-indicator-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .macro-legend {
    justify-content: flex-start;
    gap: 18px;
  }
  .macro-balance-grid {
    grid-template-columns: 1fr;
  }
}


/* v30 Chart.js height containment fix */
.chart-box {
  position: relative;
  width: 100%;
  overflow: hidden;
  flex: 0 0 auto;
  contain: layout size;
}
.chart-box canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}
.panel-body .chart-box {
  max-width: 100%;
}
#macroAccountingChart,
#macroBalanceChart,
#expenseCategoryChart,
#accountingMonthlyChart,
#crmChart,
#projectMarginChart,
#invoiceChart,
#purchaseChart,
#bankChart,
#userChart,
#workflowChart {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}
#monthlyDashboardExportZone .panel-body,
#balanceExportZone .panel-body {
  min-height: auto !important;
  overflow: hidden;
}


/* v31 treasury dashboard */
.treasury-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.treasury-header h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -.04em;
}
.treasury-header p {
  margin: 4px 0 0;
  color: var(--muted);
}
.treasury-account-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #f4f6f8;
  border-radius: 14px;
  padding: 12px 14px;
  min-width: min(100%, 360px);
}
.treasury-account-select span {
  font-size: 22px;
  opacity: .65;
}
.treasury-account-select .form-select {
  border: 0;
  background-color: transparent;
  color: #667085;
  font-weight: 900;
  min-width: 280px;
}
.treasury-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.treasury-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.88);
}
.treasury-card span,
.treasury-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.treasury-card strong {
  display: block;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -.03em;
  margin: 3px 0;
}
.treasury-card.positive strong { color: #16a34a; }
.treasury-card.negative strong { color: #dc2626; }
.treasury-card.focus {
  background: linear-gradient(135deg, rgba(59,130,246,.10), rgba(139,92,246,.08));
  border-color: rgba(59,130,246,.22);
}
.connection-status-list {
  display: grid;
  gap: 10px;
}
.connection-status-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
}
.connection-status-item strong,
.connection-status-item span,
.connection-status-item small {
  display: block;
}
.connection-status-item span {
  color: #1d4ed8;
  font-weight: 900;
  margin-top: 3px;
}
.connection-status-item small {
  color: var(--muted);
  margin-top: 3px;
}
#treasuryChart {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
}
@media (max-width: 980px) {
  .treasury-header {
    display: block;
  }
  .treasury-account-select {
    margin-top: 12px;
    width: 100%;
  }
  .treasury-account-select .form-select {
    min-width: 0;
  }
  .treasury-card-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .treasury-card-grid {
    grid-template-columns: 1fr;
  }
}


/* v32 collapsible dashboards */
.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.panel-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.9);
  color: #334155;
  display: inline-grid;
  place-items: center;
  font-weight: 950;
  line-height: 1;
  transition: .15s ease;
}
.panel-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15,23,42,.10);
  border-color: rgba(59,130,246,.28);
  color: #1d4ed8;
}
.collapse-icon {
  font-size: 17px;
  margin-top: -1px;
}
.collapsible-panel-body {
  overflow: hidden;
}
.collapsible-panel.is-collapsed .collapsible-panel-body {
  display: none;
}
.collapsible-panel.is-collapsed .panel-head {
  border-bottom: 0;
}
.collapsible-panel.is-collapsed {
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}
.panel-global-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 14px;
}
.panel-global-actions .btn-mini {
  background: rgba(255,255,255,.92);
  border-color: rgba(59,130,246,.18);
  color: #1d4ed8;
  font-weight: 900;
}
@media (max-width: 700px) {
  .panel-head {
    align-items: flex-start;
    gap: 10px;
  }
  .panel-actions {
    align-self: stretch;
    justify-content: space-between;
  }
  .panel-global-actions {
    justify-content: flex-start;
  }
}


/* v33 panel arrow + clickable header */
.panel-head-clickable {
  cursor: pointer;
  user-select: none;
}
.panel-head-clickable:hover h3 {
  color: #1d4ed8;
}
.panel-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.panel-title-wrap > div {
  min-width: 0;
}
.panel-arrow {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(59,130,246,.08);
  color: #1d4ed8;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  margin-top: 2px;
  flex: 0 0 auto;
  transition: .15s ease;
}
.panel-head-clickable:hover .panel-arrow {
  background: rgba(59,130,246,.16);
  transform: translateY(-1px);
}
.collapsible-panel.is-collapsed .panel-arrow {
  background: rgba(100,116,139,.10);
  color: #64748b;
}
.collapsible-panel.is-collapsed .panel-head-clickable:hover .panel-arrow {
  color: #1d4ed8;
}

/* v33: legacy +/- button hidden if old markup remains somewhere */
.panel-toggle {
  display: none !important;
}


/* v34 legal entity document branding */
.hero-right-stack {
  display: grid;
  justify-items: end;
  gap: 10px;
}
.legal-brand-block {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.legal-brand-block.compact {
  padding: 7px 10px;
  border-radius: 14px;
}
.legal-brand-block strong,
.legal-brand-block span {
  display: block;
}
.legal-brand-block strong {
  color: var(--text);
  font-weight: 950;
  font-size: 13px;
}
.legal-brand-block span {
  color: var(--muted);
  font-size: 11px;
}
.legal-entity-logo-img {
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
}
.legal-entity-logo-img.sm { width: 34px; height: 34px; }
.legal-entity-logo-img.md { width: 48px; height: 48px; }
.legal-entity-logo-img.lg { width: 120px; height: 120px; }
.legal-entity-logo-mark {
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 950;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--entity-brand), color-mix(in srgb, var(--entity-brand) 55%, #ffffff));
  box-shadow: 0 10px 22px rgba(15,23,42,.12);
}
.legal-entity-logo-mark.sm { width: 34px; height: 34px; font-size: 15px; }
.legal-entity-logo-mark.md { width: 48px; height: 48px; font-size: 22px; }
.legal-entity-logo-mark.lg { width: 120px; height: 120px; font-size: 46px; border-radius: 30px; }
.legal-brand-admin {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}
.legal-brand-admin-meta strong,
.legal-brand-admin-meta span {
  display: block;
}
.legal-brand-admin-meta span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.legal-brand-modal-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 20px;
  align-items: start;
}
.legal-logo-drop {
  border: 1px dashed #bfdbfe;
  border-radius: 24px;
  background: linear-gradient(180deg,#f8fbff,#ffffff);
  padding: 18px;
  text-align: center;
}
.legal-logo-drop strong,
.legal-logo-drop span {
  display: block;
}
.legal-logo-drop strong {
  margin-top: 12px;
  color: var(--text);
  font-weight: 900;
  word-break: break-word;
}
.legal-logo-drop span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
@media (max-width: 900px) {
  .hero-right-stack {
    justify-items: start;
  }
  .legal-brand-admin,
  .legal-brand-modal-grid {
    grid-template-columns: 1fr;
  }
}


/* v37 full-width bank lists with scroll */
.fullwidth-dashboard-block {
  width: 100%;
  max-width: 100%;
}
.dashboard-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}
.dashboard-table-scroll .table-responsive {
  margin: 0;
  overflow: visible;
}
.dashboard-table-scroll table {
  margin-bottom: 0;
  min-width: 980px;
}
.dashboard-table-scroll-lg {
  max-height: 560px;
}
.dashboard-table-scroll-md {
  max-height: 460px;
}
.dashboard-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbff;
  box-shadow: 0 1px 0 var(--border);
}
.dashboard-table-scroll::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.dashboard-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(100,116,139,.35);
  border-radius: 999px;
}
.dashboard-table-scroll::-webkit-scrollbar-track {
  background: rgba(241,245,249,.75);
  border-radius: 999px;
}


/* v38 business card facing */
.business-card-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
}
.business-card-face {
  aspect-ratio: 1.545 / 1;
  border-radius: 24px;
  padding: 22px;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 18px 44px rgba(15,23,42,.10);
  position: relative;
  overflow: hidden;
  min-height: 190px;
}
.business-card-front {
  background:
    radial-gradient(circle at 8% 10%, color-mix(in srgb, var(--card-brand) 18%, transparent), transparent 32%),
    linear-gradient(135deg, #ffffff, #f8fbff);
}
.business-card-front::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -34px;
  width: 150px;
  height: 150px;
  border-radius: 48px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--card-brand) 28%, transparent), color-mix(in srgb, var(--card-accent) 25%, transparent));
  transform: rotate(16deg);
}
.business-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.business-card-top strong {
  font-size: 15px;
  font-weight: 950;
  color: var(--text);
}
.business-card-person {
  margin-top: 32px;
  position: relative;
  z-index: 1;
}
.business-card-person h4 {
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.05em;
  margin: 0;
}
.business-card-person p {
  color: var(--card-brand);
  font-weight: 900;
  margin: 3px 0 0;
}
.business-card-contact {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  z-index: 1;
  display: grid;
  gap: 4px;
}
.business-card-contact span {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
.business-card-back {
  background:
    radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--card-accent) 20%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--card-brand) 88%, #111827), color-mix(in srgb, var(--card-brand) 55%, #111827));
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
}
.business-card-back .legal-entity-logo-mark,
.business-card-back .legal-entity-logo-img {
  transform: scale(1.08);
}
.business-card-back strong,
.business-card-back span {
  display: block;
  color: #fff;
}
.business-card-back strong {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 950;
}
.business-card-back span {
  opacity: .82;
  font-size: 12px;
}
.business-card-back-mark {
  display: grid;
  place-items: center;
}
@media (max-width: 800px) {
  .business-card-preview-grid {
    grid-template-columns: 1fr;
  }
}


/* v39 legal entity uses Nallium brand-logo */
.legal-entity-brand-logo {
  flex: 0 0 auto;
}
.legal-entity-brand-logo.sm {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}
.legal-entity-brand-logo.md {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}
.legal-entity-brand-logo.lg {
  width: 120px;
  height: 120px;
  border-radius: 30px;
}
.legal-entity-brand-logo.sm span {
  font-size: 15px;
}
.legal-entity-brand-logo.md span {
  font-size: 22px;
}
.legal-entity-brand-logo.lg span {
  font-size: 48px;
}
.business-card-back .legal-entity-brand-logo {
  background: conic-gradient(from 180deg,var(--blue),var(--green),var(--amber),var(--pink),var(--violet),var(--blue));
  box-shadow: 0 20px 50px rgba(0,0,0,.20);
}


/* v40 products/services catalog and quote lines */
.product-facing {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  min-width: 260px;
}
.product-facing-visual {
  width: 72px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(139,92,246,.10));
  border: 1px solid rgba(59,130,246,.15);
  color: #1d4ed8;
  font-weight: 950;
  font-size: 13px;
}
.product-facing-visual.service {
  background: linear-gradient(135deg, rgba(34,197,94,.14), rgba(6,182,212,.10));
  color: #15803d;
}
.product-facing-visual.material {
  background: linear-gradient(135deg, rgba(245,158,11,.14), rgba(236,72,153,.10));
  color: #b45309;
}
.product-facing-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-facing strong,
.product-facing p {
  display: block;
  margin: 0;
}
.product-facing strong {
  font-weight: 950;
  color: var(--text);
}
.product-facing p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin-top: 3px;
}
.quick-list {
  display: grid;
  gap: 10px;
}
#quoteLineProductFacing .product-facing {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: rgba(248,251,255,.86);
}
.product-service-fields,
.product-material-fields {
  transition: .15s ease;
}
.status-pill.danger {
  background: rgba(239,68,68,.12);
  color: #b91c1c;
}


/* v41 quote detail modal as a real quote document */
.quote-detail-modal .modal-body {
  background: #f8fbff;
}
.quote-document-preview {
  max-width: 1120px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 18px 55px rgba(15,23,42,.10);
}
.quote-top-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 24px;
}
.quote-party-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(180deg,#ffffff,#f8fbff);
}
.quote-party-card.client {
  text-align: right;
}
.quote-party-card strong,
.quote-party-card span {
  display: block;
}
.quote-party-card strong {
  color: var(--text);
  font-weight: 950;
}
.quote-party-card span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.quote-issuer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.quote-header-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.quote-header-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: #f8fbff;
}
.quote-header-item span,
.quote-header-item strong {
  display: block;
}
.quote-header-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.quote-header-item strong {
  color: var(--text);
  font-size: 13px;
  margin-top: 4px;
}
.quote-empty-lines {
  border: 1px dashed #bfdbfe;
  border-radius: 22px;
  padding: 30px;
  text-align: center;
  background: linear-gradient(180deg,#f8fbff,#ffffff);
  margin-bottom: 20px;
}
.quote-empty-lines strong,
.quote-empty-lines span {
  display: block;
}
.quote-empty-lines strong {
  font-size: 18px;
  font-weight: 950;
  color: var(--text);
}
.quote-empty-lines span {
  color: var(--muted);
  margin: 6px 0 16px;
}
.quote-lines-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.quote-detail-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 22px;
}
.quote-detail-table {
  margin: 0;
  min-width: 960px;
}
.quote-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
}
.quote-line-row {
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.quote-line-row.is-dragging {
  opacity: .55;
  transform: scale(.995);
  background: #eff6ff;
}
.quote-line-row.drag-over {
  outline: 2px dashed #3b82f6;
  outline-offset: -4px;
  background: #eff6ff;
}
.drag-cell {
  width: 34px;
  text-align: center;
}
.drag-grip {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(59,130,246,.10);
  color: #1d4ed8;
  cursor: grab;
  font-weight: 950;
  letter-spacing: -3px;
}
.drag-grip:active {
  cursor: grabbing;
}
.quote-total-zone {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}
.quote-vat-summary,
.quote-grand-total {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  background: #fff;
}
.quote-vat-summary strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 950;
}
.quote-vat-summary div,
.quote-grand-total div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid #eef2f7;
}
.quote-vat-summary div:last-child,
.quote-grand-total div:last-child {
  border-bottom: 0;
}
.quote-grand-total span {
  color: var(--muted);
}
.quote-grand-total strong {
  color: var(--text);
  font-weight: 950;
}
.quote-grand-total .total-ttc {
  margin-top: 6px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59,130,246,.10), rgba(34,197,94,.08));
}
.quote-grand-total .total-ttc strong {
  font-size: 20px;
  color: #1d4ed8;
}
.quote-legal-mentions {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  background: #f8fbff;
}
.quote-legal-mentions strong {
  display: block;
  color: var(--text);
  margin-bottom: 8px;
}
.quote-legal-mentions li {
  color: #475569;
  font-size: 12px;
  margin-bottom: 5px;
}
@media (max-width: 1000px) {
  .quote-top-parties,
  .quote-total-zone {
    grid-template-columns: 1fr;
  }
  .quote-party-card.client {
    text-align: left;
  }
  .quote-header-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}


/* v42 quote lock, PDF and email send */
.quote-document-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  margin-bottom: 14px;
}
.quote-document-actions strong,
.quote-document-actions span {
  display: block;
}
.quote-lock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  border: 1px solid rgba(239,68,68,.18);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(254,242,242,.86);
  color: #991b1b;
}
.quote-lock-banner strong,
.quote-lock-banner span {
  display: block;
}
.quote-lock-banner span {
  font-size: 12px;
  color: #b91c1c;
}
.quote-line-row.is-locked {
  background: rgba(248,250,252,.75);
}
.drag-grip.disabled {
  opacity: .45;
  cursor: not-allowed;
  background: rgba(100,116,139,.10);
  color: #64748b;
}


/* v43 clean legal entity brand-logo: identical premium rendering to sidebar brand-logo */
.legal-brand-block .legal-entity-brand-logo,
.quote-issuer-brand .legal-entity-brand-logo,
.business-card-face .legal-entity-brand-logo,
#legalLogoCurrentPreview .legal-entity-brand-logo {
  display: grid !important;
  place-items: center !important;
  position: relative !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border: 2px solid transparent !important;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(from 180deg, var(--blue), var(--green), var(--amber), var(--pink), var(--violet), var(--blue)) border-box !important;
  box-shadow: 0 12px 30px rgba(15,23,42,.10) !important;
  color: var(--text) !important;
  transform: none !important;
  flex: 0 0 auto !important;
}

.legal-brand-block .legal-entity-brand-logo::before,
.quote-issuer-brand .legal-entity-brand-logo::before,
.business-card-face .legal-entity-brand-logo::before,
#legalLogoCurrentPreview .legal-entity-brand-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(66,133,244,.16), transparent 34%),
    radial-gradient(circle at 80% 75%, rgba(236,72,153,.13), transparent 32%);
  pointer-events: none;
}

.legal-brand-block .legal-entity-brand-logo span,
.quote-issuer-brand .legal-entity-brand-logo span,
.business-card-face .legal-entity-brand-logo span,
#legalLogoCurrentPreview .legal-entity-brand-logo span {
  position: relative !important;
  z-index: 1 !important;
  display: inline-block !important;
  color: var(--text) !important;
  font-weight: 950 !important;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: -.08em !important;
  line-height: 1 !important;
  transform: translateY(-1px) !important;
}

.legal-entity-brand-logo.sm {
  width: 44px !important;
  height: 44px !important;
  border-radius: 18px !important;
  min-width: 44px !important;
}

.legal-entity-brand-logo.sm span {
  font-size: 24px !important;
}

.legal-entity-brand-logo.md {
  width: 56px !important;
  height: 56px !important;
  border-radius: 22px !important;
  min-width: 56px !important;
}

.legal-entity-brand-logo.md span {
  font-size: 30px !important;
}

.legal-entity-brand-logo.lg {
  width: 126px !important;
  height: 126px !important;
  border-radius: 34px !important;
  min-width: 126px !important;
}

.legal-entity-brand-logo.lg span {
  font-size: 64px !important;
}

.legal-brand-block.compact {
  min-height: 62px;
  padding: 9px 14px;
  align-items: center;
}

.business-card-back .legal-entity-brand-logo {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(from 180deg, var(--blue), var(--green), var(--amber), var(--pink), var(--violet), var(--blue)) border-box !important;
  box-shadow: 0 20px 55px rgba(0,0,0,.24) !important;
}


/* v44 workflow stepper and safe local storage UX */
.workflow-status-cell {
  display: grid;
  gap: 7px;
  min-width: 180px;
}
.workflow-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 220px;
  flex-wrap: wrap;
}
.workflow-step {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 9px;
  font-weight: 900;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.workflow-step.done {
  color: #fff;
  background: #22c55e;
  border-color: #22c55e;
}
.workflow-step.current {
  color: #fff;
  background: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}
.btn-mini.disabled,
.btn-mini:disabled {
  opacity: .55;
  cursor: not-allowed;
}


/* v45 auth, RBAC, quote client actions */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  background: rgba(248,251,255,.88);
  backdrop-filter: blur(18px);
}
.auth-card {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 30px;
  background: #fff;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(15,23,42,.16);
}
.quote-email-editor {
  min-height: 240px;
  overflow: auto;
  line-height: 1.5;
  background: #fff;
}
.quote-email-editor p {
  margin: 0 0 10px;
}
.mail-signature-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 10px 12px;
  background: #f8fbff;
  margin-top: 8px;
}
.mail-signature-card strong,
.mail-signature-card span {
  display: block;
}
.mail-signature-card span {
  font-size: 12px;
  color: var(--muted);
}
.quote-client-actions {
  border: 1px solid rgba(34,197,94,.22);
  border-radius: 20px;
  padding: 14px;
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(59,130,246,.06));
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.quote-client-actions strong,
.quote-client-actions small {
  display: block;
}
.quote-client-actions small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}
.btn-mini.success {
  background: rgba(34,197,94,.12);
  color: #15803d;
  border-color: rgba(34,197,94,.25);
}



/* v49 global full-width item lists */
.list-panel-block,
.fullwidth-dashboard-block {
  width: 100%;
  max-width: 100%;
  grid-column: 1 / -1;
}
.list-panel-block .panel,
.fullwidth-dashboard-block .panel {
  width: 100%;
}
.list-panel-block .table-responsive,
.fullwidth-dashboard-block .table-responsive {
  max-width: 100%;
}
.list-panel-block + .list-panel-block,
.dashboard-grid + .list-panel-block {
  margin-top: 16px;
}
.dashboard-grid .list-panel-block {
  grid-column: 1 / -1;
}


/* v50 unified brand-logo rendering */
.brand-logo,
.brand-logo.legal-entity-brand-logo {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  overflow: hidden !important;
  padding: 0 !important;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(from 180deg, var(--blue), var(--green), var(--amber), var(--pink), var(--violet), var(--blue)) border-box !important;
  border: 2px solid transparent !important;
  box-shadow: 0 14px 34px rgba(15,23,42,.10) !important;
  color: var(--text) !important;
}

.brand-logo::before,
.brand-logo.legal-entity-brand-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(66,133,244,.16), transparent 34%),
    radial-gradient(circle at 80% 75%, rgba(236,72,153,.13), transparent 32%);
  pointer-events: none;
}

.brand-logo span,
.brand-logo.legal-entity-brand-logo span {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
  transform: none !important;
  left: 0 !important;
  top: 0 !important;
  letter-spacing: 0 !important;
  color: var(--text) !important;
  font-weight: 950 !important;
}

/* Same rendering as classic brand-logo; only size changes. */
.brand-logo.legal-entity-brand-logo.sm {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 18px !important;
}
.brand-logo.legal-entity-brand-logo.md {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;
  border-radius: 26px !important;
}
.brand-logo.legal-entity-brand-logo.lg {
  width: 126px !important;
  height: 126px !important;
  min-width: 126px !important;
  border-radius: 34px !important;
}
.brand-logo.legal-entity-brand-logo.sm span { font-size: 24px !important; }
.brand-logo.legal-entity-brand-logo.md span { font-size: 40px !important; }
.brand-logo.legal-entity-brand-logo.lg span { font-size: 64px !important; }


/* v50 dedicated login page */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 10% 10%, rgba(66,133,244,.15), transparent 32%),
    radial-gradient(circle at 90% 30%, rgba(236,72,153,.13), transparent 30%),
    linear-gradient(135deg, #f8fbff, #ffffff);
}
.login-panel {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 34px;
  background: rgba(255,255,255,.92);
  padding: 32px;
  box-shadow: 0 24px 88px rgba(15,23,42,.16);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}
.login-brand .brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 26px;
}
.login-brand .brand-logo span {
  font-size: 40px;
}
.login-brand h1 {
  margin: 0;
  color: var(--text);
  font-weight: 950;
  letter-spacing: -.05em;
}
.login-brand p {
  margin: 4px 0 0;
  color: var(--muted);
}
.login-route-info {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fbff;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.login-route-info span,
.login-route-info strong {
  display: block;
}
.login-route-info span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.login-route-info strong {
  color: var(--text);
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
}
.login-demo-users {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.login-demo-users strong,
.login-demo-users span {
  display: block;
}
.login-demo-users strong {
  color: var(--text);
}
.login-demo-users span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}


/* v51 login visibility and project staffing */
.auth-mini-card {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.75);
}
.auth-mini-card span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.login-page:not(.d-none) {
  display: grid !important;
}
#appShell.d-none {
  display: none !important;
}


/* v52 internal login functional states */
.login-error {
  border: 1px solid rgba(239,68,68,.22);
  background: rgba(254,242,242,.92);
  color: #991b1b;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 800;
  margin-bottom: 16px;
}
.login-loader {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: 28px;
}
.login-loader strong,
.login-loader span {
  display: block;
}
.login-loader strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}
.login-loader span {
  color: var(--muted);
  font-size: 13px;
}
.login-loader-logo {
  width: 92px !important;
  height: 92px !important;
  border-radius: 32px !important;
  animation: loginLogoBuild 1.15s ease-in-out infinite alternate;
}
.login-loader-logo span {
  font-size: 52px !important;
}
@keyframes loginLogoBuild {
  0% {
    transform: scale(.82) rotate(-8deg);
    filter: saturate(.85);
    box-shadow: 0 6px 18px rgba(15,23,42,.08);
  }
  60% {
    transform: scale(1.03) rotate(2deg);
    filter: saturate(1.25);
    box-shadow: 0 18px 44px rgba(15,23,42,.16);
  }
  100% {
    transform: scale(1) rotate(0);
    filter: saturate(1.4);
    box-shadow: 0 22px 58px rgba(15,23,42,.18);
  }
}
#moduleNav .nav-link[style*="display: none"] {
  display: none !important;
}

/* v53 login submit/redirect fix */
#loginSubmitBtn:disabled {
  opacity: .7;
  cursor: wait;
}


/* v54 user session menu and cookie-backed session */
.user-session-card {
  position: relative;
}
.user-session-trigger {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 10px;
  background: rgba(255,255,255,.82);
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}
.user-avatar-gradient {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 950;
  letter-spacing: -.03em;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    conic-gradient(from 180deg, var(--blue), var(--green), var(--amber), var(--pink), var(--violet), var(--blue)) border-box;
  border: 2px solid transparent;
  box-shadow: 0 10px 24px rgba(15,23,42,.10);
}
.user-session-identity {
  min-width: 0;
}
.user-session-identity strong,
.user-session-identity small {
  display: block;
}
.user-session-identity strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-session-identity small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-session-arrow {
  color: var(--muted);
  font-weight: 950;
}
.user-session-dropdown {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 18px 60px rgba(15,23,42,.16);
}
.user-session-dropdown-head {
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  padding-bottom: 10px;
}
.user-session-dropdown-head strong,
.user-session-dropdown-head span {
  display: block;
}
.user-session-dropdown-head strong {
  color: var(--text);
  font-weight: 950;
}
.user-session-dropdown-head span {
  color: var(--muted);
  font-size: 12px;
}
.btn-mini.danger {
  color: #b91c1c;
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.22);
}


/* v55 business card QR code with centered logo */
.business-card-front .business-card-contact span:nth-child(3) {
  display: none !important;
}

.business-card-back-qr {
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 18px !important;
  align-items: center !important;
}

.business-card-back-content {
  display: grid;
  gap: 8px;
}

.business-card-back-content strong {
  font-size: 18px;
  color: #fff;
}

.business-card-back-content span {
  color: rgba(255,255,255,.82);
  font-size: 12px;
  word-break: break-word;
}

.business-card-qr {
  position: relative;
  width: 126px;
  height: 126px;
  border-radius: 24px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0,0,0,.24);
  display: grid;
  place-items: center;
}

.business-card-qr-svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 14px;
}

.business-card-qr-logo {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 16px;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 3px;
  box-shadow: 0 8px 22px rgba(15,23,42,.24);
}

.business-card-qr-logo .legal-entity-brand-logo.sm {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 13px !important;
}

.business-card-qr-logo .legal-entity-brand-logo.sm span {
  font-size: 17px !important;
}


/* v57 business card verso: QR only, perfectly centered */
.business-card-back-qr-only {
  display: grid !important;
  place-items: center !important;
  justify-content: center !important;
  align-content: center !important;
  text-align: center !important;
  padding: 24px !important;
}

.business-card-back-qr-only .business-card-qr {
  margin: 0 auto !important;
  align-self: center !important;
  justify-self: center !important;
}

.business-card-back-qr-only .business-card-back-content,
.business-card-back-qr-only > strong,
.business-card-back-qr-only > span {
  display: none !important;
}


/* v58 RBAC editor and account password flow */
.rbac-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  min-width: 520px;
}
.rbac-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
}
.rbac-check.compact {
  margin: 0 6px 6px 0;
}
.rbac-check input {
  accent-color: var(--blue);
}
.rbac-editor-note {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}


/* v59 real camera-scannable QR image */
.business-card-qr {
  width: 148px !important;
  height: 148px !important;
  padding: 8px !important;
  border-radius: 24px !important;
}

.business-card-qr-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  border-radius: 14px;
}

.business-card-qr-logo {
  width: 34px !important;
  height: 34px !important;
  padding: 3px !important;
  border-radius: 14px !important;
}

.business-card-qr-logo .legal-entity-brand-logo.sm {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border-radius: 12px !important;
}

.business-card-qr-logo .legal-entity-brand-logo.sm span {
  font-size: 15px !important;
}


/* v60 user profile page */
.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 4px;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 26px;
  font-size: 28px;
  flex: 0 0 auto;
}
.profile-meta h3 {
  margin: 0;
  color: var(--text);
  font-weight: 950;
  letter-spacing: -.03em;
}
.profile-meta p {
  margin: 4px 0 10px;
  color: var(--muted);
  font-weight: 800;
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.profile-tags span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.profile-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.profile-kv-grid div {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.78);
}
.profile-kv-grid span,
.profile-kv-grid strong {
  display: block;
}
.profile-kv-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.profile-kv-grid strong {
  margin-top: 4px;
  color: var(--text);
  font-weight: 950;
}


/* v61 global action splashscreen */
.global-action-splash {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(66,133,244,.18), transparent 34%),
    radial-gradient(circle at 84% 26%, rgba(236,72,153,.16), transparent 30%),
    rgba(248,251,255,.74);
  backdrop-filter: blur(8px);
}
.global-action-splash.d-none {
  display: none !important;
}
.global-action-splash-card {
  width: min(360px, calc(100vw - 40px));
  border: 1px solid var(--border);
  border-radius: 32px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 28px 90px rgba(15,23,42,.20);
  padding: 30px;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
}
.global-action-splash-logo {
  width: 92px !important;
  height: 92px !important;
  border-radius: 32px !important;
  animation: globalLogoBuild 1.15s ease-in-out infinite alternate;
}
.global-action-splash-logo span {
  font-size: 52px !important;
}
.global-action-splash-card strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
}
.global-action-splash-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
@keyframes globalLogoBuild {
  0% {
    transform: scale(.82) rotate(-8deg);
    filter: saturate(.85);
    box-shadow: 0 6px 18px rgba(15,23,42,.08);
  }
  60% {
    transform: scale(1.03) rotate(2deg);
    filter: saturate(1.25);
    box-shadow: 0 18px 44px rgba(15,23,42,.16);
  }
  100% {
    transform: scale(1) rotate(0);
    filter: saturate(1.4);
    box-shadow: 0 22px 58px rgba(15,23,42,.18);
  }
}


/* v62 legal entity documents and HR */
.legal-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.legal-doc-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  padding: 12px;
}
.legal-doc-section-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.legal-doc-section-head strong {
  color: var(--text);
  font-weight: 950;
}
.legal-doc-section-head span,
.legal-doc-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.legal-doc-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}
.legal-doc-item strong,
.legal-doc-item span {
  display: block;
}
.legal-doc-item strong {
  color: var(--text);
}
.legal-doc-item span {
  color: var(--muted);
  font-size: 12px;
}
.legal-doc-item em {
  font-style: normal;
  color: #166534;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}
.legal-doc-item em.warn {
  color: #b45309;
}


/* v64 HR employee CRUD and career */
.action-row.tight {
  gap: 6px;
  flex-wrap: nowrap;
}
.row-disabled {
  opacity: .58;
  background: rgba(148,163,184,.08);
}
.btn-mini.danger {
  color: #b91c1c;
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.22);
}
.hr-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.hr-detail-grid div {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  padding: 12px;
}
.hr-detail-grid span,
.hr-detail-grid strong {
  display: block;
}
.hr-detail-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.hr-detail-grid strong {
  margin-top: 5px;
  color: var(--text);
  font-weight: 950;
  overflow-wrap: anywhere;
}


/* v65 HR sick/work stop certificate upload */
.badge-soft {
  display: inline-flex;
  max-width: 220px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#hrAbsenceCertificatePreview {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}


/* v66 leave entitlements and legal leave alerts */
.legal-leave-settings {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  background: #f8fbff;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.legal-leave-settings strong {
  color: var(--text);
  font-weight: 950;
}
.legal-leave-settings span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.leave-alert-list {
  display: grid;
  gap: 10px;
}
.leave-alert,
.leave-alert-ok {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #fff;
}
.leave-alert.high {
  border-color: rgba(220,38,38,.25);
  background: rgba(254,242,242,.85);
}
.leave-alert.medium {
  border-color: rgba(245,158,11,.28);
  background: rgba(255,251,235,.85);
}
.leave-alert strong,
.leave-alert span {
  display: block;
}
.leave-alert strong {
  color: var(--text);
  font-weight: 950;
}
.leave-alert span,
.leave-alert-ok {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}


/* v67 profile personal leave dashboard */
#dashboardContent .leave-alert-ok {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}


/* v69 users / HR coherence */
.coherence-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.coherence-summary div {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  padding: 12px;
}
.coherence-summary strong,
.coherence-summary span {
  display: block;
}
.coherence-summary strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 950;
}
.coherence-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-soft.warn {
  color: #b45309;
  background: #fffbeb;
  border-color: rgba(245,158,11,.28);
}


/* v70 profile leave identity guard */
.profile-privacy-banner {
  border: 1px solid rgba(34,197,94,.22);
  border-radius: 18px;
  background: rgba(240,253,244,.85);
  padding: 13px;
}
.profile-privacy-banner.danger {
  border-color: rgba(220,38,38,.25);
  background: rgba(254,242,242,.85);
}
.profile-privacy-banner strong,
.profile-privacy-banner span {
  display: block;
}
.profile-privacy-banner strong {
  color: var(--text);
  font-weight: 950;
}
.profile-privacy-banner span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  margin-top: 4px;
}


/* v72 clean users / HR reference */
.coherence-summary.clean-reference div {
  background: rgba(240,253,244,.88);
}


/* v73 user role editor */
.role-edit-summary,
.role-permission-box {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  padding: 12px;
}
.role-edit-summary strong,
.role-edit-summary span,
.role-permission-box strong,
.role-permission-box span {
  display: block;
}
.role-edit-summary strong,
.role-permission-box strong {
  color: var(--text);
  font-weight: 950;
}
.role-edit-summary span,
.role-permission-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  margin-top: 4px;
}
.role-permission-box.danger {
  border-color: rgba(220,38,38,.25);
  background: rgba(254,242,242,.85);
}


/* v74 personal imputation dashboard */
.mini-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.mini-kpi-grid .kpi-card {
  min-height: auto;
}


/* v75 role persistence fix */
.role-permission-box.persistence-note {
  background: rgba(240,253,244,.88);
}


/* v78 imputation in user menu */
.user-menu-separator {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}
.user-menu-action {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 850;
}
.user-menu-action:hover {
  background: rgba(59,130,246,.08);
}
.user-menu-action span {
  width: 18px;
  text-align: center;
}
.user-menu-action.danger {
  color: #b91c1c;
}


/* v79 user menu, cockpit visibility, monthly imputations, Syntec HR */
.month-imputation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.84);
  padding: 12px;
}
.month-imputation-header strong,
.month-imputation-header span {
  display: block;
}
.month-imputation-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.month-imputation-header input {
  max-width: 180px;
}
tr.weekend td {
  background: rgba(245,158,11,.08) !important;
}
tr.holiday td {
  background: rgba(239,68,68,.08) !important;
}
.badge-soft.danger {
  color: #b91c1c;
  background: #fef2f2;
  border-color: rgba(239,68,68,.25);
}


/* v80 proper monthly timesheet */
.timesheet-header-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.88);
  padding: 14px;
  margin-bottom: 12px;
}
.timesheet-header-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 950;
}
.timesheet-header-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.timesheet-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.timesheet-add-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.timesheet-scroll {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}
.timesheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.timesheet-table th,
.timesheet-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 6px;
  vertical-align: middle;
  text-align: center;
}
.timesheet-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 2;
}
.timesheet-line-label {
  position: sticky;
  left: 0;
  min-width: 230px;
  max-width: 260px;
  background: #fff;
  text-align: left !important;
  z-index: 3;
}
.timesheet-table thead .timesheet-line-label {
  background: #f8fafc;
  z-index: 4;
}
.timesheet-line-label strong,
.timesheet-line-label span {
  display: block;
}
.timesheet-line-label span,
.timesheet-table th em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.timesheet-table th span,
.timesheet-table th strong {
  display: block;
}
.timesheet-table th.weekend,
.timesheet-table td.weekend {
  background: rgba(245,158,11,.08);
}
.timesheet-table th.holiday,
.timesheet-table td.holiday {
  background: rgba(239,68,68,.09);
}
.timesheet-cell {
  width: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 5px;
  text-align: center;
  background: rgba(248,250,252,.9);
}
.timesheet-cell:focus {
  outline: none;
  border-color: rgba(59,130,246,.55);
  background: #fff;
}
.timesheet-cell:disabled {
  background: rgba(229,231,235,.75);
  cursor: not-allowed;
}
.timesheet-total,
.timesheet-total-row td {
  background: rgba(59,130,246,.06);
}


/* v81 timesheet header/detail */
.timesheet-header-actions .btn-mini {
  white-space: nowrap;
}


/* v83 definitive timesheet list/detail */
.timesheet-header-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.88);
  padding: 14px;
  margin-bottom: 12px;
}
.timesheet-header-card h3 { margin: 0; font-size: 20px; font-weight: 950; }
.timesheet-header-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 850; }
.timesheet-header-actions { display: flex; align-items: center; gap: 10px; }
.timesheet-add-line { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.timesheet-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: #fff; }
.timesheet-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.timesheet-table th, .timesheet-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 6px; vertical-align: middle; text-align: center; }
.timesheet-table thead th { position: sticky; top: 0; background: #f8fafc; z-index: 2; }
.timesheet-line-label { position: sticky; left: 0; min-width: 230px; max-width: 260px; background: #fff; text-align: left !important; z-index: 3; }
.timesheet-table thead .timesheet-line-label { background: #f8fafc; z-index: 4; }
.timesheet-line-label strong, .timesheet-line-label span, .timesheet-table th span, .timesheet-table th strong { display: block; }
.timesheet-line-label span, .timesheet-table th em { color: var(--muted); font-size: 10px; font-style: normal; font-weight: 800; }
.timesheet-table th.weekend, .timesheet-table td.weekend { background: rgba(245,158,11,.08); }
.timesheet-table th.holiday, .timesheet-table td.holiday { background: rgba(239,68,68,.09); }
.timesheet-cell { width: 44px; border: 1px solid transparent; border-radius: 10px; padding: 5px; text-align: center; background: rgba(248,250,252,.9); }
.timesheet-cell:focus { outline: none; border-color: rgba(59,130,246,.55); background: #fff; }
.timesheet-cell:disabled { background: rgba(229,231,235,.75); cursor: not-allowed; }
.timesheet-total, .timesheet-total-row td { background: rgba(59,130,246,.06); }


/* v84 canonical timesheet UI */
.timesheet-header-card {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  border:1px solid var(--border);
  border-radius:20px;
  background:rgba(255,255,255,.88);
  padding:14px;
  margin-bottom:12px;
}
.timesheet-header-card h3 { margin:0; font-size:20px; font-weight:950; }
.timesheet-header-card span { display:block; color:var(--muted); font-size:12px; font-weight:850; }
.timesheet-header-actions { display:flex; align-items:center; gap:10px; }
.timesheet-add-line { display:flex; gap:10px; align-items:center; margin-bottom:12px; }
.timesheet-scroll { overflow:auto; border:1px solid var(--border); border-radius:18px; background:#fff; }
.timesheet-table { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; font-size:12px; }
.timesheet-table th, .timesheet-table td { border-bottom:1px solid var(--border); border-right:1px solid var(--border); padding:6px; vertical-align:middle; text-align:center; }
.timesheet-table thead th { position:sticky; top:0; background:#f8fafc; z-index:2; }
.timesheet-line-label { position:sticky; left:0; min-width:230px; max-width:260px; background:#fff; text-align:left !important; z-index:3; }
.timesheet-table thead .timesheet-line-label { background:#f8fafc; z-index:4; }
.timesheet-line-label strong, .timesheet-line-label span, .timesheet-table th span, .timesheet-table th strong { display:block; }
.timesheet-line-label span, .timesheet-table th em { color:var(--muted); font-size:10px; font-style:normal; font-weight:800; }
.timesheet-table th.weekend, .timesheet-table td.weekend { background:rgba(245,158,11,.08); }
.timesheet-table th.holiday, .timesheet-table td.holiday { background:rgba(239,68,68,.09); }
.timesheet-cell { width:44px; border:1px solid transparent; border-radius:10px; padding:5px; text-align:center; background:rgba(248,250,252,.9); }
.timesheet-cell:focus { outline:none; border-color:rgba(59,130,246,.55); background:#fff; }
.timesheet-cell:disabled { background:rgba(229,231,235,.75); cursor:not-allowed; }
.timesheet-total, .timesheet-total-row td { background:rgba(59,130,246,.06); }


/* v86 timesheet list and login cleanup */
.clean-timesheet-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  padding: 16px;
  box-shadow: 0 18px 50px rgba(15,23,42,.08);
}
.timesheet-linked-projects,
.timesheet-list-block {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(248,250,252,.72);
  padding: 12px;
  margin-top: 12px;
}
.timesheet-linked-projects h6,
.timesheet-list-block h6 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.login-help,
.demo-credentials,
.credentials-example {
  display: none !important;
}


/* v87 clean timesheet detail card */
.clean-timesheet-detail-card {
  margin-top: 0;
}
.timesheet-detail-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(248,250,252,.72);
  padding: 12px;
  margin-top: 12px;
}
.timesheet-detail-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.timesheet-detail-section-header h6 {
  margin: 0;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.timesheet-detail-section-header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}
.clean-timesheet-detail-card .timesheet-add-line {
  margin-bottom: 0;
  min-width: min(480px, 100%);
}
@media (max-width: 900px) {
  .timesheet-detail-section-header {
    flex-direction: column;
  }
  .clean-timesheet-detail-card .timesheet-add-line {
    width: 100%;
  }
}


/* v88 timesheet live update */
[data-timesheet-updated-at="true"] {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-top: 4px;
}
.timesheet-cell {
  transition: background .15s ease, border-color .15s ease;
}
.timesheet-cell:focus {
  background: #fff;
}


/* v89 timesheet manager workflow */
.badge-soft.success {
  color: #047857;
  background: #ecfdf5;
  border-color: rgba(16,185,129,.25);
}
.manager-timesheet-card {
  margin-top: 16px;
}
.timesheet-header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}


/* v90 create timesheet month/year form */
#createTimesheetFormContainer {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(248,250,252,.78);
  padding: 12px;
  margin: 12px 0;
}
.create-timesheet-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, .7fr) auto auto;
  gap: 10px;
  align-items: end;
}
@media (max-width: 760px) {
  .create-timesheet-form {
    grid-template-columns: 1fr;
  }
}


/* v91 top create-timesheet action and modal */
.imputation-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.94);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 18px 50px rgba(15,23,42,.08);
}
.imputation-top-actions h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 950;
}
.imputation-top-actions span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
#createTimesheetFormContainer {
  display: none !important;
}
#createTimesheetModal .modal-content.clean-modal {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15,23,42,.22);
}
@media (max-width: 760px) {
  .imputation-top-actions {
    flex-direction: column;
    align-items: stretch;
  }
}


/* v92 global create timesheet action */
.imputation-top-actions {
  display: none !important;
}


/* v93 timesheet modal only */
#imputationModal,
#createImputationModal,
#personalImputationModal,
.imputation-top-actions {
  display: none !important;
}
#primaryCreateBtn[data-create-target="timesheet"] {
  white-space: nowrap;
}


/* v96 collaborator holiday fields */
.hr-holiday-fields {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(248,250,252,.78);
  padding: 12px;
  margin-top: 12px;
}
.hr-holiday-fields h6 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 850;
  color: var(--text);
}


/* v97 HR social fields */
.hr-social-fields {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(248,250,252,.78);
  padding: 12px;
  margin-top: 12px;
}
.hr-social-fields h6 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.hr-social-fields textarea {
  resize: vertical;
}


/* v98 global create modal fixes */
#primaryCreateBtn { white-space: nowrap; }

/* v99 CRUD events: no visual schema change */

/* v100 restore create modals */

/* v101 project modal */
#projectModal .modal-content.clean-modal {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15,23,42,.22);
}

/* v102 unified CRUD modals */
.nallium-crud-modal .modal-content.clean-modal {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15,23,42,.22);
}
.nallium-crud-modal .modal-footer {
  gap: 8px;
}

/* v103 CRM company modal */
#companyCreateModal .modal-content.clean-modal {
  border: 0;
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(15,23,42,.22);
}

/* v104 cockpit no create */
#primaryCreateBtn.d-none {
  display: none !important;
}


/* v105 role based cockpit dashboards */
.cockpit-role-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; }
.cockpit-category-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.cockpit-dashboard-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
.cockpit-dashboard-block { border:1px solid var(--border); border-radius:22px; background:rgba(255,255,255,.92); box-shadow:0 16px 50px rgba(15,23,42,.08); overflow:hidden; }
.cockpit-dashboard-header { padding:16px 18px 10px; border-bottom:1px solid var(--border); }
.cockpit-dashboard-header h3 { font-size:16px; font-weight:950; margin:0; }
.cockpit-dashboard-body { padding:14px; }
.mini-dashboard-card { display:flex; justify-content:space-between; align-items:center; gap:12px; border:1px dashed var(--border); border-radius:16px; padding:14px; background:rgba(248,250,252,.86); }
.mini-dashboard-card span { display:block; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; font-weight:900; }
.mini-dashboard-card strong { display:block; font-size:15px; }
.mini-dashboard-card p { margin:0; color:var(--text); font-weight:900; }


/* v106 clean cockpit dispatch */
.cockpit-role-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; }
.cockpit-category-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:18px; }
.cockpit-dashboard-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
.cockpit-dashboard-block { border:1px solid var(--border); border-radius:22px; background:rgba(255,255,255,.92); box-shadow:0 16px 50px rgba(15,23,42,.08); overflow:hidden; }
.cockpit-dashboard-header { padding:16px 18px 10px; border-bottom:1px solid var(--border); }
.cockpit-dashboard-header h3 { font-size:16px; font-weight:950; margin:0; }
.cockpit-dashboard-body { padding:14px; }
.mini-dashboard-card { display:flex; justify-content:space-between; align-items:center; gap:12px; border:1px dashed var(--border); border-radius:16px; padding:14px; background:rgba(248,250,252,.86); }
.mini-dashboard-card span { display:block; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.06em; font-weight:900; }
.mini-dashboard-card strong { display:block; font-size:15px; }
.mini-dashboard-card p { margin:0; color:var(--text); font-weight:900; }

/* CRM company row selection */
.crm-company-selectable {
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.crm-company-selectable:hover {
  background: rgba(37, 99, 235, .04);
}
.crm-company-selectable.selected,
.crm-company-selectable.selected-row {
  background: rgba(37, 99, 235, .08) !important;
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, .8);
}




/* CRM list refinements aligned with the standard panel style */
.crm-list-panel .crm-filter-bar {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.crm-list-panel .crm-filter-bar label {
  display: grid;
  gap: .35rem;
  font-size: .85rem;
  color: var(--muted, #64748b);
}
.crm-list-panel .crm-filter-bar select,
.crm-list-panel .crm-filter-bar input {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 10px;
  padding: .45rem .65rem;
  background: var(--surface, #fff);
  color: inherit;
}
.crm-list-panel .crm-search-field {
  min-width: 280px;
  flex: 1;
}
.crm-company-cell {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.crm-company-logo {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(14,165,233,.12));
}
.crm-company-logo-img {
  position: absolute;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.crm-company-logo-fallback {
  font-weight: 800;
  color: #2563eb;
}


/* CRM visible list fix */
#dashboardContent .crm-list-panel,
#mainContent .crm-list-panel {
  display: block;
}


/* CRM filter/logo fix */
.crm-company-logo {
  border: 1px solid rgba(148, 163, 184, .24);
}
.crm-company-logo-fallback {
  z-index: 1;
  letter-spacing: -.02em;
}
.crm-company-logo-img {
  z-index: 2;
  border-radius: 6px;
  background: #fff;
}


/* CRM detail route */
.crm-company-link {
  font-weight: 800;
  color: inherit;
  text-decoration: none;
}
.crm-company-link:hover {
  color: #2563eb;
  text-decoration: underline;
}
.crm-detail-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}
.crm-detail-hero-title {
  display: flex;
  gap: .9rem;
  align-items: center;
}
.crm-detail-logo {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}
.crm-detail-grid {
  align-items: stretch;
}
.risk-score-card {
  display: grid;
  gap: .35rem;
}
.risk-score-card strong {
  font-size: 2rem;
  line-height: 1;
}


/* CRM detail tabs */
.crm-detail-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: .35rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 16px;
  background: rgba(148, 163, 184, .08);
}
.crm-detail-tab {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .45rem .8rem;
  border-radius: 12px;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.crm-detail-tab:hover {
  background: rgba(37, 99, 235, .10);
  color: #2563eb;
}
.crm-detail-tab.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}
.crm-detail-tab-content {
  display: block;
}
.crm-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.crm-edit-field {
  display: grid;
  gap: .35rem;
  color: var(--muted, #64748b);
  font-size: .85rem;
}
.crm-edit-field input,
.crm-edit-field select,
.crm-table-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 10px;
  padding: .45rem .6rem;
  background: var(--surface, #fff);
  color: inherit;
}
.crm-org-chart {
  overflow-x: auto;
  padding: .5rem 0;
}
.crm-org-chart ul {
  list-style: none;
  margin: 0;
  padding-left: 1.25rem;
}
.crm-org-chart > ul {
  padding-left: 0;
}
.crm-org-node {
  display: inline-grid;
  gap: .15rem;
  min-width: 180px;
  margin: .3rem 0;
  padding: .55rem .7rem;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 12px;
  background: rgba(37, 99, 235, calc(.05 + var(--depth, 0) * .02));
}
.crm-org-node span {
  color: var(--muted, #64748b);
  font-size: .82rem;
}
.crm-org-empty {
  padding: 1rem;
  border: 1px dashed rgba(148, 163, 184, .35);
  border-radius: 12px;
}
@media (max-width: 760px) {
  .crm-edit-grid {
    grid-template-columns: 1fr;
  }
}


/* CRM tabs links and quote modal */
.crm-detail-toolbar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
  padding: .85rem 1rem;
}
.crm-detail-toolbar .btn-secondary {
  min-height: 38px;
  border-radius: 12px;
  font-weight: 700;
}
.crm-list-link {
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
}
.crm-list-link:hover {
  text-decoration: underline;
}
.crm-modal-root.open {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.crm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(3px);
}
.crm-modal-dialog {
  position: relative;
  width: min(980px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  margin: 1rem auto;
  border-radius: 22px;
  background: var(--surface, #fff);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}
.crm-modal-header,
.crm-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, .2);
}
.crm-modal-footer {
  border-top: 1px solid rgba(148, 163, 184, .2);
  border-bottom: 0;
  justify-content: flex-end;
}
.crm-modal-header h3 {
  margin: 0;
}
.crm-modal-body {
  padding: 1.25rem;
}
.crm-quote-document {
  display: grid;
  gap: 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  background: #fff;
}
.crm-quote-header,
.crm-quote-parties,
.crm-quote-totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
}
.crm-quote-meta {
  display: grid;
  gap: .25rem;
  text-align: right;
}
.crm-quote-meta h2 {
  margin: 0;
  font-size: 2rem;
}
.crm-quote-parties > div {
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
}
.crm-quote-object {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(37, 99, 235, .06);
}
.crm-quote-totals {
  margin-left: auto;
  min-width: 280px;
  grid-template-columns: 1fr;
}
.crm-quote-totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .75rem;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.crm-quote-footer {
  color: var(--muted, #64748b);
  font-size: .9rem;
}
.crm-read-card {
  display: grid;
  gap: .5rem;
}
.crm-read-card h4 {
  margin: 0 0 .5rem;
}
@media (max-width: 760px) {
  .crm-quote-header,
  .crm-quote-parties {
    grid-template-columns: 1fr;
  }
  .crm-quote-meta {
    text-align: left;
  }
}


/* CRM quote line editor */
.crm-quote-line-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.crm-quote-line-table th,
.crm-quote-line-table td {
  vertical-align: middle;
}
.crm-quote-line-table select.crm-table-input {
  min-width: 260px;
}
.crm-quote-line-table input.crm-table-input {
  min-width: 86px;
}
.crm-quote-totals-detailed {
  display: grid;
  gap: .35rem;
  min-width: 340px;
  margin-left: auto;
}
.crm-quote-totals-detailed > div,
.crm-vat-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem .75rem;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.crm-vat-row small {
  color: var(--muted, #64748b);
  margin-left: .35rem;
}


/* CRM quote editor v2 */
.crm-product-free-select {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: .45rem;
  align-items: start;
}
.crm-pickup-btn { min-height: 36px; }
.crm-product-suggestions {
  position: absolute;
  z-index: 5;
  top: 40px;
  left: 0;
  right: 72px;
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: .35rem;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .16);
}
.crm-product-suggestions.open { display: grid; gap: .25rem; }
.crm-product-suggestion, .crm-picker-card {
  display: grid;
  gap: .15rem;
  width: 100%;
  padding: .65rem .75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.crm-product-suggestion:hover, .crm-picker-card:hover {
  border-color: rgba(37, 99, 235, .25);
  background: rgba(37, 99, 235, .07);
}
.crm-product-suggestion span, .crm-picker-card span, .crm-picker-card small { color: var(--muted, #64748b); }
.crm-picker-filters { display: grid; grid-template-columns: 180px 1fr; gap: .75rem; margin-bottom: 1rem; }
.crm-picker-filters label { display: grid; gap: .35rem; color: var(--muted, #64748b); font-size: .85rem; }
.crm-picker-filters select, .crm-picker-filters input {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 10px;
  padding: .45rem .65rem;
}
.crm-product-picker-list { display: grid; gap: .5rem; }
.crm-quote-totals-detailed, .crm-quote-totals-detailed > div, .crm-vat-row { text-align: right; }
.crm-quote-totals-detailed span, .crm-vat-row span { text-align: left; }
.crm-modal-close {
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  font-weight: 900;
}
.crm-download-pdf-btn, .crm-icon-btn {
  border-color: rgba(37, 99, 235, .28);
  background: rgba(37, 99, 235, .08);
  color: #2563eb;
  font-weight: 800;
}
.crm-icon-btn {
  min-width: 34px;
  min-height: 30px;
  border-radius: 10px;
}
@media (max-width: 760px) {
  .crm-picker-filters, .crm-product-free-select { grid-template-columns: 1fr; }
  .crm-product-suggestions { right: 0; top: 82px; }
}


/* CRM quote editor v3 */
.crm-quote-line-toolbar .btn-secondary {
  min-height: 38px;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  font-weight: 800;
}
.crm-product-suggestions {
  z-index: 10020;
  overflow: auto;
  max-height: 320px;
}
.crm-product-free-select {
  overflow: visible;
}
.crm-quote-line-table,
.crm-quote-line-table tbody,
.crm-quote-line-table tr,
.crm-quote-line-table td {
  overflow: visible;
}
.crm-readonly-money,
.crm-readonly-tax {
  white-space: nowrap;
}
.crm-readonly-tax strong {
  display: inline-flex;
  white-space: nowrap;
  gap: .2rem;
}
.crm-pickup-btn {
  white-space: nowrap;
  border-color: rgba(37, 99, 235, .32);
  background: rgba(37, 99, 235, .09);
  color: #2563eb;
  font-weight: 800;
}
.crm-send-email-btn {
  border-color: rgba(34, 197, 94, .32);
  background: rgba(34, 197, 94, .1);
  color: #15803d;
  font-weight: 800;
}
.crm-modal-footer {
  gap: .65rem;
}

.crm-quote-editor-v3 { position: relative; }


/* CRM quote editor v4 */
.crm-quote-line-table th,
.crm-quote-line-table td {
  white-space: nowrap;
}
.crm-quote-line-table th:first-child,
.crm-quote-line-table td:first-child {
  white-space: normal;
}
.crm-quote-line-table th:nth-child(6) {
  min-width: 88px;
}
.crm-pickup-btn {
  width: 38px;
  min-width: 38px;
  padding-inline: 0;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
}
.crm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  align-items: center;
  background: linear-gradient(180deg, rgba(248, 250, 252, .92), rgba(255, 255, 255, .98));
}
.crm-quote-action-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 42px;
  padding: .55rem .95rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.crm-quote-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .14);
}
.crm-quote-action-btn span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
}
.crm-download-pdf-btn {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, .25);
  background: linear-gradient(135deg, rgba(37, 99, 235, .14), rgba(14, 165, 233, .18));
}
.crm-send-email-btn {
  color: #047857;
  border-color: rgba(16, 185, 129, .28);
  background: linear-gradient(135deg, rgba(16, 185, 129, .16), rgba(34, 197, 94, .18));
}


/* CRM quote editor v5 */
.crm-letter-address {
  display: grid;
  gap: .15rem;
  margin: .35rem 0 0;
  font-style: normal;
  line-height: 1.35;
}
.crm-letter-address span {
  display: block;
}
.crm-quote-line-table input[type="number"] {
  appearance: textfield;
}
.crm-quote-line-table input[type="number"]::-webkit-outer-spin-button,
.crm-quote-line-table input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
}


/* CRM quote VAT and legal conditions fix */
#crmQuoteVatBreakdown {
  display: grid !important;
  gap: .25rem;
  padding: 0 !important;
  border-bottom: 0 !important;
}
.crm-vat-breakdown {
  display: grid;
  gap: .25rem;
  width: 100%;
}
.crm-vat-row {
  display: grid !important;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  padding: .55rem .75rem;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  text-align: right;
}
.crm-vat-row span {
  text-align: left;
  white-space: nowrap;
}
.crm-vat-row small {
  display: inline;
  white-space: nowrap;
}
.crm-vat-row strong {
  text-align: right;
  white-space: nowrap;
}
.crm-quote-conditions {
  display: grid;
  gap: .35rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 14px;
  background: rgba(248, 250, 252, .82);
}
.crm-quote-conditions strong {
  margin-bottom: .25rem;
}
.crm-quote-conditions p {
  margin: 0;
}
.crm-quote-conditions p span {
  color: var(--muted, #64748b);
  font-weight: 700;
}
.crm-quote-conditions ul {
  margin: .25rem 0 0;
  padding-left: 1.15rem;
}


/* CRM quote addresses, prices and VAT alignment */
.crm-quote-parties .crm-letter-address {
  display: grid;
  gap: .12rem;
  margin: .5rem 0 0;
  font-style: normal;
  line-height: 1.38;
  color: #0f172a;
}
.crm-quote-parties .crm-letter-address span {
  display: block;
}
#crmQuoteVatBreakdown {
  display: block !important;
  padding: 0 !important;
  border: 0 !important;
}
.crm-vat-breakdown {
  display: grid !important;
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  gap: .25rem;
  width: 100%;
}
.crm-vat-row {
  display: grid !important;
  grid-template-columns: minmax(210px, 1fr) minmax(96px, auto);
  gap: 1rem;
  align-items: baseline;
  width: 100%;
  padding: .55rem .75rem;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.crm-vat-row span {
  text-align: left;
  white-space: nowrap;
}
.crm-vat-row small {
  display: inline;
  white-space: nowrap;
  color: var(--muted, #64748b);
}
.crm-vat-row strong {
  text-align: right;
  white-space: nowrap;
}


/* CRM quote discount guard v1 */
.crm-line-discount-blocked {
  background: rgba(239, 68, 68, .08) !important;
  outline: 1px solid rgba(239, 68, 68, .28);
}
.crm-line-discount-blocked td {
  border-bottom-color: rgba(239, 68, 68, .22) !important;
}
.crm-line-discount-blocked .crm-table-input.is-invalid {
  border-color: #ef4444 !important;
  background: #fef2f2;
  color: #991b1b;
}
.crm-line-alert {
  margin-top: .35rem;
  color: #b91c1c;
  font-size: .8rem;
  font-weight: 800;
}
.crm-quote-blocking-alert {
  display: grid;
  gap: .2rem;
  margin: .5rem 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(239, 68, 68, .28);
  border-radius: 14px;
  background: #fef2f2;
  color: #991b1b;
}
.crm-quote-blocking-alert strong {
  font-size: .95rem;
}
.crm-quote-action-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.crm-quote-line-table th:nth-child(4),
.crm-quote-line-table th:nth-child(5) {
  min-width: 110px;
}


/* CRM quote discount guard v2 */
.crm-commercial-rule {
  display: block;
  margin-top: .18rem;
  color: var(--muted, #64748b);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.crm-line-discount-blocked .crm-commercial-rule {
  color: #991b1b;
}
.crm-quote-line-table th:nth-child(3),
.crm-quote-line-table td:nth-child(3) {
  min-width: 112px;
}
.crm-quote-line-table th:nth-child(4),
.crm-quote-line-table td:nth-child(4) {
  min-width: 112px;
}
.crm-quote-line-table th:nth-child(5),
.crm-quote-line-table td:nth-child(5) {
  min-width: initial;
}


/* CRM quote discount input/save fix */
.crm-quote-line-table input[type="number"].is-invalid {
  color: #991b1b;
  font-weight: 800;
}
.crm-quote-blocking-alert::after {
  content: "Les modifications ne sont pas enregistrées tant que cette erreur existe.";
  display: block;
  margin-top: .2rem;
  font-size: .8rem;
  font-weight: 700;
}


/* CRM quote discount focus and product type fix */
.crm-line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  align-items: center;
  margin-top: .35rem;
  color: var(--muted, #64748b);
  font-size: .82rem;
}
.crm-line-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: .12rem .45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .3);
  background: rgba(248, 250, 252, .92);
  color: #334155;
  font-weight: 800;
}
.crm-line-type.service {
  border-color: rgba(37, 99, 235, .25);
  background: rgba(37, 99, 235, .08);
  color: #1d4ed8;
}
.crm-line-type.product {
  border-color: rgba(16, 185, 129, .25);
  background: rgba(16, 185, 129, .08);
  color: #047857;
}
#crmQuoteDiscountWarningSlot:empty {
  display: none;
}


/* CRM quote modal close refresh fix */
.crm-list-refresh-on-close {
  contain: content;
}


/* CRM quote negative margin block fix */
.crm-negative-margin {
  color: #b91c1c !important;
  font-weight: 900 !important;
}
.crm-quote-margin-alert {
  border-color: rgba(185, 28, 28, .32);
  background: #fff1f2;
  color: #9f1239;
}
.crm-line-discount-blocked [data-line-margin] {
  font-weight: 900;
}


/* CRM quote discount total red fix */
.crm-discount-total-blocked {
  color: #991b1b !important;
  font-weight: 900 !important;
}
.crm-line-discount-blocked [data-line-total].crm-discount-total-blocked {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}


/* CRM quote margin floor fix */
.crm-margin-basis-note {
  color: var(--muted, #64748b);
}


/* CRM quote discount over 100 fix */
.crm-discount-total-blocked {
  color: #991b1b !important;
  font-weight: 900 !important;
}


/* CRM quote discount cap and price update fix */
[data-line-unit-price],
[data-line-min-price],
[data-line-tax],
[data-line-total],
[data-line-margin],
[data-max-discount] {
  transition: color .12s ease, background-color .12s ease;
}


/* CRM quote modal width and trash button fix */
#crmModalRoot .crm-modal {
  width: min(98vw, 1480px);
  max-width: 1480px;
}
#crmModalRoot .crm-modal.crm-quote-modal,
.crm-modal.crm-quote-modal {
  width: min(98vw, 1520px);
  max-width: 1520px;
}
.crm-quote-line-table {
  min-width: 1080px;
}
.crm-quote-line-table th:first-child,
.crm-quote-line-table td:first-child {
  min-width: 340px;
}
.crm-trash-line-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0 !important;
  font-size: 1rem;
  line-height: 1;
}
.crm-trash-line-btn:hover {
  transform: translateY(-1px);
}


/* CRM quote no horizontal scroll and red trash fix */
.crm-trash-line-btn {
  color: #dc2626 !important;
  background: #fef2f2 !important;
  border: 1px solid rgba(220, 38, 38, .28) !important;
}
.crm-trash-line-btn:hover {
  color: #991b1b !important;
  background: #fee2e2 !important;
  border-color: rgba(185, 28, 28, .38) !important;
}

#crmModalRoot .crm-modal {
  width: min(99vw, 1680px) !important;
  max-width: 1680px !important;
}
.crm-quote-document.crm-quote-modal-marker {
  max-width: none !important;
}
.crm-quote-document .generated-table-scroll,
.crm-quote-modal-marker .generated-table-scroll {
  overflow-x: visible !important;
}
.crm-quote-line-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
}
.crm-quote-line-table th,
.crm-quote-line-table td {
  padding-left: .45rem !important;
  padding-right: .45rem !important;
  white-space: normal !important;
  vertical-align: top;
}
.crm-quote-line-table th:nth-child(1),
.crm-quote-line-table td:nth-child(1) {
  width: 36% !important;
  min-width: 0 !important;
}
.crm-quote-line-table th:nth-child(2),
.crm-quote-line-table td:nth-child(2) {
  width: 72px !important;
}
.crm-quote-line-table th:nth-child(3),
.crm-quote-line-table td:nth-child(3) {
  width: 118px !important;
  min-width: 0 !important;
}
.crm-quote-line-table th:nth-child(4),
.crm-quote-line-table td:nth-child(4) {
  width: 112px !important;
  min-width: 0 !important;
}
.crm-quote-line-table th:nth-child(5),
.crm-quote-line-table td:nth-child(5) {
  width: 82px !important;
}
.crm-quote-line-table th:nth-child(6),
.crm-quote-line-table td:nth-child(6) {
  width: 128px !important;
}
.crm-quote-line-table th:nth-child(7),
.crm-quote-line-table td:nth-child(7) {
  width: 44px !important;
  text-align: center !important;
}
.crm-product-free-select {
  grid-template-columns: minmax(0, 1fr) 34px !important;
}
.crm-product-free-select .crm-table-input {
  min-width: 0 !important;
}
.crm-commercial-rule {
  white-space: normal !important;
}


/* CRM quote quantity financial refresh fix */
[data-line-min-total] {
  color: var(--muted, #64748b);
}


/* CRM quote label cleanup and reliable red trash icon */
.crm-quote-line-table .crm-trash-line-btn {
  color: #dc2626 !important;
  background: #fef2f2 !important;
  border: 1px solid rgba(220, 38, 38, .35) !important;
}
.crm-quote-line-table .crm-trash-line-btn:hover {
  color: #991b1b !important;
  background: #fee2e2 !important;
  border-color: rgba(185, 28, 28, .55) !important;
}
.crm-trash-icon {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* CRM quote totals live recalculation fix */
.crm-trash-icon {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.crm-quote-line-table .crm-trash-line-btn {
  color: #dc2626 !important;
  background: #fef2f2 !important;
  border: 1px solid rgba(220, 38, 38, .35) !important;
}


/* CRM project detail v1 */
.crm-project-hero small {
  color: rgba(255,255,255,.86);
}
.crm-project-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.crm-project-summary-card {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
}
.crm-project-summary-card span,
.crm-project-summary-card small {
  display: block;
  color: #64748b;
}
.crm-project-summary-card strong {
  display: block;
  margin: .35rem 0;
  color: #0f172a;
  font-size: 1.25rem;
}
.crm-project-summary-card.danger strong {
  color: #b91c1c;
}
.crm-project-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
.crm-project-textareas {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin-top: .85rem;
}
.crm-project-textareas textarea {
  min-height: 92px;
  resize: vertical;
}
.crm-project-panel {
  margin-top: 1rem;
}
.crm-project-panel .generated-table-scroll {
  overflow-x: auto;
}
@media (max-width: 1100px) {
  .crm-project-dashboard,
  .crm-project-form-grid,
  .crm-project-textareas {
    grid-template-columns: 1fr;
  }
}


/* CRM project modal tabs v1 */
#crmModalRoot .crm-modal-dialog {
  width: min(96vw, 1480px);
  max-width: 1480px;
}
.crm-project-modal-shell {
  display: grid;
  gap: 1rem;
}
.crm-project-modal-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
}
.crm-project-modal-hero h2 {
  margin: .2rem 0 .35rem;
  color: #fff;
}
.crm-project-modal-hero p {
  margin: 0;
  color: rgba(255,255,255,.84);
}
.crm-project-modal-eyebrow {
  display: inline-flex;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: .78rem;
  font-weight: 800;
}
.crm-project-modal-date {
  min-width: 160px;
  padding: .7rem .8rem;
  border-radius: 16px;
  background: rgba(255,255,255,.14);
  text-align: right;
}
.crm-project-modal-date span,
.crm-project-modal-date small {
  display: block;
  color: rgba(255,255,255,.92);
}
.crm-project-modal-dashboard {
  margin: 0;
}
.crm-project-modal-tabs {
  display: flex;
  gap: .45rem;
  padding: .35rem;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 16px;
  background: #f8fafc;
  overflow-x: auto;
}
.crm-project-tab {
  border: 0;
  border-radius: 12px;
  padding: .7rem 1rem;
  color: #475569;
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.crm-project-tab.active {
  color: #0f172a;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}
.crm-project-modal-content .crm-project-panel {
  margin-top: 0;
}
.crm-project-tab-panel {
  border-radius: 18px;
}
.crm-project-modal-content .generated-table-scroll {
  max-height: 48vh;
  overflow: auto;
}
@media (max-width: 900px) {
  .crm-project-modal-hero {
    flex-direction: column;
  }
  .crm-project-modal-date {
    text-align: left;
  }
}


/* CRM project assignments and financial decomposition fix */
.crm-project-modal-content .crm-table-input {
  width: 100%;
  min-width: 0;
}
.crm-project-modal-content .generated-table-scroll {
  max-height: 52vh;
}
.crm-project-modal-content table th:last-child,
.crm-project-modal-content table td:last-child {
  width: 44px;
  text-align: center;
}
.crm-project-summary-card[data-project-kpi="finance"] small {
  line-height: 1.25;
}
.crm-project-tab-panel + .crm-project-tab-panel {
  margin-top: 1rem;
}
#crmModalRoot .crm-modal-footer:empty,
#crmModalRoot .modal-footer:empty {
  display: none !important;
}


/* CRM project resource smart days and TJM fix */
.crm-add-resource-btn{display:inline-flex;align-items:center;gap:.35rem;border:0;border-radius:999px;padding:.62rem 1rem;color:#fff;background:linear-gradient(135deg,#2563eb,#0f766e);font-weight:900;box-shadow:0 12px 26px rgba(37,99,235,.18)}
.crm-add-resource-btn:hover{filter:brightness(.98);transform:translateY(-1px)}
.crm-project-note{margin:-.25rem 0 .85rem;color:#64748b;font-size:.9rem}.crm-smart-date-range{display:grid;grid-template-columns:1fr 1fr;gap:.35rem;min-width:220px}.crm-smart-date-range label span{display:block;margin-bottom:.15rem;color:#64748b;font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.crm-smart-days{display:flex;align-items:center;flex-wrap:wrap;gap:.25rem;margin-top:.35rem;color:#0f172a;white-space:normal}.crm-smart-days strong{white-space:nowrap}.crm-day-chip{display:inline-flex;align-items:center;border-radius:999px;padding:.15rem .42rem;font-size:.72rem;font-weight:900}.crm-day-chip.weekend{color:#475569;background:#e2e8f0}.crm-day-chip.holiday{color:#92400e;background:#fef3c7}.crm-day-chip.leave{color:#9f1239;background:#ffe4e6}.crm-day-chip.more{color:#1d4ed8;background:#dbeafe}.crm-resource-sub-input{margin-top:.35rem}.crm-resource-price-note{display:block;margin-top:.25rem;color:#64748b;white-space:nowrap}.crm-resource-price-note.danger{color:#b91c1c;font-weight:900}.crm-resource-row-blocked{background:#fff1f2}.crm-resource-total-cell{min-width:180px}.crm-resource-total-cell span{display:flex;justify-content:space-between;gap:.7rem;white-space:nowrap;color:#64748b}.crm-resource-total-cell strong{color:#0f172a;white-space:nowrap}.crm-resource-status-select{min-width:142px!important}.crm-resource-user-select{min-width:165px!important}.crm-project-modal-content .generated-table-scroll{max-height:54vh}.crm-project-modal-content table th,.crm-project-modal-content table td{vertical-align:top}.crm-project-modal-content table th:nth-child(3),.crm-project-modal-content table td:nth-child(3){min-width:245px}.crm-project-modal-content table th:nth-child(4),.crm-project-modal-content table td:nth-child(4){min-width:140px}.crm-project-modal-content table th:nth-child(5),.crm-project-modal-content table td:nth-child(5){min-width:190px}.crm-project-modal-content table th:nth-child(6),.crm-project-modal-content table td:nth-child(6){min-width:150px}


/* CRM project resource calendar and forecast fix */
.crm-resource-section-title {
  align-items: center;
  gap: 1rem;
}
.crm-add-resource-btn.icon-only {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0 !important;
  justify-content: center;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  margin: 0 .45rem;
}
.crm-resource-calendar {
  display: grid;
  grid-template-columns: repeat(7, 28px);
  gap: .22rem;
  margin-top: .45rem;
  max-width: 220px;
}
.crm-resource-calendar.empty {
  display: block;
  color: #64748b;
  font-size: .82rem;
}
.crm-resource-calendar-day {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
}
.crm-resource-calendar-day.workday:hover {
  border-color: #2563eb;
  background: #eff6ff;
}
.crm-resource-calendar-day.selected {
  color: #fff;
  border-color: #2563eb;
  background: #2563eb;
}
.crm-resource-calendar-day.weekend {
  color: #64748b;
  background: #e2e8f0;
  cursor: not-allowed;
}
.crm-resource-calendar-day.holiday {
  color: #92400e;
  background: #fef3c7;
  cursor: not-allowed;
}
.crm-resource-calendar-day.leave {
  color: #9f1239;
  background: #ffe4e6;
  cursor: not-allowed;
}
.crm-resource-calendar-day:disabled {
  opacity: .85;
}
.crm-calendar-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 8px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: .72rem;
  font-weight: 900;
}
.crm-line-discount-blocked .crm-resource-price-note.danger,
.crm-resource-row-blocked .crm-resource-price-note.danger {
  color: #b91c1c !important;
  font-weight: 900;
}
.crm-resource-row-blocked [data-assignment-tjm].is-invalid {
  border-color: #b91c1c !important;
  background: #fff1f2 !important;
  color: #991b1b !important;
}
.crm-resource-total-cell span {
  white-space: nowrap;
}
.crm-project-summary-card[data-project-kpi="finance"] span {
  color: #334155;
}
.crm-project-modal-content table th:nth-child(4),
.crm-project-modal-content table td:nth-child(4) {
  min-width: 92px;
}


/* CRM project custom day input and sales-order margin fix */
.crm-resource-day-input {
  position: relative;
  margin-top: .45rem;
}
.crm-custom-date-trigger {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 12px;
  padding: .55rem .65rem;
  text-align: left;
  background: #fff;
  cursor: pointer;
}
.crm-custom-date-trigger span,
.crm-custom-date-trigger small {
  display: block;
}
.crm-custom-date-trigger span {
  color: #0f172a;
  font-weight: 900;
}
.crm-custom-date-trigger small {
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crm-custom-date-panel {
  display: none;
  position: absolute;
  z-index: 50;
  top: calc(100% + .35rem);
  left: 0;
  min-width: 244px;
  padding: .65rem;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(15, 23, 42, .16);
}
.crm-custom-date-panel.open {
  display: block;
}
.crm-resource-calendar {
  grid-template-columns: repeat(7, 28px);
}
.crm-project-summary-card[data-project-kpi="forecastRevenue"] small,
.crm-project-summary-card[data-project-kpi="forecastCost"] small,
.crm-project-summary-card[data-project-kpi="finance"] small {
  line-height: 1.25;
}


/* CRM project date field decoupled from commercial quantity */
.crm-resource-date-field {
  position: relative;
  min-width: 230px;
}
.crm-custom-date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
  margin-bottom: .55rem;
}
.crm-custom-date-range label span {
  display: block;
  margin-bottom: .15rem;
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.crm-custom-date-help {
  margin: .55rem 0 0;
  color: #64748b;
  font-size: .78rem;
}
.crm-resource-date-field .crm-custom-date-panel {
  min-width: 276px;
}
.crm-resource-date-field .crm-resource-calendar {
  max-width: 244px;
}


/* CRM project monthly intervention calendar */
.crm-resource-month-calendar {
  width: 244px;
}
.crm-resource-calendar-header {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: .35rem;
  margin-bottom: .45rem;
}
.crm-resource-calendar-header strong {
  text-align: center;
  color: #0f172a;
  font-size: .9rem;
  text-transform: capitalize;
}
.crm-calendar-nav-btn {
  width: 34px;
  height: 32px;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}
.crm-calendar-nav-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
}
.crm-resource-calendar-weekdays,
.crm-resource-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 28px);
  gap: .22rem;
}
.crm-resource-calendar-weekdays {
  margin-bottom: .25rem;
}
.crm-resource-calendar-weekdays span {
  text-align: center;
  color: #64748b;
  font-size: .68rem;
  font-weight: 900;
}
.crm-calendar-empty {
  width: 28px;
  height: 28px;
}
.crm-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  margin-top: .55rem;
  color: #64748b;
  font-size: .72rem;
}
.crm-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
}
.crm-calendar-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}
.crm-calendar-legend i.workday { background: #fff; border: 1px solid rgba(148, 163, 184, .55); }
.crm-calendar-legend i.selected { background: #2563eb; }
.crm-calendar-legend i.weekend { background: #e2e8f0; }
.crm-calendar-legend i.holiday { background: #fef3c7; }
.crm-calendar-legend i.leave { background: #ffe4e6; }
.crm-resource-calendar {
  display: block;
  max-width: none;
}


/* CRM project holidays and leaves visibility */
.crm-resource-calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 1px;
}
.crm-resource-calendar-day span {
  font-weight: 900;
}
.crm-resource-calendar-day small {
  font-size: .52rem;
  font-weight: 1000;
  letter-spacing: .01em;
}
.crm-resource-calendar-day.weekend {
  color: #475569 !important;
  background: repeating-linear-gradient(135deg, #e2e8f0 0, #e2e8f0 5px, #f1f5f9 5px, #f1f5f9 10px) !important;
  border-color: rgba(100, 116, 139, .35) !important;
}
.crm-resource-calendar-day.holiday {
  color: #92400e !important;
  background: #fef3c7 !important;
  border-color: rgba(217, 119, 6, .45) !important;
}
.crm-resource-calendar-day.leave {
  color: #9f1239 !important;
  background: #ffe4e6 !important;
  border-color: rgba(225, 29, 72, .45) !important;
  cursor: not-allowed !important;
}
.crm-resource-calendar-day.leave small {
  color: #be123c;
}
.crm-resource-calendar-day.weekend small {
  color: #334155;
}
.crm-resource-calendar-day.holiday small {
  color: #92400e;
}
.crm-resource-calendar-day:disabled {
  opacity: 1 !important;
}
.crm-calendar-legend i.holiday {
  border: 1px solid rgba(217, 119, 6, .45);
}
.crm-calendar-legend i.leave {
  border: 1px solid rgba(225, 29, 72, .45);
}


/* CRM project calendar: only user leaves blocked */
.crm-resource-calendar-day.weekend,
.crm-resource-calendar-day.holiday {
  cursor: pointer !important;
}
.crm-resource-calendar-day.weekend:hover,
.crm-resource-calendar-day.holiday:hover {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}
.crm-resource-calendar-day.weekend.selected,
.crm-resource-calendar-day.holiday.selected {
  color: #fff !important;
  background: #2563eb !important;
  border-color: #2563eb !important;
}
.crm-resource-calendar-day.weekend.selected small,
.crm-resource-calendar-day.holiday.selected small {
  color: #fff !important;
}
.crm-resource-calendar-day.leave {
  cursor: not-allowed !important;
}


/* CRM project and resource status workflow UI */
.crm-status-edit-field {
  grid-column: 1 / -1;
}
.crm-status-workflow {
  display: grid;
  gap: .65rem;
  width: 100%;
}
.crm-status-current-label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  width: fit-content;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 999px;
  padding: .42rem .72rem;
  background: #eff6ff;
}
.crm-status-current-label span {
  color: #64748b;
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.crm-status-current-label strong {
  color: #1d4ed8;
  font-size: .92rem;
  font-weight: 1000;
}
.crm-status-current-label.compact {
  padding: .32rem .55rem;
}
.crm-status-current-label.compact span {
  font-size: .66rem;
}
.crm-status-current-label.compact strong {
  font-size: .82rem;
}
.crm-status-steps {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: .38rem;
}
.crm-status-step {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 999px;
  padding: .42rem .62rem;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-weight: 900;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.crm-status-step:hover {
  transform: translateY(-1px);
  border-color: #2563eb;
  background: #eff6ff;
}
.crm-status-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  color: #64748b;
  background: #e2e8f0;
  font-size: .68rem;
}
.crm-status-step strong {
  white-space: nowrap;
  font-size: .78rem;
}
.crm-status-step.done {
  border-color: rgba(22, 163, 74, .25);
  background: #f0fdf4;
  color: #166534;
}
.crm-status-step.done span {
  color: #fff;
  background: #16a34a;
}
.crm-status-step.current {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, .18);
}
.crm-status-step.current span {
  color: #2563eb;
  background: #fff;
}
.crm-status-step.next {
  border-color: rgba(37, 99, 235, .35);
}
.crm-status-step.danger {
  border-color: rgba(220, 38, 38, .25);
  color: #b91c1c;
}
.crm-status-step.danger span {
  color: #fff;
  background: #dc2626;
}
.crm-status-step.danger.current {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
.crm-status-actions {
  display: flex;
  gap: .45rem;
}
.crm-status-actions .btn-mini.primary {
  color: #fff;
  border-color: #2563eb;
  background: #2563eb;
}
.crm-status-actions .btn-mini:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.crm-resource-status-workflow {
  min-width: 260px;
}
.crm-resource-status-workflow .crm-status-steps.compact {
  gap: .25rem;
}
.crm-resource-status-workflow .crm-status-step {
  padding: .32rem .45rem;
}
.crm-resource-status-workflow .crm-status-step strong {
  font-size: .72rem;
}
.crm-resource-status-workflow .crm-status-actions.compact {
  gap: .3rem;
}
.crm-project-status-workflow.blocked .crm-status-current-label,
.crm-resource-status-workflow.blocked .crm-status-current-label {
  border-color: rgba(220, 38, 38, .22);
  background: #fef2f2;
}
.crm-project-status-workflow.blocked .crm-status-current-label strong,
.crm-resource-status-workflow.blocked .crm-status-current-label strong {
  color: #b91c1c;
}
.crm-project-modal-content table th:nth-child(7),
.crm-project-modal-content table td:nth-child(7) {
  min-width: 285px;
}


/* CRM guarded status workflow: current status + allowed actions only */
.crm-status-workflow.guarded {
  gap: .55rem;
}
.crm-status-action-zone {
  display: grid;
  gap: .38rem;
}
.crm-status-action-title {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.crm-status-action-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}
.crm-status-action-list.compact {
  gap: .28rem;
}
.crm-status-action-btn {
  border: 1px solid rgba(37, 99, 235, .28);
  border-radius: 999px;
  padding: .48rem .72rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}
.crm-status-action-btn:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.crm-status-action-btn.danger {
  border-color: rgba(220, 38, 38, .28);
  background: #fef2f2;
  color: #b91c1c;
}
.crm-status-action-btn.danger:hover {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
.crm-status-no-action {
  display: inline-flex;
  align-items: center;
  border: 1px dashed rgba(148, 163, 184, .45);
  border-radius: 999px;
  padding: .42rem .7rem;
  color: #64748b;
  background: #f8fafc;
  font-size: .82rem;
  font-weight: 850;
}
.crm-resource-status-workflow.guarded {
  min-width: 230px;
}
.crm-resource-status-workflow .crm-status-action-btn {
  padding: .36rem .55rem;
  font-size: .78rem;
}


/* CRM assignment status workflow correction */
.crm-resource-status-workflow .crm-status-current-label strong {
  max-width: 180px;
}
.crm-resource-status-workflow .crm-status-action-btn.danger {
  border-color: rgba(220, 38, 38, .28);
}
.crm-resource-status-workflow .crm-status-no-action {
  color: #166534;
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, .25);
}


/* CRM project orders: sale order flow + generated purchase requests */
.crm-project-order-title{display:flex;align-items:center;gap:1rem}.crm-project-order-actions{margin-left:auto;display:flex;align-items:stretch;gap:.65rem;flex-wrap:wrap}.crm-order-choice-btn{display:inline-grid;grid-template-columns:34px 1fr;align-items:center;gap:.65rem;min-width:230px;border:1px solid rgba(37,99,235,.22);border-radius:16px;padding:.62rem .78rem;background:linear-gradient(180deg,#fff,#f8fbff);color:#0f172a;text-align:left;cursor:pointer;box-shadow:0 10px 22px rgba(15,23,42,.06);transition:transform .14s ease,border-color .14s ease,box-shadow .14s ease}.crm-order-choice-btn:hover{transform:translateY(-1px);border-color:rgba(37,99,235,.42);box-shadow:0 14px 28px rgba(37,99,235,.12)}.crm-order-choice-btn strong,.crm-order-choice-btn small{display:block;line-height:1.15}.crm-order-choice-btn strong{font-size:.88rem;font-weight:950}.crm-order-choice-btn small{margin-top:.16rem;color:#64748b;font-size:.72rem;font-weight:750}.crm-order-choice-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:12px;color:#fff;background:#2563eb;font-size:1.05rem;font-weight:1000}.crm-subsection-title{margin:1rem 0 .5rem;color:#0f172a;font-size:.95rem;font-weight:950}.crm-order-source-note{display:block;margin-top:.15rem;color:#64748b;font-size:.76rem}.crm-order-builder{display:grid;gap:.95rem}.crm-builder-section{border:1px solid rgba(148,163,184,.22);border-radius:16px;padding:.9rem;background:#fff}.crm-builder-section h4{margin:0 0 .65rem;color:#0f172a;font-size:.94rem;font-weight:950}.crm-selection-list{display:grid;gap:.45rem;max-height:250px;overflow:auto}.crm-selection-row{display:grid;grid-template-columns:18px 1fr;align-items:center;gap:.62rem;border:1px solid rgba(148,163,184,.24);border-radius:12px;padding:.62rem .7rem;background:#fff;cursor:pointer}.crm-selection-row:hover{border-color:rgba(37,99,235,.35);background:#f8fafc}.crm-selection-row:has(input:checked){border-color:rgba(37,99,235,.55);background:#eff6ff}.crm-selection-row input{width:16px;height:16px;margin:0;accent-color:#2563eb}.crm-selection-row strong,.crm-selection-row small{display:block}.crm-selection-row strong{color:#0f172a;font-weight:900}.crm-selection-row small{margin-top:.1rem;color:#64748b;font-size:.78rem}.crm-builder-footer{display:flex;justify-content:flex-end;gap:.55rem;width:100%}.crm-request-detail{display:grid;gap:1rem}.crm-request-detail-head{display:grid;grid-template-columns:repeat(4,minmax(140px,1fr));gap:.65rem}.crm-request-detail-head>div{border:1px solid rgba(148,163,184,.22);border-radius:14px;padding:.7rem;background:#f8fafc}.crm-muted-label{display:block;margin-bottom:.18rem;color:#64748b;font-size:.72rem;font-weight:900;text-transform:uppercase;letter-spacing:.04em}.crm-quote-status-workflow{min-width:200px}.crm-quote-status-workflow .crm-status-action-btn{padding:.32rem .5rem;font-size:.75rem}@media(max-width:920px){.crm-project-order-title{align-items:flex-start;flex-direction:column}.crm-project-order-actions{margin-left:0;width:100%}.crm-order-choice-btn{width:100%}.crm-request-detail-head{grid-template-columns:repeat(2,minmax(140px,1fr))}}@media(max-width:620px){.crm-request-detail-head{grid-template-columns:1fr}.crm-builder-footer{justify-content:stretch}.crm-builder-footer button{flex:1}}


/* CRM purchases integration for generated project purchase requests */
.crm-request-detail-head {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}


/* CRM quote creation buttons */
.crm-project-quote-title,
.crm-quotes-module-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.crm-project-quote-title .crm-project-add-quote-btn,
.crm-quotes-module-title .crm-project-add-quote-btn {
  margin-left: auto;
  border-radius: 10px;
  padding: .5rem .75rem;
  font-weight: 850;
  line-height: 1;
}
.crm-quote-create-form {
  display: grid;
  gap: .85rem;
}
@media (max-width: 720px) {
  .crm-project-quote-title,
  .crm-quotes-module-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .crm-project-quote-title .crm-project-add-quote-btn,
  .crm-quotes-module-title .crm-project-add-quote-btn {
    width: 100%;
    margin-left: 0;
  }
}


/* CRM quote creation buttons using login premium button style */
.crm-project-quote-title,
.crm-company-quote-title,
.crm-quotes-module-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.crm-project-quote-title .crm-project-add-quote-btn,
.crm-company-quote-title .crm-project-add-quote-btn,
.crm-quotes-module-title .crm-project-add-quote-btn,
.crm-inline-table-header .crm-project-add-quote-btn {
  margin-left: auto;
  border-radius: 14px;
  padding: .6rem .9rem;
  font-weight: 900;
  line-height: 1;
}
.crm-inline-table-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .75rem;
}
.crm-quote-create-form {
  display: grid;
  gap: .85rem;
}
@media (max-width: 720px) {
  .crm-project-quote-title,
  .crm-company-quote-title,
  .crm-quotes-module-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .crm-project-quote-title .crm-project-add-quote-btn,
  .crm-company-quote-title .crm-project-add-quote-btn,
  .crm-quotes-module-title .crm-project-add-quote-btn,
  .crm-inline-table-header .crm-project-add-quote-btn {
    width: 100%;
    margin-left: 0;
  }
}


/* CRM quote modal client/project flow and premium project buttons */
.crm-inline-field-action {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: .5rem;
  align-items: center;
}
.crm-inline-plus-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: 14px !important;
  font-size: 1.15rem;
  font-weight: 1000;
}
.crm-edit-field-wide {
  grid-column: 1 / -1;
}
.crm-project-create-btn,
.crm-add-project-btn {
  border-radius: 14px !important;
  font-weight: 900 !important;
}


/* CRM client tabs: premium compact actions */
.crm-icon-only-action,
.crm-inline-plus-btn {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: 14px !important;
  font-size: 1.15rem;
  font-weight: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.crm-company-order-title,
.crm-company-quote-title,
.crm-project-quote-title,
.crm-quotes-module-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.crm-company-order-title .crm-icon-only-action,
.crm-company-quote-title .crm-project-add-quote-btn,
.crm-project-quote-title .crm-project-add-quote-btn,
.crm-quotes-module-title .crm-project-add-quote-btn {
  margin-left: auto;
}
.crm-inline-field-action {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: .5rem;
  align-items: center;
}
.crm-back-btn,
a.crm-back-btn,
button.crm-back-btn {
  border-radius: 14px !important;
  font-weight: 900 !important;
}
@media (max-width: 720px) {
  .crm-company-order-title,
  .crm-company-quote-title,
  .crm-project-quote-title,
  .crm-quotes-module-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .crm-company-order-title .crm-icon-only-action,
  .crm-company-quote-title .crm-project-add-quote-btn,
  .crm-project-quote-title .crm-project-add-quote-btn,
  .crm-quotes-module-title .crm-project-add-quote-btn {
    margin-left: 0;
  }
}


/* CRM compact premium plus buttons and purchases tab */
.crm-icon-only-action,
.crm-project-add-quote-btn.crm-icon-only-action,
.crm-inline-plus-btn {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0 !important;
  border-radius: 14px !important;
  font-size: 1.15rem;
  font-weight: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.crm-company-purchases-title,
.crm-company-order-title,
.crm-company-quote-title,
.crm-project-quote-title,
.crm-quotes-module-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.crm-company-purchases-title .crm-icon-only-action,
.crm-company-order-title .crm-icon-only-action,
.crm-company-quote-title .crm-icon-only-action,
.crm-project-quote-title .crm-icon-only-action,
.crm-quotes-module-title .crm-icon-only-action {
  margin-left: auto;
}
.crm-purchase-create-form {
  display: grid;
  gap: .85rem;
}


/* CRM final premium plus buttons — aligned with login primary gradient */
.section-title .crm-icon-only-action.btn.btn-primary-gradient,
.crm-icon-only-action.btn.btn-primary-gradient,
.crm-inline-plus-btn.btn.btn-primary-gradient,
.crm-project-add-quote-btn.btn.btn-primary-gradient {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 14px !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--blue), var(--violet) 50%, var(--pink)) !important;
  box-shadow: 0 16px 40px rgba(139,92,246,.20) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.18rem !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease !important;
}
.section-title .crm-icon-only-action.btn.btn-primary-gradient:hover,
.crm-icon-only-action.btn.btn-primary-gradient:hover,
.crm-inline-plus-btn.btn.btn-primary-gradient:hover,
.crm-project-add-quote-btn.btn.btn-primary-gradient:hover {
  transform: translateY(-1px) !important;
  filter: saturate(1.04) brightness(1.02) !important;
  box-shadow: 0 20px 44px rgba(139,92,246,.26) !important;
  color: #ffffff !important;
}
.section-title .crm-icon-only-action.btn.btn-primary-gradient:active,
.crm-icon-only-action.btn.btn-primary-gradient:active,
.crm-inline-plus-btn.btn.btn-primary-gradient:active,
.crm-project-add-quote-btn.btn.btn-primary-gradient:active {
  transform: translateY(0) scale(.98) !important;
}
.crm-company-contact-title,
.crm-company-project-title,
.crm-company-order-title,
.crm-company-purchases-title,
.crm-company-quote-title,
.crm-project-quote-title,
.crm-quotes-module-title {
  display: flex !important;
  align-items: center !important;
  gap: .75rem !important;
}
.crm-company-contact-title .crm-icon-only-action,
.crm-company-project-title .crm-icon-only-action,
.crm-company-order-title .crm-icon-only-action,
.crm-company-purchases-title .crm-icon-only-action,
.crm-company-quote-title .crm-icon-only-action,
.crm-project-quote-title .crm-icon-only-action,
.crm-quotes-module-title .crm-icon-only-action {
  margin-left: auto !important;
}
.crm-inline-field-action .crm-inline-plus-btn {
  flex: 0 0 44px !important;
}
@media (max-width: 720px) {
  .crm-company-contact-title .crm-icon-only-action,
  .crm-company-project-title .crm-icon-only-action,
  .crm-company-order-title .crm-icon-only-action,
  .crm-company-purchases-title .crm-icon-only-action,
  .crm-company-quote-title .crm-icon-only-action,
  .crm-project-quote-title .crm-icon-only-action,
  .crm-quotes-module-title .crm-icon-only-action {
    width: 44px !important;
    min-width: 44px !important;
    margin-left: 0 !important;
  }
}


/* CRM purchases tabs and harmonized codes fixes */
.crm-company-purchases-title .crm-icon-only-action,
.crm-project-order-title .crm-icon-only-action {
  margin-left: auto !important;
}
.crm-project-order-actions {
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: .5rem !important;
}


/* CRM purchase request manual line editor */
.crm-purchase-lines-editor {
  margin-top: 1rem;
  display: grid;
  gap: .75rem;
}
.crm-purchase-lines-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.crm-purchase-lines-title .crm-icon-only-action {
  margin-left: auto;
}
.crm-purchase-create-totals {
  display: flex;
  justify-content: flex-end;
  gap: .9rem;
  flex-wrap: wrap;
  padding: .75rem .9rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
  background: rgba(248, 250, 252, .82);
}
.crm-purchase-create-totals span {
  color: var(--muted);
  font-size: .92rem;
}
.crm-purchase-create-totals strong {
  color: var(--text);
}
.crm-purchase-lines-editor .crm-inline-input {
  min-width: 90px;
}
.crm-purchase-lines-editor textarea.crm-inline-input {
  min-width: 220px;
  resize: vertical;
}


/* CRM purchase request product picker */
.crm-purchase-lines-editor .crm-product-free-select {
  min-width: 260px;
}
.crm-purchase-lines-editor .crm-product-suggestions {
  z-index: 3000;
}
.purchase-product-picker .crm-picker-card em {
  color: var(--blue);
}


/* CRM purchase request line label fields */
.crm-line-static-label {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  min-width: 84px;
  padding: .45rem .65rem;
  border-radius: 12px;
  background: rgba(248, 250, 252, .92);
  border: 1px solid rgba(148, 163, 184, .24);
  color: var(--text);
  font-weight: 750;
  white-space: nowrap;
}
.crm-quantity-integer {
  width: 76px !important;
}
.crm-purchase-lines-editor th:nth-child(4),
.crm-purchase-lines-editor td:nth-child(4),
.crm-purchase-lines-editor th:nth-child(6),
.crm-purchase-lines-editor td:nth-child(6),
.crm-purchase-lines-editor th:nth-child(7),
.crm-purchase-lines-editor td:nth-child(7) {
  white-space: nowrap;
}


/* CRM purchase request imported product labels and inline picker */
.crm-purchase-imported-fields {
  display: grid;
  gap: .45rem;
  margin-top: .55rem;
}
.crm-purchase-imported-fields > div {
  display: grid;
  gap: .2rem;
}
.crm-purchase-imported-fields small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.crm-line-long-label {
  justify-content: flex-start;
  width: 100%;
  white-space: normal;
  line-height: 1.25;
}
.crm-product-suggestions.purchase-picker-open {
  max-height: 520px;
  overflow: auto;
  padding: .75rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .28);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 64px rgba(15, 23, 42, .22);
}
.crm-purchase-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .55rem;
}
.crm-purchase-picker-filter {
  margin-bottom: .65rem;
}


/* CRM quote modal product reference and unit labels */
.crm-line-reference {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .22rem .45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}
.crm-line-reference strong {
  color: var(--text);
  font-weight: 900;
}
.crm-quote-unit-label {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
  font-size: .78rem;
  text-align: right;
  font-weight: 750;
}
.crm-quote-unit-label strong {
  color: var(--text);
  font-weight: 900;
}


/* CRM purchase lines aligned with quote product/service column */
.crm-purchase-line-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .45rem;
  margin-top: .55rem;
}
.crm-purchase-line-meta .crm-purchase-line-label,
.crm-purchase-line-meta .crm-purchase-line-description {
  flex-basis: 100%;
}
.crm-purchase-line-meta .crm-purchase-line-label strong {
  color: var(--text);
  font-weight: 900;
}
.crm-purchase-line-description {
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.3;
}
.crm-purchase-line-meta.readonly {
  margin-top: 0;
}
.crm-purchase-line-meta.readonly .crm-purchase-line-label {
  margin-top: .15rem;
}


/* CRM purchase unit under quantity and VAT breakdown */
.crm-purchase-unit-under-qty {
  text-align: right;
  white-space: nowrap;
}
.crm-purchase-create-totals span {
  white-space: nowrap;
}


/* CRM order billing and invoices */
.crm-order-detail {
  display: grid;
  gap: 1rem;
}
.crm-billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}
.crm-billing-grid > div {
  padding: .8rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 16px;
  background: rgba(248, 250, 252, .82);
  display: grid;
  gap: .25rem;
}
.crm-billing-grid strong {
  color: var(--text);
}
@media (max-width: 820px) {
  .crm-billing-grid {
    grid-template-columns: 1fr;
  }
}


/* CRM invoice path control and overdue highlighting */
.crm-order-invoice-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  margin-left: .5rem;
}
.crm-muted-action {
  color: var(--muted);
  font-weight: 800;
  align-self: center;
}
.crm-invoice-overdue-row td {
  background: rgba(254, 226, 226, .72) !important;
  border-color: rgba(239, 68, 68, .18) !important;
}
.crm-overdue-label {
  display: inline-flex;
  margin-top: .25rem;
  padding: .18rem .45rem;
  border-radius: 999px;
  color: #991b1b;
  background: rgba(239, 68, 68, .12);
  font-size: .76rem;
  font-weight: 900;
}
.status-pill.danger {
  background: rgba(239, 68, 68, .12);
  color: #991b1b;
}


/* CRM invoice downloads everywhere */
.crm-invoice-download-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}
.crm-invoice-document-status {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .25rem;
}
.crm-invoice-download-actions .btn-mini {
  min-width: 64px;
  justify-content: center;
}


/* CRM invoice document actions harmonized */
.crm-invoice-download-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}
.crm-invoice-download-btn {
  font-weight: 850;
}
.crm-invoice-document-status {
  display: none !important;
}
.crm-invoice-download-actions .btn-mini.crm-invoice-download-btn {
  min-width: 72px;
  justify-content: center;
  border-radius: 999px;
}


/* CRM invoice filters and bulk workflow */
.crm-invoice-filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: .65rem;
  align-items: end;
  margin-bottom: 1rem;
}
.crm-invoice-filter-bar > div {
  display: grid;
  gap: .25rem;
}
.crm-invoice-filter-bar label {
  font-size: .74rem;
  color: var(--muted);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.crm-invoice-filter-actions {
  align-self: end;
}
.crm-invoice-bulk-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .8rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(248, 250, 252, .84);
}
.crm-invoice-totals-footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: .75rem;
  padding: .8rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, .04);
  font-weight: 850;
}
.crm-invoice-status-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: .85rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, .24);
  background: rgba(248, 250, 252, .9);
}
@media (max-width: 1100px) {
  .crm-invoice-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .crm-invoice-bulk-bar,
  .crm-invoice-status-box {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* CRM invoice periods and linked documents */
.crm-invoice-links-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.crm-invoice-links-grid > div {
  display: grid;
  gap: .25rem;
  padding: .75rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(248, 250, 252, .86);
}
@media (max-width: 980px) {
  .crm-invoice-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .crm-invoice-links-grid {
    grid-template-columns: 1fr;
  }
}


/* Global list toolbox and pagination */
.crm-list-widget {
  display: grid;
  gap: .75rem;
}
.crm-list-toolbox {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 18px;
  background: rgba(248, 250, 252, .88);
}
.crm-list-toolbox-left,
.crm-list-toolbox-right {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: .55rem;
}
.crm-list-filter,
.crm-list-page-size {
  display: grid;
  gap: .25rem;
}
.crm-list-filter {
  min-width: min(360px, 78vw);
}
.crm-list-page-size {
  min-width: 135px;
}
.crm-list-filter span,
.crm-list-page-size span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.crm-list-count,
.crm-list-page-label {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 850;
  white-space: nowrap;
}
.crm-paginated-table tbody tr[style*="display:none"] {
  display: none !important;
}
@media (max-width: 840px) {
  .crm-list-toolbox {
    align-items: stretch;
    flex-direction: column;
  }
  .crm-list-toolbox-left,
  .crm-list-toolbox-right {
    align-items: stretch;
  }
  .crm-list-filter,
  .crm-list-page-size {
    width: 100%;
  }
}


/* Auto-enhanced pagination on native tables and modal lists */
.crm-global-enhanced-list {
  margin-top: .35rem;
}
.crm-global-enhanced-list > .crm-list-toolbox {
  margin-bottom: .35rem;
}
.crm-list-widget table tbody tr[data-crm-list-row] {
  transition: background .12s ease;
}
.crm-list-widget .btn-mini:disabled {
  opacity: .45;
  cursor: not-allowed;
}


/* Advanced invoice date filters */
.crm-invoice-filter-panel {
  display: grid;
  gap: .85rem;
  margin-bottom: 1rem;
}
.crm-invoice-date-menu {
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 18px;
  background: rgba(248, 250, 252, .9);
  overflow: hidden;
}
.crm-invoice-date-menu summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  padding: .85rem 1rem;
  cursor: pointer;
  list-style: none;
}
.crm-invoice-date-menu summary::-webkit-details-marker {
  display: none;
}
.crm-invoice-date-menu summary span {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.crm-invoice-date-menu summary strong {
  color: var(--text);
  font-weight: 950;
}
.crm-invoice-date-menu summary em {
  color: var(--muted);
  font-style: normal;
  font-size: .86rem;
}
.crm-invoice-date-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  padding: 0 1rem 1rem;
}
.crm-invoice-date-grid > div {
  display: grid;
  gap: .25rem;
}
.crm-invoice-date-grid label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.crm-filter-hidden {
  display: none !important;
}
@media (max-width: 1100px) {
  .crm-invoice-date-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px) {
  .crm-invoice-date-grid {
    grid-template-columns: 1fr;
  }
}
