:root {
  /*
  --color-info: #40916C;
  --gradient-primary: linear-gradient(135deg, #1B4332 0%, #40916C 100%); */

  /* ============================================
     LAYER 1 — Raw Palette (named by SLOT, not hue)
     Swap what's poured into a slot anytime —
     the name never needs to change again
     ============================================ */
  --brand-1: #243A7D;
  /* currently navy */
  --brand-2: #1C88C9;
  /* currently sky blue — swap to red here anytime */
  --brand-3: #E5B921;
  /* currently gold */
  --neutral-dark: #000000;
  --neutral-light: #ffffff;
  --neutral-muted: #f4f6f9;
  --neutral-grey: #6c757d;
  --neutral-border: #e9ecef;
  --status-danger: #e63946;
  --transparent: transparent;
  /* ============================================
     LAYER 2 — Semantic tokens (named by ROLE)
     ============================================ */
  --color-primary: var(--brand-1);
  --color-info: var(--brand-2);
  --color-accent: var(--brand-3);
  --color-danger: var(--status-danger);
  --color-secondary: var(--neutral-dark);
  --color-surface: var(--neutral-light);
  --color-surface-muted: var(--neutral-muted);

  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-info) 100%);
  --font-family: 'Google Sans', 'Google Sans Text', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  --main-heading-font-size: 28px;
  --sub-heading-font-size: 20px;
  --small-heading-font-size: 16px;
  --main-content: 15px;
  --small-main-content: 13px;
  --mini-main-content: 12px;
  --heading-font-weight: 700;
  --content-font-weight: 400;
  --small-font-weight: 600;
  --medium-font-weight: 500;
  --heading-line-height: 1.3;
  --content-line-height: 1.6;
  --border-radius-standard: 8px;
  --border-radius-medium: 16px;
  --border-radius-full: 50%;
  --dashboard-sidebar-width: 260px;
  --dashboard-sidebar-collapsed-width: 72px;
  --dashboard-topbar-height: 64px;
}

body {
  background-color: var(--color-surface-muted);
  background-image: none;
  font-family: var(--font-family);
  margin: 0;
  color: var(--color-secondary);
  /* The fixed sidebar's width transition (72px <-> 260px) momentarily leaves
     its nowrap labels wider than the sidebar box; with overflow:visible that
     spill creates a horizontal scrollbar. The dashboard layout never needs
     horizontal page scroll, so pin it off. */
  overflow-x: hidden;
}

*,
::after,
::before {
  outline: none;
  margin: 0;
  padding: 0;
  text-decoration: none;
  list-style: none;
  padding-left: 0;
  box-shadow: none;
  border: none;
  box-sizing: border-box;
}

form,
dl,
ol,
ul,
p {
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: none;
}

/* === UTILITY CLASSES === */

/* Display Utilities */
.d-none {
  display: none;
}

.d-block {
  display: block;
}

.d-inline {
  display: inline;
}

.d-flex {
  display: flex;
}

.d-inline-flex {
  display: inline-flex;
}

.d-grid {
  display: grid;
}

.split-grid {
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  /* grid-template-columns: minmax(0, 40fr) minmax(0, 60fr) */
}

/* Flexbox Utilities */
.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column;
}

.flex-row-reverse {
  flex-direction: row-reverse;
}

