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

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #121824;
  --bg-card: rgba(22, 30, 46, 0.75);
  --bg-card-hover: rgba(28, 38, 58, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.3);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --brand-primary: #6366f1;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --ringover-blue: #0084ff;
  --ringover-gradient: linear-gradient(135deg, #0084ff 0%, #00c6ff 100%);
  
  --status-delivered: #10b981;
  --status-delivered-bg: rgba(16, 185, 129, 0.12);
  --status-failed: #ef4444;
  --status-failed-bg: rgba(239, 68, 68, 0.12);
  --status-noanswer: #f59e0b;
  --status-noanswer-bg: rgba(245, 158, 11, 0.12);
  
  --obs-tms: #8b5cf6;
  --obs-tms-bg: rgba(139, 92, 246, 0.15);
  --obs-retry: #06b6d4;
  --obs-retry-bg: rgba(6, 182, 212, 0.15);
  
  --cruzmer-color: #ec4899;
  --marie-color: #3b82f6;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(217, 70, 239, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  padding-bottom: 60px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-badge {
  width: 52px;
  height: 52px;
  background: var(--ringover-gradient);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 132, 255, 0.3);
  color: #fff;
  font-size: 24px;
}

.brand-title h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title p {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cf-badge {
  background: rgba(246, 130, 31, 0.15);
  color: #f6821f;
  border: 1px solid rgba(246, 130, 31, 0.3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Agent Tabs */
.agent-tabs {
  display: flex;
  background: rgba(18, 24, 36, 0.8);
  padding: 5px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.tab-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.tab-btn.active.cruzmer-tab {
  background: var(--cruzmer-color);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

.tab-btn.active.marie-tab {
  background: var(--marie-color);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.tab-count {
  background: rgba(255, 255, 255, 0.2);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card.clickable:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.total { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.stat-icon.delivered { background: var(--status-delivered-bg); color: var(--status-delivered); }
.stat-icon.failed { background: var(--status-failed-bg); color: var(--status-failed); }
.stat-icon.noanswer { background: var(--status-noanswer-bg); color: var(--status-noanswer); }
.stat-icon.tms { background: var(--obs-tms-bg); color: var(--obs-tms); }
.stat-icon.retry { background: var(--obs-retry-bg); color: var(--obs-retry); }

.stat-info h3 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-info p {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

/* Progress Bar */
.progress-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: 6px;
  transition: width 0.4s ease;
}

/* Controls Bar */
.controls-bar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.search-box {
  position: relative;
  flex: 1 1 300px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-color);
  padding: 10px 14px 10px 40px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.filters-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-select {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--brand-primary);
}

.btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-accent {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-accent:hover {
  opacity: 0.95;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

/* Export Dropdown Menu */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 100;
  min-width: 220px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.export-menu.hidden {
  display: none;
}

.export-menu button {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
}

.export-menu button:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.btn-ringover {
  background: var(--ringover-gradient);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 132, 255, 0.3);
}

.btn-ringover:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 132, 255, 0.45);
}

/* Copy CS Message Button */
.copy-cs-btn {
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  transition: all 0.2s ease;
}

.copy-cs-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  color: #ffffff;
  border-color: rgba(139, 92, 246, 0.5);
}

/* Custom Notes Field */
.note-box {
  width: 100%;
  margin-top: 2px;
}

.note-input {
  width: 100%;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 48px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.note-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.note-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

/* Dates Box */
.dates-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.date-sep {
  opacity: 0.3;
}

/* Products Box */
.products-box {
  align-items: flex-start !important;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4px;
}

.products-box i {
  color: #ec4899 !important;
  margin-top: 3px;
}

.products-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.products-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.products-list {
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.4;
  font-weight: 500;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}

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

.pkg-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.pkg-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pkg-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
}

.pkg-card.status-entregado::before { background: var(--status-delivered); }
.pkg-card.status-noentregado::before { background: var(--status-failed); }
.pkg-card.status-nocontesta::before { background: var(--status-noanswer); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.agent-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-badge.cruzmer {
  background: rgba(236, 72, 153, 0.15);
  color: var(--cruzmer-color);
  border: 1px solid rgba(236, 72, 153, 0.3);
}

.agent-badge.marie {
  background: rgba(59, 130, 246, 0.15);
  color: var(--marie-color);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.pkg-code-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 14, 23, 0.7);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pkg-label {
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 11px;
}

.pkg-code {
  font-family: monospace;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  border-radius: 4px;
}

.copy-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.customer-info h2 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.customer-meta {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-item i {
  color: var(--brand-primary);
  width: 14px;
}

/* Ringover Call Box */
.ringover-call-box {
  background: rgba(0, 132, 255, 0.07);
  border: 1px solid rgba(0, 132, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.phone-display {
  display: flex;
  flex-direction: column;
}

.phone-number {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.phone-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

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

.call-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ringover-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 132, 255, 0.4);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.call-icon-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 132, 255, 0.6);
}

.call-icon-btn.web-btn {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  border: 1px solid var(--border-color);
}

.call-icon-btn.web-btn:hover {
  background: rgba(0, 132, 255, 0.3);
  border-color: rgba(0, 132, 255, 0.6);
}

/* Management Form Controls */
.management-box {
  background: rgba(10, 14, 23, 0.4);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Status Button Pills */
.status-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.pill-btn {
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.pill-btn.active[data-val="ENTREGADO"] {
  background: var(--status-delivered-bg);
  color: var(--status-delivered);
  border-color: var(--status-delivered);
}

.pill-btn.active[data-val="NO ENTREGADO"] {
  background: var(--status-failed-bg);
  color: var(--status-failed);
  border-color: var(--status-failed);
}

.pill-btn.active[data-val="NO CONTESTA"] {
  background: var(--status-noanswer-bg);
  color: var(--status-noanswer);
  border-color: var(--status-noanswer);
}

/* Observation Checks */
.obs-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.toggle-label:hover {
  background: rgba(255, 255, 255, 0.05);
}

.toggle-label input[type="checkbox"] {
  accent-color: var(--brand-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.toggle-label.checked-tms {
  background: var(--obs-tms-bg);
  border-color: rgba(139, 92, 246, 0.4);
  color: #ddd6fe;
}

.toggle-label.checked-retry {
  background: var(--obs-retry-bg);
  border-color: rgba(6, 182, 212, 0.4);
  color: #cffaff;
}

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

.toast {
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--brand-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  animation: slideIn 0.3s ease;
}

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

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-results i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}
