/**
 * Clockwise Insurance Brokerage — Theme
 * Green primary palette with offwhite background.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Inter:wght@400;500;600;700&family=Poppins:wght@600;700&display=swap');

/* ============================================================
   1. VARIABLES
   ============================================================ */
:root {
  --cw-primary: #49a942;
  --cw-primary-dark: #2E7D32;
  --cw-primary-darker: #1B5E20;
  --cw-primary-light: #66BB6A;
  --cw-primary-subtle: rgba(73, 169, 66, 0.08);
  --cw-accent: #f58621;
  --cw-accent-hover: #e07510;
  --cw-bg: #f5f7f8;
  --cw-card-bg: #ffffff;
  --cw-text: #1a1a2e;
  --cw-text-secondary: #4a5568;
  --cw-text-muted: #718096;
  --cw-border: #e2e8f0;
  --cw-border-light: #edf2f7;
  --cw-success: #49a942;
  --cw-warning: #f58621;
  --cw-danger: #ef4444;
  --cw-info: #3b82f6;
  --cw-purple: #7c3aed;
  --cw-sidebar: #0a1628;
  --cw-sidebar-section: #0d1b2a;
  --cw-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --cw-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
  --cw-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --cw-radius: 8px;
  --cw-radius-lg: 12px;
  --cw-radius-xl: 16px;
  --cw-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   2. GLOBAL RESETS & BASE
   ============================================================ */
body,
.wrapper {
  font-family: var(--cw-font) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.content-wrapper {
  background-color: var(--cw-bg) !important;
}

/*
 * Gap between last page content and footer: space lives in the main content column
 * (below cards/tables), not inside cards and not as footer margin.
 */
.wrapper .content-wrapper > .content {
  padding-bottom: clamp(2rem, 4.5vw, 3.5rem) !important;
}

/* Main footer — global (layouts.app) */
.main-footer {
  border-top: 1px solid var(--cw-border) !important;
  background: var(--cw-card-bg) !important;
  color: var(--cw-text-muted);
  font-size: 0.8125rem;
  padding: 0.65rem 1.25rem !important;
}
.cw-app-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
}
.cw-app-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 1.25rem;
  width: 100%;
}
.cw-app-footer-legal {
  font-weight: 500;
  color: var(--cw-text-muted);
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.cw-app-footer-legal strong {
  font-weight: 600;
  color: var(--cw-text-secondary);
}
.cw-app-footer-version {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  background: var(--cw-primary-subtle);
  color: var(--cw-primary-dark);
  font-size: 0.78rem;
}

/* Developer credit — Eco / partner line */
.cw-app-footer-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  text-align: center;
}
.cw-app-footer-credit-text {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--cw-text-muted);
}
.cw-app-footer-credit-label {
  display: inline;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.68rem;
  opacity: 0.92;
  margin-right: 0.35rem;
}
.cw-app-footer-credit-name {
  font-family: 'Poppins', var(--cw-font);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: -0.02em;
  color: var(--cw-primary-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a.cw-app-footer-credit-name:hover {
  color: var(--cw-accent-hover);
  border-bottom-color: rgba(245, 134, 33, 0.45);
  text-decoration: none;
}

/* ============================================================
   3. SIDEBAR — Modern white with colorful icon badges
   ============================================================ */

/* Green-to-orange gradient accent stripe at top */
.main-sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cw-primary), var(--cw-accent));
  z-index: 1060;
}

.main-sidebar {
  background: #ffffff !important;
  border-right: 1px solid var(--cw-border) !important;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.04) !important;
  overflow-x: hidden !important;
}

