/* ==========================================================================
   Hajiz Design System - Core Tokens & Global Styles (Pure ASP.NET Core)
   Adhering to DESIGN_GUIDELINES.md
   ========================================================================== */


/* ==========================================================================
   Hajiz Design System - Global Styles
   Tokens: wwwroot/css/tokens.css
   ========================================================================== */

/* Legacy block removed — all tokens live in tokens.css */

/* Base Elements */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html {
    overflow-y: scroll;
  }
}

body {
  font-family: var(--font-sans);
  background: var(--murphy-page-gradient), #f2f0f7;
  background-attachment: fixed;
  color: var(--color-ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--color-ink);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 { font-size: 2.15rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.28rem; }
h4 { font-size: 1.1rem; }

a {
  color: var(--org-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

/* App Shell Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

/* Frosted Translucent Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  color: #1e293b;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(124, 58, 237, 0.04);
  border-right: 1px solid rgba(255, 255, 255, 0.85);
  transition: width var(--transition-sidebar), transform var(--transition-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  will-change: width, transform;
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  box-shadow: -4px 0 24px rgba(124, 58, 237, 0.04);
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.85);
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  position: relative;
  flex-shrink: 0;
}

.sidebar-waffle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  border: 1px solid rgba(124, 58, 237, 0.4);
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-waffle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.waffle-icon {
  display: grid;
  grid-template-columns: repeat(3, 3px);
  grid-template-rows: repeat(3, 3px);
  gap: 2px;
}

.waffle-icon span {
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: #ffffff;
  display: block;
}

.sidebar-module-code {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #ffffff;
  line-height: 1;
  text-transform: uppercase;
}

.brand-title-box {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  white-space: nowrap;
  line-height: 1.15;
  transition: opacity var(--transition-fast);
}

.brand-module-subtitle {
  font-size: 0.68rem;
  font-weight: 700;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.sidebar-collapse-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: auto;
  transition: all var(--transition-fast);
  padding: 0;
  flex-shrink: 0;
}

[dir="rtl"] .sidebar-collapse-btn {
  margin-left: 0;
  margin-right: auto;
}

.sidebar-collapse-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}




/* Quick Search Box in Sidebar */
.sidebar-search-box {
  margin: 8px 14px 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.82rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.sidebar-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.82rem;
  color: #0f172a;
  width: 100%;
}

.sidebar-search-box kbd {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: #64748b;
}

/* Categorized Nav Section Titles */
.nav-section-title {
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 14px 14px 4px;
}

.nav-links {
  list-style: none;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item a,
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #475569;
  font-size: 0.86rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
}

[dir="rtl"] .nav-item a,
[dir="rtl"] .nav-group-toggle {
  text-align: right;
}

.nav-item a:hover,
.nav-group-toggle:hover {
  color: #7c3aed;
  background: rgba(245, 243, 255, 0.8);
  border-color: rgba(221, 214, 254, 0.6);
}

.nav-item.active a {
  background: #ede9fe;
  color: #6d28d9;
  font-weight: 700;
  border-color: #c4b5fd;
  box-shadow: 0 1px 3px rgba(124, 58, 237, 0.08);
}

.nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: #6d28d9;
}

.nav-label-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-chevron {
  width: 12px;
  height: 12px;
  color: #94a3b8;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-left: auto;
  flex-shrink: 0;
}

[dir="rtl"] .nav-chevron {
  margin-left: 0;
  margin-right: auto;
}

.nav-group-parent.open > .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
  color: #7c3aed;
}

.nav-group-parent.active-parent > .nav-group-toggle {
  color: #6d28d9;
  font-weight: 700;
}

.nav-sub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, margin 0.2s ease;
}

.nav-group-parent.open > .nav-sub-list {
  max-height: 400px;
  opacity: 1;
  margin: 2px 0 4px;
}

.nav-sub-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 28px;
  margin: 1px 0;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.81rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

[dir="rtl"] .nav-sub-item a {
  padding: 5px 28px 5px 12px;
}

.nav-sub-bullet {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.nav-sub-item a:hover {
  color: #7c3aed;
  background: rgba(245, 243, 255, 0.6);
}

.nav-sub-item a:hover .nav-sub-bullet {
  background: #7c3aed;
}

.nav-sub-item.active a {
  background: #f5f3ff;
  color: #6d28d9;
  font-weight: 700;
  border-color: #ddd6fe;
}

.nav-sub-item.active a .nav-sub-bullet {
  background: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.nav-count-badge {
  background: #ede9fe;
  color: #6d28d9;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 700;
  padding: 1px 6px;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
}

[dir="rtl"] .nav-count-badge {
  margin-left: 0;
  margin-right: auto;
}

/* Topbar Context Pills & Breadcrumbs */
.topbar-context-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.81rem;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: all var(--transition-fast);
  position: relative;
  max-width: 200px;
  white-space: nowrap;
}

.topbar-pill:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.topbar-workspace-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.topbar-pill .pill-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.topbar-pill .pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-branch-pill {
  background: #ffffff;
  padding-right: 22px;
}

[dir="rtl"] .topbar-branch-pill {
  padding-right: 10px;
  padding-left: 22px;
}

.topbar-branch-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 600;
  color: #1e293b;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
}

.pill-chevron {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #94a3b8;
}

[dir="rtl"] .pill-chevron {
  right: auto;
  left: 8px;
}

.topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: #64748b;
  margin: 0 4px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-item {
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  transition: color var(--transition-fast);
}

a.breadcrumb-item:hover {
  color: #7c3aed;
}

.breadcrumb-item.active {
  color: #0f172a;
  font-weight: 700;
}

.breadcrumb-separator {
  color: #cbd5e1;
  font-size: 0.75rem;
}

/* Collapsed Sidebar Rules (Qualys-Style Icon Rail) */
.sidebar-is-collapsed .sidebar,
.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width, 68px) !important;
}

.sidebar-is-collapsed .sidebar .sidebar-header,
.sidebar-collapsed .sidebar .sidebar-header {
  padding: 0 14px;
  justify-content: center;
}

.sidebar-is-collapsed .sidebar .brand-title-box,
.sidebar-collapsed .sidebar .brand-title-box,
.sidebar-is-collapsed .sidebar .sidebar-collapse-btn,
.sidebar-collapsed .sidebar .sidebar-collapse-btn,
.sidebar-is-collapsed .sidebar .nav-label-text,
.sidebar-collapsed .sidebar .nav-label-text,
.sidebar-is-collapsed .sidebar .nav-chevron,
.sidebar-collapsed .sidebar .nav-chevron,
.sidebar-is-collapsed .sidebar .nav-sub-list,
.sidebar-collapsed .sidebar .nav-sub-list,
.sidebar-is-collapsed .sidebar .nav-section-title,
.sidebar-is-collapsed .sidebar .sidebar-user-card div:not(.avatar),
.sidebar-collapsed .sidebar .sidebar-user-card div:not(.avatar) {
  display: none !important;
}

.sidebar-is-collapsed .sidebar .nav-links,
.sidebar-collapsed .sidebar .nav-links {
  padding: 0 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.sidebar-is-collapsed .sidebar .nav-item a,
.sidebar-collapsed .sidebar .nav-item a,
.sidebar-is-collapsed .sidebar .nav-group-toggle,
.sidebar-collapsed .sidebar .nav-group-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  width: 42px !important;
  height: 42px !important;
  margin: 0 auto !important;
  border-radius: 10px !important;
}

.sidebar-is-collapsed .sidebar .nav-icon-wrap,
.sidebar-collapsed .sidebar .nav-icon-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.sidebar-is-collapsed .sidebar .nav-icon-wrap svg,
.sidebar-collapsed .sidebar .nav-icon-wrap svg,
.sidebar-is-collapsed .sidebar .nav-icon,
.sidebar-collapsed .sidebar .nav-icon {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.sidebar-is-collapsed .sidebar .sidebar-user-card,
.sidebar-collapsed .sidebar .sidebar-user-card {
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.sidebar-is-collapsed .main-content,
.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width, 68px) !important;
}

[dir="rtl"].sidebar-is-collapsed .main-content,
[dir="rtl"] .sidebar-collapsed .main-content {
  margin-left: 0 !important;
  margin-right: var(--sidebar-collapsed-width, 68px) !important;
}

/* ==========================================================================
   Qualys-Style Mega Module Launcher Overlay (Anchored Sub-Menu Mega-Drawer)
   ========================================================================== */
.module-launcher-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999 !important;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

[dir="rtl"] .module-launcher-overlay {
  justify-content: flex-end;
}

.module-launcher-overlay.open {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.module-launcher-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.module-launcher-panel {
  position: relative;
  width: 780px;
  max-width: 90vw;
  height: 100vh;
  max-height: 100vh;
  background: #ffffff;
  border-radius: 0 20px 20px 0;
  box-shadow: 16px 0 50px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] .module-launcher-panel {
  border-radius: 20px 0 0 20px;
  box-shadow: -16px 0 50px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
}

.module-launcher-overlay.open .module-launcher-panel {
  transform: translateX(0) !important;
}

.module-launcher-header {
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fafafa;
  flex-shrink: 0;
}

.launcher-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.launcher-back-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  display: grid;
  place-items: center;
  color: #475569;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.launcher-back-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[dir="rtl"] .launcher-back-btn svg {
  transform: rotate(180deg);
}

.launcher-header-title-box {
  display: flex;
  flex-direction: column;
}

.launcher-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin: 0;
}

.launcher-subtitle {
  font-size: 0.76rem;
  color: #64748b;
}

.launcher-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.launcher-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 14px;
  width: 240px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.launcher-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.82rem;
  width: 100%;
  color: #0f172a;
}

.launcher-close-btn {
  font-size: 1.6rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color var(--transition-fast);
}

.launcher-close-btn:hover {
  color: #0f172a;
}

/* 2-Column Body */
.module-launcher-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.module-cat-nav {
  width: 230px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  flex-shrink: 0;
}

[dir="rtl"] .module-cat-nav {
  border-right: none;
  border-left: 1px solid #e2e8f0;
}

.module-cat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

[dir="rtl"] .module-cat-btn {
  text-align: right;
}

.module-cat-btn .cat-icon {
  font-size: 1rem;
}

.module-cat-btn .cat-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-cat-btn .cat-count {
  font-size: 0.70rem;
  color: #94a3b8;
  background: rgba(226, 232, 240, 0.7);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.module-cat-btn:hover {
  background: #ede9fe;
  color: #6d28d9;
}

.module-cat-btn.active {
  background: #ffffff;
  color: #6d28d9;
  border-color: #ddd6fe;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.08);
}

.module-cat-btn.active .cat-count {
  background: #ede9fe;
  color: #6d28d9;
}

.module-apps-panel {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  min-height: 0;
  background: #ffffff;
}

.module-cat-section {
  margin-bottom: 28px;
}

.module-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.cat-section-icon {
  font-size: 1.1rem;
}

.cat-section-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}

.cat-section-badge {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  margin-left: auto;
}

[dir="rtl"] .cat-section-badge {
  margin-left: 0;
  margin-right: auto;
}

.module-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.module-app-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.module-app-card:hover {
  background: #ffffff;
  border-color: #c4b5fd;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.08);
}

.module-app-card.active {
  background: #f5f3ff;
  border-color: #a78bfa;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
}

.module-app-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #6d28d9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
}

.module-code-tag {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #7c3aed;
  line-height: 1;
}

.module-app-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.module-app-svg svg {
  width: 18px;
  height: 18px;
}

.module-app-info {
  flex: 1;
  min-width: 0;
}

.module-app-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.module-app-desc {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.25;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.module-app-arrow {
  color: #cbd5e1;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

[dir="rtl"] .module-app-arrow svg {
  transform: rotate(180deg);
}

.module-app-card:hover .module-app-arrow {
  color: #7c3aed;
  transform: translateX(3px);
}

[dir="rtl"] .module-app-card:hover .module-app-arrow {
  transform: translateX(-3px);
}



.sidebar-footer {
  margin-top: auto;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
}

.sidebar-user-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.85;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-brass-soft);
  color: var(--color-ink);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.main-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--topbar-height);
  transition: margin-left var(--transition-sidebar), margin-right var(--transition-sidebar);
  contain: style;
  background: var(--murphy-page-gradient);
}

