
/* ================================================================
   CRM v1.5 — COMPACT PORTAL UI
   Reference: simple sidebar, compact top header, clean table views
================================================================ */

:root{
  --crm-primary:#0f172a;
  --crm-primary-hover:#1e293b;
  --crm-accent:#2563eb;
  --crm-page:#ffffff;
  --crm-surface:#ffffff;
  --crm-soft:#f8fafc;
  --crm-soft-2:#f4f6f8;
  --crm-line:#dde4ec;
  --crm-line-soft:#edf1f5;
  --crm-text:#172033;
  --crm-muted-2:#68788b;
  --crm-sidebar:185px;
  --crm-radius:10px;
  --crm-shadow:none;
}

/* ------------------------------------------------
   Base / page density
------------------------------------------------ */

html,body{
  background:#fff!important;
}

body{
  font-size:13px!important;
  color:var(--crm-text)!important;
}

.crm-shell{
  background:#fff!important;
}

.admin-main{
  margin-left:var(--crm-sidebar)!important;
}

.dashboard-content{
  background:#fff!important;
  min-height:calc(100vh - 64px)!important;
}

.dashboard-content>.container-fluid{
  max-width:none!important;
  padding:20px 16px 28px!important;
}

.crm-footer{
  background:#fff!important;
  border-top:1px solid var(--crm-line)!important;
  color:#8a98a8!important;
}

.crm-footer .container-fluid{
  padding:9px 18px!important;
}

/* ------------------------------------------------
   Sidebar — simple reference style
------------------------------------------------ */

.crm-sidebar{
  width:var(--crm-sidebar)!important;
  background:#fff!important;
  border-right:1px solid var(--crm-line)!important;
  box-shadow:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}

.crm-brand-wrap{
  height:64px!important;
  min-height:64px!important;
  padding:10px 15px!important;
  background:#fff!important;
  border-bottom:1px solid var(--crm-line)!important;
  position:sticky;
  top:0;
  z-index:20;
}

.crm-brand{
  gap:9px!important;
}

.crm-brand-logo{
  width:30px!important;
  height:30px!important;
  flex:0 0 30px!important;
  border-radius:8px!important;
  box-shadow:none!important;
  background:#f3f6fa!important;
  color:#334155!important;
  border:1px solid #e3e9ef;
  font-size:.86rem!important;
}

.crm-brand .brand-title{
  font-size:.82rem!important;
  line-height:1.2!important;
  font-weight:650!important;
  letter-spacing:0!important;
  color:#334155!important;
  text-transform:none!important;
}

.crm-brand .brand-subtitle{
  margin-top:2px!important;
  font-size:.58rem!important;
  color:#94a0ad!important;
  font-weight:500!important;
}

.sidebar-section-label{
  display:none!important;
}

.crm-nav{
  padding:10px 8px 18px!important;
  overflow:visible!important;
}

.crm-nav .nav-link{
  width:100%;
  min-height:36px!important;
  margin:1px 0!important;
  padding:7px 9px!important;
  gap:9px!important;
  border:0!important;
  border-radius:6px!important;
  background:transparent!important;
  color:#4d5c6d!important;
  font-size:.76rem!important;
  font-weight:500!important;
  line-height:1.2!important;
  box-shadow:none!important;
  transform:none!important;
}

.crm-nav .nav-link:hover{
  background:#f5f6f8!important;
  color:#111827!important;
}

.crm-nav .nav-icon{
  width:22px!important;
  height:22px!important;
  flex:0 0 22px!important;
  display:grid!important;
  place-items:center!important;
  border-radius:0!important;
  background:transparent!important;
  color:#64748b!important;
  font-size:.88rem!important;
}

.crm-nav .nav-link.active,
.crm-nav .nav-group.open>.nav-group-toggle{
  background:#f3f4f6!important;
  color:#111827!important;
  font-weight:700!important;
  box-shadow:none!important;
}

.crm-nav .nav-link.active .nav-icon,
.crm-nav .nav-group.open>.nav-group-toggle .nav-icon{
  background:transparent!important;
  color:#111827!important;
}

.crm-nav .nav-group.open>.nav-group-toggle{
  margin-bottom:2px!important;
}

.nav-group-toggle .bi-chevron-down{
  font-size:.62rem!important;
  color:#8b98a7!important;
}

.nav-submenu{
  padding:2px 0 4px 31px!important;
}

.nav-submenu:before{
  display:none!important;
}

.nav-sublink{
  min-height:30px;
  display:flex!important;
  align-items:center;
  margin:1px 0!important;
  padding:5px 8px!important;
  border-radius:5px!important;
  color:#718095!important;
  font-size:.69rem!important;
}

.nav-sublink:before{
  display:none!important;
}

.nav-sublink:hover,
.nav-sublink.active{
  background:#f6f7f9!important;
  color:#111827!important;
}

.nav-sublink.active{
  font-weight:700!important;
}

.nav-count{
  min-width:18px!important;
  height:18px!important;
  padding:0 5px!important;
  border-radius:9px!important;
  background:#5b7fe8!important;
  font-size:.57rem!important;
}

/* ------------------------------------------------
   Top header — compact simple line
------------------------------------------------ */

.crm-navbar{
  height:64px!important;
  min-height:64px!important;
  background:#fff!important;
  border-bottom:1px solid var(--crm-line)!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  position:sticky!important;
  top:0;
  z-index:1030!important;
}

.crm-navbar .container-fluid{
  padding-left:16px!important;
  padding-right:14px!important;
}

.topbar-left{
  gap:11px!important;
}

.sidebar-toggle{
  width:34px!important;
  height:34px!important;
  padding:0!important;
  border:0!important;
  border-radius:6px!important;
  background:transparent!important;
  box-shadow:none!important;
}

.sidebar-toggle:hover{
  background:#f4f6f8!important;
  border:0!important;
}

.sidebar-toggle span{
  width:14px!important;
  background:#475569!important;
}

.top-role-pill{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 10px;
  border:1px solid #dce4ed;
  border-radius:15px;
  background:#fff;
  color:#0f172a;
  font-size:.68rem;
  font-weight:600;
  white-space:nowrap;
}

.navbar-actions{
  gap:5px!important;
}

.icon-button{
  width:34px!important;
  height:34px!important;
  border:0!important;
  border-radius:50%!important;
  background:transparent!important;
  color:#526273!important;
  font-size:.88rem!important;
  box-shadow:none!important;
  transform:none!important;
}

.icon-button:hover{
  border:0!important;
  background:#f4f6f8!important;
  color:#111827!important;
  transform:none!important;
}

.header-count{
  top:-2px!important;
  right:-2px!important;
  min-width:17px!important;
  height:17px!important;
  padding:0 4px!important;
  border:2px solid #fff!important;
  font-size:.53rem!important;
}

.profile-button{
  height:36px!important;
  max-width:190px!important;
  padding:2px 5px 2px 3px!important;
  gap:7px!important;
  border:0!important;
  border-radius:7px!important;
  background:transparent!important;
  box-shadow:none!important;
}

.profile-button:hover{
  background:#f5f6f8!important;
  border:0!important;
}

.avatar-sm{
  width:30px!important;
  height:30px!important;
  border-radius:50%!important;
  border:0!important;
}

.profile-copy strong{
  max-width:125px!important;
  font-size:.7rem!important;
  font-weight:600!important;
  color:#35475a!important;
}

.profile-copy small{
  display:none!important;
}

.profile-button:after{
  display:none!important;
}

.brand-switcher{
  min-width:142px!important;
}

.brand-switcher .select2-container{
  min-width:142px!important;
  max-width:170px!important;
}

/* Header select2 only */
.brand-switcher .select2-selection--single{
  height:32px!important;
  min-height:32px!important;
  border-color:#dce4ed!important;
  border-radius:7px!important;
}

.brand-switcher .select2-selection__rendered{
  line-height:30px!important;
  font-size:.68rem!important;
}

.brand-switcher .select2-selection__arrow{
  height:30px!important;
}

/* ------------------------------------------------
   Page headings — less decorative
------------------------------------------------ */

.page-heading{
  min-height:44px;
  margin-bottom:14px!important;
  gap:10px!important;
}

.page-heading-copy{
  gap:0!important;
}

.page-icon{
  display:none!important;
}

.eyebrow{
  display:none!important;
}

.page-heading h1,
.page-heading .h1,
.page-heading .h2,
.page-heading .h3{
  margin-bottom:2px!important;
  font-size:1.38rem!important;
  line-height:1.2!important;
  font-weight:750!important;
  color:#0f172a!important;
  letter-spacing:-.025em!important;
}

.page-heading .text-muted{
  max-width:760px;
  font-size:.71rem!important;
  line-height:1.4!important;
  color:#718095!important;
}

.page-heading .btn{
  min-height:34px;
  padding:6px 10px!important;
  font-size:.7rem!important;
}

/* ------------------------------------------------
   Panels / cards
------------------------------------------------ */

.panel,
.metric-card,
.file-card,
.gateway-card{
  border:1px solid var(--crm-line)!important;
  border-radius:10px!important;
  background:#fff!important;
  box-shadow:none!important;
}

.panel-header{
  min-height:52px;
  padding:9px 12px!important;
  gap:8px!important;
  border-bottom:1px solid var(--crm-line)!important;
  background:#fff!important;
}

.panel-header h2,
.panel-header h3,
.panel-header .h5,
.panel-header .h6{
  margin:0!important;
  color:#0f172a!important;
  font-size:.78rem!important;
  font-weight:700!important;
}

.panel-header p,
.panel-header .small{
  font-size:.64rem!important;
}

.metric-card{
  padding:13px!important;
}

.file-card{
  padding:10px!important;
}

/* ------------------------------------------------
   Buttons / forms — compact
------------------------------------------------ */

.btn{
  min-height:34px;
  padding:6px 10px;
  border-radius:7px!important;
  font-size:.7rem!important;
  font-weight:600!important;
  box-shadow:none!important;
}

.btn-sm{
  min-height:30px!important;
  padding:4px 8px!important;
  font-size:.65rem!important;
}

.btn-primary{
  background:#111827!important;
  border-color:#111827!important;
  color:#fff!important;
  box-shadow:none!important;
}

.btn-primary:hover,
.btn-primary:focus{
  background:#273449!important;
  border-color:#273449!important;
}

.btn-light,
.btn-outline-secondary{
  background:#fff!important;
  border-color:#dce4ed!important;
  color:#405064!important;
}

.btn-light:hover,
.btn-outline-secondary:hover{
  background:#f7f8fa!important;
  border-color:#cfd9e4!important;
  color:#111827!important;
}

.form-control,
.form-select{
  min-height:36px!important;
  padding:.4rem .65rem!important;
  border:1px solid #dce4ed!important;
  border-radius:7px!important;
  background:#fff!important;
  color:#334155!important;
  font-size:.72rem!important;
}

.form-control::placeholder{
  color:#8997a6!important;
}

.form-label{
  margin-bottom:4px!important;
  color:#5d6d7f!important;
  font-size:.68rem!important;
  font-weight:600!important;
}

.form-text{
  font-size:.62rem!important;
}

/* Generic select2 */
.select2-container .select2-selection--single{
  height:36px!important;
  min-height:36px!important;
  border:1px solid #dce4ed!important;
  border-radius:7px!important;
}

.select2-container .select2-selection--single .select2-selection__rendered{
  line-height:34px!important;
  padding-left:10px!important;
  font-size:.72rem!important;
}

.select2-container .select2-selection--single .select2-selection__arrow{
  height:34px!important;
}

.select2-container .select2-selection--multiple{
  min-height:36px!important;
  border:1px solid #dce4ed!important;
  border-radius:7px!important;
}

/* ------------------------------------------------
   TABLE VIEWS — reference-like
------------------------------------------------ */

.table-responsive{
  border-radius:0 0 10px 10px;
}

.table{
  margin-bottom:0!important;
  width:100%!important;
  color:#334155!important;
}

.table>:not(caption)>*>*{
  min-width:0!important;
  padding:10px 11px!important;
  border-color:var(--crm-line)!important;
  color:#35475a!important;
  font-size:.7rem!important;
  line-height:1.35!important;
  vertical-align:middle!important;
}

.table thead th{
  height:42px;
  padding-top:8px!important;
  padding-bottom:8px!important;
  background:#f7f9fb!important;
  color:#111827!important;
  border-bottom:1px solid var(--crm-line)!important;
  font-size:.68rem!important;
  font-weight:700!important;
  text-transform:none!important;
  letter-spacing:0!important;
  white-space:nowrap;
}

.table tbody td{
  background:#fff!important;
  border-bottom:1px solid var(--crm-line)!important;
}

.table tbody tr:last-child td{
  border-bottom:0!important;
}

.table tbody tr:hover td{
  background:#fbfcfd!important;
}

.table a{
  color:#4f6580!important;
  text-decoration:none!important;
}

.table a strong,
.table strong a{
  color:#0f172a!important;
  font-weight:700!important;
}

.table a:hover{
  color:#111827!important;
  text-decoration:none!important;
}

.table .small,
.table small{
  margin-top:2px;
  color:#7a899a!important;
  font-size:.61rem!important;
}

.table .btn{
  width:29px;
  min-width:29px;
  height:29px;
  min-height:29px!important;
  padding:0!important;
  display:inline-grid;
  place-items:center;
  border:0!important;
  border-radius:6px!important;
  background:transparent!important;
  color:#506174!important;
}

.table .btn:hover{
  background:#f1f4f7!important;
  color:#0f172a!important;
}

.table .btn.text-danger{
  color:#ef4444!important;
}

.table .btn.text-danger:hover{
  background:#fff1f2!important;
  color:#dc2626!important;
}

.table .badge{
  min-height:22px;
  display:inline-flex;
  align-items:center;
  padding:3px 8px!important;
  border-radius:12px!important;
  font-size:.58rem!important;
  font-weight:700!important;
}

/* Filters that are commonly inside panel-header */
.panel-header form.d-flex{
  align-items:center!important;
  gap:7px!important;
}

.panel-header .form-control{
  max-width:300px;
}

.panel-header .form-select{
  min-width:135px;
  max-width:210px;
}

