/* GSM-CRM Design System - "Midnight" Theme */

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Colors */
  --bg-app: hsl(224, 45%, 5%);
  --bg-sidebar: hsla(224, 40%, 8%, 0.7);
  --bg-card: hsla(224, 30%, 12%, 0.45);
  --bg-card-hover: hsla(224, 30%, 18%, 0.6);
  --border-color: hsla(224, 20%, 25%, 0.2);
  --border-color-glow: hsla(255, 85%, 65%, 0.45);
  
  --text-primary: hsl(210, 40%, 96%);
  --text-secondary: hsl(215, 20%, 65%);
  --text-muted: hsl(215, 12%, 45%);

  /* Accents */
  --accent-purple: hsl(258, 85%, 66%);
  --accent-purple-glow: hsla(258, 85%, 66%, 0.3);
  --accent-blue: hsl(207, 90%, 54%);
  --accent-blue-glow: hsla(207, 90%, 54%, 0.3);
  --accent-green: hsl(158, 85%, 42%);
  --accent-green-glow: hsla(158, 85%, 42%, 0.3);
  --accent-gold: hsl(43, 90%, 50%);
  --accent-gold-glow: hsla(43, 90%, 50%, 0.3);
  --accent-rose: hsl(342, 85%, 58%);
  --accent-rose-glow: hsla(342, 85%, 58%, 0.3);

  --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 20px rgba(108, 93, 211, 0.2);
}

/* Reset & Global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient glow backgrounds */
.ambient-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.25;
}

.glow-1 {
  top: -100px;
  left: 20%;
  background-color: var(--accent-purple);
}

.glow-2 {
  bottom: -100px;
  right: 15%;
  background-color: var(--accent-blue);
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar styling */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding: 0 8px;
}

.brand-logo {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(108, 93, 211, 0.4);
}

.brand-icon {
  width: 22px;
  height: 22px;
  color: white;
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-body);
}

.menu-item:hover {
  background-color: hsla(224, 30%, 15%, 0.4);
  color: var(--text-primary);
}

.menu-item.active {
  background: linear-gradient(90deg, hsla(258, 85%, 66%, 0.15), hsla(207, 90%, 54%, 0.05));
  color: var(--text-primary);
  border-left: 3px solid var(--accent-purple);
  box-shadow: inset 0 0 10px rgba(108, 93, 211, 0.05);
}

.menu-item i {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 16px 8px 0;
  border-top: 1px solid var(--border-color);
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-dot.green {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-details {
  display: flex;
  flex-direction: column;
}

.status-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.status-value {
  font-size: 12px;
  font-weight: 600;
}

/* Main Content Area */
.main-content {
  margin-left: 280px;
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Header */
.top-header {
  height: 80px;
  background-color: rgba(6, 9, 20, 0.4);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  width: 320px;
  transition: all 0.3s ease;
}

.header-search:focus-within {
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow);
  background-color: rgba(255, 255, 255, 0.07);
}

.header-search i {
  color: var(--text-secondary);
  width: 16px;
  height: 16px;
}

.header-search input {
  background: none;
  border: none;
  color: var(--text-primary);
  outline: none;
  font-size: 14px;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.divider {
  width: 1px;
  height: 32px;
  background-color: var(--border-color);
}

.tenant-selector-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 6px;
  backdrop-filter: blur(10px);
  margin-right: 12px;
  transition: all 0.3s ease;
}
.tenant-selector-container:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.tenant-selector-container select {
  background: transparent;
  border: none;
  color: var(--text-color, #ffffff);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  padding-right: 16px;
}
.tenant-selector-container select option {
  background: #1e1e2e;
  color: #cdd6f4;
}
.tenant-icon {
  width: 16px;
  height: 16px;
  color: #89b4fa;
}

.tenant-readonly-indicator {
  font-size: 11px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f38ba8;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
}

.readonly-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-primary);
  font-weight: 500;
  cursor: default;
  text-decoration: none;
}


.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 13px;
  font-weight: 600;
}

.profile-role {
  font-size: 10px;
  color: var(--text-secondary);
}

/* Button UI */
.btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: white;
  box-shadow: 0 4px 14px rgba(108, 93, 211, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108, 93, 211, 0.45);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: var(--text-secondary);
}

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

.btn-block {
  width: 100%;
  justify-content: center;
}

.glow-button {
  position: relative;
  overflow: hidden;
}

.glow-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
}

.glow-button:hover::after {
  left: 120%;
}

/* View Wrapper & Transitions */
.view-wrapper {
  padding: 32px;
  flex-grow: 1;
  position: relative;
}

.tab-view {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.tab-view.active {
  display: block;
}

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

/* Cards & Glassmorphism */
.glass {
  background-color: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-main);
  transition: all 0.3s ease;
}

.glass:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

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

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  padding: 24px;
}

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

.metric-title {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.metric-icon i {
  width: 16px;
  height: 16px;
}

.metric-icon.purple { background-color: var(--accent-purple-glow); color: var(--accent-purple); }
.metric-icon.blue { background-color: var(--accent-blue-glow); color: var(--accent-blue); }
.metric-icon.green { background-color: var(--accent-green-glow); color: var(--accent-green); }
.metric-icon.gold { background-color: var(--accent-gold-glow); color: var(--accent-gold); }

.metric-body h3 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.metric-change.positive { color: var(--accent-green); }
.metric-change.negative { color: var(--accent-rose); }
.metric-change.neutral { color: var(--text-secondary); }

.metric-change i {
  width: 12px;
  height: 12px;
}

/* Dashboard Split Layout */
.dashboard-split {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
}

.split-left, .split-right {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* Chart Mockup */
.chart-mockup {
  height: 200px;
  display: flex;
  align-items: flex-end;
  margin-bottom: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.bar-chart-stage {
  display: flex;
  justify-content: space-around;
  width: 100%;
  height: 100%;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 12%;
  height: 100%;
  gap: 8px;
}

.bar-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent-purple), var(--accent-blue));
  box-shadow: 0 4px 10px rgba(108, 93, 211, 0.2);
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
}

.quick-actions-panel h3 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Live Badge & Pulses */
.badge {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.engine-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--accent-purple-glow);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--accent-purple);
  font-weight: 600;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-purple);
  border-radius: 50%;
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(108, 93, 211, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(108, 93, 211, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(108, 93, 211, 0);
  }
}

/* Call Stream Items */
.call-log-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 380px;
  padding-right: 4px;
}

.call-stream-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.call-stream-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

.direction-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.direction-icon.inbound {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

.direction-icon.outbound {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}

.call-details {
  flex-grow: 1;
}

.call-caller {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.call-caller h4 {
  font-size: 14px;
  font-weight: 600;
}

.call-time {
  font-size: 10px;
  color: var(--text-muted);
}

.call-phone {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.call-voice-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.voice-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.voice-tag.verified {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.voice-tag.unverified {
  background-color: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.voice-score {
  font-size: 10px;
  color: var(--text-secondary);
}

.score-badge {
  font-weight: 700;
  color: var(--accent-purple);
}

/* Contacts Table View */
.table-container {
  padding: 24px;
}

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

.table-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
}

.table-filters select {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  outline: none;
  font-family: var(--font-body);
}

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

.data-table th, .data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.data-table td {
  font-size: 14px;
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.voice-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.voice-badge.registered {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

.voice-badge.pending {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold);
}

.voice-badge.unregistered {
  background-color: rgba(244, 63, 94, 0.1);
  color: var(--accent-rose);
}

.stage-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.stage-badge.won {
  background-color: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
}

.table-actions-cell {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Kanban Board View */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  min-height: calc(100vh - 200px);
}

.kanban-column {
  background-color: rgba(6, 9, 20, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(10px);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.column-header h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.column-count {
  background-color: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--text-secondary);
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
  overflow-y: auto;
  max-height: 600px;
}

.kanban-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  cursor: grab;
  transition: all 0.2s ease;
}

.kanban-card:hover {
  border-color: var(--text-secondary);
  background-color: var(--bg-card-hover);
  transform: translateY(-2px);
}

.kanban-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.kanban-card-company {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.kanban-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-card-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}

/* Call Stream List Page (Specific layout) */
.calls-page-wrapper {
  padding: 24px;
}

.calls-grid-header {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.5fr 1fr 4fr 1.5fr;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.calls-list-container {
  display: flex;
  flex-direction: column;
  max-height: 600px;
  overflow-y: auto;
}

.call-row {
  display: grid;
  grid-template-columns: 1.5fr 2fr 1.5fr 1fr 4fr 1.5fr;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  font-size: 13px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.call-row:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.call-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.call-row-caller h4 {
  font-weight: 600;
  font-size: 14px;
}

.call-row-caller p {
  color: var(--text-secondary);
  font-size: 11px;
}

.call-row-transcription {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 16px;
}

/* Activities Wrapper */
.activities-wrapper {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

.activity-form-card, .activity-list-card {
  padding: 24px;
}

.activity-form-card h3 {
  font-family: var(--font-heading);
  margin-bottom: 20px;
  font-size: 18px;
}

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

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input, .form-group select {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: 8px;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--accent-purple);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 10px;
}

.activity-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.activity-content p {
  font-size: 12px;
  color: var(--text-secondary);
}

.activity-badge {
  font-size: 10px;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  display: inline-block;
}

.activity-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.activity-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal Dialog System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(3, 5, 12, 0.7);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out forwards;
}

.modal-box {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  padding: 24px 32px;
  position: relative;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-box {
  max-width: 800px;
}

.hidden {
  display: none !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideUp {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
}

.modal-box form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  min-height: 0;
}

.modal-box .call-detail-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 16px;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  flex-shrink: 0;
}

/* Call Detail Content */
.call-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

.detail-pane {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
}

.detail-pane h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.meta-field {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

.meta-field span:first-child {
  color: var(--text-secondary);
}

.meta-field span:last-child {
  font-weight: 500;
}

.call-recording-card {
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--accent-blue) 24%, var(--border-color));
  border-radius: 14px;
  background: var(--bg-secondary);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.call-recording-card[data-playback-state="reviewed"] {
  border-color: color-mix(in srgb, var(--accent-green) 35%, var(--border-color));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07), 0 0 0 3px color-mix(in srgb, var(--accent-green) 7%, transparent);
}

.call-recording-card[data-playback-state="error"] {
  border-color: color-mix(in srgb, var(--accent-rose) 34%, var(--border-color));
}

.call-recording-heading,
.call-recording-title,
.call-recording-footer,
.call-recording-status,
.call-recording-badge {
  display: flex;
  align-items: center;
}

.call-recording-heading {
  justify-content: space-between;
  gap: 16px;
}

.call-recording-title {
  min-width: 0;
  gap: 11px;
}

.call-recording-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--accent-blue);
  background: color-mix(in srgb, var(--accent-blue) 12%, transparent);
}

.call-recording-icon svg { width: 19px; height: 19px; }

.call-recording-eyebrow {
  display: block;
  color: var(--accent-blue);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.call-recording-title h3 {
  margin: 2px 0 1px;
  font-size: 15px;
}

.call-recording-title p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.call-recording-badge {
  flex: 0 0 auto;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--accent-green) 25%, var(--border-color));
  border-radius: 999px;
  color: var(--accent-green);
  background: color-mix(in srgb, var(--accent-green) 7%, var(--bg-secondary));
  font-size: 9px;
  font-weight: 750;
}

.call-recording-badge svg,
.call-recording-status svg,
.call-recording-footer a svg { width: 13px; height: 13px; }

.call-recording-player-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 8px 9px;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-primary) 78%, var(--bg-secondary));
}

