/*
 * CorrectWork CRM — admin UI theme
 * ------------------------------------------------------------------
 * Design reference: crm-lead-pipeline-mockup.html
 *   Work Sans · ink #141413 · gold #c9a84c · warm neutral lines #e2ded0
 *   10px cards · pill badges · small uppercase table headers
 *
 * Perfex loads this file automatically after style.css (see
 * application/helpers/assets_helper.php), so everything here is a
 * presentation-only override layer. Rules restyle existing classes and
 * ids only: no element is hidden, re-ordered or resized in a way that
 * JavaScript depends on (sidebar stays 230px, header stays 57px).
 */

@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@400;500;600;700&display=swap");

/* ==================================================================
   1. Design tokens
   ================================================================== */
:root {
  --cw-font: "Work Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cw-font-display: var(--cw-font);

  --cw-ink: #141413;
  --cw-ink-hover: #000000;
  --cw-text: #26251f;
  --cw-text-2: #3a3a36;
  --cw-muted: #6b6b64;
  --cw-subtle: #8a8880;
  --cw-faint: #c2beae;

  --cw-bg: #f4f3ee;
  --cw-surface: #ffffff;
  --cw-surface-2: #faf8f2;
  --cw-surface-3: #f4f3ee;
  --cw-line: #e7e5da;
  --cw-line-2: #e2ded0;
  --cw-line-input: #d8d4c6;
  --cw-row-line: #efede6;

  --cw-gold: #c9a84c;
  --cw-gold-dark: #a8711c;
  --cw-gold-bg: #fbf7ec;
  --cw-gold-ring: rgba(201, 168, 76, 0.28);

  --cw-blue: #2f5fc4;
  --cw-blue-bright: #2f6fed;
  --cw-blue-bg: #eaf1ff;
  --cw-green: #2f8a4e;
  --cw-green-bg: #eafaf0;
  --cw-amber: #a8711c;
  --cw-amber-bg: #fdf2e3;
  --cw-violet: #6b4fc4;
  --cw-violet-bg: #f1eefe;
  --cw-red: #b6543c;
  --cw-red-bright: #e64b3c;
  --cw-red-bg: #faeae6;
  --cw-grey-bg: #eef0ee;

  --cw-radius-sm: 6px;
  --cw-radius: 10px;
  --cw-radius-lg: 14px;
  --cw-pill: 20px;

  --cw-shadow-xs: 0 1px 2px rgba(20, 20, 19, 0.04);
  --cw-shadow-sm: 0 1px 3px rgba(20, 20, 19, 0.06);
  --cw-shadow-md: 0 8px 24px rgba(20, 20, 19, 0.08);
  --cw-shadow-lg: 0 18px 48px rgba(20, 20, 19, 0.16);
}

/* ==================================================================
   2. Base
   ================================================================== */
body,
body.login_admin,
.tooltip,
.popover {
  font-family: var(--cw-font);
}

body {
  background: var(--cw-bg);
  color: var(--cw-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--cw-font);
  color: var(--cw-ink);
}

a {
  color: var(--cw-blue);
}

a:hover,
a:focus {
  color: #234a9c;
}

::selection {
  background: var(--cw-gold-ring);
  color: var(--cw-ink);
}

hr {
  border-top-color: var(--cw-line);
}

.text-muted {
  color: var(--cw-subtle);
}

.text-success { color: var(--cw-green); }
.text-danger  { color: var(--cw-red); }
.text-warning { color: var(--cw-amber); }
.text-info    { color: var(--cw-blue); }
.text-primary { color: var(--cw-ink); }

.bg-success { background-color: var(--cw-green-bg); }
.bg-danger  { background-color: var(--cw-red-bg); }
.bg-warning { background-color: var(--cw-amber-bg); }
.bg-info    { background-color: var(--cw-blue-bg); }

/* Thin, warm scrollbars (WebKit + Firefox). */
* {
  scrollbar-color: #d3cfc1 transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: #d3cfc1;
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #b9b4a3;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* ==================================================================
   3. Tailwind palette remap
   The compiled tailwind.css hard-codes Tailwind blue as "primary" and
   cool gray as "neutral". Re-point the most used utilities to the
   CorrectWork palette so every view picks it up without markup edits.
   ================================================================== */
.tw-bg-primary-50  { background-color: var(--cw-gold-bg) !important; }
.tw-bg-primary-100 { background-color: #f6efd9 !important; }
.tw-bg-primary-500,
.tw-bg-primary-600 { background-color: var(--cw-ink) !important; }
.tw-bg-primary-700,
.tw-bg-primary-800 { background-color: var(--cw-ink-hover) !important; }
.hover\:tw-bg-primary-700:hover,
.group:hover .group-hover\:\!tw-bg-primary-700 { background-color: var(--cw-ink-hover) !important; }

.tw-text-primary-500,
.tw-text-primary-600,
.tw-text-primary-700 { color: var(--cw-blue) !important; }
.hover\:tw-text-primary-700:hover,
.hover\:tw-text-primary-800:hover { color: #234a9c !important; }

.tw-border-primary-200,
.tw-border-primary-300 { border-color: #ecdcae !important; }
.tw-border-primary-500,
.tw-border-primary-600 { border-color: var(--cw-ink) !important; }

.tw-bg-neutral-50  { background-color: var(--cw-surface-2); }
.tw-bg-neutral-100 { background-color: var(--cw-surface-3); }
.tw-bg-neutral-200 { background-color: #ebe9e1; }

.tw-text-neutral-900,
.tw-text-neutral-800 { color: var(--cw-ink); }
.tw-text-neutral-700 { color: var(--cw-text); }
.tw-text-neutral-600 { color: var(--cw-text-2); }
.tw-text-neutral-500 { color: var(--cw-muted); }
.tw-text-neutral-400 { color: var(--cw-subtle); }

.tw-border-neutral-100,
.tw-border-neutral-200 { border-color: var(--cw-line); }
.tw-border-neutral-300 { border-color: var(--cw-line-2); }

.tw-bg-success-50 { background-color: var(--cw-green-bg); }
.tw-text-success-600,
.tw-text-success-700 { color: var(--cw-green); }
.tw-bg-danger-50 { background-color: var(--cw-red-bg); }
.tw-text-danger-500,
.tw-text-danger-600,
.tw-text-danger-700 { color: var(--cw-red); }
.tw-bg-warning-50 { background-color: var(--cw-amber-bg); }
.tw-text-warning-600,
.tw-text-warning-700 { color: var(--cw-amber); }

/* ==================================================================
   4. App shell — header
   ================================================================== */
#header {
  background: var(--cw-surface);
  box-shadow: none;
  border-bottom: 1px solid var(--cw-line);
}

#header .hide-menu {
  color: var(--cw-muted);
}

#header .hide-menu:hover {
  color: var(--cw-ink);
  background: var(--cw-surface-3);
}

#logo .logo-text {
  color: var(--cw-ink);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 15px !important;
}

#top_search #search_input {
  background: var(--cw-surface-3) !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  color: var(--cw-ink);
  font-size: 13px;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

#top_search #search_input:hover {
  border-color: var(--cw-line-2) !important;
}