.panel-header .badge.text-bg-light{
  min-height:25px;
  display:inline-flex;
  align-items:center;
  padding:4px 8px!important;
  border-radius:13px!important;
  background:#f7f9fb!important;
  color:#617184!important;
  border-color:#dce4ed!important;
  font-size:.61rem!important;
}

/* Table card top radius when table is only panel content */
.panel>.table-responsive:first-child{
  border-radius:10px;
}

/* ------------------------------------------------
   Status badges — restrained
------------------------------------------------ */

.badge{
  font-weight:650!important;
}

.badge.text-bg-success,
.bg-success{
  background:#dcfce7!important;
  color:#15803d!important;
}

.badge.text-bg-danger,
.bg-danger{
  background:#fee2e2!important;
  color:#dc2626!important;
}

.badge.text-bg-warning,
.bg-warning{
  background:#fef3c7!important;
  color:#a16207!important;
}

.badge.text-bg-info,
.bg-info{
  background:#e0f2fe!important;
  color:#0369a1!important;
}

.badge.text-bg-primary,
.bg-primary{
  background:#e8efff!important;
  color:#315db5!important;
}

/* ------------------------------------------------
   Dropdowns
------------------------------------------------ */

.dropdown-menu{
  border:1px solid #dce4ed!important;
  border-radius:9px!important;
  box-shadow:0 12px 30px rgba(15,23,42,.11)!important;
  font-size:.72rem!important;
}

.dropdown-item{
  min-height:34px;
  display:flex;
  align-items:center;
  border-radius:5px;
}

.profile-menu{
  min-width:230px!important;
}

/* ------------------------------------------------
   Notification dropdown
------------------------------------------------ */

.notification-menu{
  width:min(360px,calc(100vw - 24px))!important;
}

.notification-head{
  padding:11px 12px!important;
}

.notification-item{
  padding:9px 11px!important;
}

.notification-icon{
  width:31px!important;
  height:31px!important;
}

/* ------------------------------------------------
   Dark theme
------------------------------------------------ */

[data-bs-theme="dark"]{
  --crm-page:#10161d;
  --crm-surface:#17202a;
  --crm-soft:#1d2732;
  --crm-soft-2:#202b36;
  --crm-line:#303d4a;
  --crm-line-soft:#273441;
  --crm-text:#e7edf4;
}