.call-recording-player-shell audio {
  width: 100%;
  min-width: 0;
  height: 38px;
}

.call-recording-speed {
  display: grid;
  gap: 3px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.call-recording-speed select {
  width: 70px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
}

.call-recording-footer {
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.call-recording-status {
  gap: 6px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}

.call-recording-status.is-ready { color: var(--accent-blue); }
.call-recording-status.is-reviewed { color: var(--accent-green); }
.call-recording-status.is-error { color: var(--accent-rose); }

.call-recording-status.is-loading svg {
  animation: callRecordingSpin 1s linear infinite;
}

@keyframes callRecordingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.call-recording-footer a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  color: var(--accent-blue);
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .call-recording-heading,
  .call-recording-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .call-recording-player-shell {
    grid-template-columns: 1fr;
  }

  .call-recording-speed {
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: end;
  }
}

.call-association-card {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent-blue) 22%, var(--border-color));
  border-radius: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-blue) 7%, transparent), rgba(255, 255, 255, 0.015));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.call-association-heading,
.call-association-record,
.call-association-control-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.call-association-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}

.call-association-heading h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.call-association-eyebrow,
.call-association-label {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.call-association-method {
  padding: 5px 9px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  font-size: 10px;
  font-weight: 700;
}

.call-association-record {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.call-association-record-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent-green) 13%, transparent);
  color: var(--accent-green);
}

.call-association-record.needs-review .call-association-record-icon {
  background: color-mix(in srgb, var(--accent-amber) 15%, transparent);
  color: var(--accent-amber);
}

.call-association-record strong,
.call-association-create strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.call-association-record small,
.call-association-controls small,
.call-association-create small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.call-association-controls,
.call-association-create {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
}

.call-association-controls label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.call-association-control-row select {
  min-width: 0;
  flex: 1;
}

.call-voiceid-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid color-mix(in srgb, #725cff 25%, var(--border-color));
  border-radius: 11px;
  background: color-mix(in srgb, #725cff 6%, var(--bg-secondary));
}

.call-voiceid-panel.is-complete {
  border-color: color-mix(in srgb, var(--accent-green) 32%, var(--border-color));
  background: color-mix(in srgb, var(--accent-green) 7%, var(--bg-secondary));
}

.call-voiceid-panel.is-pending {
  border-color: color-mix(in srgb, var(--accent-blue) 28%, var(--border-color));
  background: color-mix(in srgb, var(--accent-blue) 6%, var(--bg-secondary));
}

.call-voiceid-panel.is-warning {
  border-color: color-mix(in srgb, var(--accent-amber) 32%, var(--border-color));
  background: color-mix(in srgb, var(--accent-amber) 7%, var(--bg-secondary));
}

.call-voiceid-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #725cff;
  background: color-mix(in srgb, #725cff 13%, transparent);
}

.call-voiceid-panel.is-complete .call-voiceid-icon { color: var(--accent-green); }
.call-voiceid-panel.is-warning .call-voiceid-icon { color: var(--accent-amber); }
.call-voiceid-icon svg { width: 19px; height: 19px; }
.call-voiceid-panel strong { display: block; font-size: 13px; }
.call-voiceid-panel small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

.call-voiceid-copy label,
.call-voiceid-create-approval {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.call-voiceid-copy input,
.call-voiceid-create-approval input {
  margin-top: 1px;
  accent-color: #725cff;
}

.call-shared-phone-note {
  display: flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 8px !important;
  color: var(--accent-blue) !important;
}
.call-shared-phone-note svg { width: 13px; height: 13px; }
.call-association-create-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto;
  gap: 8px;
  margin-top: 9px;
}

@media (max-width: 760px) {
  .call-association-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .call-association-record {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .call-association-record .btn {
    grid-column: 1 / -1;
  }

  .call-association-control-row {
    align-items: stretch;
    flex-direction: column;
  }

  .call-association-create-grid {
    grid-template-columns: 1fr;
  }

  .call-voiceid-panel {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .call-voiceid-panel .btn {
    grid-column: 1 / -1;
  }
}
.voiceprint-verification {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  gap: 12px;
}

.voiceprint-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.voiceprint-ring.success {
  border-color: var(--accent-green);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.voiceprint-ring.failed {
  border-color: var(--accent-rose);
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
}

.voiceprint-ring i {
  width: 40px;
  height: 40px;
}

.voiceprint-ring.success i { color: var(--accent-green); }
.voiceprint-ring.failed i { color: var(--accent-rose); }

.voiceprint-ring.pending i { color: var(--accent-gold); }
.voiceprint-ring.pending { border-color: var(--accent-gold); }

.detail-transcription {
  margin-top: 20px;
}

.transcription-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
}

/* Incoming alert animations */
.incoming-alert {
  position: fixed;
  top: 32px;
  right: 32px;
  width: 320px;
  background-color: hsla(224, 30%, 10%, 0.85);
  backdrop-filter: blur(20px);
  border: 2px solid var(--accent-purple);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(108, 93, 211, 0.4);
  z-index: 300;
  animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.live-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--accent-rose);
  border-radius: 50%;
  animation: blink 0.8s infinite alternate;
}

@keyframes blink {
  from { opacity: 0.2; }
  to { opacity: 1; }
}

.alert-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-rose);
  letter-spacing: 1px;
}

.alert-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.caller-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--accent-purple-glow);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-purple);
  animation: scaleUpDown 1.2s infinite ease-in-out;
}

@keyframes scaleUpDown {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.caller-info h4 {
  font-size: 15px;
  font-weight: 600;
}

.caller-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.voice-check-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.checking-text {
  font-size: 11px;
  color: var(--accent-purple);
  font-weight: 600;
}

.waveform-small {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.waveform-small .bar {
  width: 3px;
  height: 100%;
  background-color: var(--accent-purple);
  border-radius: 1px;
  animation: bounceBar 0.6s infinite alternate;
}

.waveform-small .bar:nth-child(1) { animation-delay: 0.1s; }
.waveform-small .bar:nth-child(2) { animation-delay: 0.3s; }
.waveform-small .bar:nth-child(3) { animation-delay: 0.2s; }
.waveform-small .bar:nth-child(4) { animation-delay: 0.4s; }
.waveform-small .bar:nth-child(5) { animation-delay: 0.15s; }

@keyframes bounceBar {
  from { height: 4px; }
  to { height: 16px; }
}

/* Scrollbar Customization */
::-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);
}

/* Glassmorphic Login Container */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background-color: rgba(3, 5, 12, 0.5);
  backdrop-filter: blur(25px);
  padding: 20px;
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  text-align: center;
  box-sizing: border-box;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background-color: var(--accent-purple-glow);
  color: var(--accent-purple);
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(108, 93, 211, 0.2);
}