#top_search #search_input:focus {
  background: var(--cw-surface) !important;
  border-color: var(--cw-gold) !important;
  box-shadow: 0 0 0 3px var(--cw-gold-ring) !important;
}

#top_search #search_input::placeholder {
  color: var(--cw-subtle) !important;
}

#header .navbar-nav > li > a {
  color: var(--cw-muted);
}

#header .navbar-nav > li > a:hover,
#header .navbar-nav > li > a:focus {
  color: var(--cw-ink);
  background: transparent;
}

#header li > a.active {
  background: var(--cw-surface-3);
}

/* Notification / timer counters → red flag pill from the mockup. */
.icon-notifications,
.icon-total-indicator,
#header .badge,
.notifications-wrapper .icon-notifications {
  background: var(--cw-red-bright) !important;
  color: #fff !important;
  border: 2px solid #fff;
  font-weight: 700;
  font-family: var(--cw-font) !important;
}

/* ==================================================================
   5. App shell — sidebar
   ================================================================== */
.sidebar {
  background: var(--cw-surface);
  border-right: 1px solid var(--cw-line);
}

[dir="rtl"] .sidebar {
  border-left: 1px solid var(--cw-line);
}

.sidebar-user-profile .profile {
  background: var(--cw-surface-2) !important;
  border-color: var(--cw-line) !important;
  border-radius: var(--cw-radius) !important;
  box-shadow: none !important;
  color: var(--cw-ink) !important;
}

.sidebar-user-profile .profile:hover,
.sidebar-user-profile .profile:focus,
.sidebar-user-profile.open .profile {
  background: var(--cw-surface-3) !important;
  border-color: var(--cw-line-2) !important;
}

.sidebar-user-profile .profile .tw-text-sm {
  color: var(--cw-subtle) !important;
}

.sidebar ul.nav li a {
  color: var(--cw-text-2);
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar ul.nav li a i.menu-icon {
  font-size: 15px;
  color: var(--cw-subtle);
  margin-top: 1px;
}

/* Top-level hover / active: soft warm fill with a gold rail, no card shadow. */
.sidebar > ul.nav > li:hover a:first-child,
.sidebar > ul.nav > li.active a:first-child {
  background: var(--cw-surface-3);
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
}

.sidebar > ul.nav > li.active {
  border-left-color: var(--cw-gold);
}

[dir="rtl"] .sidebar > ul.nav > li.active {
  border-right-color: var(--cw-gold);
}

.sidebar ul.nav li.active > a,
.sidebar ul.nav > li > a:hover,
.sidebar ul.nav > li > a:focus {
  color: var(--cw-ink);
}

.sidebar ul.nav li.active > a .menu-icon,
.sidebar ul.nav > li > a:hover .menu-icon,
.sidebar ul.nav > li > a:focus .menu-icon {
  color: var(--cw-gold-dark);
}

.sidebar > ul.nav > li.active > a {
  font-weight: 700;
}

/* Second level */
.sidebar ul.nav li .nav-second-level li a {
  color: var(--cw-muted);
  font-size: 12.5px;
  font-weight: 500;
}

.sidebar ul.nav > li .nav-second-level > li:not(.active) > a:hover,
.sidebar ul.nav > li .nav-second-level > li:not(.active) > a:focus {
  color: var(--cw-ink);
}

.sidebar ul.nav li .nav-second-level li.active a {
  color: var(--cw-ink);
  font-weight: 700;
}

.sidebar ul.nav > li .nav-second-level a .menu-icon {
  color: var(--cw-faint);
}

/* Document trees (Contracts) keep their structure; only the palette changes. */
.sidebar ul.nav li.menu-tree ul.nav li > a:hover,
.sidebar ul.nav li.menu-tree ul.nav li > a:focus {
  color: var(--cw-ink) !important;
  background: var(--cw-surface-3) !important;
}

.sidebar ul.nav li.menu-tree ul.nav li.menu-tree-doc.active > a {
  color: var(--cw-ink) !important;
}

.sidebar ul.nav li.menu-tree .tree-icon {
  color: var(--cw-subtle);
}

.sidebar ul.nav li.menu-tree ul.nav li > a:hover > .tree-icon,
.sidebar ul.nav li.menu-tree ul.nav li > a:focus > .tree-icon,
.sidebar ul.nav li.menu-tree li.menu-tree-folder.active > a > .tree-icon {
  color: var(--cw-gold-dark);
}

/* "2 new" style counters in the menu. */
#side-menu .badge,
.sidebar .menu-badge {
  background: var(--cw-red-bright);
  color: #fff;
  border-radius: var(--cw-pill);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
}

.sidebar .arrow,
.sidebar .fa.arrow {
  color: var(--cw-faint);
}

/* Setup / customizer menu */
#setup-menu-wrapper {
  background: var(--cw-surface);
  border-right: 1px solid var(--cw-line);
  box-shadow: var(--cw-shadow-lg);
}

#setup-menu-wrapper .customizer-heading {
  color: var(--cw-ink);
  font-weight: 700;
}

#setup-menu > li > a {
  color: var(--cw-text-2);
  font-weight: 500;
  border-radius: 8px;
}

#setup-menu > li > a:hover,
#setup-menu > li.active > a {
  background: var(--cw-surface-3);
  color: var(--cw-ink);
}

/* ==================================================================
   6. Page canvas & headings
   ================================================================== */
#wrapper {
  background: var(--cw-bg);
}

.content {
  padding: 26px 32px;
}

/* Page title row (most Perfex list pages start with an h4 above the panel). */
.content h4.tw-font-semibold,
.content h4.tw-font-bold,
.content .tw-text-lg.tw-font-semibold {
  color: var(--cw-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.content > .row > [class*="col-"] > h4.tw-text-lg:first-child,
.content > .row > [class*="col-"] > .tw-mb-2 > h4.tw-text-lg {
  font-size: 21px;
}

/* Eyebrow label (mockup ".eyebrow"), available to any view. */
.cw-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cw-gold);
  font-weight: 600;
  margin-bottom: 4px;
}

.cw-subtitle {
  font-size: 12.5px;
  color: var(--cw-muted);
  margin: 0 0 18px;
}

/* ==================================================================
   7. Panels / cards
   ================================================================== */
.panel_s,
.panel {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow-xs);
}

