/**
 * CRM9 local HR9 product shell — UI only.
 * Styles activate only when body has .crm9-hr9-shell or .crm9-hr9-login
 * (added by crm9_hr9_shell.js on local hosts). Live sites stay untouched.
 */

/* ── Tokens ─────────────────────────────────────────────── */
body.crm9-hr9-shell,
body.crm9-hr9-login {
  --hr9-purple: #4d2d95;
  --hr9-purple-dark: #3f257a;
  --hr9-blue: #1a60be;
  --hr9-black: #000000;
  --hr9-white: #ffffff;
  --hr9-surface: #f5f6fb;
  --hr9-surface-2: #eef0f8;
  --hr9-border: rgba(77, 45, 149, 0.12);
  --hr9-purple-tint: rgba(77, 45, 149, 0.1);
  --hr9-purple-tint-strong: rgba(77, 45, 149, 0.16);
  --hr9-purple-tint-hover: rgba(77, 45, 149, 0.06);
  --hr9-blue-tint: rgba(26, 96, 190, 0.1);
  --hr9-radius-sm: 8px;
  --hr9-radius-md: 12px;
  --hr9-radius-lg: 16px;
  --hr9-motion: 180ms ease;
  --hr9-motion-fast: 150ms ease;
  --hr9-shadow: 0 4px 14px rgba(77, 45, 149, 0.06);
  --hr9-shadow-lg: 0 10px 28px rgba(77, 45, 149, 0.1);
  --primary: #4d2d95;
  --primary-color: #4d2d95;
  --btn-primary: #4d2d95;
  --btn-primary-hover: #3f257a;
  --blue-500: #1a60be;
  --text-color: #101828;
  --text-muted: #667085;
  --bg-color: #f5f6fb;
  --control-bg: #fafbfe;
  --border-color: rgba(77, 45, 149, 0.12);
}

/* ── App shell ──────────────────────────────────────────── */
body.crm9-hr9-shell {
  background: var(--hr9-surface) !important;
}

body.crm9-hr9-shell .main-section,
body.crm9-hr9-shell .layout-main-section,
body.crm9-hr9-shell .page-container,
body.crm9-hr9-shell .workspace-container,
body.crm9-hr9-shell .content.page-container {
  background: var(--hr9-surface);
}

/* Full-width main pane (HR9-style): kill centered bootstrap/container column */
html.crm9-hr9-shell,
html.crm9-hr9-shell body,
body.crm9-hr9-shell {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden;
}

html.crm9-hr9-shell .container,
html.crm9-hr9-shell .container-sm,
html.crm9-hr9-shell .container-md,
html.crm9-hr9-shell .container-lg,
html.crm9-hr9-shell .container-xl,
body.crm9-hr9-shell .container,
body.crm9-hr9-shell .container.page-body,
body.crm9-hr9-shell .page-container,
body.crm9-hr9-shell .page-body,
body.crm9-hr9-shell .page-content,
/* Inner content fills the RIGHT pane only — do NOT force wrapper to 100%
   (that makes Home/workspace stack under the sidebar instead of beside it). */
body.crm9-hr9-shell .layout-main-section,
body.crm9-hr9-shell .layout-main-section.frappe-card,
body.crm9-hr9-shell [data-page-route="Workspaces"] .layout-main-section,
body.crm9-hr9-shell [data-page-route="Workspaces"] .codex-editor,
body.crm9-hr9-shell [data-page-route="Workspaces"] .codex-editor__redactor,
body.crm9-hr9-shell [data-page-route="Workspaces"] .ce-block,
body.crm9-hr9-shell [data-page-route="Workspaces"] .ce-block__content,
body.crm9-hr9-shell [data-page-route="Workspaces"] .ce-toolbar__content,
body.crm9-hr9-shell .codex-editor,
body.crm9-hr9-shell .codex-editor__redactor,
body.crm9-hr9-shell .ce-block__content,
body.crm9-hr9-shell .ce-toolbar__content {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}

