/* ═══════════════════════════════════════════════════════════════
   Upnez Property CRM — Global Design System
   Upnez · Real Estate Operations Platform
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+Bengali:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ─── Color Tokens ─── */
:root {
  --color-primary: #0074FF;
  --color-primary-light: #3390ff;
  --color-primary-dark: #0055cc;
  --color-dark: #081A3E;
  --color-dark-2: #0d2252;
  --color-dark-3: #132c65;
  --color-white: #FFFFFF;
  --color-success: #1FAE60;
  --color-warning: #F5A623;
  --color-danger: #E5484D;
  --color-info: #5B8DEF;
  --color-muted: #8A94A6;

  --bg-body: #F0F4FF;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --sidebar-width: 260px;
  --topbar-height: 64px;

  --shadow-sm: 0 1px 3px rgba(8, 26, 62, 0.08);
  --shadow-md: 0 4px 16px rgba(8, 26, 62, 0.12);
  --shadow-lg: 0 8px 32px rgba(8, 26, 62, 0.16);
  --shadow-xl: 0 16px 48px rgba(8, 26, 62, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 50px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', 'Noto Sans Bengali', system-ui, -apple-system, sans-serif;
}

/* ═══ EXECUTIVE TOP ACCENT PROGRESS LOADER & PJAX TRANSITIONS ═══ */
#app-top-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #0074FF 0%, #00D4FF 50%, #7C3AED 100%);
  z-index: 999999;
  box-shadow: 0 0 10px rgba(0, 116, 255, 0.8), 0 0 5px rgba(124, 58, 237, 0.6);
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  pointer-events: none;
  opacity: 0;
}

#app-top-loader.loading {
  opacity: 1;
}

.main-content {
  transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.pjax-loading {
  opacity: 0.35;
  transform: translateY(2px);
}

/* ─── Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-body);
  color: var(--color-dark);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(8, 26, 62, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ════════════════════════════════
   LAYOUT
   ════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(160deg, var(--color-dark) 0%, var(--color-dark-2) 60%, var(--color-dark-3) 100%);
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  box-sizing: border-box;
  transition: transform var(--transition);
}

/* ─── Unified App Header (replaces sidebar-logo + old topbar) ─── */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: flex;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(8, 26, 62, 0.1), 0 2px 12px rgba(8, 26, 62, 0.08);
}

.app-header-brand {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(160deg, var(--color-dark) 0%, var(--color-dark-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.app-header-topbar {
  flex: 1;
  background: white;
  border-bottom: 1px solid rgba(8, 26, 62, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--color-dark, #0B192C);
  line-height: 1.2;
}

.breadcrumb {
  font-size: 11px;
  color: var(--color-muted, #64748B);
  margin-top: 2px;
  display: flex;
  align-items: center;
}

.breadcrumb a {
  color: var(--color-primary, #0074FF);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-action {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted, #64748B);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  position: relative;
}

.topbar-action:hover {
  color: var(--color-primary, #0074FF);
  background: rgba(0, 116, 255, 0.08);
}

.topbar-logout-btn:hover {
  color: var(--color-danger, #E5484D) !important;
  background: rgba(229, 72, 77, 0.1) !important;
}

/* Custom Tooltip that safely aligns inside the viewport */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #081A3E;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  z-index: 1200;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  top: calc(100% + 3px);
  right: 12px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #081A3E;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1200;
  pointer-events: none;
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateY(0);
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #E5484D;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid #ffffff;
  line-height: 1;
}

/* ─── Header Notification Popover Dropdown ─── */
.notif-dropdown-wrapper {
  position: relative;
}

.notif-dropdown-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -10px;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(8, 26, 62, 0.1);
  box-shadow: 0 12px 36px rgba(8, 26, 62, 0.14), 0 2px 6px rgba(8, 26, 62, 0.04);
  z-index: 1050;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: notifDropdownSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-dropdown-panel.show {
  display: flex;
}

@keyframes notifDropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notif-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(8, 26, 62, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFBFD;
}

.notif-dropdown-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-dark, #0B192C);
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-dropdown-filters {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid rgba(8, 26, 62, 0.06);
  overflow-x: auto;
}

.notif-filter-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted, #64748B);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.notif-filter-pill:hover {
  background: rgba(8, 26, 62, 0.05);
  color: var(--color-dark, #0B192C);
}

.notif-filter-pill.active {
  background: #ffffff;
  border-color: rgba(8, 26, 62, 0.12);
  color: var(--color-primary, #0074FF);
  box-shadow: 0 1px 2px rgba(8, 26, 62, 0.04);
}

.notif-dropdown-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 0;
}

.notif-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(8, 26, 62, 0.04);
  transition: background 0.15s ease;
  position: relative;
}

.notif-dropdown-item:hover {
  background: #F8FAFC;
}

.notif-dropdown-item.unread {
  background: #F0F7FF;
}

.notif-dropdown-item.unread:hover {
  background: #E5F0FF;
}

.notif-dropdown-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-dropdown-body {
  flex: 1;
  min-width: 0;
}

.notif-dropdown-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-dark, #0B192C);
  line-height: 1.3;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-dropdown-item-msg {
  font-size: 11.5px;
  color: var(--color-muted, #64748B);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-dropdown-item-time {
  font-size: 10.5px;
  color: var(--color-muted, #94A3B8);
  margin-top: 4px;
}

.notif-dropdown-footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(8, 26, 62, 0.07);
  background: #FAFBFD;
  text-align: center;
}

.notif-dropdown-footer a {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary, #0074FF);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.notif-dropdown-footer a:hover {
  text-decoration: underline;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: rgba(8, 26, 62, 0.1);
  margin: 0 4px;
  flex-shrink: 0;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.header-user:hover {
  background: rgba(0, 116, 255, 0.06);
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-info));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.header-user-info {
  line-height: 1.25;
}

.header-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-dark);
}

.header-user-role {
  font-size: 10.5px;
  color: var(--color-muted);
  text-transform: capitalize;
}

/* ─── Sidebar (no longer has logo — header handles it) ─── */
.sidebar-logo {
  display: none;
}

.sidebar-logo a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 116, 255, 0.4);
}

.logo-text {
  color: white;
}

.logo-text .company {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-text .tagline {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 10px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.sidebar-nav::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

.sidebar-nav::-webkit-scrollbar-track {
  display: none !important;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  display: none !important;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.34);
  padding: 10px 10px 4px;
  margin-top: 2px;
}

.nav-section-label:first-child {
  padding-top: 4px;
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  margin-bottom: 2px;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 116, 255, 0.32) 0%, rgba(0, 116, 255, 0.12) 100%);
  color: #ffffff;
  font-weight: 600;
  border-left: 3px solid var(--color-primary);
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--color-primary, #0074FF);
  color: white;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1.5px 5.5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 1.2;
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, var(--color-dark) 0%, var(--color-dark-2) 100%);
  box-sizing: border-box;
  width: 100%;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}

.sidebar-user-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.28);
}

