/* CRM company themes: classic business blue (default) and warm gold.
 * Visual overrides only. Keep FastAdmin markup, events, permissions and layout sizing.
 * This file is loaded in the admin shell and every admin content/dialog iframe.
 */
:root {
  --crm-navy: #142c50;
  --crm-navy-deep: #102643;
  --crm-navy-soft: #203b64;
  --crm-blue: #2563eb;
  --crm-blue-hover: #1d54ce;
  --crm-blue-soft: #eaf2ff;
  --crm-canvas: #f3f6fb;
  --crm-surface: #fff;
  --crm-border: #e1e8f1;
  --crm-heading: #172b49;
  --crm-text: #435671;
  --crm-muted: #74849a;
  --crm-shadow: 0 5px 22px rgba(24, 49, 91, .045);
}

/* Blue keeps its existing values. Gold also switches the sidebar and neutral surfaces. */
:root[data-crm-theme="gold"] {
  --crm-navy: #f2ead9;
  --crm-navy-deep: #e8dcc4;
  --crm-navy-soft: #e4d2ae;
  --crm-blue: #a66c12;
  --crm-blue-hover: #88550b;
  --crm-blue-soft: #f2e5c9;
  --crm-canvas: #f8f6ef;
  --crm-border: #e7ddca;
  --crm-heading: #44351f;
  --crm-text: #665339;
  --crm-muted: #927e60;
  --crm-shadow: 0 5px 22px rgba(92, 64, 20, .045);
  --crm-brand: #b57a18;
  --crm-custom-accent: #a66c12;
  --crm-sidebar-text: #665339;
  --crm-sidebar-strong: #49371d;
  --crm-sidebar-muted: #927e60;
  --crm-sidebar-icon: #a57422;
  --crm-sidebar-active: #dfc99d;
  --crm-sidebar-subactive: #e8d8b9;
  --crm-sidebar-border: #ddceb2;
  --crm-sidebar-panel: #ebe0cb;
  --crm-sidebar-hover: #e6d7b9;
  --crm-secondary-text: #7a684c;
  --crm-body-text: #665339;
  --crm-input-text: #4e3c23;
  --crm-placeholder: #a7967d;
  --crm-soft-surface: #fbf6eb;
  --crm-hover-surface: #faf1df;
  --crm-striped-surface: #fffdf8;
  --crm-disabled-bg: #f5f0e6;
  --crm-disabled-text: #a89980;
  --crm-control-border: #e2d7c1;
  --crm-row-border: #eee6d7;
  --crm-accent-border: #d8bd85;
  --crm-focus: #c99a40;
  --crm-focus-shadow: rgba(181, 122, 24, .13);
  --crm-overlay-shadow: rgba(92, 64, 20, .13);
  --crm-dialog-shadow: rgba(92, 64, 20, .2);
}

body#tabs,
body.inside-header,
body.login-page {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--crm-text);
}

body#tabs,
body#tabs .wrapper,
body#tabs .content-wrapper,
body.inside-header,
body.inside-header #main,
body.inside-header #content {
  background-color: var(--crm-canvas);
}

body#tabs a,
body.inside-header a {
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

body#tabs a:focus-visible,
body.inside-header a:focus-visible,
body.inside-header button:focus-visible,
body.inside-header .btn:focus-visible,
body.inside-header .form-control:focus-visible {
  outline: 2px solid var(--crm-blue);
  outline-offset: 2px;
}

/* Main shell: logo, workspace and permission-driven navigation. */
body#tabs .main-header .logo,
body#tabs .main-header .logo:hover {
  background: var(--crm-navy);
  border-color: var(--crm-sidebar-border, rgba(255, 255, 255, .08));
  color: var(--crm-sidebar-strong, #fff);
  font-weight: 700;
  letter-spacing: .02em;
}

body#tabs .main-header .logo .logo-lg {
  font-size: 17px;
}

body#tabs .main-header .logo .crm-brand-mark {
  display: inline-block;
  width: 30px;
  height: 30px;
  margin-right: 9px;
  border-radius: 7px;
  background: var(--crm-brand, #367cf1);
  color: #fff;
  font-size: 17px;
  line-height: 30px;
  text-align: center;
  vertical-align: middle;
}

body#tabs .main-sidebar,
body#tabs .left-side,
body#tabs .sidebar {
  background: var(--crm-navy);
}

body#tabs .sidebar {
  color: var(--crm-sidebar-text, #d5e1f7);
}

body#tabs .sidebar .user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  height: auto;
  min-height: 80px;
  margin: 16px 10px 12px;
  padding: 10px;
  border: 1px solid var(--crm-sidebar-border, rgba(255, 255, 255, .1));
  border-radius: 9px;
  background: var(--crm-sidebar-panel, rgba(255, 255, 255, .055));
}