.panel_s > .panel-body,
.panel > .panel-body {
  border-radius: var(--cw-radius);
  background: transparent;
}

.panel_s .panel-heading,
.panel .panel-heading,
.panel-default > .panel-heading {
  background: var(--cw-surface-2);
  border-bottom: 1px solid var(--cw-line);
  border-radius: var(--cw-radius) var(--cw-radius) 0 0;
  color: var(--cw-ink);
  font-weight: 600;
}

.panel-heading + .panel-body {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.panel-footer {
  background: var(--cw-surface-2);
  border-top: 1px solid var(--cw-line);
  border-radius: 0 0 var(--cw-radius) var(--cw-radius);
}

.panel-title {
  color: var(--cw-ink);
  font-weight: 600;
}

/* Panel group (accordions) */
.panel-group .panel {
  border-radius: var(--cw-radius);
}

.panel-group .panel + .panel {
  margin-top: 8px;
}

.well {
  background: var(--cw-surface-2);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: none;
}

/* Section label inside a card (mockup ".panel-title" on dash panels). */
.cw-card-label {
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cw-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

/* ==================================================================
   8. Buttons
   ================================================================== */
.btn {
  font-family: var(--cw-font);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--cw-radius-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.btn:focus,
.btn.focus,
.btn:active:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--cw-gold-ring);
}

.btn-primary,
.btn-info.btn-primary {
  background-color: var(--cw-ink);
  border-color: var(--cw-ink);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary,
.btn-primary:active:hover,
.btn-primary:active:focus {
  background-color: var(--cw-ink-hover);
  border-color: var(--cw-ink-hover);
  color: #fff;
}

.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary {
  background-color: #5c5b55;
  border-color: #5c5b55;
}

.btn-default {
  background-color: var(--cw-surface);
  border-color: var(--cw-line-input);
  color: var(--cw-text-2);
}

.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active,
.open > .dropdown-toggle.btn-default {
  background-color: var(--cw-surface-2);
  border-color: #c7c2b3;
  color: var(--cw-ink);
}

.btn-success {
  background-color: var(--cw-green);
  border-color: var(--cw-green);
  color: #fff;
}

.btn-success:hover,
.btn-success:focus,
.btn-success:active,
.open > .dropdown-toggle.btn-success {
  background-color: #26733f;
  border-color: #26733f;
  color: #fff;
}

.btn-info {
  background-color: var(--cw-blue-bright);
  border-color: var(--cw-blue-bright);
  color: #fff;
}

.btn-info:hover,
.btn-info:focus,
.btn-info:active,
.open > .dropdown-toggle.btn-info {
  background-color: #1f5ad4;
  border-color: #1f5ad4;
  color: #fff;
}

.btn-warning {
  background-color: var(--cw-gold);
  border-color: var(--cw-gold);
  color: var(--cw-ink);
}

.btn-warning:hover,
.btn-warning:focus,
.btn-warning:active,
.open > .dropdown-toggle.btn-warning {
  background-color: #b8963b;
  border-color: #b8963b;
  color: var(--cw-ink);
}

.btn-danger {
  background-color: var(--cw-red-bright);
  border-color: var(--cw-red-bright);
  color: #fff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.open > .dropdown-toggle.btn-danger {
  background-color: #c93d2f;
  border-color: #c93d2f;
  color: #fff;
}

.btn-link {
  color: var(--cw-blue);
  font-weight: 600;
}

.btn-link:hover,
.btn-link:focus {
  color: #234a9c;
}

.btn-xs,
.btn-group-xs > .btn {
  border-radius: 5px;
  font-size: 11.5px;
}

.btn-sm,
.btn-group-sm > .btn {
  font-size: 12px;
}

/* Square icon buttons in table rows (mockup ".crm-icon"/".icon-btn"). */
.btn-icon {
  border-radius: var(--cw-radius-sm);
}

/* Outline variants used by the CorrectWork views. */
.btn-outline-primary,
.btn-outline-dark {
  background: transparent;
  border: 1.5px solid var(--cw-ink);
  color: var(--cw-ink);
}

.btn-outline-primary:hover,
.btn-outline-dark:hover {
  background: var(--cw-ink);
  color: #fff;
}

/* Sticky save bar at the bottom of long forms. */
.btn-bottom-toolbar {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--cw-line);
  box-shadow: 0 -6px 20px rgba(20, 20, 19, 0.05);
  backdrop-filter: blur(6px);
}

/* ==================================================================
   9. Forms
   ================================================================== */
.form-control,
input[type="text"].form-control,
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select.form-control,
textarea.form-control {
  font-family: var(--cw-font);
  background-color: var(--cw-surface);
  border-color: var(--cw-line-input);
  border-radius: var(--cw-radius-sm);
  color: var(--cw-ink);
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:hover {
  border-color: #c7c2b3;
}

.form-control:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
select.form-control:focus,
textarea.form-control:focus {
  border-color: var(--cw-gold);
  box-shadow: 0 0 0 3px var(--cw-gold-ring);
  outline: none;
}

.form-control::placeholder {
  color: #a9a598;
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
  background-color: var(--cw-surface-3);
  color: var(--cw-muted);
}

.control-label,
label {
  color: var(--cw-text-2);
  font-weight: 600;
  font-size: 12.5px;
}

.checkbox label,
.radio label,
.checkbox-inline,
.radio-inline {
  font-weight: 400;
  font-size: 13px;
}

.help-block {
  color: var(--cw-subtle);
  font-size: 12px;
}

.has-error .form-control {
  border-color: var(--cw-red-bright);
}

.has-error .form-control:focus {
  box-shadow: 0 0 0 3px rgba(230, 75, 60, 0.18);
}

.has-error .help-block,
.has-error .control-label,
label.error,
p.text-danger {
  color: var(--cw-red);
}

.input-group-addon {
  background: var(--cw-surface-3);
  border-color: var(--cw-line-input);
  color: var(--cw-muted);
  border-radius: var(--cw-radius-sm);
}

.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Checkboxes / radios (awesome-bootstrap-checkbox) */
.checkbox label::before,
.radio label::before {
  border-color: var(--cw-line-input);
  border-radius: 4px;
}

.radio label::before {
  border-radius: 50%;
}

.checkbox input[type="checkbox"]:checked + label::before,
.checkbox input[type="radio"]:checked + label::before,
.checkbox-primary input[type="checkbox"]:checked + label::before {
  background-color: var(--cw-ink);
  border-color: var(--cw-ink);
}

.checkbox input[type="checkbox"]:checked + label::after {
  color: #fff;
}

.radio input[type="radio"]:checked + label::before {
  border-color: var(--cw-ink);
}

.radio label::after,
.radio-primary input[type="radio"]:checked + label::after {
  background-color: var(--cw-ink);
}

.checkbox input[type="checkbox"]:focus + label::before,
.radio input[type="radio"]:focus + label::before {
  outline: none;
  box-shadow: 0 0 0 3px var(--cw-gold-ring);
}

/* Toggle switches (onoffswitch) */
.onoffswitch-inner:before {
  background-color: var(--cw-green);
}

/* bootstrap-select: make the toggle look like a native input. */
.bootstrap-select > .dropdown-toggle,
.bootstrap-select > .dropdown-toggle.btn-default {
  background: var(--cw-surface);
  border-color: var(--cw-line-input);
  border-radius: var(--cw-radius-sm);
  color: var(--cw-ink);
  font-weight: 400;
  box-shadow: none;
}

.bootstrap-select > .dropdown-toggle:hover {
  border-color: #c7c2b3;
  background: var(--cw-surface);
}

.bootstrap-select.open > .dropdown-toggle,
.bootstrap-select > .dropdown-toggle:focus {
  border-color: var(--cw-gold) !important;
  box-shadow: 0 0 0 3px var(--cw-gold-ring) !important;
  background: var(--cw-surface);
}

.bootstrap-select > .dropdown-toggle.bs-placeholder,
.bootstrap-select > .dropdown-toggle.bs-placeholder:hover {
  color: #a9a598;
}

.bootstrap-select .dropdown-menu li.selected > a,
.bootstrap-select .dropdown-menu li.active > a {
  background: var(--cw-surface-3);
  color: var(--cw-ink);
}

.bootstrap-select .dropdown-menu li a span.check-mark {
  color: var(--cw-gold-dark);
}

.bootstrap-select .bs-searchbox .form-control {
  border-radius: var(--cw-radius-sm);
}

.bootstrap-select .bs-actionsbox .btn {
  font-size: 12px;
}

/* Tag inputs */
ul.tagit {
  border-color: var(--cw-line-input) !important;
  border-radius: var(--cw-radius-sm) !important;
  background: var(--cw-surface) !important;
}

ul.tagit li.tagit-choice {
  background: var(--cw-blue-bg) !important;
  border-color: transparent !important;
  color: var(--cw-blue) !important;
  border-radius: var(--cw-pill) !important;
  font-weight: 600;
}

/* Dropzone */
.dropzone,
.dropzone-previews {
  border: 1.5px dashed var(--cw-line-input) !important;
  border-radius: var(--cw-radius) !important;
  background: var(--cw-surface-2) !important;
}

.dropzone:hover,
.dropzone.dz-drag-hover {
  border-color: var(--cw-gold) !important;
  background: var(--cw-gold-bg) !important;
}

/* ==================================================================
   10. Tables & DataTables
   ================================================================== */
.table {
  color: var(--cw-text);
}

.table > thead > tr > th,
table.dataTable thead > tr > th,
.table > thead > tr > td {
  background: var(--cw-surface-2);
  color: var(--cw-subtle);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-top: 0;
  border-bottom: 1px solid var(--cw-line);
  padding-top: 11px;
  padding-bottom: 11px;
  white-space: nowrap;
}

.table > thead > tr > th a,
table.dataTable thead > tr > th a {
  color: var(--cw-subtle);
}

.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th {
  border-top: 1px solid var(--cw-row-line);
  font-size: 13px;
  vertical-align: middle;
}

.table > tbody > tr:first-child > td {
  border-top: 0;
}

.table-hover > tbody > tr:hover,
table.dataTable tbody tr:hover {
  background-color: #fbfaf6;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: var(--cw-surface-2);
}

.table-bordered,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
  border-color: var(--cw-line);
}

table.dataTable tbody tr.selected,
table.dataTable tbody tr.selected:hover {
  background-color: var(--cw-gold-bg);
}

table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
  background-color: var(--cw-line-2);
}