.sidebar-user-info-link {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
}

.sidebar-user-card .user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-user-card .user-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-card .user-avatar .avatar-letter {
  font-size: 14px;
  font-weight: 800;
  color: #0F172A;
  font-family: inherit;
  line-height: 1;
}

.sidebar-user-card .user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-user-card .user-info .user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-card .user-info .user-role {
  font-size: 10.5px;
  font-weight: 500;
  color: #8E9DB5;
  line-height: 1.15;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-form {
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.sidebar-logout-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.24);
  border-radius: 7px;
  color: #F87171;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
  color: #FF5252;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.sidebar-logout-btn:active {
  transform: scale(0.96);
}

/* ─── Sidebar Collapsed State (Zero-Shift Initial Paint Support) ─── */
html.sidebar-collapsed,
body.sidebar-collapsed {
  --sidebar-width: 68px;
}

html.sidebar-collapsed .app-header-brand,
body.sidebar-collapsed .app-header-brand {
  width: var(--sidebar-width);
  padding: 0;
  justify-content: center;
}

html.sidebar-collapsed .logo-text,
html.sidebar-collapsed .nav-section-label,
html.sidebar-collapsed .nav-item span:not(.nav-badge),
html.sidebar-collapsed .nav-item .nav-badge,
html.sidebar-collapsed .sidebar-user-card .user-info,
body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-item span:not(.nav-badge),
body.sidebar-collapsed .nav-item .nav-badge,
body.sidebar-collapsed .sidebar-user-card .user-info {
  display: none !important;
}

html.sidebar-collapsed .sidebar-footer,
body.sidebar-collapsed .sidebar-footer {
  padding: 8px 6px;
}

html.sidebar-collapsed .sidebar-user-card,
body.sidebar-collapsed .sidebar-user-card {
  padding: 6px 4px;
  flex-direction: column;
  background: transparent;
  border: none;
  box-shadow: none;
  gap: 8px;
}

html.sidebar-collapsed .sidebar-user-card .user-avatar,
body.sidebar-collapsed .sidebar-user-card .user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

html.sidebar-collapsed .sidebar-logout-btn,
body.sidebar-collapsed .sidebar-logout-btn {
  width: 28px;
  height: 28px;
}

html.sidebar-collapsed .nav-item,
body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
  border-left: none;
}

html.sidebar-collapsed .nav-item.active,
body.sidebar-collapsed .nav-item.active {
  background: rgba(0, 116, 255, 0.25);
  border-radius: var(--radius-sm);
}

html.sidebar-collapsed .main-content,
body.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
}

/* ─── Main Content ─── */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  flex: 1;
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: 100vw;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
}

/* ─── Topbar helpers (used inside .app-header-topbar) ─── */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-dark);
  letter-spacing: -0.3px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg-body);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
}

.topbar-action:hover {
  background: var(--color-primary);
  color: white;
  transform: scale(1.05);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--color-danger);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* ─── Page Content ─── */