.login-logo i {
  width: 32px;
  height: 32px;
}

.login-card h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.login-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.login-card .form-group {
  text-align: left;
  margin-bottom: 20px;
}

.login-status {
  min-height: 20px;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-rose);
  text-align: center;
}

.login-card .btn-primary {
  margin-top: 10px;
}

/* Contact Detail Drawer Styles */
.detail-drawer {
  position: fixed;
  top: 0;
  right: -460px;
  width: 440px;
  height: 100vh;
  z-index: 1000;
  background: rgba(8, 12, 28, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.detail-drawer.open {
  right: 0;
}

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

.drawer-title-area {
  display: flex;
  flex-direction: column;
}

.drawer-title-area h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.drawer-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.drawer-close-btn:hover {
  color: var(--text-primary);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
}

.drawer-section h3 {
  font-family: var(--font-heading);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.drawer-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
}

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

.info-value {
  color: var(--text-primary);
  font-weight: 500;
}

.info-price {
  font-weight: 700;
  color: var(--accent-purple);
}

/* Drawer Notes Styles */
.drawer-notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.note-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.note-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.note-date {
  font-size: 10.5px;
  color: var(--text-muted);
}

.note-actions {
  display: flex;
  gap: 6px;
}

.note-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.note-content {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Related Calls in Drawer */
.drawer-section.calls-section {
  min-height: 230px; /* Reserves room for the entire section card (header + 3 call rows) */
  flex-shrink: 0;    /* Prevents the section panel from compressing on short windows */
  display: flex;
  flex-direction: column;
}

.drawer-calls-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;           /* Allow list to fill the height of the parent calls-section */
}

.drawer-call-item {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.drawer-call-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--text-secondary);
}

.drawer-call-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.drawer-call-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.drawer-call-time {
  font-size: 10px;
  color: var(--text-muted);
}

.drawer-call-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

/* Related Activities in Drawer */
.drawer-activities-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.drawer-activity-item {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

/* Phase 7B Call Sync UI Styles */
.cdrplus-event-row {
  background: rgba(255, 255, 255, 0.015);
  transition: background 0.2s ease;
}
.cdrplus-event-row:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}
.ref-badge {
  font-family: monospace;
  font-size: 10px;
}
.filter-group button.active {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Embedded Mode Override */
body:has(.app-container.embedded) {
  background: transparent !important;
  background-color: transparent !important;
}
.app-container.embedded {
  min-height: 0;
  height: 100vh;
  overflow: hidden;
  background-color: transparent !important;
  background: transparent !important;
}
.app-container.embedded .sidebar {
  display: none !important;
}
.app-container.embedded.contacts-workspace-active .sidebar,
.app-container.embedded.companies-workspace-active .sidebar {
  display: flex !important;
  border-right: 1px solid var(--border-color);
}
.app-container.embedded .top-header {
  display: none !important;
}
.app-container.embedded.contacts-workspace-active .top-header,
.app-container.embedded.companies-workspace-active .top-header {
  display: flex !important;
}
.app-container.embedded .main-content {
  margin-left: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  overflow-y: auto !important;
  background-color: transparent !important;
  background: transparent !important;
}
.app-container.embedded.contacts-workspace-active .main-content,
.app-container.embedded.companies-workspace-active .main-content {
  margin-left: 280px !important;
  width: calc(100% - 280px) !important;
}
.app-container.embedded .view-wrapper {
  padding: 16px !important;
}
.app-container.embedded #view-edit-contact {
  height: calc(100vh - 32px) !important; /* stretch to fill full iframe height */
}
.app-container.embedded .ambient-glow {
  display: none !important;
}

/* Light mode theme overrides */
:root.light {
  --bg-app: #f8fafc;
  --bg-sidebar: rgba(241, 245, 249, 0.85);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(148, 163, 184, 0.2);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-purple-glow: rgba(108, 93, 211, 0.05);
  --accent-blue-glow: rgba(59, 130, 246, 0.05);
}

/* Modal styling in light mode */
:root.light .modal-box.glass {
  background: rgba(255, 255, 255, 0.98) !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

:root.light .modal-header h2 {
  color: #0f172a !important;
}

:root.light .form-group input, 
:root.light .form-group select,
:root.light #contact-company-select {
  background: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.4) !important;
  color: #0f172a !important;
}

:root.light .form-group label {
  color: #475569 !important;
}

:root.light .close-btn {
  color: #64748b !important;
}

:root.light .btn-secondary {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

:root.light .btn-secondary:hover {
  background: #cbd5e1 !important;
}

/* Native select option dropdown visibility overrides */
select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

:root.light select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

/* Add/Edit Contact Workspace Redesign */
#view-edit-contact {
  height: calc(100vh - 120px);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#view-edit-contact.active {
  display: flex;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.workspace-title-area h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.workspace-title-area .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.workspace-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.collapsible-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.edit-contact-workspace {
  display: flex;
  flex-direction: row;
  gap: 24px;
  flex-grow: 1;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

.edit-contact-workspace.right-panel-collapsed .edit-contact-right-panel {
  display: none !important;
}

.edit-contact-workspace.right-panel-collapsed .edit-contact-main-form {
  flex: 1 1 100%;
}

/* Left main form card */
.edit-contact-main-form {
  flex: 1 1 65%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.edit-contact-main-form.glass {
  background: linear-gradient(135deg, hsla(224, 40%, 14%, 0.9), hsla(224, 45%, 8%, 0.95)) !important;
  border: 1px solid rgba(59, 130, 246, 0.28) !important;
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6), 0 0 25px rgba(59, 130, 246, 0.16) !important;
}

.edit-contact-main-form form {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.workspace-form-scroll-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  row-gap: 8px;
  column-gap: 16px;
}

.edit-contact-main-form .form-group {
  margin-bottom: 0;
}

.edit-contact-main-form .form-group label {
  margin-bottom: 2px;
  font-size: 13px;
}

/* Input Icon styling */
.input-with-icon {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}

.input-with-icon input,
.input-with-icon select {
  width: 100%;
  padding: 6px 12px 6px 36px !important;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  transition: all 0.3s ease;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px var(--accent-purple-glow);
  background-color: rgba(255, 255, 255, 0.05);
}

.add-custom-type-link {
  font-size: 12px;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.add-custom-type-link:hover {
  color: var(--accent-purple);
  text-decoration: underline;
}

/* Form footer actions */
.workspace-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.btn-save-contact {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: white;
  box-shadow: 0 4px 14px rgba(108, 93, 211, 0.3);
}

.btn-save-contact:hover {
  box-shadow: 0 6px 20px rgba(108, 93, 211, 0.5);
  transform: translateY(-1px);
}

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

.btn.outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

/* Right side contextual panel */
.edit-contact-right-panel {
  flex: 0 0 35%;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding-bottom: 24px;
}

.panel-card {
  padding: 0;
  overflow: hidden;
}

.panel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.panel-card-header h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.panel-card-header .view-all-link {
  font-size: 11px;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.panel-card-header .view-all-link:hover {
  text-decoration: underline;
}

.panel-card-header .view-all-link:disabled {
  color: var(--text-muted);
  cursor: default;
  text-decoration: none;
}

.card-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.panel-card.collapsed .panel-card-body {
  display: none;
}

.panel-card.collapsed .card-toggle-btn {
  transform: rotate(180deg);
}

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

/* Contact Summary Details */
.summary-avatar-area {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.summary-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: white;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(108, 93, 211, 0.4);
  flex-shrink: 0;
}

.summary-avatar-info h4 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.summary-avatar-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.summary-fields-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-primary);
}

.summary-field i {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.badge-primary-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  background-color: var(--accent-blue-glow);
  color: var(--accent-blue);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  margin-left: 4px;
}

.summary-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.summary-badge-tag {
  font-size: 11px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
}

/* Call History Mini List */
.recent-calls-panel {
  min-height: 315px;
  flex-shrink: 0;
}

.contacts-workspace-center > *,
.companies-workspace-center > * {
  flex-shrink: 0;
}

.calls-mini-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.drawer-call-item,
.call-record-item-mini {
  min-height: 70px;
  flex-shrink: 0;
}

.mini-call-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12px;
  transition: all 0.2s;
  min-height: 48px;
  flex-shrink: 0;
}

.mini-call-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.mini-call-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-call-dir-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.mini-call-dir-icon.inbound {
  color: var(--accent-green);
}

.mini-call-dir-icon.outbound {
  color: var(--accent-blue);
}

.mini-call-dir-icon.missed {
  color: var(--accent-rose);
}

.mini-call-info {
  display: flex;
  flex-direction: column;
}

.mini-call-time {
  font-weight: 500;
  color: var(--text-primary);
}

.mini-call-meta {
  font-size: 10px;
  color: var(--text-muted);
}

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

.mini-call-duration {
  font-weight: 500;
  color: var(--text-secondary);
}

.mini-call-play-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.mini-call-play-btn:hover {
  color: var(--text-primary);
}

.mini-calls-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0;
}