/* ── Brand / Logo ── */
.main-sidebar .brand-link {
  background: #ffffff !important;
  border-bottom: 1px solid var(--cw-border-light) !important;
  padding: 1.125rem 1.25rem !important;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.main-sidebar .brand-link .brand-text {
  color: var(--cw-primary-dark) !important;
  font-weight: 800;
  font-family: 'Poppins', var(--cw-font);
}
.main-sidebar .brand-link .brand-image {
  display: none !important;
}

/* ── Sidebar body ── */
.main-sidebar .sidebar {
  padding: 0.375rem 0.65rem 1rem;
  background: #ffffff;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

/* Scrollable area: no horizontal clip; content uses full inner width */
.main-sidebar .os-content,
.main-sidebar .sidebar nav {
  overflow-x: hidden !important;
  max-width: 100%;
  box-sizing: border-box;
}

.main-sidebar .nav-sidebar {
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
}

/* OverlayScrollbars: let content use full width (no reserved gutter) */
.main-sidebar .os-content-glue {
  margin-right: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.main-sidebar .os-viewport {
  box-sizing: border-box;
}

/* ── Sidebar user card (above search) ── */
.main-sidebar .cw-sidebar-user-card-li {
  list-style: none;
}
.main-sidebar a.cw-sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  margin: 0 0 0.125rem;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(73, 169, 66, 0.24);
  background: linear-gradient(135deg, rgba(220, 252, 231, 0.96) 0%, rgba(240, 253, 244, 0.86) 45%, #ffffff 100%);
  text-decoration: none !important;
  color: var(--cw-text) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.main-sidebar a.cw-sidebar-user-card:hover {
  border-color: rgba(73, 169, 66, 0.45);
  box-shadow: 0 3px 12px rgba(73, 169, 66, 0.14);
  transform: translateY(-1px);
}
.main-sidebar .cw-sidebar-user-card-avatar-wrap {
  flex-shrink: 0;
}
.main-sidebar .cw-sidebar-user-card-avatar {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}
.main-sidebar .cw-sidebar-user-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}
.main-sidebar .cw-sidebar-user-card-name {
  font-family: 'Poppins', var(--cw-font);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--cw-text) !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main-sidebar .cw-sidebar-user-card-role {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--cw-text-muted) !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main-sidebar .cw-sidebar-user-card-badges {
  margin-top: 0.1rem;
}
.main-sidebar .cw-sidebar-user-status {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}
.main-sidebar .cw-sidebar-user-status--active {
  background: rgba(73, 169, 66, 0.14);
  color: var(--cw-primary-dark) !important;
}
.main-sidebar .cw-sidebar-user-status--inactive {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c !important;
}

/* ── Sidebar search — icon on left, orange border ── */
.main-sidebar .form-inline {
  padding: 0;
  margin-bottom: 0.35rem;
  max-width: 100%;
}
.main-sidebar [data-widget="sidebar-search"] {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.main-sidebar .form-control-sidebar {
  background: #fff8f2 !important;
  border: 1.5px solid var(--cw-accent) !important;
  border-radius: 10px !important;
  color: var(--cw-text) !important;
  font-size: 0.8125rem;
  font-family: var(--cw-font);
  padding: 0.625rem 0.875rem 0.625rem 2.375rem !important;
  width: 100% !important;
  box-sizing: border-box;
  height: auto !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.main-sidebar .form-control-sidebar::placeholder {
  color: #b0956e;
  font-size: 0.8125rem;
}
.main-sidebar .form-control-sidebar:focus {
  border-color: var(--cw-accent-hover) !important;
  box-shadow: 0 0 0 3px rgba(245, 134, 33, 0.12) !important;
  background: #ffffff !important;
  outline: none;
}
.main-sidebar [data-widget="sidebar-search"] .input-group-append {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  margin: 0;
}
.main-sidebar .btn-sidebar {
  color: var(--cw-accent) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
  pointer-events: none;
}
.main-sidebar .btn-sidebar:hover {
  color: var(--cw-accent-hover) !important;
}

/* Search results dropdown (inserted by AdminLTE JS after the input-group) */
.main-sidebar .sidebar-search-results {
  position: relative;
  z-index: 1050;
  margin: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 0 0 10px 10px;
  border: 1.5px solid var(--cw-accent);
  border-top: 1px solid rgba(245, 134, 33, 0.15);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(245, 134, 33, 0.1);
  max-height: 280px;
  overflow-y: auto;
}
.main-sidebar .sidebar-search-open .form-control-sidebar {
  border-radius: 10px 10px 0 0 !important;
}
.main-sidebar .sidebar-search-results .list-group {
  margin: 0;
}
.main-sidebar .sidebar-search-results .list-group-item {
  border-color: rgba(245, 134, 33, 0.08);
  font-size: 0.8125rem;
  padding: 0.5rem 0.875rem;
  color: var(--cw-text-secondary);
  transition: background 0.1s;
}
.main-sidebar .sidebar-search-results .list-group-item:first-child {
  border-top: none;
}
.main-sidebar .sidebar-search-results .list-group-item.active,
.main-sidebar .sidebar-search-results .list-group-item:hover {
  background: rgba(245, 134, 33, 0.06);
  color: var(--cw-text);
}
.main-sidebar .sidebar-search-results .search-path {
  font-size: 0.6875rem;
  color: var(--cw-text-muted);
}

/* ── Section headers ── */
.main-sidebar .nav-sidebar .nav-header {
  color: var(--cw-text-muted) !important;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1.5rem 0.55rem 0.5rem;
}

/* ── Nav item wrapper ── */
.main-sidebar .nav-sidebar > .nav-item {
  margin: 3px 0;
  max-width: 100%;
}

/* ── Nav link base — uniform padding ── */
.main-sidebar .nav-sidebar > .nav-item > .nav-link {
  color: var(--cw-text-secondary) !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.55rem;
  border-radius: 10px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  position: relative;
  gap: 0.625rem;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

/* Nested menu rows (treeview) — same full-width fit */
.main-sidebar .nav-sidebar .nav-treeview > .nav-item {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
}
.main-sidebar .nav-sidebar .nav-treeview .nav-link {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
}
.main-sidebar .nav-sidebar > .nav-item > .nav-link p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* Hover */
.main-sidebar .nav-sidebar > .nav-item > .nav-link:hover {
  color: var(--cw-text) !important;
  background: #f1f5f9 !important;
}

/* Active */
.main-sidebar .nav-sidebar > .nav-item > .nav-link.active {
  color: var(--cw-primary-darker) !important;
  background: rgba(73, 169, 66, 0.08) !important;
  font-weight: 600;
}
.main-sidebar .nav-sidebar > .nav-item > .nav-link.active p {
  color: var(--cw-primary-darker) !important;
}

/* ──────────────────────────────────────────────
   Icon base — colorful rounded-square badges
   Must override AdminLTE sidebar-light defaults
   ────────────────────────────────────────────── */
.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link .nav-icon,
.main-sidebar .nav-sidebar > .nav-item > .nav-link .nav-icon,
.main-sidebar .nav-sidebar .nav-link .nav-icon {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  line-height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  font-size: 0.875rem !important;
  margin-right: 0 !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
  opacity: 1 !important;
}

/* Hover icon lift */
.main-sidebar .nav-sidebar > .nav-item > .nav-link:hover .nav-icon {
  transform: translateY(-1px);
}

/* ──────────────────────────────────────────────
   Per-item icon colors  (matches dashboard palette)
   NOTE: AdminLTE puts 'classes' on the <a> nav-link,
   NOT the <li> — so selectors use .nav-link.cw-nav-xxx
   ────────────────────────────────────────────── */

/* Dashboard — Green */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-dashboard .nav-icon {
  background: rgba(73, 169, 66, 0.12) !important;
  color: #2E7D32 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-dashboard.active .nav-icon {
  background: #49a942 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(73, 169, 66, 0.3);
}

/* Clients — Orange */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-clients .nav-icon {
  background: rgba(245, 134, 33, 0.12) !important;
  color: #d97706 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-clients.active .nav-icon {
  background: #f58621 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(245, 134, 33, 0.3);
}

/* Quotations — Blue */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-quotations .nav-icon {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #2563eb !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-quotations.active .nav-icon {
  background: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

/* Policies — Emerald */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-policies .nav-icon {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-policies.active .nav-icon {
  background: #10b981 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

/* Invoices — Red */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-invoices .nav-icon {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-invoices.active .nav-icon {
  background: #ef4444 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

/* Payments — Green */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-payments .nav-icon {
  background: rgba(73, 169, 66, 0.12) !important;
  color: #2E7D32 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-payments.active .nav-icon {
  background: #49a942 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(73, 169, 66, 0.3);
}

/* Claims — Orange */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-claims .nav-icon {
  background: rgba(245, 134, 33, 0.12) !important;
  color: #d97706 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-claims.active .nav-icon {
  background: #f58621 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(245, 134, 33, 0.3);
}

/* Renewals — Purple */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-renewals .nav-icon {
  background: rgba(139, 92, 246, 0.12) !important;
  color: #7c3aed !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-renewals.active .nav-icon {
  background: #8b5cf6 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

/* Field Operations — Violet */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-field-operations .nav-icon {
  background: rgba(124, 58, 237, 0.12) !important;
  color: #7c3aed !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-field-operations.active .nav-icon {
  background: #7c3aed !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.35);
}

/* Help Center — Cyan */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-help .nav-icon {
  background: rgba(6, 182, 212, 0.12) !important;
  color: #0891b2 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-help.active .nav-icon {
  background: #06b6d4 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(6, 182, 212, 0.35);
}

/* Finance — Chart of Accounts — Blue */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-finance-accounts .nav-icon {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #2563eb !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-finance-accounts.active .nav-icon {
  background: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

/* Finance — Journal Entries — Teal */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-finance-journals .nav-icon {
  background: rgba(20, 184, 166, 0.12) !important;
  color: #0d9488 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-finance-journals.active .nav-icon {
  background: #14b8a6 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(20, 184, 166, 0.3);
}

/* Finance — General Ledger — Indigo */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-finance-ledger .nav-icon {
  background: rgba(99, 102, 241, 0.12) !important;
  color: #4f46e5 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-finance-ledger.active .nav-icon {
  background: #6366f1 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

/* Finance — Trial Balance — Amber */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-finance-trial-balance .nav-icon {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-finance-trial-balance.active .nav-icon {
  background: #f59e0b !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

/* Reports — Blue */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-reports .nav-icon {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #2563eb !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-reports.active .nav-icon {
  background: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

/* Commissions — Amber */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-commissions .nav-icon {
  background: rgba(217, 119, 6, 0.12) !important;
  color: #b45309 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-commissions.active .nav-icon {
  background: #d97706 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.3);
}

/* Products — Purple */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-products .nav-icon {
  background: rgba(139, 92, 246, 0.12) !important;
  color: #7c3aed !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-products.active .nav-icon {
  background: #8b5cf6 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

/* Insurers — Emerald */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-insurers .nav-icon {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-insurers.active .nav-icon {
  background: #10b981 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

/* Users — Red */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-users .nav-icon {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-users.active .nav-icon {
  background: #ef4444 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

/* Procurement — mixed: Suppliers (teal), Purchase Orders (orange), GRN (blue) */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-suppliers .nav-icon {
  background: rgba(13, 148, 136, 0.12) !important;
  color: #0d9488 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-suppliers.active .nav-icon {
  background: #0d9488 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.3);
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-purchase-orders .nav-icon {
  background: rgba(245, 134, 33, 0.12) !important;
  color: #d97706 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-purchase-orders.active .nav-icon {
  background: #f58621 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(245, 134, 33, 0.3);
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-grn .nav-icon {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #2563eb !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-grn.active .nav-icon {
  background: #3b82f6 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

/* Assets / Inventory — mixed: Inventory (indigo), Assets (green), Asset categories (amber) */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-inventory .nav-icon {
  background: rgba(79, 70, 229, 0.12) !important;
  color: #4f46e5 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-inventory.active .nav-icon {
  background: #4f46e5 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-assets .nav-icon {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-assets.active .nav-icon {
  background: #10b981 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-asset-categories .nav-icon {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #d97706 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-asset-categories.active .nav-icon {
  background: #f59e0b !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

/* HR — Employees (teal) */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-employees .nav-icon {
  background: rgba(13, 148, 136, 0.12) !important;
  color: #0d9488 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-employees.active .nav-icon {
  background: #0d9488 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.3);
}

/* HR — Departments (indigo) */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-departments .nav-icon {
  background: rgba(79, 70, 229, 0.12) !important;
  color: #4f46e5 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-departments.active .nav-icon {
  background: #4f46e5 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}

/* HR — Payroll */
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-payroll .nav-icon {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
}
.sidebar-light-primary .nav-sidebar .nav-link.cw-nav-payroll.active .nav-icon {
  background: #10b981 !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

/* ── AdminLTE elevation override ── */
.main-sidebar.elevation-4 {
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.04) !important;
}

/*
 * Sidebar scrolling: config/adminlte.php uses sidebar_scrollbar_theme => os-theme-none
 * so OverlayScrollbars hides tracks. Extra rules below catch any theme or native overflow.
 */
.main-sidebar .os-scrollbar,
.main-sidebar .os-scrollbar-vertical,
.main-sidebar .os-scrollbar-horizontal,
.main-sidebar .os-scrollbar-corner {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  width: 0 !important;
  min-width: 0 !important;
  pointer-events: none !important;
}

.main-sidebar .sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.main-sidebar .sidebar::-webkit-scrollbar,
.main-sidebar .os-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* ── Collapsed sidebar fit fixes (prevent icon clipping) ── */
.sidebar-mini.sidebar-collapse .main-sidebar .brand-link {
  padding: 0.75rem 0.45rem !important;
}
.sidebar-mini.sidebar-collapse .main-sidebar .brand-link .brand-image {
  max-height: 28px;
  margin: 0 auto !important;
}
.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar {
  padding-right: 0.15rem;
}
.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar > .nav-item {
  margin: 4px 0.3rem;
}
.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar > .nav-item > .nav-link {
  width: 100%;
  margin-right: 0;
  padding: 0.4rem 0.3rem;
  justify-content: center;
}
.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar > .nav-item > .nav-link .nav-icon,
.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar .nav-link .nav-icon {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  line-height: 32px !important;
  border-radius: 9px !important;
  font-size: 0.8rem !important;
}
.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar > .nav-item > .nav-link:hover .nav-icon {
  transform: none;
}

/* ============================================================
   4. NAVBAR / TOP HEADER
   ============================================================ */
.main-header.navbar {
  background: #ffffff !important;
  border-bottom: 1px solid var(--cw-border) !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
  min-height: 60px;
  position: relative;
  z-index: 1040;
}

.main-header.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cw-primary), var(--cw-accent));
  pointer-events: none;
}

.main-header .navbar-nav .nav-link {
  color: var(--cw-text-secondary) !important;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.main-header .navbar-nav .nav-link:hover {
  color: var(--cw-primary) !important;
}

/* Brand / title area in top bar */
.main-header .navbar-brand,
.main-header .brand-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.cw-topbar-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.18), rgba(34, 197, 94, 0.22));
  color: var(--cw-primary-dark);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  font-size: 0.95rem;
}

.cw-topbar-logo-text {
  font-family: 'Poppins', var(--cw-font);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--cw-primary-dark);
}

/* ── User menu (navbar): profile card dropdown ── */
.cw-navbar-user-toggle {
  gap: 0.5rem;
}
.cw-navbar-user-toggle::after {
  margin-left: 0.15rem;
}
.cw-navbar-user-avatar {
  width: 34px;
  height: 34px;
  object-fit: cover;
  flex-shrink: 0;
}
.cw-navbar-user-name {
  color: var(--cw-primary) !important;
  font-weight: 600;
  font-size: 0.9375rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cw-user-dropdown-menu {
  min-width: 280px !important;
  max-width: 320px;
  padding: 0 !important;
  margin-top: 0.5rem !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12) !important;
  border: 1px solid var(--cw-border) !important;
}

.cw-user-dropdown-header {
  background: linear-gradient(145deg, rgba(220, 252, 231, 1) 0%, rgba(187, 247, 208, 1) 40%, #ffffff 100%);
  color: var(--cw-primary-dark);
  text-align: center;
  padding: 1.35rem 1.25rem 1.25rem;
  list-style: none;
}

.cw-user-dropdown-avatar {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.4);
  margin: 0 auto 0.75rem;
  display: block;
}

.cw-user-dropdown-name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.25rem;
  color: var(--cw-primary-dark);
}

.cw-user-dropdown-role {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.95;
  margin-bottom: 0.35rem;
  color: var(--cw-text-secondary);
}

.cw-user-dropdown-since {
  font-size: 0.75rem;
  opacity: 0.8;
  color: var(--cw-text-muted);
}

.cw-user-dropdown-footer {
  list-style: none;
  background: #fff;
  padding: 0;
  margin: 0;
}

.cw-user-dropdown-actions {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0.75rem;
  padding: 1rem 1.15rem 1.15rem;
}

.cw-user-dropdown-btn {
  flex: 1 1 0;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  padding: 0.5rem 0.65rem !important;
  border-radius: 8px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #334155 !important;
  text-align: center;
  line-height: 1.3;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.cw-user-dropdown-btn:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #1e293b !important;
  text-decoration: none;
}

/* ── User create/edit: profile photo sidebar card ── */
.cw-user-avatar-side-card {
  border-radius: 12px !important;
  background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%, #f1f5f9 100%);
  border: 1px solid var(--cw-border) !important;
}
.cw-user-avatar-side-label {
  letter-spacing: 0.08em;
  font-size: 0.65rem !important;
}
.cw-user-photo-preview-wrap {
  max-width: 148px;
}
.cw-user-photo-preview-ring {
  width: 132px;
  height: 132px;
  margin: 0 auto;
  padding: 5px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--cw-primary, #49a942) 0%, #2563eb 45%, var(--cw-accent, #f58621) 100%);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.cw-user-photo-preview-img {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.cw-user-photo-preview-ring .cw-user-photo-preview-placeholder {
  display: none;
  width: 122px;
  height: 122px;
  border-radius: 50%;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #94a3b8;
  font-size: 2.75rem;
  border: 3px solid #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.cw-user-photo-preview-ring .cw-user-photo-preview-img.d-none ~ .cw-user-photo-preview-placeholder {
  display: flex;
}
@media (min-width: 992px) {
  .cw-user-avatar-side-card {
    position: sticky;
    top: 72px;
    z-index: 1;
  }
}

/* ============================================================
   5. CONTENT HEADER (Page title)
   ============================================================ */
.content-header {
  padding: 1.5rem 0 0.5rem;
}

.content-header h1 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--cw-text);
  letter-spacing: -0.01em;
}

.content-header .page-subtitle {
  font-size: 0.875rem;
  color: var(--cw-text-muted);
  margin-top: 0.125rem;
  font-weight: 400;
}

/* ============================================================
   6. METRIC CARDS (KPI row)
   ============================================================ */
.cw-metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.cw-metric-card {
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cw-metric-card:hover {
  border-color: var(--cw-primary-light);
  box-shadow: var(--cw-shadow-sm);
}

.cw-metric-card .cw-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--cw-text);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.cw-metric-card .cw-metric-label {
  font-size: 0.8125rem;
  color: var(--cw-text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Primary metric card — green */
.cw-metric-card.cw-metric-card-primary {
  background: var(--cw-primary-darker);
  border-color: var(--cw-primary-darker);
}

.cw-metric-card.cw-metric-card-primary:hover {
  border-color: var(--cw-primary-dark);
  box-shadow: var(--cw-shadow);
}

.cw-metric-card.cw-metric-card-primary .cw-metric-value,
.cw-metric-card.cw-metric-card-primary .cw-metric-label {
  color: #fff;
}

.cw-metric-card.cw-metric-card-primary .cw-metric-label {
  opacity: 0.85;
}

/* Accent metric card — orange */
.cw-metric-card.cw-metric-card-accent {
  background: var(--cw-accent);
  border-color: var(--cw-accent);
}

.cw-metric-card.cw-metric-card-accent .cw-metric-value,
.cw-metric-card.cw-metric-card-accent .cw-metric-label {
  color: #fff;
}

/* ============================================================
   7. DATA CARDS (table container)
   ============================================================ */
.cw-data-card {
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  overflow: hidden;
  box-shadow: none;
}

.cw-data-card .card-header {
  background: var(--cw-card-bg);
  border-bottom: 1px solid var(--cw-border-light);
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--cw-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Right-aligned badge/meta in card headers */
.cw-card-header-meta {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
}

.cw-data-card .card-body {
  padding: 0;
}

.cw-data-card .card-footer {
  background: var(--cw-card-bg);
  border-top: 1px solid var(--cw-border-light);
}

/* ============================================================
   8. TABLES
   ============================================================ */
.cw-data-card .table {
  margin: 0;
  color: var(--cw-text);
  font-size: 0.875rem;
}

.cw-data-card .table thead th {
  background: var(--cw-card-bg);
  border-top: none;
  border-bottom: 1px solid var(--cw-border);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cw-text-muted);
  padding: 0.875rem 1.5rem;
  white-space: nowrap;
}

.cw-data-card .table tbody td {
  padding: 0.875rem 1.5rem;
  vertical-align: middle;
  border-color: var(--cw-border-light);
}

.cw-data-card .table tbody tr {
  transition: background-color 0.1s;
}

.cw-data-card .table tbody tr:hover {
  background-color: rgba(73, 169, 66, 0.03);
}

.cw-data-card .table tbody tr:last-child td {
  border-bottom: none;
}

/* Purchase order create — order lines table */
.cw-po-lines-table {
  font-size: 0.875rem;
  border-collapse: collapse;
}
.cw-po-lines-table thead th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cw-text-muted);
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--cw-border);
  white-space: nowrap;
}
.cw-po-lines-table tbody td {
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--cw-border-light);
}
.cw-po-lines-table tbody tr:last-child td {
  border-bottom: none;
}
.cw-po-lines-table .cw-po-col-item {
  min-width: 140px;
}
.cw-po-lines-table .cw-po-col-qty {
  width: 70px;
  white-space: nowrap;
}
.cw-po-lines-table .cw-po-col-unit {
  width: 72px;
}
.cw-po-lines-table .cw-po-col-price,
.cw-po-lines-table .cw-po-col-subtotal {
  width: 100px;
  white-space: nowrap;
}
.cw-po-empty-state {
  background: var(--cw-bg);
}

/* ============================================================
   9. STATUS BADGES (dot + label style)
   ============================================================ */
.cw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 9999px;
  line-height: 1.3;
  white-space: nowrap;
}

.cw-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cw-badge-success,
.cw-badge-active {
  background-color: rgba(73, 169, 66, 0.1);
  color: #2E7D32;
}
.cw-badge-success::before,
.cw-badge-active::before {
  background-color: #49a942;
}

.cw-badge-warning,
.cw-badge-expiring {
  background-color: rgba(245, 134, 33, 0.1);
  color: #c96a0e;
}
.cw-badge-warning::before,
.cw-badge-expiring::before {
  background-color: #f58621;
}

.cw-badge-danger,
.cw-badge-lapsed {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.cw-badge-danger::before,
.cw-badge-lapsed::before {
  background-color: #ef4444;
}

.cw-badge-secondary,
.cw-badge-expired {
  background-color: rgba(113, 128, 150, 0.1);
  color: #64748b;
}
.cw-badge-secondary::before,
.cw-badge-expired::before {
  background-color: #94a3b8;
}

.cw-badge-inactive {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.cw-badge-inactive::before {
  background-color: #ef4444;
}

.cw-badge-pending {
  background-color: rgba(245, 134, 33, 0.12);
  color: #c96a0e;
}
.cw-badge-pending::before {
  background-color: #f58621;
}

.cw-badge-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}
.cw-badge-info::before {
  background-color: #3b82f6;
}

.cw-badge-purple {
  background-color: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
}
.cw-badge-purple::before {
  background-color: var(--cw-purple);
}

/* Journal entry source badges — distinct colors per type */
.cw-je-source { font-weight: 500; }
.cw-je-source-invoice {
  background-color: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}
.cw-je-source-invoice::before { background-color: #7c3aed; }
.cw-je-source-payment {
  background-color: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.cw-je-source-payment::before { background-color: #22c55e; }
.cw-je-source-commission {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0369a1;
}
.cw-je-source-commission::before { background-color: #0ea5e9; }
.cw-je-source-expense {
  background-color: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}
.cw-je-source-expense::before { background-color: #f97316; }
.cw-je-source-manual {
  background-color: rgba(100, 116, 139, 0.12);
  color: #475569;
}
.cw-je-source-manual::before { background-color: #64748b; }

/* ============================================================
   10. BUTTONS
   ============================================================ */
.btn {
  font-family: var(--cw-font);
  font-weight: 500;
  border-radius: var(--cw-radius);
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

/* Top-right page header action buttons (index/show/create/edit) */
.cw-quotes-page-header .btn.btn-sm {
  min-height: 2.25rem;
  padding: 0.375rem 0.85rem;
  line-height: 1.2;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.cw-quotes-page-header .btn.btn-sm i {
  font-size: 0.8rem;
  line-height: 1;
}

.btn-primary {
  background-color: var(--cw-primary) !important;
  border-color: var(--cw-primary) !important;
  color: #fff !important;
  padding: 0.5rem 1.25rem;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--cw-primary-dark) !important;
  border-color: var(--cw-primary-dark) !important;
  box-shadow: 0 2px 8px rgba(73, 169, 66, 0.3);
}

.btn-success {
  background-color: var(--cw-primary) !important;
  border-color: var(--cw-primary) !important;
  color: #fff !important;
}
.btn-success:hover {
  background-color: var(--cw-primary-dark) !important;
  border-color: var(--cw-primary-dark) !important;
}

/* Accent button — orange CTA */
.btn-accent {
  background-color: var(--cw-accent) !important;
  border-color: var(--cw-accent) !important;
  color: #fff !important;
  font-weight: 600;
}
.btn-accent:hover {
  background-color: var(--cw-accent-hover) !important;
  border-color: var(--cw-accent-hover) !important;
}

.btn-outline-secondary {
  border-color: var(--cw-border);
  color: var(--cw-text-secondary);
}
.btn-outline-secondary:hover {
  background: #f7fafc;
  border-color: var(--cw-text-muted);
  color: var(--cw-text);
}

/* Table action buttons */
.cw-data-card .btn-sm {
  border-radius: var(--cw-radius);
  font-weight: 500;
  padding: 0.3125rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-info,
.cw-data-card .btn-info {
  background-color: transparent;
  border: 1px solid var(--cw-border);
  color: var(--cw-text-secondary);
}

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

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

/* ============================================================
   11. TOOLBAR (search + CTA row)
   ============================================================ */
.cw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.cw-toolbar .cw-toolbar-search {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  position: relative;
}

.cw-toolbar .cw-toolbar-search input {
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  width: 100%;
  background: var(--cw-card-bg);
  transition: border-color 0.15s;
}

.cw-toolbar .cw-toolbar-search input:focus {
  border-color: var(--cw-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(73, 169, 66, 0.12);
}

.cw-toolbar .cw-toolbar-search .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cw-text-muted);
  font-size: 0.875rem;
}

.cw-toolbar .cw-toolbar-action {
  margin-left: auto;
}

/* ============================================================
   12. TABS (filter style)
   ============================================================ */
.cw-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--cw-border);
  margin-bottom: 1rem;
}

.cw-tabs .cw-tab {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cw-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
}

.cw-tabs .cw-tab:hover {
  color: var(--cw-primary);
}

.cw-tabs .cw-tab.active {
  color: var(--cw-primary);
  border-bottom-color: var(--cw-primary);
  font-weight: 600;
}

/* ============================================================
   13. FORMS
   ============================================================ */
.cw-form-card {
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  overflow: hidden;
  box-shadow: none;
}

.cw-form-card .card-body {
  padding: 2rem;
}

/* Primary panel — same blue edge as quotation / insurer create */
.cw-form-card.cw-form-card-accent,
.cw-data-card.cw-form-card-accent {
  border-left: 3px solid var(--cw-info, #2563eb);
}

.form-control {
  font-family: var(--cw-font);
  font-size: 0.875rem;
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  padding: 0.5625rem 0.875rem;
  color: var(--cw-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 3px rgba(73, 169, 66, 0.12);
}

.form-control::placeholder {
  color: var(--cw-text-muted);
}

/* Filter dropdowns: comfortable height so options display well */
.cw-filter-select {
  min-height: 2.25rem;
  padding: 0.35rem 0.6rem;
  line-height: 1.4;
}

label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cw-text-secondary);
  margin-bottom: 0.375rem;
}

/* Issue stock (issuance) form: comfortable spacing */
.cw-issuance-form .cw-form-group-spaced {
  margin-bottom: 1.75rem;
}
.cw-issuance-form .cw-form-group-spaced:last-of-type {
  margin-bottom: 0;
}
.cw-issuance-form .cw-form-actions {
  margin-bottom: 0;
}
.cw-issuance-form .form-text.mt-2 {
  margin-bottom: 0.25rem;
}

/* Movements page: item filter dropdown – prevent text clipping */
.cw-movements-item-select {
  line-height: 1.5;
  height: auto;
}

/* GRN create: asset category selector (per line) */
.cw-grn-asset-category-select {
  min-height: 2.25rem;
  line-height: 1.5;
  padding: 0.35rem 0.75rem;
}

.custom-control-label {
  font-weight: 500;
  font-size: 0.875rem;
}

/* ============================================================
   14. ALERTS
   ============================================================ */
.alert {
  border-radius: var(--cw-radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
}

.alert-success {
  background: rgba(73, 169, 66, 0.08);
  color: #2E7D32;
  border-left: 3px solid #49a942;
}

.alert-info {
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  border-left: 3px solid #3b82f6;
}

.alert-warning {
  background: rgba(245, 134, 33, 0.08);
  color: #b45309;
  border-left: 3px solid #f58621;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-left: 3px solid #ef4444;
}

/* ============================================================
   15. PAGINATION
   ============================================================ */
.cw-pagination-nav {
  padding: 0.75rem 1rem;
  gap: 0.75rem;
}

.cw-pagination-info {
  color: var(--cw-text-muted) !important;
  font-size: 0.8125rem;
}

.pagination,
.cw-pagination {
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.page-item .page-link {
  border-radius: var(--cw-radius);
  font-size: 0.8125rem;
  color: var(--cw-text-secondary);
  border-color: var(--cw-border);
  background-color: var(--cw-card-bg);
  padding: 0.35rem 0.6rem;
  min-width: 2rem;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.page-item .page-link:hover {
  background-color: var(--cw-primary-subtle);
  border-color: var(--cw-primary-light);
  color: var(--cw-primary-dark);
}

.page-item.active .page-link {
  background-color: var(--cw-primary);
  border-color: var(--cw-primary);
  color: #fff;
}

.page-item.disabled .page-link {
  background-color: var(--cw-border-light);
  color: var(--cw-text-muted);
  border-color: var(--cw-border);
  cursor: not-allowed;
}

/* ============================================================
   16. EMPTY STATE
   ============================================================ */
.cw-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--cw-text-muted);
}

.cw-empty-state .fas,
.cw-empty-state .far {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.35;
}

.cw-empty-state p {
  font-size: 0.9375rem;
}

/* ============================================================
   17. NOTIFICATIONS LIST
   ============================================================ */
.list-group-flush .list-group-item {
  border-color: var(--cw-border-light);
  padding: 1rem 1.5rem;
}

.list-group-item-action:hover {
  background-color: rgba(73, 169, 66, 0.04);
}

.list-group-item-action strong {
  font-size: 0.875rem;
  color: var(--cw-text);
}

.list-group-item-action small {
  color: var(--cw-text-muted);
}

/* ============================================================
   18. RENEWAL TABLE ROW HIGHLIGHTS
   ============================================================ */
.table-danger td {
  background-color: rgba(239, 68, 68, 0.05) !important;
}
.table-warning td {
  background-color: rgba(245, 134, 33, 0.05) !important;
}

/* ============================================================
   19. CARDS USED IN DETAIL PAGES
   ============================================================ */
.card {
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  box-shadow: none;
}

.card .card-header {
  background: var(--cw-card-bg);
  border-bottom: 1px solid var(--cw-border-light);
  font-weight: 600;
  font-size: 0.9375rem;
}

/* ============================================================
   20. LOGIN PAGE OVERRIDES
   ============================================================ */
.login-page,
.register-page {
  background: var(--cw-bg);
}

.login-box .card,
.register-box .card {
  border-radius: var(--cw-radius-xl);
  border: 1px solid var(--cw-border);
  box-shadow: var(--cw-shadow);
}

.login-box .btn-primary,
.register-box .btn-primary {
  border-radius: var(--cw-radius);
}

/* ============================================================
   21. PRELOADER
   ============================================================ */
.preloader {
  background-color: var(--cw-bg) !important;
}

/* ============================================================
   22. SCROLLBAR CUSTOMIZATION
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

/* ============================================================
   23. MISC UTILITY OVERRIDES
   ============================================================ */
a {
  color: var(--cw-primary-dark);
}
a:hover {
  color: var(--cw-primary-darker);
}

code {
  font-size: 0.8125rem;
  color: var(--cw-text-muted);
  background: #f7fafc;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

strong {
  font-weight: 600;
}

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

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

.content {
  padding: 0 0.5rem;
}

.cw-action-dots {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--cw-text-muted);
  cursor: pointer;
  transition: background 0.15s;
}
.cw-action-dots:hover {
  background: #f7fafc;
  color: var(--cw-text);
}

/* ============================================================
   24. DASHBOARD — Redesigned layout
   ============================================================ */

/* ── Greeting ── */
.cw-greeting {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Header notification bell + date */
.cw-header-notif {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 134, 33, 0.1);
  color: var(--cw-accent);
  font-size: 0.9375rem;
}
.cw-notif-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--cw-danger);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.cw-header-date {
  font-size: 0.8125rem;
  color: var(--cw-text-muted);
  font-weight: 500;
  background: var(--cw-card-bg);
  padding: 0.375rem 0.875rem;
  border-radius: var(--cw-radius);
  border: 1px solid var(--cw-border);
}

/* ── Icon Metric Cards (EduVerse-style) ── */
.cw-icon-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.cw-icon-metric {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cw-icon-metric:hover {
  border-color: var(--cw-primary-light);
  box-shadow: var(--cw-shadow-sm);
}
.cw-icon-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--cw-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}
.cw-icon-metric-icon.cw-icon-green {
  background: rgba(73, 169, 66, 0.12);
  color: var(--cw-primary-dark);
}
.cw-icon-metric-icon.cw-icon-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
.cw-icon-metric-icon.cw-icon-orange {
  background: rgba(245, 134, 33, 0.12);
  color: #d97706;
}
.cw-icon-metric-icon.cw-icon-red {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}
.cw-icon-metric-icon.cw-icon-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}
.cw-icon-metric-body {
  min-width: 0;
}
.cw-icon-metric-label {
  font-size: 0.75rem;
  color: var(--cw-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cw-icon-metric-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--cw-text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 0.125rem;
}

/* ── Secondary stat strip ── */
.cw-stat-strip {
  display: flex;
  gap: 0;
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.cw-stat-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  position: relative;
}
.cw-stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--cw-border);
}
.cw-stat-icon {
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f7fafc;
  flex-shrink: 0;
}
.cw-stat-val {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--cw-text);
  line-height: 1.2;
}
.cw-stat-lbl {
  font-size: 0.75rem;
  color: var(--cw-text-muted);
  font-weight: 400;
}

/* ── New clients list ── */
.cw-client-list {
  padding: 0;
}
.cw-client-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--cw-border-light);
  transition: background 0.1s;
}
.cw-client-item:last-child {
  border-bottom: none;
}
.cw-client-item:hover {
  background: rgba(73, 169, 66, 0.03);
}
.cw-client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cw-primary-light), var(--cw-primary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9375rem;
  flex-shrink: 0;
}
.cw-client-info {
  flex: 1;
  min-width: 0;
}
.cw-client-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--cw-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cw-client-meta {
  font-size: 0.75rem;
  color: var(--cw-text-muted);
  margin-top: 0.125rem;
}
.cw-dot-sep {
  margin: 0 0.25rem;
  opacity: 0.4;
}
.cw-client-date {
  font-size: 0.6875rem;
  color: var(--cw-text-muted);
  white-space: nowrap;
}

/* ── Notification list ── */
.cw-notif-list {
  padding: 0;
}
.cw-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--cw-border-light);
  text-decoration: none;
  transition: background 0.1s;
}
.cw-notif-item:last-child {
  border-bottom: none;
}
.cw-notif-item:hover {
  background: rgba(73, 169, 66, 0.03);
  text-decoration: none;
}
.cw-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.cw-notif-dot.dot-green { background: var(--cw-success); }
.cw-notif-dot.dot-orange { background: var(--cw-warning); }
.cw-notif-dot.dot-red { background: var(--cw-danger); }
.cw-notif-dot.dot-blue { background: var(--cw-info); }
.cw-notif-body {
  flex: 1;
  min-width: 0;
}
.cw-notif-title {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--cw-text);
  line-height: 1.35;
}
.cw-notif-msg {
  font-size: 0.75rem;
  color: var(--cw-text-muted);
  margin-top: 0.125rem;
  line-height: 1.4;
}
.cw-notif-time {
  font-size: 0.6875rem;
  color: var(--cw-text-muted);
  margin-top: 0.25rem;
  opacity: 0.7;
}

/* ── Quick action buttons ── */
.cw-quick-actions .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
}
.cw-qa-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  border-radius: var(--cw-radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cw-text-secondary);
  background: #f7fafc;
  border: 1px solid var(--cw-border-light);
  text-decoration: none;
  transition: all 0.15s;
}
.cw-qa-btn:hover {
  background: var(--cw-primary-subtle);
  border-color: var(--cw-primary-light);
  color: var(--cw-primary-dark);
  text-decoration: none;
}
.cw-qa-btn.cw-qa-primary {
  background: var(--cw-primary);
  border-color: var(--cw-primary);
  color: #fff;
  font-weight: 600;
}
.cw-qa-btn.cw-qa-primary:hover {
  background: var(--cw-primary-dark);
  border-color: var(--cw-primary-dark);
  color: #fff;
}
.cw-qa-btn i {
  font-size: 0.875rem;
  width: 1.125rem;
  text-align: center;
}

/* ── Role badge card ── */
.cw-role-card .card-body {
  background: linear-gradient(135deg, var(--cw-primary-darker), var(--cw-primary-dark));
  border-radius: var(--cw-radius-lg);
  color: #fff;
}
.cw-role-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}
.cw-role-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}
.cw-role-name {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.125rem;
}

/* Module info card (index pages, right sidebar) */
.cw-module-info-card {
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  box-shadow: none;
}
.cw-module-info-card .card-header {
  background: rgba(59, 130, 246, 0.06);
  border-bottom: 1px solid var(--cw-border-light);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--cw-text);
  padding: 1rem 1.25rem;
}
.cw-module-info-card .card-body {
  padding: 1.25rem;
}
.cw-module-info-card .card-body .small {
  line-height: 1.5;
}
.cw-module-info-card .card-body ul {
  margin-bottom: 0.5rem;
}
.cw-module-info-card .card-body li {
  margin-bottom: 0.35rem;
}

/* Table cell helpers */
.cw-cell-primary {
  font-weight: 600;
  color: var(--cw-text);
}
.cw-cell-secondary {
  font-size: 0.75rem;
  color: var(--cw-text-muted);
  margin-top: 0.125rem;
}
.cw-cell-amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Icon-only action buttons in tables — horizontal row, aligned */
.cw-cell-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.25rem;
  white-space: nowrap;
}
.cw-data-card .table td .btn-sm.btn-icon,
.table .btn-sm.btn-icon {
  min-width: 2rem;
  padding: 0.3125rem 0.5rem;
  text-align: center;
  flex-shrink: 0;
}
.cw-data-card .table td .btn-sm.btn-icon + .btn-sm.btn-icon,
.table .btn-sm.btn-icon + .btn-sm.btn-icon {
  margin-left: 0;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .cw-icon-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .cw-icon-metrics { grid-template-columns: 1fr; }
  .cw-stat-strip { flex-direction: column; }
  .cw-stat-item:not(:last-child)::after {
    right: 15%; top: auto; bottom: 0;
    height: 1px; width: 70%;
  }
}

/* ============================================================
   25. CHART CARDS (Dashboard)
   ============================================================ */
.cw-chart-card {
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  animation: cw-chart-card-in 0.55s ease-out both;
}
@keyframes cw-chart-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cw-chart-card:hover {
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  border-color: rgba(73, 169, 66, 0.18);
}
.cw-chart-card .card-header {
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--cw-border-light);
  padding: 0.9rem 1.25rem;
  font-family: 'Poppins', var(--cw-font);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--cw-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cw-chart-header-icon {
  margin-right: 0.45rem;
  font-size: 0.95rem;
  opacity: 0.95;
}
.cw-chart-icon-green { color: var(--cw-primary); }
.cw-chart-icon-blue { color: #3b82f6; }
.cw-chart-icon-purple { color: #8b5cf6; }
.cw-chart-icon-orange { color: var(--cw-accent); }
.cw-chart-card .card-body {
  padding: 1.15rem 1.25rem 1.35rem;
  position: relative;
  min-height: 260px;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(73, 169, 66, 0.04), transparent 55%);
}
.cw-chart-card-doughnut .card-body {
  background: radial-gradient(ellipse 70% 55% at 50% 35%, rgba(59, 130, 246, 0.06), transparent 60%);
}
.cw-chart-period-total {
  font-size: 0.8125rem;
  font-weight: 500;
}
.cw-chart-canvas-wrap {
  position: relative;
  height: 280px;
  min-height: 220px;
}
.cw-chart-doughnut-wrap {
  height: 260px;
  max-width: 280px;
  margin: 0 auto;
}
.cw-chart-card .card-body canvas {
  max-height: 100%;
}
.cw-chart-period {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--cw-text-muted);
  background: rgba(15, 23, 42, 0.05);
  padding: 0.4rem 0.7rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.cw-chart-card-premium .card-header { border-left: 3px solid var(--cw-primary); }
.cw-chart-card-doughnut .card-header { border-left: 3px solid #3b82f6; }
.cw-chart-card-bar .card-header { border-left: 3px solid #8b5cf6; }
.cw-chart-card-conversion .card-header { border-left: 3px solid var(--cw-accent); }

.cw-chart-empty {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}
.cw-chart-empty-icon {
  font-size: 1.75rem;
  opacity: 0.35;
}

/* Dashboard header: period dropdown (avoid text clipping) */
.cw-dashboard-period-select {
  width: auto;
  min-width: 160px;
  height: auto;
  min-height: 2.25rem;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  line-height: 1.5;
  vertical-align: middle;
  appearance: auto;
}

/* ============================================================
   26. CLIENT CREATE — Type toggle & info card
   ============================================================ */
.cw-type-toggle {
  display: inline-flex;
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  padding: 3px;
  position: relative;
}
.cw-type-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.cw-type-toggle label {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cw-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin: 0;
}
.cw-type-toggle label:hover {
  color: var(--cw-text-secondary);
}
.cw-type-toggle input:checked + label,
.cw-type-toggle input:focus-visible + label {
  background: var(--cw-primary);
  color: #fff;
  font-weight: 600;
}
.cw-type-toggle input:checked + label + input + label {
  background: transparent;
  color: var(--cw-text-muted);
}
.cw-type-toggle input#type_corporate:checked + label {
  background: var(--cw-primary);
  color: #fff;
}

.cw-info-card {
  background: linear-gradient(135deg, rgba(73, 169, 66, 0.06), rgba(73, 169, 66, 0.02));
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  border-left: 3px solid var(--cw-primary);
}
.cw-info-card .card-body {
  padding: 1.25rem 1.5rem;
}
.cw-info-card .card-header {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--cw-text);
  border-bottom: 1px solid var(--cw-border-light);
}
.cw-info-card h5 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--cw-text);
}
.cw-info-intro {
  font-size: 0.875rem;
  color: var(--cw-text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.cw-info-heading {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--cw-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 1rem 0 0.5rem;
}
.cw-info-heading:first-of-type {
  margin-top: 0;
}
.cw-info-steps,
.cw-info-list {
  font-size: 0.8125rem;
  color: var(--cw-text-secondary);
  line-height: 1.55;
  padding-left: 1.25rem;
  margin: 0 0 0.75rem;
}
.cw-info-steps li,
.cw-info-list li {
  margin-bottom: 0.375rem;
}
.cw-info-text {
  font-size: 0.8125rem;
  color: var(--cw-text-secondary);
  line-height: 1.55;
  margin: 0 0 0.75rem;
}
.cw-form-section h6 {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cw-text-secondary);
}

/* Document section info card (inside client create) */
.cw-doc-info {
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  border-left: 3px solid var(--cw-info);
}
.cw-doc-info .card-body {
  padding: 1rem 1.25rem;
}
.cw-doc-info h6 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--cw-text);
}
.cw-doc-info .small {
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* ============================================================
   CLIENT CREATE — Centered layout & step tracker
   ============================================================ */
.cw-create-wrap {
  max-width: auto;
  margin-left: auto;
  margin-right: auto;
}

.cw-step-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.cw-step-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cw-text-muted);
  transition: all 0.2s ease;
}
.cw-step-item .cw-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cw-border);
  color: var(--cw-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.cw-step-item.active {
  background: var(--cw-primary);
  border-color: var(--cw-primary);
  color: #fff;
}
.cw-step-item.active .cw-step-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.cw-step-item.completed {
  background: var(--cw-primary-subtle);
  border-color: var(--cw-primary-light);
  color: var(--cw-primary-dark);
}
.cw-step-item.completed .cw-step-num {
  background: var(--cw-primary);
  color: #fff;
}
.cw-step-line {
  width: 40px;
  height: 2px;
  background: var(--cw-border);
  flex-shrink: 0;
}
.cw-step-panel {
  padding: 0.125rem 0;
}

/* Index page headers — matches create page style */
.cw-quotes-page-header {
  padding: 0.5rem 0.5rem 1rem;
}
.cw-quotes-page-header .cw-quotes-title {
  font-family: 'DM Sans', var(--cw-font);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--cw-text);
  margin: 0 0 0.375rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cw-quotes-title-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.125rem;
  flex-shrink: 0;
}
.cw-quotes-page-header .cw-quotes-subtitle {
  font-family: 'DM Sans', var(--cw-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--cw-text-secondary);
  margin: 0;
}
/* Quotation show — Preview button (orange border + icon) */
.cw-preview-btn {
  border: 1px solid var(--cw-accent);
  color: var(--cw-accent);
  background: transparent;
  border-radius: var(--cw-radius);
  font-weight: 500;
  padding: 0.3125rem 0.75rem;
}
.cw-preview-btn:hover {
  background: rgba(245, 134, 33, 0.08);
  border-color: var(--cw-accent);
  color: var(--cw-accent);
}
.cw-preview-btn i {
  color: var(--cw-accent);
}

/* Quotation show — Actions: uniform button sizing */
.cw-quote-actions-btns {
  align-items: stretch;
}
.cw-quote-actions-btns .cw-quote-action-btn-form {
  flex: 1;
  min-width: 0;
  display: flex;
}
.cw-quote-actions-btns .cw-quote-action-btn-form .cw-quote-action-btn {
  flex: 1;
  width: 100%;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cw-quote-actions-btns > .cw-quote-action-btn {
  flex: 1;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Quotation show — Next step / Record client response card (pending) */
/* Glow animation — slower interval so it doesn’t feel rushed */
@keyframes cw-quote-actions-glow {
  0%, 100% {
    border-color: rgba(73, 169, 66, 0.45);
    box-shadow: 0 0 0 1px rgba(73, 169, 66, 0.3), 0 0 12px 0 rgba(73, 169, 66, 0.05);
  }
  50% {
    border-color: rgba(73, 169, 66, 0.85);
    box-shadow: 0 0 0 2px rgba(73, 169, 66, 0.5), 0 0 20px 6px rgba(73, 169, 66, 0.25);
  }
}

.cw-quote-actions-guide {
  border: 2px solid rgba(73, 169, 66, 0.45);
  background: linear-gradient(135deg, rgba(73, 169, 66, 0.06) 0%, rgba(245, 134, 33, 0.04) 100%);
  animation: cw-quote-actions-glow 2.5s ease-in-out infinite;
  border-radius: var(--cw-radius-lg);
  overflow: hidden;
}
.cw-quote-actions-guide-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(73, 169, 66, 0.06);
  border-bottom: 1px solid rgba(73, 169, 66, 0.15);
  padding: 1.25rem 1.5rem;
}
.cw-quote-actions-guide-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cw-primary-dark);
  background: rgba(73, 169, 66, 0.15);
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
}
.cw-quote-actions-guide-header strong {
  font-size: 0.9375rem;
}
.cw-quote-actions-guide-icon {
  color: var(--cw-primary);
}
.cw-quote-actions-guide-body {
  padding: 1.5rem 1.5rem 1.75rem;
}
.cw-quote-actions-guide-copy {
  font-size: 0.9375rem;
  color: var(--cw-text-secondary);
  line-height: 1.55;
  margin: 0 0 1.35rem 0;
}
.cw-quote-actions-guide-body .cw-quote-actions-btns {
  margin: 0;
  gap: 0.85rem;
}
.cw-quote-actions-guide-body .cw-quote-action-btn {
  min-height: 2.5rem;
  padding: 0.4rem 1rem;
}

/* Quotation show — pending hint in header (conspicuous, not dull) */
.cw-quote-pending-hint {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cw-primary-dark);
}