/* Primary link column in rows */
table.dataTable tbody td a:not(.btn):not(.label) {
  font-weight: 500;
}

/* Row options (View | Edit | Delete) that appear on hover */
.row-options {
  font-size: 12px;
}

.row-options a {
  color: var(--cw-muted);
}

.row-options a:hover {
  color: var(--cw-ink);
}

.row-options a.text-danger,
.row-options a._delete {
  color: var(--cw-red);
}

/* Toolbar around DataTables */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select,
.dataTables_filter input,
.dataTables_length select {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line-input);
  border-radius: var(--cw-radius-sm);
  color: var(--cw-ink);
  box-shadow: none;
}

.dataTables_filter input:focus,
.dataTables_length select:focus {
  border-color: var(--cw-gold);
  box-shadow: 0 0 0 3px var(--cw-gold-ring);
  outline: none;
}

.dataTables_filter .input-group-addon,
.dataTables_length .input-group-addon {
  background: var(--cw-surface-3);
}

div.dataTables_wrapper .dt-buttons .btn,
div.dataTables_wrapper .dt-buttons .btn-default {
  background: var(--cw-surface);
  border-color: var(--cw-line-input);
  color: var(--cw-text-2);
  font-size: 12px;
}

div.dataTables_wrapper .dt-buttons .btn:hover {
  background: var(--cw-surface-2);
  color: var(--cw-ink);
}

.dataTables_info {
  color: var(--cw-subtle);
  font-size: 12px;
}

.dataTables_processing,
div.dataTables_wrapper div.dataTables_processing {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow-md);
  color: var(--cw-ink);
}

.dataTables_empty {
  color: var(--cw-subtle);
  padding: 28px 10px !important;
}

/* Pagination → rounded pills */
.pagination > li > a,
.pagination > li > span {
  border-color: var(--cw-line);
  color: var(--cw-text-2);
  margin: 0 2px;
  border-radius: var(--cw-radius-sm) !important;
  font-size: 12.5px;
  font-weight: 500;
}

.pagination > li > a:hover,
.pagination > li > a:focus,
.pagination > li > span:hover {
  background: var(--cw-surface-3);
  border-color: var(--cw-line-2);
  color: var(--cw-ink);
}

.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > a:focus,
.pagination > .active > span,
.pagination > .active > span:hover {
  background: var(--cw-ink);
  border-color: var(--cw-ink);
  color: #fff;
}

.pagination > .disabled > a,
.pagination > .disabled > span {
  color: var(--cw-faint);
  background: transparent;
}

/* Bulk-action / filter dropdown buttons above tables */
._filters .btn,
.btn-with-tooltip-group .btn {
  border-radius: var(--cw-radius-sm);
}

/* ==================================================================
   11. Labels, badges, status pills
   ================================================================== */
.label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--cw-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 3px 10px;
  line-height: 1.4;
  vertical-align: middle;
}

.label-default {
  background: var(--cw-grey-bg);
  color: var(--cw-muted);
  border: 1px solid transparent;
}