.page-content {
  padding: 24px;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

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

@media (max-width: 576px) {
  .page-content {
    padding: 12px 8px;
  }
}

/* ════════════════════════════════
   CARDS
   ════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(8, 26, 62, 0.06);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-dark);
  letter-spacing: -0.2px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px 24px 24px;
}

/* ─── KPI Stat Cards ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(8, 26, 62, 0.06);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-color, var(--color-primary));
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: color-mix(in srgb, var(--kpi-color, var(--color-primary)) 12%, transparent);
  color: var(--kpi-color, var(--color-primary));
  flex-shrink: 0;
}

.kpi-content {}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-dark);
  line-height: 1;
  letter-spacing: -1px;
}

.kpi-label {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 4px;
  font-weight: 500;
}

.kpi-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kpi-change.up {
  color: var(--color-success);
}

.kpi-change.down {
  color: var(--color-danger);
}

/* ════════════════════════════════
   BADGES / PILLS
   ════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-primary {
  background: rgba(0, 116, 255, 0.12);
  color: var(--color-primary);
}

.badge-success {
  background: rgba(31, 174, 96, 0.12);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(245, 166, 35, 0.15);
  color: #c4830b;
}

.badge-danger {
  background: rgba(229, 72, 77, 0.12);
  color: var(--color-danger);
}

.badge-info {
  background: rgba(91, 141, 239, 0.12);
  color: var(--color-info);
}

.badge-muted {
  background: rgba(138, 148, 166, 0.12);
  color: var(--color-muted);
}

.badge-dark {
  background: rgba(8, 26, 62, 0.1);
  color: var(--color-dark);
}

/* Priority badges */
.badge-hot {
  background: rgba(0, 116, 255, 0.15);
  color: var(--color-primary);
}

.badge-high {
  background: rgba(31, 174, 96, 0.15);
  color: var(--color-success);
}

.badge-medium {
  background: rgba(245, 166, 35, 0.15);
  color: #c4830b;
}

.badge-low {
  background: rgba(138, 148, 166, 0.15);
  color: var(--color-muted);
}

/* ════════════════════════════════
   TABLES
   ════════════════════════════════ */
.table-wrap {
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(8, 26, 62, 0.06);
  background: white;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
}

/* Custom styled horizontal scrollbar for tables */
.table-wrap::-webkit-scrollbar {
  height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 3px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Tables inside cards — remove card overflow so rows show */
.card .data-table {
  margin: 0 -0px;
}

.card-body.p-0 {
  padding: 0 !important;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background: #F8FAFC;
  border-bottom: 2px solid rgba(8, 26, 62, 0.08);
}

.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(8, 26, 62, 0.05);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
  position: relative;
}

.data-table tbody tr:hover {
  background: rgba(0, 116, 255, 0.03);
}

/* Sticky Action Column on the right */
.data-table th.sticky-action,
.data-table td.sticky-action {
  position: sticky;
  right: 0;
  background: white;
  z-index: 2;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.04);
  text-align: right;
  min-width: 185px;
  width: 185px;
  white-space: nowrap !important;
}

.data-table thead th.sticky-action {
  background: #F8FAFC;
  z-index: 3;
}

.data-table tbody tr:hover td.sticky-action {
  background: #F4F8FF;
}

.table-action-group {
  display: flex !important;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
}

.table-action-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(8, 26, 62, 0.1);
  background: #F8FAFC;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  padding: 0;
}

.table-action-btn:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: scale(1.08);
}

.table-action-btn.btn-call {
  color: #0074FF;
  background: #EFF6FF;
  border-color: rgba(0, 116, 255, 0.2);
}

.table-action-btn.btn-call:hover {
  background: #0074FF;
  color: white;
  border-color: #0074FF;
}

.table-action-btn.btn-whatsapp {
  color: #1FAE60;
  background: #F0FDF4;
  border-color: rgba(31, 174, 96, 0.2);
}

.table-action-btn.btn-whatsapp:hover {
  background: #1FAE60;
  color: white;
  border-color: #1FAE60;
}

.table-action-btn.btn-visit {
  color: #06B6D4;
  background: #ECFEFF;
  border-color: rgba(6, 182, 212, 0.2);
}

.table-action-btn.btn-visit:hover {
  background: #06B6D4;
  color: white;
  border-color: #06B6D4;
}

.table-action-btn.btn-apt {
  color: #F59E0B;
  background: #FFFBEB;
  border-color: rgba(245, 158, 11, 0.2);
}

.table-action-btn.btn-apt:hover {
  background: #F59E0B;
  color: white;
  border-color: #F59E0B;
}

.table-action-btn.btn-complete {
  color: #10B981;
  background: #ECFDF5;
  border-color: rgba(16, 185, 129, 0.2);
}

.table-action-btn.btn-complete:hover {
  background: #10B981;
  color: white;
  border-color: #10B981;
}

.table-action-btn.btn-resched {
  color: #8B5CF6;
  background: #F5F3FF;
  border-color: rgba(139, 92, 246, 0.2);
}

.table-action-btn.btn-resched:hover {
  background: #8B5CF6;
  color: white;
  border-color: #8B5CF6;
}

.table-action-btn.btn-more {
  color: var(--color-muted);
  background: #F8FAFC;
}

.table-action-btn.btn-more:hover {
  background: var(--color-dark);
  color: white;
  border-color: var(--color-dark);
}

/* Row Dropdown Menu */
.row-dropdown-container {
  position: relative;
  display: inline-block;
}

.row-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(8, 26, 62, 0.15);
  border: 1px solid rgba(8, 26, 62, 0.08);
  padding: 6px;
  min-width: 180px;
  z-index: 1000;
  text-align: left;
}

.row-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-dark);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
  white-space: nowrap;
}

.row-dropdown-item:hover {
  background: rgba(0, 116, 255, 0.08);
  color: var(--color-primary);
}

/* Priority strip on left edge */
.data-table tbody tr.priority-hot td:first-child {
  border-left: 3px solid var(--color-primary);
}

.data-table tbody tr.priority-high td:first-child {
  border-left: 3px solid var(--color-success);
}

.data-table tbody tr.priority-medium td:first-child {
  border-left: 3px solid var(--color-warning);
}

.data-table tbody tr.priority-low td:first-child {
  border-left: 3px solid var(--color-muted);
}

.data-table tbody tr.status-overdue {
  background: rgba(229, 72, 77, 0.03);
}

.data-table tbody tr.status-escalated {
  background: rgba(229, 72, 77, 0.06);
}