/* Add Client page header — uniform with other pages */
.cw-create-page-header {
  padding: 0.5rem 0 1rem;
}
.cw-create-page-header .cw-create-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--cw-text);
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
}
.cw-create-page-header .cw-create-subtitle {
  font-size: 0.875rem;
  color: var(--cw-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Quotation create header — icon + title + subtitle */
.cw-create-page-header.cw-create-quote-header {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.cw-create-page-header.cw-create-quote-header .cw-create-header-inner {
  max-width: 760px;
}
.cw-create-page-header.cw-create-quote-header .cw-create-title {
  font-family: 'DM Sans', var(--cw-font);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}
.cw-create-page-header.cw-create-quote-header .cw-create-title-icon {
  font-size: 1.5rem;
  color: var(--cw-primary);
  flex-shrink: 0;
}
.cw-create-page-header.cw-create-quote-header .cw-create-subtitle {
  font-family: 'DM Sans', var(--cw-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  max-width: 640px;
  color: var(--cw-text-secondary);
  margin: 0;
}

/* Step tracker inside form card (quotation create) */
.cw-step-tracker-in-card {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--cw-border);
  justify-content: flex-start;
}

/* Quotation create: two-column layout — form left, info card right */
.cw-quotation-create-layout .row {
  align-items: start;
}
.cw-quote-sidebar-card {
  position: sticky;
  top: 1rem;
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  box-shadow: var(--cw-shadow-sm);
}
/* Blue "Creating a quotation" styling on sidebar card */
.cw-quote-sidebar-card.cw-doc-info {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid var(--cw-border);
  border-left: 3px solid var(--cw-info);
}
.cw-quote-sidebar-card .card-body {
  padding: 1.25rem;
}
.cw-quote-sidebar-card .cw-sidebar-card-title {
  font-family: 'DM Sans', var(--cw-font);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: var(--cw-text);
}
.cw-quote-sidebar-card .cw-sidebar-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cw-info);
  margin: 1rem 0 0.35rem 0;
}
.cw-quote-sidebar-card .cw-sidebar-heading:first-of-type {
  margin-top: 0.5rem;
}
.cw-quote-sidebar-card .cw-sidebar-list {
  padding-left: 1.125rem;
  line-height: 1.55;
}
.cw-quote-sidebar-card .cw-sidebar-list li + li {
  margin-top: 0.35rem;
}
@media (max-width: 991.98px) {
  .cw-quote-sidebar-card {
    position: static;
    margin-top: 1.5rem;
  }
}

/* Document upload row — upload button + preview */
.cw-doc-row .cw-btn-upload-doc {
  white-space: nowrap;
}
.cw-doc-preview {
  min-height: 0;
}
.cw-doc-preview-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--cw-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  margin-top: 0.5rem;
  max-width: 100%;
}
.cw-doc-preview-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Client create — document type select: taller, clearer selected value */
.cw-doc-type-select {
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.4;
}
.cw-doc-type-select option {
  padding: 0.35rem 0.5rem;
  font-size: 0.9375rem;
}