/* HR9-style: Workspaces only — sidebar LEFT + page RIGHT (never on List/Currency) */
body.crm9-hr9-shell [data-page-route="Workspaces"] .row.layout-main {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.crm9-hr9-shell [data-page-route="Workspaces"] .layout-side-section,
body.crm9-hr9-shell [data-page-route="Workspaces"] .row.layout-main > .layout-side-section {
  flex: 0 0 290px !important;
  width: 290px !important;
  max-width: 290px !important;
  min-width: 290px !important;
  float: none !important;
  position: relative !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body.crm9-hr9-shell [data-page-route="Workspaces"] .layout-side-section > .desk-sidebar,
body.crm9-hr9-shell [data-page-route="Workspaces"] .layout-side-section > .list-sidebar {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.crm9-hr9-shell [data-page-route="Workspaces"] .layout-main-section-wrapper,
body.crm9-hr9-shell [data-page-route="Workspaces"] .row.layout-main > .layout-main-section-wrapper {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* Persist nav styles live in crm9_sidebar.css — shell must not hide them */

body.crm9-hr9-shell .layout-side-section .list-sidebar,
body.crm9-hr9-shell .layout-side-section .desk-sidebar {
  width: 100% !important;
  max-width: 100% !important;
}

/* Don't let modal dialogs go full viewport width */
body.crm9-hr9-shell .modal .container,
body.crm9-hr9-shell .modal-dialog {
  max-width: 500px !important;
  width: auto !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body.crm9-hr9-shell .modal-dialog.modal-lg {
  max-width: 800px !important;
}

body.crm9-hr9-shell .body-sidebar-container,
body.crm9-hr9-shell .main-section,
body.crm9-hr9-shell #body,
body.crm9-hr9-shell .content,
body.crm9-hr9-shell .content.page-container,
body.crm9-hr9-shell .page-container {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

body.crm9-hr9-shell .layout-main-section,
body.crm9-hr9-shell [data-page-route="Workspaces"] .layout-main-section {
  padding-left: 4px !important;
  padding-right: 4px !important;
  box-sizing: border-box !important;
}

body.crm9-hr9-shell .layout-main-section,
body.crm9-hr9-shell .page-body,
body.crm9-hr9-shell .codex-editor,
body.crm9-hr9-shell .frappe-card {
  border-radius: var(--hr9-radius-md);
}

body.crm9-hr9-shell .body-sidebar-container,
body.crm9-hr9-shell .main-section,
body.crm9-hr9-shell #body,
body.crm9-hr9-shell .content.page-container {
  width: 100%;
}

body.crm9-hr9-shell .main-section {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

body.crm9-hr9-shell .body-sidebar-container + .main-section {
  flex: 1 1 auto;
  min-width: 0;
}

body.crm9-hr9-shell .page-title .title-text,
body.crm9-hr9-shell .workspace-title,
body.crm9-hr9-shell h3.ellipsis.title-text {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #101828;
}

/* Hide vendor chrome / app launcher / classic top ERP bar (HR9 demo shell) */
body.crm9-hr9-shell .navbar,
body.crm9-hr9-shell header.navbar,
body.crm9-hr9-shell .navbar .navbar-home .app-logo + span,
body.crm9-hr9-shell .navbar .app-logo + .ellipsis,
body.crm9-hr9-shell .app-switcher-dropdown,
body.crm9-hr9-shell .dropdown-help,
body.crm9-hr9-shell .vertical-bar,
body.crm9-hr9-shell .awesome-bar,
body.crm9-hr9-shell .search-bar,
body.crm9-hr9-shell #navbar-breadcrumbs,
body.crm9-hr9-shell .form-sidebar .form-shared,
body.crm9-hr9-shell [data-label="ERPNext"],
body.crm9-hr9-shell .sidebar-item-container[item-name="ERPNext Integrations"],
body.crm9-hr9-shell .sidebar-item-container[item-name="CRM9 Integrations"],
body.crm9-hr9-shell .sidebar-item-container[item-name="Assets"],
body.crm9-hr9-shell .sidebar-item-container[item-name="Manufacturing"],
body.crm9-hr9-shell .sidebar-item-container[item-name="Quality"],
body.crm9-hr9-shell .sidebar-item-container[item-name="Stock"],
body.crm9-hr9-shell .sidebar-item-container[item-name="Support"],
body.crm9-hr9-shell .sidebar-item-container[item-name="Website"],
body.crm9-app-sidebar .sidebar-item-container[item-name="ERPNext Integrations"],
body.crm9-app-sidebar .sidebar-item-container[item-name="CRM9 Integrations"],
body.crm9-app-sidebar .sidebar-item-container[item-name="Assets"],
body.crm9-app-sidebar .sidebar-item-container[item-name="Manufacturing"],
body.crm9-app-sidebar .sidebar-item-container[item-name="Quality"],
body.crm9-app-sidebar .sidebar-item-container[item-name="Stock"],
body.crm9-app-sidebar .sidebar-item-container[item-name="Support"],
body.crm9-app-sidebar .sidebar-item-container[item-name="Website"],
#crm9-persist-nav .sidebar-item-container[item-name="ERPNext Integrations"],
#crm9-persist-nav .sidebar-item-container[item-name="CRM9 Integrations"],
#crm9-persist-nav .sidebar-item-container[item-name="Assets"],
#crm9-persist-nav .sidebar-item-container[item-name="Manufacturing"],
#crm9-persist-nav .sidebar-item-container[item-name="Quality"],
#crm9-persist-nav .sidebar-item-container[item-name="Stock"],
#crm9-persist-nav .sidebar-item-container[item-name="Support"],
#crm9-persist-nav .sidebar-item-container[item-name="Website"],
body.crm9-hr9-shell .crm9-ui-hidden,
body.crm9-hr9-shell .sidebar-item-container[item-is-hidden="1"],
body.crm9-app-sidebar .sidebar-item-container[item-is-hidden="1"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Logo: sidebar header only — hide stacked navbar logo+name */
body.crm9-hr9-shell .navbar .navbar-brand,
body.crm9-hr9-shell .navbar .navbar-home {
  display: none !important;
}

/* Sidebar account footer — navbar is hidden, so logout lives here.
   Must be sibling of .desk-sidebar (sticky bottom), never inside scrollable nav. */
body.crm9-hr9-shell .desk-sidebar .crm9-user-footer,
body.crm9-hr9-shell .list-sidebar .crm9-user-footer,
#crm9-persist-nav .desk-sidebar .crm9-user-footer,
#crm9-persist-nav .list-sidebar .crm9-user-footer {
  display: none !important;
}
body.crm9-hr9-shell .crm9-user-footer,
#crm9-persist-nav .crm9-user-footer,
body.crm9-app-sidebar .crm9-user-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(77, 45, 149, 0.12);
  background: #fff;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}
body.crm9-hr9-shell .crm9-user-meta,
#crm9-persist-nav .crm9-user-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
body.crm9-hr9-shell .crm9-user-avatar,
#crm9-persist-nav .crm9-user-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(77, 45, 149, 0.12);
  color: #4d2d95;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.crm9-hr9-shell .crm9-user-text,
#crm9-persist-nav .crm9-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
body.crm9-hr9-shell .crm9-user-label,
#crm9-persist-nav .crm9-user-label {
  font-size: 11px;
  color: #667085;
}
body.crm9-hr9-shell .crm9-user-name,
#crm9-persist-nav .crm9-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #101828;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.crm9-hr9-shell .crm9-logout-btn,
#crm9-persist-nav .crm9-logout-btn {
  appearance: none;
  border: 1px solid rgba(77, 45, 149, 0.22);
  background: #f5f6fb;
  color: #4d2d95;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  width: 100%;
}
body.crm9-hr9-shell .crm9-logout-btn:hover,
#crm9-persist-nav .crm9-logout-btn:hover {
  background: rgba(77, 45, 149, 0.1);
  border-color: rgba(77, 45, 149, 0.35);
}
body.crm9-hr9-shell .body-sidebar {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100% !important;
}

/* Viewport product shell: sidebar + content fill height */
html.crm9-hr9-shell,
html.crm9-hr9-shell body.crm9-hr9-shell {
  height: 100% !important;
  background: #f5f6fb !important;
}

body.crm9-hr9-shell .main-section,
body.crm9-hr9-shell .body-sidebar-container,
body.crm9-hr9-shell #body {
  min-height: 100vh !important;
  height: 100% !important;
  background: #f5f6fb !important;
}

body.crm9-hr9-shell .body-sidebar-container {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  align-items: stretch !important;
}

body.crm9-hr9-shell .body-sidebar,
body.crm9-hr9-shell .left-sidebar-container {
  background: #ffffff !important;
  border-right: 1px solid rgba(77, 45, 149, 0.12) !important;
  box-shadow: none !important;
}

body.crm9-hr9-shell .standard-sidebar-label,
body.crm9-hr9-shell .sidebar-label,
body.crm9-hr9-shell .body-sidebar .sidebar-label {
  font-size: 11px !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: #98a2b3 !important;
  opacity: 1 !important;
  padding: 14px 16px 6px !important;
}

/* Navbar is hidden — zero its reserved height so sticky heads don't float/crop */
body.crm9-hr9-shell {
  --navbar-height: 0px !important;
}

body.crm9-hr9-shell .page-head {
  position: sticky !important;
  top: 0 !important;
  z-index: 6 !important;
  background: #f5f6fb !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 10px 0 6px !important;
  min-height: auto !important;
}

body.crm9-hr9-shell .page-head .container,
body.crm9-hr9-shell .page-head .page-head-content,
body.crm9-hr9-shell .editor-toolbar-wrapper {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: 0 !important;
  align-items: center !important;
}

/* Brand strip lives in RIGHT pane only — slim the full-width page-head */
body.crm9-hr9-shell.crm9-has-brand-strip .page-head .page-title,
body.crm9-hr9-shell.crm9-has-brand-strip .page-head .title-text,
body.crm9-hr9-shell.crm9-has-brand-strip .page-head h3,
body.crm9-hr9-shell.crm9-has-brand-strip .page-head .ellipsis,
body.crm9-hr9-shell .page-head.crm9-page-head-slim .page-title,
body.crm9-hr9-shell .page-head.crm9-page-head-slim .title-text,
body.crm9-hr9-shell .page-head.crm9-page-head-slim h3,
body.crm9-hr9-shell .page-head.crm9-page-head-slim .ellipsis {
  display: none !important;
}

body.crm9-hr9-shell.crm9-has-brand-strip .page-head,
body.crm9-hr9-shell .page-head.crm9-page-head-slim {
  min-height: 0 !important;
  height: auto !important;
  padding: 4px 0 !important;
  background: transparent !important;
}

/* Never let brand strip sit above the whole desk (wrong parent) */
body.crm9-hr9-shell .page-body > .crm9-brand-strip,
body.crm9-hr9-shell .page-container > .crm9-brand-strip {
  display: none !important;
}

body.crm9-hr9-shell .layout-main-section-wrapper > .layout-main-section > .crm9-brand-strip {
  display: flex !important;
}

/* Kill Frappe scroll nudge that pulls page-head to top:-15px (causes crop) */
body.crm9-hr9-shell .page-head.drop-shadow,
body.crm9-hr9-shell .page-head[style] {
  top: 0 !important;
}

body.crm9-hr9-shell .layout-main-section-wrapper,
body.crm9-hr9-shell .page-body,
body.crm9-hr9-shell .page-content {
  padding-top: 4px !important;
}

body.crm9-hr9-shell .layout-main-section.frappe-card,
body.crm9-hr9-shell [data-page-route="Workspaces"] .layout-main-section {
  background: #ffffff !important;
  border: 1px solid rgba(77, 45, 149, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 14px rgba(77, 45, 149, 0.06) !important;
  padding: 18px 20px !important;
}

body.crm9-hr9-shell .standard-image.app-logo,
body.crm9-hr9-shell .avatar.avatar-frame.app-logo,
body.crm9-hr9-shell .sidebar-header .avatar,
body.crm9-hr9-shell .body-sidebar .sidebar-header .standard-image {
  display: none !important;
}

/* Sidebar width + header lockup */
body.crm9-hr9-shell .body-sidebar,
body.crm9-hr9-shell .desk-sidebar,
body.crm9-hr9-shell .left-sidebar-container {
  width: 290px;
  max-width: 290px;
  background: var(--hr9-white);
  border-right: 1px solid var(--hr9-border);
}

body.crm9-hr9-shell .body-sidebar-container .body-sidebar,
body.crm9-hr9-shell .layout-side-section {
  background: var(--hr9-white);
}

body.crm9-hr9-shell .sidebar-header,
body.crm9-hr9-shell .crm9-sidebar-brand {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 0 !important;
  height: auto !important;
  padding: 16px 14px 10px !important;
  margin: 0 !important;
  overflow: visible !important;
}

/* Search under logo — above PUBLIC */
body.crm9-hr9-shell .crm9-sidebar-search,
#crm9-persist-nav .crm9-sidebar-search,
body.crm9-app-sidebar .crm9-sidebar-search {
  flex: 0 0 auto;
  display: block !important;
  padding: 0 14px 12px !important;
  margin: 0 !important;
  box-sizing: border-box;
}

body.crm9-hr9-shell .crm9-sidebar-search-field,
#crm9-persist-nav .crm9-sidebar-search-field {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid rgba(77, 45, 149, 0.18);
  border-radius: 10px;
  background: #f5f6fb;
  color: #4d2d95;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

body.crm9-hr9-shell .crm9-sidebar-search-field:hover,
#crm9-persist-nav .crm9-sidebar-search-field:hover {
  background: #efeaf8;
  border-color: rgba(77, 45, 149, 0.35);
}

body.crm9-hr9-shell .crm9-sidebar-search-icon,
#crm9-persist-nav .crm9-sidebar-search-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
  opacity: 0.75;
  pointer-events: none;
}

body.crm9-hr9-shell .crm9-sidebar-search-input,
#crm9-persist-nav .crm9-sidebar-search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 500;
  color: #101828 !important;
  cursor: pointer;
}

body.crm9-hr9-shell .crm9-sidebar-search-input::placeholder,
#crm9-persist-nav .crm9-sidebar-search-input::placeholder {
  color: #667085;
  opacity: 1;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed .crm9-sidebar-search,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-sidebar-search {
  display: none !important;
}

/* HR9-style brand lockup: mark + CRM9 + subtitle */
body.crm9-hr9-shell .crm9-brand-lockup {
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible !important;
  text-decoration: none !important;
  color: inherit !important;
}

/* Close all menus — pairs with sidebar ‹ control (clean icon button) */
body.crm9-hr9-shell .crm9-collapse-all-dd {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin: 0 4px 0 auto;
  padding: 0;
  border-radius: var(--hr9-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4d2d95;
  background: #fff;
  border: 1px solid #d4cce8;
  cursor: pointer;
  /* No layout-changing props on hover — avoids cursor flicker */
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

body.crm9-hr9-shell .crm9-collapse-all-dd svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
  flex: 0 0 auto;
}

body.crm9-hr9-shell .crm9-collapse-all-dd:hover {
  background: #efeaf8;
  border-color: #4d2d95;
  color: #3b2275;
}

body.crm9-hr9-shell .crm9-collapse-all-dd:active {
  background: #e0d6f5;
}

body.crm9-hr9-shell .crm9-sidebar-brand .crm9-sidebar-collapse,
body.crm9-hr9-shell .sidebar-header .crm9-sidebar-collapse {
  margin-left: 0;
}

body.crm9-hr9-shell .crm9-sidebar-mark {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  flex: 0 0 48px;
  object-fit: contain;
  object-position: center;
  display: block !important;
  margin: 0 !important;
  overflow: visible !important;
}

body.crm9-hr9-shell .crm9-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 0 1 auto;
  min-width: min-content;
  overflow: visible !important;
  line-height: 1.15;
}

body.crm9-hr9-shell .crm9-brand-name {
  font-size: 24px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: #111827 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

body.crm9-hr9-shell .crm9-brand-sub {
  display: none !important;
}

/* Hide old single-image lockup if any leftover */
body.crm9-hr9-shell .crm9-sidebar-brand > img.app-logo,
body.crm9-hr9-shell .crm9-sidebar-brand > .crm9-sidebar-logo {
  display: none !important;
}

body.crm9-hr9-shell .crm9-sidebar-brand .crm9-sidebar-collapse,
body.crm9-hr9-shell .sidebar-header .crm9-sidebar-collapse,
body.crm9-hr9-shell .sidebar-header .collapse-sidebar-link,
body.crm9-hr9-shell .sidebar-header .collapse-sidebar-btn {
  flex: 0 0 32px;
  margin-left: 0;
}

body.crm9-hr9-shell .crm9-sidebar-collapse,
body.crm9-hr9-shell .collapse-sidebar-link,
body.crm9-hr9-shell .body-sidebar .collapse-sidebar-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--hr9-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hr9-purple);
  background: transparent;
  border: 1px solid transparent;
  transition: background var(--hr9-motion), border-color var(--hr9-motion);
  padding: 0;
  font-size: 0;
  line-height: 0;
}