.data-table tfoot td {
  padding: 14px;
  border-top: 2px solid rgba(8, 26, 62, 0.08);
  background: var(--bg-body);
}

/* ─── Table Actions ─── */
.actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--bg-body);
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-size: 13px;
}

.action-btn:hover {
  background: var(--color-primary);
  color: white;
  transform: scale(1.1);
}

.action-btn.danger:hover {
  background: var(--color-danger);
}

.action-btn.success:hover {
  background: var(--color-success);
}

.action-btn.warning:hover {
  background: var(--color-warning);
  color: white;
}

/* ════════════════════════════════
   BUTTONS
   ════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 116, 255, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  box-shadow: 0 6px 20px rgba(0, 116, 255, 0.45);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success), #27c672);
  color: white;
  box-shadow: 0 4px 12px rgba(31, 174, 96, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(31, 174, 96, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #f06060);
  color: white;
  box-shadow: 0 4px 12px rgba(229, 72, 77, 0.3);
}

.btn-danger:hover {
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--color-warning), #f8bc4a);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}

.btn-outline:hover,
.btn-outline:focus,
.btn-outline:active,
.btn-outline.active {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-primary) !important;
}

.btn-outline:hover i,
.btn-outline:hover svg,
.btn-outline:focus i,
.btn-outline:focus svg,
.btn-outline:active i,
.btn-outline:active svg,
.btn-outline.active i,
.btn-outline.active svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.btn-primary:hover i,
.btn-primary:hover svg,
.btn-primary:focus i,
.btn-primary:focus svg,
.btn-primary:active i,
.btn-primary:active svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.btn svg,
.btn i {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-ghost {
  background: var(--bg-body);
  color: var(--color-dark);
  border: 1px solid rgba(8, 26, 62, 0.12);
}

.btn-ghost:hover {
  background: white;
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-icon {
  padding: 9px;
  border-radius: var(--radius-sm);
}

/* ════════════════════════════════
   FORMS
   ════════════════════════════════ */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-dark);
  letter-spacing: 0.2px;
}

.form-label .required {
  color: var(--color-danger);
  margin-left: 2px;
}

.form-control {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(8, 26, 62, 0.15);
  font-size: 13.5px;
  font-family: var(--font-family);
  color: var(--color-dark);
  background: white;
  transition: all var(--transition);
  outline: none;
  width: 100%;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 116, 255, 0.1);
}

.form-control.error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.1);
}

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

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

select.form-control {
  cursor: pointer;
}

.form-hint {
  font-size: 11.5px;
  color: var(--color-muted);
}

.form-hint.counter {
  text-align: right;
}

.form-hint.counter.danger {
  color: var(--color-danger);
  font-weight: 600;
}

.form-error {
  font-size: 11.5px;
  color: var(--color-danger);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-section {
  padding: 24px;
  border-radius: var(--radius-md);
  background: rgba(240, 244, 255, 0.6);
  border: 1px solid rgba(8, 26, 62, 0.06);
  margin-bottom: 20px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-dark);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Wizard steps */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0 4px;
}

.wizard-step {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}

.wizard-step-indicator {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(8, 26, 62, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-muted);
  background: white;
  transition: all var(--transition);
  flex-shrink: 0;
  z-index: 1;
}

.wizard-step.done .wizard-step-indicator {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.wizard-step.active .wizard-step-indicator {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(0, 116, 255, 0.2);
}

.wizard-step-label {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-muted);
}

.wizard-step.active .wizard-step-label {
  color: var(--color-primary);
}

.wizard-step.done .wizard-step-label {
  color: var(--color-success);
}

.wizard-step-line {
  flex: 1;
  height: 2px;
  background: rgba(8, 26, 62, 0.1);
  margin: 0 12px;
}

.wizard-step.done+.wizard-step .wizard-step-line,
.wizard-step.done .wizard-step-line {
  background: var(--color-success);
}

/* ════════════════════════════════
   FILTERS BAR
   ════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: white;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(8, 26, 62, 0.06);
  width: 100%;
  box-sizing: border-box;
}

.filter-bar .form-control {
  min-width: 110px;
  flex: 1 1 120px;
  max-width: 100%;
  font-size: 12.5px;
  padding: 7px 10px;
  height: 36px;
}

.filter-bar .search-input {
  min-width: 160px;
  flex: 2 1 200px;
}

/* ════════════════════════════════
   PAGE HEADER
   ════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-left {}

.page-header-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-dark);
  letter-spacing: -0.5px;
}

.page-header-subtitle {
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ════════════════════════════════
   ALERTS / FLASH MESSAGES
   ════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 20px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: rgba(31, 174, 96, 0.1);
  border-color: var(--color-success);
  color: #0e6b3a;
}

.alert-danger {
  background: rgba(229, 72, 77, 0.1);
  border-color: var(--color-danger);
  color: #b01c22;
}

.alert-warning {
  background: rgba(245, 166, 35, 0.1);
  border-color: var(--color-warning);
  color: #8a5c00;
}

.alert-info {
  background: rgba(91, 141, 239, 0.1);
  border-color: var(--color-info);
  color: #2e58c4;
}

/* ════════════════════════════════
   KANBAN BOARD
   ════════════════════════════════ */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-column {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: white;
  border-bottom: 3px solid var(--stage-color, var(--color-primary));
  box-shadow: var(--shadow-sm);
}

.kanban-column-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-dark);
}