/* Client create — larger document preview so user can see what was uploaded */
.cw-client-doc-upload .cw-doc-preview {
  min-height: 0;
  margin-top: 0.75rem;
}
.cw-client-doc-upload .cw-doc-preview-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  max-width: 100%;
}
.cw-client-doc-upload .cw-doc-preview-img {
  width: auto;
  height: auto;
  max-width: 260px;
  max-height: 320px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--cw-border);
  flex-shrink: 0;
}
.cw-client-doc-upload .cw-doc-preview-name {
  max-width: 100%;
}
.cw-client-doc-upload .cw-doc-preview-remove {
  margin-left: auto;
  margin-top: 0.25rem;
}
.cw-doc-preview-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.cw-doc-preview-name {
  font-size: 0.8125rem;
  color: var(--cw-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.cw-doc-preview-remove {
  margin-left: auto;
  padding: 0.25rem;
  border: none;
  background: transparent;
  color: var(--cw-text-muted);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.cw-doc-preview-remove:hover {
  color: var(--cw-danger, #dc3545);
  background: rgba(220, 53, 69, 0.08);
}

/* Quotation create — risk document preview list (Step 2) */
.cw-doc-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cw-doc-preview-list .cw-doc-preview-item {
  padding: 0.5rem 0.75rem;
  background: var(--cw-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
}
.cw-doc-preview-list .cw-doc-preview-thumb {
  max-width: 80px;
  max-height: 60px;
  object-fit: cover;
  border-radius: 4px;
  vertical-align: middle;
}
.cw-risk-doc-group .btn.cw-clear-docs {
  display: inline-block;
}

/* ============================================================
   27. SEARCH IN CARD HEADERS (used on index pages)
   ============================================================ */
.cw-quote-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.75rem;
}
.cw-quote-toolbar .cw-tabs {
  flex-shrink: 0;
}
.cw-quote-toolbar .cw-toolbar-search {
  margin-left: auto;
}

.cw-toolbar-search {
  position: relative;
}

.cw-toolbar-search .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cw-text-muted);
  font-size: 0.8125rem;
}

.cw-toolbar-search input {
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  padding: 0.4375rem 0.875rem 0.4375rem 2.125rem;
  font-size: 0.8125rem;
  font-family: var(--cw-font);
  width: 240px;
  background: var(--cw-card-bg);
  color: var(--cw-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cw-toolbar-search input::placeholder {
  color: var(--cw-text-muted);
}

.cw-toolbar-search input:focus {
  outline: none;
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 3px rgba(73, 169, 66, 0.1);
}

/* Journal entries card: search next to title (not pushed right), wide enough for placeholder */
.cw-journal-entries-card .card-header {
  justify-content: flex-start;
}
.cw-journal-entries-card .card-header .cw-toolbar-search--wide input {
  min-width: 300px;
  width: 300px;
}

/* ============================================================
   PERIOD FILTER BUTTONS
   ============================================================ */
.cw-period-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Custom date range filter */
.cw-custom-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--cw-border);
}
.cw-custom-date-filter input[type="date"] {
  width: 140px;
  font-size: 0.8125rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius);
  background: var(--cw-card-bg);
  color: var(--cw-text);
  font-family: var(--cw-font);
}
.cw-custom-date-filter input[type="date"]:focus {
  outline: none;
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 2px rgba(73,169,66,.12);
}
.cw-date-sep {
  font-size: 0.75rem;
  color: var(--cw-text-muted);
}
@media (max-width: 768px) {
  .cw-custom-date-filter {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    width: 100%;
  }
}
.cw-period-btn {
  display: inline-block;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--cw-font);
  color: var(--cw-text-secondary);
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  text-decoration: none;
  transition: all 0.15s ease;
}
.cw-period-btn:hover {
  color: var(--cw-primary-dark);
  border-color: var(--cw-primary-light);
  background: var(--cw-primary-subtle);
  text-decoration: none;
}
.cw-period-btn.active {
  background: var(--cw-primary);
  color: #fff;
  border-color: var(--cw-primary);
}
.cw-period-btn.active:hover {
  background: var(--cw-primary-dark);
  border-color: var(--cw-primary-dark);
  color: #fff;
}