body.crm9-hr9-shell .crm9-sidebar-collapse .crm9-panel-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
}

body.crm9-hr9-shell .crm9-sidebar-collapse:hover,
body.crm9-hr9-shell .collapse-sidebar-link:hover {
  background: var(--hr9-purple-tint-hover);
  border-color: var(--hr9-border);
}

/* Old floating › expand tab — unused (panel icon stays in rail) */
body.crm9-hr9-shell .crm9-sidebar-expand-rail {
  display: none !important;
}

/* —— Collapsed icon rail (panel button click) —— */
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed {
  --crm9-rail-w: 88px;
}

/* Inner desk still 290px unless forced — that caused left-clip ("ounting") */
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav.crm9-persist-nav,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .list-sidebar {
  width: var(--crm9-rail-w) !important;
  min-width: var(--crm9-rail-w) !important;
  max-width: var(--crm9-rail-w) !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-brand-lockup,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-brand-text,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-sidebar-mark,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-collapse-all-dd,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-sidebar-search,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-user-footer,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .standard-sidebar-label,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .sidebar-label,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-chevron-glyph,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-chevron,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-drop-btn,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .sidebar-child-item,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .sidebar-item-container > .sidebar-item-container,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-drop-link {
  display: none !important;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .sidebar-header,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-sidebar-brand {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 12px 4px 8px !important;
  min-height: 48px;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .crm9-sidebar-collapse {
  margin: 0 !important;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(77, 45, 149, 0.22);
  background: #f5f6fb;
  border-radius: 8px;
  flex: 0 0 36px;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar > .sidebar-item-container,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar .standard-sidebar-section > .sidebar-item-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 4px !important;
  box-sizing: border-box !important;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar .sidebar-item-container > .desk-sidebar-item.standard-sidebar-item,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar .standard-sidebar-item {
  margin: 2px 0 !important;
  min-height: 54px;
  height: auto;
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 10px;
  box-sizing: border-box !important;
}

/* Expanded: icon + label on one horizontal line */
body.crm9-hr9-shell:not(.crm9-sidebar-rail-collapsed) #crm9-persist-nav .desk-sidebar .standard-sidebar-item .item-anchor {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 10px !important;
}
body.crm9-hr9-shell:not(.crm9-sidebar-rail-collapsed) #crm9-persist-nav .desk-sidebar .sidebar-item-label {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Collapsed (panel button): demo-style rail — icon above label, centered */
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar .standard-sidebar-item .item-anchor {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  padding: 8px 2px !important;
  text-align: center !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar .sidebar-item-icon,
body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar .crm9-flat-icon {
  margin: 0 auto !important;
  flex: 0 0 auto !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar .crm9-flat-icon svg {
  width: 20px !important;
  height: 20px !important;
}

body.crm9-hr9-shell.crm9-sidebar-rail-collapsed #crm9-persist-nav .desk-sidebar .sidebar-item-label {
  display: block !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  text-align: center !important;
  width: 100% !important;
  max-width: 80px !important;
  margin: 0 auto !important;
  padding: 0 2px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
}

/* Nav rows */
body.crm9-hr9-shell .desk-sidebar .sidebar-item-container > .desk-sidebar-item.standard-sidebar-item,
body.crm9-hr9-shell .body-sidebar .standard-sidebar-item {
  min-height: 40px;
  border-radius: var(--hr9-radius-sm);
  margin: 2px 8px;
  box-shadow: none !important;
}

body.crm9-hr9-shell .desk-sidebar .sidebar-item-container > .desk-sidebar-item .item-anchor,
body.crm9-hr9-shell .body-sidebar .standard-sidebar-item .item-anchor {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  color: #2c2c2c;
  text-decoration: none;
}

body.crm9-hr9-shell .desk-sidebar .sidebar-item-icon,
body.crm9-hr9-shell .body-sidebar .sidebar-item-icon {
  width: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b6b6b;
}

body.crm9-hr9-shell .desk-sidebar .sidebar-child-item .desk-sidebar-item .item-anchor,
body.crm9-hr9-shell .body-sidebar .sidebar-child-item .item-anchor {
  min-height: 34px;
  padding-left: 36px;
  font-size: 12.5px;
}

body.crm9-hr9-shell .desk-sidebar .standard-sidebar-item:hover,
body.crm9-hr9-shell .body-sidebar .standard-sidebar-item:hover {
  background: var(--hr9-purple-tint-hover) !important;
  border-radius: var(--hr9-radius-sm);
}

body.crm9-hr9-shell .desk-sidebar .standard-sidebar-item.selected,
body.crm9-hr9-shell .body-sidebar .standard-sidebar-item.selected,
body.crm9-hr9-shell .desk-sidebar .standard-sidebar-item.active {
  background: var(--hr9-purple-tint) !important;
  box-shadow: none !important;
}

body.crm9-hr9-shell .desk-sidebar .standard-sidebar-item.selected .item-anchor,
body.crm9-hr9-shell .desk-sidebar .standard-sidebar-item.selected .sidebar-item-icon,
body.crm9-hr9-shell .desk-sidebar .standard-sidebar-item.selected .sidebar-item-label,
body.crm9-hr9-shell .body-sidebar .standard-sidebar-item.selected .item-anchor,
body.crm9-hr9-shell .body-sidebar .standard-sidebar-item.selected .sidebar-item-icon,
body.crm9-hr9-shell .body-sidebar .standard-sidebar-item.selected .sidebar-item-label {
  color: var(--hr9-purple) !important;
  font-weight: 500;
}

/* Buttons / tabs / links / inputs */
body.crm9-hr9-shell .btn-primary,
body.crm9-hr9-shell .btn.btn-primary {
  background: var(--hr9-purple) !important;
  border-color: var(--hr9-purple) !important;
  color: var(--hr9-white) !important;
  border-radius: var(--hr9-radius-sm);
  font-weight: 500;
  box-shadow: none;
  transition: background var(--hr9-motion), transform var(--hr9-motion-fast), box-shadow var(--hr9-motion);
}

body.crm9-hr9-shell .btn-primary:hover,
body.crm9-hr9-shell .btn.btn-primary:hover {
  background: var(--hr9-purple-dark) !important;
  border-color: var(--hr9-purple-dark) !important;
}

body.crm9-hr9-shell .btn-primary:focus,
body.crm9-hr9-shell .btn:focus,
body.crm9-hr9-shell a:focus-visible,
body.crm9-hr9-shell input:focus-visible,
body.crm9-hr9-shell select:focus-visible,
body.crm9-hr9-shell textarea:focus-visible {
  outline: 2px solid var(--hr9-blue);
  outline-offset: 2px;
}

body.crm9-hr9-shell .btn-default,
body.crm9-hr9-shell .btn-secondary,
body.crm9-hr9-shell .btn {
  border-radius: var(--hr9-radius-sm);
}

body.crm9-hr9-shell .nav-link.active,
body.crm9-hr9-shell .form-tabs .nav-link.active,
body.crm9-hr9-shell .nav-tabs .nav-link.active {
  color: var(--hr9-purple) !important;
  border-bottom-color: var(--hr9-purple) !important;
  font-weight: 500;
}

/*
 * Sticky form-tabs hairline fix (Lead Series / Job Title / Lead Owner).
 * CRM9 sets --navbar-height: 0, so Frappe's sticky .form-tabs-list sits too high
 * and its border-bottom cuts through the first row of field labels.
 */
body.crm9-hr9-shell .form-tabs-list {
  position: relative !important;
  top: auto !important;
  background: #fff !important;
  z-index: 1 !important;
}
body.crm9-hr9-shell .form-tabs-sticky-up,
body.crm9-hr9-shell .form-tabs-sticky-down {
  top: auto !important;
}
body.crm9-hr9-shell .form-layout .form-section .section-head:empty,
body.crm9-hr9-shell .form-layout .form-section .section-head.hide-control {
  display: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}
body.crm9-hr9-shell .form-layout .control-label,
body.crm9-hr9-shell .form-layout label.control-label {
  background: transparent !important;
  text-decoration: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.crm9-hr9-shell a:not(.btn):not(.nav-link),
body.crm9-hr9-shell .indicator-pill.blue,
body.crm9-hr9-shell .indicator.blue {
  color: var(--hr9-blue);
}

body.crm9-hr9-shell .indicator-pill.blue,
body.crm9-hr9-shell .badge-blue {
  background: var(--hr9-blue-tint) !important;
  color: var(--hr9-blue) !important;
}

body.crm9-hr9-shell input[type="checkbox"]:checked,
body.crm9-hr9-shell .progress-bar,
body.crm9-hr9-shell .awesomplete > ul > li[aria-selected="true"] {
  accent-color: var(--hr9-purple);
  background-color: var(--hr9-purple);
}

/* Select caret — never fill the whole icon box with purple */
body.crm9-hr9-shell .select-icon {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--hr9-muted, #667085) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
body.crm9-hr9-shell .select-icon .icon,
body.crm9-hr9-shell .select-icon svg,
body.crm9-hr9-shell .select-icon use {
  fill: currentColor !important;
  stroke: currentColor !important;
  color: #667085 !important;
  opacity: 1 !important;
}
body.crm9-hr9-shell .frappe-control[data-fieldtype="Select"] .select-icon,
body.crm9-hr9-shell .form-group[data-fieldtype="Select"] .select-icon {
  background: transparent !important;
  right: 8px;
}

/* Status / Select filters — room for long labels (native dropdown width follows select) */
body.crm9-hr9-shell .page-form .standard-filter-section .form-group[data-fieldtype="Select"],
body.crm9-hr9-shell .page-form .frappe-control[data-fieldtype="Select"],
body.crm9-hr9-shell .page-form .form-group[data-fieldtype="Select"] {
  min-width: 260px !important;
  max-width: 320px;
}
body.crm9-hr9-shell .page-form select.form-control,
body.crm9-hr9-shell .page-form .frappe-control[data-fieldtype="Select"] select {
  min-width: 260px !important;
  width: 100% !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  padding-right: 28px !important;
  text-overflow: ellipsis;
}
body.crm9-hr9-shell select.form-control option,
body.crm9-hr9-shell .page-form select option {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
}

/* Awesomplete / Link filter lists — opaque, padded, wide enough for labels */
body.crm9-hr9-shell .awesomplete > ul,
body.crm9-hr9-shell .awesomplete > [role="listbox"],
body.crm9-hr9-shell .page-form .awesomplete > ul,
body.crm9-hr9-shell .filter-area .awesomplete > ul {
  min-width: 280px !important;
  width: max-content !important;
  max-width: min(420px, 90vw) !important;
  background: #fff !important;
  background-color: #fff !important;
  opacity: 1 !important;
  z-index: 1060 !important;
  padding: 6px !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12) !important;
  overflow-x: visible !important;
}
body.crm9-hr9-shell .awesomplete > ul > li,
body.crm9-hr9-shell .awesomplete > [role="listbox"] > [role="option"],
body.crm9-hr9-shell .page-form .awesomplete > ul > li {
  padding: 8px 12px !important;
  max-width: none !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  line-height: 1.4 !important;
  color: #101828 !important;
}
body.crm9-hr9-shell .awesomplete > ul > li[aria-selected="true"],
body.crm9-hr9-shell .awesomplete > [role="listbox"] > [role="option"][aria-selected="true"] {
  background-color: var(--hr9-purple) !important;
  color: #fff !important;
}

body.crm9-hr9-shell .form-control:focus,
body.crm9-hr9-shell .input-with-feedback:focus,
body.crm9-hr9-shell input.form-control:focus,
body.crm9-hr9-shell select.form-control:focus,
body.crm9-hr9-shell textarea.form-control:focus {
  border-color: var(--hr9-purple) !important;
  box-shadow: 0 0 0 2px var(--hr9-purple-tint) !important;
}

/* Dashboard brand strip + cards */
body.crm9-hr9-shell .crm9-brand-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin: 4px 0 16px !important;
  position: relative;
  z-index: 1;
  border-radius: var(--hr9-radius-md);
  border: 1px solid var(--hr9-border);
  background:
    radial-gradient(420px 180px at 92% 0%, rgba(26, 96, 190, 0.08), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f3f1fa 100%);
}

body.crm9-hr9-shell .crm9-brand-strip .kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hr9-purple);
  margin: 0 0 4px;
}

body.crm9-hr9-shell .crm9-brand-strip .title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #101828;
  margin: 0 0 4px;
}

body.crm9-hr9-shell .crm9-brand-strip .subtitle {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0;
}

body.crm9-hr9-shell .crm9-brand-strip .switcher-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

body.crm9-hr9-shell .crm9-brand-strip select,
body.crm9-hr9-shell .crm9-brand-strip .form-control {
  height: 36px;
  border-radius: var(--hr9-radius-sm);
  border: 1px solid var(--hr9-purple);
  background: var(--hr9-white);
}

body.crm9-hr9-shell .widget.number-widget-box,
body.crm9-hr9-shell .widget.shortcut-widget-box,
body.crm9-hr9-shell .widget.dashboard-widget-box,
body.crm9-hr9-shell .widget.links-widget-box {
  border-radius: var(--hr9-radius-md);
  border: 1px solid var(--hr9-border);
  box-shadow: none;
  transition: transform var(--hr9-motion), box-shadow var(--hr9-motion), border-color var(--hr9-motion);
  background: var(--hr9-white);
}

body.crm9-hr9-shell .widget.number-widget-box {
  border-top: 3px solid var(--hr9-purple);
}

body.crm9-hr9-shell .widget.number-widget-box .number,
body.crm9-hr9-shell .widget.number-widget-box .widget-title,
body.crm9-hr9-shell .widget.number-widget-box .widget-body .number {
  color: var(--hr9-purple);
}

body.crm9-hr9-shell .widget.number-widget-box:hover {
  transform: translateY(-1px);
  box-shadow: var(--hr9-shadow);
  border-color: rgba(77, 45, 149, 0.22);
}

body.crm9-hr9-shell .widget.shortcut-widget-box {
  border-left: 3px solid transparent;
}

body.crm9-hr9-shell .widget.shortcut-widget-box:hover {
  border-left-color: var(--hr9-blue);
}

body.crm9-hr9-shell .widget.dashboard-widget-box,
body.crm9-hr9-shell .widget.chart-widget {
  border-top: 3px solid var(--hr9-blue);
}

/* Workforce insight block */
body.crm9-hr9-shell .crm9-workforce-insight {
  border-radius: 14px;
  border: 1px solid var(--hr9-border);
  background: var(--hr9-white);
  padding: 18px;
  margin-bottom: 16px;
}

body.crm9-hr9-shell .crm9-workforce-insight .heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

body.crm9-hr9-shell .crm9-workforce-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

body.crm9-hr9-shell .crm9-workforce-kpi {
  min-height: 70px;
  border-radius: var(--hr9-radius-md);
  border: 1px solid var(--hr9-border);
  background: var(--hr9-surface);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.crm9-hr9-shell .crm9-workforce-kpi .icon-chip {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--control-bg);
  color: var(--hr9-purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.crm9-hr9-shell .crm9-workforce-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 991px) {
  body.crm9-hr9-shell .crm9-workforce-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  body.crm9-hr9-shell .crm9-workforce-kpis {
    grid-template-columns: 1fr;
  }
  body.crm9-hr9-shell .crm9-workforce-details {
    grid-template-columns: 1fr;
  }
}

/* ── CRM9 Home Dashboard (screenshot-style, main pane only) ── */
body.crm9-hr9-shell .crm9-ops-host {
  width: 100%;
  max-width: 100%;
}

body.crm9-hr9-shell .crm9-ops-dashboard {
  padding: 4px 4px 28px;
  width: 100%;
  box-sizing: border-box;
}

/*
 * Home/Dashboard flash kill: hide EVERYTHING in the right pane except ops host.
 * NEVER target #crm9-persist-nav, .layout-side-section, .body-sidebar, .desk-sidebar.
 */
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section > *:not(.crm9-ops-host),
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section > *:not(.crm9-ops-host),
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section .codex-editor,
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section .workspace-body,
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section .widget-group,
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section .number-widget-box,
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section .shortcut-widget-box,
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section .onboarding-widget-box,
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section .quick-list-widget-box,
html.crm9-home-dash .layout-main-section-wrapper .layout-main-section .links-widget-box,
html.crm9-home-dash .crm9-brand-strip,
body.crm9-home-dash .crm9-brand-strip,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section .codex-editor,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section .workspace-body,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section .widget-group,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section .number-widget-box,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section .shortcut-widget-box,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section .onboarding-widget-box,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section .quick-list-widget-box,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section .links-widget-box {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

html.crm9-home-dash .layout-main-section-wrapper .layout-main-section > .crm9-ops-host,
body.crm9-home-dash .layout-main-section-wrapper .layout-main-section > .crm9-ops-host {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Hard isolation: dashboard styles must not collapse the left nav */
body.crm9-hr9-shell #crm9-persist-nav,
body.crm9-hr9-shell .body-sidebar,
body.crm9-hr9-shell .layout-side-section .desk-sidebar {
  visibility: visible;
}

/* Extra home headings only — Zoho topnav keeps its Home title */
body.crm9-hr9-shell .crm9-home-heading,
html.crm9-home-dash .crm9-home-heading {
  display: none !important;
}

/* Home dash: avoid "Home Home" — title lives in Zoho topnav */
html.crm9-home-dash .page-head .page-title,
html.crm9-home-dash .page-head .title-text,
html.crm9-home-dash .page-head h3,
html.crm9-home-dash .page-head .ellipsis,
body.crm9-home-dash .page-head .page-title,
body.crm9-home-dash .page-head .title-text,
body.crm9-home-dash .page-head h3,
body.crm9-home-dash .page-head .ellipsis {
  display: none !important;
}

/* Zoho-style Home top navigation */
.crm9-zoho-topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid rgba(77, 45, 149, 0.1);
  border-radius: 10px;
  border-bottom: 1px solid #d1d5db;
  box-sizing: border-box;
  min-height: 52px;
}

.crm9-zoho-topnav-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-width: 0;
}

.crm9-zoho-topnav-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1e293b;
  line-height: 1.2;
}

.crm9-zoho-topnav-right {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.crm9-zoho-search {
  flex: 1 1 360px;
  max-width: 520px;
  min-width: 220px;
}

.crm9-zoho-search-shell {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 38px;
  background: #ffffff;
  border: 1px solid #b8c0e0;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(77, 45, 149, 0.06);
  overflow: visible;
  position: relative;
}

.crm9-zoho-mod-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
}

.crm9-zoho-mod-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 12px 0 14px;
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 999px 0 0 999px;
}