.kanban-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--stage-color, var(--color-primary));
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.kanban-cards {
  background: rgba(240, 244, 255, 0.5);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  min-height: 200px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(8, 26, 62, 0.06);
  cursor: pointer;
  transition: all var(--transition);
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 8px;
}

.kanban-card-meta {
  font-size: 11.5px;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.kanban-card-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ════════════════════════════════
   TIMELINE (Activity Log)
   ════════════════════════════════ */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(8, 26, 62, 0.08);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid white;
  box-shadow: 0 0 0 2px rgba(0, 116, 255, 0.2);
}

.timeline-content {
  background: white;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(8, 26, 62, 0.06);
}

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-dark);
}

.timeline-meta {
  font-size: 11.5px;
  color: var(--color-muted);
  margin-top: 4px;
}

/* ════════════════════════════════
   DETAIL VIEW (Show Page)
   ════════════════════════════════ */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.detail-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(8, 26, 62, 0.05);
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.detail-value {
  font-size: 13.5px;
  color: var(--color-dark);
  font-weight: 500;
}

/* ════════════════════════════════
   EMPTY STATE
   ════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted);
}

.empty-state-icon {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 13.5px;
  margin-bottom: 20px;
}

/* ════════════════════════════════
   CRM MODERN COMPACT PAGINATION SYSTEM
   ════════════════════════════════ */
.pagination-wrap,
.leads-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #ffffff;
  border-top: 1px solid rgba(8, 26, 62, 0.07);
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
}

.pagination-info,
.leads-pagination-info {
  font-size: 12px;
  color: var(--color-muted, #64748B);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-info strong,
.pagination-info .highlight,
.leads-pagination-info strong,
.leads-pagination-info .highlight {
  font-weight: 700;
  color: var(--color-dark, #0B192C);
}

.crm-pagination-nav {
  display: inline-flex;
  align-items: center;
}

.crm-pagination-list,
.pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.crm-page-item,
.page-item {
  display: inline-flex;
  align-items: center;
}

.crm-page-btn,
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #334155;
  background: #ffffff;
  border: 1px solid rgba(8, 26, 62, 0.12);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
  line-height: 1;
}

.crm-page-btn.crm-page-num {
  padding: 0 6px;
  min-width: 28px;
}

.crm-page-btn:hover:not(.disabled):not(.active),
.page-link:hover:not(.disabled):not(.active) {
  background: #F8FAFC;
  color: #0074FF;
  border-color: #0074FF;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 116, 255, 0.12);
}

.crm-page-item.active .crm-page-btn,
.crm-page-btn.active,
.page-item.active .page-link,
.page-link.active {
  background: #0074FF !important;
  color: #ffffff !important;
  border-color: #0074FF !important;
  font-weight: 700;
  cursor: default;
  transform: none !important;
  box-shadow: 0 2px 6px rgba(0, 116, 255, 0.25) !important;
}

.crm-page-item.disabled .crm-page-btn,
.crm-page-btn.disabled,
.page-item.disabled .page-link,
.page-link.disabled {
  background: #F8FAFC !important;
  color: #94A3B8 !important;
  border-color: rgba(8, 26, 62, 0.08) !important;
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none !important;
  transform: none !important;
}

.crm-page-btn.crm-page-dots,
.page-link.dots {
  border: none;
  background: transparent !important;
  color: #94A3B8 !important;
  min-width: 20px;
  padding: 0;
  cursor: default;
  box-shadow: none !important;
  transform: none !important;
  font-size: 12px;
}

.crm-page-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.crm-page-text {
  font-size: 11.5px;
  font-weight: 600;
}

/* ─── Jump To Page Component ─── */
.crm-pagination-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-jump-page {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #F8FAFC;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(8, 26, 62, 0.1);
  height: 28px;
  box-sizing: border-box;
}

.crm-jump-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-muted, #64748B);
  white-space: nowrap;
}

.crm-jump-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.crm-jump-input {
  min-width: 34px;
  width: 3.5ch;
  max-width: 100px;
  height: 22px;
  padding: 0 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-dark, #0B192C);
  background: #ffffff;
  border: 1px solid rgba(8, 26, 62, 0.18);
  border-radius: 4px;
  text-align: center;
  font-family: inherit;
  box-sizing: border-box;
  transition: width 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -moz-appearance: textfield;
}

.crm-jump-input::-webkit-outer-spin-button,
.crm-jump-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.crm-jump-input:focus {
  outline: none;
  border-color: #0074FF;
  box-shadow: 0 0 0 2px rgba(0, 116, 255, 0.15);
  background: #ffffff;
}

.crm-jump-total {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-muted, #64748B);
  white-space: nowrap;
}

@media (max-width: 640px) {

  .pagination-wrap,
  .leads-pagination-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 8px 12px;
  }

  .crm-pagination-inner {
    justify-content: center;
    gap: 6px;
  }

  .crm-page-text {
    display: none;
  }

  .crm-page-btn,
  .page-link {
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    font-size: 11px;
  }

  .crm-pagination-list,
  .pagination {
    gap: 3px;
  }
}

/* ════════════════════════════════
   CHARTS
   ════════════════════════════════ */
.chart-wrap {
  width: 100%;
  min-height: 200px;
  position: relative;
}

/* ════════════════════════════════
   CALENDAR
   ════════════════════════════════ */
.fc-toolbar-title {
  font-size: 16px !important;
  font-weight: 700 !important;
}

.fc-button-primary {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 12px !important;
}

.fc-event {
  border-radius: 4px !important;
  font-size: 11px !important;
}