/* ============================================================
   CHANGE BADGES (% up / down / flat)
   ============================================================ */
.cw-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  margin-top: 0.25rem;
}
.cw-change i {
  font-size: 0.5625rem;
}
.cw-change-up {
  background: rgba(73, 169, 66, 0.1);
  color: #2E7D32;
}
.cw-change-down {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.cw-change-flat {
  background: rgba(113, 128, 150, 0.1);
  color: #64748b;
}

/* ============================================================
   SHOW PAGE — KPI Strip, Detail Table, Documents, Timeline
   ============================================================ */
.cw-show-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.cw-show-kpi {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 1.125rem 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cw-show-kpi:hover {
  border-color: var(--cw-primary-light);
  box-shadow: var(--cw-shadow-sm);
}
.cw-show-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.cw-show-kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cw-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.125rem;
}
.cw-show-kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cw-text);
  line-height: 1.3;
}

/* Supplier show: Details table — fixed column widths so value column is not squeezed */
.cw-supplier-detail-table {
  table-layout: fixed;
  width: 100%;
}
.cw-supplier-details-body {
  padding: 0 !important;
}
.cw-supplier-detail-table th {
  width: 220px;
  max-width: 35%;
  font-weight: 600;
  color: var(--cw-text-muted);
  font-size: 0.8125rem;
  padding: 0.875rem 1.25rem;
  vertical-align: top;
  border-color: var(--cw-border-light);
}
.cw-supplier-detail-table td {
  padding: 0.875rem 1.25rem;
  vertical-align: top;
  border-color: var(--cw-border-light);
  word-wrap: break-word;
  min-width: 0;
}

/* Detail table inside show page */
.cw-show-detail-table {
  margin: 0;
  font-size: 0.875rem;
}
.cw-show-detail-table td {
  padding: 0.875rem 1.25rem;
  vertical-align: middle;
  border-color: var(--cw-border-light);
}
.cw-show-detail-table .cw-show-label {
  font-weight: 600;
  color: var(--cw-text-muted);
  font-size: 0.8125rem;
  width: 120px;
  white-space: nowrap;
}
.cw-show-link {
  color: var(--cw-primary-dark);
  font-weight: 600;
  text-decoration: none;
}
.cw-show-link:hover {
  color: var(--cw-primary);
  text-decoration: underline;
}
.cw-show-product-tag {
  display: inline-block;
  background: var(--cw-primary-subtle);
  color: var(--cw-primary-dark);
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Documents grid */
.cw-show-doc-grid {
  padding: 1rem 1.25rem;
}
.cw-show-doc-group {
  margin-bottom: 1.25rem;
}
.cw-show-doc-group:last-child {
  margin-bottom: 0;
}
.cw-show-doc-type-header {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cw-text-secondary);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--cw-border-light);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.cw-show-doc-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cw-primary-subtle);
  color: var(--cw-primary-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  margin-left: auto;
}
.cw-show-doc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--cw-radius);
  transition: background-color 0.15s;
}
.cw-show-doc-item:hover {
  background: rgba(59, 130, 246, 0.04);
}
.cw-show-doc-icon {
  font-size: 1.25rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.cw-show-doc-info {
  flex: 1;
  min-width: 0;
}
.cw-show-doc-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cw-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cw-show-doc-meta {
  font-size: 0.75rem;
  color: var(--cw-text-muted);
}
.cw-show-doc-dl {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.cw-show-doc-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--cw-text-muted);
}
.cw-show-doc-empty i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.4;
  display: block;
}
.cw-show-doc-empty p {
  margin: 0;
  font-size: 0.875rem;
}