[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

/* ==========================================================================
   Mobile-First & Responsive App Shell (@media max-width: 992px & 768px)
   ========================================================================== */

/* 1. Mobile Sidebar Off-Canvas Drawer */
@media (max-width: 992px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: min(300px, 86vw) !important;
    max-width: 86vw !important;
    z-index: 1400 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2) !important;
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
  }

  [dir="rtl"] .sidebar {
    left: auto !important;
    right: 0 !important;
    transform: translateX(100%) !important;
    border-right: none !important;
    border-left: 1px solid #e2e8f0 !important;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2) !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* When mobile-open, always show all labels & full sidebar content */
  .sidebar .brand-title-box,
  .sidebar .nav-label-text,
  .sidebar .nav-chevron,
  .sidebar .nav-section-title {
    display: block !important;
  }

  .sidebar .nav-group-parent.open .nav-sub-list {
    display: block !important;
  }

  .sidebar .nav-item a,
  .sidebar .nav-group-toggle {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 8px 12px !important;
  }

  /* Backdrop */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1350;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .topbar,
  html.sidebar-is-collapsed .topbar,
  .app-shell.sidebar-collapsed .topbar,
  [dir="rtl"] .topbar,
  [dir="rtl"] html.sidebar-is-collapsed .topbar,
  [dir="rtl"] .app-shell.sidebar-collapsed .topbar {
    left: 0 !important;
    right: 0 !important;
  }
}

/* 2. Mobile Topbar Refinements */
@media (max-width: 768px) {
  .topbar {
    padding: 0 10px !important;
    height: 56px !important;
  }

  .topbar-left-section {
    gap: 8px !important;
  }

  .topbar-context-group {
    gap: 4px !important;
  }

  .topbar-workspace-pill,
  .topbar-branch-pill {
    max-width: 130px !important;
    padding: 3px 8px !important;
    font-size: 0.76rem !important;
  }

  .topbar-breadcrumbs {
    display: none !important;
  }

  .topbar-right-section {
    gap: 6px !important;
  }

  .topbar-lang-btn {
    padding: 4px 8px !important;
    font-size: 0.76rem !important;
    min-height: 32px !important;
  }

  .topbar-notif-btn {
    width: 34px !important;
    height: 34px !important;
  }
}

/* 3. Mobile Module Launcher (Full screen responsive modal) */
@media (max-width: 768px) {
  .module-launcher-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }

  .module-launcher-header {
    height: 56px !important;
    padding: 0 14px !important;
    gap: 8px !important;
  }

  .launcher-search-box {
    width: 140px !important;
    padding: 4px 8px !important;
  }

  .module-launcher-body {
    flex-direction: column !important;
  }

  .module-cat-nav {
    width: 100% !important;
    height: auto !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 8px 10px !important;
    border-right: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  [dir="rtl"] .module-cat-nav {
    border-left: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .module-cat-btn {
    width: auto !important;
    padding: 6px 12px !important;
    font-size: 0.78rem !important;
    flex-shrink: 0 !important;
  }

  .module-apps-panel {
    padding: 14px !important;
  }

  .module-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .module-app-card {
    padding: 10px 12px !important;
  }
}

.sidebar-toggle-btn {
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--color-line);
  color: var(--color-ink);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.topbar {
  height: var(--topbar-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--color-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 1300;
  width: auto;
  box-sizing: border-box;
  isolation: isolate;
  pointer-events: auto;
  transition: left var(--transition-sidebar), right var(--transition-sidebar);
}

[dir="rtl"] .topbar {
  left: 0;
  right: var(--sidebar-width);
}

html.sidebar-is-collapsed .topbar,
.app-shell.sidebar-collapsed .topbar {
  left: var(--sidebar-collapsed-width, 68px);
}

[dir="rtl"] html.sidebar-is-collapsed .topbar,
[dir="rtl"] .app-shell.sidebar-collapsed .topbar {
  left: 0;
  right: var(--sidebar-collapsed-width, 68px);
}

.topbar-left-section {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
  /* Not clipped: the sidebar toggle sits flush against this box's start edge, so
     overflow:hidden here shears its border/focus ring. Long content is truncated by
     .topbar-breadcrumbs and .topbar-pill .pill-label instead. */
  overflow: visible;
}

.topbar-right-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 1200;
  pointer-events: auto;
}

.topbar-lang-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  line-height: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
}

.topbar-lang-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.topbar-notif-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 3;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-notif-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.notif-bell-icon {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notif-badge-bubble {
  position: absolute;
  top: -2px;
  right: -2px;
  padding: 2px 5px;
  font-size: 0.68rem;
  display: none;
}

[dir="rtl"] .notif-badge-bubble {
  right: auto;
  left: -2px;
}

.page-container {
  padding: 32px;
  max-width: none;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  flex: 1 1 auto;
  background: transparent;
  min-height: calc(100vh - var(--topbar-height));
}

@media (max-width: 768px) {
  .topbar {
    padding: 0 12px;
  }
  .page-container {
    padding: 16px 12px;
    width: 100%;
    max-width: 100%;
  }
}

/* Universal Page Heading & Action Button Row */
.page-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-heading-btn {
  padding: 8px 18px;
  font-size: 0.88rem;
  border-radius: 9999px;
}

@media (max-width: 600px) {
  .page-heading-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .page-heading-btn {
    width: 100% !important;
    min-height: 44px;
    justify-content: center;
    font-size: 0.92rem !important;
    display: flex;
    align-items: center;
  }
}

/* Client profile page */
.crm-profile-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.crm-profile-stats-card {
  padding: 0;
}

.crm-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.crm-profile-stat {
  padding: 18px 20px;
  text-align: center;
  border-right: 1px solid var(--murphy-card-border, var(--color-line));
}

.crm-profile-stat:last-child {
  border-right: none;
}

.crm-profile-stat-label {
  font-size: 0.78rem;
  color: var(--murphy-text-muted, var(--color-ink-soft));
  font-weight: 600;
  margin-bottom: 6px;
}

.crm-profile-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--murphy-text, var(--color-ink));
  line-height: 1.2;
}

.crm-profile-stat-value--mono {
  font-size: 1rem;
  font-family: var(--font-mono);
}

.crm-profile-stat-value--accent {
  color: var(--murphy-accent, var(--org-primary));
}

.crm-profile-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr);
  gap: 20px;
  align-items: start;
}

.crm-profile-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.crm-section-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--murphy-text, var(--color-ink));
}

.crm-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.crm-section-header .crm-section-title {
  margin: 0;
}

.crm-inline-field {
  margin-bottom: 14px;
}

.crm-profile-divider {
  border-top: 1px solid var(--murphy-card-border, var(--color-line));
  padding-top: 16px;
  margin-top: 4px;
}

.crm-profile-divider + .crm-profile-divider {
  margin-top: 16px;
}

.crm-tag-add-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.crm-tag-add-row .form-control {
  flex: 1;
  min-width: 0;
}

.crm-empty-hint {
  margin: 0;
  color: var(--murphy-text-muted, var(--color-ink-soft));
  font-size: 0.9rem;
}

.crm-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.crm-upcoming-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--murphy-card-border, var(--color-line));
}

.crm-upcoming-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.crm-upcoming-service {
  font-weight: 600;
  color: var(--murphy-text, var(--color-ink));
}

.crm-upcoming-meta,
.crm-upcoming-date {
  font-size: 0.85rem;
  color: var(--murphy-text-muted, var(--color-ink-soft));
}

.crm-upcoming-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  margin-top: 2px;
}

.crm-billing-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.crm-billing-stat {
  background: var(--murphy-toolbar-bg, var(--color-bg));
  border: 1px solid var(--murphy-card-border, var(--color-line));
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  text-align: center;
}

.crm-billing-stat-label {
  font-size: 0.74rem;
  color: var(--murphy-text-muted, var(--color-ink-soft));
  margin-bottom: 4px;
}

.crm-billing-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.crm-billing-stat-value--warn {
  color: #d97706;
}

.crm-billing-stat-value--ok {
  color: #16a34a;
}

.crm-invoice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-invoice-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--murphy-card-border, var(--color-line));
  border-radius: var(--radius-md, 10px);
  background: var(--murphy-toolbar-bg, #f8fafc);
  font-size: 0.88rem;
}

.crm-invoice-link {
  font-weight: 700;
  color: #0d9488;
  font-family: var(--font-mono);
  text-decoration: none;
}

.crm-invoice-link:hover {
  text-decoration: underline;
}

.crm-invoice-row .badge {
  margin-left: 8px;
  font-size: 0.72rem;
}

.crm-invoice-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
}

.crm-mono {
  font-family: var(--font-mono);
}

.crm-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-top: 16px;
  flex-wrap: wrap;
}

.crm-comm-badge {
  font-size: 0.72rem;
}

.crm-comm-badge--campaign {
  border-color: var(--murphy-accent, #8b5cf6);
  color: var(--murphy-accent, #8b5cf6);
}

@media (max-width: 992px) {
  .crm-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .crm-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-profile-stat:nth-child(2n) {
    border-right: none;
  }

  .crm-profile-stat:nth-child(-n+2) {
    border-bottom: 1px solid var(--murphy-card-border, var(--color-line));
  }

  .client-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* 2-Column CRM Client Detail Grid (legacy alias) */
.client-detail-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .client-detail-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Glass Cards & Surfaces */
.card {
  background: var(--color-paper-light);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-container);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.page-container section.ac-section.card,
.page-container .ac-section.card {
  background: var(--murphy-toolbar-bg);
  border-color: var(--murphy-card-border);
  box-shadow: var(--murphy-shadow);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 999px;
  min-height: 30px;
}

.btn-sm.btn-outline-neutral {
  background: var(--color-paper-light);
  border: 1px solid var(--color-line);
  color: var(--color-slate);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  transition: all var(--transition-fast);
  line-height: 1.2;
}

.btn-sm.btn-outline-neutral:hover {
  background: var(--color-paper);
  border-color: #cbd5e1;
  color: var(--color-ink);
}

.btn-sm.btn-outline-danger {
  background: var(--color-paper-light);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: var(--color-danger);
  border-radius: 999px;
}

.btn-sm.btn-outline-danger:hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
  color: var(--color-danger-hover);
}

/* Confirmed style-audit standards (2026-08-31) */
.btn.btn-add-std {
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 999px;
  min-height: 0;
  box-shadow: none;
}

.btn.btn-add-std:hover,
.btn.btn-add-std:focus {
  box-shadow: none;
  transform: none;
}

.wf-hub-header-actions .btn.btn-add-std,
.wf-hub-header-actions .btn-sm.btn-outline {
  padding: 6px 14px;
  font-size: 0.82rem;
}

#segments-run-btn {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
}

#segments-run-btn [data-i18n="segments.run_now"] {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#segments-run-btn [data-i18n="segments.run_now"]::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
  flex-shrink: 0;
}

.wf-hub-header-actions .btn-sm.btn-outline {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn.btn-save-std {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  min-height: 30px;
  box-shadow: none;
}

.btn.btn-save-std:hover,
.btn.btn-save-std:focus {
  box-shadow: none;
  transform: none;
}

.btn.btn-save-std--block {
  width: 100%;
}

.btn.btn-refund-std {
  color: #ef4444 !important;
  border: 1px solid #ef4444;
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: none;
}

.btn.btn-refund-std:hover,
.btn.btn-refund-std:focus {
  background: #fef2f2;
  color: #dc2626 !important;
  border-color: #dc2626;
  transform: none;
  box-shadow: none;
}

.app-flash-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  animation: appFlashToastIn 0.3s ease;
  max-width: min(420px, calc(100vw - 32px));
}

@keyframes appFlashToastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-flash-toast--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.app-flash-toast--error,
.app-flash-toast--danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.app-flash-toast--warn,
.app-flash-toast--warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.app-flash-toast--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

[dir="rtl"] .app-flash-toast {
  right: auto;
  left: 24px;
}