.crm9-zoho-mod-btn:hover {
  background: #f5f6fb;
}

.crm9-zoho-mod-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #6b7280;
  margin-top: 1px;
}

.crm9-zoho-mod-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 160px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d4cce8;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.crm9-zoho-mod-menu[hidden] {
  display: none !important;
}

.crm9-zoho-mod-menu li {
  padding: 8px 14px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

.crm9-zoho-mod-menu li:hover {
  background: #efeaf8;
  color: #4d2d95;
}

.crm9-zoho-search-divider {
  flex: 0 0 1px;
  width: 1px;
  align-self: center;
  height: 20px;
  background: #c7cde3;
}

.crm9-zoho-search-field {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 14px 0 12px;
  margin: 0;
  cursor: text;
}

.crm9-zoho-search-field svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: #64748b;
}

.crm9-zoho-search-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 36px;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 13px;
  color: #374151;
  padding: 0 !important;
}

.crm9-zoho-search-input::placeholder {
  color: #9aa3b5;
}

.crm9-zoho-search-shell:focus-within {
  border-color: #4d2d95;
  box-shadow: 0 0 0 2px rgba(77, 45, 149, 0.12);
}

.crm9-zoho-icon-btn {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}

.crm9-zoho-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.crm9-zoho-icon-btn[data-zoho="new"] {
  border-color: #93c5fd;
  color: #2563eb;
}