[data-bs-theme="dark"] html,
[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .crm-shell,
[data-bs-theme="dark"] .dashboard-content{
  background:#10161d!important;
  color:#e7edf4!important;
}

[data-bs-theme="dark"] .crm-sidebar,
[data-bs-theme="dark"] .crm-brand-wrap,
[data-bs-theme="dark"] .crm-navbar,
[data-bs-theme="dark"] .panel,
[data-bs-theme="dark"] .panel-header,
[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] .file-card,
[data-bs-theme="dark"] .crm-footer{
  background:#17202a!important;
  border-color:#303d4a!important;
  color:#e7edf4!important;
}

[data-bs-theme="dark"] .crm-brand-logo{
  background:#202b36!important;
  border-color:#303d4a!important;
  color:#cbd5e1!important;
}

[data-bs-theme="dark"] .crm-brand .brand-title,
[data-bs-theme="dark"] .page-heading h1,
[data-bs-theme="dark"] .panel-header h2,
[data-bs-theme="dark"] .panel-header h3{
  color:#f1f5f9!important;
}

[data-bs-theme="dark"] .crm-nav .nav-link{
  color:#bac5d0!important;
}

[data-bs-theme="dark"] .crm-nav .nav-link:hover,
[data-bs-theme="dark"] .crm-nav .nav-link.active,
[data-bs-theme="dark"] .crm-nav .nav-group.open>.nav-group-toggle,
[data-bs-theme="dark"] .nav-sublink:hover,
[data-bs-theme="dark"] .nav-sublink.active{
  background:#202a35!important;
  color:#fff!important;
}

[data-bs-theme="dark"] .crm-nav .nav-icon{
  color:#aeb9c6!important;
}

[data-bs-theme="dark"] .top-role-pill{
  background:#17202a;
  border-color:#344250;
  color:#e5edf5;
}

[data-bs-theme="dark"] .icon-button,
[data-bs-theme="dark"] .profile-button,
[data-bs-theme="dark"] .sidebar-toggle{
  color:#d4dee8!important;
}

[data-bs-theme="dark"] .icon-button:hover,
[data-bs-theme="dark"] .profile-button:hover,
[data-bs-theme="dark"] .sidebar-toggle:hover{
  background:#202b36!important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .select2-container .select2-selection--single,
[data-bs-theme="dark"] .select2-container .select2-selection--multiple{
  background:#111922!important;
  border-color:#354453!important;
  color:#eef4fa!important;
}

[data-bs-theme="dark"] .table thead th{
  background:#202a35!important;
  color:#e4ebf2!important;
  border-color:#34414e!important;
}

[data-bs-theme="dark"] .table tbody td{
  background:#17202a!important;
  color:#dce5ed!important;
  border-color:#303d4a!important;
}

[data-bs-theme="dark"] .table tbody tr:hover td{
  background:#1d2833!important;
}

[data-bs-theme="dark"] .table a,
[data-bs-theme="dark"] .table a strong{
  color:#dce7f3!important;
}

[data-bs-theme="dark"] .table .btn{
  color:#c8d3df!important;
}

[data-bs-theme="dark"] .table .btn:hover{
  background:#24303c!important;
  color:#fff!important;
}

/* ------------------------------------------------
   Responsive
------------------------------------------------ */

@media(max-width:991.98px){
  .admin-main{
    margin-left:0!important;
  }

  .crm-sidebar{
    width:255px!important;
  }

  .dashboard-content>.container-fluid{
    padding:16px 12px 24px!important;
  }

  .page-heading{
    align-items:flex-start!important;
    flex-direction:column!important;
  }

  .page-heading>div:last-child{
    width:100%;
    justify-content:flex-start!important;
  }

  .panel-header{
    align-items:flex-start!important;
  }

  .panel-header form.d-flex{
    width:100%;
  }
}

@media(max-width:767.98px){
  .crm-navbar .container-fluid{
    padding-left:9px!important;
    padding-right:7px!important;
  }

  .top-role-pill{
    display:none;
  }

  .brand-switcher{
    display:none!important;
  }

  .dashboard-content>.container-fluid{
    padding:13px 9px 20px!important;
  }

  .page-heading h1,
  .page-heading .h3{
    font-size:1.2rem!important;
  }

  .panel-header{
    padding:9px!important;
  }

  .panel-header form.d-flex{
    display:grid!important;
    grid-template-columns:1fr!important;
  }

  .panel-header .form-control,
  .panel-header .form-select{
    width:100%!important;
    max-width:none!important;
  }

  .table>:not(caption)>*>*{
    padding:8px 9px!important;
    font-size:.66rem!important;
  }

  .table thead th{
    font-size:.63rem!important;
  }
}

/* ------------------------------------------------
   Workspace search, quick create and sign-in
------------------------------------------------ */

.global-search-trigger{
  width:min(230px,19vw);
  height:34px;
  align-items:center;
  gap:8px;
  padding:0 8px 0 10px;
  border:1px solid #dce4ed;
  border-radius:7px;
  background:#fff;
  color:#7a8898;
  font-size:.69rem;
  text-align:left;
}

.global-search-trigger:hover{
  border-color:#cbd6e2;
  background:#f8fafc;
  color:#334155;
}

.global-search-trigger span{
  min-width:0;
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.global-search-trigger kbd,
.command-search-row kbd{
  border:1px solid #dce3eb;
  border-bottom-color:#c7d0da;
  border-radius:5px;
  background:#f8fafc;
  color:#718096;
  box-shadow:0 1px 0 #dce3eb;
  font-family:inherit;
  font-size:.58rem;
  font-weight:600;
}

.quick-create-menu{
  width:270px;
  padding:7px!important;
  border:1px solid #dfe6ed!important;
  border-radius:10px!important;
  box-shadow:0 18px 45px rgba(30,41,59,.13)!important;
}

.quick-create-head{
  padding:6px 8px 8px;
  color:#8a98a8;
  font-size:.61rem;
  font-weight:700;
  letter-spacing:.07em;
  text-transform:uppercase;
}

.quick-create-menu .dropdown-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px;
  border-radius:7px;
}

.quick-create-menu .dropdown-item>i{
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  flex:0 0 30px;
  border-radius:7px;
  background:#f1f5f9;
  color:#475569;
}

.quick-create-menu .dropdown-item>span{
  display:flex;
  min-width:0;
  flex-direction:column;
}

.quick-create-menu .dropdown-item strong{
  color:#26384a;
  font-size:.73rem;
  line-height:1.2;
}

.quick-create-menu .dropdown-item small{
  margin-top:2px;
  color:#8b98a6;
  font-size:.62rem;
}

.command-modal .modal-dialog{
  width:min(680px,calc(100% - 20px));
  max-width:680px;
  margin:10px auto;
}

.command-modal .modal-content{
  overflow:hidden;
  border:1px solid #dbe3ec;
  border-radius:13px;
  box-shadow:0 28px 80px rgba(15,23,42,.24);
}

.command-search-row{
  display:flex;
  align-items:center;
  gap:11px;
  min-height:58px;
  padding:0 15px;
  border-bottom:1px solid #e8edf2;
}

.command-search-row>i{
  color:#64748b;
  font-size:1rem;
}

.command-search-row input{
  min-width:0;
  flex:1;
  border:0;
  outline:0;
  background:transparent;
  color:#172033;
  font-size:.88rem;
}

.command-search-row input::placeholder{color:#97a3af}
.command-results{max-height:min(470px,58vh);overflow-y:auto;padding:7px}

.command-section-label{
  padding:7px 9px 5px;
  color:#929eaa;
  font-size:.59rem;
  font-weight:700;
  letter-spacing:.07em;
  text-transform:uppercase;
}

.command-result-item{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:50px;
  padding:7px 9px;
  border-radius:8px;
  color:#26384a;
  text-decoration:none;
}

.command-result-item:hover,
.command-result-item.is-selected{
  background:#f1f5f9;
  color:#172033;
  text-decoration:none;
}

.command-result-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  flex:0 0 34px;
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:#fff;
  color:#526273;
}

.command-result-copy{display:flex;min-width:0;flex:1;flex-direction:column}
.command-result-copy strong{overflow:hidden;color:#26384a;font-size:.74rem;text-overflow:ellipsis;white-space:nowrap}
.command-result-copy small{overflow:hidden;margin-top:2px;color:#8390a0;font-size:.64rem;text-overflow:ellipsis;white-space:nowrap}
.command-result-meta{max-width:130px;overflow:hidden;color:#667789;font-size:.62rem;text-overflow:ellipsis;white-space:nowrap}

.command-state{
  min-height:180px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:24px;
  color:#8492a1;
  font-size:.72rem;
  text-align:center;
}

.command-state.command-empty{flex-direction:column}
.command-state.command-empty i{margin-bottom:4px;color:#a1acb8;font-size:1.35rem}
.command-state.command-empty strong{color:#405367;font-size:.8rem}
.command-footer{display:flex;align-items:center;gap:14px;min-height:34px;padding:0 12px;border-top:1px solid #e8edf2;background:#fafbfc;color:#8b98a6;font-size:.58rem}
.command-footer span:last-child{margin-left:auto}
.command-footer i{margin-right:4px}

.crm-login-page{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:#f5f7fa!important;
}

.crm-login-shell{
  width:min(920px,100%);
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(360px,1fr);
  overflow:hidden;
  border:1px solid #dfe6ed;
  border-radius:16px;
  background:#fff;
  box-shadow:0 24px 70px rgba(31,45,61,.12);
}

.crm-login-intro{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:38px;
  background:#0f172a;
  color:#e2e8f0;
}

.crm-login-brand{display:flex;align-items:center;gap:10px;color:#fff;font-size:.8rem;font-weight:700;letter-spacing:.05em}
.crm-login-brand .crm-brand-logo{background:#fff!important;border:0!important;color:#0f172a!important}
.crm-login-intro h1{max-width:360px;margin:46px 0 12px;color:#fff;font-size:2rem;font-weight:750;letter-spacing:-.04em;line-height:1.15}
.crm-login-intro p{max-width:360px;color:#9fb0c4;font-size:.78rem;line-height:1.7}
.crm-login-points{display:grid;gap:10px;margin-top:32px;color:#c5d0dc;font-size:.69rem}
.crm-login-points span{display:flex;align-items:center;gap:8px}
.crm-login-points i{color:#60a5fa}
.crm-login-form-wrap{position:relative;padding:48px}
.crm-login-theme{position:absolute;top:16px;right:16px}
.crm-login-form-wrap h2{margin:24px 0 5px;color:#172033;font-size:1.45rem;font-weight:750;letter-spacing:-.025em}
.crm-login-form-wrap>p{margin-bottom:26px;color:#8492a1;font-size:.74rem}
.crm-password-field{position:relative}
.crm-password-field .form-control{padding-right:42px}
.crm-password-toggle{position:absolute;top:3px;right:3px;width:34px;height:34px;border:0;border-radius:7px;background:transparent;color:#7d8b9b}
.crm-password-toggle:hover{background:#f1f5f9;color:#334155}
.crm-login-form-wrap .btn-primary{min-height:42px;margin-top:5px}
.crm-login-help{margin-top:24px;padding-top:18px;border-top:1px solid #edf1f5;color:#95a1ad;font-size:.63rem;text-align:center}

[data-bs-theme="dark"] .global-search-trigger,
[data-bs-theme="dark"] .command-modal .modal-content,
[data-bs-theme="dark"] .command-result-icon,
[data-bs-theme="dark"] .quick-create-menu{
  border-color:#344250!important;
  background:#17202a!important;
  color:#dce5ed!important;
}

[data-bs-theme="dark"] .global-search-trigger:hover,
[data-bs-theme="dark"] .command-result-item:hover,
[data-bs-theme="dark"] .command-result-item.is-selected,
[data-bs-theme="dark"] .quick-create-menu .dropdown-item:hover{
  background:#202b36!important;
  color:#fff!important;
}

[data-bs-theme="dark"] .command-search-row,[data-bs-theme="dark"] .command-footer{border-color:#303d4a!important}
[data-bs-theme="dark"] .command-search-row input{color:#eef4fa}
[data-bs-theme="dark"] .command-result-copy strong,[data-bs-theme="dark"] .quick-create-menu .dropdown-item strong{color:#e7eef5}
[data-bs-theme="dark"] .command-result-copy small,[data-bs-theme="dark"] .command-result-meta{color:#a8b4c0}
[data-bs-theme="dark"] .command-result-icon,[data-bs-theme="dark"] .quick-create-menu .dropdown-item>i{background:#202b36!important;color:#cbd5e1!important}
[data-bs-theme="dark"] .command-footer{background:#151e27;color:#9cabb9}
[data-bs-theme="dark"] .crm-login-page{background:#0f151c!important}
[data-bs-theme="dark"] .crm-login-shell,[data-bs-theme="dark"] .crm-login-form-wrap{border-color:#303d4a;background:#17202a}
[data-bs-theme="dark"] .crm-login-form-wrap h2{color:#f1f5f9}

@media(max-width:767.98px){
  .command-modal .modal-dialog{align-items:flex-start;margin-top:8px}
  .command-footer span:last-child{display:none}
  .command-result-meta{max-width:80px}
  .crm-login-page{padding:10px}
  .crm-login-shell{grid-template-columns:1fr}
  .crm-login-intro{display:none}
  .crm-login-form-wrap{padding:40px 24px 28px}
}

/* ================================================================
   v1.4 screenshot-aligned workspace system
================================================================ */

/* Sidebar and top shell */
.crm-sidebar{display:flex!important;flex-direction:column!important;height:100vh!important;position:fixed!important;inset:0 auto 0 0!important}
.crm-brand-wrap{position:static!important;flex:0 0 64px!important}
.crm-brand .brand-title{max-width:175px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.76rem!important;font-weight:650!important}
.crm-brand .brand-subtitle{font-size:.56rem!important}
.crm-nav{flex:1!important;padding:10px 8px 90px!important;overflow-y:auto!important}
.crm-nav .nav-link{min-height:36px!important;padding:7px 8px!important;font-size:.76rem!important}
.crm-nav .nav-link.active{background:#f2f2f3!important;color:#0f172a!important;font-weight:700!important}
.crm-nav .nav-icon{font-size:.86rem!important;color:#4b5563!important}
.sidebar-account{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;gap:9px;min-height:68px;padding:10px 14px;border-top:1px solid #e5e9ee;background:#fff}
.sidebar-account-copy{display:flex;min-width:0;flex:1;flex-direction:column;color:#172033;text-decoration:none}
.sidebar-account-copy:hover{color:#172033;text-decoration:none}
.sidebar-account-copy strong,.sidebar-account-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-account-copy strong{font-size:.72rem}.sidebar-account-copy small{margin-top:2px;color:#8492a1;font-size:.6rem}
.sidebar-signout{width:32px;height:32px;display:grid;place-items:center;border-radius:7px;color:#536273;text-decoration:none}.sidebar-signout:hover{background:#f2f4f7;color:#0f172a}
.crm-navbar{border-top:1px solid #111827!important}
.dashboard-content>.container-fluid{padding:20px 16px 32px!important}
.page-heading{min-height:60px!important}.page-heading h1{font-size:1.42rem!important}.page-heading .text-muted{color:#5f7590!important;font-size:.72rem!important}

/* Reference tables */
.panel{overflow:hidden!important}
.table-responsive{border-radius:inherit}
.table{border-collapse:separate!important;border-spacing:0!important}
.table thead th{height:44px!important;padding:10px 12px!important;background:#f6f8fa!important;border-bottom:1px solid #dbe3ec!important;color:#0f172a!important;font-size:.68rem!important;font-weight:750!important;letter-spacing:0!important;text-transform:none!important;white-space:nowrap!important}
.table tbody td{min-height:56px;padding:11px 12px!important;border-bottom:1px solid #dbe3ec!important;color:#172033!important;font-size:.7rem!important;line-height:1.45!important}
.table tbody tr:last-child td{border-bottom:0!important}.table tbody tr:hover td{background:#fafbfc!important}
.table tbody td>a:not(.btn),.table tbody td .mobile-cell-value>a:not(.btn){color:#607895;font-weight:500}.table tbody td strong{color:#0f172a}
.table .btn-sm{width:30px!important;height:30px!important;border:0!important;background:transparent!important;color:#172033!important}.table .btn-sm:hover{background:#eef2f6!important}.table .btn-sm.text-danger{color:#ef4444!important}
.empty-table-state{padding:52px 20px!important;color:#8390a0!important;text-align:center!important}
.table-search-box,.filter-search{position:relative}.table-search-box i,.filter-search i{position:absolute;left:12px;top:50%;z-index:2;transform:translateY(-50%);color:#7890aa}.table-search-box .form-control,.filter-search .form-control{padding-left:36px!important}

/* Remote add/view/edit modal */
.app-record-modal .modal-dialog{max-width:min(1080px,calc(100vw - 24px))!important}
.app-record-modal .modal-content{max-height:calc(100vh - 28px);overflow:hidden;border:1px solid #dbe3ec;border-radius:12px;box-shadow:0 28px 90px rgba(15,23,42,.23)}
.app-record-modal .modal-header{min-height:66px;padding:13px 18px;border-color:#e4e9ef;background:#fff}
.app-record-modal .modal-header>div{display:flex;min-width:0;flex-direction:column}.app-record-modal .modal-kicker{color:#8a97a5;font-size:.56rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.app-record-modal .modal-title{margin-top:2px;color:#111827;font-size:1.05rem;font-weight:750}
.app-record-modal .modal-body{padding:16px;background:#f8fafc}.app-record-modal .modal-body>.panel,.app-record-modal .modal-body>form.panel{margin:0!important;border-radius:9px!important;box-shadow:none!important}
.app-record-modal .modal-body>.row{margin:0!important}.app-record-modal .modal-body>.row>[class*="col-"]{padding-top:0}.app-record-modal .modal-body .page-heading{display:none!important}
.app-modal-loading,.app-modal-error{min-height:280px;display:flex;align-items:center;justify-content:center;gap:9px;color:#7b8897;font-size:.72rem}.app-modal-error{flex-direction:column}.app-modal-error>i{color:#ef4444;font-size:1.7rem}.app-modal-error strong{color:#27384a;font-size:.85rem}
.modal-form-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:24px -24px -24px;padding:13px 18px;border-top:1px solid #e4e9ef;background:#fafbfc}

/* Brand settings */
.brand-settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.grid-column-full{grid-column:1/-1}
.brand-setting-card{display:flex;min-height:194px;flex-direction:column;padding:20px 22px;border:1px solid #dbe3ec;border-radius:10px;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.025)}
.brand-setting-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.brand-setting-identity{display:flex;align-items:center;gap:11px;min-width:0}.brand-setting-logo{width:42px;height:42px;display:grid;place-items:center;flex:0 0 42px;overflow:hidden;border:1px solid #dce4ed;border-radius:9px;background:#f4f7fa}.brand-setting-logo img{width:100%;height:100%;padding:4px;object-fit:contain}.brand-setting-logo span{color:#52667c;font-size:.7rem;font-weight:800}
.brand-setting-identity h2{max-width:300px;overflow:hidden;margin:0;color:#0f172a;font-size:.83rem;font-weight:750;text-overflow:ellipsis;white-space:nowrap}.brand-setting-identity small{display:block;margin-top:3px;color:#8b98a6;font-size:.59rem}
.brand-setting-actions{display:flex;align-items:center;gap:4px}.brand-setting-actions a,.brand-setting-actions button{width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:6px;background:transparent;color:#172033}.brand-setting-actions a:hover,.brand-setting-actions button:hover{background:#f1f4f7}.brand-setting-actions button{color:#ef4444}
.brand-setting-details{display:grid;gap:5px;margin-top:13px}.brand-setting-details p{display:flex;align-items:flex-start;gap:8px;margin:0;color:#607895;font-size:.67rem}.brand-setting-details p>i{width:13px;margin-top:1px;color:#8391a0}.brand-setting-details a{color:#607895;text-decoration:none}.brand-setting-details .brand-bank-line{margin-top:3px;color:#111827}.brand-setting-details .brand-bank-line strong{color:#111827;font-size:.68rem}
.brand-setting-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;padding-top:13px;border-top:1px solid #edf1f4}.brand-setting-foot>div{display:flex;gap:5px;flex-wrap:wrap}.brand-setting-foot span{padding:3px 6px;border-radius:5px;background:#f2f5f8;color:#617286;font-size:.55rem}.brand-setting-foot>a{color:#536b86;font-size:.6rem;font-weight:650;text-decoration:none;white-space:nowrap}

/* User management and individual permissions */
.user-management-panel .panel-header{min-height:58px}.user-management-panel .table-search-box{width:250px}.user-cell{display:flex;align-items:center;gap:9px}.user-cell>div{display:flex;min-width:0;flex-direction:column}.user-cell small{margin-top:2px;color:#8391a0;font-size:.58rem}.role-chip{display:inline-flex;padding:4px 8px;border:1px solid #d9e2eb;border-radius:12px;background:#fff;color:#27384a;font-size:.58rem;font-weight:650}.permission-chip-list{display:flex;max-width:300px;gap:4px;flex-wrap:wrap}.permission-chip-list span{padding:3px 6px;border-radius:5px;background:#eef2f6;color:#506276;font-size:.53rem}
.form-section-title{display:flex;align-items:center;gap:9px;margin-bottom:13px;padding-bottom:9px;border-bottom:1px solid #e7ecf1}.form-section-title>span{color:#172033;font-size:.79rem;font-weight:750}.form-section-title>small{color:#8492a1;font-size:.61rem}
.brand-access-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.access-check{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px solid #dfe6ed;border-radius:8px;background:#fff;color:#334155;font-size:.67rem}
.permission-editor-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.permission-module-card{overflow:hidden;border:1px solid #dfe6ed;border-radius:8px;background:#fff}.permission-module-card>strong{display:block;padding:8px 10px;border-bottom:1px solid #e7ecf1;background:#f8fafc;color:#27384a;font-size:.64rem}.permission-module-card>div{padding:4px 9px}.permission-switch{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:31px;color:#526376;font-size:.59rem}.permission-switch span small{margin-left:4px;color:#98a3af;text-transform:capitalize}.permission-switch .form-check-input{width:30px;height:16px;margin:0}

/* Chat */
.messages-shell{min-height:calc(100vh - 120px)!important;border-radius:9px!important}.messages-sidebar{width:auto}.messages-sidebar-head{padding:10px!important}.messages-conversations{max-height:calc(100vh - 202px)!important}.conversation-item{min-height:58px;padding:9px 11px!important}.conversation-item.active{background:#f2f2f3!important}.conversation-item.active:before{display:none}.conversation-name{font-size:.7rem!important}.conversation-subject,.conversation-preview{font-size:.58rem!important}.conversation-time{font-size:.52rem!important}.messages-main-head{min-height:58px!important;padding:9px 12px!important}.messages-thread{max-height:calc(100vh - 254px)!important;background:#fff}.messages-compose{padding:9px 10px!important}.messages-compose .form-control{min-height:38px!important;border-radius:18px!important;padding:8px 13px!important}.messages-compose .btn-primary{width:38px;height:38px;padding:0!important;border-radius:50%!important;background:#0f172a!important;border-color:#0f172a!important}.message-tool-button{width:34px;height:38px;display:grid;place-items:center;border-radius:50%;color:#68788b;cursor:pointer}.message-tool-button:hover{background:#eef2f6;color:#0f172a}.message-attachment-preview{display:flex;align-items:center;gap:7px;margin-bottom:7px;padding:7px 10px;border:1px solid #dce4ec;border-radius:7px;background:#f7f9fb;color:#526376;font-size:.62rem}.message-attachment-preview[hidden]{display:none}.message-attachment-preview small{margin-left:auto;color:#8a97a5}.message-attachment{display:flex;align-items:center;gap:8px;margin-top:8px;padding:8px;border:1px solid rgba(100,116,139,.22);border-radius:8px;background:rgba(248,250,252,.75);color:inherit;text-decoration:none}.message-attachment:hover{color:inherit}.message-attachment>span{display:flex;min-width:0;flex-direction:column}.message-attachment strong{max-width:220px;overflow:hidden;font-size:.62rem;text-overflow:ellipsis;white-space:nowrap}.message-attachment small{font-size:.53rem;opacity:.65}

/* Invoice list and builder */
.invoice-filter-bar{display:grid;grid-template-columns:minmax(260px,1fr) minmax(180px,.55fr) minmax(200px,.65fr) auto auto;gap:10px;margin-bottom:16px}.invoice-filter-bar .form-control,.invoice-filter-bar .form-select{height:42px!important}
.invoice-list-panel{border-radius:11px!important}.invoice-status{display:inline-flex;min-width:70px;align-items:center;justify-content:center;padding:5px 9px;border-radius:12px;background:#eef2f6;color:#475569;font-size:.57rem;font-weight:750}.invoice-status.status-paid{background:#d9f8e7;color:#087443}.invoice-status.status-draft,.invoice-status.status-sent{background:#ffe1e1;color:#c52222}.invoice-status.status-partially-paid{background:#fff0c8;color:#9a6410}.invoice-status.status-cancelled{background:#e8ebef;color:#5b6470}
.invoice-brand-selector{max-width:900px;margin:0 auto;border:0!important;box-shadow:none!important}.invoice-brand-selector>.panel-header{display:none!important}.invoice-brand-selector>.p-3{padding:0!important}.invoice-brand-grid{gap:14px 0}.invoice-brand-card{min-height:96px!important;border:1px solid #e2e8f0!important;border-radius:8px!important;background:#f1f5f9!important;box-shadow:none!important}.invoice-brand-card:before{display:none!important}.invoice-brand-card-inner{align-items:center!important;justify-content:center!important;padding:16px!important}.invoice-brand-card-top,.invoice-brand-email,.invoice-brand-meta,.invoice-brand-card-footer{display:none!important}.invoice-brand-card h3{margin:0!important;color:#0f172a!important;font-size:.85rem!important;text-align:center}.invoice-brand-card:hover{transform:none!important;border-color:#0f172a!important;background:#fff!important}.invoice-brand-grid>div:first-child .invoice-brand-card{background:#0f172a!important}.invoice-brand-grid>div:first-child .invoice-brand-card h3{color:#fff!important}
.selected-invoice-brand{border:1px solid #dbe3ec!important;border-left:1px solid #dbe3ec!important;border-radius:10px!important;padding:16px 18px!important}.selected-invoice-brand-logo{order:3;margin-left:auto;width:74px!important;height:50px!important}.selected-invoice-brand-copy{order:1}.selected-invoice-brand-copy>span{display:none}.selected-invoice-brand-copy strong{font-size:.88rem!important}.selected-invoice-brand-copy small{margin-top:5px;color:#607895!important;font-size:.61rem}.selected-invoice-brand-details{order:2;margin-left:20px!important}.invoice-form-panel{border-radius:10px!important}.invoice-form-panel>.panel-header{background:#f8fafc!important}.invoice-form-panel>.p-3{padding:16px!important}.invoice-items-wrap{padding:0!important;border:1px solid #dbe3ec!important;border-radius:9px!important;overflow:hidden}.invoice-items-wrap>.d-flex{margin:0!important;padding:11px 12px;border-bottom:1px solid #dbe3ec;background:#f8fafc}.invoice-items-table{border:0!important;border-radius:0!important}.invoice-items-table .table thead th{height:38px!important}.invoice-total-box{background:#fff!important;border-color:#dbe3ec!important}.invoice-bank-card{margin:0 16px 16px;padding:14px;border:1px solid #dbe3ec;border-radius:9px;background:#fff}.invoice-bank-card>div{display:flex;align-items:center;gap:9px}.invoice-bank-card>div>i{width:30px;height:30px;display:grid;place-items:center;border-radius:7px;background:#eef2f6;color:#475569}.invoice-bank-card>div span{display:flex;flex-direction:column}.invoice-bank-card>div strong{color:#172033;font-size:.68rem}.invoice-bank-card>div small{margin-top:2px;color:#8492a1;font-size:.55rem}.invoice-bank-card p{margin:10px 0 0;color:#53677f;font-size:.62rem;line-height:1.55}.invoice-form-actions{background:#fff!important}.invoice-form-actions .btn-primary{background:#0f172a!important;border-color:#0f172a!important;box-shadow:none!important}
.lead-invoice-summary{display:flex;align-items:center;gap:11px;padding:12px;border-radius:8px;background:#f7f9fb}.lead-avatar{width:38px;height:38px;display:grid;place-items:center;border-radius:50%;background:#0f172a;color:#fff;font-weight:700}.lead-invoice-summary>div{display:flex;flex-direction:column}.lead-invoice-summary strong{font-size:.76rem}.lead-invoice-summary small{margin-top:3px;color:#7c8997;font-size:.6rem}

/* v1.5.1 layout correction: compact expanded navigation, one type system */
html,body,button,input,select,textarea,.btn,.form-control,.form-select,.select2-container,.dropdown-menu,.table,.credential-value,code,kbd,pre,samp{font-family:Arial,Helvetica,sans-serif!important}
.crm-sidebar{width:185px!important}
.admin-main{margin-left:185px!important}
.crm-brand-wrap{flex-basis:52px!important;height:52px!important;padding:7px 14px!important}
.crm-brand-logo{width:28px!important;height:28px!important;flex:0 0 28px!important}
.crm-brand .brand-subtitle{display:none!important}
.crm-nav{padding:4px 7px 62px!important}
.crm-nav .nav-link{min-height:34px!important;margin:0!important;padding:5px 8px!important;border-radius:7px!important}
.crm-nav .nav-icon{width:20px!important;flex:0 0 20px!important}
.crm-nav .nav-group-toggle{cursor:pointer}
.crm-nav .nav-submenu{padding:2px 0 3px 36px!important}
.crm-nav .nav-sublink{padding:5px 7px!important;border-radius:6px!important;font-size:.67rem!important}
.crm-nav .nav-sublink.active{background:#eef2f6!important;color:#0f172a!important;font-weight:700!important}
.sidebar-account{min-height:58px!important;padding:7px 14px!important}
body.sidebar-mini .crm-sidebar{width:68px!important}
body.sidebar-mini .admin-main{margin-left:68px!important}
body.sidebar-mini .crm-brand-wrap{padding:7px!important;justify-content:center!important}
body.sidebar-mini .crm-brand{justify-content:center!important}
body.sidebar-mini .crm-nav{padding-inline:7px!important}
body.sidebar-mini .crm-nav .nav-link{justify-content:center!important;padding-inline:6px!important}
body.sidebar-mini .crm-nav .nav-icon{width:22px!important;flex-basis:22px!important}
body.sidebar-mini .brand-copy,body.sidebar-mini .nav-text,body.sidebar-mini .nav-count,body.sidebar-mini .sidebar-account-copy,body.sidebar-mini .crm-nav .nav-submenu{display:none!important}
body.sidebar-mini .sidebar-account{justify-content:center!important;padding-inline:7px!important}

/* Compact white invoice builder matching the reference while retaining all fields. */
.selected-invoice-brand,.invoice-form-panel{width:min(940px,100%);margin-left:auto!important;margin-right:auto!important}
.selected-invoice-brand{display:grid!important;grid-template-columns:minmax(0,1fr) 86px;grid-template-rows:auto auto;gap:3px 14px;min-height:112px;align-items:start!important;padding:13px 15px!important}
.selected-invoice-brand-copy{grid-column:1;grid-row:1/3;display:flex!important;flex-direction:column!important;align-self:start}
.selected-invoice-brand-copy strong{margin-bottom:3px;font-size:.86rem!important}
.selected-invoice-brand-copy small{display:block;margin:1px 0!important;line-height:1.35!important}
.selected-invoice-brand-address{max-width:520px;white-space:pre-line}
.selected-invoice-brand-logo{grid-column:2;grid-row:1;order:initial!important;width:86px!important;height:42px!important;margin:0!important;justify-self:end}
.selected-invoice-brand-details{display:none!important}
.invoice-brand-document-meta{grid-column:2;grid-row:2;display:flex;align-items:flex-end;flex-direction:column;line-height:1.1}
.invoice-brand-document-meta strong{color:#0f172a;font-size:.9rem;font-weight:800}.invoice-brand-document-meta small{margin-top:2px;color:#607895;font-size:.56rem}.invoice-brand-document-meta span{margin-top:4px;padding:3px 7px;border-radius:10px;background:#ffe1e1;color:#d63030;font-size:.48rem;font-weight:750}
.invoice-form-panel{overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important}
.invoice-form-panel>.panel-header{display:none!important}
.invoice-form-panel>.p-3{padding:0!important}
.invoice-primary-fields{margin-bottom:14px!important}
.invoice-primary-fields>div{order:4}
.invoice-primary-fields>div:nth-child(1){order:1;flex:0 0 33.333%;max-width:33.333%}
.invoice-primary-fields>div:nth-child(4){order:2;flex:0 0 33.333%;max-width:33.333%}
.invoice-primary-fields>div:nth-child(5){order:3;flex:0 0 33.333%;max-width:33.333%}
.invoice-primary-fields>div:nth-child(2){order:4}.invoice-primary-fields>div:nth-child(3){order:5}.invoice-primary-fields>div:nth-child(6){order:6}.invoice-primary-fields>div:nth-child(7){order:7}
.invoice-primary-fields .form-label{margin-bottom:5px!important;font-size:.62rem!important}.invoice-primary-fields .form-text{font-size:.52rem!important}
.invoice-items-wrap{background:#fff!important}
.invoice-total-box{width:min(365px,100%)!important;margin-left:auto!important}
.invoice-bank-card{margin:16px 0!important;min-height:92px;padding:14px!important}
.invoice-bank-card>div>i,.invoice-bank-card>div>span small{display:none!important}.invoice-bank-card>div strong{font-size:.64rem!important}.invoice-bank-card p{margin-top:7px!important}
.invoice-form-actions{display:grid!important;grid-template-columns:auto minmax(220px,1fr);gap:9px!important;padding:0!important;border:0!important}
.invoice-form-actions .btn{min-height:40px}.invoice-form-actions .btn-primary{width:100%!important}

/* v1.5.2 navigation editor, readable actions and mobile records */
.crm-brand-wrap{flex-basis:46px!important;height:46px!important;padding:5px 13px!important}
.crm-brand-logo{width:27px!important;height:27px!important;flex-basis:27px!important;border:1px solid #dbe3ec!important;border-radius:7px!important;background:#f8fafc!important;color:#172033!important;box-shadow:none!important}
.crm-brand .brand-title{font-size:.8rem!important;font-weight:750!important}
.crm-nav{padding:2px 7px 54px!important}
.crm-nav .nav-link{min-height:32px!important;padding:4px 8px!important;font-size:.78rem!important}
.crm-nav .nav-submenu{padding:2px 0!important}
.crm-nav .nav-sublink{display:flex!important;align-items:center!important;gap:.65rem!important;min-height:32px!important;padding:4px 8px!important;font-size:.78rem!important}
.crm-nav .nav-sublink:before{display:none!important}
.crm-nav .nav-sublink .nav-icon{display:inline-block!important}
.sidebar-account{min-height:52px!important;padding:5px 13px!important}
.sidebar-account-copy strong{font-size:.76rem!important}.sidebar-account-copy small{font-size:.63rem!important}

.table thead th{font-size:.75rem!important}
.table tbody td{font-size:.78rem!important}
.table .btn-sm{width:36px!important;height:36px!important;padding:0!important;display:inline-grid!important;place-items:center!important;border-radius:8px!important;font-size:1rem!important}
.table td.text-end.text-nowrap{min-width:118px!important}
.table td.text-end.text-nowrap .btn i{font-size:1rem!important}
.mobile-cell-value{display:contents}

.sidebar-menu-settings{overflow:hidden}.sidebar-order-list{display:grid;gap:0;margin:0;padding:0;list-style:none}.sidebar-order-item{display:grid;grid-template-columns:28px 38px minmax(180px,1fr) minmax(150px,190px) auto;align-items:center;gap:10px;min-height:60px;padding:8px 14px;border-bottom:1px solid #e4e9ef;background:#fff}.sidebar-order-item:last-child{border-bottom:0}.sidebar-order-item.is-dragging{opacity:.55;background:#eef4ff}.sidebar-order-handle{color:#98a4b2;cursor:grab;text-align:center}.sidebar-order-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:#f0f4f8;color:#334155}.sidebar-order-copy{display:flex;min-width:0;flex-direction:column}.sidebar-order-copy strong{font-size:.78rem}.sidebar-order-copy small{margin-top:3px;color:#8794a3;font-size:.62rem}.sidebar-order-actions{display:flex;gap:5px}.sidebar-order-actions .btn{width:34px;height:34px;padding:0;display:grid;place-items:center}.sidebar-menu-savebar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 14px;border-top:1px solid #e4e9ef;background:#f8fafc}
.settings-card-grid .panel{transition:border-color .15s ease,transform .15s ease}.settings-card-grid .panel:hover{transform:translateY(-2px);border-color:#bdc9d6!important}.settings-card-grid h2{font-size:1rem}.settings-card-grid p{font-size:.72rem}

[data-bs-theme="dark"] .sidebar-account,[data-bs-theme="dark"] .brand-setting-card,[data-bs-theme="dark"] .app-record-modal .modal-header,[data-bs-theme="dark"] .app-record-modal .modal-body,[data-bs-theme="dark"] .permission-module-card,[data-bs-theme="dark"] .access-check,[data-bs-theme="dark"] .invoice-bank-card{background:#17202a!important;border-color:#303d4a!important;color:#e7edf4!important}
[data-bs-theme="dark"] .crm-nav .nav-link.active,[data-bs-theme="dark"] .conversation-item.active{background:#202a35!important;color:#fff!important}
[data-bs-theme="dark"] .brand-setting-identity h2,[data-bs-theme="dark"] .brand-setting-details .brand-bank-line,[data-bs-theme="dark"] .brand-setting-details .brand-bank-line strong,[data-bs-theme="dark"] .sidebar-account-copy,[data-bs-theme="dark"] .app-record-modal .modal-title,[data-bs-theme="dark"] .form-section-title>span,[data-bs-theme="dark"] .permission-module-card>strong{color:#eef4fa!important}
[data-bs-theme="dark"] .brand-setting-foot,[data-bs-theme="dark"] .form-section-title,[data-bs-theme="dark"] .permission-module-card>strong{border-color:#303d4a!important}
[data-bs-theme="dark"] .permission-module-card>strong,[data-bs-theme="dark"] .lead-invoice-summary,[data-bs-theme="dark"] .invoice-items-wrap>.d-flex{background:#202a35!important}
[data-bs-theme="dark"] .table thead th{background:#202a35!important;color:#e6edf4!important;border-color:#34414e!important}
[data-bs-theme="dark"] .table tbody td{color:#dce5ed!important;border-color:#303d4a!important}

/* v1.6 brand identity and public brief link */
.crm-brand-wrap{height:54px!important;flex-basis:54px!important;padding:7px 12px!important;background:linear-gradient(135deg,#fff 0%,#f8fafc 100%)!important}
.crm-brand{width:100%;min-width:0}.crm-brand-logo{width:34px!important;height:34px!important;flex-basis:34px!important;border:0!important;border-radius:10px!important;background:#0f172a!important;color:#fff!important;font-size:.88rem!important}.crm-brand .brand-title{font-size:.88rem!important;line-height:1.05!important;letter-spacing:.01em!important;color:#111827!important}.crm-brand .brand-subtitle{display:block!important;margin-top:3px!important;color:#7b8795!important;font-size:.55rem!important;line-height:1!important;letter-spacing:.02em}.crm-brand:hover .crm-brand-logo{background:#1e3a5f!important}
.brand-brief-link{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:13px -20px 0;padding:11px 20px;border-top:1px solid #e7ebf0;background:#f8fafc}.brand-brief-link>span{display:flex;align-items:center;gap:9px;min-width:0}.brand-brief-link>span>i{width:30px;height:30px;display:grid;place-items:center;flex:0 0 30px;border-radius:8px;background:#e8eef7;color:#203f62}.brand-brief-link>span>span{display:flex;min-width:0;flex-direction:column}.brand-brief-link strong{font-size:.69rem}.brand-brief-link small{margin-top:2px;color:#8290a0;font-size:.55rem}.brand-brief-link>div{display:flex;gap:5px}.brand-brief-link a,.brand-copy-link{width:34px;height:34px;display:grid;place-items:center;border:1px solid #dce4ed;border-radius:8px;background:#fff;color:#29445f;text-decoration:none}.brand-copy-link{cursor:pointer}.brand-brief-link a:hover,.brand-copy-link:hover{border-color:#9fb0c2;color:#0f172a}
[data-bs-theme="dark"] .crm-brand-wrap{background:#17212b!important}[data-bs-theme="dark"] .crm-brand .brand-title{color:#f1f5f9!important}[data-bs-theme="dark"] .brand-brief-link{background:#202a35;border-color:#303d4a}[data-bs-theme="dark"] .brand-brief-link a,[data-bs-theme="dark"] .brand-copy-link{background:#17212b;border-color:#34414e;color:#dce5ed}

.invoice-lead-recipient{display:flex;align-items:center;gap:10px;width:min(940px,100%);margin:0 auto 12px;padding:11px 13px;border:1px solid #cfe0f5;border-radius:9px;background:#f3f8ff;color:#193b61}.invoice-lead-recipient>i{width:34px;height:34px;display:grid;place-items:center;flex:0 0 34px;border-radius:8px;background:#dcecff;font-size:1rem}.invoice-lead-recipient>span{display:flex;min-width:0;flex-direction:column}.invoice-lead-recipient strong{font-size:.75rem}.invoice-lead-recipient small{margin-top:3px;color:#607895;font-size:.61rem}.invoice-items-table{overflow-x:auto!important}.invoice-items-table table{min-width:830px}.invoice-items-table .form-control{min-width:76px}.invoice-items-table td:first-child .form-control{min-width:220px}.invoice-total-box{padding:15px!important;border-radius:10px!important}.invoice-total-line{font-size:.72rem!important}.invoice-grand-total{font-size:.86rem!important}.invoice-form-actions .btn-primary{min-height:44px!important;font-weight:750!important}
.conversion-lock,.conversion-ready{display:flex;align-items:center;gap:11px;margin:14px 0 4px;padding:13px;border:1px solid #e0e6ed;border-radius:9px;background:#f8fafc}.conversion-lock>i,.conversion-ready>i{width:35px;height:35px;display:grid;place-items:center;flex:0 0 35px;border-radius:50%;background:#e8edf3;color:#68788a}.conversion-ready{margin-bottom:16px;border-color:#bdebd2;background:#effcf5}.conversion-ready>i{background:#d6f7e5;color:#087443}.conversion-lock>div,.conversion-ready>div{display:flex;flex-direction:column}.conversion-lock strong,.conversion-ready strong{font-size:.73rem}.conversion-lock span,.conversion-ready span{margin-top:2px;color:#728196;font-size:.62rem}
.lead-brief-panel{overflow:hidden}.brief-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;border:1px solid #e2e8f0;border-radius:9px;overflow:hidden}.brief-detail-grid>div{display:flex;min-height:82px;flex-direction:column;padding:13px;border-right:1px solid #e8edf2;border-bottom:1px solid #e8edf2}.brief-detail-grid>div:nth-child(2n){border-right:0}.brief-detail-grid>div.brief-wide{grid-column:1/-1;border-right:0}.brief-detail-grid small{margin-bottom:6px;color:#758497;font-size:.6rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.brief-detail-grid strong,.brief-detail-grid span{color:#24364a;font-size:.73rem;line-height:1.55}.brief-file-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.brief-file-list>a{display:flex;align-items:center;gap:9px;padding:10px 11px;border:1px solid #e0e6ed;border-radius:8px;color:#263c53;text-decoration:none}.brief-file-list>a>span{display:flex;min-width:0;flex-direction:column;overflow:hidden;font-size:.68rem;text-overflow:ellipsis;white-space:nowrap}.brief-file-list small{margin-top:2px;color:#8491a0;font-size:.55rem}
[data-bs-theme="dark"] .invoice-lead-recipient,[data-bs-theme="dark"] .conversion-lock,[data-bs-theme="dark"] .conversion-ready,[data-bs-theme="dark"] .brief-detail-grid,[data-bs-theme="dark"] .brief-detail-grid>div,[data-bs-theme="dark"] .brief-file-list>a{background:#202a35!important;border-color:#34414e!important;color:#e7eef5!important}[data-bs-theme="dark"] .brief-detail-grid strong,[data-bs-theme="dark"] .brief-detail-grid span,[data-bs-theme="dark"] .brief-file-list>a{color:#e7eef5!important}

@media(max-width:1199.98px){.permission-editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.invoice-filter-bar{grid-template-columns:1fr 1fr 1fr}.invoice-filter-bar .filter-search{grid-column:1/-1}}
@media(max-width:991.98px){.admin-main,body.sidebar-mini .admin-main{margin-left:0!important}.crm-sidebar{position:fixed!important}.brand-settings-grid{grid-template-columns:1fr}.brand-access-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.app-record-modal .modal-dialog{max-width:calc(100vw - 16px)!important}.messages-shell{min-height:700px!important}.messages-thread{max-height:470px!important}}
@media(max-width:767.98px){.permission-editor-grid,.brand-access-grid{grid-template-columns:1fr}.brand-setting-card{padding:16px}.invoice-filter-bar{grid-template-columns:1fr}.invoice-filter-bar .filter-search{grid-column:auto}.invoice-filter-bar .btn{width:100%}.app-record-modal .modal-dialog{margin:8px!important}.app-record-modal .modal-body{padding:9px}.modal-form-actions{position:sticky;bottom:-24px;z-index:4;margin-left:-24px;margin-right:-24px}.selected-invoice-brand{grid-template-columns:minmax(0,1fr) 72px!important;align-items:flex-start!important}.selected-invoice-brand-logo{width:72px!important}.invoice-primary-fields>div{flex:0 0 100%!important;max-width:100%!important}.invoice-form-actions{grid-template-columns:1fr!important}.invoice-bank-card{margin:12px 0!important}.user-management-panel .panel-header{align-items:stretch!important;flex-direction:column}.user-management-panel .table-search-box{width:100%}}

/* v1.7 usability pass */
.crm-brand-name,.crm-nav .nav-link,.nav-sublink,.crm-sidebar-user strong{font-family:"Gill Sans",sans-serif}
.crm-nav{padding-top:5px!important;padding-bottom:5px!important}
.crm-nav .nav-link,.nav-sublink{min-height:36px!important;padding:7px 9px!important;font-size:.88rem!important;font-weight:500!important;line-height:1.25!important;letter-spacing:.004em;color:#334155}
.crm-nav .nav-link.active,.crm-nav .nav-group.open>.nav-group-toggle{font-weight:700!important}
.crm-nav .nav-icon{font-size:1rem!important}
.app-record-modal.brand-record-modal .modal-dialog{max-width:min(540px,calc(100vw - 20px))!important}
.app-record-modal.brand-record-modal .modal-body{max-height:82vh!important;padding:20px!important}
.app-record-modal.brand-record-modal .page-heading{margin-bottom:14px!important}
.app-record-modal.brand-record-modal .panel{box-shadow:none!important}
.app-record-modal.brand-record-modal .modal-form-actions{position:sticky;bottom:-20px;z-index:5;margin:20px -20px -20px;padding:12px 20px;background:#fff}
.brand-setting-card{min-height:184px;padding:22px!important}
.brand-setting-card h2{font-size:1rem!important}
.messages-shell{grid-template-columns:minmax(260px,310px) minmax(0,1fr)!important;border:1px solid #e4e9ef!important;box-shadow:0 8px 28px rgba(15,23,42,.05)}
.messages-main{background:#f6f8fb!important}
.messages-thread{background:linear-gradient(180deg,#f7f9fc 0%,#f3f6fa 100%)!important;padding:18px!important}
.message-bubble{border:0!important;border-radius:14px 14px 14px 5px!important;box-shadow:0 3px 12px rgba(15,23,42,.07)!important}
.message-line.mine .message-bubble{background:#0f172a!important;border-color:#0f172a!important;border-radius:14px 14px 5px 14px!important}
.message-body{font-size:.84rem!important;line-height:1.45}
.conversation-name{font-size:.78rem!important}.conversation-subject,.conversation-preview{font-size:.68rem!important}.conversation-time{font-size:.6rem!important}
.report-filter-grid{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr)) auto;gap:10px;align-items:center}
.report-filter-grid-compact{grid-template-columns:minmax(180px,1fr) repeat(2,minmax(140px,.6fr)) auto}

@media(max-width:991.98px){.report-filter-grid,.report-filter-grid-compact{grid-template-columns:repeat(2,minmax(0,1fr))}.report-filter-grid .btn{width:100%}.messages-shell{grid-template-columns:1fr!important}.messages-conversations{max-height:250px!important}.messages-thread{min-height:420px!important}}
@media(max-width:575.98px){.report-filter-grid,.report-filter-grid-compact{grid-template-columns:1fr}.app-record-modal.brand-record-modal .modal-dialog{max-width:calc(100vw - 12px)!important;margin:6px!important}.messages-thread{min-height:360px!important;padding:12px!important}.message-bubble{max-width:88%!important}.page-heading>.d-flex{width:100%}.page-heading>.d-flex .btn{flex:1 1 auto}}

/* v1.7.1 multi-form brand editor */
.brand-editor-current-logo{display:flex;align-items:center;gap:9px;margin-bottom:8px;padding:8px;border:1px solid #e3e8ef;border-radius:8px;background:#f8fafc;color:#64748b;font-size:.72rem}
.brand-editor-current-logo img{width:48px;height:36px;object-fit:contain;border-radius:5px;background:#fff}
.brand-editor-section{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:5px;padding:12px 0 4px;border-top:1px solid #e4e9ef}
.brand-editor-section strong,.brand-editor-section small{display:block}.brand-editor-section small{margin-top:2px;color:#64748b;font-size:.72rem}.brand-editor-section>span{white-space:nowrap;color:#475569;font-size:.72rem}
.brand-service-brief-list{display:grid;gap:7px;margin-top:6px}
.brand-service-brief-list>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border-radius:8px;background:#f6f8fb}
.brand-service-brief-list>div>span{display:flex;align-items:center;gap:8px;min-width:0}.brand-service-brief-list strong{overflow:hidden;font-size:.76rem;text-overflow:ellipsis;white-space:nowrap}
.brand-service-brief-list button,.brand-service-brief-list a{display:grid;width:30px;height:30px;padding:0;place-items:center;border:0;border-radius:6px;background:#fff;color:#334155;text-decoration:none}
.brand-service-brief-list button:hover,.brand-service-brief-list a:hover{background:#0f172a;color:#fff}

@media(max-width:767.98px){.brief-detail-grid,.brief-file-list{grid-template-columns:1fr}.brief-detail-grid>div,.brief-detail-grid>div:nth-child(2n){grid-column:auto;border-right:0}.invoice-items-table{margin:0!important}.invoice-items-table table{min-width:780px!important}.brand-brief-link{margin-left:-16px;margin-right:-16px;padding-left:16px;padding-right:16px}.brand-brief-link small{display:none}}

@media(max-width:767.98px){
  .page-heading{gap:10px!important;margin-bottom:12px!important}
  .page-heading-copy{gap:8px!important}.page-icon{width:36px!important;height:36px!important;flex:0 0 36px!important}
  .panel{border-radius:9px!important}
  .table-responsive:not(.invoice-items-table){overflow:visible!important;border-radius:0!important}
  .table-responsive:not(.invoice-items-table)>table.table{display:block!important;width:100%!important;background:transparent!important}
  .table-responsive:not(.invoice-items-table)>table.table>thead{display:none!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody{display:grid!important;gap:10px!important;padding:9px!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr{display:block!important;overflow:hidden;border:1px solid #dbe3ec;border-radius:9px;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.03)}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td{display:grid!important;grid-template-columns:minmax(92px,35%) minmax(0,1fr);align-items:center;gap:10px;min-height:42px!important;padding:8px 10px!important;border-bottom:1px solid #edf1f4!important;font-size:.75rem!important;text-align:left!important;white-space:normal!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td:last-child{border-bottom:0!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td[data-label]:before{content:attr(data-label);color:#66778a;font-size:.66rem;font-weight:700}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td>.mobile-cell-value{display:block!important;min-width:0;overflow-wrap:anywhere}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td.mobile-full-row{display:block!important;padding:18px!important;text-align:center!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td.text-end.text-nowrap{min-width:0!important;white-space:normal!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td.text-end.text-nowrap .mobile-cell-value>form,.table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td.text-end.text-nowrap .mobile-cell-value>a{vertical-align:middle}
  .table .btn-sm{width:38px!important;height:38px!important;font-size:1.05rem!important}
  .settings-card-grid{--bs-gutter-x:.65rem;--bs-gutter-y:.65rem}.settings-card-grid h2{font-size:.86rem}.settings-card-grid p{font-size:.66rem}.settings-card-grid .page-icon{margin-bottom:8px!important}
  .sidebar-order-item{grid-template-columns:24px 34px minmax(0,1fr) auto;gap:7px;padding:8px 9px}.sidebar-order-item .form-select{grid-column:2/5;width:100%!important}.sidebar-order-actions{grid-column:4;grid-row:1}.sidebar-order-copy strong{font-size:.74rem}.sidebar-order-copy small{display:none}.sidebar-menu-savebar{align-items:stretch;flex-direction:column-reverse}.sidebar-menu-savebar .btn{width:100%}
}

/* v1.6.1 readability and invoice workspace correction */
html{font-size:16px!important}
body{font-size:15px!important;line-height:1.5!important}
body,.form-control,.form-select,.select2-container,.dropdown-menu,.btn{font-size:.9rem!important}
.form-label{font-size:.84rem!important;font-weight:650!important}
.form-text,.text-muted,small{font-size:.76rem}
.page-heading .text-muted{font-size:.84rem!important}
.panel-header h2,.panel-header h3{font-size:1rem!important}
.crm-brand .brand-title{font-size:.94rem!important}
.crm-brand .brand-subtitle{font-size:.65rem!important}
.crm-nav .nav-link,.crm-nav .nav-sublink{font-size:.88rem!important}
.sidebar-account-copy strong{font-size:.86rem!important}.sidebar-account-copy small{font-size:.72rem!important}
.table thead th{font-size:.82rem!important}
.table tbody td{font-size:.88rem!important;line-height:1.5!important}
.table .badge,.role-chip,.permission-chip-list span,.invoice-status{font-size:.72rem!important}
.brand-setting-identity h2{font-size:.95rem!important}.brand-setting-identity small{font-size:.73rem!important}
.brand-setting-details p,.brand-setting-details .brand-bank-line strong{font-size:.81rem!important}
.brand-setting-foot span,.brand-setting-foot>a{font-size:.7rem!important}
.brand-brief-link strong{font-size:.82rem!important}.brand-brief-link small{font-size:.7rem!important}
.user-cell small{font-size:.73rem!important}.role-chip{font-size:.73rem!important}.permission-chip-list span{font-size:.68rem!important}
.form-section-title>span{font-size:.94rem!important}.form-section-title>small{font-size:.75rem!important}
.access-check{font-size:.82rem!important}.permission-module-card>strong{font-size:.8rem!important}.permission-switch{font-size:.76rem!important}
.conversation-name{font-size:.86rem!important}.conversation-subject,.conversation-preview{font-size:.73rem!important}.conversation-time{font-size:.68rem!important}
.message-attachment-preview,.message-attachment strong{font-size:.77rem!important}.message-attachment small{font-size:.68rem!important}
.invoice-status{font-size:.72rem!important}.invoice-brand-card h3{font-size:.96rem!important}
.selected-invoice-brand-copy strong{font-size:1rem!important}.selected-invoice-brand-copy small{font-size:.74rem!important}
.invoice-brand-document-meta strong{font-size:1rem!important}.invoice-brand-document-meta small{font-size:.7rem!important}.invoice-brand-document-meta span{font-size:.64rem!important}
.invoice-primary-fields .form-label{font-size:.82rem!important}.invoice-primary-fields .form-text{font-size:.7rem!important}
.invoice-bank-card>div strong{font-size:.82rem!important}.invoice-bank-card p{font-size:.78rem!important}
.invoice-lead-recipient strong{font-size:.87rem!important}.invoice-lead-recipient small{font-size:.75rem!important}
.invoice-total-line{font-size:.84rem!important}.invoice-grand-total{font-size:1rem!important}
.conversion-lock strong,.conversion-ready strong{font-size:.86rem!important}.conversion-lock span,.conversion-ready span{font-size:.76rem!important}
.brief-detail-grid small{font-size:.72rem!important}.brief-detail-grid strong,.brief-detail-grid span{font-size:.86rem!important}.brief-file-list>a>span{font-size:.8rem!important}.brief-file-list small{font-size:.68rem!important}
.sidebar-order-copy strong{font-size:.9rem!important}.sidebar-order-copy small{font-size:.74rem!important}.settings-card-grid p{font-size:.82rem!important}
.app-record-modal .modal-kicker{font-size:.68rem!important}.app-record-modal .modal-title{font-size:1.18rem!important}.app-modal-loading,.app-modal-error{font-size:.86rem!important}
.app-record-modal.invoice-record-modal .modal-dialog{max-width:min(820px,calc(100vw - 24px))!important}
.app-record-modal.invoice-record-modal .modal-body{padding:14px!important}
.app-record-modal.invoice-record-modal .selected-invoice-brand,.app-record-modal.invoice-record-modal .invoice-form-panel,.app-record-modal.invoice-record-modal .invoice-lead-recipient{width:100%!important}
.app-record-modal.invoice-record-modal .invoice-items-table table{min-width:760px!important}
@media(max-width:767.98px){
  body{font-size:15px!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td{font-size:.86rem!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td[data-label]:before{font-size:.76rem!important}
  .app-record-modal.invoice-record-modal .modal-dialog{max-width:calc(100vw - 12px)!important;margin:6px!important}
  .app-record-modal.invoice-record-modal .modal-body{padding:8px!important}
}

/* v1.6.2 discoverability, classic data tables and responsive shell */
.crm-navbar{height:66px!important;min-height:66px!important;border-top:0!important;border-bottom:1px solid #dbe3ec!important;background:linear-gradient(180deg,#fff 0%,#fbfcfe 100%)!important;box-shadow:0 2px 10px rgba(15,23,42,.035)!important}
.crm-navbar .container-fluid{gap:14px!important;padding-left:18px!important;padding-right:16px!important}
.topbar-left{display:flex;align-items:center;gap:12px!important}
.sidebar-toggle{width:38px!important;height:38px!important;border:1px solid transparent!important;border-radius:9px!important}
.sidebar-toggle:hover{border-color:#dbe3ec!important;background:#fff!important}
.top-role-pill{min-height:32px;padding:5px 12px;border-color:#d8e1ea;background:#fff;font-size:.76rem;box-shadow:0 1px 2px rgba(15,23,42,.03)}
.navbar-actions{display:flex;align-items:center;gap:7px!important;min-width:0}
.global-search-trigger{height:40px!important;min-width:235px;border-radius:9px!important;background:#fff!important}
.brand-switcher .form-select,.brand-switcher .select2-container .select2-selection{min-height:40px!important;border-radius:9px!important;background:#fff!important}
.crm-navbar .icon-button{width:38px!important;height:38px!important;border:1px solid transparent!important;border-radius:9px!important}
.crm-navbar .icon-button:hover{border-color:#dbe3ec!important;background:#fff!important}
.profile-button{min-height:42px!important;padding:4px 7px!important;border:1px solid transparent!important;border-radius:10px!important}
.profile-button:hover{border-color:#dbe3ec!important;background:#fff!important}
.profile-copy strong{font-size:.8rem!important}.profile-copy small{font-size:.68rem!important}

.app-record-modal .modal-dialog{max-width:min(760px,calc(100vw - 24px))!important}
.app-record-modal.invoice-record-modal .modal-dialog{max-width:min(780px,calc(100vw - 24px))!important}
.app-record-modal .modal-content{max-height:90vh!important;border-radius:11px!important}
.app-record-modal .modal-header{min-height:58px!important;padding:10px 15px!important}
.app-record-modal .modal-body{padding:13px!important}
.app-record-modal .modal-body .row{--bs-gutter-x:.65rem;--bs-gutter-y:.65rem}
.app-record-modal .modal-body .panel{margin-bottom:.65rem!important}
.app-record-modal .modal-body .panel.p-4{padding:1rem!important}
.app-record-modal .modal-body .panel-header{padding:.75rem 1rem!important}
.app-record-modal .modal-body .metric-card{min-height:0!important;padding:.8rem!important}
.app-record-modal .modal-body .compact-detail-grid{gap:.55rem!important}
.app-record-modal .modal-body .modal-form-actions{margin-top:1rem!important}
.app-record-modal .modal-body .project-primary-actions{gap:.4rem!important}
.app-record-modal .app-modal-page-actions{display:flex;align-items:center;justify-content:flex-end;gap:.4rem;margin:0 0 .65rem;padding:0 0 .65rem;border-bottom:1px solid var(--bs-border-color)}
.app-record-modal .app-modal-page-actions>div{display:flex;align-items:center;justify-content:flex-end;gap:.4rem;flex-wrap:wrap;width:100%}
.app-record-modal .app-modal-page-actions>.btn{margin-left:auto}
.app-record-modal .task-view .tv-top{gap:10px;margin-bottom:10px}
.app-record-modal .task-view .tv-title-wrap{display:none}
.app-record-modal .task-view .tv-top{justify-content:flex-end;padding-bottom:.65rem;border-bottom:1px solid var(--bs-border-color)}
.app-record-modal .task-view .tv-grid{grid-template-columns:minmax(0,1.6fr) 300px;gap:10px}
.app-record-modal .task-view .tv-stack,.app-record-modal .task-view .tv-side{gap:10px}
.app-record-modal .task-view .tv-card-head{padding:10px 12px}
.app-record-modal .task-view .tv-card-body{padding:12px}
.app-record-modal .task-view .tv-source{gap:6px;margin-top:10px}
.app-record-modal .task-view .tv-progress{padding:10px 12px}
#taskBoardModal .modal-dialog{width:min(820px,calc(100vw - 24px))!important;max-width:820px!important;height:auto!important;max-height:90vh!important;margin:5vh auto!important}
#taskBoardModal .modal-content{height:auto!important;max-height:90vh!important}

.panel>.table-responsive{border-top:1px solid #d9e0e8;border-radius:0!important}
.table{border-collapse:collapse!important;border-spacing:0!important;margin-bottom:0!important}
.table thead th{height:44px!important;padding:10px 12px!important;border-right:1px solid #d9e0e8!important;border-bottom:1px solid #cfd8e2!important;background:#f3f5f7!important;color:#172033!important;font-weight:700!important}
.table thead th:last-child{border-right:0!important}
.table tbody td{padding:11px 12px!important;border-right:1px solid #e1e6ec!important;border-bottom:1px solid #d9e0e8!important;background:#fff!important}
.table tbody td:last-child{border-right:0!important}.table tbody tr:last-child td{border-bottom:0!important}
.table tbody tr:hover td{background:#f8fafc!important}
.table td a:not(.btn){color:#245b94!important;text-decoration:none!important;font-weight:600}
.table td a:not(.btn):hover{color:#123e6c!important;text-decoration:underline!important}

.task-list-filterbar{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:nowrap!important}
.task-list-filter{display:flex;align-items:center;gap:8px;min-width:0;flex:1;flex-wrap:nowrap}
.task-filter-search{width:min(340px,31vw)!important;min-width:210px}.task-filter-status{width:190px!important;flex:0 0 190px}.task-filter-mine{flex:0 0 auto;white-space:nowrap}.task-filter-count{flex:0 0 auto;margin-left:auto}

.brief-form-directory{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.brief-form-card{display:flex;min-width:0;flex-direction:column;padding:18px;border:1px solid #dbe3ec;border-radius:11px;background:#fff;box-shadow:0 2px 8px rgba(15,23,42,.035)}
.brief-form-card-head{display:flex;align-items:center;gap:11px}.brief-form-card-head>div{min-width:0;flex:1}.brief-form-card-head h2{overflow:hidden;margin:0;color:#172033;font-size:1rem;text-overflow:ellipsis;white-space:nowrap}.brief-form-card-head p{margin:3px 0 0;color:#748397;font-size:.76rem}.brief-form-card-head>.badge{font-size:.68rem!important}
.brief-form-logo{width:42px;height:42px;display:grid;place-items:center;flex:0 0 42px;overflow:hidden;border:1px solid #dbe3ec;border-radius:9px;background:#f4f7fa;color:#52677e}.brief-form-logo img{width:100%;height:100%;padding:4px;object-fit:contain}
.brief-form-card>label{margin:18px 0 6px;color:#66778b;font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.035em}
.brief-url-row{display:flex;align-items:center;gap:7px;min-width:0}.brief-url-row>a{min-width:0;flex:1;overflow:hidden;padding:9px 10px;border:1px solid #dce4ec;border-radius:8px;background:#f8fafc;color:#285b8f;font-size:.76rem;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.brief-url-row>button{width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;border:1px solid #dce4ec;border-radius:8px;background:#fff;color:#29445f}
.brief-form-card-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}.brief-form-card-stats span{display:flex;flex-direction:column;padding:10px;border-radius:8px;background:#f6f8fb;color:#7a8999;font-size:.7rem}.brief-form-card-stats strong{margin-bottom:2px;color:#172033;font-size:.86rem}
.brief-form-card-actions{display:flex;gap:8px;margin-top:14px}.brief-form-card-actions .btn{flex:1}

.crm-login-page{padding:28px!important;background:radial-gradient(circle at 15% 18%,#eaf1fa 0,transparent 32%),linear-gradient(135deg,#f7f9fc,#eef3f8)!important}
.crm-login-shell{width:min(980px,100%)!important;grid-template-columns:minmax(0,1.05fr) minmax(380px,.95fr)!important;border:0!important;border-radius:20px!important;box-shadow:0 30px 90px rgba(15,23,42,.16)!important}
.crm-login-intro{position:relative;isolation:isolate;overflow:hidden;padding:46px!important;background:linear-gradient(145deg,#0b1425 0%,#142b49 62%,#1d4f78 100%)!important}
.crm-login-intro:before,.crm-login-intro:after{content:"";position:absolute;z-index:-1;border-radius:50%;background:rgba(255,255,255,.06)}.crm-login-intro:before{width:280px;height:280px;right:-110px;top:-80px}.crm-login-intro:after{width:190px;height:190px;left:-95px;bottom:-70px}
.crm-login-brand{font-size:.92rem!important}.crm-login-intro h1{max-width:400px;margin-top:58px!important;font-size:2.35rem!important;line-height:1.12!important}.crm-login-intro p{font-size:.9rem!important}.crm-login-points{font-size:.8rem!important}.crm-login-points span{gap:10px!important}.crm-login-points i{font-size:1rem}
.crm-login-form-wrap{display:flex;flex-direction:column;justify-content:center;padding:48px 52px!important;background:#fff}
.crm-login-form-brand{display:none;align-items:center;gap:10px;margin-bottom:28px}.crm-login-form-brand>span:last-child{display:flex;flex-direction:column}.crm-login-form-brand strong{color:#172033;font-size:.9rem}.crm-login-form-brand small{margin-top:2px;color:#7b8998;font-size:.68rem}
.crm-login-eyebrow{color:#4d6f98;font-size:.7rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.crm-login-form-wrap h2{margin:8px 0 7px!important;font-size:1.75rem!important}.crm-login-form-wrap>p{margin-bottom:28px!important;font-size:.84rem!important;line-height:1.55}.crm-login-form-wrap .form-control{min-height:46px!important;border-radius:9px!important}.crm-password-toggle{top:6px!important}.crm-login-form-wrap .btn-primary{min-height:47px!important;border-radius:9px!important}.crm-login-help{font-size:.72rem!important}

@media(max-width:991.98px){
  .brief-form-directory{grid-template-columns:1fr}
  .global-search-trigger{min-width:190px}
  .app-record-modal .modal-dialog,.app-record-modal.invoice-record-modal .modal-dialog{max-width:min(720px,calc(100vw - 18px))!important}
}
@media(max-width:767.98px){
  .crm-navbar{height:58px!important;min-height:58px!important}.crm-navbar .container-fluid{gap:6px!important;padding-inline:8px!important}.topbar-left{gap:5px!important}.top-role-pill{display:none}.navbar-actions{gap:3px!important}.crm-navbar .icon-button{width:36px!important;height:36px!important}.profile-button{min-height:38px!important;padding:2px 4px!important}
  .task-list-filterbar{align-items:stretch!important;flex-direction:column!important}.task-list-filter{display:grid;grid-template-columns:1fr 1fr;width:100%}.task-filter-search,.task-filter-status{width:100%!important;min-width:0;flex:auto}.task-filter-search{grid-column:1/-1}.task-filter-count{align-self:flex-end;margin:0}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td{border-right:0!important;background:#fff!important}.table-responsive:not(.invoice-items-table)>table.table>tbody>tr:hover>td{background:#f8fafc!important}
  .brief-form-card{padding:14px}.brief-form-card-actions{flex-direction:column}.brief-form-card-actions .btn{width:100%}
  .crm-login-page{padding:12px!important}.crm-login-shell{display:block!important;border-radius:16px!important}.crm-login-intro{display:none!important}.crm-login-form-wrap{min-height:calc(100vh - 24px);padding:34px 24px!important}.crm-login-form-brand{display:flex}.crm-login-theme{top:14px!important;right:14px!important}
  #taskBoardModal .modal-dialog{width:calc(100vw - 12px)!important;max-width:none!important;margin:6px!important}
}
@media(max-width:479.98px){
  .crm-navbar .theme-toggle,.crm-navbar .brand-switcher{display:none!important}.crm-navbar .avatar-sm{width:30px!important;height:30px!important}.header-count{top:-1px!important;right:-1px!important}
  .task-list-filter{grid-template-columns:1fr}.task-filter-search{grid-column:auto}.task-filter-mine,.task-list-filter .btn{width:100%}
  .brief-form-card-stats{grid-template-columns:1fr}.brief-form-card-head>.badge{display:none}
}
[data-bs-theme="dark"] .crm-navbar{background:linear-gradient(180deg,#17212b,#141d26)!important;border-color:#303d4a!important}
[data-bs-theme="dark"] .brief-form-card,[data-bs-theme="dark"] .brief-url-row>button,[data-bs-theme="dark"] .crm-login-form-wrap{background:#17212b!important;border-color:#303d4a!important}
[data-bs-theme="dark"] .brief-url-row>a,[data-bs-theme="dark"] .brief-form-card-stats span{background:#202b36!important;border-color:#34414e!important}[data-bs-theme="dark"] .brief-form-card h2,[data-bs-theme="dark"] .brief-form-card-stats strong,[data-bs-theme="dark"] .crm-login-form-brand strong{color:#eef4fa!important}

/* v1.6.3 compact Gill Sans interface */
html{font-size:15px!important}
html,body,button,input,select,textarea,.btn,.form-control,.form-select,.select2-container,.dropdown-menu,.table,.badge,.modal,.panel,.credential-value,code,kbd,pre,samp{font-family:"Gill Sans",sans-serif!important}
body{font-size:14px!important;line-height:1.4!important}
.btn,.form-control,.form-select,.select2-container,.dropdown-menu{font-size:.82rem!important}
.form-label{font-size:.77rem!important}.form-text,.text-muted,small{font-size:.68rem}
.page-heading{min-height:44px!important;margin-bottom:13px!important}.page-heading h1{font-size:1.28rem!important}.page-heading .page-icon{width:35px!important;height:35px!important;flex-basis:35px!important;font-size:1rem!important}
.page-heading .eyebrow,.page-heading p.text-muted,.panel-header .small.text-muted,.crm-brand .brand-subtitle,.settings-card-grid p.text-muted{display:none!important}
.panel-header{min-height:48px!important;padding:10px 13px!important}.panel-header h2,.panel-header h3{font-size:.9rem!important}
.crm-nav .nav-link,.crm-nav .nav-sublink{font-size:.81rem!important}.sidebar-account-copy strong{font-size:.8rem!important}.sidebar-account-copy small{font-size:.66rem!important}
.table-responsive,.panel>.table-responsive{border:0!important}
.table{border:0!important;border-collapse:collapse!important}
.table thead th{height:38px!important;padding:8px 10px!important;border:0!important;background:#f5f6f8!important;font-size:.73rem!important}
.table tbody td{min-height:44px!important;padding:9px 10px!important;border:0!important;background:#fff!important;font-size:.78rem!important;line-height:1.35!important}
.table tbody tr:nth-child(even) td{background:#fafbfc!important}.table tbody tr:hover td{background:#f3f6f9!important}
.table .badge,.task-status-pill,.priority-badge,.invoice-status,.role-chip,.status-badge,.table [class*="status-"]{max-width:none!important;min-width:max-content!important;white-space:nowrap!important;word-break:keep-all!important;overflow-wrap:normal!important;line-height:1.15!important}
.table td:has(.task-status-pill),.table td:has(.invoice-status),.table td:has(.badge){white-space:nowrap!important}
.invoice-status,.task-status-pill{font-size:.67rem!important;padding:4px 7px!important}
.brand-setting-identity small,.brand-setting-foot,.brand-brief-link small{font-size:.65rem!important}
.conversation-name{font-size:.8rem!important}.conversation-subject,.conversation-preview{font-size:.68rem!important}.conversation-time{font-size:.62rem!important}
.crm-login-intro p,.crm-login-points,.crm-login-form-wrap>p,.crm-login-eyebrow{display:none!important}.crm-login-form-wrap h2{margin-bottom:22px!important}.crm-login-help{font-size:.66rem!important}
@media(max-width:767.98px){
  body{font-size:14px!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr{border:0!important;border-radius:7px!important;box-shadow:0 1px 5px rgba(15,23,42,.06)!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td{border:0!important;font-size:.76rem!important}
  .table-responsive:not(.invoice-items-table)>table.table>tbody>tr>td[data-label]:before{font-size:.67rem!important}
}

/* v1.8 final sidebar structure */
.crm-nav{display:flex!important;flex-direction:column!important;gap:2px!important;padding:7px 8px 10px!important}
.crm-nav>.nav-link,.crm-nav>.nav-group>.nav-group-toggle,.crm-nav .nav-sublink{display:flex!important;align-items:center!important;width:100%!important;min-height:38px!important;margin:0!important;padding:8px 10px!important;border-radius:7px!important;font-size:.86rem!important;font-weight:500!important;line-height:1.2!important;color:#334155!important}
.crm-nav .nav-icon{display:grid!important;width:21px!important;flex:0 0 21px!important;place-items:center!important;font-size:.96rem!important;color:#526174!important}
.crm-nav .nav-text{display:inline-block!important;min-width:0!important}
.crm-nav .nav-group{display:block!important;width:100%!important}
.crm-nav .nav-group-toggle .bi-chevron-down{display:inline-block!important;margin-left:auto!important;font-size:.75rem!important;transition:transform .18s ease!important}
.crm-nav .nav-group.open>.nav-group-toggle .bi-chevron-down{transform:rotate(180deg)!important}
.crm-nav .nav-submenu{display:none!important;width:100%!important;padding:3px 0 3px 0!important}
.crm-nav .nav-group.open>.nav-submenu{display:flex!important;flex-direction:column!important;gap:2px!important}
.crm-nav .nav-sublink{padding-left:10px!important;background:transparent!important}
.crm-nav .nav-sublink:before{display:none!important}
.crm-nav>.nav-link:hover,.crm-nav .nav-group-toggle:hover,.crm-nav .nav-sublink:hover{background:#f1f4f7!important;color:#0f172a!important}
.crm-nav>.nav-link.active,.crm-nav .nav-sublink.active,.crm-nav .nav-group.open>.nav-group-toggle{background:#eef1f4!important;color:#0f172a!important;font-weight:700!important}
.crm-nav>.nav-link.active .nav-icon,.crm-nav .nav-sublink.active .nav-icon,.crm-nav .nav-group.open>.nav-group-toggle .nav-icon{color:#0f172a!important}
body.sidebar-mini .crm-nav .nav-group.open>.nav-submenu{display:none!important}
[data-bs-theme="dark"] .crm-nav>.nav-link,[data-bs-theme="dark"] .crm-nav>.nav-group>.nav-group-toggle,[data-bs-theme="dark"] .crm-nav .nav-sublink{color:#cbd5e1!important}
[data-bs-theme="dark"] .crm-nav>.nav-link:hover,[data-bs-theme="dark"] .crm-nav .nav-group-toggle:hover,[data-bs-theme="dark"] .crm-nav .nav-sublink:hover,[data-bs-theme="dark"] .crm-nav>.nav-link.active,[data-bs-theme="dark"] .crm-nav .nav-sublink.active,[data-bs-theme="dark"] .crm-nav .nav-group.open>.nav-group-toggle{background:#202a35!important;color:#fff!important}

/* --- v1.6 usability updates --- */
.table-responsive{width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
.table-responsive>table.table{min-width:100%}
.table>thead>tr>th,.table>tbody>tr>td{vertical-align:middle;overflow-wrap:anywhere;word-break:break-word}
.panel .table .btn{white-space:nowrap}
.workflow-mini{padding:10px 14px!important;gap:10px!important;overflow-x:auto;flex-wrap:nowrap}
.workflow-mini span{white-space:nowrap}
.invoice-simple-form .panel{border-radius:12px}
.invoice-simple-form .lead-avatar{width:46px;height:46px;display:grid;place-items:center;flex:0 0 46px;border-radius:12px;background:#eff6ff;color:#1d4ed8;font-weight:800;font-size:1rem}
.invoice-simple-totals{position:sticky;top:84px}
.brand-setting-foot a{white-space:nowrap}
@media(max-width:1199.98px){.invoice-simple-totals{position:static}}
@media(max-width:767.98px){
  .workflow-mini{margin-left:-4px;margin-right:-4px}
  .invoice-simple-form .panel{padding:16px!important}
  .invoice-simple-form .panel-header{align-items:stretch!important;flex-direction:column}
  .invoice-simple-form .panel-header .btn{width:100%}
  .invoice-simple-form .input-group{flex-wrap:nowrap}
}
[data-bs-theme="dark"] .invoice-simple-form .lead-avatar{background:#1e3a5f!important;color:#dbeafe!important}
[data-bs-theme="dark"] .workflow-mini{background:#17212b!important;border-color:#303d4a!important}


/* v1.7 responsive records + simple invoice */
.invoice-recipient-card,.invoice-meta-card,.invoice-payment-preview{box-shadow:0 2px 10px rgba(15,23,42,.03)}
.invoice-head-meta{min-width:140px}
.invoice-payment-copy{white-space:pre-wrap;color:#475569;line-height:1.7;font-size:.84rem}
.invoice-items-table table td,.invoice-items-table table th{vertical-align:top}
.invoice-items-table .select2-container{width:100%!important}
.invoice-items-table .select2-container .select2-selection--single{height:38px!important;border-color:#d8e1ea!important;border-radius:8px!important}
.invoice-items-table .select2-container .select2-selection__rendered{line-height:36px!important;padding-left:12px!important;font-size:.82rem!important}
.invoice-items-table .select2-container .select2-selection__arrow{height:36px!important;right:6px!important}
.brand-setting-card,.brief-form-card{transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease}
.brand-setting-card:hover,.brief-form-card:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(15,23,42,.06);border-color:#cfd9e4}
.brand-setting-head,.brief-form-card-head{align-items:flex-start}
.brand-service-brief-list>div{border:1px solid #ebf0f5}
@media(max-width:767.98px){
  .invoice-head-meta{width:100%;text-align:left!important}
  .brand-settings-grid,.brief-form-directory{gap:12px!important}
}

/* v3.4 invoice rows stack on phones instead of overflowing */
@media(max-width:767.98px){
  .invoice-items-table{overflow:visible!important}
  .invoice-items-table table{display:block!important;min-width:0!important;width:100%!important}
  .invoice-items-table thead{display:none!important}
  .invoice-items-table tbody{display:grid!important;gap:10px!important;padding:10px!important}
  .invoice-items-table tr[data-item]{display:grid!important;grid-template-columns:1fr!important;gap:0!important;padding:8px!important;border:1px solid #dbe3ec;border-radius:10px;background:#fff}
  .invoice-items-table tr[data-item]>td{display:block!important;width:100%!important;padding:8px!important;border:0!important}
  .invoice-items-table tr[data-item]>td:before{display:block;margin-bottom:5px;color:#66778a;font-size:.7rem;font-weight:700}
  .invoice-items-table tr[data-item]>td:nth-child(1):before{content:'Service'}
  .invoice-items-table tr[data-item]>td:nth-child(2):before{content:'Description'}
  .invoice-items-table tr[data-item]>td:nth-child(3):before{content:'Amount'}
  .invoice-items-table tr[data-item]>td:nth-child(4):before{content:'';display:none}
  .invoice-items-table tr[data-item]>td:nth-child(4){text-align:right!important}
}
[data-bs-theme="dark"] .invoice-items-table tr[data-item]{background:#17212b!important;border-color:#303d4a!important}

/* v3.4.1 visual brand directory */
.brand-overview-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:hidden;border:1px solid #dbe3ec;border-radius:14px;background:#fff}
.brand-overview-strip>div,.brand-overview-strip>a{min-height:72px;display:flex;align-items:center;gap:12px;padding:14px 18px;border-right:1px solid #e8edf2;color:#172033;text-decoration:none}
.brand-overview-strip>*:last-child{border-right:0}.brand-overview-strip>a:hover{background:#f8fafc}
.brand-overview-strip>*>i:first-child{width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;border-radius:10px;background:#f1f5f9;color:#475569;font-size:1rem}
.brand-overview-strip span{display:flex;flex-direction:column}.brand-overview-strip strong{font-size:1.15rem;line-height:1}.brand-overview-strip small{margin-top:5px;color:#7b8998;font-size:.72rem}
.brand-visual-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.brand-visual-card{position:relative;min-width:0;overflow:hidden;border:1px solid #dbe3ec;border-radius:16px;background:#fff;box-shadow:0 4px 14px rgba(15,23,42,.045);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.brand-visual-card:hover{transform:translateY(-3px);border-color:#c7d2df;box-shadow:0 12px 28px rgba(15,23,42,.09)}
.brand-visual-accent{position:relative;height:78px;background:var(--brand-card-color,#648bea)}
.brand-visual-accent:after{content:"";position:absolute;inset:0;background:linear-gradient(115deg,rgba(255,255,255,.18),transparent 48%,rgba(0,0,0,.08))}
.brand-visual-actions{position:absolute;z-index:2;top:12px;right:12px;display:flex;gap:6px}.brand-visual-actions form{margin:0}
.brand-visual-actions a,.brand-visual-actions button{width:32px;height:32px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.42);border-radius:9px;background:rgba(255,255,255,.88);color:#172033;box-shadow:0 2px 7px rgba(15,23,42,.08);text-decoration:none;backdrop-filter:blur(6px)}
.brand-visual-actions button{color:#dc2626}.brand-visual-actions a:hover,.brand-visual-actions button:hover{background:#fff}
.brand-visual-body{position:relative;padding:0 18px 18px}.brand-visual-logo{width:66px;height:66px;display:grid;place-items:center;margin-top:-34px;overflow:hidden;border:4px solid #fff;border-radius:16px;background:#fff;box-shadow:0 5px 14px rgba(15,23,42,.12)}
.brand-visual-logo img{width:100%;height:100%;padding:5px;object-fit:contain}.brand-visual-logo span{color:#465a70;font-size:.95rem;font-weight:850}
.brand-visual-title{margin-top:12px;min-width:0}.brand-visual-title h2{min-width:0;overflow:hidden;margin:0;color:#172033;font-size:1.05rem;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.brand-visual-title small{display:block;margin-top:3px;color:#8290a0;font-size:.72rem}
.brand-status-dot{width:8px;height:8px;display:inline-block;flex:0 0 8px;border-radius:50%}.brand-status-dot.is-active{background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.12)}.brand-status-dot.is-inactive{background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.13)}
.brand-visual-meta{display:flex;flex-wrap:wrap;gap:7px;margin-top:14px}.brand-visual-meta>span{min-height:27px;display:inline-flex;align-items:center;gap:6px;padding:5px 8px;border:1px solid #e3e9ef;border-radius:8px;background:#f8fafc;color:#5f7084;font-size:.68rem;font-weight:700}.brand-visual-meta>span>i.bi{font-size:.72rem}.brand-color-chip i{width:13px;height:13px;display:block;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #d3dce6}.brand-color-chip b{color:#334155;font-size:.65rem}
.brand-visual-contact{display:grid;gap:7px;margin-top:15px;padding-top:14px;border-top:1px solid #edf1f5}.brand-visual-contact>a,.brand-visual-contact>div{min-width:0;display:flex;align-items:center;gap:8px;color:#607287;font-size:.73rem;text-decoration:none}.brand-visual-contact i{width:16px;color:#8998a8}.brand-visual-contact span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.brand-visual-assets{display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:10px;margin-top:14px}.brand-visual-assets>div{min-width:0;padding:10px;border:1px solid #e6ebf1;border-radius:10px;background:#fbfcfd}.brand-visual-assets small{display:block;margin-bottom:7px;color:#8593a2;font-size:.62rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.brand-color-bar{height:30px;display:block;overflow:hidden;border-radius:7px;background:#eef2f6}.brand-color-bar i{display:block;width:100%;height:100%}
.brand-invoice-logo-preview{height:30px;display:grid;place-items:center;overflow:hidden;border-radius:7px;background:#fff}.brand-invoice-logo-preview img{max-width:100%;max-height:30px;object-fit:contain}.brand-invoice-logo-preview b{color:#64748b;font-size:.68rem}
.brand-visual-footer{display:flex;gap:7px;margin-top:15px;padding-top:14px;border-top:1px solid #edf1f5}.brand-visual-footer .btn{flex:1;min-width:0;padding-inline:7px;font-size:.69rem;white-space:nowrap}

/* Brand add/edit live preview */
.brand-live-preview{position:relative;overflow:hidden;min-height:118px;border-radius:16px!important}.brand-live-color{height:38px;background:var(--brand-preview-color,#648bea);transition:background .15s ease}.brand-live-content{display:grid;grid-template-columns:76px minmax(0,1fr) 130px;gap:15px;align-items:center;padding:0 20px 16px}
.brand-live-logo{width:76px;height:76px;display:grid;place-items:center;margin-top:-20px;overflow:hidden;border:4px solid #fff;border-radius:17px;background:#fff;box-shadow:0 5px 16px rgba(15,23,42,.13)}.brand-live-logo img{width:100%;height:100%;padding:5px;object-fit:contain}.brand-live-logo span{color:#4f647a;font-size:1rem;font-weight:850}
.brand-live-copy{min-width:0}.brand-live-copy h2{overflow:hidden;margin:0;color:#172033;font-size:1.08rem;font-weight:800;text-overflow:ellipsis;white-space:nowrap}.brand-live-copy>small{display:block;margin-top:3px;color:#8391a0;font-size:.72rem}.brand-live-tags{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}.brand-live-tags>span{display:inline-flex;align-items:center;gap:6px;padding:4px 7px;border:1px solid #e0e7ef;border-radius:7px;background:#f8fafc;color:#5e7186;font-size:.65rem;font-weight:700}.brand-live-tags>span>i:not(.bi){width:12px;height:12px;display:inline-block;border-radius:50%;background:var(--brand-preview-color,#648bea)}
.brand-live-invoice-logo{text-align:right}.brand-live-invoice-logo>small{display:block;margin-bottom:6px;color:#8593a2;font-size:.62rem;font-weight:700;text-transform:uppercase}.brand-live-invoice-logo>div{height:50px;display:grid;place-items:center;overflow:hidden;border:1px solid #e1e7ee;border-radius:10px;background:#f9fbfc}.brand-live-invoice-logo img{max-width:100%;max-height:46px;padding:4px;object-fit:contain}.brand-live-invoice-logo span{color:#64748b;font-size:.72rem;font-weight:800}
.brand-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 230px;gap:16px;align-items:start}.brand-editor-side{position:sticky;top:82px}.brand-editor-section-title{display:flex;align-items:center;gap:9px;margin-bottom:17px;padding-bottom:12px;border-bottom:1px solid #edf1f5}.brand-editor-section-title i{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;background:#f1f5f9;color:#53677d}.brand-editor-section-title strong{color:#172033;font-size:.84rem}
.brand-upload-box{display:grid;grid-template-columns:72px minmax(0,1fr);gap:9px;align-items:center}.brand-upload-thumb{width:72px;height:50px;display:grid;place-items:center;overflow:hidden;border:1px solid #dce4ec;border-radius:9px;background:#f8fafc;color:#94a3b8}.brand-upload-thumb img{width:100%;height:100%;padding:4px;object-fit:contain}.brand-upload-thumb i{font-size:1.2rem}.brand-upload-box .form-control{min-width:0}
.brand-color-control{display:grid;grid-template-columns:58px minmax(0,1fr);gap:9px;align-items:center}.brand-color-control .form-control-color{width:58px!important;height:42px!important;padding:4px!important}.brand-color-control>span{min-height:42px;display:flex;align-items:center;padding:0 12px;border:1px solid #dce4ec;border-radius:8px;background:#f8fafc;color:#41556b;font-size:.76rem;font-weight:750;letter-spacing:.03em}
.brand-active-control{width:100%;min-height:42px;display:flex;align-items:center;gap:10px;margin:0;padding:7px 11px;border:1px solid #dce4ec;border-radius:9px;background:#f8fafc;cursor:pointer}.brand-active-control input{margin:0}.brand-active-control span{display:flex;flex-direction:column}.brand-active-control strong{color:#334155;font-size:.75rem}.brand-active-control small{margin-top:1px;color:#8a97a6;font-size:.62rem}
.brand-side-link-head{display:flex;align-items:center;gap:8px;color:#334155}.brand-side-link-head>i{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;background:#f1f5f9;color:#53677d}.brand-side-link-head strong{font-size:.78rem}.brand-side-link-head>span{margin-left:auto;min-width:24px;padding:3px 7px;border-radius:999px;background:#eef2f6;color:#526174;font-size:.65rem;text-align:center}.brand-editor-save-card{box-shadow:0 5px 15px rgba(15,23,42,.05)}

@media(max-width:1199.98px){.brand-visual-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.brand-editor-layout{grid-template-columns:1fr}.brand-editor-side{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.brand-editor-side .panel{margin-bottom:0!important}.brand-editor-save-card{grid-column:1/-1}}
@media(max-width:767.98px){.brand-overview-strip{grid-template-columns:1fr}.brand-overview-strip>div,.brand-overview-strip>a{min-height:60px;border-right:0;border-bottom:1px solid #e8edf2}.brand-overview-strip>*:last-child{border-bottom:0}.brand-visual-grid{grid-template-columns:1fr}.brand-visual-card{border-radius:13px}.brand-visual-accent{height:66px}.brand-visual-logo{width:58px;height:58px;margin-top:-29px;border-radius:14px}.brand-live-content{grid-template-columns:64px minmax(0,1fr);padding:0 14px 14px}.brand-live-logo{width:64px;height:64px;margin-top:-16px;border-radius:14px}.brand-live-invoice-logo{grid-column:1/-1;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;text-align:left}.brand-live-invoice-logo>small{margin:0}.brand-live-invoice-logo>div{height:42px}.brand-editor-side{grid-template-columns:1fr}.brand-editor-save-card{grid-column:auto}.brand-upload-box{grid-template-columns:60px minmax(0,1fr)}.brand-upload-thumb{width:60px}}

[data-bs-theme="dark"] .brand-overview-strip,[data-bs-theme="dark"] .brand-visual-card,[data-bs-theme="dark"] .brand-live-preview,[data-bs-theme="dark"] .brand-editor-save-card{background:#17212b!important;border-color:#303d4a!important}
[data-bs-theme="dark"] .brand-overview-strip>div,[data-bs-theme="dark"] .brand-overview-strip>a,[data-bs-theme="dark"] .brand-visual-contact,[data-bs-theme="dark"] .brand-visual-footer,[data-bs-theme="dark"] .brand-editor-section-title{border-color:#2e3a47!important}
[data-bs-theme="dark"] .brand-overview-strip strong,[data-bs-theme="dark"] .brand-visual-title h2,[data-bs-theme="dark"] .brand-live-copy h2,[data-bs-theme="dark"] .brand-editor-section-title strong,[data-bs-theme="dark"] .brand-side-link-head{color:#eef4fa!important}
[data-bs-theme="dark"] .brand-overview-strip>*>i:first-child,[data-bs-theme="dark"] .brand-visual-meta>span,[data-bs-theme="dark"] .brand-visual-assets>div,[data-bs-theme="dark"] .brand-live-tags>span,[data-bs-theme="dark"] .brand-live-invoice-logo>div,[data-bs-theme="dark"] .brand-editor-section-title i,[data-bs-theme="dark"] .brand-upload-thumb,[data-bs-theme="dark"] .brand-color-control>span,[data-bs-theme="dark"] .brand-active-control,[data-bs-theme="dark"] .brand-side-link-head>i{background:#202b36!important;border-color:#34414e!important;color:#cbd5e1!important}
[data-bs-theme="dark"] .brand-visual-logo,[data-bs-theme="dark"] .brand-live-logo,[data-bs-theme="dark"] .brand-invoice-logo-preview{background:#fff!important}

/* v3.5 lead date queue and compact participant discussions */
.lead-filter-header{flex-wrap:nowrap!important;align-items:center!important}.lead-filter-row{display:grid!important;grid-template-columns:minmax(190px,1fr) auto auto auto auto;gap:8px;align-items:center;min-width:0}.compact-table-header .lead-filter-row .table-search-box{width:auto;max-width:none;min-width:190px}.lead-date-field{display:flex;align-items:center;gap:7px;margin:0}.lead-date-field>span{color:#718096;font-size:.68rem;font-weight:750;text-transform:uppercase}.lead-date-field .form-control{width:142px}.lead-filter-row .btn{white-space:nowrap}
.leads-workflow-table tr.lead-overdue-reminder>td{background:#fff1f2!important}.leads-workflow-table tr.lead-overdue-reminder:hover>td{background:#ffe4e6!important}.lead-overdue-label{display:block;margin-top:4px;color:#be123c;font-size:.66rem;font-weight:750}
.lead-reminder-date{display:flex;width:max-content;align-items:center;gap:4px;margin-top:5px;padding:3px 7px;border:1px solid #fecaca;border-radius:999px;background:#fee2e2;color:#b91c1c;font-size:.66rem;font-weight:800;line-height:1.2;white-space:nowrap}
.record-discussion-list{display:grid;gap:12px}.record-discussion-item{display:grid;grid-template-columns:34px minmax(0,1fr);gap:10px}.record-discussion-avatar{width:34px;height:34px;object-fit:cover;border-radius:50%;background:#e2e8f0}.record-discussion-copy{min-width:0}.record-discussion-meta{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin-bottom:3px}.record-discussion-meta strong{font-size:.75rem}.record-discussion-meta small{color:#8795a5;font-size:.65rem}.record-discussion-text{white-space:pre-wrap;overflow-wrap:anywhere;color:#405166;font-size:.76rem;line-height:1.55}.record-discussion-form textarea{min-height:78px;resize:vertical}
@media(max-width:767.98px){.lead-filter-header{align-items:stretch!important;flex-wrap:wrap!important}.lead-filter-row{grid-template-columns:1fr 1fr;width:100%}.compact-table-header .lead-filter-row .table-search-box{grid-column:1/-1;width:100%;min-width:0}.lead-date-field{display:grid;grid-template-columns:1fr;gap:4px}.lead-date-field .form-control{width:100%}.lead-filter-row .btn{width:100%}.lead-filter-header .record-count{margin-left:auto}}
[data-bs-theme="dark"] .leads-workflow-table tr.lead-overdue-reminder>td{background:#3a2028!important}[data-bs-theme="dark"] .leads-workflow-table tr.lead-overdue-reminder:hover>td{background:#47242e!important}[data-bs-theme="dark"] .lead-reminder-date{border-color:#7f1d1d;background:#5f1f27;color:#fecaca}[data-bs-theme="dark"] .record-discussion-text{color:#cbd5e1}