/* Shareable Link Banner Component */
.share-link-card {
  margin-bottom: 28px;
  background: linear-gradient(135deg, rgba(29, 92, 99, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid rgba(29, 92, 99, 0.18);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.share-link-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.share-link-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.share-link-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft, #ede9fe);
  color: var(--color-primary, #7c3aed);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.share-url-container {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 4px 6px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  box-sizing: border-box;
}

.share-url-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .share-url-container {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 10px;
  }
  .share-url-actions {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  .share-url-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.82rem;
    padding: 8px 10px;
  }
}

.share-url-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--color-ink);
  padding: 6px 10px;
  width: 100%;
  flex: 1;
  min-width: 160px;
}

.share-url-input:focus {
  outline: none;
}

/* Base and Variant Button Styles with High Contrast Hover States */
.btn-cta,
.btn-create,
.sched-btn-primary,
.cal-btn-new {
  background: var(--color-cta) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: var(--text-btn-weight);
  font-size: var(--text-btn-size);
  padding: var(--btn-pad-cta-y) var(--btn-pad-cta-x);
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px var(--color-cta-shadow);
  white-space: nowrap;
  min-height: var(--btn-height);
}

.btn-cta:hover,
.btn-cta:focus,
.btn-create:hover,
.btn-create:focus,
.sched-btn-primary:hover,
.sched-btn-primary:focus,
.cal-btn-new:hover,
.cal-btn-new:focus {
  background: var(--color-cta-hover) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--color-cta-shadow);
  filter: none;
}

.btn-create {
  /* Deprecated alias — use .btn-cta for page-level CTAs */
  background: var(--color-cta) !important;
  font-weight: var(--text-btn-weight);
  box-shadow: 0 2px 8px var(--color-cta-shadow);
}

.btn-outline-neutral {
  background-color: var(--color-paper-light);
  border: 1px solid var(--color-line);
  color: var(--color-slate) !important;
  box-shadow: none;
}