/* ════════════════════════════════
   MODALS
   ════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 26, 62, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open,
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"] {
  opacity: 1 !important;
  pointer-events: all !important;
  display: flex !important;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 100000;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal,
.modal-overlay[style*="display: flex"] .modal,
.modal-overlay[style*="display:flex"] .modal {
  transform: scale(1) translateY(0) !important;
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-muted);
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--color-danger);
}

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

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ════════════════════════════════
   RESPONSIVE & MULTI-DEVICE RATIOS
   ════════════════════════════════ */
@media (max-width: 1440px) {
  :root {
    --sidebar-width: 230px;
  }

  .page-content {
    padding: 18px 20px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 12.5px;
  }
}

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 220px;
  }

  .page-content {
    padding: 16px;
  }

  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .filter-bar .form-control {
    min-width: 100px;
    font-size: 12px;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

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

  .kanban-board {
    gap: 12px;
  }
}

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

  .filter-bar {
    gap: 6px;
    padding: 10px 12px;
  }

  .filter-bar .form-control {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .page-content {
    padding: 10px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .form-control {
    max-width: 100%;
  }
}

/* ════════════════════════════════
   ANIMATIONS
   ════════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.fade-up {
  animation: fadeUp 0.4s ease both;
}

.fade-up-1 {
  animation-delay: 0.05s;
}

.fade-up-2 {
  animation-delay: 0.1s;
}

.fade-up-3 {
  animation-delay: 0.15s;
}

.fade-up-4 {
  animation-delay: 0.2s;
}

.fade-up-5 {
  animation-delay: 0.25s;
}

.kpi-value {
  animation: countUp 0.5s ease both;
}

/* ─── Utility Classes ─── */
.text-primary {
  color: var(--color-primary) !important;
}

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

.text-warning {
  color: #c4830b !important;
}

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

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

.text-sm {
  font-size: 12px !important;
}

.text-xs {
  font-size: 11px !important;
}

.fw-600 {
  font-weight: 600 !important;
}

.fw-700 {
  font-weight: 700 !important;
}

.d-flex {
  display: flex !important;
}

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

.gap-8 {
  gap: 8px !important;
}

.gap-12 {
  gap: 12px !important;
}

.mt-4 {
  margin-top: 4px !important;
}

.mt-8 {
  margin-top: 8px !important;
}

.mt-16 {
  margin-top: 16px !important;
}

.mt-24 {
  margin-top: 24px !important;
}

.mb-16 {
  margin-bottom: 16px !important;
}

.mb-24 {
  margin-bottom: 24px !important;
}

/* ════════════════════════════════
   KPI 6-CARD GRID SYSTEM
   ════════════════════════════════ */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 1400px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
  }
}

@media (max-width: 1180px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 850px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ════════════════════════════════
   STICKY ACTIONS & TABLE ICON BUTTONS
   ════════════════════════════════ */
.sticky-action {
  position: sticky !important;
  right: 0 !important;
  background: white !important;
  z-index: 15 !important;
  min-width: 155px !important;
  width: 155px !important;
  white-space: nowrap !important;
  box-shadow: -4px 0 8px rgba(8, 26, 62, 0.04) !important;
  text-align: right !important;
}

thead th.sticky-action {
  background: #F8FAFC !important;
  z-index: 20 !important;
}

.table-action-group {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  justify-content: flex-end !important;
  align-items: center !important;
  position: relative !important;
}

.table-action-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(8, 26, 62, 0.12) !important;
  background: #FFFFFF !important;
  color: var(--color-dark) !important;
  cursor: pointer !important;
  transition: all 0.15s ease-in-out !important;
  padding: 0 !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
}

.table-action-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 5px rgba(8, 26, 62, 0.1) !important;
}

.table-action-btn.btn-call:hover {
  background: #EFF6FF !important;
  color: #0074FF !important;
  border-color: #0074FF !important;
}

.table-action-btn.btn-whatsapp:hover {
  background: #F0FDF4 !important;
  color: #16A34A !important;
  border-color: #16A34A !important;
}

.table-action-btn.btn-complete:hover {
  background: #ECFDF5 !important;
  color: #10B981 !important;
  border-color: #10B981 !important;
}

.table-action-btn.btn-resched:hover {
  background: #FFFBEB !important;
  color: #D97706 !important;
  border-color: #D97706 !important;
}

.table-action-btn.btn-expand:hover {
  background: #F1F5F9 !important;
  color: #0074FF !important;
  border-color: #0074FF !important;
}

.table-action-btn.btn-more:hover {
  background: #F1F5F9 !important;
  color: var(--color-dark) !important;
  border-color: rgba(8, 26, 62, 0.25) !important;
}

/* ─── Row Floating Dropdown Menu ─── */
.row-dropdown-container {
  position: relative !important;
  display: inline-block !important;
}

.row-dropdown-menu {
  display: none;
  position: fixed !important;
  z-index: 99999 !important;
  min-width: 185px !important;
  background: #FFFFFF !important;
  border-radius: 9px !important;
  box-shadow: 0 10px 30px rgba(8, 26, 62, 0.18), 0 2px 8px rgba(8, 26, 62, 0.08) !important;
  border: 1px solid rgba(8, 26, 62, 0.12) !important;
  padding: 6px 0 !important;
  animation: fadeUp 0.15s ease both !important;
}

.row-dropdown-item {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 8px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--color-dark) !important;
  text-decoration: none !important;
  transition: all 0.12s ease !important;
  white-space: nowrap !important;
  border: none !important;
  background: transparent !important;
  width: 100% !important;
  text-align: left !important;
  cursor: pointer !important;
}