/* Client avatar */
.cw-show-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--cw-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Timeline */
.cw-show-timeline {
  position: relative;
}
.cw-show-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding-bottom: 1.125rem;
  position: relative;
}
.cw-show-timeline-item:last-child {
  padding-bottom: 0;
}
.cw-show-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--cw-border);
}
.cw-show-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* Responsive: stack detail table on mobile */
@media (max-width: 767.98px) {
  .cw-show-detail-table tr {
    display: flex;
    flex-wrap: wrap;
  }
  .cw-show-detail-table td {
    width: 50%;
    box-sizing: border-box;
  }
  .cw-show-kpi-strip {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 575.98px) {
  .cw-show-kpi-strip {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   VIEW TOGGLE — List / Grid switch buttons
   ============================================================ */
.cw-view-toggle-group {
  margin-left: auto;
  flex-shrink: 0;
}

.cw-view-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--cw-radius);
  border: 1px solid var(--cw-accent);
  background: var(--cw-card-bg);
  color: var(--cw-accent);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0.4rem 0.65rem;
  gap: 0.35rem;
}
.cw-view-toggle:hover {
  color: var(--cw-accent-hover);
  border-color: var(--cw-accent-hover);
  background: rgba(245, 134, 33, 0.06);
}
.cw-view-toggle.active {
  color: #fff;
  background: var(--cw-primary);
  border-color: var(--cw-primary);
}

/* ============================================================
   PRODUCT GRID — Card layout for grid view
   ============================================================ */
.cw-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.cw-product-card {
  background: var(--cw-card-bg);
  border: 1px solid var(--cw-border);
  border-radius: var(--cw-radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cw-product-card:hover {
  border-color: var(--cw-primary-light);
  box-shadow: var(--cw-shadow-sm);
}
.cw-product-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}
.cw-product-card-body {
  flex: 1;
  min-width: 0;
}
.cw-product-card-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--cw-text);
  margin: 0 0 0.25rem;
  line-height: 1.3;
}
.cw-product-card-desc {
  font-size: 0.8125rem;
  color: var(--cw-text-muted);
  line-height: 1.45;
  margin: 0 0 0.5rem;
}
.cw-product-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cw-product-card-slug {
  font-size: 0.6875rem;
  color: var(--cw-text-muted);
  background: #f7fafc;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--cw-border-light);
}
.cw-product-card-docs {
  font-size: 0.75rem;
  color: var(--cw-text-muted);
  margin-top: 0.25rem;
}
.cw-product-card-docs i {
  color: var(--cw-info);
  margin-right: 0.25rem;
}
.cw-product-card-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--cw-border-light);
}

@media (max-width: 768px) {
  .cw-product-grid {
    grid-template-columns: 1fr;
  }
}

/* Insurer create/edit: product selection (icon + label, uniform card width) */
.cw-insurer-product-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.cw-insurer-product-option {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  min-height: 5.5rem;
  box-sizing: border-box;
}
.cw-insurer-product-option:hover {
  border-color: rgba(0, 0, 0, 0.2);
}
.cw-insurer-product-option.active {
  border-color: var(--cw-accent, #2563eb);
  box-shadow: 0 0 0 1px var(--cw-accent, #2563eb);
}

/* Payment method options (Record Payment form): thin 1px border; color set per-method via JS */
.cw-payment-method-option { border-width: 1px; }
.cw-payment-method-option.active {
  border-width: 1px !important;
  box-shadow: none !important;
}

/* Product create/edit: Custom option — multicolor border, vibrant look */
.cw-product-option-custom {
  border: 2px solid transparent !important;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #7c3aed 0%, #2563eb 35%, #16a34a 70%, #eab308 100%) border-box;
  box-shadow: none !important;
}
.cw-product-option-custom:hover {
  background: linear-gradient(#faf9ff, #faf9ff) padding-box,
    linear-gradient(135deg, #7c3aed 0%, #2563eb 35%, #16a34a 70%, #eab308 100%) border-box;
}
.cw-product-option-custom.active {
  background: linear-gradient(#f5f3ff, #f5f3ff) padding-box,
    linear-gradient(135deg, #7c3aed 0%, #2563eb 35%, #16a34a 70%, #eab308 100%) border-box;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.3), 0 2px 8px rgba(124, 58, 237, 0.15) !important;
}
.cw-product-option-custom .cw-insurer-product-icon {
  color: #7c3aed;
}
.cw-product-option-custom.active .cw-insurer-product-icon {
  color: #fff;
}
.cw-product-option-custom .cw-insurer-product-label {
  color: #5b21b6;
  font-weight: 600;
}

/* Product create/edit: custom icon/color panel — multicolor border, soft tint (no grey) */
.cw-product-custom-fields {
  border: 2px solid transparent;
  background: linear-gradient(#faf9ff 0%, #f0f9ff 100%) padding-box,
    linear-gradient(135deg, #7c3aed 0%, #2563eb 50%, #16a34a 100%) border-box;
}

.cw-insurer-product-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.06);
  color: var(--cw-accent, #2563eb);
}
.cw-insurer-product-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #374151;
  text-align: center;
  line-height: 1.2;
  width: 100%;
  word-wrap: break-word;
}
@media (max-width: 576px) {
  .cw-insurer-product-options {
    grid-template-columns: 1fr;
  }
}

/* Product create/edit: icon picker grid (Font Awesome icon list) */
.cw-product-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.25rem;
}
.cw-product-icon-picker-item {
  width: 44px;
  height: 44px;
  border: 2px solid var(--cw-border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.cw-product-icon-picker-item:hover {
  border-color: var(--cw-primary, #2563eb);
  background: rgba(37, 99, 235, 0.06);
  color: var(--cw-primary, #2563eb);
}
.cw-product-icon-picker-item.selected {
  border-color: var(--cw-primary, #2563eb);
  background: rgba(37, 99, 235, 0.12);
  color: var(--cw-primary, #2563eb);
}

/* Product create/edit: required document types (beautiful checkbox list) */
.cw-doc-checkbox-list {
  display: grid;
  /* min(100%, 260px) keeps tracks inside narrow parents (e.g. insurer product cards) */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.cw-doc-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--cw-border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.cw-doc-checkbox-item:hover {
  background: rgba(124, 58, 237, 0.04);
  border-color: rgba(124, 58, 237, 0.25);
}
.cw-doc-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.cw-doc-checkbox-input:focus-visible + .cw-doc-checkbox-box {
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.4);
}
.cw-doc-checkbox-input:checked + .cw-doc-checkbox-box {
  background: var(--cw-accent, #7c3aed);
  border-color: var(--cw-accent, #7c3aed);
  color: #fff;
}
.cw-doc-checkbox-input:checked + .cw-doc-checkbox-box .cw-doc-checkbox-check {
  opacity: 1;
  transform: scale(1);
}
.cw-doc-checkbox-item:has(.cw-doc-checkbox-input:checked) {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.35);
}
.cw-doc-checkbox-box {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.cw-doc-checkbox-check {
  font-size: 0.65rem;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.15s, transform 0.15s;
}
.cw-doc-checkbox-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--cw-text, #374151);
  line-height: 1.35;
  user-select: none;
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.cw-doc-checkbox-item:has(.cw-doc-checkbox-input:checked) .cw-doc-checkbox-label {
  color: var(--cw-accent, #7c3aed);
}

/* Narrow columns (insurer product cards): allow body to shrink so doc grid fits */
.js-product-card > .card-body {
  min-width: 0;
}

/* ============================================================
   AUTH PAGES (login, register, forgot, reset)
   ============================================================ */
body.cw-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cw-bg);
  padding: 1.5rem;
  font-family: var(--cw-font);
}
.cw-auth-wrap {
  width: 100%;
  max-width: 420px;
}
.cw-auth-logo a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--cw-primary-dark);
  font-weight: 700;
  font-family: 'Poppins', var(--cw-font);
  font-size: 1.5rem;
}
.cw-auth-logo .brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cw-primary), var(--cw-primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
}
.cw-auth-card {
  border: none;
  border-radius: var(--cw-radius-lg);
  box-shadow: var(--cw-shadow-md);
  overflow: hidden;
}
.cw-auth-card .card-header {
  background: linear-gradient(135deg, var(--cw-primary), var(--cw-primary-dark));
  color: #fff;
  border: none;
  padding: 1rem 1.25rem;
}
.cw-auth-card .card-title {
  font-weight: 600;
  margin: 0;
  font-size: 1.125rem;
}
.cw-auth-card .card-body {
  padding: 1.5rem 1.25rem;
}
.cw-auth-card .form-control:focus {
  border-color: var(--cw-primary);
  box-shadow: 0 0 0 0.2rem rgba(73, 169, 66, 0.2);
}
.cw-auth-btn {
  background: var(--cw-accent);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--cw-radius);
}
.cw-auth-btn:hover {
  background: var(--cw-accent-hover);
  color: #fff;
}
.cw-auth-link {
  color: var(--cw-primary);
  font-weight: 500;
}
.cw-auth-link:hover {
  color: var(--cw-primary-dark);
}

/* ============================================================
   Toast / notification alerts (replace default browser alerts)
   ============================================================ */
.cw-alerts-wrapper {
  margin-bottom: 1rem;
}
.cw-toast-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem 0.875rem 1rem;
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow-md);
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  animation: cw-toast-in 0.25s ease-out;
}
.cw-alerts-wrapper .cw-toast-alert:last-child {
  margin-bottom: 0;
}
@keyframes cw-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cw-toast-alert-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}
.cw-toast-alert-message {
  flex: 1;
  line-height: 1.4;
}
.cw-toast-alert-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
  padding: 0 0.25rem;
  color: inherit;
}
.cw-toast-alert-close:hover {
  opacity: 1;
}
.cw-toast-alert-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #065f46;
  border-color: #a7f3d0;
}
.cw-toast-alert-success .cw-toast-alert-icon { color: #059669; }
.cw-toast-alert-info {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
  border-color: #93c5fd;
}
.cw-toast-alert-info .cw-toast-alert-icon { color: #2563eb; }
.cw-toast-alert-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  border-color: #fecaca;
}
.cw-toast-alert-error .cw-toast-alert-icon { color: #dc2626; }
.cw-toast-alert-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  border-color: #fde68a;
}
.cw-toast-alert-warning .cw-toast-alert-icon { color: #d97706; }

/* Container for JS-driven toasts (fixed top-right) */
.cw-toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
  pointer-events: none;
}
.cw-toast-container .cw-toast-alert {
  pointer-events: auto;
  margin-bottom: 0;
}

/* ============================================================
   FILE INPUT — styled choose-file button
   ============================================================ */
.cw-risk-doc-input {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  color: #374151;
  padding: 0;
  border: none;
  background: transparent;
}
.cw-risk-doc-input::file-selector-button {
  padding: 6px 14px;
  background: #49a942;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
  transition: background 0.15s;
  font-family: inherit;
}
.cw-risk-doc-input::file-selector-button:hover {
  background: #2E7D32;
}
.cw-risk-doc-input.is-invalid::file-selector-button {
  background: #dc3545;
}

/* ============================================================
   QUOTATION SHOW — Next step: Record client response card
   ============================================================ */
@keyframes cw-pulse-border {
  0%   { border-color: #cbd5e1; box-shadow: none; }
  50%  { border-color: #f97316; box-shadow: 0 0 0 4px rgba(249,115,22,.14); }
  100% { border-color: #cbd5e1; box-shadow: none; }
}

.cw-next-step-card {
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  animation: cw-pulse-border 3s ease-in-out infinite;
}

.cw-next-step-body {
  padding: 1.6rem 1.75rem 1.75rem;
}

/* ── Header row ── */
.cw-next-step-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.cw-next-step-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  border-radius: 20px;
  padding: 3px 11px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}

.cw-next-step-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.cw-next-step-icon {
  color: #f97316;
}

/* ── Divider ── */
.cw-next-step-hr {
  border: none;
  border-top: 1px solid #f1f5f9;
  margin: 1rem 0;
}

/* ── Description ── */
.cw-next-step-copy {
  font-size: .9rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* ── Action buttons row ── */
.cw-next-step-btns {
  display: flex;
  gap: .875rem;
  flex-wrap: wrap;
}

/* Shared base for both action buttons */
.cw-next-step-accept-btn,
.cw-next-step-reject-btn {
  flex: 1 1 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .35rem 1.1rem;
  border-radius: 8px;
  border: 1.5px solid;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: background .17s, box-shadow .17s, transform .12s;
}

.cw-next-step-accept-btn:hover,
.cw-next-step-accept-btn:focus {
  background: #f0fdf4;
  box-shadow: 0 4px 14px rgba(22,163,74,.14);
  transform: translateY(-1px);
  outline: none;
}

.cw-next-step-reject-btn:hover,
.cw-next-step-reject-btn:focus {
  background: #fff1f2;
  box-shadow: 0 4px 14px rgba(220,38,38,.12);
  transform: translateY(-1px);
  outline: none;
}

/* Accept colours */
.cw-next-step-accept-btn {
  border-color: #86efac;
  color: #15803d;
}

/* Reject colours */
.cw-next-step-reject-btn {
  border-color: #fca5a5;
  color: #dc2626;
}

/* Icon circle */
.cw-nsa-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
}

.cw-next-step-accept-btn .cw-nsa-icon {
  background: #dcfce7;
  color: #16a34a;
}

.cw-next-step-reject-btn .cw-nsa-icon {
  background: #fee2e2;
  color: #dc2626;
}

/* Button label */
.cw-nsa-label {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.2;
}

/* ============================================================
   QUOTATION SHOW — Cancelled proforma row
   ============================================================ */
.cw-proforma-cancelled {
  background: #fafafa;
}

/* ============================================================
   HELP CENTER
   ============================================================ */

/* Index — category icon chip */
.cw-help-cat-icon {
  width: 2rem;
  height: 2rem;
  border-radius: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  flex-shrink: 0;
}

/* Index — article count pill */
.cw-help-count-badge {
  background: var(--cw-border-light);
  color: var(--cw-text-muted);
  font-size: .7rem;
  font-weight: 600;
  padding: .25em .55em;
}

/* Index — article card link */
a.cw-help-article-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--cw-border);
  border-radius: .75rem;
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
a.cw-help-article-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  border-color: var(--cw-primary);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

/* Index — article icon */
.cw-help-article-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.cw-help-article-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--cw-text);
  line-height: 1.3;
  margin-bottom: .25rem;
}

.cw-help-article-excerpt {
  font-size: .78rem;
  color: var(--cw-text-muted);
  line-height: 1.5;
}

.cw-help-article-footer {
  font-size: .75rem;
  color: var(--cw-primary);
  font-weight: 600;
  background: transparent;
  border-top: 1px solid var(--cw-border-light);
  padding: .5rem 1rem;
}
a.cw-help-article-card:hover .cw-help-article-footer {
  color: var(--cw-primary-dark);
}

/* Show — breadcrumb */
.cw-help-breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}
.cw-help-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: var(--cw-text-muted);
}
.cw-help-breadcrumb a {
  color: var(--cw-help-accent, var(--cw-primary));
  font-weight: 600;
}

/* Help article — page header (content_header) */
.cw-help-show-header {
  --cw-help-accent: var(--cw-primary);
  padding: 0.25rem 0.5rem 1.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--cw-border-light);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
.cw-help-show-header-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}
@media (min-width: 768px) {
  .cw-help-show-header-main {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
  }
}
.cw-help-show-header-text {
  flex: 1;
  min-width: 0;
}
.cw-help-show-title {
  font-family: 'DM Sans', var(--cw-font);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--cw-text);
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
@media (min-width: 768px) {
  .cw-help-show-title {
    font-size: 1.65rem;
  }
}
.cw-help-show-title-icon {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  font-size: 1.05rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.cw-help-show-excerpt {
  font-family: 'DM Sans', var(--cw-font);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--cw-text-secondary);
  margin: 0;
  max-width: 40rem;
}
.cw-help-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cw-text-secondary);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  margin: 0 -0.65rem;
  border-radius: 0.5rem;
  transition: color 0.15s ease, background 0.15s ease;
}
.cw-help-back-link:hover {
  color: var(--cw-help-accent, var(--cw-primary));
  background: rgba(15, 23, 42, 0.04);
  text-decoration: none;
}