.btn-outline-neutral:hover,
.btn-outline-neutral:focus {
  background-color: var(--color-paper);
  border-color: #cbd5e1;
  color: var(--color-ink) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ds-btn-toolbar,
.sched-toolbar-btn,
.cal-toolbar-btn {
  padding: 7px 12px !important;
  font-size: var(--text-toolbar-size) !important;
  border-radius: var(--radius-control) !important;
  min-height: var(--control-height-toolbar);
}

.btn-primary {
  background-color: var(--org-primary, #7c3aed);
  color: #ffffff !important;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--color-primary-hover, #6d28d9);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

.btn-success {
  background-color: var(--color-success, #16a34a);
  color: #ffffff !important;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.btn-success:hover,
.btn-success:focus {
  background-color: #15803d;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.btn-secondary,
.btn-outline {
  background-color: #ffffff;
  border: 1px solid #c4b5fd;
  color: #7c3aed !important;
  box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-outline:hover,
.btn-outline:focus {
  background-color: #faf5ff;
  border-color: #a78bfa;
  color: #6d28d9 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
}

.btn-danger {
  background-color: var(--color-danger, #dc2626);
  color: #ffffff !important;
  border: 1px solid transparent;
}

.btn-danger:hover, .btn-danger:focus {
  background-color: #b91c1c;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: var(--text-label-size);
  font-weight: var(--text-label-weight);
  color: var(--color-ink);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  border: 1px solid var(--color-line);
  background: var(--color-paper-light);
  color: var(--color-ink);
  font-family: inherit;
  font-size: var(--text-body-size);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

/* Badges & Status */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pending { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(194, 125, 26, 0.2); }
.badge-confirmed { background: var(--color-confirmed-bg); color: var(--color-confirmed); border: 1px solid rgba(22, 163, 74, 0.2); }
.badge-require_action { background: #ffedd5; color: #9a3412; border: 1px solid rgba(234, 88, 12, 0.25); }
.badge-completed { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(45, 138, 78, 0.2); }
.badge-no-show { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid rgba(197, 48, 48, 0.2); }
.badge-cancelled { background: var(--color-line-soft); color: var(--color-ink-soft); border: 1px solid var(--color-line); }

/* Schedule Grid Motif */
.schedule-grid-bg {
  background-image: linear-gradient(var(--color-line-soft) 1px, transparent 1px),
                    linear-gradient(90deg, var(--color-line-soft) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Stats Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-ink);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

[dir="rtl"] .table {
  text-align: right;
}

.table th {
  padding: 12px 16px;
  background: var(--color-paper);
  color: var(--color-ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-line);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-line);
  font-size: 0.95rem;
}

.table tbody tr:hover {
  background-color: rgba(29, 92, 99, 0.02);
}

/* ==========================================================================
   Unified right-side drawer system (tokens in tokens.css)
   ========================================================================== */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: var(--drawer-overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1400;
  isolation: isolate;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--drawer-overlay-transition);
  display: none;
  visibility: hidden;
}

.drawer-overlay.open {
  display: block;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.drawer-overlay:not(.open) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  z-index: -1 !important;
}

.drawer-overlay:not(.open) .drawer {
  pointer-events: none;
  visibility: hidden;
}

.drawer,
.drawer.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: var(--drawer-width);
  max-width: min(var(--drawer-width), 100vw);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  background: #ffffff;
  box-shadow: var(--drawer-shadow);
  border-left: 1px solid #e2e8f0;
  border-radius: var(--drawer-radius);
  z-index: 1;
  transform: translateX(100%);
  transition: var(--drawer-transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

[dir="rtl"] .drawer,
[dir="rtl"] .drawer.drawer-panel {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid #e2e8f0;
  transform: translateX(-100%);
}

.drawer-overlay.open .drawer {
  transform: translateX(0);
}

.drawer-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--drawer-header-h);
  padding: 0 var(--drawer-body-pad);
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.drawer-header h3,
.drawer-header .drawer-title {
  margin: 0;
  font-size: var(--drawer-title-size);
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: var(--drawer-control-radius);
  background: #ffffff;
  color: #475569;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.drawer-close:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--drawer-body-pad);
}

.drawer-body.drawer-body-flush {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.drawer-form-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.drawer-form-shell > .drawer-body {
  flex: 1 1 auto;
}

.drawer-footer {
  flex-shrink: 0;
  padding: var(--drawer-footer-pad);
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
}

.drawer-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-footer-actions.drawer-footer-row {
  flex-direction: row;
  align-items: stretch;
}

.drawer-footer-actions.drawer-footer-row .btn {
  flex: 1 1 0;
  min-width: 0;
}

.drawer-body .form-group {
  margin-bottom: var(--drawer-field-gap);
}

.drawer-body .form-group:last-child {
  margin-bottom: 0;
}

.drawer-body .form-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--drawer-label-size);
  font-weight: 600;
  color: #334155;
}

.drawer-body .form-control,
.drawer-body select.form-control,
.drawer-body textarea.form-control {
  width: 100%;
  min-height: var(--drawer-input-h);
  padding: 8px 12px;
  font-size: var(--drawer-input-size);
  border: 1px solid #e2e8f0;
  border-radius: var(--drawer-control-radius);
  background: #ffffff;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.drawer-body textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

.drawer-body .form-control:focus,
.drawer-body select.form-control:focus,
.drawer-body textarea.form-control:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.drawer-body .drawer-caption,
.drawer-body .form-hint {
  margin: 4px 0 0;
  font-size: var(--drawer-caption-size);
  color: #64748b;
  line-height: 1.4;
}

.drawer-footer .btn,
.drawer-body .drawer-footer .btn {
  min-height: var(--drawer-btn-h);
  padding: 10px 16px;
  font-size: var(--drawer-input-size);
  font-weight: 600;
  border-radius: 999px;
}

.drawer-footer .btn-primary,
.drawer-footer .btn.btn-primary {
  width: 100%;
  background: var(--org-primary, #7c3aed);
  border-color: transparent;
  color: #ffffff;
}

.drawer-footer .btn-primary:hover,
.drawer-footer .btn.btn-primary:hover {
  background: var(--color-primary-hover, #6d28d9);
  border-color: transparent;
  color: #ffffff;
}

.drawer-footer .btn-outline,
.drawer-footer .btn.btn-outline {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #334155;
}

.drawer-footer .btn-outline:hover,
.drawer-footer .btn.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.drawer-footer .btn.btn-sm {
  min-height: 30px;
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 999px;
}

.drawer-footer .btn.btn-outline.btn-sm {
  background: #ffffff;
  border-color: #c4b5fd;
  color: #7c3aed;
}

.drawer-footer .btn.btn-outline.btn-sm:hover {
  background: #faf5ff;
  border-color: #a78bfa;
}

.btn.btn-outline-warn {
  color: #d97706 !important;
  border-color: #fde68a;
  background: #ffffff;
  box-shadow: none;
}

.btn.btn-outline-warn:hover,
.btn.btn-outline-warn:focus {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309 !important;
  transform: none;
  box-shadow: none;
}

.btn.btn-outline-danger,
.btn.btn-outline.btn-outline-danger {
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.35);
  background: #ffffff;
  box-shadow: none;
}

.btn.btn-outline-danger:hover,
.btn.btn-outline-danger:focus,
.btn.btn-outline.btn-outline-danger:hover,
.btn.btn-outline.btn-outline-danger:focus {
  background: var(--color-danger-bg, #fef2f2);
  border-color: var(--color-danger, #dc2626);
  color: var(--color-danger-hover, #b91c1c) !important;
  transform: none;
  box-shadow: none;
}

.detail-status-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.detail-status-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
}

.detail-status-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.drawer-footer .detail-status-buttons .btn,
.detail-status-buttons .btn {
  flex: 1 1 calc(33.33% - 8px);
  min-width: 96px;
  min-height: 36px;
  width: auto;
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: 8px;
}

.drawer-footer .detail-status-buttons .btn-primary,
.detail-status-buttons .btn-primary {
  width: auto;
  background: var(--org-primary, #7c3aed);
  border-color: transparent;
  color: #ffffff;
  box-shadow: none;
}

.drawer-footer .detail-status-buttons .btn-primary:hover,
.drawer-footer .detail-status-buttons .btn-primary:focus,
.detail-status-buttons .btn-primary:hover,
.detail-status-buttons .btn-primary:focus {
  background: var(--color-primary-hover, #6d28d9);
  border-color: transparent;
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.drawer-footer .detail-status-buttons .btn.btn-outline-warn {
  color: #d97706 !important;
  border-color: #fde68a;
}

.drawer-footer .detail-status-buttons .btn.btn-outline-warn:hover,
.drawer-footer .detail-status-buttons .btn.btn-outline-warn:focus {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309 !important;
  transform: none;
  box-shadow: none;
}

.drawer-footer .detail-status-buttons .btn.btn-outline-danger {
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.35);
}

.drawer-footer .detail-status-buttons .btn.btn-outline-danger:hover,
.drawer-footer .detail-status-buttons .btn.btn-outline-danger:focus {
  background: #fef2f2;
  border-color: #dc2626;
  color: #b91c1c !important;
  transform: none;
  box-shadow: none;
}

.drawer-footer .btn.btn-primary.btn-save-std {
  width: 100%;
  min-height: 30px;
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
  background: var(--org-primary, #7c3aed);
  border-color: transparent;
  color: #ffffff;
  box-shadow: none;
}

.drawer-footer-actions.drawer-footer-row .btn.btn-primary.btn-save-std {
  width: auto;
  flex: 1 1 0;
}

.drawer-footer .btn.btn-primary.btn-save-std:hover {
  background: var(--color-primary-hover, #6d28d9);
  border-color: transparent;
  color: #ffffff;
}

.drawer-footer .btn.btn-refund-std {
  width: auto;
  flex: 1 1 0;
  min-height: 0;
  padding: 9px 18px;
  font-size: 0.88rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #ef4444;
  color: #ef4444 !important;
}

/* Invoice create drawer — line items must not shrink inside flex drawer shell */
.invoice-create-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.invoice-line-items-panel {
  flex-shrink: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md, 12px);
  background: #ffffff;
}

.invoice-line-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--color-bg, #f8fafc);
  border-bottom: 1px solid var(--color-line);
}

.invoice-line-items-title {
  font-weight: 700;
  font-size: 0.88rem;
}

.invoice-line-items-add {
  font-size: 0.76rem;
  padding: 3px 8px;
  flex-shrink: 0;
}

.invoice-line-items-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(42vh, 340px);
}

.invoice-line-items-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.invoice-line-items-table thead tr {
  background: var(--color-bg, #f8fafc);
  border-bottom: 1px solid var(--color-line);
  color: var(--color-ink-soft);
  font-size: 0.78rem;
}

.invoice-line-items-table th,
.invoice-line-items-table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.invoice-line-items-table th:last-child,
.invoice-line-items-table td:last-child {
  width: 44px;
  text-align: center;
}

.invoice-line-items-table th:nth-child(2),
.invoice-line-items-table td:nth-child(2) {
  width: 88px;
}

.invoice-line-items-table th:nth-child(3),
.invoice-line-items-table td:nth-child(3) {
  width: 112px;
}

.invoice-line-items-table th:nth-child(4),
.invoice-line-items-table td:nth-child(4) {
  width: 104px;
  text-align: right;
}

.invoice-line-items-table .line-item-row .form-control-sm {
  width: 100%;
  min-width: 0;
}

.invoice-line-items-table .line-item-row .li-total {
  font-weight: 600;
  font-family: var(--font-mono);
}

.invoice-line-items-table .line-item-remove {
  padding: 2px 6px;
  color: #ef4444;
  border-color: #fca5a5;
}

.invoice-totals-panel {
  flex-shrink: 0;
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.invoice-totals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.invoice-totals-label {
  font-size: 0.78rem;
}

.invoice-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--color-ink-soft);
  padding-top: 6px;
  border-top: 1px dashed var(--color-line);
}

.invoice-totals-row--total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-ink);
  border-top: none;
  padding-top: 0;
}

.invoice-totals-value {
  font-family: var(--font-mono);
  font-weight: 600;
}

.invoice-totals-value--total {
  color: var(--org-primary);
}

html.drawer-scroll-lock,
body.drawer-scroll-lock {
  overflow: hidden !important;
}

body.drawer-scroll-lock {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

/* Centered modal variant (leave warning — not a right drawer) */
.drawer-overlay.drawer-overlay--centered.open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.drawer-overlay.drawer-overlay--centered .drawer {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  max-width: 520px;
  height: auto;
  max-height: min(88vh, 680px);
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  transform: none !important;
  box-shadow: var(--shadow-xl);
}

.app-confirm-overlay .app-confirm-modal {
  width: 100%;
  max-width: 440px;
  background: var(--murphy-card-bg, #ffffff);
  border: 1px solid var(--murphy-card-border, var(--color-line));
  border-radius: var(--radius-container, 16px);
  box-shadow: var(--shadow-xl);
  padding: var(--space-5, 20px);
  display: flex;
  flex-direction: column;
  gap: var(--space-5, 20px);
}

.app-confirm-overlay.open {
  z-index: 1500;
}

.app-confirm-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4, 14px);
}

.app-confirm-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-control, 10px);
  background: var(--murphy-accent-muted, rgba(136, 109, 177, 0.12));
  font-size: 1.15rem;
}

.app-confirm-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-ink, #0f172a);
  line-height: 1.3;
}

.app-confirm-message {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-ink-soft, #475569);
  line-height: 1.5;
  white-space: pre-wrap;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3, 10px);
  flex-wrap: wrap;
}

[dir="rtl"] .app-confirm-actions {
  justify-content: flex-start;
}

.app-confirm-actions .btn {
  min-width: 96px;
  border-radius: 999px;
  min-height: 36px;
  padding: 8px 16px;
  font-size: 0.88rem;
}

.drawer-body .drawer-body-stack {
  display: flex;
  flex-direction: column;
  gap: var(--drawer-field-gap);
}

#notif-items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.drawer-body-flush .drawer-body-stack,
.drawer-body-flush > #notif-items {
  padding: 0 var(--drawer-body-pad) var(--drawer-body-pad);
}

/* Real-time Floating Notification Toast */
.notif-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 32px);
}

[dir="rtl"] .notif-toast-container {
  right: auto;
  left: 24px;
}

.notif-toast {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-left: 4px solid var(--org-primary, #7c3aed);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 14px 38px rgba(124, 58, 237, 0.16), 0 4px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[dir="rtl"] .notif-toast {
  border-left: 1px solid rgba(124, 58, 237, 0.25);
  border-right: 4px solid var(--org-primary, #7c3aed);
}

.notif-toast:hover {
  transform: translateY(-2px) scale(1);
  box-shadow: 0 18px 44px rgba(124, 58, 237, 0.24);
}

.notif-toast.hide {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
}

.notif-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3);
}

.notif-toast-body {
  flex: 1;
  min-width: 0;
}

.notif-toast-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.notif-toast-msg {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.35;
}

.notif-toast-time {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Bell ring animation */
@keyframes bellRing {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(14deg); }
  40%, 80% { transform: rotate(-14deg); }
}

.bell-ringing svg {
  animation: bellRing 0.8s ease-in-out;
  color: var(--org-primary, #7c3aed);
}

[dir="rtl"] {
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
  text-align: right;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
  font-family: 'Cairo', system-ui, sans-serif;
  letter-spacing: normal;
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

[dir="rtl"] .nav-links a {
  text-align: right;
}

[dir="rtl"] .form-input, [dir="rtl"] .form-select, [dir="rtl"] textarea {
  text-align: right;
}

[dir="rtl"] .table th, [dir="rtl"] .table td {
  text-align: right;
}


/* Topbar Header & System Status */
.topbar-greeting-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.topbar-greeting {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtext {
  font-size: 0.84rem;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-subtext strong {
  color: #7c3aed;
  font-weight: 700;
}

.topbar-org-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow: hidden;
}

.topbar-org-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
}

.topbar-org-logo-sm {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  vertical-align: middle;
  margin-inline-end: 6px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.topbar-org-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.topbar-org-name {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modern Logo Upload Component */
.logo-upload-container {
  display: flex;
  align-items: stretch;
  gap: 20px;
  flex-wrap: wrap;
}

.logo-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo-preview-card {
  width: 108px;
  height: 108px;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: 6px;
  box-sizing: border-box;
}

.logo-preview-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

.logo-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo-dropzone-box {
  flex: 1;
  min-width: 0;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 22px 20px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.logo-dropzone-box:hover,
.logo-dropzone-box.dragover {
  border-color: var(--org-primary, #3b82f6);
  background: #eff6ff;
  transform: translateY(-1px);
}

.dropzone-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--org-primary, #3b82f6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #166534;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* AI Agent Live Banner */
.ai-agent-banner {
  background: linear-gradient(135deg, #1b1238 0%, #2a1158 50%, #1e1346 100%);
  border-radius: 22px;
  padding: 22px 28px;
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(42, 17, 88, 0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .ai-agent-banner {
    padding: 16px 14px;
    gap: 16px;
    border-radius: 16px;
  }
}

.ai-agent-banner::before {
  content: "";
  position: absolute;
  top: -50px;
  right: 10%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.ai-banner-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
}

.ai-banner-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
  flex-shrink: 0;
}

.ai-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #e9d5ff;
}

/* Sound Wave Animation */
.sound-wave {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.sound-wave span {
  display: block;
  width: 2.5px;
  height: 100%;
  background: #c084fc;
  border-radius: 2px;
  animation: soundWave 1.2s ease-in-out infinite alternate;
}

.sound-wave span:nth-child(2) { animation-delay: 0.2s; height: 60%; }
.sound-wave span:nth-child(3) { animation-delay: 0.4s; height: 100%; }
.sound-wave span:nth-child(4) { animation-delay: 0.1s; height: 40%; }
.sound-wave span:nth-child(5) { animation-delay: 0.3s; height: 80%; }

@keyframes soundWave {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

.ai-banner-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin: 6px 0 8px;
}

.ai-banner-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #f3e8ff;
}

.ai-banner-kpis {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-kpi-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-kpi-chip-title {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-kpi-chip-val-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-kpi-chip-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.ai-mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.ai-mini-chart span {
  width: 2.5px;
  background: #a855f7;
  border-radius: 1px;
}

.ai-kpi-chip-sub {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* Modern KPI Stat Cards */
.molar-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .molar-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ai-agent-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .molar-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.molar-kpi-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.molar-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.molar-kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.molar-kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  margin: 8px 0 2px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.molar-kpi-subtext {
  font-size: 0.76rem;
  color: #64748b;
}

.molar-kpi-progress-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
}

.molar-progress-track {
  height: 5px;
  border-radius: 999px;
  background: #f1f5f9;
  overflow: hidden;
  margin-top: 6px;
  width: 100%;
}

.molar-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #818cf8, #a855f7);
}

.molar-progress-fill.amber {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.molar-progress-fill.coral {
  background: linear-gradient(90deg, #f87171, #fb7185);
}

.molar-progress-fill.emerald {
  background: linear-gradient(90deg, #34d399, #10b981);
}

/* Dual Stream Section (2 columns) */
.stream-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 992px) {
  .stream-grid {
    grid-template-columns: 1fr;
  }
}

.stream-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.stream-title-group h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.stream-title-group span {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.stream-title-group span strong {
  color: #16a34a;
}

/* Day Filter Pills */
.molar-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 16px;
}

.filter-pill-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-pill-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.filter-pill-count {
  font-size: 0.7rem;
  opacity: 0.75;
}

/* Live Activity Feed Stream */
.activity-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  transition: background 0.15s ease;
}

.activity-item:hover {
  background: #f1f5f9;
}

.activity-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #ede9fe;
  color: #7c3aed;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 0.84rem;
  color: #1e293b;
  line-height: 1.4;
}

.activity-text strong {
  font-weight: 700;
}

.activity-meta {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.activity-meta-ai {
  color: #7c3aed;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Today's Schedule Stream Items */
.schedule-stream {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-stream-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.schedule-stream-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.schedule-accent-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #7c3aed;
}

[dir="rtl"] .schedule-accent-bar {
  left: auto;
  right: 0;
}

.schedule-time-box {
  min-width: 56px;
  display: flex;
  flex-direction: column;
}

.schedule-time {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
}

.schedule-dur {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
}

.schedule-details {
  flex: 1;
}

.schedule-patient {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.schedule-service {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 1px;
}

.schedule-status-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-pill-confirmed {
  background: #dcfce7;
  color: #15803d;
}

.status-pill-reminder {
  background: #ede9fe;
  color: #6d28d9;
}

.status-pill-pending {
  background: #fef3c7;
  color: #b45309;
}

/* Collapsed Desktop State */
html.sidebar-is-collapsed .sidebar,
.app-shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

html.sidebar-is-collapsed .main-content,
.app-shell.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

[dir="rtl"] html.sidebar-is-collapsed .main-content,
[dir="rtl"] .app-shell.sidebar-collapsed .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-collapsed-width);
}

/* In Collapsed State: hide textual labels smoothly.
   Target the label/badge/chevron explicitly — a blanket `a span` selector also matches
   .nav-icon-wrap and out-specifies the rule that keeps the icon rail visible. */
html.sidebar-is-collapsed .brand-title,
.app-shell.sidebar-collapsed .brand-title,
html.sidebar-is-collapsed .nav-item a .nav-label-text,
.app-shell.sidebar-collapsed .nav-item a .nav-label-text,
html.sidebar-is-collapsed .nav-item a .nav-count-badge,
.app-shell.sidebar-collapsed .nav-item a .nav-count-badge,
html.sidebar-is-collapsed .nav-group-parent .nav-label-text,
.app-shell.sidebar-collapsed .nav-group-parent .nav-label-text,
html.sidebar-is-collapsed .nav-group-parent .nav-chevron,
.app-shell.sidebar-collapsed .nav-group-parent .nav-chevron,
html.sidebar-is-collapsed .nav-submenu,
.app-shell.sidebar-collapsed .nav-submenu,
html.sidebar-is-collapsed .user-badge div:nth-child(2),
.app-shell.sidebar-collapsed .user-badge div:nth-child(2),
html.sidebar-is-collapsed .sidebar-footer a,
.app-shell.sidebar-collapsed .sidebar-footer a,
html.sidebar-is-collapsed .sidebar-collapse-btn,
.app-shell.sidebar-collapsed .sidebar-collapse-btn {
  display: none !important;
}

html.sidebar-is-collapsed .sidebar-header,
.app-shell.sidebar-collapsed .sidebar-header {
  padding: 0;
  justify-content: center;
}

html.sidebar-is-collapsed .brand-logo-icon,
.app-shell.sidebar-collapsed .brand-logo-icon {
  margin: 0 auto;
}

html.sidebar-is-collapsed .nav-links,
.app-shell.sidebar-collapsed .nav-links {
  padding: 16px 6px;
}

html.sidebar-is-collapsed .nav-item a,
.app-shell.sidebar-collapsed .nav-item a,
html.sidebar-is-collapsed .nav-group-parent,
.app-shell.sidebar-collapsed .nav-group-parent {
  padding: 12px 0;
  justify-content: center;
  gap: 0;
}

html.sidebar-is-collapsed .nav-icon,
.app-shell.sidebar-collapsed .nav-icon {
  width: 22px;
  height: 22px;
  margin: 0 auto;
  opacity: 0.95;
}

html.sidebar-is-collapsed .nav-group-toggle .nav-icon-wrap,
.app-shell.sidebar-collapsed .nav-group-toggle .nav-icon-wrap,
html.sidebar-is-collapsed .nav-item a .nav-icon-wrap,
.app-shell.sidebar-collapsed .nav-item a .nav-icon-wrap {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  visibility: visible !important;
  opacity: 1 !important;
}

html.sidebar-is-collapsed .sidebar-footer,
.app-shell.sidebar-collapsed .sidebar-footer {
  padding: 12px 0;
  justify-content: center;
}

html.sidebar-is-collapsed .user-badge,
.app-shell.sidebar-collapsed .user-badge {
  justify-content: center;
}

/* Mobile Off-canvas Drawer & Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  transition: opacity var(--transition-sidebar);
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

@media (min-width: 993px) {
  .sidebar-backdrop {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}

/* Responsive Breakpoints & Mobile Overhaul */
@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-width) !important;
    transform: translateX(-100%);
  }
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }
  .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  html.sidebar-is-collapsed .brand-title,
  .app-shell.sidebar-collapsed .brand-title,
  html.sidebar-is-collapsed .nav-item a .nav-label-text,
  .app-shell.sidebar-collapsed .nav-item a .nav-label-text,
  html.sidebar-is-collapsed .user-badge div:nth-child(2),
  .app-shell.sidebar-collapsed .user-badge div:nth-child(2),
  html.sidebar-is-collapsed .sidebar-footer a,
  .app-shell.sidebar-collapsed .sidebar-footer a,
  html.sidebar-is-collapsed .sidebar-collapse-btn,
  .app-shell.sidebar-collapsed .sidebar-collapse-btn {
    display: block !important;
  }
  html.sidebar-is-collapsed .nav-item a,
  .app-shell.sidebar-collapsed .nav-item a {
    padding: 10px 14px;
    justify-content: flex-start;
    gap: 12px;
  }
  html.sidebar-is-collapsed .sidebar-header,
  .app-shell.sidebar-collapsed .sidebar-header {
    padding: 0 16px 0 20px;
    justify-content: flex-start;
  }
}

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  :root {
    --topbar-height: 60px;
  }

  body {
    -webkit-text-size-adjust: 100%;
  }

  /* Compact Topbar */
  .topbar {
    padding: 0 10px;
    height: 58px;
  }

  .topbar-left-section {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .topbar-right-section {
    gap: 6px;
    flex-shrink: 0;
  }

  .sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar-greeting-box {
    min-width: 0;
  }

  .topbar-org-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .topbar-org-logo {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .topbar-org-name {
    font-size: 0.88rem;
    font-weight: 700;
    max-width: 105px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-greeting {
    font-size: 0.90rem;
    white-space: nowrap;
  }

  /* On mobile, hide the user name from the greeting — the avatar handles it */
  .greeting-name {
    display: none;
  }

  .topbar-subtext {
    display: none;
  }

  /* Completely hide the live green dot pill on mobile to make room */
  .system-status-pill {
    display: none !important;
  }

  /* Language toggle button - clean, compact, fully visible with text */
  .topbar-lang-btn {
    padding: 6px 9px !important;
    font-size: 0.78rem !important;
    gap: 4px !important;
    min-height: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .lang-globe-icon {
    font-size: 0.85rem;
    line-height: 1;
  }

  .lang-text-label {
    display: inline-block !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    line-height: 1;
  }

  .topbar-notif-btn {
    width: 34px !important;
    height: 34px !important;
    flex: 0 0 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }

  .notif-bell-icon {
    font-size: 1.05rem !important;
    line-height: 1 !important;
  }

  /* Responsive Page Layout */
  .page-container {
    padding: 16px 12px 32px;
  }

  .card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  /* Form Elements - Prevent iOS Safari Auto-Zoom */
  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="date"],
  input[type="time"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* Mobile Floating Toast Notifications (Full Width, Safe Distance from Bottom) */
  .notif-toast-container {
    bottom: 12px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  [dir="rtl"] .notif-toast-container {
    left: 12px !important;
    right: 12px !important;
  }

  .notif-toast {
    padding: 12px 14px;
    border-radius: 12px;
  }

  /* Drawers — full width on mobile, same slide transition */
  .drawer,
  .drawer.drawer-panel {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Data Tables Responsive Touch Scrolling */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  .table td, .table th {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
  /* Public Customer Booking Card */
  .public-container {
    padding: 12px 8px;
    min-height: 100vh;
    justify-content: flex-start;
  }

  .public-card {
    padding: 18px 14px !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  }

  .public-brand-badge {
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 14px;
  }

  /* Multi-column Forms Collapse to Single Column */
  .form-grid-2,
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr;"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Touch Buttons */
  .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Turbo Drive — in-app navigation (sidebar stays mounted) */
#main-content-area.turbo-loading #page-content {
  pointer-events: none;
}

.turbo-progress-bar {
  background: linear-gradient(90deg, #7c3aed 0%, #a855f7 100%) !important;
  height: 2px !important;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  #main-content-area.turbo-loading #page-content {
    pointer-events: none;
  }
}

/* Shared filter bar (Clients, Services, Resources) — uses design tokens */
.filter-bar,
.ds-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  background: var(--sched-toolbar-bg);
  padding: var(--pad-toolbar);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-container);
  box-shadow: none;
}

.filter-search-box,
.ds-search-wrap,
.ds-select-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.filter-search-icon,
.ds-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-ink-muted);
  font-size: 0.8rem;
  pointer-events: none;
  line-height: 1;
}

[dir="rtl"] .filter-search-icon,
[dir="rtl"] .ds-search-icon {
  left: auto;
  right: 10px;
}

.ds-select-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--color-ink-muted);
  pointer-events: none;
  z-index: 1;
}

[dir="rtl"] .ds-select-icon {
  left: auto;
  right: 12px;
}

.ds-select-wrap .ds-select {
  width: 100%;
  padding-left: 34px;
  appearance: auto;
}

[dir="rtl"] .ds-select-wrap .ds-select {
  padding-left: 12px;
  padding-right: 34px;
}

.filter-search-input,
.ds-search,
.sched-toolbar-search {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-paper-light);
  font-size: var(--text-toolbar-size);
  color: var(--color-ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: var(--control-height-toolbar);
}

[dir="rtl"] .filter-search-input,
[dir="rtl"] .ds-search {
  padding: 7px 32px 7px 12px;
}

.filter-search-input:focus,
.ds-search:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.filter-bar .form-control {
  border-radius: 9999px;
  background: #f8fafc;
  font-size: 0.84rem;
  padding: 8px 14px;
}

.filter-bar .form-control:focus {
  background: #ffffff;
}

/* Catalog filter pills (Services, Resources) — scoped to avoid Action Center day pills */
.filter-bar .filter-pill-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.filter-bar .filter-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-line-hairline);
  border: 1px solid transparent;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-slate);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-bar .filter-pill-btn:hover {
  background: var(--color-line);
  color: var(--color-ink);
}

.filter-bar .filter-pill-btn.active {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--color-accent-glow);
}

@media (max-width: 600px) {
  .filter-bar .filter-search-box,
  .filter-bar .ds-search-wrap {
    min-width: 100%;
    max-width: none;
  }

  .filter-bar .filter-pill-group {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .filter-bar .filter-pill-btn {
    flex-shrink: 0;
  }
}

/* CRM Phase 2 */
.crm-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.crm-tag-inline-input {
  border-radius: 9999px !important;
}

.crm-tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #6366f1;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

.crm-segment-pill {
  display: inline-block;
  padding: 3px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.crm-tags-wrap, .crm-segments-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.crm-comms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-comm-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-line);
}

.crm-comm-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--color-ink-soft);
}

.crm-comm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.crm-comm-direction, .crm-comm-channel {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-ink-soft);
}

.client-tags-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}

/* ── Design system utilities ── */
.ds-layout,
.sched-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  background: var(--sched-bg);
  padding: 4px 0 var(--space-5);
}