.row-dropdown-item:hover {
  background: #F0F4FF !important;
  color: var(--color-primary) !important;
}

.row-dropdown-divider {
  height: 1px !important;
  background: rgba(8, 26, 62, 0.08) !important;
  margin: 4px 0 !important;
}

/* ─── Expandable Details Row ─── */
.details-row {
  transition: all 0.2s ease-in-out;
}

.details-row td {
  background: #F8FAFC !important;
}

/* ─── Collapsed Sidebar Mode ─── */
body.sidebar-collapsed {
  --sidebar-width: 68px;
}

body.sidebar-collapsed .sidebar .nav-item {
  justify-content: center;
  padding: 10px 0;
  font-size: 0;
}

body.sidebar-collapsed .sidebar .nav-item .nav-icon {
  margin-right: 0;
  width: 20px;
  height: 20px;
}

body.sidebar-collapsed .sidebar .nav-section-label,
body.sidebar-collapsed .sidebar .badge,
body.sidebar-collapsed .app-header-brand .logo-text {
  display: none !important;
}

body.sidebar-collapsed .app-header-brand {
  justify-content: center;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE VIEW TRANSITION & ANIMATIONS (EXECUTIVE ULTRA-SMOOTH)
   ═══════════════════════════════════════════════════════════════ */
@view-transition {
  navigation: auto;
}

.app-header {
  view-transition-name: app-header-bar;
}

.sidebar {
  view-transition-name: app-sidebar-nav;
}

.main-content {
  view-transition-name: app-main-content;
}

::view-transition-old(app-header-bar),
::view-transition-new(app-header-bar),
::view-transition-old(app-sidebar-nav),
::view-transition-new(app-sidebar-nav) {
  animation: none !important;
}

::view-transition-old(app-main-content) {
  animation: 90ms cubic-bezier(0.4, 0, 1, 1) both fadeContentOut;
}

::view-transition-new(app-main-content) {
  animation: 180ms cubic-bezier(0.16, 1, 0.3, 1) 30ms both fadeContentIn;
}

@keyframes fadeContentOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.995);
  }
}

@keyframes fadeContentIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-content {
  animation: fadeContentIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

font-size: 11px;
font-weight: 700;
padding: 1px 6px;
border-radius: 8px;
}

.team-tab-btn.active .team-tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Workload Health Meter */
.workload-meter-box {
  background: #F8FAFC;
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid #E2E8F0;
}

.workload-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #E2E8F0;
  overflow: hidden;
  position: relative;
}

.workload-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.workload-status-optimal {
  color: #16A34A;
}

.workload-status-balanced {
  color: #0284C7;
}

.workload-status-heavy {
  color: #D97706;
}

.workload-status-overloaded {
  color: #DC2626;
}

.workload-fill-optimal {
  background: #22C55E;
}

.workload-fill-balanced {
  background: #0EA5E9;
}

.workload-fill-heavy {
  background: #F59E0B;
}

.workload-fill-overloaded {
  background: #EF4444;
}