.flex-column-reverse {
  flex-direction: column-reverse;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-nowrap {
  flex-wrap: nowrap;
}

.flex-wrap-reverse {
  flex-wrap: wrap-reverse;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-around {
  justify-content: space-around;
}

.justify-evenly {
  justify-content: space-evenly;
}

.align-start {
  align-items: flex-start;
}

.align-end {
  align-items: flex-end;
}

.align-center {
  align-items: center;
}

.align-baseline {
  align-items: baseline;
}

.align-stretch {
  align-items: stretch;
}

.justify-items-center {
  justify-items: center;
}

.flex-1 {
  flex: 1;
}

.flex-auto {
  flex: auto;
}

.flex-none {
  flex: none;
}

/* Grid Utilities */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-cols-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid-cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* Gap Utilities */
.gap-0 {
  gap: 0;
}

.gap-10 {
  gap: 10px;
}

.gap-20 {
  gap: 20px;
}

.gap-40 {
  gap: 40px;
}

/* Container Utilities */
.container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
}

.small-container {
  max-width: 640px;
}

.xs-container {
  max-width: 500px;
}

/* Margin Utilities */
.m-0 {
  margin: 0;
}

.m-auto {
  margin: auto;
}

.mt-0 {
  margin-top: 0;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mt-40 {
  margin-top: 40px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-40 {
  margin-bottom: 40px;
}

/* Padding Utilities */
.p-0 {
  padding: 0;
}

.p-10 {
  padding: 10px;
}

.p-20 {
  padding: 20px;
}

.pt-0 {
  padding-top: 0;
}

.pt-10 {
  padding-top: 10px;
}

.pt-20 {
  padding-top: 20px;
}

.pb-0 {
  padding-bottom: 0;
}

.pb-10 {
  padding-bottom: 10px;
}

.pb-20 {
  padding-bottom: 20px;
}

/* Text Alignment */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Width Utilities */
.w-25 {
  width: 25%;
}

.w-50 {
  width: 50%;
}

.w-75 {
  width: 75%;
}

.w-100 {
  width: 100%;
}

.w-auto {
  width: auto;
}

/* Height Utilities */
.h-100 {
  height: 100%;
}

.h-auto {
  height: auto;
}

/* Position Utilities */
.position-relative {
  position: relative;
}

.position-absolute {
  position: absolute;
}

.position-fixed {
  position: fixed;
}

.position-sticky {
  position: sticky;
}

/* Overflow Utilities */
.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.overflow-scroll {
  overflow: scroll;
}

.border-solid {
  border: 1px solid var(--neutral-border);
}

/* Typography */
.main-heading,
.sub-heading,
.main-content,
.small-heading,
.small-main-content {
  color: var(--color-secondary);
}

.main-heading,
.main-content {
  font-weight: var(--content-font-weight);
}

.main-heading {
  font-size: var(--main-heading-font-size);
  line-height: var(--heading-line-height);
}

.sub-heading {
  font-weight: var(--heading-font-weight);
  font-size: var(--sub-heading-font-size);
  opacity: 0.8;
}

.small-heading {
  font-size: var(--small-heading-font-size);
  line-height: var(--heading-line-height);
  font-weight: var(--heading-font-weight);
}

.small-content-heading {
  color: var(--neutral-grey);
  font-size: var(--small-main-content);
  font-weight: var(--small-font-weight);
}

.main-content {
  font-size: var(--main-content);
  line-height: var(--content-line-height);
}

.small-main-content {
  font-size: var(--small-main-content);
}

.success-text {
  color: var(--color-info);
}

.error-text {
  color: var(--color-danger);
}

.dashboard-heading {
  font-size: var(--sub-heading-font-size);
  font-weight: var(--small-font-weight);
  letter-spacing: 0.1em;
  color: var(--color-secondary);
  text-transform: capitalize;
  /* margin-bottom: 0; */
}

/* Buttons */
.ui-button {
  padding: 12px 20px;
  border: 1px solid var(--color-primary);
  border-radius: var(--border-radius-standard);
  font-size: 15px;
  line-height: 18px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  /* display: inline-block; */
}

.ui-button-primary {
  background: var(--color-primary);
  color: var(--color-surface);
}

.ui-button-secondary {
  background: var(--transparent);
  color: var(--color-primary);
}

.ui-button-danger {
  background: var(--transparent);
  color: var(--color-danger);
  border-color: var(--color-danger);
}

/* Invoice / Quotation table — colgroup widths only work with fixed layout */
.rcd-inv-table { table-layout: fixed; width: 100%; }

/* Invoice row action dropdown */
.rcd-info-grid { display: grid; grid-template-columns: 100px 1fr; gap: 8px 16px; margin: 0; }
.rcd-info-grid dt { font-weight: 600; color: var(--color-text, #222); white-space: nowrap; }
.rcd-info-grid dd { margin: 0; word-break: break-word; }

.rcd-row-menu { position: relative; display: inline-block; }
.rcd-row-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 20px;
  color: var(--color-text-muted, #666);
  line-height: 1;
  border-radius: 4px;
}
.rcd-row-menu-btn:hover { color: var(--color-primary); }
.rcd-row-menu-dropdown {
  display: none;
  position: fixed;
  min-width: 130px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  z-index: 9999;
  overflow: hidden;
}
.rcd-row-menu.open .rcd-row-menu-dropdown { display: block; }
.rcd-row-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-text, #333);
  text-decoration: none;
  white-space: nowrap;
}
.rcd-row-menu-item:hover { background: var(--color-bg-light, #f5f5f5); }
.rcd-row-menu-item--danger { color: var(--color-danger); }

.ui-button-success {
  background: var(--transparent);
  color: var(--color-info);
  border-color: var(--color-info);
}

.ui-button-gradient {
  background: var(--gradient-primary);
  color: var(--color-surface);
}

.ui-button-white {
  background: var(--color-surface);
  color: var(--color-secondary);
  border-color: var(--neutral-border);
}

.ui-button-borderless {
  border: none;
}

/* Loading spinner icon (used inside buttons while an action is in flight) */
.rcd-spin {
  display: inline-block;
  animation: rcd-spin 0.7s linear infinite;
}

@keyframes rcd-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Public plugin pages (profile / OTP): the theme's header prints a
   "Skip to content" accessibility link hidden by the theme's own
   screen-reader CSS — which is stripped on these pages, so hide it here. */
/* Plugin-rendered header on public pages with the "Header Only" layout
   (blank.php prints it — no theme header markup is involved). */
.rcd-public-header {
  padding: 24px 15px 0;
}

.custom-logo-link {
  max-width: 200px;
  display: block;
  margin: 0 auto 20px;
  text-align: center;
}

.custom-logo-link img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.rcd-public-header .rcd-site-title {
  display: block;
  text-align: center;
  font-size: var(--sub-heading-font-size);
  font-weight: var(--heading-font-weight);
  color: var(--color-primary);
  margin-bottom: 20px;
}

body.rcd-otp-page .custom-logo-link img {
  height: auto;
  max-width: 100%;
  width: 100%;
}

/* Full-page loader: covers the dashboard while a page's data is loading,
   blurs the content behind it, and fades out once RCD_Global.pageLoader.hide()
   is called. Shown by default (markup in dashboard-layout.php) so it is visible
   before the page JS runs. */
.rcd-page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.rcd-page-loader .rcd-spin {
  font-size: 40px;
  color: var(--color-primary);
}

.rcd-page-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Icons */
.fi {
  display: flex;
}

/* Higher specificity than .fi so the spinner stays a small inline glyph
   instead of stretching to fill the button (display:flex from .fi alone
   made it expand to the button's full width/height). */
.fi.rcd-spin {
  display: inline-flex;
  width: 1em;
  height: 1em;
  align-items: center;
  justify-content: center;
  vertical-align: -2px;
  flex: none;
}

/* Form Fields */
.ui-form-input {
  border-radius: var(--border-radius-standard);
  font-size: 15px;
  line-height: 18px;
  padding: 12px 20px;
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--neutral-border);
  font-family: var(--font-family);
}

.ui-form-label {
  color: var(--color-secondary);
  font-weight: var(--small-font-weight);
  font-size: var(--mini-main-content);
  margin-bottom: 8px;
}

/* Form Fields */
.ui-form-input {
  width: 100%;
  margin-top: 10px;
  padding: 12px 20px;
  border: 1px solid var(--neutral-border);
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 18px;
}

.ui-form-label {
  margin-bottom: 8px;
  color: var(--color-secondary);
  font-size: var(--mini-main-content);
  font-weight: var(--small-font-weight);
}

/* Tabs */
.ui-tabs {
  margin-top: 15px;
}

.ui-tabs-nav {
  background: var(--color-surface);
  padding: 8px;
  border-radius: var(--border-radius-standard);
}

.ui-tab-item,
.ui-subtab-item {
  flex: 1;
  min-width: 0;
}

.ui-tab-link {
  background: var(--color-surface-muted);
  padding: 12px 24px;
  cursor: pointer;
  font-size: var(--small-main-content);
  font-weight: var(--medium-font-weight);
  color: var(--color-secondary);
  border-radius: var(--border-radius-standard);
  transition: all 0.3s ease;
}

.ui-tab-link.active {
  background: var(--gradient-primary);
  color: var(--color-surface);
}

.ui-tabs-content {
  position: relative;
}

.ui-tab-panel,
.ui-subtab-panel,
.ui-color-picker-btn {
  display: none;
}

.ui-tab-panel.active,
.ui-subtab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Modals */
.ui-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ui-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.ui-modal {
  background: var(--color-surface);
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.ui-modal-overlay.show .ui-modal {
  transform: translateY(0);
}

.ui-modal-sm {
  max-width: 360px;
}

.ui-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--neutral-border);
}

.ui-modal-heading {
  font-size: var(--small-heading-font-size);
  font-weight: var(--small-font-weight);
  color: var(--color-secondary);
}

.ui-password-toggle {
  position: absolute;
  top: 20px;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--neutral-grey);
  font-size: 16px;
  padding: 4px;
  transition: color 0.2s;
}

.ui-password-toggle:hover {
  color: var(--color-secondary);
}

.ui-modal-close {
  background: var(--transparent);
  cursor: pointer;
}

.ui-modal-body {
  padding: 24px;
}

.ui-form-group {
  margin-bottom: 16px;
}

.d-grid .ui-form-group {
  margin-bottom: 0;
}

.ui-modal-footer {}

.ui-error-message {
  color: var(--color-danger);
  font-size: var(--mini-main-content);
  margin-top: 5px;
  margin-bottom: 0;
}

.ui-password-options {
  margin: 16px 0;
}

.ui-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-1);
}

/* Checkbox rows (e.g. Profile Features Visibility) */
.form-text {
  color: var(--neutral-grey);
  font-size: var(--mini-main-content);
}

.ui-form-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.ui-form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-1);
  flex-shrink: 0;
}