.ds-header-row,
.sched-header-row-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.ds-actions-toolbar,
.sched-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ds-toast {
  padding: 12px 20px;
  border-radius: 10px;
  margin-bottom: var(--space-4);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
}

.ds-toast-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.ds-toast-error {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-secondary {
  background: var(--color-line-hairline);
  color: var(--color-ink-soft);
  border: 1px solid var(--color-line);
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.badge-outline {
  background: #fff;
  color: var(--color-ink);
  border: 1px solid var(--color-line);
  text-transform: none;
  letter-spacing: 0;
}

/* ── Unified scheduling design system (Calendar + Shift Scheduler) ── */
/* Token values: tokens.css — class rules below */

.sched-layout,
.clinexa-layout,
.cal-page-header {
  --clinexa-card-radius: var(--sched-container-radius);
}

.sched-layout,
.clinexa-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  background: var(--sched-bg);
  padding: 4px 0 20px;
}

/* Page header */
.sched-page-header,
.cal-page-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sched-header-row-title,
.cal-header-row-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sched-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.sched-page-heading,
.cal-header-row-title .clinexa-page-heading,
.cal-header-row-title .sched-page-heading {
  margin: 0;
  font-size: var(--sched-heading-size);
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sched-page-subtitle,
.clinexa-page-subtitle {
  margin: 0;
  font-size: var(--sched-subtitle-size);
  color: #64748b;
  line-height: 1.35;
}

.sched-actions-toolbar,
.clinexa-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sched-btn-primary,
.cal-btn-new,
.btn-create.sched-btn-primary {
  background: var(--color-cta) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 20px;
  border-radius: 9999px;
  box-shadow: 0 2px 8px var(--color-cta-shadow);
  white-space: nowrap;
  min-height: var(--sched-btn-h);
}

.sched-btn-primary:hover,
.sched-btn-primary:focus,
.cal-btn-new:hover,
.cal-btn-new:focus {
  background: var(--color-cta-hover) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--color-cta-shadow);
}

.sched-toolbar-btn,
.cal-toolbar-btn {
  padding: 7px 12px !important;
  font-size: var(--sched-toolbar-label-size) !important;
  border-radius: var(--sched-control-radius) !important;
  white-space: nowrap;
  min-height: var(--sched-control-h);
}

/* Shaded toolbar strip */
.sched-toolbar-strip,
.cal-toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: var(--sched-toolbar-pad);
  background: var(--sched-toolbar-bg);
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-container-radius);
}

.sched-toolbar-left,
.sched-toolbar-right,
.cal-toolbar-left,
.cal-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sched-toolbar-right form,
.sched-toolbar-right {
  margin-left: auto;
}

.sched-period-nav,
.clinexa-nav-pill-group.sched-period-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sched-arrow-btn,
.clinexa-arrow-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: var(--sched-control-radius);
  background: #ffffff;
  border: 1px solid var(--sched-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sched-arrow-btn:hover,
.clinexa-arrow-btn:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: none;
  color: #0f172a;
}

.sched-date-pill,
.clinexa-date-pill,
.cal-toolbar-strip .clinexa-date-pill,
.sched-period-nav .sched-date-pill,
.sched-period-nav .clinexa-date-pill {
  background: #ffffff;
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-control-radius);
  padding: 6px 12px;
  font-size: var(--sched-toolbar-label-size);
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: none;
  white-space: nowrap;
  min-height: var(--sched-control-h);
  cursor: default;
  font-family: inherit;
  line-height: 1.2;
}

button.sched-date-pill,
button.clinexa-date-pill,
.wf-period-picker-btn {
  cursor: pointer;
}