/* Target Metric Cards */
.target-card {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid rgba(8, 26, 62, 0.08);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.target-progress-ring {
  position: relative;
  width: 48px;
  height: 48px;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL DIALOG SYSTEM (Bootstrap 5.3 + Custom Polish)
   ═══════════════════════════════════════════════════════════════ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.fade .modal-dialog {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  transform: scale(0.96) translateY(-10px);
  opacity: 0;
}

.modal.show .modal-dialog {
  transform: none;
  opacity: 1;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background-color: rgba(11, 25, 44, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop.fade {
  opacity: 0;
  transition: opacity 0.2s linear;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  pointer-events: none;
  max-width: 520px;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #FFFFFF;
  background-clip: padding-box;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 14px;
  outline: 0;
  box-shadow: 0 20px 40px -15px rgba(8, 26, 62, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid #E2E8F0;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  background: #F8FAFC;
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.4;
  font-size: 16px;
  font-weight: 800;
  color: #0B192C;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 22px;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid #E2E8F0;
  border-bottom-right-radius: 14px;
  border-bottom-left-radius: 14px;
  background: #F8FAFC;
  gap: 10px;
}

.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: .25em .25em;
  color: #64748B;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748B'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: .375rem;
  opacity: .6;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-close:hover {
  opacity: 1;
}

.btn-close:focus {
  outline: 0;
  box-shadow: 0 0 0 .25rem rgba(0, 116, 255, .25);
  opacity: 1;
}

/* Leads & Reports Export Dropdown */
.leads-export-dropdown {
  position: relative;
  display: inline-block;
}

.leads-export-link {
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.leads-export-link:hover {
  background: #F1F5F9 !important;
  transform: translateX(2px);
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL TABLE ENHANCEMENTS (Actions Dropdown, Copy, Long-Press)
   ═══════════════════════════════════════════════════════════════ */

/* Action Button Group */
.action-btn-group,
.crm-actions-group,
.task-actions-group,
.sitevisit-actions-group,
.proj-actions-group,
.role-actions-group,
.entity-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  position: relative;
  flex-wrap: nowrap;
}

.table-action-btn,
.entity-action-btn,
.task-action-btn,
.sitevisit-action-btn,
.proj-action-btn,
.role-action-btn,
.user-action-btn {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(8, 26, 62, 0.1);
  background: #F8FAFC;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  padding: 0;
  box-sizing: border-box;
}

.table-action-btn:hover,
.entity-action-btn:hover,
.task-action-btn:hover,
.sitevisit-action-btn:hover,
.proj-action-btn:hover,
.role-action-btn:hover,
.user-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.table-action-btn.view:hover,
.entity-action-btn.view:hover,
.task-action-btn.view:hover,
.sitevisit-action-btn.view:hover,
.proj-action-btn.view:hover,
.role-action-btn.view:hover,
.user-action-btn.view:hover {
  background: #0074FF !important;
  color: #ffffff !important;
  border-color: #0074FF !important;
}

.table-action-btn.more-btn:hover,
.entity-action-btn.more-btn:hover,
.task-action-btn.more-btn:hover,
.sitevisit-action-btn.more-btn:hover,
.proj-action-btn.more-btn:hover,
.role-action-btn.more-btn:hover,
.user-action-btn.more-btn:hover {
  background: #0B192C !important;
  color: #ffffff !important;
  border-color: #0B192C !important;
}

/* Dropdown Container */
.crm-actions-dropdown,
.entity-actions-dropdown,
.task-actions-dropdown,
.sitevisit-actions-dropdown,
.proj-actions-dropdown,
.role-actions-dropdown,
.user-actions-dropdown {
  position: relative;
  display: inline-block;
}

.crm-action-popup-menu,
.entity-action-popup-menu,
.lead-action-popup-menu,
.fr-action-popup-menu,
.task-action-popup-menu,
.sitevisit-action-popup-menu,
.proj-action-popup-menu,
.role-action-popup-menu,
.user-action-popup-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  bottom: auto;
  right: 0;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid rgba(8, 26, 62, 0.12);
  box-shadow: 0 10px 30px -5px rgba(8, 26, 62, 0.18), 0 4px 12px rgba(0, 0, 0, 0.06);
  min-width: 175px;
  z-index: 1000;
  padding: 5px;
  text-align: left;
  transform-origin: top right;
  animation: crmMenuPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-action-popup-menu.show,
.entity-action-popup-menu.show,
.lead-action-popup-menu.show,
.fr-action-popup-menu.show,
.task-action-popup-menu.show,
.sitevisit-action-popup-menu.show,
.proj-action-popup-menu.show,
.role-action-popup-menu.show,
.user-action-popup-menu.show {
  display: block;
}

/* Smart upward flip class applied dynamically by JS when needed (never on low data / top rows) */
.crm-action-popup-menu.drop-up,
.entity-action-popup-menu.drop-up,
.lead-action-popup-menu.drop-up,
.fr-action-popup-menu.drop-up,
.task-action-popup-menu.drop-up,
.sitevisit-action-popup-menu.drop-up,
.proj-action-popup-menu.drop-up,
.role-action-popup-menu.drop-up,
.user-action-popup-menu.drop-up {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom right;
}

@keyframes crmMenuPop {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Popup Items */
.crm-popup-item,
.entity-popup-item,
.task-popup-item,
.sitevisit-popup-item,
.proj-popup-item,
.role-popup-item,
.user-popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.12s ease;
  box-sizing: border-box;
  text-align: left;
}

.crm-popup-item:hover,
.entity-popup-item:hover,
.task-popup-item:hover,
.sitevisit-popup-item:hover,
.proj-popup-item:hover,
.role-popup-item:hover,
.user-popup-item:hover {
  background: #F1F5F9;
  color: #0B192C;
}

.crm-popup-item.danger,
.entity-popup-item.danger,
.task-popup-item.danger,
.sitevisit-popup-item.danger,
.proj-popup-item.danger,
.role-popup-item.danger,
.user-popup-item.danger {
  color: #DC2626;
}

.crm-popup-item.danger:hover,
.entity-popup-item.danger:hover,
.task-popup-item.danger:hover,
.sitevisit-popup-item.danger:hover,
.proj-popup-item.danger:hover,
.role-popup-item.danger:hover,
.user-popup-item.danger:hover {
  background: #FEE2E2;
  color: #B91C1C;
}

/* Copy Hover Button & Toast */
.copy-hover-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.copy-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #94A3B8;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.15s ease;
  padding: 0;
  margin-left: 2px;
}

.copy-hover-wrap:hover .copy-icon-btn,
.copy-icon-btn:hover {
  opacity: 1;
  color: #0074FF;
  background: rgba(0, 116, 255, 0.1);
}

.crm-copy-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #081A3E;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(8, 26, 62, 0.25);
  z-index: 10000;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

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

/* Centered Placeholder Dashes */
.crm-dash-center {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-muted, #94A3B8);
}

/* Table Sliding / Panning State */
.is-sliding {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.is-sliding * {
  cursor: grabbing !important;
  user-select: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL CRM IDENTIFIER BADGES & WRAPPERS (STRICT ONE-LINE NO-WRAP)
   ═══════════════════════════════════════════════════════════════ */
.lead-id-badge,
.fr-id-badge,
.cust-id-badge,
.id-code-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 9px !important;
  border-radius: 7px !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.3px !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  -webkit-hyphens: none !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

.lead-id-badge span,
.fr-id-badge span,
.cust-id-badge span,
.id-code-badge span,
.lead-id-badge *,
.fr-id-badge *,
.cust-id-badge *,
.id-code-badge * {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  -webkit-hyphens: none !important;
  flex-shrink: 0 !important;
}

.copy-hover-wrap {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  flex-shrink: 0 !important;
}

.copy-hover-wrap * {
  white-space: nowrap !important;
}