.ui-form-checkbox span {
  font-size: var(--main-content);
  color: var(--color-secondary);
}

/* Mobile Responsive */
@media only screen and (max-width: 767px) {}

/* ═══════════════════════════════════════════════════════════════
   Dashboard Layout
   ═══════════════════════════════════════════════════════════════ */

/* Dashboard */
.dashboard-layout {
  min-height: 100vh;
}

.dashboard-sidebar {
  width: var(--dashboard-sidebar-width);
  background: var(--color-surface);
  color: var(--color-primary);
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: width 0.3s ease;
  overflow: visible;
  border-right: 1px solid var(--neutral-border);
}

.dashboard-sidebar-header {
  border-bottom: 1px solid var(--neutral-border);
}

/* Logo */
.dashboard-logo a {
  color: var(--color-surface);
}

.dashboard-logo-full {
  max-width: 120px;
  height: auto;
}

.dashboard-logo-text {
  font-size: 20px;
  font-weight: var(--heading-font-weight);
  white-space: nowrap;
}

.dashboard-logo-icon {
  display: none;
  /* width: 32px;
  height: 32px; */
  width: 42px;
  height: 42px;
  border-radius: 6px;
}

.dashboard-logo-icon-text {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--color-info);
  color: var(--color-surface);
  font-weight: var(--heading-font-weight);
  font-size: 16px;
  align-items: center;
  justify-content: center;
}