.sched-today-btn,
.cal-today-btn {
  padding: 6px 12px;
  font-size: var(--sched-toolbar-label-size);
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-control-radius);
  text-decoration: none;
  line-height: 1.2;
  min-height: var(--sched-control-h);
  display: inline-flex;
  align-items: center;
}

.sched-today-btn:hover,
.cal-today-btn:hover {
  border-color: #cbd5e1;
  color: #0f172a;
}

.sched-view-switcher,
.cal-toolbar-strip .clinexa-view-switcher {
  display: flex;
  padding: 2px;
  border-radius: var(--sched-control-radius);
  background: #ffffff;
  border: 1px solid var(--sched-border);
  gap: 2px;
}

.sched-view-tab,
.clinexa-view-tab,
.sched-view-switcher .sched-view-tab {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: var(--sched-toolbar-label-size);
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

.sched-view-tab.active,
.sched-view-tab.is-active,
.clinexa-view-tab.active {
  background: #f1f5f9;
  color: #0f172a;
  box-shadow: none;
}

.sched-toolbar-branch,
.cal-toolbar-branch {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-control-radius);
  padding: 0 10px;
  min-height: var(--sched-control-h);
}

.sched-toolbar-branch select,
.cal-toolbar-branch select {
  border: none;
  background: transparent;
  font-size: var(--sched-toolbar-label-size);
  font-weight: 500;
  color: #334155;
  outline: none;
  cursor: pointer;
  padding: 6px 0;
  max-width: 160px;
}

.sched-toolbar-select,
.sched-toolbar-input {
  min-height: var(--sched-control-h);
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-control-radius);
  font-size: var(--sched-toolbar-label-size);
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
}

.sched-toolbar-select:focus,
.sched-toolbar-input:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.sched-toolbar-search-wrap,
.cal-toolbar-search-wrap {
  position: relative;
  min-width: 140px;
  max-width: 200px;
}

.sched-toolbar-search-wrap .sched-search-icon,
.sched-toolbar-search-wrap .clinexa-search-icon,
.cal-toolbar-search-wrap .clinexa-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: #94a3b8;
  pointer-events: none;
}

[dir="rtl"] .sched-toolbar-search-wrap .sched-search-icon,
[dir="rtl"] .sched-toolbar-search-wrap .clinexa-search-icon {
  left: auto;
  right: 10px;
}

.sched-toolbar-search,
.cal-toolbar-search {
  width: 100%;
  padding: 7px 12px 7px 32px;
  background: #ffffff;
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-control-radius);
  font-size: var(--sched-toolbar-label-size);
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
  min-height: var(--sched-control-h);
}

[dir="rtl"] .sched-toolbar-search {
  padding: 7px 32px 7px 12px;
}

.sched-toolbar-search:focus,
.cal-toolbar-search:focus {
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.sched-period-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-container-radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  min-width: 220px;
}

.sched-period-popover .sched-toolbar-input {
  width: 100%;
  min-height: var(--sched-control-h);
  padding: 6px 10px;
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-control-radius);
  background: #ffffff;
  font-size: var(--sched-toolbar-label-size);
  color: var(--color-ink);
  font-family: inherit;
}

.sched-period-popover[hidden] {
  display: none !important;
}

.sched-period-nav-wrap {
  position: relative;
}

.sched-toolbar-apply {
  min-height: var(--sched-control-h);
}

/* Entity row (sidebar + grid resource column) */
.sched-entity-row,
.clinexa-staff-item .sched-entity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sched-entity-avatar,
.clinexa-staff-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.88rem;
}

.sched-entity-meta,
.clinexa-staff-info {
  flex: 1;
  min-width: 0;
}

.sched-entity-name,
.clinexa-staff-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sched-entity-role,
.clinexa-staff-role {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

/* Grid panel */
.sched-grid-panel,
.cal-calendar-panel,
.clinexa-calendar-card {
  background: #ffffff;
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-container-radius);
  box-shadow: none;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sched-grid-scroll,
.cal-calendar-scroll {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1;
  min-width: 0;
  max-height: calc(100dvh - 280px);
  touch-action: pan-x pan-y;
}

turbo-frame.cal-calendar-scroll {
  display: block;
  width: 100%;
}

/* Shared day-column header (week grid + shift grid) */
.sched-col-header,
.clinexa-col-header,
.wf-shifts-day-col.sched-col-header {
  padding: 14px 10px;
  text-align: center;
  border-right: 1.5px solid var(--sched-border-hairline);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-sizing: border-box;
}

.sched-col-day,
.clinexa-col-header-day,
.wf-shifts-day-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sched-col-date,
.clinexa-col-header-date,
.wf-shifts-day-date {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
}

.sched-col-header.is-today,
.clinexa-col-header.is-today,
.wf-shifts-grid-header .wf-shifts-day-col.is-today {
  background: var(--sched-today-tint);
  box-shadow: inset 0 -2px 0 var(--sched-today-accent);
}

.wf-shifts-grid-row .wf-shifts-day-col.is-today {
  background: var(--sched-today-tint);
  box-shadow: none;
}

.sched-col-header.is-today .sched-col-date,
.clinexa-col-header.is-today .clinexa-col-header-date,
.wf-shifts-day-col.is-today .wf-shifts-day-date {
  color: var(--sched-today-accent);
}

.clinexa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.clinexa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.clinexa-title-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clinexa-page-heading {
  margin: 0;
  font-size: var(--sched-heading-size, 1.65rem);
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.clinexa-page-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-ink-soft, #64748b);
}

.clinexa-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.clinexa-nav-pill-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sched-period-popover .sched-toolbar-input:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.2);
}

.clinexa-filters-card {
  display: none;
}

.clinexa-calendar-card {
  background: #ffffff;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
  min-width: 0;
}

.clinexa-calendar-card .clinexa-calendar-nav {
  justify-content: center;
  padding: 16px;
  border-bottom: 1px solid var(--clinexa-border);
}

.clinexa-staff-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clinexa-staff-role {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.2;
}

.clinexa-booking-card {
  position: relative;
  border-radius: 8px;
  padding: 6px 8px 6px 12px;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  margin-bottom: 6px;
}

[dir="rtl"] .clinexa-booking-card {
  text-align: right;
  padding: 6px 12px 6px 8px;
}

.clinexa-booking-card::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