/* VoiceID Snapshot Layout */
.voiceid-visuals {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fingerprint-glow-container {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fingerprint-icon-bg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  z-index: 2;
  transition: all 0.3s;
}

.fingerprint-icon-bg i {
  width: 24px;
  height: 24px;
}

.fingerprint-pulse-ring {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  z-index: 1;
  opacity: 0;
  transition: all 0.3s;
}

/* Pulse animation states */
.fingerprint-glow-container.verified .fingerprint-icon-bg {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background-color: var(--accent-green-glow);
}

.fingerprint-glow-container.verified .fingerprint-pulse-ring {
  border: 2px solid var(--accent-green);
  animation: pulse-green 2s infinite;
  opacity: 1;
}

.fingerprint-glow-container.pending .fingerprint-icon-bg {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background-color: var(--accent-gold-glow);
}

.fingerprint-glow-container.pending .fingerprint-pulse-ring {
  border: 2px solid var(--accent-gold);
  animation: pulse-gold 2s infinite;
  opacity: 1;
}

.fingerprint-glow-container.unregistered .fingerprint-icon-bg {
  border-color: var(--text-muted);
  color: var(--text-muted);
  background-color: rgba(255, 255, 255, 0.01);
}

.fingerprint-glow-container.unregistered .fingerprint-pulse-ring {
  animation: none;
  opacity: 0;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes pulse-gold {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
  }
  70% {
    transform: scale(1.15);
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

.voiceid-status-details {
  flex-grow: 1;
}

.voiceid-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.voiceid-status-badge.verified {
  color: var(--accent-green);
}

.voiceid-status-badge.pending {
  color: var(--accent-gold);
}

.voiceid-status-badge.unregistered {
  color: var(--text-muted);
}

.voiceid-status-badge i {
  width: 12px;
  height: 12px;
}

.voiceid-confidence-metric {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

.voiceid-confidence-metric .label {
  color: var(--text-secondary);
}

.voiceid-confidence-metric .value {
  font-weight: 700;
  color: var(--text-primary);
}

.voiceid-progress-bar-bg {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}

.voiceid-progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease, background-color 0.3s ease;
}

.voiceid-progress-bar-fill.verified {
  background-color: var(--accent-green);
}

.voiceid-progress-bar-fill.pending {
  background-color: var(--accent-gold);
}

.voiceid-progress-bar-fill.unregistered {
  background-color: var(--text-muted);
}

/* Light mode overrides for redesigned elements */
:root.light .edit-contact-main-form.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95)) !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  box-shadow: 0 12px 40px 0 rgba(15, 23, 42, 0.08), 0 0 20px rgba(59, 130, 246, 0.06) !important;
}

:root.light .input-with-icon input,
:root.light .input-with-icon select {
  background-color: #ffffff !important;
  border-color: rgba(148, 163, 184, 0.4) !important;
  color: #0f172a !important;
}

:root.light .input-with-icon input:focus,
:root.light .input-with-icon select:focus {
  border-color: var(--accent-purple) !important;
  background-color: #ffffff !important;
}

:root.light .workspace-form-footer {
  background-color: rgba(241, 245, 249, 0.95);
  border-top-color: rgba(148, 163, 184, 0.3);
}

:root.light .summary-badge-tag {
  background-color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.2);
  color: #475569;
}

:root.light .mini-call-item {
  background-color: #ffffff;
  border-color: rgba(148, 163, 184, 0.2);
}

:root.light .mini-call-item:hover {
  background-color: #f8fafc;
}

/* Responsive styles */
@media (max-width: 960px) {
  .workspace-header-actions {
    display: none;
  }
}

@media (max-width: 768px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
  }
  
  #view-edit-contact {
    height: auto;
    overflow-y: auto;
  }
  
  .edit-contact-workspace {
    flex-direction: column;
    overflow-y: auto;
    gap: 16px;
  }
  
  .edit-contact-main-form {
    flex: none;
    height: auto;
    overflow: visible;
  }
  
  .edit-contact-main-form form {
    height: auto;
    overflow: visible;
  }
  
  .workspace-form-scroll-body {
    overflow-y: visible;
  }
  
  .edit-contact-right-panel {
    flex: none;
    min-width: 0;
    overflow-y: visible;
  }
  
  .workspace-form-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
  }
}

/* Click-to-call phone triggers styling */
.clickable-phone {
  text-decoration: underline dotted;
  cursor: pointer;
  color: var(--accent-purple);
  transition: color 0.2s ease, text-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.clickable-phone:hover {
  color: var(--accent-purple-hover, #a193ff);
  text-shadow: 0 0 8px rgba(108, 93, 211, 0.4);
}

.clickable-phone i {
  width: 12px;
  height: 12px;
  display: inline-block;
  vertical-align: middle;
}

/* Contacts/Companies Workspace Three-Column Responsive Layout */
.app-container.contacts-workspace-active .sidebar,
.app-container.companies-workspace-active .sidebar {
  display: flex;
}

.app-container.contacts-workspace-active .main-content,
.app-container.companies-workspace-active .main-content {
  margin-left: 280px;
}

.app-container.contacts-workspace-active .top-header .header-search,
.app-container.companies-workspace-active .top-header .header-search {
  display: none;
}

.app-container.contacts-workspace-active .top-header #header-breadcrumbs,
.app-container.companies-workspace-active .top-header #header-breadcrumbs {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.app-container.contacts-workspace-active .top-header #header-breadcrumbs a.breadcrumb-link,
.app-container.companies-workspace-active .top-header #header-breadcrumbs a.breadcrumb-link {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.app-container.contacts-workspace-active .top-header #header-breadcrumbs a.breadcrumb-link:hover,
.app-container.companies-workspace-active .top-header #header-breadcrumbs a.breadcrumb-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.app-container.contacts-workspace-active .top-header #header-breadcrumbs .breadcrumb-separator,
.app-container.companies-workspace-active .top-header #header-breadcrumbs .breadcrumb-separator {
  color: var(--text-muted);
  margin: 0 4px;
}

.app-container.contacts-workspace-active .top-header #header-breadcrumbs span,
.app-container.companies-workspace-active .top-header #header-breadcrumbs span {
  color: var(--text-primary);
  font-weight: 600;
}

.app-container.contacts-workspace-active .top-header #contacts-workspace-global-search,
.app-container.companies-workspace-active .top-header #contacts-workspace-global-search {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  width: 300px;
  transition: all 0.3s ease;
}

.app-container.contacts-workspace-active .top-header #contacts-workspace-global-search:focus-within,
.app-container.companies-workspace-active .top-header #contacts-workspace-global-search:focus-within {
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow);
  background-color: rgba(255, 255, 255, 0.07);
}

.app-container.contacts-workspace-active .top-header #contacts-workspace-global-search i,
.app-container.companies-workspace-active .top-header #contacts-workspace-global-search i {
  color: var(--text-secondary);
  width: 14px;
  height: 14px;
}

.app-container.contacts-workspace-active .top-header #contacts-workspace-global-search input,
.app-container.companies-workspace-active .top-header #contacts-workspace-global-search input {
  background: none;
  border: none;
  color: var(--text-primary);
  outline: none;
  font-size: 13.5px;
  width: 100%;
}

/* Three-Column Container */
.contacts-workspace-container,
.companies-workspace-container {
  display: flex;
  gap: 20px;
  align-items: stretch;
  width: 100%;
  height: calc(100vh - 120px); /* accounting for main content area and margins */
  overflow: hidden;
  box-sizing: border-box;
}

/* Column 1: Left Contacts Sidebar */
.sidebar-contacts-content,
.sidebar-companies-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 14px;
  overflow: hidden;
  width: 100%;
}

.sidebar-brand-contacts,
.sidebar-brand-companies {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.sidebar-logo-img {
  max-width: 100%;
  height: auto;
  max-height: 44px;
  object-fit: contain;
}

.sidebar-user-profile-contacts,
.sidebar-user-profile-companies {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 4px;
  position: relative;
  width: 100%;
}

.sidebar-user-profile-contacts .user-avatar-circle,
.sidebar-user-profile-companies .user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
}

.sidebar-user-profile-contacts .user-profile-details,
.sidebar-user-profile-companies .user-profile-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-user-profile-contacts .user-profile-details h4,
.sidebar-user-profile-companies .user-profile-details h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-profile-contacts .user-profile-details span,
.sidebar-user-profile-companies .user-profile-details span {
  font-size: 9px;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout-btn {
  font-size: 8px;
  font-weight: 700;
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid transparent;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: rgba(244, 63, 94, 0.2);
}

.sidebar-contacts-header,
.sidebar-companies-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2px;
}

.sidebar-contacts-header h3,
.sidebar-companies-header h3 {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-primary);
}

.add-contact-icon-btn,
.add-company-icon-btn {
  background: rgba(108, 93, 211, 0.1);
  border: 1px solid rgba(108, 93, 211, 0.15);
  color: var(--text-primary);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-contact-icon-btn:hover,
.add-company-icon-btn:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
}

.add-contact-icon-btn i,
.add-company-icon-btn i {
  width: 13px;
  height: 13px;
}

.sidebar-contacts-filters,
.sidebar-companies-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-contacts-filters .sidebar-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sidebar-contacts-filters select {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  outline: none;
  cursor: pointer;
  width: 100%;
  font-family: var(--font-body);
}

.sidebar-contacts-filters select:focus {
  border-color: var(--accent-purple);
}

