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

.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: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s ease-out forwards;
}

.modal-box {
  width: 100%;
  max-width: 600px;
  padding: 32px;
  position: relative;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.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: 24px;
}

.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;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

/* 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;
}

.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); }

.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-calls-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.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;
}