.crm9-zoho-icon-btn:hover {
  background: #f3f4f6;
  color: #4d2d95;
  border-color: rgba(77, 45, 149, 0.2);
}

/* Zoho-style Create Records popover (+) */
.crm9-zoho-create-wrap {
  position: relative;
  flex: 0 0 auto;
}

.crm9-zoho-create-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 260px;
  padding: 14px 12px 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
  box-sizing: border-box;
}

.crm9-zoho-create-pop[hidden] {
  display: none !important;
}

.crm9-zoho-create-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 4px 10px;
}

.crm9-zoho-create-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 0 0 8px;
  padding: 0 10px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.crm9-zoho-create-search svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: #64748b;
}

.crm9-zoho-create-filter {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 13px;
  color: #374151;
  padding: 0 !important;
}

.crm9-zoho-create-filter::placeholder {
  color: #9aa3b5;
}

.crm9-zoho-create-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}

.crm9-zoho-create-list li {
  margin: 0;
}

.crm9-zoho-create-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}

.crm9-zoho-create-list button:hover {
  background: #f3f4f6;
  color: #4d2d95;
}

.crm9-zoho-create-plus {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1;
}

@media (max-width: 720px) {
  .crm9-zoho-topnav {
    flex-wrap: wrap;
  }
  .crm9-zoho-search {
    flex: 1 1 100%;
    max-width: none;
    order: 3;
  }
}