/* Toggle Button — overlaps sidebar edge */
.dashboard-sidebar-toggle {
  width: 28px;
  height: 28px;
  background: var(--color-surface);
  border: 1px solid var(--neutral-border);
  border-radius: var(--border-radius-full);
  cursor: pointer;
  color: var(--color-primary);
  top: 24px;
  right: -14px;
  z-index: 1001;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

/* Sidebar Nav */
.dashboard-sidebar-nav {
  padding: 16px 0;
}

.dashboard-sidebar-nav .menu-item {
  margin: 2px 12px;
}

.dashboard-sidebar-nav .menu-item-link {
  padding: 12px 16px;
  color: var(--color-primary);
  border-radius: var(--border-radius-standard);
  font-size: var(--main-content);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.dashboard-sidebar-nav .menu-item-link:hover {
  /* background: rgba(255, 255, 255, 0.1); */
  background: var(--color-primary);
  color: var(--color-surface);
}

.dashboard-sidebar-nav .menu-item-link.active-menu-item-link {
  background: var(--color-info);
  color: var(--color-surface);
  font-weight: var(--small-font-weight);
}

.dashboard-sidebar-nav .menu-item-link i {
  font-size: 18px;
  width: 20px;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-sidebar-footer {
  border-top: 1px solid var(--neutral-border);
}

.dashboard-logout-btn {
  color: var(--color-surface);
  border-radius: var(--border-radius-standard);
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  font-size: var(--main-content);
  transition: color 0.2s;
  white-space: nowrap;
  padding: 12px 16px;

}

/* .dashboard-logout-btn:hover {
  color: var(--color-primary);
} */

/* === Sidebar Collapsed State === */
.dashboard-sidebar.collapsed {
  width: var(--dashboard-sidebar-collapsed-width);
}

.dashboard-sidebar.collapsed .dashboard-sidebar-header {
  justify-content: center;
  padding: 16px 12px;
}

.dashboard-sidebar.collapsed .dashboard-logo {
  display: flex;
  justify-content: center;
}

.dashboard-sidebar.collapsed .dashboard-logo-full,
.dashboard-sidebar.collapsed .dashboard-logo-text {
  display: none;
}

.dashboard-sidebar.collapsed .dashboard-logo-icon {
  display: block;
}

.dashboard-sidebar.collapsed .dashboard-logo-icon-text {
  display: flex;
}

.dashboard-sidebar.collapsed .dashboard-sidebar-toggle i {
  transform: rotate(180deg);
}

.dashboard-sidebar.collapsed .dashboard-sidebar-nav .menu-item {
  margin: 2px 8px;
}

.dashboard-sidebar.collapsed .dashboard-sidebar-nav .menu-item-link {
  justify-content: center;
  padding: 12px;
  gap: 0;
}

.dashboard-sidebar.collapsed .dashboard-sidebar-nav .menu-item-link span {
  display: none;
}

.dashboard-sidebar.collapsed .dashboard-sidebar-footer {
  padding: 16px 12px;
  display: flex;
  justify-content: center;
}

.dashboard-sidebar.collapsed .dashboard-logout-btn span {
  display: none;
}

.dashboard-sidebar.collapsed .dashboard-logout-btn {
  justify-content: center;
  padding: 10px;
}

/* Main content adjusts */
.dashboard-main {
  margin-left: var(--dashboard-sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
  /* Flex item in the dashboard-layout row: without min-width:0 it refuses to
     shrink below its content's intrinsic width, so wide tables/long content
     push this whole column off-screen (visible during the sidebar toggle
     transition). With 0 it shrinks and inner content scrolls/wraps inside
     its own containers (.ui-table-scroll etc.) instead. */
  min-width: 0;
}

.dashboard-layout.sidebar-collapsed .dashboard-main {
  margin-left: var(--dashboard-sidebar-collapsed-width);
}

/* Flex child of .dashboard-main's column — same min-width fix, so the
   ability to shrink (above) reaches the actual page content. */
.dashboard-content {
  min-width: 0;
}

/* Top Bar */
.dashboard-topbar {
  background: var(--color-surface);
  height: var(--dashboard-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--neutral-border);
  top: 0;
  z-index: 100;
  height: 75px;
}

.dashboard-mobile-toggle {
  display: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  color: var(--color-secondary);
}

.dashboard-topbar-title {
  font-size: var(--small-heading-font-size);
  font-weight: var(--small-font-weight);
  color: var(--color-secondary);
}

.dashboard-topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background: var(--color-primary);
  color: var(--color-surface);
  font-weight: var(--heading-font-weight);
}

.dashboard-topbar-user-info span {
  display: block;
  font-size: var(--small-main-content);
  color: var(--neutral-grey);
}

.dashboard-topbar-user-info strong {
  font-size: var(--small-main-content);
  color: var(--color-secondary);
  font-weight: var(--small-font-weight);
  text-transform: capitalize;
}

/* Footer */
.dashboard-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--neutral-border);
  background: var(--color-surface);
  text-align: center;
  font-size: var(--small-main-content);
  color: var(--neutral-grey);
}

.ui-card {
  background: var(--color-surface);
  border-radius: var(--border-radius-standard);
  padding: 15px;
  border: 1px solid var(--neutral-border);
}

.ui-box {
  max-width: 500px;
  padding: 40px 32px;
}

.ui-box-primary {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

.ui-stat-icon {
  border-radius: var(--border-radius-medium);
  background: var(--neutral-border);
  color: var(--color-primary);
}

.ui-stat-icon-primary {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  font-size: var(--main-heading-font-size);
}

.ui-stat-value {
  display: block;
  font-size: var(--sub-heading-font-size);
  font-weight: var(--heading-font-weight);
  color: var(--color-secondary);
}

.ui-stat-label {
  font-size: var(--small-main-content);
  color: var(--neutral-grey);
}

/* Tables */
.ui-table-wrapper {
  overflow-x: auto;
}

.ui-table {
  width: 100%;
  border-collapse: collapse;
}

.ui-table th,
.ui-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: var(--main-content);
  border-bottom: 1px solid var(--neutral-border);
  vertical-align: middle;
}

.ui-table th {
  font-weight: var(--small-font-weight);
  color: var(--neutral-grey);
  font-size: var(--small-main-content);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--neutral-border);
  background: var(--color-surface);
}