.label-primary {
  background: var(--cw-blue-bg);
  color: var(--cw-blue);
}

.label-info {
  background: var(--cw-blue-bg);
  color: var(--cw-blue);
}

.label-success {
  background: var(--cw-green-bg);
  color: var(--cw-green);
}

.label-warning {
  background: var(--cw-amber-bg);
  color: var(--cw-amber);
}

.label-danger {
  background: var(--cw-red-bg);
  color: var(--cw-red);
}

/* Outline labels used by many Perfex status columns (border colored inline). */
.label[style*="border:"],
.label[style*="border-color"],
.label[style*="border-width"] {
  background: transparent;
}

.badge {
  border-radius: var(--cw-pill);
  font-weight: 700;
  font-size: 10.5px;
  padding: 3px 8px;
  background: var(--cw-ink);
}

.badge-success,
.bg-success.badge { background: var(--cw-green); }
.badge-danger { background: var(--cw-red-bright); }
.badge-warning { background: var(--cw-gold); color: var(--cw-ink); }
.badge-info { background: var(--cw-blue-bright); }

/* Tags */
.label-tag,
.tags-labels .label-tag {
  background: var(--cw-blue-bg) !important;
  color: var(--cw-blue) !important;
  border: 0 !important;
  border-radius: var(--cw-pill);
}

/* Reusable pill helpers matching the mockup palette (opt-in classes). */
.cw-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--cw-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1.4;
}

.cw-pill-blue   { background: var(--cw-blue-bg);   color: var(--cw-blue); }
.cw-pill-green  { background: var(--cw-green-bg);  color: var(--cw-green); }
.cw-pill-amber  { background: var(--cw-amber-bg);  color: var(--cw-amber); }
.cw-pill-violet { background: var(--cw-violet-bg); color: var(--cw-violet); }
.cw-pill-red    { background: var(--cw-red-bg);    color: var(--cw-red); }
.cw-pill-grey   { background: var(--cw-grey-bg);   color: var(--cw-muted); }
.cw-pill-ink    { background: var(--cw-ink);       color: #fff; }
.cw-pill-dashed { border: 1.5px dashed var(--cw-gold); background: var(--cw-amber-bg); color: var(--cw-amber); }

/* ==================================================================
   12. Tabs
   Bootstrap .nav-tabs → mockup underline tabs (2px gold active rail).
   ================================================================== */
.nav-tabs {
  border-bottom: 2px solid var(--cw-line-2);
}

.nav-tabs > li > a {
  color: var(--cw-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus {
  color: var(--cw-ink);
  background: transparent;
  border-width: 0 0 2px;
  border-color: var(--cw-line-input);
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: var(--cw-ink);
  font-weight: 700;
  background: transparent;
  border-width: 0 0 2px;
  border-style: solid;
  border-color: var(--cw-gold);
  margin-bottom: -2px;
}

.nav-tabs > li.active > a i.menu-icon,
.nav-tabs > li > a:hover i.menu-icon {
  color: var(--cw-gold-dark);
}

.nav-tabs > li > a i.menu-icon {
  color: var(--cw-subtle);
}

/* Scrolling tab arrows (horizontal-scrollable-tabs) */
.horizontal-scrollable-tabs .arrow-left,
.horizontal-scrollable-tabs .arrow-right {
  color: var(--cw-muted);
}

/* Pills */
.nav-pills > li > a {
  border-radius: var(--cw-pill);
  color: var(--cw-text-2);
  font-weight: 600;
  font-size: 12.5px;
  border: 1.5px solid transparent;
}

.nav-pills > li > a:hover {
  background: var(--cw-surface-3);
}

.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
  background: transparent;
  border-color: var(--cw-ink);
  color: var(--cw-ink);
}

/* Customer / lead profile side tabs (vertical .customer-tabs etc.) */
.customer-tabs > li > a,
.nav-stacked > li > a {
  border-radius: 8px;
  color: var(--cw-text-2);
}

.customer-tabs > li.active > a,
.nav-stacked > li.active > a,
.nav-stacked > li.active > a:hover {
  background: var(--cw-surface-3);
  color: var(--cw-ink);
  font-weight: 700;
}

/* ==================================================================
   13. Dropdowns, popovers, tooltips
   ================================================================== */
.dropdown-menu {
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow-md);
  padding: 6px;
  font-size: 13px;
}

.dropdown-menu > li > a {
  color: var(--cw-text-2);
  border-radius: var(--cw-radius-sm);
  padding: 7px 12px;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background: var(--cw-surface-3);
  color: var(--cw-ink);
}

.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
  background: var(--cw-ink);
  color: #fff;
}

.dropdown-menu .divider {
  background-color: var(--cw-line);
  margin: 5px 0;
}

.dropdown-header {
  color: var(--cw-subtle);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tooltip-inner {
  background: var(--cw-ink);
  border-radius: var(--cw-radius-sm);
  font-size: 11.5px;
  padding: 6px 10px;
}

.tooltip.top .tooltip-arrow { border-top-color: var(--cw-ink); }
.tooltip.bottom .tooltip-arrow { border-bottom-color: var(--cw-ink); }
.tooltip.left .tooltip-arrow { border-left-color: var(--cw-ink); }
.tooltip.right .tooltip-arrow { border-right-color: var(--cw-ink); }

.popover {
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow-md);
}

.popover-title {
  background: var(--cw-surface-2);
  border-bottom: 1px solid var(--cw-line);
  font-weight: 700;
  color: var(--cw-ink);
  border-radius: var(--cw-radius) var(--cw-radius) 0 0;
}

/* Notifications dropdown */
.notifications .notification-box {
  border-bottom: 1px solid var(--cw-row-line);
}

.notifications .unread-notification,
.notification-box.unread {
  background: var(--cw-gold-bg);
}

/* ==================================================================
   14. Modals
   ================================================================== */
.modal-backdrop.in {
  opacity: 0.45;
  background: var(--cw-ink);
}

.modal-content {
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius-lg);
  box-shadow: var(--cw-shadow-lg);
  overflow: hidden;
}

.modal-header {
  background: var(--cw-surface);
  border-bottom: 1px solid var(--cw-line);
  padding: 16px 22px;
}

.modal-title,
.modal-header .modal-title {
  color: var(--cw-ink);
  font-weight: 700;
  font-size: 16px;
}

.modal-header .close {
  color: var(--cw-muted);
  opacity: 1;
  text-shadow: none;
}

.modal-header .close:hover {
  color: var(--cw-ink);
}

.modal-body {
  padding: 20px 22px;
}

.modal-footer {
  background: var(--cw-surface-2);
  border-top: 1px solid var(--cw-line);
  padding: 12px 22px;
}

/* ==================================================================
   15. Alerts → mockup callouts
   ================================================================== */