body#tabs .sidebar .user-panel::before,
body#tabs .sidebar .user-panel::after {
  display: none;
}

body#tabs .sidebar .user-panel > .image {
  flex: 0 0 40px;
}

body#tabs .sidebar .user-panel > .image > a {
  display: block;
}

body#tabs .sidebar .user-panel .image img {
  display: block;
  width: 40px;
  height: 40px;
  border: 2px solid var(--crm-sidebar-border, rgba(255, 255, 255, .18));
}

body#tabs .sidebar .user-panel > .info {
  position: static;
  flex: 1;
  min-width: 0;
  padding: 0;
  line-height: 18px;
}

body#tabs .sidebar .user-panel > .info > p {
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body#tabs .sidebar .user-panel .info,
body#tabs .sidebar .user-panel .info p {
  color: var(--crm-sidebar-strong, #eef4ff);
}

body#tabs .sidebar .user-panel .info p:first-child {
  font-weight: 600;
}

body#tabs .sidebar .user-panel .info .text-success {
  color: #4bd59a !important;
}

body#tabs .sidebar > form.sidebar-form {
  margin: 0 10px 14px;
  border: 1px solid var(--crm-sidebar-border, rgba(255, 255, 255, .1));
  border-radius: 7px;
  background: var(--crm-sidebar-panel, rgba(255, 255, 255, .07));
}

body#tabs .sidebar > form.sidebar-form:focus-within {
  border-color: var(--crm-sidebar-icon, #79a8f4);
}

body#tabs .sidebar-form > .input-group {
  width: 100%;
}

body#tabs .sidebar-form input[type="text"],
body#tabs .sidebar-form .btn,
body#tabs .sidebar-form input[type="text"]:focus + .input-group-btn {
  background: transparent;
  color: var(--crm-sidebar-text, #d5e1f7);
  border-color: transparent;
}

body#tabs .sidebar-form .menuresult {
  left: -1px;
  right: -1px;
  width: auto !important;
  margin: 0;
  border: 1px solid var(--crm-sidebar-border, rgba(255, 255, 255, .1));
  border-radius: 0 0 7px 7px;
  background: var(--crm-navy);
}

body#tabs .sidebar-form .menuresult a {
  background: var(--crm-navy);
  border-color: var(--crm-sidebar-border, rgba(255, 255, 255, .1));
  color: var(--crm-sidebar-text, #d5e1f7);
}

body#tabs .sidebar-form .menuresult a:hover {
  background: var(--crm-sidebar-hover, rgba(255, 255, 255, .09));
  color: var(--crm-sidebar-strong, #fff);
}

body#tabs .sidebar-form input[type="text"]::placeholder {
  color: var(--crm-sidebar-muted, #a3b7d5);
}

body#tabs .sidebar-menu {
  padding: 0 10px 24px;
}

body#tabs .sidebar-menu > li.header {
  margin: 12px 10px 7px;
  padding: 0;
  background: transparent;
  color: var(--crm-sidebar-muted, #91a7c8);
  font-size: 11px;
  letter-spacing: .07em;
}

body#tabs .sidebar-menu li > a,
body#tabs .sidebar-menu .treeview-menu > li > a {
  border-left: 0;
  border-radius: 7px;
  color: var(--crm-sidebar-text, #d5e1f7);
}

body#tabs .sidebar-menu > li > a {
  margin: 2px 0;
}

body#tabs .sidebar-menu li > a > .fa,
body#tabs .sidebar-menu li > a > .iconfont {
  color: var(--crm-sidebar-icon, #a7bfdf);
}

body#tabs .sidebar-menu li.treeview > a,
body#tabs .sidebar-menu li.treeview.active > a,
body#tabs .sidebar-menu li.treeview.treeview-open > a {
  background: transparent;
  border-left: 0;
}

body#tabs .sidebar-menu > li:hover > a,
body#tabs .sidebar-menu li.treeview:hover > a,
body#tabs .sidebar-menu .treeview-menu > li > a:hover {
  background: var(--crm-sidebar-hover, rgba(255, 255, 255, .09));
  color: var(--crm-sidebar-strong, #fff);
  border-left: 0;
}

body#tabs .sidebar-menu > li.active > a,
body#tabs .sidebar-menu li.treeview.active > a,
body#tabs .sidebar-menu li.treeview.treeview-open > a {
  background: var(--crm-sidebar-active, #315fbd);
  color: var(--crm-sidebar-strong, #fff);
  border-left: 0;
  font-weight: 600;
}

body#tabs .sidebar-menu > li > .treeview-menu,
body#tabs .sidebar-menu .treeview-menu {
  background: transparent;
}

body#tabs .sidebar-menu .treeview-menu > li.active > a {
  background: var(--crm-sidebar-subactive, rgba(68, 128, 241, .23));
  color: var(--crm-sidebar-strong, #fff);
  font-weight: 600;
}