.ui-table tbody tr:nth-child(even) {
  background: var(--color-surface-muted);
}

.ui-table .ui-table-action {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rcd-row-expired {
  background: #ffe4e6;
}

/* Soft-deleted profile row (manager Company Users table): dimmed with a
   struck-through label; the green Undelete button in the Action column restores it. */
.rcd-row-deleted {
  opacity: 0.55;
}

.rcd-row-deleted td.u-text-truncate {
  text-decoration: line-through;
}

/* .ui-table td a{
  color: var(--color-secondary);
} */

.ui-table tbody tr:hover {
  background: var(--neutral-border);
}

/* Vertical scroll for large tables (keeps header visible), no horizontal scroll */
.ui-table-wrapper.ui-table-scroll {
  /* max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden; */
}

/* Fixed layout: columns share container width so cells can truncate instead of overflowing */
.ui-table-scroll .ui-table {
  table-layout: fixed;
}

.ui-table-scroll .ui-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--color-surface);
}

/* Truncate long content (emails, URLs) to one line with a … ellipsis.
   Requires a bounded width — inside .ui-table-scroll the fixed layout provides it. */
.u-text-truncate {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* FAQ */
.ui-faq-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--neutral-border);
}

.ui-faq-item:last-child {
  border-bottom: none;
}