.alert {
  border: 1px solid transparent;
  border-left-width: 3px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.6;
  padding: 13px 18px;
}

.alert-info {
  background: var(--cw-blue-bg);
  border-color: #cbd9f6;
  border-left-color: var(--cw-blue);
  color: #24448a;
}

.alert-success {
  background: var(--cw-green-bg);
  border-color: #c7ead3;
  border-left-color: var(--cw-green);
  color: #22603a;
}

.alert-warning {
  background: var(--cw-gold-bg);
  border-color: #efe2bc;
  border-left-color: var(--cw-gold);
  color: #5a5136;
}

.alert-danger {
  background: var(--cw-red-bg);
  border-color: #f1d1c9;
  border-left-color: var(--cw-red);
  color: #86392a;
}

.alert .alert-link {
  color: inherit;
  text-decoration: underline;
}

/* Gold callout block (mockup ".callout"), opt-in. */
.cw-callout {
  background: var(--cw-gold-bg);
  border-left: 3px solid var(--cw-gold);
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  font-size: 13px;
  color: var(--cw-text-2);
  line-height: 1.65;
}

/* Toast notifications (alert_float) */
.float-alert.alert {
  box-shadow: var(--cw-shadow-md);
}

/* ==================================================================
   16. Progress, list groups, misc components
   ================================================================== */
.progress {
  background: #ebe9e1;
  border-radius: var(--cw-pill);
  box-shadow: none;
}

.progress-bar {
  background-color: var(--cw-ink);
  box-shadow: none;
}

.progress-bar-success { background-color: var(--cw-green); }
.progress-bar-info { background-color: var(--cw-blue); }
.progress-bar-warning { background-color: var(--cw-gold); }
.progress-bar-danger { background-color: var(--cw-red); }

.list-group-item {
  border-color: var(--cw-line);
  color: var(--cw-text);
}

.list-group-item:first-child {
  border-top-left-radius: var(--cw-radius);
  border-top-right-radius: var(--cw-radius);
}

.list-group-item:last-child {
  border-bottom-left-radius: var(--cw-radius);
  border-bottom-right-radius: var(--cw-radius);
}

.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
  background: var(--cw-ink);
  border-color: var(--cw-ink);
}

a.list-group-item:hover,
a.list-group-item:focus {
  background: var(--cw-surface-3);
}

.breadcrumb {
  background: transparent;
  padding-left: 0;
  font-size: 12.5px;
}

.breadcrumb > .active {
  color: var(--cw-ink);
  font-weight: 600;
}

/* Avatars */
.staff-profile-image-small,
.staff-profile-image-thumb,
.client-profile-image-small {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--cw-line);
}

/* Activity feed / timeline */
.activity-feed .feed-item:after {
  background: var(--cw-gold);
  border-color: #fff;
}

.activity-feed .feed-item {
  border-left-color: var(--cw-line-2);
}

.activity-feed .feed-item .date {
  color: var(--cw-subtle);
}

/* ==================================================================
   17. Dashboard
   ================================================================== */
.top_stats_wrapper {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow-xs);
  padding: 16px 18px;
}

.top_stats_wrapper .tw-font-semibold.tw-shrink-0 {
  font-family: var(--cw-font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--cw-ink);
  line-height: 1;
}

.top_stats_wrapper svg {
  color: var(--cw-gold-dark) !important;
}

.progress-bar-mini {
  height: 6px;
}

.widget .panel_s,
.widget > .panel_s {
  border-radius: var(--cw-radius);
}

.widget-dragger:before {
  color: var(--cw-faint);
}

/* KPI tile + dashboard panels from the mockup (opt-in). */
.cw-stat-tile {
  background: var(--cw-surface);
  border: 1px solid var(--cw-line-2);
  border-radius: var(--cw-radius);
  padding: 16px 18px;
}

.cw-stat-tile .cw-stat-label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cw-subtle);
  font-weight: 700;
  margin-bottom: 6px;
}

.cw-stat-tile .cw-stat-value {
  font-family: var(--cw-font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--cw-ink);
  line-height: 1;
}

.cw-stat-tile .cw-stat-sub {
  font-size: 11px;
  color: var(--cw-muted);
  margin-top: 6px;
}

.cw-stat-tile .cw-stat-sub.up { color: var(--cw-green); }
.cw-stat-tile .cw-stat-sub.down { color: var(--cw-red); }

.cw-urgent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cw-surface);
  border: 1px solid var(--cw-line-2);
  border-left: 3px solid var(--cw-red);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 7px;
}

.cw-urgent-row.warn {
  border-left-color: var(--cw-gold);
}

/* ------------------------------------------------------------------
   Dashboard overview (spec item 19) — modules/correctwork_pipeline/
   views/widgets/cw_*.php. Every card is a normal dashboard widget, so
   Screen options can hide and reorder it.
   ------------------------------------------------------------------ */
.cw-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.cw-kpi-row .cw-stat-tile {
  flex: 1 1 150px;
  min-width: 150px;
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cw-kpi-row a.cw-stat-tile:hover,
.cw-kpi-row a.cw-stat-tile:focus {
  border-color: var(--cw-faint);
  box-shadow: var(--cw-shadow-sm);
  text-decoration: none;
}

.cw-stat-tile .cw-stat-unit {
  font-family: var(--cw-font);
  font-size: 13px;
  font-weight: 600;
  color: var(--cw-muted);
}

.cw-stat-tile .cw-stat-value.is-alert { color: var(--cw-red); }
.cw-stat-tile .cw-stat-extra { font-size: 11px; color: var(--cw-subtle); margin-top: 3px; }

.cw-dash-panel > .panel-body { padding: 16px 18px; }

/* Level columns. The core dashboard floats its [data-container] columns, so
   side-by-side columns end at different heights and leave a hole under the
   shorter one. As a flex row, the columns of one line stretch to the same
   height and only the LAST card of each column grows to fill it, so cards
   stack tightly with no gap. Column widths still come from Bootstrap's
   col-md-*; below 992px every column takes the full width, as before. */
body.dashboard .content > .row {
  display: flex;
  flex-wrap: wrap;
}

body.dashboard .content > .row::before,
body.dashboard .content > .row::after,
body.dashboard .content > .row > .clearfix {
  display: none;
}

body.dashboard .content > .row > * {
  flex: 0 0 100%;
  max-width: 100%;
}

@media (min-width: 992px) {
  body.dashboard .content > .row > .col-md-4 { flex-basis: 33.3333%; }
  body.dashboard .content > .row > .col-md-6 { flex-basis: 50%; }
  body.dashboard .content > .row > .col-md-8 { flex-basis: 66.6667%; }
}

body.dashboard .content > .row > [data-container] {
  display: flex;
  flex-direction: column;
}

body.dashboard [data-container] > .widget {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

/* The last visible card takes up the slack (last-child is the fallback for
   browsers without the "of S" selector). */
body.dashboard [data-container] > .widget:last-child,
body.dashboard [data-container] > .widget:nth-last-child(1 of .widget:not(.hide)) {
  flex-grow: 1;
}

body.dashboard [data-container] > .widget > .panel_s {
  flex: 1 1 auto;
}

/* A container with no card (the half-width row today) must not open a blank line. */
body.dashboard .content > .row > [data-container]:not(:has(> .widget:not(.hide))) {
  min-height: 0;
}

.cw-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--cw-gold-dark);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px;
}