.sidebar-telemetry-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.02);
  border: 1px solid rgba(16, 185, 129, 0.1);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: auto;
}

.sidebar-telemetry-sync .telemetry-details {
  display: flex;
  flex-direction: column;
}

.sidebar-telemetry-sync .telemetry-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-secondary);
}

.sidebar-telemetry-sync .telemetry-value {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.sidebar-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-heading);
  color: #fff;
  font-size: 14px;
}

.user-profile-details h4 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-profile-details span {
  font-size: 11px;
  color: var(--text-secondary);
}

.contacts-sidebar-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sidebar-filters-grid select {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 8px;
  border-radius: 6px;
  outline: none;
  font-size: 11.5px;
  width: 100%;
}

.contacts-list,
.companies-list {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-sidebar-item,
.company-sidebar-item {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-sidebar-item:hover,
.company-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.contact-sidebar-item.active,
.company-sidebar-item.active {
  background: linear-gradient(90deg, hsla(258, 85%, 66%, 0.1), hsla(207, 90%, 54%, 0.03));
  border-color: var(--accent-purple-glow);
  box-shadow: inset 0 0 8px rgba(108, 93, 211, 0.05);
}

.contact-item-avatar,
.company-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple-glow), var(--accent-blue-glow));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.contact-item-info,
.company-item-info {
  flex-grow: 1;
  min-width: 0;
}

.contact-item-name,
.company-item-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-item-company,
.company-item-details {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-sidebar-item.active .contact-item-avatar,
.company-sidebar-item.active .company-item-avatar {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: white;
}

.contacts-sidebar-pagination,
.companies-sidebar-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-secondary);
}

.contacts-sidebar-pagination .pagination-buttons,
.companies-sidebar-pagination .pagination-buttons {
  display: flex;
  gap: 4px;
}

.contacts-sidebar-pagination button,
.companies-sidebar-pagination button {
  padding: 4px 8px;
}

.telemetry-sync-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
  justify-content: center;
  padding-top: 4px;
}

.pulse-dot-green {
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-green);
  display: inline-block;
  animation: pulse-sync 2s infinite;
}

@keyframes pulse-sync {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Column 2: Center Content Workspace */
.contacts-workspace-center,
.companies-workspace-center {
  flex: 1 1 0%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-right: 8px;
}

.contact-profile-header,
.company-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
}

.contact-profile-header .header-left,
.company-profile-header .header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-large-avatar,
.company-large-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 12px rgba(108, 93, 211, 0.3);
  font-family: var(--font-heading);
}

.contact-header-info h2,
.company-header-info h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.contact-header-info span,
.company-header-info span {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.contact-details-fields-grid,
.company-details-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
}

.field-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.field-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.field-value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.workspace-panel-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.workspace-panel-card .panel-card-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
}

.workspace-panel-card .panel-card-header h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.workspace-panel-card .panel-card-body {
  padding: 16px 20px;
}

.center-split-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Column 3: Right Sidebar */
.contacts-workspace-right,
.companies-workspace-right {
  flex: 0 1 280px;
  min-width: 230px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  height: 100%;
}

.contacts-workspace-right .workspace-panel-card,
.companies-workspace-right .workspace-panel-card {
  margin-bottom: 0;
}

.quick-actions-container button {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

/* Theme light adjustments */
:root.light .contacts-workspace-sidebar,
:root.light .companies-workspace-sidebar,
:root.light .contact-profile-header,
:root.light .company-profile-header,
:root.light .contact-details-fields-grid,
:root.light .company-details-fields-grid,
:root.light .workspace-panel-card {
  background-color: #ffffff;
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

:root.light .contact-sidebar-item,
:root.light .company-sidebar-item {
  background-color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.15);
}

:root.light .contact-sidebar-item:hover,
:root.light .company-sidebar-item:hover {
  background-color: #f1f5f9;
}

:root.light .contact-sidebar-item.active,
:root.light .company-sidebar-item.active {
  background: linear-gradient(90deg, rgba(108, 93, 211, 0.08), rgba(59, 130, 246, 0.03));
  border-color: rgba(108, 93, 211, 0.4);
}

/* Responsive queries */
@media (max-width: 1200px) {
  .contacts-workspace-container,
  .companies-workspace-container {
    flex-wrap: wrap;
    height: auto;
    overflow: visible;
  }
  
  .contacts-workspace-sidebar,
  .companies-workspace-sidebar {
    flex: 1 1 300px;
    height: 650px;
    max-width: none;
  }
  
  .contacts-workspace-center,
  .companies-workspace-center {
    flex: 1 1 500px;
    height: auto;
    overflow: visible;
    padding-right: 0;
  }
  
  .contacts-workspace-right,
  .companies-workspace-right {
    flex: 1 1 100%;
    max-width: none;
    height: auto;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .center-split-panels {
    grid-template-columns: 1fr;
  }
}

/* Header Breadcrumb Styling */
.header-breadcrumbs {
  display: flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text-secondary);
}

.breadcrumb-link {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
  font-weight: 500;
}

.breadcrumb-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-muted);
  margin: 0 6px;
  font-size: 11px;
  user-select: none;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================================================
   Embedded Mode Workspace Layout Optimization (Iframe width ~808px)
   ========================================================================== */
.app-container.embedded .contacts-workspace-container,
.app-container.embedded .companies-workspace-container {
  flex-wrap: nowrap !important;
  height: calc(100vh - 56px) !important; /* constraint to iframe height */
  overflow: hidden !important;
  gap: 12px !important;
}

/* Recalibrate contacts/companies sidebar list width when embedded */
.app-container.embedded.contacts-workspace-active .sidebar,
.app-container.embedded.companies-workspace-active .sidebar {
  width: 240px !important;
  flex: 0 0 240px !important;
  padding: 16px 12px !important;
}
.app-container.embedded.contacts-workspace-active .main-content,
.app-container.embedded.companies-workspace-active .main-content {
  margin-left: 240px !important;
  width: calc(100% - 240px) !important;
}

/* Center Column Details Area - Scrollable Independently */
.app-container.embedded .contacts-workspace-center,
.app-container.embedded .companies-workspace-center {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  padding-right: 6px !important;
}