.ui-faq-question {
  cursor: pointer;
}

.ui-faq-question i {
  transition: transform 0.3s ease;
}

.ui-faq-item.active .ui-faq-question i {
  transform: rotate(180deg);
}

.ui-faq-answer {
  display: none;
}

.ui-faq-item.active .ui-faq-answer {
  display: block;
}

/* Sidebar Overlay (mobile) */
.dashboard-sidebar-overlay {
  display: none;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Toast */
.ui-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--border-radius-standard);
  background: var(--color-secondary);
  color: var(--color-surface);
  font-size: var(--main-content);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 10001;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.ui-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.ui-toast-success {
  background: var(--color-info);
}

.ui-toast-error {
  background: var(--color-danger);
}

/* Badge */
.ui-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--color-surface-muted);
  border: 1px solid var(--neutral-border);
  border-radius: var(--border-radius-standard);
  font-size: var(--mini-main-content);
  color: var(--color-secondary);
  font-weight: var(--medium-font-weight);
}

/* Status badge (WooCommerce order statuses) */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--border-radius-standard);
  font-size: var(--mini-main-content);
  font-weight: var(--medium-font-weight);
  text-transform: capitalize;
}

.status-completed {
  background: #e6f4ea;
  color: #1e7e34;
}

.status-processing {
  background: #e8f0fe;
  color: #1a73e8;
}