.widget[data-name="My tasks"] .todo-panel .tw-font-semibold span.tw-text-neutral-700,
.widget[data-name="My tasks"] .todo-panel .tw-font-semibold span {
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--cw-gold-dark) !important;
  font-weight: 700;
}

.widget[data-name="My tasks"] .todo-panel .tw-font-semibold i {
  color: var(--cw-gold-dark) !important;
}

.cw-panel-title a {
  color: var(--cw-blue);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.cw-panel-title .cw-pill {
  background: var(--cw-ink);
  color: #fff;
  border-radius: var(--cw-pill);
  padding: 1px 9px;
  font-size: 10px;
  letter-spacing: 0;
}

.cw-panel-note {
  font-size: 10.5px;
  color: var(--cw-subtle);
  line-height: 1.5;
  margin-top: 6px;
}

.cw-panel-empty {
  font-size: 12px;
  color: var(--cw-subtle);
  padding: 4px 0 8px;
}

/* Rows (urgent, radar, revenue, risky). Severity colours the left edge. */
.cw-dash-panel .cw-urgent-row { margin-bottom: 6px; padding: 8px 12px; }
.cw-urgent-row.sev-amber { border-left-color: var(--cw-gold); }
.cw-urgent-row.sev-gray { border-left-color: var(--cw-faint); }
.cw-urgent-row .cw-row-icon { flex: 0 0 16px; text-align: center; color: var(--cw-red); }
.cw-urgent-row.sev-amber .cw-row-icon { color: var(--cw-gold-dark); }
.cw-urgent-row.sev-gray .cw-row-icon { color: var(--cw-subtle); }
.cw-urgent-row .cw-row-text { flex: 1 1 auto; min-width: 0; color: var(--cw-text-2); line-height: 1.45; }
.cw-urgent-row .cw-row-text b,
.cw-urgent-row .cw-row-text a.cw-row-title { color: var(--cw-ink); font-weight: 600; }
.cw-urgent-row .cw-row-flag { color: var(--cw-gold-dark); font-weight: 600; }
.cw-urgent-row.is-placeholder { border-left-style: dashed; color: var(--cw-subtle); }

/* Horizontal bars (pipeline funnel, business lines, lead sources). */
.cw-funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--cw-text-2);
  margin-bottom: 8px;
}

.cw-funnel-row .cw-funnel-label { flex: 0 0 150px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-funnel-row .cw-funnel-track { flex: 1 1 auto; min-width: 40px; }
.cw-funnel-row .cw-funnel-value { flex: 0 0 auto; font-weight: 600; color: var(--cw-ink); white-space: nowrap; }
.cw-funnel-row.is-muted,
.cw-funnel-row.is-muted .cw-funnel-value { color: var(--cw-subtle); font-weight: 500; }

.cw-funnel-bar {
  height: 10px;
  min-width: 3px;
  border-radius: 5px;
  background: var(--cw-text-2);
}

.cw-funnel-bar.c-blue { background: var(--cw-blue); }
.cw-funnel-bar.c-blue-bright { background: var(--cw-blue-bright); }
.cw-funnel-bar.c-green { background: var(--cw-green); }
.cw-funnel-bar.c-amber { background: var(--cw-amber); }
.cw-funnel-bar.c-violet { background: var(--cw-violet); }
.cw-funnel-bar.c-gold { background: var(--cw-gold); }
.cw-funnel-bar.c-red { background: var(--cw-red); }
.cw-funnel-bar.c-ink { background: var(--cw-ink); }
.cw-funnel-bar.c-ink3 { background: var(--cw-text-2); opacity: 0.55; }
.cw-funnel-bar.c-muted { background: var(--cw-subtle); }
.cw-funnel-bar.c-empty { background: var(--cw-line-2); }

/* Revenue mini stats. */
.cw-mini-stats { display: flex; gap: 10px; margin-bottom: 10px; }

.cw-mini-stat {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  background: var(--cw-surface-2);
  border-radius: var(--cw-radius-sm);
  padding: 8px 6px;
}

.cw-mini-stat .cw-mini-label { font-size: 10px; color: var(--cw-subtle); }
.cw-mini-stat .cw-mini-value { font-family: var(--cw-font-display); font-size: 19px; font-weight: 600; color: var(--cw-ink); line-height: 1.25; }
.cw-mini-stat .cw-mini-more { font-size: 11px; color: var(--cw-muted); }
.cw-mini-stat.is-good { background: var(--cw-green-bg); }
.cw-mini-stat.is-good .cw-mini-value { color: var(--cw-green); }
.cw-mini-stat.is-bad { background: var(--cw-red-bg); }
.cw-mini-stat.is-bad .cw-mini-value { color: var(--cw-red); }

/* Relogo deal-type panel. */
.cw-relogo-box {
  border: 1px dashed var(--cw-gold);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  background: var(--cw-gold-bg);
}

.cw-relogo-box .cw-relogo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--cw-ink); }
.cw-relogo-box .cw-pill { background: var(--cw-ink); color: #fff; border-radius: var(--cw-pill); padding: 1px 9px; font-size: 10px; white-space: nowrap; }
.cw-relogo-box .table-responsive { margin: 0; border: 0; }
.cw-relogo-table { width: 100%; font-size: 12px; background: var(--cw-surface); border-radius: 6px; }
.cw-relogo-table th { font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--cw-muted); font-weight: 700; padding: 7px 8px; border-bottom: 1px solid var(--cw-line-2); white-space: nowrap; }
.cw-relogo-table td { padding: 7px 8px; border-bottom: 1px solid var(--cw-row-line); color: var(--cw-text-2); }
.cw-relogo-table tr.is-total td { font-weight: 700; background: var(--cw-surface-2); border-bottom: 0; }
.cw-relogo-table .is-none { color: var(--cw-subtle); }
.cw-relogo-table .is-good { color: var(--cw-green); font-weight: 600; }
.cw-relogo-table .is-bad { color: var(--cw-red); font-weight: 600; }

