/* CPM Dashboard — Design System & Layout
   shadcn-inspired premium dark theme (Zinc/Black) */

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

:root {
  /* Shadcn Slate/Zinc Dark Palette */
  --bg-primary: #000000;     /* Pure solid black */
  --bg-secondary: #09090b;   /* Zinc-950 */
  --bg-tertiary: #18181b;    /* Zinc-900 */
  --bg-elevated: #18181b;    /* Zinc-900 for Dropdowns & Modals */
  
  --bg-card: #09090b;        /* Zinc-950 for cards/panels */
  --bg-card-hover: #18181b;  /* Zinc-900 hover background */

  --surface: rgba(255, 255, 255, 0.02);
  --surface-hover: rgba(255, 255, 255, 0.04);
  --surface-active: rgba(255, 255, 255, 0.07);

  /* Clean Borders */
  --border: rgba(255, 255, 255, 0.08);      /* Slightly higher contrast */
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-muted: rgba(255, 255, 255, 0.04);
  --border-accent: rgba(59, 130, 246, 0.3); /* sky/blue */

  /* Text Hierarchy */
  --text-primary: #fafafa;   /* Zinc-50 */
  --text-secondary: #a1a1aa; /* Zinc-400 */
  --text-tertiary: #71717a;  /* Zinc-500 */
  --text-muted: #52525b;     /* Zinc-600 */

  /* Premium Accents */
  --accent: #3b82f6;          /* Sky Blue/Royal Blue */
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.08);
  --accent-glow: rgba(59, 130, 246, 0.15);

  /* Status Colors */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.08);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.08);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.08);
  --info: #06b6d4;
  --info-soft: rgba(6, 182, 212, 0.08);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;

  /* Sizing */
  --sidebar-w: 260px;
  --header-h: 64px;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.8);
  
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 220ms;
  --duration-slow: 350ms;
}