.status-on-hold {
  background: #fef7e0;
  color: #b06d00;
}

.status-pending {
  background: #fef7e0;
  color: #b06d00;
}

.status-cancelled {
  background: #fce8e6;
  color: #c5221f;
}

.status-refunded {
  background: #f1f3f4;
  color: #5f6368;
}

.status-failed {
  background: #fce8e6;
  color: #c5221f;
}

.ui-pagination {
  justify-content: center;
  padding-top: 16px;
  flex-wrap: wrap;
}

.ui-pagination-button {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--neutral-border);
  border-radius: var(--border-radius-standard);
  background: var(--color-surface);
  color: var(--color-secondary);
  font-size: var(--small-main-content);
  cursor: pointer;
  transition: all 0.2s;
}

.ui-pagination-button:hover:not([disabled]):not(.active) {
  background: var(--color-surface-muted);
  border-color: var(--color-primary);
}

.ui-pagination-button.active {
  background: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
}

.ui-pagination-button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.ui-pagination-dots {
  font-size: var(--small-main-content);
  color: var(--neutral-grey);
  padding: 0 4px;
}

/* Avatars */
.rcd-avatar {
  border-radius: var(--border-radius-full);
  object-fit: cover;
  background: var(--color-surface-muted);
  border: 1px solid var(--neutral-border);
}

.rcd-avatar-sm {
  width: 32px;
  height: 32px;
}

.rcd-avatar-lg {
  width: 80px;
  height: 80px;
}

/* Avatar edit trigger — opens the reusable image cropper (see RCD_Global.cropper) */
.rcd-avatar-edit {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.rcd-avatar-edit-icon {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  border-radius: var(--border-radius-full);
  background: var(--color-primary);
  color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid var(--color-surface);
}

/* Reusable image cropper (#rcd-cropper-modal). Crop shape is toggled via the
   rcd-cropper-shape-* class set by RCD_Global.cropper.open({ shape }). */

/* The cropper is a secondary modal opened from inside another modal (profile /
   edit-user). All .ui-modal-overlay share z-index 9998, so with an equal stack
   the later modal in the DOM wins — the cropper would render behind its opener.
   Bump it above the base modal layer (but below the toast at 10001). */
#rcd-cropper-modal {
  z-index: 10000;
}

/* .rcd-cropper-modal {
  max-width: 400px;
} */

.rcd-cropper-stage {
  margin: 0 auto;
  overflow: hidden;
  background: var(--color-surface-muted);
  border: 1px solid var(--neutral-border);
  position: relative;
  touch-action: none;
}

.rcd-cropper-stage canvas {
  display: block;
  cursor: grab;
}

.rcd-cropper-stage.dragging canvas {
  cursor: grabbing;
}

.rcd-cropper-stage.rcd-cropper-shape-circle {
  border-radius: var(--border-radius-full);
}

.rcd-cropper-stage.rcd-cropper-shape-square,
.rcd-cropper-stage.rcd-cropper-shape-rect {
  border-radius: var(--border-radius-standard);
}

.rcd-cropper-zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--neutral-border);
  background: var(--color-surface);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.rcd-cropper-zoom-range {
  flex: 1;
  accent-color: var(--color-primary);
}