/* Team feed + Next 7 days. */
.cw-feed-item { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--cw-row-line); font-size: 12px; }
.cw-feed-item:last-child { border-bottom: 0; }
.cw-feed-item .cw-feed-body { flex: 1 1 auto; min-width: 0; line-height: 1.45; color: var(--cw-text-2); overflow-wrap: anywhere; }
.cw-feed-item .cw-feed-when { color: var(--cw-subtle); }

.cw-avatar {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--cw-gold-dark);
}

.cw-avatar.a-1 { background: var(--cw-violet); }
.cw-avatar.a-2 { background: var(--cw-green); }
.cw-avatar.a-3 { background: var(--cw-blue); }
.cw-avatar.a-4 { background: var(--cw-red); }
.cw-avatar.a-system { background: var(--cw-subtle); }

.cw-queue-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12px; color: var(--cw-text-2); border-bottom: 1px solid var(--cw-row-line); }
.cw-queue-row:last-child { border-bottom: 0; }
.cw-queue-row a { color: inherit; }
.cw-queue-row a:hover { color: var(--cw-ink); text-decoration: underline; }

.cw-cal-dot {
  flex: 0 0 46px;
  height: 22px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: var(--cw-blue-bright);
}

.cw-cal-dot.c-red { background: var(--cw-red); }
.cw-cal-dot.c-amber { background: var(--cw-amber); }
.cw-cal-dot.c-violet { background: var(--cw-violet); }
.cw-cal-dot.c-gold { background: var(--cw-gold); }

.cw-queue-badge {
  flex: 0 0 auto;
  border-radius: var(--cw-pill);
  padding: 1px 9px;
  font-size: 11px;
  font-weight: 700;
  background: var(--cw-blue-bg);
  color: var(--cw-blue);
}

.cw-queue-badge.q-ops { background: var(--cw-amber-bg); color: var(--cw-amber); }

@media (max-width: 767px) {
  .cw-funnel-row .cw-funnel-label { flex-basis: 110px; }
  .cw-mini-stats { flex-direction: column; }
  .cw-kpi-row .cw-stat-tile { flex-basis: calc(50% - 7px); min-width: 0; }
}

/* ==================================================================
   18. Kanban (leads, tasks, projects)
   ================================================================== */
.kan-ban-col .panel_s,
.kan-ban-col .kan-ban-col-wrapper {
  border-radius: var(--cw-radius);
}

.kan-ban-col .panel-heading {
  border-radius: var(--cw-radius) var(--cw-radius) 0 0;
  font-size: 12.5px;
  font-weight: 700;
}

.kan-ban-content-wrapper,
.kan-ban-col .kan-ban-content {
  background: var(--cw-surface-3);
}

.kan-ban-col li.lead-kan-ban,
.kan-ban-col li.task,
.kan-ban-col .panel-body > ul > li {
  border-radius: 8px;
}

.kan-ban-col li .panel-body {
  border: 1px solid var(--cw-line);
  border-radius: 8px;
  background: var(--cw-surface);
}

.kan-ban-col li .panel-body:hover {
  border-color: var(--cw-line-input);
  box-shadow: var(--cw-shadow-sm);
}

/* ==================================================================
   19. Calendar (FullCalendar)
   ================================================================== */
.fc .fc-button-primary {
  background: var(--cw-surface);
  border-color: var(--cw-line-input);
  color: var(--cw-text-2);
  font-weight: 600;
  text-transform: capitalize;
  box-shadow: none;
}

.fc .fc-button-primary:hover {
  background: var(--cw-surface-2);
  border-color: #c7c2b3;
  color: var(--cw-ink);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--cw-ink);
  border-color: var(--cw-ink);
  color: #fff;
}

.fc .fc-button-primary:focus,
.fc .fc-button-primary:not(:disabled).fc-button-active:focus {
  box-shadow: 0 0 0 3px var(--cw-gold-ring);
}

.fc .fc-toolbar-title {
  color: var(--cw-ink);
  font-weight: 700;
  font-size: 1.3em;
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--cw-line);
}

.fc .fc-col-header-cell {
  background: var(--cw-surface-2);
}

.fc .fc-col-header-cell-cushion {
  color: var(--cw-subtle);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.fc .fc-daygrid-day-number {
  color: var(--cw-muted);
  font-size: 12px;
}

.fc .fc-day-today {
  background: var(--cw-gold-bg) !important;
}

.fc .fc-event {
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

/* ==================================================================
   20. Rich text (TinyMCE frame) & misc third-party
   ================================================================== */
.tox-tinymce {
  border-color: var(--cw-line-input) !important;
  border-radius: var(--cw-radius-sm) !important;
}

.daterangepicker td.active,
.daterangepicker td.active:hover,
.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box > div > div.xdsoft_current {
  background: var(--cw-ink) !important;
  box-shadow: none !important;
  color: #fff !important;
}

.xdsoft_datetimepicker .xdsoft_calendar td:hover,
.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box > div > div:hover {
  background: var(--cw-gold) !important;
  color: var(--cw-ink) !important;
}

.xdsoft_datetimepicker {
  border-color: var(--cw-line) !important;
  border-radius: var(--cw-radius) !important;
  box-shadow: var(--cw-shadow-md) !important;
}

/* ==================================================================
   21. Authentication pages (login, forgot / reset password)
   ================================================================== */
body.login_admin,
body.authentication,
body.forgot_password,
body.reset_password,
body.set_password {
  background:
    radial-gradient(1200px 500px at 50% -10%, #fbf7ec 0%, rgba(251, 247, 236, 0) 60%),
    var(--cw-bg) !important;
}

.authentication-form-wrapper h1 {
  color: var(--cw-ink) !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.authentication-form-wrapper h1 + p,
.authentication-form-wrapper p.tw-text-neutral-600 {
  color: var(--cw-muted) !important;
}

.authentication-form-wrapper .tw-bg-white {
  border-color: var(--cw-line) !important;
  border-radius: var(--cw-radius-lg) !important;
  box-shadow: var(--cw-shadow-md) !important;
}

.authentication-form-wrapper .company-logo img {
  max-height: 56px;
  width: auto;
  display: inline-block;
}

.authentication-form-wrapper .btn-primary {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* ==================================================================
   22. Responsive
   ================================================================== */
@media (max-width: 991px) {
  .content {
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .content {
    padding: 16px;
  }

  .panel_s > .panel-body {
    padding: 14px;
  }

  .modal-body,
  .modal-header,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-tabs > li > a {
    padding: 8px 12px;
  }

  .table > thead > tr > th {
    white-space: normal;
  }

  /* Wide list tables scroll inside their card instead of the page. */
  .table-responsive,
  .dataTables_wrapper .table-responsive {
    border: 0;
    -webkit-overflow-scrolling: touch;
  }

  .content h4.tw-text-lg {
    font-size: 18px !important;
  }
}