/* Home welcome strip — matches “Welcome NAME” banner with building icon */
body.crm9-hr9-shell .crm9-welcome-banner,
html.crm9-home-dash .crm9-welcome-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #e8f0fa;
  border: 1px solid rgba(26, 96, 190, 0.12);
  box-sizing: border-box;
}
body.crm9-hr9-shell .crm9-welcome-icon-wrap {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d0d7e2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}
body.crm9-hr9-shell .crm9-welcome-ico {
  width: 22px;
  height: 22px;
  display: block;
}
body.crm9-hr9-shell .crm9-welcome-text {
  font-size: 18px;
  font-weight: 500;
  color: #1f2937;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
body.crm9-hr9-shell .crm9-welcome-text strong {
  font-weight: 700;
  text-transform: uppercase;
  color: #111827;
}

body.crm9-hr9-shell .crm9-ops-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 0 2px;
}

/* Local-style home: no "CRM Dashboard" title — clock + actions only */
body.crm9-hr9-shell .crm9-ops-toolbar-slim {
  justify-content: flex-end;
}
body.crm9-hr9-shell .crm9-ops-toolbar h1,
body.crm9-hr9-shell .crm9-ops-toolbar-slim > div:first-child:not(.crm9-dash-right) {
  display: none !important;
}

body.crm9-hr9-shell .crm9-ops-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
}

body.crm9-hr9-shell .crm9-dash-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.crm9-hr9-shell .crm9-live-clock {
  min-width: 168px;
  text-align: right;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

body.crm9-hr9-shell .crm9-live-date {
  font-size: 12px;
  font-weight: 600;
  color: #4d2d95;
  letter-spacing: 0.02em;
}

body.crm9-hr9-shell .crm9-live-time {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

body.crm9-hr9-shell .crm9-dash-actions {
  display: flex;
  gap: 8px;
}

body.crm9-hr9-shell .crm9-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #4d2d95;
  background: #4d2d95;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

body.crm9-hr9-shell .crm9-btn-ghost {
  background: #fff;
  color: #4d2d95;
}

body.crm9-hr9-shell .crm9-dash-filters {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

body.crm9-hr9-shell .crm9-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

body.crm9-hr9-shell .crm9-filter-pills button {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

body.crm9-hr9-shell .crm9-filter-pills button.active {
  background: rgba(77, 45, 149, 0.12);
  border-color: #4d2d95;
  color: #4d2d95;
  font-weight: 600;
}

body.crm9-hr9-shell .crm9-filter-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

body.crm9-hr9-shell .crm9-filter-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
}

body.crm9-hr9-shell .crm9-filter-fields input,
body.crm9-hr9-shell .crm9-filter-fields select {
  height: 32px;
  min-width: 140px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12px;
  color: #111827;
  background: #fff;
}

body.crm9-hr9-shell .crm9-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

body.crm9-hr9-shell .crm9-kpi-card {
  display: block;
  text-decoration: none !important;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 88px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

body.crm9-hr9-shell .crm9-kpi-card:hover {
  transform: translateY(-1px);
  border-color: rgba(77, 45, 149, 0.35);
}

body.crm9-hr9-shell .crm9-kpi-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

body.crm9-hr9-shell .crm9-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  line-height: 1.15;
}

body.crm9-hr9-shell .crm9-kpi-delta {
  margin-top: 6px;
  font-size: 11px;
  color: #94a3b8;
}

body.crm9-hr9-shell .crm9-kpi-delta.up { color: #16a34a; }
body.crm9-hr9-shell .crm9-kpi-delta.down { color: #dc2626; }

body.crm9-hr9-shell .crm9-big-metric {
  text-align: center;
  padding: 8px 0 12px;
}

body.crm9-hr9-shell .crm9-big-metric .num {
  font-size: 40px;
  font-weight: 700;
  color: #4d2d95;
}

body.crm9-hr9-shell .crm9-big-metric .lbl {
  font-size: 13px;
  color: #334155;
}

body.crm9-hr9-shell .crm9-big-metric .sub {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
}

body.crm9-hr9-shell .crm9-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.crm9-hr9-shell .crm9-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

body.crm9-hr9-shell .crm9-list li a {
  color: #1a60be;
  font-weight: 500;
}

body.crm9-hr9-shell .crm9-list li span,
body.crm9-hr9-shell .crm9-list li.muted {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}

body.crm9-hr9-shell .crm9-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

body.crm9-hr9-shell .crm9-split h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #334155;
}

body.crm9-hr9-shell .crm9-task-stats,
body.crm9-hr9-shell .crm9-pipe-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  text-align: center;
}

body.crm9-hr9-shell .crm9-pipe-summary {
  grid-template-columns: 1fr 1fr;
}

body.crm9-hr9-shell .crm9-task-stats strong,
body.crm9-hr9-shell .crm9-pipe-summary strong {
  display: block;
  font-size: 20px;
  color: #111827;
}

body.crm9-hr9-shell .crm9-task-stats span,
body.crm9-hr9-shell .crm9-pipe-summary span {
  font-size: 11px;
  color: #64748b;
}

body.crm9-hr9-shell .crm9-links {
  margin-top: 10px;
  font-size: 12px;
}

body.crm9-hr9-shell .crm9-dash-foot {
  margin: 8px 2px 0;
  font-size: 11px;
  color: #94a3b8;
}

@media (max-width: 1200px) {
  body.crm9-hr9-shell .crm9-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body.crm9-hr9-shell .crm9-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.crm9-hr9-shell .crm9-split {
    grid-template-columns: 1fr;
  }
  body.crm9-hr9-shell .crm9-task-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

body.crm9-hr9-shell .crm9-ops-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hr9-purple);
}

body.crm9-hr9-shell .crm9-ops-toolbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #101828;
}

body.crm9-hr9-shell .crm9-home-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

body.crm9-hr9-shell .crm9-home-kpi {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 84px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

body.crm9-hr9-shell .crm9-home-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #38bdf8;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

body.crm9-hr9-shell .crm9-home-kpi-icon--indigo {
  background: #4f46e5;
}

body.crm9-hr9-shell .crm9-home-kpi-icon--red {
  background: #ef4444;
}

body.crm9-hr9-shell .crm9-home-kpi-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #111827;
}

body.crm9-hr9-shell .crm9-home-kpi-num--sm {
  font-size: 16px;
  font-weight: 700;
  color: #b91c1c;
}

body.crm9-hr9-shell .crm9-home-kpi-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

body.crm9-hr9-shell .crm9-clock-btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: 4px 10px;
  background: #eff6ff;
}