[dir="rtl"] .clinexa-booking-card::before {
  left: auto;
  right: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.clinexa-booking-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.clinexa-card-blue { background: #eff6ff; color: #1e40af; }
.clinexa-card-blue::before { background: #3b82f6; }

.clinexa-card-yellow { background: #fefce8; color: #854d0e; }
.clinexa-card-yellow::before { background: #eab308; }

.clinexa-card-coral { background: #fff1f2; color: #9f1239; }
.clinexa-card-coral::before { background: #f43f5e; }

.clinexa-card-mint { background: #f0fdf4; color: #166534; }
.clinexa-card-mint::before { background: #22c55e; }

.clinexa-card-purple { background: #faf5ff; color: #6b21a8; }
.clinexa-card-purple::before { background: #a855f7; }

.clinexa-card-teal { background: #ccfbf1; color: #0f766e; }
.clinexa-card-teal::before { background: #14b8a6; }

/* ── Shift schedule grid (uses shared sched tokens) ── */
.wf-shifts-grid-wrap,
.sched-shifts-grid-wrap {
  padding: 0;
  overflow-x: auto;
}

.wf-shifts-grid,
.sched-shifts-grid {
  display: grid;
  grid-template-columns: minmax(200px, 240px) repeat(var(--wf-day-count, var(--sched-day-count, 7)), minmax(90px, 1fr));
  gap: 0;
  min-width: min(100%, calc(240px + var(--wf-day-count, var(--sched-day-count, 7)) * 90px));
}

.wf-shifts-grid-header,
.wf-shifts-grid-row,
.sched-shifts-grid-header,
.sched-shifts-grid-row {
  display: contents;
}

.wf-shifts-cell,
.sched-shifts-cell {
  background: #ffffff;
  padding: var(--sched-cell-pad);
  min-height: 72px;
  font-size: var(--sched-body-size);
  border-bottom: 1px solid var(--sched-border-hairline);
  border-right: 1px solid var(--sched-border-hairline);
  box-sizing: border-box;
}

.wf-shifts-grid-header .wf-shifts-cell,
.sched-shifts-grid-header .sched-shifts-cell {
  background: #fafbfc;
  min-height: auto;
  padding: 14px 10px;
  font-weight: 700;
  font-size: var(--sched-table-header-size);
  color: #64748b;
  text-align: center;
  border-bottom: 1.5px solid var(--sched-border);
}

.wf-shifts-grid-header .wf-shifts-employee-col,
.sched-shifts-grid-header .sched-resource-col {
  text-align: left;
  color: #475569;
  font-size: var(--sched-table-header-size);
  font-weight: 700;
}

[dir="rtl"] .wf-shifts-grid-header .wf-shifts-employee-col,
[dir="rtl"] .sched-shifts-grid-header .sched-resource-col {
  text-align: right;
}

.wf-shifts-employee-col,
.sched-resource-col {
  background: #fafbfc;
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.03);
  border-right: 1.5px solid var(--sched-border-hairline);
}

[dir="rtl"] .wf-shifts-employee-col,
[dir="rtl"] .sched-resource-col {
  left: auto;
  right: 0;
  box-shadow: -2px 0 6px rgba(0, 0, 0, 0.03);
}

.wf-shifts-employee-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wf-shifts-employee-meta {
  min-width: 0;
  flex: 1;
}

.wf-shift-card {
  font-size: 0.76rem;
  line-height: 1.25;
}

.wf-shift-card:has(.wf-shift-remove-btn) {
  padding-inline-end: 22px;
}

.wf-shift-remove-btn {
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  z-index: 2;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.72);
  color: #94a3b8;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.wf-shift-card:hover .wf-shift-remove-btn,
.wf-shift-card:focus-within .wf-shift-remove-btn {
  opacity: 1;
}

.wf-shift-remove-btn:hover,
.wf-shift-remove-btn:focus-visible {
  color: #dc2626;
  background: #fef2f2;
}

.wf-shifts-mobile-list .wf-shift-remove-btn {
  opacity: 1;
}

@media (hover: none), (max-width: 720px) {
  .wf-shift-remove-btn {
    opacity: 1;
  }
}

.wf-shift-remove-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.wf-shift-remove-footer .btn {
  width: 100%;
}

.wf-shift-time {
  font-weight: 700;
  display: block;
}

.wf-shift-role {
  display: block;
  font-size: 0.72rem;
  opacity: 0.9;
}

.wf-shift-type-pill {
  display: block;
  font-size: 0.68rem;
  opacity: 0.85;
  margin-top: 2px;
}

.wf-overtime-row .wf-shifts-employee-col {
  background: #fffbeb;
}

.wf-overtime-badge {
  display: inline-flex;
  margin-top: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}

.sched-resource-col .wf-overtime-badge {
  margin-left: 52px;
}

.wf-shifts-no-employees {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-ink-soft);
}

.wf-shift-slot--interactive {
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
}

.wf-shift-slot--interactive:hover {
  background: rgba(59, 130, 246, 0.06);
}

.wf-shift-slot--interactive:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}

.wf-shift-slot--interactive::after {
  content: "+";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.wf-shift-slot--interactive:hover::after {
  opacity: 1;
}

[dir="rtl"] .wf-shift-slot--interactive::after {
  right: auto;
  left: 8px;
}

/* Shared Clinexa form helpers (Shifts + Calendar) */
.clinexa-filters-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.clinexa-form-group-compact {
  margin: 0;
  min-width: 160px;
}

.clinexa-form-group-compact.wide {
  min-width: 180px;
}

.clinexa-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.clinexa-btn-pill {
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.88rem;
}

.clinexa-recurrence-panel {
  background: var(--color-paper, #fafafa);
  border: 1px solid var(--color-line, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 14px;
}

.clinexa-recurrence-panel .form-group:last-child {
  margin-bottom: 0;
}

.wf-shift-drawer {
  padding: 24px;
  max-width: 420px;
}

.wf-shift-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.wf-shift-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wf-shifts-mobile-list {
  display: none;
}

.wf-shifts-mobile-card {
  border-top: 1px solid var(--clinexa-border);
  padding: 14px 16px;
}

.wf-shifts-mobile-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.wf-shifts-mobile-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--clinexa-border);
}

.wf-shifts-mobile-day:last-child {
  border-bottom: none;
}

.wf-shifts-mobile-day.is-today {
  background: rgba(59, 130, 246, 0.04);
  margin: 0 -16px;
  padding: 10px 16px;
  border-radius: 12px;
}

.wf-shifts-mobile-day-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.wf-shifts-mobile-day-date {
  font-weight: 600;
  color: #64748b;
}

.wf-shifts-mobile-day-shifts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wf-shifts-mobile-add-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  font-style: italic;
}

.wf-shift-template-name {
  display: block;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.wf-period-preset-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wf-shift-entry-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.wf-shift-mode-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.wf-shift-template-hint {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--color-ink-soft);
}

.wf-template-chip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-template-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wf-template-chip.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.wf-template-chip-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
}

.wf-template-chip-time {
  font-size: 0.78rem;
  color: #64748b;
}

.wf-recurrence-label {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wf-templates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 240px;
  overflow-y: auto;
}

.wf-template-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fafbfc;
}

.wf-template-row-meta {
  min-width: 0;
}

.wf-template-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.wf-template-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 768px) {
  .sched-layout .sched-header-row-title,
  .wf-shifts-layout .sched-header-row-title {
    flex-direction: column;
    align-items: stretch;
  }

  .sched-layout .sched-actions-toolbar,
  .wf-shifts-layout .sched-actions-toolbar {
    width: 100%;
    justify-content: stretch;
  }

  .sched-layout .sched-actions-toolbar .btn,
  .wf-shifts-layout .sched-actions-toolbar .btn {
    flex: 1;
    text-align: center;
  }

  .sched-toolbar-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .sched-toolbar-left,
  .sched-toolbar-right {
    width: 100%;
  }

  .sched-toolbar-search-wrap {
    max-width: none;
    flex: 1;
    min-width: 0;
  }

  .wf-shifts-grid-wrap,
  .sched-shifts-grid-wrap {
    display: none;
  }

  .wf-shifts-mobile-list {
    display: block;
  }

  .wf-shift-drawer,
  .wf-templates-drawer {
    max-width: 100%;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }

  .clinexa-filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .clinexa-form-group-compact,
  .clinexa-form-group-compact.wide {
    min-width: 0;
    width: 100%;
  }

  .wf-period-preset-btns {
    width: 100%;
  }

  .wf-period-preset {
    flex: 1;
  }
}

@media (min-width: 769px) {
  .drawer-overlay.open .wf-shift-drawer {
    margin-left: auto;
  }
}

.wf-code-pill {
  font-size: 0.78rem;
  text-transform: capitalize;
}

/* ── Unified page surface (all app pages) ── */
.ds-page-shell,
.wf-hub-page {
  margin: 0;
  padding: 0 0 24px;
  min-height: auto;
  background: transparent;
  border-radius: 0;
}

/* Murphy app theme — hub cards, tables, toolbars (site-wide via .page-container) */
.page-container .ds-page-card:not(.ac-section),
.page-container .wf-hub-card:not(.ac-section) {
  background: var(--murphy-card-bg);
  border: 1px solid var(--murphy-card-border);
  border-radius: 20px;
  box-shadow: var(--murphy-shadow);
}

/* Action Center sections — same surface as Workforce .wf-hub-toolbar */
.page-container section.ac-section,
.page-container .ac-section.card,
.page-container .ac-section.ds-page-card,
.page-container .ac-section.wf-hub-card {
  background: var(--murphy-toolbar-bg);
  border: 1px solid var(--murphy-card-border);
  border-radius: 20px;
  box-shadow: var(--murphy-shadow);
}

.page-container .wf-hub-toolbar,
.page-container .ds-page-card__toolbar,
.page-container .ds-page-card > .filter-bar,
.page-container .ds-page-card > .ds-filter-bar {
  background: var(--murphy-toolbar-bg);
  border-bottom-color: var(--murphy-card-border);
}

.page-container .wf-hub-search-input {
  background: #ffffff;
  border-color: var(--murphy-card-border);
  color: var(--murphy-text);
}

.page-container .wf-hub-search-input:focus {
  border-color: var(--murphy-accent-soft);
  box-shadow: 0 0 0 3px rgba(136, 109, 177, 0.15);
}

.page-container .wf-hub-active-badge {
  background: var(--murphy-accent-muted);
  color: var(--murphy-accent);
}

.page-container .wf-hub-table thead th,
.page-container .ds-page-card .table thead th,
.page-container .ds-page-card .data-table thead th {
  color: var(--murphy-text-muted);
  border-bottom-color: var(--murphy-card-border);
  background: var(--murphy-toolbar-bg);
}

.page-container .wf-hub-table tbody td,
.page-container .ds-page-card .table tbody td,
.page-container .ds-page-card .data-table tbody td {
  border-bottom-color: var(--murphy-card-border);
}

.page-container .wf-hub-table tbody tr:hover,
.page-container .ds-page-card .table tbody tr:hover,
.page-container .ds-page-card .data-table tbody tr:hover {
  background: var(--murphy-row-hover);
}

.page-container .wf-hub-name,
.page-container .wf-hub-job {
  color: var(--murphy-text);
}

.page-container .wf-hub-code,
.page-container .wf-hub-specialty,
.page-container .wf-hub-linked {
  color: var(--murphy-text-muted);
}

.page-container .wf-hub-employ-pill {
  background: var(--murphy-accent-muted);
  color: var(--murphy-accent);
}

.page-container .sched-page-heading,
.page-container .wf-hub-title {
  color: var(--murphy-text);
}

.page-container .sched-page-subtitle,
.page-container .wf-hub-subtitle {
  color: var(--murphy-text-muted);
}

.page-container .wf-shifts-cell,
.page-container .sched-shifts-cell {
  background: var(--murphy-card-bg);
  border-color: var(--murphy-card-border);
}

.page-container .wf-shifts-grid-header .wf-shifts-cell,
.page-container .sched-shifts-grid-header .sched-shifts-cell {
  background: var(--murphy-toolbar-bg);
  color: var(--murphy-text-muted);
}

.page-container .wf-shifts-grid-row .wf-shifts-day-col.is-today,
.page-container .wf-shifts-mobile-day.is-today {
  background: var(--murphy-accent-muted);
  box-shadow: none;
}

.page-container .wf-shifts-grid-header .wf-shifts-day-col.is-today {
  background: var(--murphy-accent-muted);
  box-shadow: inset 0 -2px 0 var(--murphy-accent);
}

.page-container .clinexa-column.is-today {
  background-color: var(--murphy-accent-muted);
  box-shadow: none;
}

.page-container .wf-hub-toolbar .form-control,
.page-container .wf-hub-toolbar-control {
  background: #ffffff;
  border-color: var(--murphy-card-border);
  color: var(--murphy-text);
}

.ds-page-card:not(.ac-section),
.wf-hub-card:not(.ac-section) {
  background: var(--murphy-card-bg);
  border-radius: var(--radius-container);
  border: 1px solid var(--murphy-card-border);
  box-shadow: var(--murphy-shadow);
  overflow: hidden;
  min-width: 0;
}

/* Body zone — turbo frames inherit card chrome from parent */
.ds-page-card > turbo-frame,
turbo-frame.ds-page-card__body {
  display: block;
  min-width: 0;
}

/* Generic page-card zones (catalog/list pages outside Workforce hub) */
.ds-page-card__toolbar,
.ds-page-card > .filter-bar,
.ds-page-card > .ds-filter-bar {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: none;
  border-bottom: 1px solid var(--murphy-card-border);
  background: var(--murphy-toolbar-bg);
  padding: 16px 20px 12px;
}

.ds-page-card__body,
.ds-page-card > .ds-page-card__body {
  display: block;
  min-width: 0;
}

.ds-page-card > .card,
.ds-page-card > turbo-frame > .card,
.ds-page-card > .ds-page-card__body > .card {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}

.ds-page-card > .card:hover,
.ds-page-card > turbo-frame > .card:hover,
.ds-page-card > .ds-page-card__body > .card:hover {
  box-shadow: none;
  transform: none;
}

.ds-page-card > .card:not([style*="padding: 0"]),
.ds-page-card > turbo-frame > .card:not([style*="padding: 0"]),
.ds-page-card > .ds-page-card__body > .card:not([style*="padding: 0"]) {
  padding: 0;
}

.ds-page-card--padded,
.wf-hub-card.ds-page-card--padded {
  padding: 22px 24px;
  overflow: visible;
}

.ds-page-card--padded > h3:first-child {
  padding-top: 2px;
  line-height: 1.35;
}

.ds-page-card .table-responsive {
  overflow-x: auto;
}

.ds-page-card .table,
.ds-page-card .data-table {
  margin-bottom: 0;
}

.ds-page-card__body--pad {
  padding: 16px 20px 20px;
}

.ds-page-card__body--pad #services-count-summary,
.ds-page-card__body--pad #staff-count-summary {
  margin-bottom: 12px;
}

.wf-shifts-layout turbo-frame#shifts-table-frame {
  display: block;
  min-width: 0;
}

.wf-hub-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--color-ink-soft);
}

.wf-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.wf-hub-title {
  margin: 0;
  font-size: var(--text-title-size);
  font-weight: var(--text-title-weight);
  letter-spacing: var(--text-title-tracking);
  color: var(--color-ink);
  line-height: 1.15;
}

.wf-hub-subtitle {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: #64748b;
}

.wf-hub-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.wf-hub-header-actions .btn-outline,
.wf-hub-header-actions a.btn-outline,
.wf-hub-header-actions .btn-create {
  padding: 8px 18px;
  font-size: 0.84rem;
}

.wf-hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--murphy-card-border);
  background: var(--murphy-toolbar-bg);
}

.wf-hub-toolbar:has(.eng-card-heading) {
  align-items: flex-start;
}

.wf-hub-toolbar:has(.eng-card-heading) .wf-hub-active-badge {
  margin-top: 2px;
}

.wf-hub-toolbar form,
.wf-hub-toolbar-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.wf-hub-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-left: auto;
}

.wf-hub-toolbar-form > .wf-hub-toolbar-filters:only-child {
  margin-left: 0;
}

.wf-hub-toolbar-field {
  margin: 0;
  min-width: 140px;
  flex: 0 1 auto;
}

.wf-hub-toolbar-field--segment {
  min-width: 160px;
  max-width: 220px;
}

.wf-hub-toolbar-field .form-control,
.wf-hub-toolbar-field .wf-hub-toolbar-control {
  width: 100%;
  min-width: 0;
}

.wf-hub-toolbar-filters > .btn {
  flex: 0 0 auto;
  align-self: center;
}

.wf-hub-toolbar-field--inline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wf-hub-toolbar-field .form-label {
  margin-bottom: 4px;
}

.wf-hub-toolbar-control {
  min-height: var(--control-height-toolbar);
  font-size: var(--text-toolbar-size);
}

.wf-hub-toolbar .ds-search-wrap {
  min-width: 180px;
}

.wf-hub-toolbar .ds-select-wrap {
  flex: 0 1 auto;
  min-width: 160px;
  max-width: 200px;
}

.wf-hub-toolbar .ds-search-wrap .ds-search,
.wf-hub-toolbar .ds-search-wrap .wf-hub-search-input {
  min-height: var(--control-height-toolbar);
  font-size: var(--text-toolbar-size);
}

.wf-hub-search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.wf-hub-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

[dir="rtl"] .wf-hub-search-icon {
  left: auto;
  right: 14px;
}

.wf-hub-search-input,
.wf-hub-search .ds-search {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-paper-light);
  font-size: var(--text-toolbar-size);
  color: var(--color-ink);
  outline: none;
  box-sizing: border-box;
  min-height: var(--control-height-toolbar);
}

[dir="rtl"] .wf-hub-search-input {
  padding: 10px 40px 10px 14px;
}

.wf-hub-search-input:focus {
  border-color: #c4b5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

/* Catalog filter pills (Services, Resources) — hub toolbar replaces legacy filter-bar */
.wf-hub-toolbar .filter-pill-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.wf-hub-toolbar .filter-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-line-hairline);
  border: 1px solid transparent;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-slate);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.wf-hub-toolbar .filter-pill-btn:hover {
  background: var(--color-line);
  color: var(--color-ink);
}