/* Article layout row — accent variable for body + aside */
.cw-help-article-layout {
  --cw-help-accent: var(--cw-primary);
  align-items: flex-start;
}

/* Reading surface (replaces heavy card shell) */
.cw-help-reading {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  border-left: 3px solid var(--cw-help-accent, var(--cw-primary));
  padding: 1.5rem 1.35rem 1.75rem;
}
@media (min-width: 768px) {
  .cw-help-reading {
    padding: 1.75rem 2rem 2rem;
  }
}

/* Sticky sidebar — one panel, topic accent only */
.cw-help-aside {
  position: sticky;
  top: 0.75rem;
}
.cw-help-aside-panel {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 0.75rem;
  padding: 1.1rem 1.15rem 1.15rem;
  border-left: 3px solid var(--cw-help-accent, var(--cw-primary));
}
.cw-help-aside-topic {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}
.cw-help-aside-topic-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.22);
  background: color-mix(in srgb, var(--cw-help-accent, var(--cw-primary)) 14%, transparent);
  color: var(--cw-help-accent, var(--cw-primary));
  font-size: 0.95rem;
}
.cw-help-aside-topic-label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--cw-text);
  letter-spacing: -0.02em;
}
.cw-help-aside-note {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--cw-text-muted);
  margin: 0 0 1rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.cw-help-aside-section {
  margin-bottom: 1rem;
}
.cw-help-aside-heading {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cw-text-muted);
  margin-bottom: 0.5rem;
}
.cw-help-aside-list li + li {
  margin-top: 0.15rem;
}
.cw-help-aside-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  margin: 0 -0.5rem;
  border-radius: 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cw-text-secondary);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.cw-help-aside-link i {
  width: 1.15rem;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}
.cw-help-aside-link:hover {
  background: #fff;
  color: var(--cw-primary);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.cw-help-aside-cta {
  margin-top: 0.25rem;
  font-weight: 600;
}

/* Legacy: index / old show related list (if referenced elsewhere) */
.cw-help-related-item {
  font-size: .82rem;
  padding: .5rem .9rem;
  color: var(--cw-text-secondary);
  border-left: 0;
  border-right: 0;
}
.cw-help-related-item:hover {
  color: var(--cw-primary);
  background: var(--cw-primary-subtle);
}

/* Deprecated shell — kept for any stray references */
.cw-help-article-shell {
  --cw-help-accent: var(--cw-primary);
  border-radius: 0.65rem;
  overflow: hidden;
  box-shadow: 0 4px 28px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.07);
}
.cw-help-article-topbar {
  height: 4px;
  background: var(--cw-help-accent);
  opacity: 0.92;
}
/* Article show page — subtitle (legacy class name) */
.cw-help-page-excerpt {
  max-width: 42rem;
  line-height: 1.55;
}

/* Article body — readable measure, comfortable type */
.cw-help-article-body {
  font-size: 0.9375rem;
  color: #334155;
  line-height: 1.78;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 0.25rem;
}
.cw-help-article-body p {
  margin-bottom: 1rem;
}
.cw-help-article-body a {
  color: var(--cw-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.cw-help-article-body a:hover {
  color: var(--cw-primary-dark, #2563eb);
}
.cw-help-article-body code {
  font-size: 0.86em;
  background: #f1f5f9;
  padding: 0.15em 0.45em;
  border-radius: 0.3rem;
  color: #0f172a;
  font-weight: 500;
}

/* Article headings — accent rail */
.cw-help-h {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.65rem;
  margin-top: 1.6rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--cw-help-accent, var(--cw-primary));
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.cw-help-article-body > .cw-help-h:first-child {
  margin-top: 0;
}
.cw-help-lead .cw-help-h:first-child {
  margin-top: 0;
}

/* Intro block — one soft callout, not a competing “card stack” */
.cw-help-lead {
  background: rgba(248, 250, 252, 0.9);
  border-radius: 0.6rem;
  padding: 1.15rem 1.15rem 1.2rem;
  margin-bottom: 1.35rem;
  border-left: 3px solid var(--cw-help-accent, var(--cw-primary));
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.cw-help-lead .cw-help-h {
  border-left-width: 0;
  padding-left: 0;
}

/* Sections — document flow: dividers instead of nested cards */
.cw-help-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 1.35rem 0;
  margin-bottom: 1.35rem;
  box-shadow: none;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}
.cw-help-article-body > .cw-help-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.cw-help-section .cw-help-h {
  margin-top: 0;
  font-size: 1rem;
  border-left-width: 3px;
  padding-left: 0.75rem;
}
.cw-help-section p:last-child,
.cw-help-section ul:last-child {
  margin-bottom: 0;
}
.cw-help-section .cw-help-list {
  margin-bottom: 0.5rem;
}

/* Steps — match article accent */
.cw-help-article-body .cw-help-step-num {
  background: var(--cw-help-accent, var(--cw-primary));
}

/* Tip — tint border with article accent */
.cw-help-article-body .cw-help-tip {
  border-left-color: var(--cw-help-accent, var(--cw-primary));
  background: rgba(248, 250, 252, 0.95);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  margin-top: 0.25rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}
.cw-help-article-body .cw-help-tip i {
  color: var(--cw-help-accent, var(--cw-primary));
}

/* Steps */
.cw-help-steps {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1rem;
}
.cw-help-step {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.cw-help-step-num {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--cw-primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: .05rem;
}

/* Tip / info box */
.cw-help-tip {
  background: rgba(73,169,66,.07);
  border-left: 3px solid var(--cw-primary);
  border-radius: 0 .4rem .4rem 0;
  padding: .6rem .9rem;
  font-size: .82rem;
  color: var(--cw-text-secondary);
  display: flex;
  gap: .6rem;
  align-items: flex-start;
}
.cw-help-tip i {
  color: var(--cw-primary);
  margin-top: .12rem;
  flex-shrink: 0;
}

/* Module grid (welcome article) */
.cw-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem;
  margin-top: .5rem;
}
.cw-help-tile {
  background: var(--cw-bg);
  border: 1px solid var(--cw-border);
  border-radius: .6rem;
  padding: .8rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .78rem;
}
.cw-help-tile i {
  font-size: 1.1rem;
}
.cw-help-tile strong {
  color: var(--cw-text);
  font-size: .82rem;
}
.cw-help-tile span {
  color: var(--cw-text-muted);
  line-height: 1.4;
}

/* Status flow */
.cw-help-status-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .78rem;
  color: var(--cw-text-muted);
}
.cw-help-status {
  padding: .2em .65em;
  border-radius: 99px;
  font-weight: 600;
  font-size: .74rem;
}
.cw-help-status.draft    { background:#f1f5f9; color:#475569; }
.cw-help-status.sent     { background:#eff6ff; color:#2563eb; }
.cw-help-status.accepted { background:#f0fdf4; color:#16a34a; }
.cw-help-status.issued   { background:#ecfdf5; color:#059669; }

/* Simple lists */
.cw-help-list {
  padding-left: 1.2rem;
  margin-bottom: .9rem;
}
.cw-help-list li {
  margin-bottom: .3rem;
}

/* Help table */
.cw-help-table th {
  background: var(--cw-bg);
  font-size: .8rem;
  font-weight: 600;
  color: var(--cw-text);
}
.cw-help-table td {
  font-size: .82rem;
  vertical-align: middle;
}

/* Field operations show — expense lines table usability */
.cw-fo-expense-table-wrap {
  overflow-x: auto;
}

.cw-fo-expense-table {
  min-width: 980px;
  table-layout: auto;
}

.cw-fo-expense-table thead th {
  white-space: nowrap;
}

.cw-fo-expense-table td {
  vertical-align: middle;
}

.cw-fo-expense-table .form-control.form-control-sm,
.cw-fo-expense-table select.form-control.form-control-sm {
  min-height: 2.25rem;
  height: 2.25rem;
  line-height: 1.4;
  font-size: 0.875rem;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.cw-fo-expense-table input[name*="[description]"] {
  min-width: 160px;
}

.cw-fo-expense-table select[name*="[category]"] {
  min-width: 130px;
}

.cw-fo-expense-table select[name*="[account_id]"] {
  min-width: 170px;
}

.cw-fo-expense-table input[name*="[amount]"] {
  min-width: 140px;
}

.cw-fo-expense-table input[name*="[receipt_reference]"] {
  min-width: 140px;
}

.cw-fo-expense-table .line-remove {
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Field operations show — header action buttons unified height */
.cw-fo-header-btn {
  min-height: 2.25rem;
  padding: 0.375rem 0.85rem !important;
  line-height: 1.2;
  border-radius: 0.55rem;
}

/* ============================================================
   DASHBOARD — hero, module shortcuts, refined layout
   ============================================================ */

.cw-dashboard {
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
}

.cw-dashboard-hero {
  position: relative;
  margin: -0.25rem -0.5rem 1.5rem;
  padding: 1.5rem 1.25rem 1.65rem;
  border-radius: var(--cw-radius-lg);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 48%, rgba(73, 169, 66, 0.06) 100%);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
@media (min-width: 768px) {
  .cw-dashboard-hero {
    padding: 1.75rem 1.75rem 1.85rem;
    margin-bottom: 1.75rem;
  }
}
.cw-dashboard-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(245, 134, 33, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(73, 169, 66, 0.1), transparent 50%);
  pointer-events: none;
}
.cw-dashboard-hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 768px) {
  .cw-dashboard-hero-inner {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
  }
}
/* Typography aligned with sidebar: nav labels 0.875rem/500; brand Poppins; section headers uppercase 0.625rem */
.cw-dashboard-eyebrow {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cw-text-muted);
  margin: 0 0 0.375rem 0;
}
.cw-dashboard-title {
  font-family: 'Poppins', var(--cw-font);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cw-text);
  margin: 0 0 0.35rem 0;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .cw-dashboard-title {
    font-size: 1.9rem;
  }
}
.cw-dashboard-subtitle {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cw-text-secondary);
  margin: 0;
  max-width: 36rem;
  line-height: 1.55;
}
.cw-dashboard-hero-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}
.cw-dashboard-notif-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(245, 134, 33, 0.12);
  color: #c2410c;
  font-size: 0.8125rem;
  font-weight: 700;
}
.cw-dashboard-date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--cw-text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.04);
}

