/**
 * NOVACREST HOMES LIMITED — Executive Admin & CMS Stylesheet
 */

:root {
  --admin-bg: #0c1219;
  --admin-surface: #141d28;
  --admin-surface-card: #192432;
  --admin-surface-hover: #202d3e;
  --admin-border: rgba(255, 255, 255, 0.09);
  --admin-border-focus: rgba(197, 160, 89, 0.4);
  --admin-crimson: #842d45;
  --admin-crimson-hover: #9c3653;
  --admin-gold: #c5a059;
  --admin-gold-hover: #d6b26d;
  --admin-gold-glow: rgba(197, 160, 89, 0.15);
  --admin-text-main: #f3f6f9;
  --admin-text-muted: #8a9ba8;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
  --admin-info: #3b82f6;
  --admin-radius: 8px;
  --admin-sidebar-width: 260px;
  --admin-sidebar-width-collapsed: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.admin-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==========================================================================
   Login Page Aesthetic
   ========================================================================== */
body.login-body {
  background: radial-gradient(circle at 50% 20%, #1c2736 0%, #0c1219 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(197, 160, 89, 0.1);
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--admin-crimson), var(--admin-gold), var(--admin-crimson));
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-brand-logo {
  height: 46px;
  margin-bottom: 16px;
  object-fit: contain;
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--admin-text-main);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--admin-text-muted);
}

.login-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
  display: none;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--admin-text-main);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  color: var(--admin-text-main);
  padding: 11px 14px;
  font-size: 13.5px;
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  border-color: var(--admin-gold);
  box-shadow: 0 0 0 3px var(--admin-gold-glow);
  background: #1e2a39;
}

.form-hint {
  font-size: 12px;
  color: var(--admin-text-muted);
  margin-top: 5px;
}

.form-checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--admin-text-muted);
}

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

.btn-admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-admin-primary {
  background: linear-gradient(135deg, var(--admin-crimson), #9a3551);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(132, 45, 69, 0.4);
}

.btn-admin-primary:hover {
  background: linear-gradient(135deg, #96334e, #ad3c5b);
  box-shadow: 0 6px 18px rgba(132, 45, 69, 0.5);
  transform: translateY(-1px);
}

.btn-admin-gold {
  background: linear-gradient(135deg, var(--admin-gold), #b89146);
  color: #0c1219;
  font-weight: 600;
}

.btn-admin-gold:hover {
  background: linear-gradient(135deg, #d6b26d, #c5a059);
  box-shadow: 0 4px 14px rgba(197, 160, 89, 0.3);
}

.btn-admin-secondary {
  background: var(--admin-surface-card);
  color: var(--admin-text-main);
  border: 1px solid var(--admin-border);
}

.btn-admin-secondary:hover {
  background: var(--admin-surface-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-admin-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-admin-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-admin-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
}

.login-demo-helper {
  margin-top: 25px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--admin-border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--admin-text-muted);
}

.login-demo-helper strong {
  color: var(--admin-gold);
}

/* ==========================================================================
   Admin Dashboard Layout
   ========================================================================== */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
  overflow: hidden;
}

.sidebar-brand {
  padding: 22px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-img {
  height: 34px;
  object-fit: contain;
}

.sidebar-brand-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-gold);
  background: rgba(197, 160, 89, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

.sidebar-nav {
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-text-muted);
  padding: 12px 12px 6px;
  font-weight: 700;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--admin-text-muted);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.admin-nav-item:hover {
  color: var(--admin-text-main);
  background: var(--admin-surface-hover);
}

.admin-nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(132, 45, 69, 0.35), rgba(132, 45, 69, 0.1));
  border-left: 3px solid var(--admin-crimson);
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
  flex-shrink: 0;
}

.admin-nav-item.active svg {
  opacity: 1;
  color: var(--admin-gold);
}

.admin-sidebar-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--admin-crimson), var(--admin-gold));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-main);
  line-height: 1.2;
}

.admin-user-role {
  font-size: 11px;
  color: var(--admin-gold);
}

.admin-logout-btn {
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: color 0.2s;
}

.admin-logout-btn:hover {
  color: #f87171;
}

/* Main Content Workspace */
.admin-main-wrapper {
  margin-left: var(--admin-sidebar-width);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Collapsible Sidebar States
   ========================================================================== */
body.sidebar-collapsed .admin-sidebar {
  width: var(--admin-sidebar-width-collapsed);
}

body.sidebar-collapsed .admin-main-wrapper {
  margin-left: var(--admin-sidebar-width-collapsed);
}

body.sidebar-collapsed .sidebar-brand {
  padding: 18px 12px;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-logo-img {
  height: 26px;
}

body.sidebar-collapsed .sidebar-brand-badge,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .admin-nav-item span,
body.sidebar-collapsed .admin-user-name,
body.sidebar-collapsed .admin-user-role {
  display: none !important;
}

body.sidebar-collapsed .admin-nav-item {
  padding: 12px 0;
  justify-content: center;
  gap: 0;
}

body.sidebar-collapsed .admin-nav-item svg {
  width: 20px;
  height: 20px;
}

body.sidebar-collapsed .admin-sidebar-footer {
  padding: 14px 6px;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

body.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

/* Sidebar Collapse Toggle Button */
.sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 12px;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  color: var(--admin-gold);
  border-color: var(--admin-gold);
  background: var(--admin-surface-hover);
}

.sidebar-collapse-btn svg {
  transition: transform 0.25s ease;
}

.admin-topbar {
  height: 65px;
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--admin-text-main);
  cursor: pointer;
  padding: 6px;
}

.topbar-page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--admin-text-main);
}

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

.admin-content-area {
  padding: 30px;
  flex-grow: 1;
}