/* Right Column Actions Area - Scale and Scroll Independently */
.app-container.embedded .contacts-workspace-right,
.app-container.embedded .companies-workspace-right {
  flex: 0 0 210px !important;
  min-width: 210px !important;
  max-width: 210px !important;
  height: 100% !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

/* Stacking center panel columns vertically in narrow workspace layout */
.app-container.embedded .center-split-panels {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

/* Media query to relax embedded constraints on larger/full-width viewports (1100px+) */
@media (min-width: 1100px) {
  .app-container.embedded.contacts-workspace-active .sidebar,
  .app-container.embedded.companies-workspace-active .sidebar {
    width: 280px !important;
    flex: 0 0 280px !important;
  }
  .app-container.embedded.contacts-workspace-active .main-content,
  .app-container.embedded.companies-workspace-active .main-content {
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
  }
  .app-container.embedded .contacts-workspace-right,
  .app-container.embedded .companies-workspace-right {
    flex: 0 0 280px !important;
    min-width: 250px !important;
    max-width: 320px !important;
  }
  .app-container.embedded .center-split-panels {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }
}


/* ==========================================================================
   CRM Operational Home + Portal Shell
   ========================================================================== */
.sidebar-default-content.portal-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.portal-sidebar-brand {
  display: flex;
  justify-content: center;
  padding: 2px 12px 18px;
  border-bottom: 1px solid var(--border-color);
}

.portal-sidebar-logo {
  display: block;
  width: 188px;
  max-width: 100%;
  height: 68px;
  object-fit: contain;
}

.portal-user-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 14px 0 22px;
  padding: 11px 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.portal-user-card .user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, #6c5dd3, #2f80ed);
}

.portal-user-card .user-profile-details { min-width: 0; }
.portal-user-card .user-profile-details h4 {
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-user-card .user-profile-details span {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 10px;
}
.portal-user-card .sidebar-logout-btn {
  padding: 6px 7px;
  font-size: 8px;
  letter-spacing: .08em;
}

.portal-nav-label {
  padding: 0 8px 9px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.portal-menu {
  gap: 3px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.portal-menu .menu-item {
  min-height: 40px;
  padding: 9px 12px;
  gap: 11px;
  border-radius: 8px;
  font-size: 13px;
}
.portal-menu .menu-item > span:not(.menu-count) { flex: 1; }
.portal-menu .menu-item.active {
  border-left: none;
  color: #fff;
  background: linear-gradient(100deg, #594ee6, #2f80ed);
  box-shadow: 0 6px 18px rgba(47, 128, 237, .24);
}
.portal-menu .menu-item:hover:not(.active) { background: rgba(108, 93, 211, .08); }
.menu-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  background: rgba(108, 93, 211, .15);
  color: var(--accent-purple);
  font-size: 9px;
  font-weight: 700;
}
.portal-menu .menu-item.active .menu-count { background: rgba(255,255,255,.2); color:#fff; }

.portal-sidebar-footer { margin-top: 14px; }
.portal-sync-status {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: rgba(14, 190, 126, .05);
}
.portal-sync-status > div { display:flex; flex-direction:column; gap:2px; }
.portal-sync-status strong { color: var(--text-secondary); font-size: 10px; }
.portal-sync-status span:last-child { color: var(--accent-green); font-size: 9px; font-weight: 800; letter-spacing:.08em; }
.portal-copyright { padding-top: 14px; color: var(--text-muted); font-size: 9px; line-height: 1.55; text-align: center; }

.top-header {
  min-height: 94px;
  height: auto;
  padding: 11px 24px;
  gap: 20px;
  background: color-mix(in srgb, var(--bg-app) 88%, transparent);
}
.header-default-context {
  flex: 1 1 390px;
  min-width: 300px;
}
.portal-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
}
.portal-breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.portal-breadcrumbs a:hover { color: var(--accent-blue); }
.portal-breadcrumbs i { width: 12px; height: 12px; }
.portal-breadcrumbs span { color: var(--text-secondary); }
.portal-page-heading { display:flex; align-items:center; gap:10px; }
.portal-heading-menu {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
}
.portal-heading-menu i { width:18px; height:18px; }
.portal-page-heading h2 { font-family: var(--font-heading); font-size: 22px; line-height:1.05; }
.portal-page-heading p { margin-top: 3px; color: var(--text-secondary); font-size: 11px; }
.top-header .header-search { flex: 0 1 330px; }
.top-header .header-actions { flex: 0 0 auto; gap: 10px; }
.top-header .header-actions .btn { padding: 8px 11px; font-size: 11px; }
.top-header .header-actions .divider { margin: 0 2px; }

#view-home { max-width: 1640px; margin: 0 auto; }
.home-attention-bar {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(500px, 2.3fr) auto;
  align-items: stretch;
  margin-bottom: 18px;
  border-radius: 12px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(108deg, #4938c9 0%, #6552e8 48%, #367de8 100%);
  box-shadow: 0 10px 28px rgba(70, 56, 200, .22);
}
.home-attention-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 20px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
}
.home-attention-title i { width:18px; height:18px; }
.home-attention-metrics { display:grid; grid-template-columns:repeat(4, minmax(105px, 1fr)); }
.home-attention-stat {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  min-width:0;
  padding: 10px 18px;
  border:0;
  border-left:1px solid rgba(255,255,255,.18);
  color:#fff;
  background:transparent;
  cursor:pointer;
  text-align:left;
}
.home-attention-stat:hover { background:rgba(255,255,255,.08); }
.home-attention-stat strong { font-family:var(--font-heading); font-size:24px; line-height:1; }
.home-attention-stat span { margin-top:4px; color:rgba(255,255,255,.78); font-size:10px; white-space:nowrap; }
.home-attention-detail {
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 18px;
  border:0;
  border-left:1px solid rgba(255,255,255,.18);
  color:rgba(255,255,255,.85);
  background:rgba(18,29,93,.12);
  font-size:10px;
  cursor:pointer;
}
.home-attention-detail i { width:14px; height:14px; }
.home-attention-section { position:relative; margin-bottom:18px; }
.home-attention-heading { display:flex; align-items:flex-end; justify-content:space-between; min-height:38px; margin-bottom:10px; }
.home-attention-heading h3 { color:var(--text-primary); font-family:var(--font-heading); font-size:14px; line-height:1.2; }
.home-attention-heading p { margin-top:3px; color:var(--text-muted); font-size:9.5px; }
.home-attention-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.home-attention-card { display:flex; align-items:center; gap:13px; min-width:0; min-height:98px; padding:16px 17px; border:1px solid var(--border-color); border-radius:12px; color:var(--text-primary); background:var(--bg-card); box-shadow:0 5px 16px rgba(15,23,42,.045); cursor:pointer; text-align:left; transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease; }
.home-attention-card:hover { transform:translateY(-1px); border-color:rgba(47,128,237,.24); box-shadow:0 9px 22px rgba(15,23,42,.08); }
.home-attention-icon { flex:0 0 auto; display:grid; place-items:center; width:44px; height:44px; border-radius:50%; }
.home-attention-icon i { width:20px; height:20px; }
.home-attention-copy { min-width:0; display:flex; flex-direction:column; align-items:flex-start; }
.home-attention-label { color:var(--text-secondary); font-size:8.5px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.home-attention-copy strong { margin-top:3px; font-family:var(--font-heading); font-size:23px; line-height:1; }
.home-attention-copy small { margin-top:6px; overflow:hidden; color:var(--text-muted); font-size:8.5px; text-overflow:ellipsis; white-space:nowrap; }
.home-attention-card.danger .home-attention-icon { color:#e14b68; background:rgba(235,87,87,.12); }
.home-attention-card.warning .home-attention-icon { color:#c27b00; background:rgba(245,158,11,.13); }
.home-attention-card.ai .home-attention-icon { color:#6552e8; background:rgba(108,93,211,.12); }
.home-attention-card.review .home-attention-icon { color:#2f80ed; background:rgba(47,128,237,.12); }
.home-attention-section .home-attention-detail { position:absolute; top:0; right:0; display:flex; align-items:center; gap:6px; padding:6px 0; border:0; color:var(--accent-blue); background:transparent; font-size:9px; font-weight:700; cursor:pointer; }
.home-attention-section .home-attention-detail:hover { color:var(--accent-purple); }
.home-attention-section .home-attention-detail i { width:12px; height:12px; }

/* Premium attention cards: Nexus-inspired depth with restrained Apple-like motion. */
.home-attention-card {
  --attention-accent-rgb:47,128,237;
  --card-tilt-x:0deg;
  --card-tilt-y:0deg;
  position:relative;
  isolation:isolate;
  overflow:hidden;
  border-radius:14px;
  background:
    linear-gradient(90deg,transparent 4%,rgba(var(--attention-accent-rgb),.68) 50%,transparent 96%) top/100% 1px no-repeat,
    linear-gradient(135deg,rgba(var(--attention-accent-rgb),.035),transparent 46%),
    var(--bg-card);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 1px 2px rgba(15,23,42,.025),
    0 6px 18px rgba(15,23,42,.05);
  transform:perspective(900px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translateY(0) scale3d(1,1,1);
  transform-style:preserve-3d;
  transform-origin:center;
  transition:transform .18s ease-out,border-color .3s ease,box-shadow .35s cubic-bezier(.2,.8,.2,1),background-color .3s ease;
  will-change:transform,box-shadow;
}
.home-attention-card::before {
  content:'';
  position:absolute;
  z-index:1;
  top:-20%;
  left:-72%;
  width:45%;
  height:140%;
  pointer-events:none;
  opacity:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.04),rgba(255,255,255,.16),rgba(255,255,255,.04),transparent);
  transform:skewX(-18deg);
  transition:left .72s cubic-bezier(.2,.7,.2,1),opacity .2s ease;
}
.home-attention-card::after {
  content:'';
  position:absolute;
  z-index:3;
  top:calc(var(--card-shine-y,-220px) - 90px);
  left:calc(var(--card-shine-x,-220px) - 90px);
  width:180px;
  height:180px;
  border-radius:50%;
  pointer-events:none;
  opacity:0;
  background:radial-gradient(circle,rgba(255,255,255,.24) 0%,rgba(255,255,255,.09) 34%,transparent 70%);
  transition:opacity .25s ease;
}
.home-attention-card > * { position:relative; z-index:2; }
.home-attention-card:hover,
.home-attention-card:focus-visible {
  border-color:rgba(var(--attention-accent-rgb),.48);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.16),
    0 2px 4px rgba(15,23,42,.04),
    0 10px 22px rgba(15,23,42,.09),
    0 20px 42px rgba(15,23,42,.08),
    0 0 26px rgba(var(--attention-accent-rgb),.12);
  transform:perspective(900px) rotateX(var(--card-tilt-x)) rotateY(var(--card-tilt-y)) translateY(-3px) scale3d(1.012,1.012,1.012);
}
.home-attention-card:hover::before,
.home-attention-card:focus-visible::before { left:130%; opacity:1; }
.home-attention-card:hover::after { opacity:1; }
.home-attention-card:focus-visible { outline:3px solid rgba(var(--attention-accent-rgb),.16); outline-offset:3px; }
.home-attention-card:active { transform:perspective(900px) rotateX(0) rotateY(0) translateY(-1px) scale3d(.997,.997,.997); transition-duration:.08s; }
.home-attention-icon { transform:translateZ(18px); transition:transform .3s cubic-bezier(.2,.8,.2,1),box-shadow .3s ease; }
.home-attention-card:hover .home-attention-icon { transform:translateZ(24px) scale(1.045); box-shadow:0 8px 18px rgba(var(--attention-accent-rgb),.14); }
.home-attention-card.danger { --attention-accent-rgb:225,75,104; }
.home-attention-card.warning { --attention-accent-rgb:194,123,0; }
.home-attention-card.ai { --attention-accent-rgb:101,82,232; }
.home-attention-card.review { --attention-accent-rgb:47,128,237; }

:root.light .home-attention-card {
  background:
    linear-gradient(90deg,transparent 4%,rgba(var(--attention-accent-rgb),.56) 50%,transparent 96%) top/100% 1px no-repeat,
    linear-gradient(145deg,rgba(255,255,255,.98),rgba(var(--attention-accent-rgb),.018)),
    #fff;
  border-color:#e6ebf2;
  box-shadow:inset 0 1px 0 #fff,0 1px 2px rgba(15,23,42,.025),0 6px 18px rgba(15,23,42,.05);
}
:root.light .home-attention-card::before { background:linear-gradient(90deg,transparent,rgba(255,255,255,.28),rgba(255,255,255,.92),rgba(255,255,255,.28),transparent); }
:root.light .home-attention-card::after { background:radial-gradient(circle,rgba(255,255,255,.92) 0%,rgba(255,255,255,.35) 34%,transparent 70%); }
:root.light .home-attention-card:hover,
:root.light .home-attention-card:focus-visible {
  border-color:rgba(var(--attention-accent-rgb),.5);
  box-shadow:inset 0 1px 0 #fff,0 2px 4px rgba(15,23,42,.04),0 10px 22px rgba(15,23,42,.08),0 20px 42px rgba(15,23,42,.07),0 0 26px rgba(var(--attention-accent-rgb),.11);
}
.home-work-grid {
  display:grid;
  grid-template-columns:minmax(0, 2.25fr) minmax(330px, .85fr);
  gap:18px;
  align-items:stretch;
}
.home-card {
  overflow:hidden;
  border:1px solid var(--border-color);
  border-radius:12px;
  background:var(--bg-card);
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}
.home-card-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:17px 19px 13px;
}
.home-card-header.compact { padding-bottom:14px; }
.home-card-header h3 { font-family:var(--font-heading); font-size:17px; }
.home-card-header p { margin-top:3px; color:var(--text-secondary); font-size:10px; }
.home-text-action {
  display:flex;
  align-items:center;
  gap:6px;
  border:0;
  color:var(--accent-blue);
  background:transparent;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.home-text-action i { width:13px; height:13px; }
.home-card-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:0 19px 13px;
  border-bottom:1px solid var(--border-color);
}
.home-filter-chips { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.home-filter-chip,
.home-scope-toggle button,
.home-action-tabs button {
  border:1px solid transparent;
  border-radius:6px;
  color:var(--text-secondary);
  background:transparent;
  font-family:var(--font-body);
  font-size:10px;
  font-weight:600;
  cursor:pointer;
}
.home-filter-chip { padding:6px 9px; }
.home-filter-chip:hover { background:rgba(108,93,211,.06); }
.home-filter-chip.active { color:#5548d9; border-color:rgba(108,93,211,.2); background:rgba(108,93,211,.1); }
.home-sync-controls { display:flex; align-items:center; gap:6px; }
.home-sync-note { display:flex; align-items:center; gap:6px; color:var(--text-muted); font-size:9px; white-space:nowrap; }
.home-sync-note .status-dot { width:6px; height:6px; }
.home-sync-note .status-dot.fresh { background:var(--accent-green); }
.home-sync-note .status-dot.waiting { background:#f59e0b; }
.home-sync-note .status-dot.error { background:var(--accent-rose); }
.home-sync-refresh { width:24px; height:24px; display:grid; place-items:center; border:1px solid var(--border-color); border-radius:6px; color:var(--text-muted); background:transparent; cursor:pointer; }
.home-sync-refresh:hover { color:var(--accent-blue); background:rgba(47,128,237,.08); }
.home-sync-refresh:disabled { cursor:wait; opacity:.55; }
.home-sync-refresh i { width:12px; height:12px; }
.home-sync-refresh.refreshing i { animation:home-sync-spin .8s linear infinite; }
@keyframes home-sync-spin { to { transform:rotate(360deg); } }

.home-table-wrap { width:100%; overflow-x:auto; }
.home-table { width:100%; border-collapse:collapse; min-width:760px; }
.home-call-table { min-width:880px; }
.home-table th {
  padding:9px 14px;
  color:var(--text-muted);
  background:rgba(148,163,184,.045);
  font-size:8px;
  font-weight:800;
  letter-spacing:.07em;
  text-align:left;
  text-transform:uppercase;
}
.home-table td {
  padding:12px 14px;
  border-top:1px solid var(--border-color);
  color:var(--text-secondary);
  font-size:10px;
  line-height:1.4;
  vertical-align:middle;
}
.home-table td strong { display:block; color:var(--text-primary); font-size:10.5px; font-weight:650; }
.home-clickable-row { cursor:pointer; transition:background .16s ease; }
.home-clickable-row:hover { background:rgba(108,93,211,.035); }
.home-cell-subtitle { display:block; margin-top:2px; color:var(--text-muted); font-size:9px; }
.home-summary-cell { width:32%; max-width:380px; color:var(--text-primary) !important; }
.home-call-meta { display:flex; align-items:center; gap:9px; min-width:145px; }
.home-call-meta strong { font-size:10px !important; }
.home-call-meta span:not(.home-call-direction) { display:block; margin-top:2px; color:var(--text-muted); font-size:8.5px; white-space:nowrap; }
.home-call-direction { width:30px; height:30px; display:grid; place-items:center; flex:0 0 30px; border-radius:50%; }
.home-call-direction i { width:14px; height:14px; }
.home-call-direction.inbound { color:#0aa978; background:rgba(14,190,126,.1); }
.home-call-direction.outbound { color:#2f80ed; background:rgba(47,128,237,.1); }
.home-outcome { display:inline-flex; max-width:150px; padding:4px 7px; border-radius:5px; font-size:8.5px; font-weight:650; }
.home-outcome.success { color:#09875f; background:rgba(14,190,126,.09); }
.home-outcome.review { color:#c35b26; background:rgba(245,158,11,.1); }
.home-action-state { display:inline-flex; align-items:center; gap:5px; font-size:9px; font-weight:600; white-space:nowrap; }
.home-action-state i { width:12px; height:12px; }
.home-action-state.success { color:#079269; }
.home-action-state.neutral { color:var(--text-muted); }
.home-action-state.dismissed { color:#536174; }
.home-row-actions { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.home-row-action {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  padding:6px 8px;
  border:1px solid var(--border-color);
  border-radius:6px;
  color:var(--text-secondary);
  background:rgba(148,163,184,.04);
  font-size:9px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
}
.home-row-action.primary { border-color:rgba(108,93,211,.2); color:#5949d8; background:rgba(108,93,211,.09); }
.home-row-action.dismiss { color:#687386; background:rgba(148,163,184,.06); }
.home-row-action.undo { padding:3px 5px; border-color:transparent; background:transparent; color:var(--accent-blue); }
.home-row-action i { width:11px; height:11px; }
.call-followup-panel-header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px 8px 12px; background:rgba(255,255,255,.03); }
.call-followup-panel-header h3 { padding:0 !important; background:transparent !important; }
.call-followup-disposition { display:flex; align-items:center; gap:6px; }
.home-icon-button {
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:6px;
  color:var(--text-muted);
  background:transparent;
  cursor:pointer;
}
.home-icon-button:hover { color:var(--accent-blue); background:rgba(47,128,237,.08); }
.home-icon-button i { width:14px; height:14px; }
.home-icon-button.dismiss:hover { color:var(--accent-rose); background:rgba(235,87,87,.08); }
.home-empty { padding:32px 18px !important; color:var(--text-muted) !important; text-align:center !important; }

.home-action-card { display:flex; flex-direction:column; min-height:510px; }
.home-scope-toggle { display:flex; padding:2px; border:1px solid var(--border-color); border-radius:7px; }
.home-scope-toggle button { padding:5px 8px; }
.home-scope-toggle button.active { color:var(--text-primary); background:rgba(108,93,211,.1); }
.home-action-tabs { display:flex; gap:18px; padding:0 18px; border-bottom:1px solid var(--border-color); }
.home-action-tabs button { padding:0 0 10px; border-radius:0; }
.home-action-tabs button.active { color:var(--text-primary); border-bottom-color:var(--accent-purple); }
.home-action-tabs span { display:inline-grid; place-items:center; min-width:17px; height:17px; margin-left:3px; border-radius:9px; color:#5949d8; background:rgba(108,93,211,.1); font-size:8px; }
.home-action-list { flex:1; min-height:0; max-height:435px; overflow-y:auto; }
.home-task-item,
.home-suggestion-item {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto auto;
  align-items:center;
  gap:9px;
  padding:12px 16px;
  border-bottom:1px solid var(--border-color);
}
.home-suggestion-item { grid-template-columns:auto minmax(0,1fr); align-items:start; }
.home-task-item { cursor:pointer; }
.home-task-item:hover,
.home-suggestion-item:hover { background:rgba(108,93,211,.03); }
.home-task-check { border:0; color:var(--text-muted); background:transparent; cursor:pointer; }
.home-task-check:disabled { cursor:not-allowed; opacity:.45; }
.home-task-check i { width:16px; height:16px; }
.home-task-check:hover:not(:disabled) { color:var(--accent-green); }
.home-action-copy { min-width:0; display:flex; flex-direction:column; gap:3px; }
.home-action-copy strong { color:var(--text-primary); font-size:10px; line-height:1.35; }
.home-action-copy > span:last-child { color:var(--text-muted); font-size:8.5px; }
.home-action-kicker { color:var(--accent-purple); font-size:8px; font-weight:750; text-transform:uppercase; letter-spacing:.05em; }
.home-action-kicker.overdue { color:var(--accent-rose); }
.home-action-kicker.today { color:#c27b00; }
.home-action-kicker.upcoming { color:var(--accent-blue); }
.home-priority { padding:3px 6px; border-radius:4px; font-size:8px; font-weight:700; }
.home-priority.high { color:#c53a62; background:rgba(235,87,87,.09); }
.home-priority.medium { color:#2f69be; background:rgba(47,128,237,.09); }
.home-priority.low { color:#218d6d; background:rgba(14,190,126,.09); }
.home-task-chevron { width:13px; height:13px; color:var(--text-muted); }
.home-action-icon { width:28px; height:28px; display:grid; place-items:center; border-radius:7px; }
.home-action-icon.ai { color:#6552e8; background:rgba(108,93,211,.1); }
.home-action-icon i { width:14px; height:14px; }
.home-action-buttons { grid-column:2 / -1; display:flex; align-items:center; flex-wrap:wrap; gap:5px; padding-top:4px; }
.home-suggestion-action { display:inline-flex; align-items:center; gap:4px; padding:5px 7px; border:1px solid var(--border-color); border-radius:6px; color:var(--text-secondary); background:transparent; font-size:8px; font-weight:700; cursor:pointer; }
.home-suggestion-action i { width:10px; height:10px; }
.home-suggestion-action:hover { color:var(--accent-blue); border-color:rgba(47,128,237,.28); background:rgba(47,128,237,.06); }
.home-suggestion-action.approve { color:#fff; border-color:#5f50de; background:#6552e8; }
.home-suggestion-action.approve:hover { color:#fff; background:#5845d9; }
.home-suggestion-action.dismiss:hover { color:var(--accent-rose); border-color:rgba(235,87,87,.25); background:rgba(235,87,87,.06); }
.home-suggestion-action:disabled { opacity:.55; cursor:wait; }
.home-suggestion-owner-row { grid-column:2 / -1; }
.home-suggested-owner { display:inline-flex; align-items:center; gap:4px; padding:4px 6px; border-radius:5px; font-size:8px; }
.home-suggested-owner i { width:10px; height:10px; }
.home-suggested-owner strong { font-weight:750; }
.home-suggested-owner.matched { color:#157454; background:rgba(14,190,126,.08); }
.home-suggested-owner.fallback { color:#8a6200; background:rgba(245,158,11,.08); }
.call-suggestion-review-note { display:flex; align-items:flex-start; gap:7px; padding:8px; border:1px solid rgba(108,93,211,.2); border-radius:7px; color:var(--text-secondary); background:rgba(108,93,211,.07); font-size:10px; line-height:1.4; }
.call-suggestion-review-note i { flex:0 0 auto; width:14px; height:14px; color:var(--accent-purple); }
.call-suggestion-review-note strong { color:var(--text-primary); }
.call-followup-assignee-row { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:8px; }
.call-followup-assignee-row label { display:flex; align-items:center; gap:5px; color:var(--text-secondary); font-size:10px; font-weight:700; }
.call-followup-assignee-row label i { width:13px; height:13px; color:var(--accent-purple); }
.call-followup-assignee-row select { min-width:0; }
.home-action-footer {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:6px;
  padding:11px;
  border:0;
  border-top:1px solid var(--border-color);
  color:var(--accent-blue);
  background:transparent;
  font-size:9px;
  font-weight:700;
  cursor:pointer;
}
.home-action-footer i { width:12px; height:12px; }
.home-empty-state { display:flex; min-height:250px; flex-direction:column; align-items:center; justify-content:center; gap:7px; padding:25px; text-align:center; }
.home-empty-state i { width:28px; height:28px; color:var(--accent-green); }
.home-empty-state strong { color:var(--text-primary); font-size:11px; }
.home-empty-state span { max-width:220px; color:var(--text-muted); font-size:9px; line-height:1.4; }

.home-accounts-card { margin-top:18px; }
.home-work-count { display:inline-block; margin-right:5px; padding:3px 6px; border-radius:4px; color:var(--text-secondary); background:rgba(148,163,184,.08); font-size:8.5px; }

:root.light .sidebar { background:#fff; border-color:#e6ebf2; }
:root.light .portal-user-card,
:root.light .portal-sync-status,
:root.light .home-card { background:#fff; border-color:#e6ebf2; }
:root.light .top-header { background:rgba(255,255,255,.94); border-color:#e6ebf2; }
:root.light .home-card { box-shadow:0 5px 16px rgba(15,23,42,.045); }
:root.light .home-table th { background:#f8fafc; }
:root.light .home-table td { border-color:#edf0f5; }
:root.light .portal-sidebar-logo { filter:none; }

.app-container.contacts-workspace-active .top-header,
.app-container.companies-workspace-active .top-header { min-height:80px; }
.app-container.contacts-workspace-active #header-default-context,
.app-container.companies-workspace-active #header-default-context { display:none !important; }

@media (max-width: 1500px) {
  .top-header .profile-info,
  .top-header .divider { display:none; }
  .top-header .header-search { flex-basis:260px; }
  .home-work-grid { grid-template-columns:minmax(0, 1.8fr) minmax(300px, .8fr); }
  .home-attention-bar { grid-template-columns:160px 1fr; }
  .home-attention-detail { display:none; }
}

@media (max-width: 1380px) {
  .top-header .header-search { display:none; }
  .home-attention-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .home-work-grid { grid-template-columns:1fr; }
  .home-action-card { min-height:440px; }
  .home-action-list { max-height:360px; }
}

@media (max-width: 900px) {
  .view-wrapper { padding:18px; }
  .top-header { min-height:82px; padding:10px 18px; }
  .portal-page-heading p { display:none; }
  .top-header #btn-simulate-call { display:none; }
  .home-attention-card { min-height:90px; }
  .home-attention-bar { grid-template-columns:1fr; }
  .home-attention-title { padding-bottom:10px; }
  .home-attention-metrics { grid-template-columns:repeat(2, 1fr); }
  .home-attention-stat { border-top:1px solid rgba(255,255,255,.16); }
  .home-card-toolbar { align-items:flex-start; flex-direction:column; }
}
@media (max-width: 600px) {
  .home-attention-grid { grid-template-columns:1fr; }
}
@media (max-height: 800px) {
  .portal-sidebar-brand { padding-bottom: 8px; }
  .portal-sidebar-logo { height: 48px; }
  .portal-user-card { margin: 8px 0 12px; padding: 8px; }
  .portal-nav-label { padding-bottom: 5px; }
  .portal-menu .menu-item { min-height: 34px; padding: 7px 11px; }
  .portal-sidebar-footer { margin-top: 6px; padding-top: 8px; }
  .portal-copyright { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home-attention-card,
  .home-attention-icon,
  .home-attention-card::before,
  .home-attention-card::after { transition-duration:.01ms !important; }
  .home-attention-card:hover,
  .home-attention-card:focus-visible,
  .home-attention-card:active { transform:none; }
  .home-attention-card:hover::before,
  .home-attention-card:focus-visible::before,
  .home-attention-card:hover::after { opacity:0; }
}

/* Contact photo source-of-truth workflow */
.contact-photo-frame { overflow:hidden; flex:0 0 auto; }
.contact-photo-frame img, .contact-item-avatar img, .contact-large-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.contact-photo-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.contact-photo-actions .btn { padding:5px 8px; font-size:11px; gap:4px; }
.contact-photo-actions svg { width:13px; height:13px; }
.contact-avatar-modal { width:min(92vw, 560px); }
.contact-avatar-crop-stage { width:256px; height:256px; margin:18px auto; overflow:hidden; position:relative; border-radius:50%; background:#0f172a; border:3px solid rgba(59,130,246,.8); cursor:grab; touch-action:none; }
.contact-avatar-crop-stage.dragging { cursor:grabbing; }
.contact-avatar-crop-stage img { position:absolute; max-width:none; transform-origin:0 0; user-select:none; pointer-events:none; }
.contact-avatar-zoom-label { display:block; font-size:12px; font-weight:700; color:var(--text-muted); margin-bottom:6px; }
#contact-avatar-zoom { width:100%; accent-color:var(--accent-blue); }
.contact-avatar-candidates { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:12px; min-height:120px; margin:18px 0; }
.contact-avatar-candidate { border:1px solid var(--border-color); background:rgba(255,255,255,.04); border-radius:12px; padding:8px; color:var(--text-primary); cursor:pointer; }
.contact-avatar-candidate img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:9px; display:block; margin-bottom:7px; }
.contact-avatar-search-links { display:flex; flex-wrap:wrap; gap:8px; }
.contact-avatar-safety-note { display:flex; align-items:flex-start; gap:8px; margin-top:18px; padding:12px; border-radius:10px; color:var(--text-muted); background:rgba(59,130,246,.08); font-size:12px; }
.contact-avatar-safety-note svg { width:17px; flex:none; color:var(--accent-blue); }
@media (max-width:600px) { .contact-photo-actions { width:100%; } .contact-avatar-crop-stage { width:220px; height:220px; } }