.cw-topbar-notif-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  min-width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: rgba(245, 134, 33, 1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 0.25rem;
  box-shadow: 0 0 0 2px #ffffff;
}

/* Critical alerts — primary card (replaces former policy tables column) */
.cw-dashboard-alerts-card.cw-data-card {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--cw-border-light);
  border-left: 4px solid var(--cw-accent);
  background: #fff;
}
.cw-dashboard-alerts-card.cw-data-card .card-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  background: linear-gradient(180deg, #fffdf9 0%, #ffffff 100%);
}
.cw-dashboard-alerts-card-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}
.cw-dashboard-alerts-card-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(245, 134, 33, 0.14), rgba(245, 134, 33, 0.04));
  color: #c2410c;
  font-size: 1rem;
}
.cw-dashboard-alerts-card-title {
  font-family: 'Poppins', var(--cw-font);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cw-text);
}
.cw-dashboard-alerts-card-subtitle {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cw-text-muted);
  line-height: 1.45;
  margin-top: 0.2rem;
  max-width: 36rem;
}
.cw-dashboard-alerts-pill {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: rgba(245, 134, 33, 0.12);
  color: #9a3412;
  border: 1px solid rgba(245, 134, 33, 0.25);
}
.cw-dashboard-alerts-pill.cw-card-header-meta {
  margin-right: 0.1rem;
}
.cw-dashboard-alerts-pill--clear {
  background: rgba(73, 169, 66, 0.1);
  color: var(--cw-primary-dark);
  border-color: rgba(73, 169, 66, 0.22);
}

.cw-dashboard-alerts-stack {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.cw-dashboard-alert-tile {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--cw-border-light);
  text-decoration: none !important;
  color: var(--cw-text-secondary) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
a.cw-dashboard-alert-tile:hover {
  border-color: rgba(245, 134, 33, 0.45);
  box-shadow: 0 6px 20px rgba(245, 134, 33, 0.1);
  transform: translateY(-1px);
  color: var(--cw-text) !important;
}
.cw-dashboard-alert-tile--policy {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.85) 0%, #fff 50%);
  border-left: 3px solid var(--cw-accent);
}
.cw-dashboard-alert-tile--insurer {
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.9) 0%, #fff 55%);
  border-left: 3px solid var(--cw-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cw-dashboard-alert-tile--insurer:hover {
  border-color: rgba(73, 169, 66, 0.35);
  box-shadow: 0 4px 16px rgba(73, 169, 66, 0.08);
}
.cw-dashboard-alert-tile-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.cw-dashboard-alert-tile--policy .cw-dashboard-alert-tile-icon {
  background: rgba(245, 134, 33, 0.14);
  color: #c2410c;
}
.cw-dashboard-alert-tile--insurer .cw-dashboard-alert-tile-icon {
  background: rgba(73, 169, 66, 0.14);
  color: var(--cw-primary-dark);
}
.cw-dashboard-alert-tile-body {
  flex: 1;
  min-width: 12rem;
}
.cw-dashboard-alert-tile-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cw-text-muted);
  margin-bottom: 0.35rem;
}
.cw-dashboard-alert-tile-text {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--cw-text-secondary) !important;
}
.cw-dashboard-alert-tile-text strong {
  color: var(--cw-text);
  font-weight: 700;
}
.cw-dashboard-alert-tile-names {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.cw-dashboard-alert-tile-name {
  color: var(--cw-primary-dark);
  font-weight: 600;
  text-decoration: none;
}
a.cw-dashboard-alert-tile-name:hover {
  text-decoration: underline;
  color: var(--cw-primary);
}
.cw-dashboard-alert-tile-sep {
  margin: 0 0.25rem;
  opacity: 0.45;
}
.cw-dashboard-alert-tile-action {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cw-accent);
  white-space: nowrap;
}
a.cw-dashboard-alert-tile:hover .cw-dashboard-alert-tile-action {
  color: var(--cw-accent-hover);
}
.cw-dashboard-alert-tile-action--btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  background: rgba(73, 169, 66, 0.1);
  color: var(--cw-primary-dark) !important;
  text-decoration: none !important;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(73, 169, 66, 0.2);
  transition: background 0.2s ease, transform 0.15s ease;
}
a.cw-dashboard-alert-tile-action--btn:hover {
  background: rgba(73, 169, 66, 0.18);
  transform: translateY(-1px);
  color: var(--cw-primary-dark) !important;
}

.cw-dashboard-alerts-empty {
  padding: 2.25rem 1.5rem 2.5rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.35) 0%, #fff 45%);
}
.cw-dashboard-alerts-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: rgba(73, 169, 66, 0.12);
  color: var(--cw-primary);
  font-size: 1.5rem;
  margin-bottom: 0.85rem;
}
.cw-dashboard-alerts-empty-title {
  font-family: 'Poppins', var(--cw-font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cw-text);
}
.cw-dashboard-alerts-empty-text {
  font-size: 0.875rem;
  color: var(--cw-text-muted);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 575.98px) {
  .cw-dashboard-alert-tile-action {
    width: 100%;
    justify-content: flex-end;
  }
}

.cw-dashboard-block {
  margin-bottom: 1.75rem;
}
.cw-dashboard-block--tight {
  margin-bottom: 1rem;
}
.cw-dashboard-block-head {
  margin-bottom: 1rem;
}
.cw-dashboard-block-head--row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 768px) {
  .cw-dashboard-block-head--row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}
.cw-dashboard-h2 {
  font-family: 'Poppins', var(--cw-font);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cw-text);
  margin: 0 0 0.25rem 0;
}
.cw-dashboard-block-desc {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cw-text-muted);
  line-height: 1.45;
}

.cw-dashboard-period-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
@media (min-width: 576px) {
  .cw-dashboard-period-form {
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
  }
}
.cw-dashboard-period-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cw-text-muted);
  margin: 0;
}
.cw-dashboard-period-select {
  min-width: 11rem;
  border-radius: 0.5rem;
  border-color: var(--cw-border);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Module shortcut grid */
.cw-dashboard-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.75rem;
}
@media (min-width: 1200px) {
  .cw-dashboard-modules {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.cw-module-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 1rem 1rem 0.85rem;
  min-height: 5.5rem;
  border-radius: var(--cw-radius-lg);
  border: 1px solid var(--cw-border);
  background: var(--cw-card-bg);
  text-decoration: none !important;
  color: var(--cw-text) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}
.cw-module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--cw-mod-stripe, var(--cw-primary));
  opacity: 0.85;
}
.cw-module-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
  border-color: rgba(73, 169, 66, 0.35);
}
.cw-module-card-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: var(--cw-mod-icon-bg, rgba(73, 169, 66, 0.12));
  color: var(--cw-mod-icon-fg, var(--cw-primary-dark));
}
.cw-module-card-label {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  padding-right: 1.25rem;
  color: var(--cw-text-secondary);
}
.cw-module-card-arrow {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  font-size: 0.65rem;
  color: var(--cw-text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.cw-module-card:hover .cw-module-card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--cw-mod-icon-fg, var(--cw-primary-dark));
}

.cw-module-card--emerald { --cw-mod-stripe: #10b981; --cw-mod-icon-bg: rgba(16, 185, 129, 0.14); --cw-mod-icon-fg: #047857; }
.cw-module-card--blue { --cw-mod-stripe: #3b82f6; --cw-mod-icon-bg: rgba(59, 130, 246, 0.14); --cw-mod-icon-fg: #1d4ed8; }
.cw-module-card--cyan { --cw-mod-stripe: #06b6d4; --cw-mod-icon-bg: rgba(6, 182, 212, 0.14); --cw-mod-icon-fg: #0e7490; }
.cw-module-card--green { --cw-mod-stripe: #49a942; --cw-mod-icon-bg: rgba(73, 169, 66, 0.14); --cw-mod-icon-fg: #2e7d32; }
.cw-module-card--violet { --cw-mod-stripe: #8b5cf6; --cw-mod-icon-bg: rgba(139, 92, 246, 0.14); --cw-mod-icon-fg: #6d28d9; }
.cw-module-card--teal { --cw-mod-stripe: #14b8a6; --cw-mod-icon-bg: rgba(20, 184, 166, 0.14); --cw-mod-icon-fg: #0f766e; }
.cw-module-card--rose { --cw-mod-stripe: #f43f5e; --cw-mod-icon-bg: rgba(244, 63, 94, 0.12); --cw-mod-icon-fg: #be123c; }
.cw-module-card--amber { --cw-mod-stripe: #f59e0b; --cw-mod-icon-bg: rgba(245, 158, 11, 0.14); --cw-mod-icon-fg: #b45309; }
.cw-module-card--gold { --cw-mod-stripe: #eab308; --cw-mod-icon-bg: rgba(234, 179, 8, 0.16); --cw-mod-icon-fg: #a16207; }
.cw-module-card--indigo { --cw-mod-stripe: #6366f1; --cw-mod-icon-bg: rgba(99, 102, 241, 0.14); --cw-mod-icon-fg: #4338ca; }
.cw-module-card--slate { --cw-mod-stripe: #64748b; --cw-mod-icon-bg: rgba(100, 116, 139, 0.14); --cw-mod-icon-fg: #334155; }
.cw-module-card--brown { --cw-mod-stripe: #a16207; --cw-mod-icon-bg: rgba(161, 98, 7, 0.12); --cw-mod-icon-fg: #854d0e; }
.cw-module-card--purple { --cw-mod-stripe: #9333ea; --cw-mod-icon-bg: rgba(147, 51, 234, 0.12); --cw-mod-icon-fg: #6b21a8; }
.cw-module-card--gray { --cw-mod-stripe: #64748b; --cw-mod-icon-bg: rgba(71, 85, 105, 0.12); --cw-mod-icon-fg: #475569; }
.cw-module-card--sky { --cw-mod-stripe: #0ea5e9; --cw-mod-icon-bg: rgba(14, 165, 233, 0.14); --cw-mod-icon-fg: #0369a1; }

/* KPI row refinement — align with sidebar nav weight (500) + Poppins numbers */
.cw-dashboard-kpis .cw-icon-metric {
  border-radius: 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.cw-dashboard-kpis .cw-icon-metric-label {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
}
.cw-dashboard-kpis .cw-icon-metric-value {
  font-family: 'Poppins', var(--cw-font);
}

/* Pulse strip */
.cw-dashboard-pulse {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 767px) {
  .cw-dashboard-pulse {
    grid-template-columns: 1fr;
  }
}
.cw-dashboard-pulse-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 1rem 1.15rem;
  border-radius: var(--cw-radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--cw-border-light);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cw-dashboard-pulse-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  margin-bottom: 0.25rem;
}
.cw-dashboard-pulse-icon.cw-pulse-warn {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}
.cw-dashboard-pulse-icon.cw-pulse-alert {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.cw-dashboard-pulse-val {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: 'Poppins', var(--cw-font);
  letter-spacing: -0.03em;
  color: var(--cw-text);
  line-height: 1.1;
}
.cw-dashboard-pulse-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cw-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cw-dashboard-alert {
  border-radius: var(--cw-radius-lg);
  border: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.cw-dashboard-card .card-header {
  font-weight: 700;
  font-size: 0.9375rem;
}
.cw-dash-icon {
  color: var(--cw-primary);
  opacity: 0.9;
}

.cw-dashboard-table-link {
  font-weight: 700;
  color: var(--cw-primary-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cw-dashboard-table-link:hover {
  color: var(--cw-primary);
  border-bottom-color: rgba(73, 169, 66, 0.45);
  text-decoration: none;
}

.cw-dashboard-profile {
  position: relative;
  border: 1px solid rgba(73, 169, 66, 0.2);
  border-radius: var(--cw-radius-lg);
  overflow: hidden;
  background: linear-gradient(145deg, rgba(240, 253, 244, 0.85) 0%, #ffffff 42%, rgba(255, 247, 237, 0.92) 100%);
  color: var(--cw-text-secondary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.cw-dashboard-profile-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cw-primary), var(--cw-accent));
}
.cw-dashboard-profile .card-body {
  padding: 1.35rem 1.25rem 1.4rem;
}
.cw-dashboard-profile-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  background: linear-gradient(135deg, rgba(73, 169, 66, 0.18), rgba(245, 134, 33, 0.12));
  color: var(--cw-primary-dark);
  margin-bottom: 0.85rem;
}
.cw-dashboard-profile-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cw-text-muted);
  margin-bottom: 0.2rem;
}
.cw-dashboard-profile-role {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Poppins', var(--cw-font);
  color: var(--cw-primary-dark);
  margin-bottom: 0.5rem;
}
.cw-dashboard-profile-hint {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cw-text-muted);
  line-height: 1.45;
}

.cw-dashboard-empty-icon {
  font-size: 1.75rem;
}

.cw-dashboard-activity-row {
  align-items: flex-start;
}