html, body, #app {
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary);
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}
a:hover {
  color: var(--accent);
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

input, select, textarea {
  font-family: var(--font);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Vector SVG Icons Styling --- */
.icon-svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Global Brand Logo Badge */
.logo {
  width: 42px;
  height: 28px;
  background: #fafafa;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  color: #09090b;
  flex-shrink: 0;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-in {
  animation: fadeIn var(--duration-slow) var(--ease-out) both;
}
.animate-in-delay-1 { animation-delay: 60ms; }
.animate-in-delay-2 { animation-delay: 120ms; }
.animate-in-delay-3 { animation-delay: 180ms; }
.animate-in-delay-4 { animation-delay: 240ms; }
.animate-in-delay-5 { animation-delay: 300ms; }
.animate-in-delay-6 { animation-delay: 360ms; }

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #000000; /* Pure black backdrop */
}
.login-card {
  background: #09090b;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
  animation: scaleIn var(--duration-slow) var(--ease-out);
}
.login-card h1 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
}
.login-card .subtitle {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-bottom: 28px;
  text-align: center;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.login-brand span {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* (Form elements defined in unified section below) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: #fafafa;
  color: #09090b;
  width: 100%;
  padding: 10px 16px;
}
.btn-primary:hover {
  background: #eaeaea;
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--surface-active);
  border-color: var(--border-hover);
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* --- Dashboard Layout --- */
.dashboard {
  display: flex;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: #09090b;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform var(--duration-base) var(--ease);
  height: 100%;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--header-h);
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}
.sidebar-brand span {
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}
.sidebar-section {
  margin-bottom: 16px;
}
.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 6px 12px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  width: 100%;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 450;
  transition: all var(--duration-fast) var(--ease);
  text-align: left;
  cursor: pointer;
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.sidebar-link.active {
  color: var(--text-primary);
  background: var(--surface-active);
  font-weight: 500;
}
.sidebar-link .icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.sidebar-link.active .icon {
  opacity: 1;
  color: var(--text-primary);
}
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

/* User profile card in sidebar bottom */
.sidebar-profile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-profile-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-profile-role {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

/* Main Area */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #000000;
}

/* Header */
.header {
  height: var(--header-h);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: static;
  z-index: 30;
  padding: 0;
  flex-shrink: 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  height: 100%;
  padding: 0 32px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Context Switcher */
.context-switcher {
  position: relative;
}
.context-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: #09090b;
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease);
}
.context-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}
.context-badge {
  font-size: 0.625rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.context-badge.global { background: var(--accent-soft); color: var(--accent); }
.context-badge.directory { background: var(--success-soft); color: var(--success); }
.context-badge.agency { background: var(--warning-soft); color: var(--warning); }

.header-icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
  position: relative;
  border: 1px solid transparent;
}
.header-icon-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
  border-color: var(--border);
}
.notification-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 6px; height: 6px;
  background: var(--danger);
  border-radius: 50%;
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-active);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.user-avatar:hover {
  border-color: var(--text-secondary);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.breadcrumbs span {
  color: var(--text-tertiary);
}
.breadcrumbs .active-crumb {
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Content Area --- */
.content-scroll-container {
  flex: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
  width: 100%;
  min-height: 0;
}
.content {
  padding: 32px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}
.page-header {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.page-header-info h1 {
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.page-header-info p {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-top: 4px;
}

/* --- Cards & Panels --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--duration-base) var(--ease), background-color var(--duration-base) var(--ease);
}
.card:hover {
  border-color: var(--border-hover);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--duration-base) var(--ease);
  position: relative;
  display: flex;
  flex-direction: column;
}
.kpi-card:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
}
.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-badge {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-badge.color-1 { background: rgba(236, 72, 153, 0.08); color: #ec4899; }
.kpi-badge.color-2 { background: rgba(14, 165, 233, 0.08); color: #0ea5e9; }
.kpi-badge.color-3 { background: rgba(139, 92, 246, 0.08); color: #8b5cf6; }
.kpi-badge.color-4 { background: rgba(245, 158, 11, 0.08); color: #f59e0b; }
.kpi-badge.color-5 { background: rgba(6, 182, 212, 0.08); color: #06b6d4; }
.kpi-badge.color-6 { background: rgba(16, 185, 129, 0.08); color: #10b981; }

.kpi-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.kpi-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
.kpi-value {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
}
.kpi-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.kpi-change {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}
.kpi-change.up { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-change.neutral { color: var(--text-tertiary); }

.kpi-sparkline {
  width: 50px;
  height: 20px;
  margin-top: 4px;
}

/* --- Inline Dashboard Charts --- */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* Custom Chart: Leads activity bar chart */
.chart-box {
  display: flex;
  flex-direction: column;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.chart-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}
.chart-legends {
  display: flex;
  gap: 16px;
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.chart-legend-color {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.chart-body {
  flex: 1;
  display: flex;
  gap: 16px;
  height: 220px;
  align-items: flex-end;
  position: relative;
  padding-bottom: 20px;
}
.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100% - 20px);
  padding-right: 12px;
  border-right: 1px solid var(--border-muted);
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.chart-grid-cols {
  flex: 1;
  display: flex;
  justify-content: space-around;
  height: 100%;
}
.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  width: 48px;
  position: relative;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: calc(100% - 20px);
  width: 100%;
  justify-content: center;
}
.chart-bar-val {
  width: 10px;
  border-radius: 4px 4px 0 0;
  transition: all var(--duration-slow) var(--ease);
  position: relative;
  cursor: pointer;
}
.chart-bar-val.primary {
  background: var(--accent);
}
.chart-bar-val.secondary {
  background: rgba(255, 255, 255, 0.08);
}
.chart-bar-val:hover {
  filter: brightness(1.2);
}
.chart-bar-val.active-highlight {
  background: #3b82f6 !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}
.chart-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  margin-top: 8px;
}
.chart-tooltip {
  position: absolute;
  bottom: 80px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  animation: scaleIn var(--duration-fast) var(--ease-out);
}
.chart-tooltip-header {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.chart-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
}

/* Donut Activity Chart */
.radial-box {
  display: flex;
  flex-direction: column;
}
.radial-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px 0;
}
.radial-svg-wrapper {
  position: relative;
  width: 140px; height: 140px;
}
.radial-svg circle {
  transition: stroke-dashoffset var(--duration-base) var(--ease), stroke-width var(--duration-fast) var(--ease), stroke var(--duration-fast) var(--ease);
}
.radial-label-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.radial-label-val {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.radial-label-sub {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.radial-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.radial-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}
.radial-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
.radial-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.radial-item-val {
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Top properties/sites rows */
.properties-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.property-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.property-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}
.property-row-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.property-row-logo {
  width: 18px; height: 18px;
  border-radius: 4px;
  background: var(--surface-active);
  font-size: 0.625rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.property-row-name {
  font-weight: 500;
  color: var(--text-primary);
}
.property-row-stats {
  color: var(--text-secondary);
}
.property-progress {
  height: 4px;
  width: 100%;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
}
.property-progress-bar {
  height: 100%;
  border-radius: 2px;
}

/* --- Recent Transactions / Activity Table --- */
.table-section {
  margin-top: 16px;
}
.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.table-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-count-badge {
  font-size: 0.6875rem;
  background: var(--surface-active);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 500;
}
.table-actions {
  display: flex;
  gap: 8px;
}
.table-search-wrapper {
  position: relative;
}
.table-search-input {
  background: #09090b;
  border: 1px solid var(--border);
  padding: 6px 10px 6px 28px;
  font-size: 0.75rem;
  color: var(--text-primary);
  border-radius: var(--radius-md);
  outline: none;
  width: 180px;
  transition: all var(--duration-fast) var(--ease);
}
.table-search-input:focus {
  border-color: var(--text-tertiary);
  width: 220px;
}
.table-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.table-search-icon svg {
  width: 12px;
  height: 12px;
}
.table-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: #09090b;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
}
.table-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}
.data-table th {
  padding: 12px 16px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-muted);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* Custom Table Row UI Elements */
.cell-property {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cell-logo-sq {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-active);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 0.75rem; color: var(--text-primary);
}
.cell-prop-details {
  display: flex;
  flex-direction: column;
}
.cell-prop-name {
  font-weight: 500;
  color: var(--text-primary);
}
.cell-prop-niche {
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}
.cell-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}
.cell-status-badge.approved { background: var(--success-soft); color: var(--success); }
.cell-status-badge.pending { background: var(--warning-soft); color: var(--warning); }
.cell-status-badge.failed { background: var(--danger-soft); color: var(--danger); }
.cell-status-badge.active { background: var(--accent-soft); color: var(--accent); }

.cell-customer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cell-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-active);
  font-size: 0.6875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}