body#tabs .sidebar-menu li.active > a > .fa,
body#tabs .sidebar-menu li.active > a > .iconfont {
  color: var(--crm-sidebar-strong, #fff);
}

body#tabs .sidebar-menu li.treeview.treeview-open:not(.active) > a {
  background: var(--crm-sidebar-panel, rgba(255, 255, 255, .045));
  color: var(--crm-sidebar-text, #d5e1f7);
  font-weight: 500;
}

body#tabs.sidebar-collapse .sidebar-menu li:hover > a,
body#tabs.sidebar-collapse .sidebar-menu li.active > a {
  background: var(--crm-sidebar-active, #315fbd);
  color: var(--crm-sidebar-strong, #fff);
}

body#tabs.sidebar-collapse .sidebar-menu {
  padding-right: 0;
  padding-left: 0;
}

body#tabs.sidebar-collapse .sidebar-menu > li > a {
  border-radius: 0;
}

/* Existing top navigation and multi-tab controls retain their event hooks. */
body#tabs .main-header,
body#tabs .main-header .navbar {
  background: #fff;
  box-shadow: 0 1px 0 var(--crm-border);
}

body#tabs .main-header .navbar .nav > li > a,
body#tabs .main-header .navbar .sidebar-toggle {
  color: var(--crm-secondary-text, #61738e);
}

body#tabs .main-header .navbar .nav > li > a:hover,
body#tabs .main-header .navbar .nav > li.active > a,
body#tabs .main-header .navbar .nav .open > a,
body#tabs .main-header .navbar .sidebar-toggle:hover {
  background: var(--crm-soft-surface, #f2f6fd);
  color: var(--crm-blue);
}

body#tabs #firstnav .nav-addtabs > li.active > a,
body#tabs #secondnav .nav-addtabs > li.active > a {
  color: var(--crm-blue);
  font-weight: 600;
}

body#tabs #secondnav {
  background: #fff;
  border-bottom: 1px solid var(--crm-border);
}

body#tabs #secondnav .nav-addtabs > li {
  border-color: var(--crm-border);
  border-radius: 6px;
  background: var(--crm-surface);
}

body#tabs #secondnav .nav-addtabs > li:has(> .close-tab) {
  padding-right: 28px;
}

body#tabs #secondnav .nav-addtabs > li > a {
  /* The bundled #secondnav rule fixes text to gray with !important. */
  color: var(--crm-text) !important;
  background: transparent;
}

body#tabs #secondnav .nav-addtabs > li:hover {
  border-color: var(--crm-accent-border, #cbdcfa);
  background: var(--crm-soft-surface, #f2f6fd);
}

body#tabs #secondnav .nav-addtabs > li.active {
  background: var(--crm-blue-soft);
  border-color: var(--crm-accent-border, #cbdcfa);
}

body#tabs #secondnav .nav-addtabs > li.active > a,
body#tabs #secondnav .nav-addtabs > li > a:hover,
body#tabs #secondnav .nav-addtabs > li > a:focus {
  color: var(--crm-blue) !important;
  background: transparent;
}

body#tabs #secondnav .nav-addtabs > li > .close-tab {
  right: 5px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 3px;
  line-height: 18px;
  text-align: center;
  color: var(--crm-muted);
}

body#tabs #secondnav .nav-addtabs > li > .close-tab:hover {
  background: var(--crm-blue-soft);
  color: var(--crm-blue);
}

body#tabs .main-header .dropdown-menu,
body.inside-header .dropdown-menu {
  border: 1px solid var(--crm-border);
  border-radius: 8px;
  box-shadow: 0 12px 30px var(--crm-overlay-shadow, rgba(23, 43, 73, .13));
}

body#tabs .main-header .dropdown-menu > li > a:hover,
body.inside-header .dropdown-menu > li > a:hover {
  background: var(--crm-blue-soft);
  color: var(--crm-blue);
}

/* Shared content treatment for all admin modules. */
body.inside-header .content {
  padding: 18px 20px 24px;
}

body.inside-header.is-dialog,
body.inside-header.is-dialog #main,
body.inside-header.is-dialog #content {
  background: #fff;
}

body.inside-header.is-dialog .content {
  padding: 18px 22px;
}

body.inside-header #ribbon {
  background: #fff;
  border-bottom: 1px solid var(--crm-border);
  box-shadow: none;
}

body.inside-header #ribbon .breadcrumb,
body.inside-header #ribbon .breadcrumb a {
  color: var(--crm-muted);
}

body.inside-header #ribbon .breadcrumb li:last-child,
body.inside-header #ribbon .breadcrumb li:last-child a {
  color: var(--crm-heading);
  font-weight: 600;
}