.wf-hub-toolbar .filter-pill-btn.active {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--color-accent-glow);
}

@media (max-width: 600px) {
  .wf-hub-toolbar .filter-pill-group {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .wf-hub-toolbar .filter-pill-btn {
    flex: 0 0 auto;
  }
}

.wf-hub-active-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: #f3e8ff;
  color: #7c3aed;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.eng-card-heading {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--murphy-text, var(--color-ink));
  line-height: 1.3;
}

.eng-card-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--murphy-text-muted, var(--color-ink-soft));
}

.eng-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--murphy-card-border, var(--color-line));
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--murphy-text, var(--color-ink));
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  unicode-bidi: isolate;
}

.eng-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 1100px) {
  .eng-split-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.eng-status-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.eng-card-body {
  padding: 16px 20px 20px;
}

.ds-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.ds-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ds-slider {
  position: absolute;
  inset: 0;
  background: #e2e8f0;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.ds-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  top: 3px;
  inset-inline-start: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease;
}

.ds-switch input:checked + .ds-slider {
  background: var(--murphy-accent, #7c3aed);
}

.ds-switch input:checked + .ds-slider::before {
  transform: translateX(18px);
}

[dir="rtl"] .ds-switch input:checked + .ds-slider::before {
  transform: translateX(-18px);
}

.wf-hub-table-wrap {
  overflow-x: auto;
}

.wf-hub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.wf-hub-table thead th {
  padding: 10px 16px;
  text-align: start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.wf-hub-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}

.wf-hub-table tbody tr:last-child td {
  border-bottom: none;
}

.wf-hub-table tbody tr:hover {
  background: #fafafa;
}

.wf-hub-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.wf-hub-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.wf-hub-name {
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
}

.wf-hub-code {
  font-size: 0.76rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-top: 2px;
  line-height: 1.2;
}

.wf-hub-specialty {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.2;
}

.wf-hub-job {
  font-weight: 600;
  color: #334155;
}

.wf-hub-employ-pill {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f3e8ff;
  color: #7c3aed;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.wf-hub-sched-pill {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 600;
  white-space: nowrap;
}

.wf-sched-rostered {
  background: #e0f2fe;
  color: #0369a1;
}

.wf-sched-contract {
  background: #f1f5f9;
  color: #475569;
}

.wf-sched-oncall {
  background: #fef3c7;
  color: #b45309;
}

.wf-hub-linked {
  color: #64748b;
  font-size: 0.82rem;
  max-width: 240px;
  display: inline-block;
}

.wf-hub-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.wf-hub-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wf-hub-status-active {
  color: #15803d;
  background: #ecfdf5;
}

.wf-hub-status-active .wf-hub-status-dot {
  background: #22c55e;
}

.wf-hub-status-inactive {
  color: #94a3b8;
  background: #f1f5f9;
}

.wf-hub-status-inactive .wf-hub-status-dot {
  background: #cbd5e1;
}

.wf-hub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wf-hub-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  padding: 0;
}

.wf-hub-icon-btn svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.wf-hub-icon-btn:hover {
  background: #f8fafc;
  border-color: #c4b5fd;
  color: #7c3aed;
}

.wf-hub-icon-btn.wf-hub-icon-btn-danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.wf-hub-footer {
  text-align: center;
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.wf-hub-empty-search {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-ink-soft);
  font-size: 0.88rem;
}

.wf-hub-row-inactive {
  opacity: 0.72;
}

@media (max-width: 900px) {
  .wf-hub-table thead {
    display: none;
  }

  .wf-hub-table tbody tr {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
  }

  .wf-hub-table tbody td {
    display: block;
    padding: 4px 0;
    border: none;
  }

  .wf-hub-actions {
    margin-top: 8px;
  }
}

.nav-count-badge {
  margin-inline-start: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ea580c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.wf-util-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 4px;
}

.wf-util-row {
  display: grid;
  grid-template-columns: 140px 1fr 48px;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
}

.wf-util-bar-track {
  height: 8px;
  background: var(--color-line);
  border-radius: 999px;
  overflow: hidden;
}

.wf-util-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 999px;
}

.wf-util-pct {
  font-weight: 700;
  text-align: right;
  font-size: 0.78rem;
}

.wf-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-line);
  border-top-color: var(--color-primary, #6366f1);
  border-radius: 50%;
  animation: wf-spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes wf-spin {
  to { transform: rotate(360deg); }
}

/* Leave approval — centered modal (not right drawer) */
.drawer-overlay.drawer-overlay--centered.wf-leave-warn-overlay.open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wf-leave-warn-modal {
  width: 100%;
  max-width: 520px;
  max-height: min(88vh, 680px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-xl, 18px);
  box-shadow: var(--shadow-xl);
  padding: 20px 22px 18px;
  position: relative;
  transform: none !important;
  top: auto !important;
  bottom: auto !important;
  right: auto !important;
  left: auto !important;
}

.wf-leave-warn-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.wf-leave-warn-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.wf-leave-warn-header h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 700;
}

.wf-leave-warn-sub {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}

.wf-leave-warn-notice {
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--color-warning-bg, #fffbeb);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: var(--color-ink-soft);
  font-size: 0.74rem;
  line-height: 1.45;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.wf-leave-warn-scroll {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: min(38vh, 280px);
  overflow-y: auto;
  margin-bottom: 14px;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

[dir="rtl"] .wf-leave-warn-scroll {
  padding-right: 0;
  padding-left: 2px;
}

.wf-leave-warn-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-ink-soft);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.wf-leave-warn-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-affected-booking-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: #fafafa;
  border: 1px solid #e8edf2;
  border-radius: 10px;
}

.wf-affected-accent {
  align-self: stretch;
  width: 3px;
  flex-shrink: 0;
  border-radius: 3px;
  background: #7c3aed;
}

.wf-affected-main {
  flex: 1 1 auto;
  min-width: 0;
}

.wf-affected-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-affected-meta {
  margin-top: 2px;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-affected-status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}

.wf-leave-warn-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--color-line);
  padding-top: 12px;
  flex-shrink: 0;
}

.wf-leave-warn-actions-intro {
  margin: 0;
  padding: 8px 11px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8edf2;
  color: var(--color-ink-soft);
  font-size: 0.74rem;
  line-height: 1.4;
}

.wf-leave-warn-action-btns {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.wf-leave-warn-action-btns .wf-leave-action-btn {
  width: auto;
  flex: 1 1 auto;
  justify-content: center;
  padding: 7px 12px;
  font-size: 0.78rem;
  white-space: nowrap;
  min-height: 34px;
}

.wf-leave-warn-actions-primary {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 2px;
}

.wf-leave-warn-actions-primary .btn {
  min-width: 72px;
  padding: 6px 12px;
  font-size: 0.78rem;
  border-color: #e2e8f0;
  color: var(--color-ink-soft);
}

[dir="rtl"] .wf-leave-warn-actions-primary {
  justify-content: flex-start;
}

@media (max-width: 600px) {
  .wf-leave-warn-modal {
    padding: 16px 14px 14px;
    max-height: 92vh;
  }

  .wf-leave-warn-scroll {
    min-height: 140px;
    max-height: 34vh;
  }

  .wf-leave-warn-action-btns {
    flex-direction: column;
  }

  .wf-leave-warn-action-btns .wf-leave-action-btn {
    width: 100%;
  }

  .wf-leave-warn-actions-primary {
    flex-direction: column-reverse;
  }

  .wf-leave-warn-actions-primary .btn {
    width: 100%;
  }
}

/* ── Action Center (Murphy theme tokens) ── */
.ac-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ac-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}

.ac-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--murphy-text);
}

.ac-subtitle {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--murphy-text-muted);
}

.ac-total-badge {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.8rem;
  font-weight: 700;
}

.ac-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--murphy-text-muted);
}

.ac-section {
  padding: 16px 18px;
}

.page-container .ac-section.card {
  padding: 16px 18px;
}

.ac-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--murphy-card-border);
}

.ac-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--murphy-text);
}

.ac-section-desc {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--murphy-text-muted);
}

.ac-count-pill {
  flex-shrink: 0;
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--murphy-accent-muted);
  color: var(--murphy-accent);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ac-count-pill-warn {
  background: #ffedd5;
  color: #c2410c;
}

.ac-section-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--murphy-text-muted);
}

.ac-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ac-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.ac-action-btns .ac-action-btn {
  width: auto;
  flex: 0 1 auto;
  justify-content: center;
  padding: 7px 14px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.ac-item-btn {
  padding: 6px 14px !important;
  font-size: 0.78rem !important;
  white-space: nowrap;
}

.ac-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ac-item-actions .ac-item-btn {
  min-width: 72px;
}

.ac-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ac-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--murphy-card-border);
  border-radius: 12px;
  background: var(--murphy-card-bg);
  transition: background var(--transition-fast);
}

.ac-item:hover {
  background: var(--murphy-row-hover);
}

.ac-item-accent {
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  flex-shrink: 0;
}

.ac-item-time {
  display: flex;
  flex-direction: column;
  min-width: 88px;
}

.ac-time {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--murphy-text);
}

.ac-date {
  font-size: 0.72rem;
  color: var(--murphy-text-muted);
}

.ac-item-body {
  flex: 1;
  min-width: 140px;
}

.ac-item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--murphy-text);
}

.ac-item-meta {
  font-size: 0.78rem;
  color: var(--murphy-text-muted);
  margin-top: 2px;
}

.ac-section-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--murphy-accent);
  text-decoration: none;
}

.ac-section-link:hover {
  color: var(--murphy-accent-soft);
  text-decoration: underline;
}

.bam-modify-panel {
  background: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bam-modify-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-ink);
}

.bam-modify-service {
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  margin-top: -4px;
}

.bam-modify-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bam-modify-field-full {
  grid-column: span 2;
}

.bam-modify-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--color-ink-soft);
  margin-bottom: 4px;
}

.bam-modify-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff;
}

.bam-modify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bam-modify-actions .btn {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 9px 14px;
  font-size: 0.85rem;
}

.ac-cover-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ac-cover-bookings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.ac-cover-booking-chip {
  border: 1px solid var(--color-line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.ac-cover-booking-chip.active {
  border-color: var(--murphy-accent);
  background: var(--murphy-accent-muted);
  color: var(--murphy-accent);
  font-weight: 600;
}

.ac-cover-proposals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ac-cover-proposal-card {
  border: 1px solid var(--color-line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.ac-cover-proposal-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.ac-cover-proposal-meta {
  font-size: 0.8rem;
  color: var(--color-ink-soft);
  margin: 4px 0 8px;
}

.ac-item-in-progress {
  opacity: 0.85;
}

.auto-rules-table-wrap {
  overflow-x: auto;
}

.auto-rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.auto-rules-table th,
.auto-rules-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-line);
  text-align: start;
  vertical-align: top;
}

.auto-rules-table th {
  background: #f8fafc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-ink-soft);
}

.auto-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.auto-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.auto-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: 0.2s;
}

.auto-toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.auto-toggle input:checked + .auto-toggle-slider {
  background: #7c3aed;
}

.auto-toggle input:checked + .auto-toggle-slider:before {
  transform: translateX(18px);
}

.auto-log-list {
  display: flex;
  flex-direction: column;
}

.auto-log-row {
  border-bottom: 1px solid var(--color-line);
}

.auto-log-summary {
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.auto-log-summary::-webkit-details-marker {
  display: none;
}

.auto-log-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auto-log-rule {
  font-weight: 600;
}

.auto-log-meta {
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  margin-top: 4px;
}

.auto-log-detail {
  padding: 0 16px 12px;
}

.auto-log-json {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.78rem;
  overflow-x: auto;
  margin: 0;
}

.auto-dryrun-step {
  border: 1px solid var(--color-line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.auto-dryrun-step.would-run {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.bam-automation-section {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md, 12px);
  padding: 10px 14px;
  background: #fafafa;
}

.bam-automation-summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
}

.bam-automation-timeline {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bam-automation-entry {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 8px;
}

.bam-automation-line {
  font-size: 0.88rem;
  font-weight: 600;
}

.bam-automation-meta {
  font-size: 0.78rem;
  color: var(--color-ink-soft);
  margin-top: 4px;
}