.cell-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

/* --- Dropdown Menus --- */
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  animation: scaleIn var(--duration-fast) var(--ease-out);
  z-index: 50;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  transition: all var(--duration-fast) var(--ease);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

/* --- Mobile Hamburger --- */
.mobile-menu-btn {
  display: none;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 35;
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}
.empty-state .icon {
  font-size: 2rem;
  margin-bottom: 10px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 0.8125rem;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--duration-base) var(--ease);
}
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  margin: 16px;
  animation: slideUp var(--duration-base) var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-primary);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.375rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color var(--duration-fast) var(--ease);
}
.modal-close:hover {
  color: var(--text-primary);
}
#property-form,
#profile-form,
#password-form {
  padding: 20px 24px 24px;
}

/* --- Form Elements (Unified) --- */
.form-group {
  margin-bottom: 18px;
}
.form-group label,
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}
.form-input:hover,
.form-select:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}
.form-input:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 12px -2px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.04);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.form-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.8125rem;
}
.form-success {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-md);
  color: var(--success);
  font-size: 0.8125rem;
}

/* --- Type Badges --- */
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 9999px;
  color: var(--badge-color, var(--text-secondary));
  background: color-mix(in srgb, var(--badge-color, var(--text-secondary)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color, var(--text-secondary)) 20%, transparent);
}

/* --- Filter Chips --- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-chip {
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  font-family: inherit;
}
.filter-chip:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.filter-chip.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* --- Table Row Actions --- */
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
}
.action-btn .icon-svg {
  width: 15px;
  height: 15px;
}
.action-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border);
  color: var(--action-hover, var(--text-primary));
}

/* --- Domain Links --- */
.domain-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color var(--duration-fast) var(--ease);
}
.domain-link:hover {
  color: var(--accent);
}
.domain-link .icon-svg {
  width: 12px;
  height: 12px;
}

/* --- Toast Notifications --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--duration-base) var(--ease), transform var(--duration-base) var(--ease);
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.toast-success {
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}
.toast-error {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* --- Settings Grid --- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
}
.settings-card {
  padding: 0;
}
.settings-card-header {
  padding: 20px 24px 0;
}
.settings-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.role-display {
  padding: 9px 0;
}

/* --- Empty State (additions) --- */
.empty-state-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.empty-state-icon .icon-svg {
  width: 48px;
  height: 48px;
}

/* --- Animations --- */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.visible {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .header {
    padding: 0;
  }
  .header-inner {
    padding: 0 20px;
  }
  .content {
    padding: 20px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .page-header-info {
    width: 100%;
  }
  .table-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    margin: 16px;
    padding: 32px 24px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-value {
    font-size: 1.375rem;
  }
  .page-header h1 {
    font-size: 1.25rem;
  }
  .table-actions {
    display: none; /* Hide actions in very small widths */
  }
}