body.inside-header .panel,
body.inside-header .box,
body.inside-header .well,
body.inside-header .nav-tabs-custom {
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  box-shadow: var(--crm-shadow);
}

body.inside-header .panel,
body.inside-header .box,
body.inside-header .nav-tabs-custom {
  background: #fff !important;
}

body.inside-header .panel-intro {
  overflow: visible;
  margin-bottom: 16px;
}

body.inside-header .panel > .panel-heading,
body.inside-header .panel-intro > .panel-heading,
body.inside-header .box > .box-header {
  background: #fff !important;
  border-color: var(--crm-border);
  border-radius: 10px 10px 0 0;
  color: var(--crm-heading);
}

body.inside-header .panel-intro > .panel-heading {
  padding: 0 16px;
  border-bottom: 1px solid var(--crm-border);
}

body.inside-header .panel-intro > .panel-heading > .panel-lead,
body.inside-header .panel-intro > .panel-heading > .panel-title {
  padding-top: 13px;
}

body.inside-header .panel-intro > .panel-heading .panel-lead,
body.inside-header .panel-title,
body.inside-header .box-title,
body.inside-header h1,
body.inside-header h2,
body.inside-header h3 {
  color: var(--crm-heading);
}

body.inside-header .panel-intro > .panel-heading .nav-tabs {
  display: flex;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
}

body.inside-header .panel-intro > .panel-heading .nav-tabs > li {
  float: none;
  flex: none;
}

body.inside-header .panel-intro > .panel-heading .nav-tabs > li > a,
body.inside-header .nav-tabs-custom > .nav-tabs > li > a {
  margin: 0;
  padding: 13px 15px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--crm-muted);
}

body.inside-header .panel-intro > .panel-heading .nav-tabs > li > a:hover,
body.inside-header .nav-tabs-custom > .nav-tabs > li > a:hover {
  background: transparent;
  color: var(--crm-blue);
}

body.inside-header .panel-intro > .panel-heading .nav-tabs > li.active > a,
body.inside-header .panel-intro > .panel-heading .nav-tabs > li.active > a:hover,
body.inside-header .nav-tabs-custom > .nav-tabs > li.active > a {
  border: 0;
  border-bottom: 2px solid var(--crm-blue);
  background: transparent;
  color: var(--crm-blue);
  font-weight: 600;
}

body.inside-header .panel-body,
body.inside-header .box-body {
  background: #fff;
}