/* Invoice/Quotation product row remove button */
.rcd-remove-row {
  position: absolute;
  top: 0;
  right: 0;
  width: 22px;
  height: 22px;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--color-danger);
  background: var(--color-surface);
  color: var(--color-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.rcd-remove-row:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.rcd-phone {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.rcd-phone .ui-form-input {
  margin-top: 0;
}

.rcd-phone .rcd-phone-num {
  flex: 1 1 auto;
  min-width: 0;
}

.rcd-phone .rcd-phone-ext {
  flex: 0 0 90px;
  width: 90px;
}

/* Country-code selector */
.rcd-phone-cc {
  position: relative;
  flex: 0 0 auto;
}

.rcd-phone-cc-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 12px 12px;
  border: 1px solid var(--neutral-border);
  border-radius: 8px;
  background: var(--color-surface);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 18px;
  white-space: nowrap;
}

.rcd-phone-cc-btn .fi {
  font-size: 12px;
  display: flex;
}

.rcd-phone-flag {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

.rcd-phone-dial {
  font-weight: 500;
}

/* Dropdown panel */
.rcd-phone-cc-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1002;
  width: 260px;
  max-width: 80vw;
  background: var(--color-surface);
  border: 1px solid var(--neutral-border);
  border-radius: var(--border-radius-standard);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 8px;
}

.rcd-phone--open .rcd-phone-cc-menu {
  display: block;
}

.rcd-phone-cc-search {
  margin-top: 0;
  margin-bottom: 6px;
}

.rcd-phone-cc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.rcd-phone-cc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.rcd-phone-cc-item:hover {
  background: var(--neutral-border);
}

.rcd-phone-cc-name {
  flex: 1 1 auto;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rcd-phone-cc-dial {
  color: var(--color-secondary);
  font-size: 13px;
}

/* Topbar User Dropdown */
.dashboard-topbar-user {
  cursor: pointer;
}

.dashboard-topbar-arrow {
  font-size: 12px;
}

.dashboard-topbar-user.dropdown-open .dashboard-topbar-arrow {
  transform: rotate(180deg);
}

.dashboard-topbar-dropdown {
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--neutral-border);
  border-radius: var(--border-radius-standard);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 190px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  z-index: 200;
}

.dashboard-topbar-user.dropdown-open .dashboard-topbar-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dashboard-topbar-dropdown ul {
  padding: 8px 0;
}

.dashboard-topbar-dropdown ul li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--color-secondary);
  font-size: var(--main-content);
  transition: background 0.2s;
}

.dashboard-topbar-dropdown ul li a:hover {
  background: var(--color-surface-muted);
}

.dashboard-topbar-dropdown ul li a i {
  font-size: 16px;
  color: var(--neutral-grey);
}


/* Responsive */
@media (max-width: 991px) {
  .dashboard-sidebar {
    transform: translateX(-100%);
    width: var(--dashboard-sidebar-width);
  }

  .dashboard-sidebar.active {
    transform: translateX(0);
    height: 100%;
  }

  .dashboard-sidebar.collapsed {
    width: var(--dashboard-sidebar-width);
  }

  .dashboard-sidebar .dashboard-sidebar-toggle {
    display: none;
  }

  .dashboard-sidebar-overlay.active,
  .dashboard-mobile-toggle {
    display: block;
  }

  .dashboard-main {
    margin-left: 0;
  }

  .dashboard-layout.sidebar-collapsed .dashboard-main {
    margin-left: 0;
  }

  .dashboard-sidebar-toggle {
    display: none;
  }

  .rcd-sidebar {
    height: auto;
  }
}

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

  .d-grid.grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .d-grid.grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

/* Chart */
.ui-chart-container {
  position: relative;
  height: 350px;
}

@media (max-width: 768px) {
  .ui-chart-container {
    height: 250px;
  }
}

/* Google Maps Places Autocomplete dropdown */
.pac-container {
  z-index: 10000 !important;
  font-family: inherit;
  border-radius: var(--border-radius-standard);
  border: 1px solid var(--neutral-border);
  background-color: var(--color-surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.pac-item {
  cursor: pointer;
  padding: 8px 12px;
  font-family: inherit;
  font-size: var(--small-main-content);
  border-top: 1px solid var(--neutral-border);
  color: var(--color-secondary);
}

.pac-item:hover,
.pac-item-selected {
  background-color: var(--color-surface-muted);
}

.pac-item-query {
  font-size: var(--small-main-content);
  color: var(--color-primary);
}