body.crm9-hr9-shell .crm9-home-row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

body.crm9-hr9-shell .crm9-home-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  min-height: 280px;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

body.crm9-hr9-shell .crm9-home-card-head {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

body.crm9-hr9-shell .crm9-home-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

body.crm9-hr9-shell .crm9-home-card-body {
  flex: 1 1 auto;
  min-height: 200px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

body.crm9-hr9-shell .crm9-ops-loading {
  min-height: 180px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f8fafc 0%, #eef2ff 50%, #f8fafc 100%);
  background-size: 200% 100%;
  animation: crm9-ops-shimmer 1.2s ease-in-out infinite;
}

@keyframes crm9-ops-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

body.crm9-hr9-shell .crm9-ops-empty {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 13px;
  border: 1px dashed #e2e8f0;
  border-radius: 8px;
}

body.crm9-hr9-shell .crm9-proj-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  text-align: center;
}

body.crm9-hr9-shell .crm9-proj-stats strong {
  display: block;
  font-size: 22px;
  color: #111827;
}

body.crm9-hr9-shell .crm9-proj-stats span {
  font-size: 12px;
  color: #64748b;
}

body.crm9-hr9-shell .crm9-prog-label {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

body.crm9-hr9-shell .crm9-proj-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  color: #334155;
}

body.crm9-hr9-shell .crm9-proj-foot .muted {
  color: #94a3b8;
  font-size: 12px;
  margin-top: 4px;
}

body.crm9-hr9-shell .crm9-hbar {
  margin-bottom: 10px;
}

body.crm9-hr9-shell .crm9-hbar-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #475569;
  margin-bottom: 4px;
}

body.crm9-hr9-shell .crm9-hbar-track {
  height: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

body.crm9-hr9-shell .crm9-hbar-track--lg {
  height: 14px;
}

body.crm9-hr9-shell .crm9-hbar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}

body.crm9-hr9-shell .crm9-inv-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #64748b;
}

body.crm9-hr9-shell .crm9-inv-foot strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: #111827;
}

body.crm9-hr9-shell .crm9-spark-label {
  margin-top: 12px;
  font-size: 11px;
  color: #64748b;
}

body.crm9-hr9-shell .crm9-spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 52px;
  margin-top: 6px;
}

body.crm9-hr9-shell .crm9-spark-bar {
  flex: 1 1 0;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
}

body.crm9-hr9-shell .crm9-donut-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

body.crm9-hr9-shell .crm9-donut {
  width: 140px;
  height: 140px;
}

body.crm9-hr9-shell .crm9-donut-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
  color: #334155;
}

body.crm9-hr9-shell .crm9-donut-legend strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

body.crm9-hr9-shell .crm9-leg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: #64748b;
}

body.crm9-hr9-shell .crm9-leg i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

body.crm9-hr9-shell .crm9-vbars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 200px;
  padding: 6px 8px 0 4px;
  border-left: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  overflow: hidden;
}

body.crm9-hr9-shell .crm9-vbar {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}

body.crm9-hr9-shell .crm9-vbar-num {
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
  line-height: 1.1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.crm9-hr9-shell .crm9-vbar-col {
  width: 70%;
  max-width: 28px;
  min-width: 8px;
  height: 140px;
  display: flex;
  align-items: flex-end;
}

body.crm9-hr9-shell .crm9-vbar-col > div {
  width: 100%;
  border-radius: 4px 4px 2px 2px;
  min-height: 3px;
}

body.crm9-hr9-shell .crm9-vbar-x {
  margin-top: 6px;
  font-size: 10px;
  color: #64748b;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

@media (max-width: 1100px) {
  body.crm9-hr9-shell .crm9-home-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.crm9-hr9-shell .crm9-home-row3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  body.crm9-hr9-shell .crm9-home-kpis {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.crm9-hr9-shell .crm9-ops-loading {
    animation: none;
  }
}

/* Lists + empty states */
body.crm9-hr9-shell .list-row,
body.crm9-hr9-shell .list-row-container .level,
body.crm9-hr9-shell .result .list-row {
  border-radius: var(--hr9-radius-sm);
}

/* Report / list thin horizontal scrollbar (like DataTable) */
body.crm9-hr9-shell .frappe-list,
body.crm9-hr9-shell .result,
body.crm9-hr9-shell .dt-scrollable,
body.crm9-hr9-shell .datatable .dt-scrollable,
body.crm9-hr9-shell .layout-main-section.frappe-card {
  overflow-x: auto !important;
  scrollbar-width: thin;
  scrollbar-color: #c5c9d4 #eef0f5;
}
body.crm9-hr9-shell .frappe-list::-webkit-scrollbar,
body.crm9-hr9-shell .result::-webkit-scrollbar,
body.crm9-hr9-shell .dt-scrollable::-webkit-scrollbar,
body.crm9-hr9-shell .datatable .dt-scrollable::-webkit-scrollbar {
  height: 10px;
}
body.crm9-hr9-shell .frappe-list::-webkit-scrollbar-track,
body.crm9-hr9-shell .result::-webkit-scrollbar-track,
body.crm9-hr9-shell .dt-scrollable::-webkit-scrollbar-track,
body.crm9-hr9-shell .datatable .dt-scrollable::-webkit-scrollbar-track {
  background: #eef0f5;
  border-radius: 8px;
}
body.crm9-hr9-shell .frappe-list::-webkit-scrollbar-thumb,
body.crm9-hr9-shell .result::-webkit-scrollbar-thumb,
body.crm9-hr9-shell .dt-scrollable::-webkit-scrollbar-thumb,
body.crm9-hr9-shell .datatable .dt-scrollable::-webkit-scrollbar-thumb {
  background: #c5c9d4;
  border-radius: 8px;
  border: 2px solid #eef0f5;
}
body.crm9-hr9-shell .frappe-list .list-row,
body.crm9-hr9-shell .frappe-list .list-row-head,
body.crm9-hr9-shell .result .list-row,
body.crm9-hr9-shell .result .list-row-head {
  min-width: 980px;
}

body.crm9-hr9-shell .msg-box,
body.crm9-hr9-shell .empty-state,
body.crm9-hr9-shell .list-paging-area + .no-result,
body.crm9-hr9-shell .frappe-card .no-result,
body.crm9-hr9-shell .empty-dashboard-state {
  border: 1px dashed var(--hr9-purple-tint-strong);
  background: var(--hr9-surface);
  padding: 28px 20px;
  border-radius: var(--hr9-radius-md);
}

/* ── Login split screen ─────────────────────────────────── */
body.crm9-hr9-login {
  min-height: 100vh;
  background: var(--hr9-surface) !important;
  overflow-x: hidden;
}

body.crm9-hr9-login .navbar,
body.crm9-hr9-login .web-footer,
body.crm9-hr9-login footer,
body.crm9-hr9-login .page-footer,
body.crm9-hr9-login .banner,
body.crm9-hr9-login .hero-and-content > .container > .page-header {
  display: none !important;
}

body.crm9-hr9-login .main-section,
body.crm9-hr9-login .hero-and-content,
body.crm9-hr9-login .page_content,
body.crm9-hr9-login .container.page-body {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.crm9-hr9-login .crm9-login-shell {
  display: grid;
  grid-template-columns: 52% 1fr;
  min-height: 100vh;
  width: 100%;
}

body.crm9-hr9-login .crm9-login-brand {
  position: relative;
  overflow: hidden;
  color: var(--hr9-white);
  padding: clamp(32px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(145deg, #4d2d95 0%, #3a3aad 42%, #1a60be 100%);
}

body.crm9-hr9-login .crm9-login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(480px 320px at 12% 8%, rgba(255, 255, 255, 0.22), transparent 55%),
    radial-gradient(420px 280px at 88% 92%, rgba(26, 96, 190, 0.55), transparent 55%);
  pointer-events: none;
}

body.crm9-hr9-login .crm9-login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

body.crm9-hr9-login .crm9-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  pointer-events: none;
  opacity: 0.45;
  animation: crm9-float 8s ease-in-out infinite;
}

body.crm9-hr9-login .crm9-orb-1 {
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.28);
  top: 12%;
  left: 18%;
}

body.crm9-hr9-login .crm9-orb-2 {
  width: 220px;
  height: 220px;
  background: rgba(26, 96, 190, 0.45);
  bottom: 10%;
  right: 12%;
  animation-delay: -2s;
}

body.crm9-hr9-login .crm9-orb-3 {
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.18);
  top: 48%;
  right: 28%;
  animation-delay: -4s;
}

@keyframes crm9-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

body.crm9-hr9-login .crm9-login-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

body.crm9-hr9-login .crm9-login-brand img.crm9-login-logo {
  height: 56px;
  width: auto;
  display: block;
  margin-bottom: 28px;
  object-fit: contain;
}

body.crm9-hr9-login .crm9-login-kicker {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 18px;
}

body.crm9-hr9-login .crm9-login-brand h1 {
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--hr9-white);
}

body.crm9-hr9-login .crm9-login-brand p.lead {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  margin: 0 0 22px;
  max-width: 36ch;
}

body.crm9-hr9-login .crm9-login-checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

body.crm9-hr9-login .crm9-login-checks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

body.crm9-hr9-login .crm9-login-checks li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  flex: 0 0 8px;
}