body.inside-header .panel-footer,
body.inside-header .box-footer {
  background: var(--crm-soft-surface, #fafcff);
  border-color: var(--crm-border);
  border-radius: 0 0 10px 10px;
}

/* Common search, forms, select widgets and upload controls. */
body.inside-header .form-control,
body.inside-header .select2-container--default .select2-selection--single,
body.inside-header .bootstrap-tagsinput,
body.inside-header .input-group-addon {
  border-color: var(--crm-control-border, #dce5ef);
  border-radius: 6px;
  box-shadow: none;
}

body.inside-header .form-control,
body.inside-header select.form-control {
  background-color: #fff;
  color: var(--crm-input-text, #263951);
}

body.inside-header .form-control::placeholder {
  color: var(--crm-placeholder, #a2afc0);
}

body.inside-header .form-control:focus,
body.inside-header .select2-container--focus .select2-selection,
body.inside-header .select2-container--open .select2-selection {
  border-color: var(--crm-focus, #79a8f4);
  box-shadow: 0 0 0 3px var(--crm-focus-shadow, rgba(37, 99, 235, .1));
}

body.inside-header .form-control[disabled],
body.inside-header .form-control[readonly] {
  background-color: var(--crm-disabled-bg, #f7f9fc);
  color: var(--crm-disabled-text, #8290a4);
}

body.inside-header .control-label,
body.inside-header label {
  color: var(--crm-secondary-text, #52647c);
}

body.inside-header .input-group-addon {
  background: var(--crm-soft-surface, #f8fafd);
  color: var(--crm-secondary-text, #657892);
}

body.inside-header .commonsearch-table,
body.inside-header .common-search-table,
body.inside-header .form-commonsearch {
  background: #fff;
  border-color: var(--crm-border);
}

body.inside-header .form-commonsearch {
  padding: 16px 16px 6px;
  border-bottom: 1px solid var(--crm-border);
}

/* Buttons keep their original click handlers and semantic state classes. */
body.inside-header .btn,
body.inside-header .pagination > li > a,
body.inside-header .pagination > li > span {
  border-radius: 6px;
  box-shadow: none;
  font-weight: 500;
}

body.inside-header .btn-default {
  background: #fff;
  border-color: var(--crm-border);
  color: var(--crm-body-text, #435671);
}

body.inside-header .btn-default:hover,
body.inside-header .btn-default:focus {
  background: var(--crm-hover-surface, #f8fbff);
  border-color: var(--crm-accent-border, #aac2e4);
  color: var(--crm-blue);
}

body.inside-header .btn-primary,
body.inside-header .btn-info {
  background: var(--crm-blue);
  border-color: var(--crm-blue);
  color: #fff;
}

body.inside-header .btn-primary:hover,
body.inside-header .btn-primary:focus,
body.inside-header .btn-info:hover,
body.inside-header .btn-info:focus {
  background: var(--crm-blue-hover);
  border-color: var(--crm-blue-hover);
  color: #fff;
}

body.inside-header .btn-success {
  background: #0f9f84;
  border-color: #0f9f84;
  color: #fff;
}

body.inside-header .btn-warning {
  background: #e69a21;
  border-color: #e69a21;
  color: #fff;
}

body.inside-header .btn-danger {
  background: #e35b62;
  border-color: #e35b62;
  color: #fff;
}

body.inside-header .btn.disabled,
body.inside-header .btn[disabled] {
  opacity: .55;
}

body.inside-header .label-primary,
body.inside-header .badge-primary {
  background: var(--crm-blue);
}

body.inside-header .label-success,
body.inside-header .badge-success {
  background: #159b76;
}

/* Tables, toolbars and pagination across all business modules. */
body.inside-header .toolbar {
  margin-top: 0;
  margin-bottom: 0;
}

body.inside-header .fixed-table-toolbar {
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid var(--crm-border);
}

body.inside-header .fixed-table-toolbar .form-control {
  border-radius: 6px;
}

body.inside-header .fixed-table-container,
body.inside-header .fixed-table-body {
  background: #fff;
}

body.inside-header .table,
body.inside-header .fixed-table-container .table {
  color: var(--crm-text);
}

body.inside-header .table > thead > tr > th,
body.inside-header .fixed-table-container thead th {
  background: var(--crm-soft-surface, #f8fafd);
  border-color: var(--crm-border);
  color: var(--crm-secondary-text, #667991);
  font-weight: 600;
}

body.inside-header .table > tbody > tr > td,
body.inside-header .table > tbody > tr > th {
  border-color: var(--crm-row-border, #edf1f6);
  background: #fff;
}

body.inside-header .table > tbody > tr:hover > td,
body.inside-header .table-striped > tbody > tr:nth-of-type(odd):hover > td {
  background: var(--crm-hover-surface, #f4f8ff);
}

body.inside-header .table-striped > tbody > tr:nth-of-type(odd) > td {
  background: var(--crm-striped-surface, #fcfdff);
}

body.inside-header .fixed-table-container tbody .selected td {
  background: var(--crm-blue-soft, #eaf2ff);
}

body.inside-header .table a,
body.inside-header .fixed-table-container a:not(.btn) {
  color: var(--crm-blue);
}

body.inside-header .table a:hover,
body.inside-header .fixed-table-container a:not(.btn):hover {
  color: var(--crm-blue-hover);
}

body.inside-header .fixed-table-pagination,
body.inside-header .pagination-info {
  color: var(--crm-muted);
}

body.inside-header .pagination > .active > a,
body.inside-header .pagination > .active > span,
body.inside-header .pagination > .active > a:hover,
body.inside-header .pagination > .active > span:hover {
  background: var(--crm-blue) !important;
  border-color: var(--crm-blue) !important;
  color: #fff;
}

body.inside-header .pagination > li > a,
body.inside-header .pagination > li > span {
  border-color: var(--crm-border);
  color: var(--crm-secondary-text, #62738c);
}

/* Customer list: keep page controls visible and separate from the wide table. */
body.inside-header .crm-customer-list .fixed-table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 12px 16px;
  border-top: 1px solid var(--crm-border);
  background: #fff;
}

body.inside-header .crm-customer-list .fixed-table-pagination .pagination-detail,
body.inside-header .crm-customer-list .fixed-table-pagination div.pagination {
  float: none !important;
  margin: 0;
}

body.inside-header .crm-customer-list .fixed-table-pagination .pagination-info {
  color: var(--crm-muted);
  font-size: 12px;
}

body.inside-header .crm-customer-list .fixed-table-pagination .page-list .btn {
  border-color: var(--crm-border);
  border-radius: 5px;
  background: #fff;
  color: var(--crm-heading);
  box-shadow: none;
}

body.inside-header .crm-customer-list .fixed-table-pagination .pagination {
  display: flex;
  gap: 5px;
}

body.inside-header .crm-customer-list .fixed-table-pagination .pagination > li > a,
body.inside-header .crm-customer-list .fixed-table-pagination .pagination > li > span {
  min-width: 32px;
  height: 32px;
  padding: 5px 9px;
  border: 1px solid var(--crm-border);
  border-radius: 5px;
  background: #fff;
  color: var(--crm-secondary-text, #62738c);
  text-align: center;
  font-size: 12px;
  line-height: 20px;
}

body.inside-header .crm-customer-list .fixed-table-pagination .pagination > li > a:hover {
  border-color: var(--crm-accent-border, #b7cfff);
  background: var(--crm-hover-surface, #f3f7ff);
  color: var(--crm-blue);
}

body.inside-header .crm-customer-list .fixed-table-pagination .pagination > li.disabled > a {
  background: var(--crm-soft-surface, #f8fafd);
  color: var(--crm-disabled-text, #b7c3d4);
}

body.inside-header .crm-customer-list .fixed-table-container a.searchit[data-field="contract_status"] {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--crm-soft-surface, #eef4fc);
  color: var(--crm-secondary-text, #5878a5) !important;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

body.inside-header .crm-customer-list .fixed-table-container a.searchit[data-field="contract_status"][data-value="1"] {
  background: #e8f7f1;
  color: #168666 !important;
}

body.inside-header .crm-customer-list .fixed-table-container a.searchit[data-field="contract_status"] > span {
  color: inherit !important;
}

body.inside-header .crm-customer-list .fixed-table-container a.searchit[data-field="contract_status"] .fa-circle {
  margin-right: 3px;
  font-size: 7px;
}

/* Layer dialogs are rendered in the parent document; iframe form fields use the rules above. */
body#tabs .layui-layer-fast,
body.inside-header .layui-layer-fast,
body#tabs .modal-content,
body.inside-header .modal-content {
  border: 1px solid var(--crm-border);
  border-radius: 10px;
  box-shadow: 0 18px 48px var(--crm-dialog-shadow, rgba(20, 44, 80, .2)) !important;
  overflow: hidden;
}

body#tabs .layui-layer-fast .layui-layer-title,
body.inside-header .layui-layer-fast .layui-layer-title,
body#tabs .modal-header,
body.inside-header .modal-header {
  background: var(--crm-soft-surface, #f7faff) !important;
  border-bottom: 1px solid var(--crm-border);
  color: var(--crm-heading) !important;
  font-weight: 600;
}

body#tabs .layui-layer-fast .layui-layer-title,
body.inside-header .layui-layer-fast .layui-layer-title {
  height: 48px;
  line-height: 48px;
}

body#tabs .layui-layer-fast .layui-layer-setwin > a:after,
body.inside-header .layui-layer-fast .layui-layer-setwin > a:after {
  color: var(--crm-secondary-text, #7386a2) !important;
}

body#tabs .layui-layer-fast .layui-layer-footer,
body.inside-header .layui-layer-fast .layui-layer-footer,
body#tabs .layui-layer-fast .layui-layer-btn,
body.inside-header .layui-layer-fast .layui-layer-btn,
body#tabs .modal-footer,
body.inside-header .modal-footer {
  background: #fff !important;
  border-top: 1px solid var(--crm-border);
}

body#tabs .layui-layer-fast .layui-layer-btn .layui-layer-btn0,
body.inside-header .layui-layer-fast .layui-layer-btn .layui-layer-btn0 {
  background: var(--crm-blue) !important;
  border-color: var(--crm-blue) !important;
}

/* Customer add/edit: keep reset available at left; match the selected mockup's
 * cancel/save treatment at right. Fast.api.layerfooter forwards these clicks.
 */
body.inside-header .crm-customer-actions,
.layui-layer-fast .layui-layer-footer .crm-customer-actions {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.inside-header .crm-customer-primary-actions,
.layui-layer-fast .layui-layer-footer .crm-customer-primary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.layui-layer-fast .layui-layer-footer:has(.crm-customer-actions) {
  min-height: 64px;
  padding: 13px 20px !important;
  border-top: 1px solid var(--crm-border);
  background: #fff !important;
  text-align: right !important;
}

.layui-layer-fast .layui-layer-footer:has(.crm-customer-actions) > .row {
  width: 100%;
  margin: 0;
}

body.inside-header .crm-customer-actions .btn,
.layui-layer-fast .layui-layer-footer .crm-customer-actions .btn {
  min-height: 36px;
  margin: 0 !important;
  padding: 0 13px;
  border-radius: 6px;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 34px;
}

body.inside-header .crm-customer-actions .crm-customer-reset,
.layui-layer-fast .layui-layer-footer .crm-customer-actions .crm-customer-reset {
  min-width: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--crm-placeholder, #8a9ab0);
  font-size: 12px;
  font-weight: 400;
}

body.inside-header .crm-customer-actions .crm-customer-reset:hover,
.layui-layer-fast .layui-layer-footer .crm-customer-actions .crm-customer-reset:hover {
  background: transparent;
  color: var(--crm-blue);
  text-decoration: underline;
}

body.inside-header .crm-customer-actions .crm-customer-cancel,
.layui-layer-fast .layui-layer-footer .crm-customer-actions .crm-customer-cancel {
  min-width: 54px;
  border: 1px solid var(--crm-control-border, #dce5ef);
  background: #fff;
  color: var(--crm-body-text, #435671);
}

body.inside-header .crm-customer-actions .crm-customer-cancel:hover,
.layui-layer-fast .layui-layer-footer .crm-customer-actions .crm-customer-cancel:hover {
  border-color: var(--crm-accent-border, #aac2e4);
  background: var(--crm-hover-surface, #f8fbff);
  color: var(--crm-blue);
}

body.inside-header .crm-customer-actions .crm-customer-submit,
.layui-layer-fast .layui-layer-footer .crm-customer-actions .crm-customer-submit {
  min-width: 78px;
  border: 1px solid var(--crm-blue);
  background: var(--crm-blue);
  color: #fff;
}

body.inside-header .crm-customer-actions .crm-customer-submit:hover,
.layui-layer-fast .layui-layer-footer .crm-customer-actions .crm-customer-submit:hover {
  border-color: var(--crm-blue-hover);
  background: var(--crm-blue-hover);
  color: #fff;
}

/* Login shares the same palette; the existing form and authentication remain intact. */
body.login-page {
  background: linear-gradient(135deg, #edf4ff 0%, #f3f6fb 62%, #e3edfb 100%) !important;
}

body.login-page .container {
  background: linear-gradient(135deg, #edf4ff 0%, #f3f6fb 62%, #e3edfb 100%) !important;
}

body.login-page .login-top-tip {
  color: var(--crm-navy);
}

body.login-page .login-screen .well {
  border: 1px solid var(--crm-border);
  border-radius: 12px;
  box-shadow: 0 20px 55px rgba(24, 49, 91, .13);
}

body.login-page .login-title {
  color: var(--crm-heading);
}

body.login-page #login-form .form-control:focus {
  border-color: var(--crm-focus, #79a8f4);
  box-shadow: 0 0 0 3px var(--crm-focus-shadow, rgba(37, 99, 235, .1));
}

body.login-page #login-form button[type="submit"] {
  background: var(--crm-blue) !important;
  border-color: var(--crm-blue) !important;
  border-radius: 6px;
}

body.login-page #login-form button[type="submit"]:hover {
  background: var(--crm-blue-hover) !important;
  border-color: var(--crm-blue-hover) !important;
}

body.login-page > div:last-of-type,
body.login-page > div:last-of-type a {
  color: var(--crm-secondary-text, #72839b) !important;
}

/* The standalone Vue field editor does not use the FastAdmin layout. */
body.crm-form-builder {
  background: var(--crm-canvas) !important;
  color: var(--crm-text);
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.crm-form-builder .el-card,
body.crm-form-builder .el-dialog,
body.crm-form-builder .el-tabs--border-card {
  border: 1px solid var(--crm-border) !important;
  border-radius: 10px !important;
  box-shadow: var(--crm-shadow) !important;
}

body.crm-form-builder .el-card__header,
body.crm-form-builder .el-dialog__header,
body.crm-form-builder .el-tabs--border-card > .el-tabs__header {
  background: var(--crm-soft-surface, #f8fafd) !important;
  border-color: var(--crm-border) !important;
  color: var(--crm-heading) !important;
}

body.crm-form-builder .el-input__inner,
body.crm-form-builder .el-textarea__inner {
  border-color: var(--crm-control-border, #dce5ef) !important;
  border-radius: 6px !important;
}

body.crm-form-builder .el-input__inner:focus,
body.crm-form-builder .el-textarea__inner:focus {
  border-color: var(--crm-focus, #79a8f4) !important;
  box-shadow: 0 0 0 3px var(--crm-focus-shadow, rgba(37, 99, 235, .1));
}

body.crm-form-builder .el-button {
  border-radius: 6px !important;
}

body.crm-form-builder .el-button--primary,
body.crm-form-builder .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  background: var(--crm-blue) !important;
  border-color: var(--crm-blue) !important;
  color: #fff !important;
}

body.crm-form-builder .el-tabs__item.is-active,
body.crm-form-builder .el-tabs__item:hover,
body.crm-form-builder .el-form-item__label a {
  color: var(--crm-blue) !important;
}

/* Company settings: two explicit choices; inheritance is preserved until a choice is clicked. */
.crm-theme-options label {
  margin-right: 20px;
}

.crm-theme-swatch {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin: 0 6px 0 2px;
  border-radius: 3px;
  vertical-align: -2px;
}

.crm-theme-swatch-blue {
  background: #2563eb;
}

.crm-theme-swatch-gold {
  background: #b57a18;
}

/* Shared widgets otherwise retain their Bootstrap / plugin blue. Status colors stay semantic. */
html[data-crm-theme="gold"] :where(body.inside-header a:not(.btn):not(.label):not(.badge)),
html[data-crm-theme="gold"] body.inside-header .text-primary,
html[data-crm-theme="gold"] body.inside-header .btn-link,
html[data-crm-theme="gold"] .el-tabs__item.is-active,
html[data-crm-theme="gold"] .el-tabs__item:hover,
html[data-crm-theme="gold"] .el-select-dropdown__item.selected,
html[data-crm-theme="gold"] .el-button--text,
html[data-crm-theme="gold"] .el-pager li.active,
html[data-crm-theme="gold"] .el-checkbox__input.is-checked + .el-checkbox__label,
html[data-crm-theme="gold"] .el-radio__input.is-checked + .el-radio__label {
  color: var(--crm-blue);
}
html[data-crm-theme="gold"] input[type="radio"],
html[data-crm-theme="gold"] input[type="checkbox"] {
  accent-color: var(--crm-blue);
}

html[data-crm-theme="gold"] .dropdown-menu > .active > a,
html[data-crm-theme="gold"] .nav-pills > li.active > a,
html[data-crm-theme="gold"] .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-crm-theme="gold"] .datepicker table tr td.active,
html[data-crm-theme="gold"] .bootstrap-datetimepicker-widget table td.active,
html[data-crm-theme="gold"] .bootstrap-datetimepicker-widget table td span.active,
html[data-crm-theme="gold"] .daterangepicker td.active,
html[data-crm-theme="gold"] .daterangepicker .ranges li.active,
html[data-crm-theme="gold"] .sp-results .sp-over,
html[data-crm-theme="gold"] .sp-results .sp-selected,
html[data-crm-theme="gold"] .progress-bar-primary,
html[data-crm-theme="gold"] .bg-primary,
html[data-crm-theme="gold"] .bg-blue,
html[data-crm-theme="gold"] .bg-aqua,
html[data-crm-theme="gold"] .el-button--primary,
html[data-crm-theme="gold"] .el-tabs__active-bar,
html[data-crm-theme="gold"] .el-switch.is-checked .el-switch__core,
html[data-crm-theme="gold"] .el-radio-button__orig-radio:checked + .el-radio-button__inner,
html[data-crm-theme="gold"] .el-checkbox__input.is-checked .el-checkbox__inner,
html[data-crm-theme="gold"] .el-radio__input.is-checked .el-radio__inner {
  background: var(--crm-blue) !important;
  border-color: var(--crm-blue) !important;
  color: #fff;
}
html[data-crm-theme="gold"] .el-input__inner:focus,
html[data-crm-theme="gold"] .el-textarea__inner:focus,
html[data-crm-theme="gold"] .el-select .el-input.is-focus .el-input__inner {
  border-color: var(--crm-focus);
}

html[data-crm-theme="gold"] .el-button--primary:hover {
  background: var(--crm-blue-hover) !important;
  border-color: var(--crm-blue-hover) !important;
}
html[data-crm-theme="gold"] .daterangepicker td.in-range,
html[data-crm-theme="gold"] body.inside-header .fixed-table-container .table > tbody > tr.selected > td {
  background: var(--crm-blue-soft);
}

html[data-crm-theme="gold"] body.inside-header .pagination > .active > a,
html[data-crm-theme="gold"] body.inside-header .pagination > .active > span {
  color: #fff;
}

html[data-crm-theme="gold"] .bootstrap-datetimepicker-widget table td.today:before {
  border-bottom-color: var(--crm-blue);
}

html[data-crm-theme="gold"] .nav-tabs > li.active > a,
html[data-crm-theme="gold"] .nav-tabs > li.active > a:hover,
html[data-crm-theme="gold"] .nav-tabs > li.active > a:focus {
  border-top-color: var(--crm-blue);
}

@media (min-width: 768px) {
  body#tabs.sidebar-collapse .sidebar .user-panel {
    justify-content: center;
    min-height: 0;
    margin: 12px 5px;
    padding: 6px 0;
    border: 0;
    background: transparent;
  }

  body#tabs.sidebar-collapse .sidebar .user-panel > .image {
    flex-basis: 30px;
  }

  body#tabs.sidebar-collapse .sidebar .user-panel .image img {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 767px) {
  body#tabs .main-header .logo {
    background: var(--crm-navy);
  }

  body#tabs .main-header .navbar {
    background: #fff;
  }

  body#tabs .main-header .navbar .nav > li > a,
  body#tabs .main-header .navbar .sidebar-toggle {
    color: var(--crm-secondary-text, #61738e);
  }

  body#tabs .sidebar-menu {
    padding-left: 8px;
    padding-right: 8px;
  }

  body.inside-header .content {
    padding: 12px;
  }

  body.inside-header .panel-intro > .panel-heading {
    padding: 0 10px;
  }

  body.inside-header .fixed-table-toolbar {
    padding: 10px;
  }
}