/* Tab Panels */
.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

/* ==========================================================================
   Stat & KPI Metric Cards
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--admin-gold);
}

.stat-card.crimson::after {
  background: var(--admin-crimson);
}

.stat-card.success::after {
  background: var(--admin-success);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--admin-text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-gold);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-footer {
  font-size: 11.5px;
  color: var(--admin-text-muted);
}

/* ==========================================================================
   Data Tables & Content Panels
   ========================================================================== */
.content-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  margin-bottom: 30px;
  overflow: hidden;
}

.content-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.content-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.card-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-search-input {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-main);
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 5px;
  outline: none;
  min-width: 220px;
}

.table-search-input:focus {
  border-color: var(--admin-gold);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--admin-text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 12px 20px;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-text-main);
  font-size: 13.5px;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: var(--admin-surface-hover);
}

.table-thumb {
  width: 48px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
}

.table-title-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.table-title-text {
  font-weight: 600;
  color: #ffffff;
  display: block;
}

.table-meta-sub {
  font-size: 12px;
  color: var(--admin-text-muted);
}

.table-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.table-badge-legal {
  background: rgba(132, 45, 69, 0.2);
  color: #f87171;
  border: 1px solid rgba(132, 45, 69, 0.4);
}

.table-badge-forecast {
  background: rgba(197, 160, 89, 0.2);
  color: var(--admin-gold);
  border: 1px solid rgba(197, 160, 89, 0.4);
}

.table-badge-diaspora {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.table-badge-investment {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.table-actions-cell {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Modals (Article Editor & Property Editor)
   ========================================================================== */
.admin-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.admin-modal-backdrop.active {
  display: flex;
}

.admin-modal-dialog {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

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

.admin-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #ffffff;
}

.admin-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.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-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 16px;
}

.admin-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* Toast Notifications */
.admin-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-toast {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-left: 4px solid var(--admin-gold);
  border-radius: 6px;
  padding: 14px 20px;
  color: #ffffff;
  font-size: 13.5px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease;
}

.admin-toast.success {
  border-left-color: var(--admin-success);
}

.admin-toast.error {
  border-left-color: var(--admin-danger);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

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

  .admin-main-wrapper {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: block;
  }

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

/* ==========================================================================
   Properties: List / Grid View Toggle
   ========================================================================== */
.prop-view-toggle {
  display: flex;
  align-items: center;
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  overflow: hidden;
}

.prop-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.prop-toggle-btn + .prop-toggle-btn {
  border-left: 1px solid var(--admin-border);
}

.prop-toggle-btn:hover {
  color: var(--admin-text-main);
  background: var(--admin-surface-hover);
}

.prop-toggle-btn.active {
  background: linear-gradient(135deg, rgba(132, 45, 69, 0.35), rgba(132, 45, 69, 0.15));
  color: #ffffff;
}

.prop-toggle-btn svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Properties: Grid Card Layout
   ========================================================================== */
.prop-grid-container {
  padding: 24px;
}

.prop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.prop-card {
  background: var(--admin-surface-card);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.prop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  border-color: rgba(197, 160, 89, 0.25);
}

.prop-card-image {
  width: 100%;
  height: 165px;
  object-fit: cover;
  display: block;
  background: var(--admin-surface);
}

.prop-card-body {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prop-card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.prop-card-name {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.prop-card-district {
  font-size: 12px;
  color: var(--admin-text-muted);
  margin-top: 2px;
}

.prop-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-gold);
  margin-top: 2px;
}

.prop-card-price-usd {
  font-size: 11.5px;
  color: var(--admin-text-muted);
  font-weight: 400;
}

.prop-card-specs {
  font-size: 12px;
  color: var(--admin-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.prop-card-spec-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--admin-text-muted);
  flex-shrink: 0;
}

.prop-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--admin-border);
  background: rgba(0,0,0,0.12);
  margin-top: auto;
}

.prop-card-actions .btn-admin {
  flex: 1;
  justify-content: center;
}

@media (max-width: 600px) {
  .prop-grid {
    grid-template-columns: 1fr;
  }

  .prop-toggle-btn span {
    display: none;
  }
}

/* ==========================================================================
   AI CRM & Sales Pipeline Studio Styles
   ========================================================================== */
.crm-header-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.crm-view-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.crm-btn-group {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 3px;
}

.crm-btn-group button {
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-btn-group button.active {
  background: var(--admin-gold);
  color: #0b0f17;
  box-shadow: 0 2px 8px rgba(201, 157, 66, 0.3);
}

.crm-kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(270px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

@media (max-width: 1400px) {
  .crm-kanban-board {
    grid-template-columns: repeat(5, 280px);
  }
}

.kanban-column {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: 800px;
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px 12px 0 0;
}

.kanban-col-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-count-pill {
  background: rgba(201, 157, 66, 0.2);
  color: var(--admin-gold);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.kanban-col-value {
  font-size: 11px;
  color: var(--admin-text-muted);
  text-align: right;
}

.kanban-cards-container {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 200px;
}

.kanban-card {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--admin-gold);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.lead-name-text {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.risk-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.risk-pill.low {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.risk-pill.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.risk-pill.high {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.lead-interest-badge {
  font-size: 11.5px;
  color: var(--admin-gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.lead-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--admin-text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  margin-top: 8px;
}

.score-badge {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.card-actions-strip {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* Slide-over CRM Drawer */
.crm-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.crm-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.crm-drawer {
  position: fixed;
  top: 0;
  right: -540px;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  background: #0f172a;
  border-left: 1px solid var(--admin-border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  z-index: 1001;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.crm-drawer-backdrop.active .crm-drawer {
  right: 0;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.drawer-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