body.crm9-hr9-login .crm9-login-form-pane {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(420px 260px at 12% 10%, rgba(77, 45, 149, 0.06), transparent 60%),
    radial-gradient(420px 260px at 90% 90%, rgba(26, 96, 190, 0.06), transparent 60%),
    var(--hr9-surface);
}

body.crm9-hr9-login .crm9-login-mobile-logo {
  display: none;
  height: 44px;
  width: auto;
  margin: 0 auto 18px;
}

body.crm9-hr9-login .crm9-login-form-pane .page-card,
body.crm9-hr9-login .crm9-login-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px;
  border-radius: 22px;
  background: var(--hr9-white);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

body.crm9-hr9-login .page-card-head {
  text-align: left !important;
  border: 0;
  padding: 0 0 8px;
}

body.crm9-hr9-login .page-card-head img,
body.crm9-hr9-login .page-card-head .app-logo {
  display: none !important;
}

body.crm9-hr9-login .page-card-head h4,
body.crm9-hr9-login .page-card-head .title,
body.crm9-hr9-login .crm9-login-title {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  color: #101828;
  text-align: left;
  margin: 0 0 6px;
}

body.crm9-hr9-login .crm9-login-subtitle,
body.crm9-hr9-login .page-card-head .sign-up-message,
body.crm9-hr9-login .for-login .page-card-head p {
  font-size: 14px;
  color: #667085;
  text-align: left;
  margin: 0 0 18px;
}

body.crm9-hr9-login .form-group label,
body.crm9-hr9-login label.control-label {
  font-size: 13px;
  font-weight: 600;
  color: #101828;
}

body.crm9-hr9-login .email-field,
body.crm9-hr9-login .password-field {
  position: relative;
}

body.crm9-hr9-login .form-control,
body.crm9-hr9-login input.form-control,
body.crm9-hr9-login input[type="text"],
body.crm9-hr9-login input[type="email"],
body.crm9-hr9-login input[type="password"] {
  height: 48px;
  line-height: 48px;
  border-radius: var(--hr9-radius-md);
  background: #fafbfe;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 0 40px 0 40px;
  box-shadow: none;
  transition: border-color var(--hr9-motion), box-shadow var(--hr9-motion);
}

/* Field icons + Show — vertically center in taller inputs */
body.crm9-hr9-login .field-icon,
body.crm9-hr9-login .email-icon,
body.crm9-hr9-login .password-icon,
body.crm9-hr9-login .page-card-body .field-icon {
  position: absolute !important;
  left: 14px !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  width: 16px !important;
  height: 16px !important;
  z-index: 2;
  pointer-events: none;
  display: block;
}
body.crm9-hr9-login .toggle-password,
body.crm9-hr9-login .page-card-body .toggle-password {
  position: absolute !important;
  right: 14px !important;
  left: auto !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  margin: 0 !important;
  line-height: 1 !important;
  z-index: 2;
  font-size: 12px;
}

body.crm9-hr9-login .form-control:focus,
body.crm9-hr9-login input.form-control:focus {
  border-color: var(--hr9-purple) !important;
  box-shadow: 0 0 0 3px rgba(77, 45, 149, 0.12) !important;
}

body.crm9-hr9-login .btn-login,
body.crm9-hr9-login .btn-primary.btn-login,
body.crm9-hr9-login .for-login .btn-primary {
  height: 48px;
  border-radius: var(--hr9-radius-md);
  background: var(--hr9-purple) !important;
  border-color: var(--hr9-purple) !important;
  color: var(--hr9-white) !important;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(77, 45, 149, 0.22);
  transition: transform var(--hr9-motion-fast), background var(--hr9-motion), box-shadow var(--hr9-motion);
}

body.crm9-hr9-login .btn-login:hover,
body.crm9-hr9-login .for-login .btn-primary:hover {
  background: linear-gradient(135deg, #4d2d95, #1a60be) !important;
  border-color: transparent !important;
  transform: translateY(-1px);
}

body.crm9-hr9-login .btn-default,
body.crm9-hr9-login .btn-secondary,
body.crm9-hr9-login .social-logins .btn {
  background: var(--hr9-white) !important;
  color: var(--hr9-blue) !important;
  border: 1px solid rgba(26, 96, 190, 0.22) !important;
  border-radius: var(--hr9-radius-md);
}

body.crm9-hr9-login a,
body.crm9-hr9-login .forgot-password-message a,
body.crm9-hr9-login .sign-up-message a {
  color: var(--hr9-blue);
}

body.crm9-hr9-login a:hover {
  color: var(--hr9-purple);
}

body.crm9-hr9-login .crm9-login-support {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  text-align: center;
  font-size: 13px;
  color: #667085;
}

@media (max-width: 820px) {
  body.crm9-hr9-login .crm9-login-shell {
    grid-template-columns: 1fr;
  }
  body.crm9-hr9-login .crm9-login-brand {
    display: none;
  }
  body.crm9-hr9-login .crm9-login-kicker,
  body.crm9-hr9-login .crm9-login-checks {
    display: none;
  }
  body.crm9-hr9-login .crm9-login-mobile-logo {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.crm9-hr9-login .crm9-orb,
  body.crm9-hr9-shell .widget.number-widget-box,
  body.crm9-hr9-shell .btn-primary,
  body.crm9-hr9-login .btn-login {
    animation: none !important;
    transition: none !important;
  }
}

/* crm9-hide-list-like-comment
   List view: hide comment count, like heart and "x of y" count.
   Keep .list-row-activity itself — it also holds assigned-to avatars. */
body.crm9-hr9-shell .list-row-activity > .comment-count,
body.crm9-hr9-shell .list-row-activity > .mx-2,
body.crm9-hr9-shell .list-row-activity > .list-row-like,
body.crm9-hr9-shell .list-row-head .list-count,
body.crm9-hr9-shell .list-row-head .list-liked-by-me {
  display: none !important;
}
