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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-weight: 500;
  background: #0a0e1a;
  background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.5)), url('../image8.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #fff;
  min-height: 100vh;
  letter-spacing: 0.02em;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  padding: 20px;
}

.login-container {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.login-title {
  text-align: center;
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.login-subtitle {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #d1d5db;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-group input {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
}

.form-group input::placeholder {
  color: #6b7280;
}

.password-input-wrapper {
  position: relative;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

.forgot-password {
  color: #3b82f6;
  font-size: 0.85rem;
  text-decoration: none;
  text-align: right;
  margin-top: 4px;
}

.forgot-password:hover {
  text-decoration: underline;
}

.login-error {
  color: #ef4444;
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
}

.login-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.login-btn:hover {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #374151;
}

.login-divider span {
  padding: 0 16px;
  color: #6b7280;
  font-size: 0.85rem;
}

.google-btn {
  width: 100%;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background 0.2s;
}

.google-btn:hover:not(:disabled) {
  background: #374151;
}

.google-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.google-btn svg {
  width: 20px;
  height: 20px;
}

.discord-btn {
  width: 100%;
  background: #5865F2;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}

.discord-btn:hover:not(:disabled) {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
}

.discord-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.discord-btn svg {
  width: 24px;
  height: 24px;
}

.company-name {
  text-align: center;
  margin-bottom: 32px;
}

.company-name h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.company-name p {
  color: #6b7280;
  font-size: 0.95rem;
  margin-top: 8px;
}

.signup-link {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  margin-top: 24px;
}

.signup-link a {
  color: #3b82f6;
  text-decoration: none;
}

.signup-link a:hover {
  text-decoration: underline;
}

/* ==================== ANNOUNCEMENT BAR ==================== */
.announcement-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 1000;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease-out;
}

.announcement-bar svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.main-app.has-announcement .sidebar {
  top: 48px;
}

.main-app.has-announcement .main-content {
  padding-top: 48px;
}

/* ==================== MAIN APP LAYOUT ==================== */
.main-app {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 240px;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(99, 102, 241, 0.15);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

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

.sidebar-logo span {
  font-weight: 700;
  font-size: 1.15rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #9ca3af;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 600;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.sidebar-bottom {
  padding: 16px 12px;
  border-top: 1px solid rgba(99, 102, 241, 0.15);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==================== TOP BAR ==================== */
.top-bar {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  padding: 16px 24px;
  display: flex;
  position: relative;
  z-index: 100;
  justify-content: space-between;
  align-items: center;
}

.page-title h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-title p {
  color: #6b7280;
  font-size: 0.85rem;
}

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

/* Language Switcher */
.lang-switcher {
  display: flex;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn.active {
  background: #6366f1;
  color: #fff;
}

/* Category Selector (in Template Overlay) */
.template-category-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  margin: 16px 0;
  padding: 12px 16px;
  background: rgba(31, 41, 55, 0.5);
  border-radius: 10px;
}

.category-label {
  color: #9ca3af;
  font-size: 0.9rem;
  font-weight: 500;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  color: #3b82f6;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.category-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
}

.category-btn .dropdown-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.category-btn.open .dropdown-icon {
  transform: rotate(180deg);
}

.category-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.98);
  border: 1px solid rgba(75, 85, 99, 0.5);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 100;
  min-width: 100px;
}

.category-option {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #d1d5db;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}

.category-option:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.category-option.active {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.admin-view-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-view-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.admin-view-btn svg {
  width: 18px;
  height: 18px;
}

.notification-btn,
.help-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.notification-btn:hover,
.help-btn:hover {
  background: #1f2937;
  color: #fff;
}

.notification-btn svg,
.help-btn svg {
  width: 20px;
  height: 20px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #1f2937;
  border-radius: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

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

.user-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.user-role {
  color: #6b7280;
  font-size: 0.75rem;
}

/* ==================== PAGE CONTENT ==================== */
.page-content {
  flex: 1;
  padding: 24px;
  background: transparent;
}

.dialer-layout {
  display: grid;
  grid-template-columns: 380px 1fr 280px;
  gap: 24px;
  max-width: 1500px;
}

/* Auto mode layout - dialpad hidden, expand recent calls */
.dialer-layout.auto-mode-active {
  grid-template-columns: 1fr 280px;
}

.dialer-layout.auto-mode-active .recent-calls-card {
  max-height: calc(100vh - 350px);
}

.dialer-layout.auto-mode-active .call-history-list {
  max-height: calc(100vh - 420px);
}

/* ==================== DIALPAD CARD ==================== */
.dialpad-card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(99, 102, 241, 0.08);
}

.connection-status {
  text-align: center;
  margin-bottom: 16px;
}

.status-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge.connected {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* Category Selector in Dialpad */
.category-selector-dialer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.category-label-dialer {
  font-size: 0.9rem;
  font-weight: 600;
  color: #a5b4fc;
}

.category-dropdown-wrapper {
  position: relative;
}

.category-selector-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  justify-content: center;
}

.category-selector-btn:hover {
  background: #6366f1;
  transform: translateY(-1px);
}

.dropdown-arrow-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.category-selector-btn.active .dropdown-arrow-icon {
  transform: rotate(180deg);
}

.category-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 120px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: none;
}

.category-dropdown-menu.show {
  display: block;
  animation: fadeIn 0.15s ease;
}

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

.category-dropdown-option {
  display: block;
  width: 100%;
  padding: 10px 20px;
  background: none;
  border: none;
  color: #d1d5db;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.category-dropdown-option:hover {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
}

.category-dropdown-option.selected {
  background: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.status-badge.disconnected {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.client-name-input-wrapper {
  margin-bottom: 16px;
}

.client-name-input {
  width: 100%;
  background: rgba(31, 41, 55, 0.8);
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  color: #fff;
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: all 0.2s;
}

.client-name-input:focus {
  border-color: #6366f1;
  background: rgba(31, 41, 55, 1);
}

.client-name-input::placeholder {
  color: #6b7280;
}

.client-name-input.error {
  border-color: #ef4444;
  animation: shake 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.display {
  background: rgba(31, 41, 55, 0.6);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

#numberDisplay {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.85rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#numberDisplay::placeholder {
  color: #6b7280;
}

.call-status {
  color: #6b7280;
  font-size: 0.9rem;
  margin-top: 8px;
}

.call-status.calling {
  color: #3b82f6;
}

.call-status.ringing {
  color: #f59e0b;
  animation: pulse 1s infinite;
}

.call-status.connected {
  color: #22c55e;
}

.call-timer {
  color: #22c55e;
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 4px;
  min-height: 1.4em;
}

.dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.digit {
  background: rgba(31, 41, 55, 0.7);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 50%;
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  margin: 0 auto;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.digit:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
  transform: scale(1.05);
}

.digit:active {
  background: rgba(99, 102, 241, 0.4);
  transform: scale(0.95);
}

.digit span {
  font-size: 0.55rem;
  font-weight: 600;
  color: #9ca3af;
  margin-top: 2px;
  letter-spacing: 1px;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.action-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.action-btn svg {
  width: 26px;
  height: 26px;
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.call-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.call-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

.hangup-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.hangup-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #f87171, #ef4444);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.clear-btn {
  background: rgba(55, 65, 81, 0.8);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #fff;
}

.clear-btn:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.3);
  transform: scale(1.05);
}

.audio-status {
  text-align: center;
  margin-top: 12px;
  font-size: 0.8rem;
  color: #6b7280;
  min-height: 1.2em;
}

.audio-status.error {
  color: #ef4444;
}

.audio-status.success {
  color: #22c55e;
}

/* Client Name Display */
.client-name-display {
  text-align: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.client-name-display .client-label {
  font-size: 0.7rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.client-name-display .client-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

/* ==================== RECENT CALLS CARD ==================== */
.recent-calls-card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(99, 102, 241, 0.08);
}

/* ==================== CURRENT STATS CARD ==================== */
.current-stats-card {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(99, 102, 241, 0.08);
  height: fit-content;
}

.current-stats-card.compact .card-header h2 {
  font-size: 0.9rem;
}

.current-stats-card.compact .stat-item {
  padding: 10px;
}

.current-stats-card.compact .stat-icon-wrapper {
  width: 32px;
  height: 32px;
}

.current-stats-card.compact .stat-icon-wrapper svg {
  width: 18px;
  height: 18px;
}

.current-stats-card.compact .stat-info .stat-label {
  font-size: 0.7rem;
}

.current-stats-card.compact .stat-info .stat-value {
  font-size: 1rem;
}

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

.current-stats-card .card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.refresh-stats-btn {
  background: transparent;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 6px 10px;
  color: #9ca3af;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-stats-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.5);
}

.stats-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(31, 41, 55, 0.6);
  border-radius: 12px;
  transition: background 0.2s;
}

.stat-item:hover {
  background: rgba(31, 41, 55, 0.9);
}

.stat-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper.connected {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  color: #22c55e;
}

.stat-icon-wrapper.sales {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
  color: #fbbf24;
}

.stat-icon-wrapper svg {
  width: 22px;
  height: 22px;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-info .stat-label {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 500;
}

.stat-info .stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
  overflow-wrap: break-word;
}

.sales-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sales-rank-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

/* Gold - #1 */
.sales-rank-badge.rank-1 {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

/* Silver - #2 */
.sales-rank-badge.rank-2 {
  background: rgba(156, 163, 175, 0.2);
  color: #d1d5db;
  border: 1px solid rgba(156, 163, 175, 0.4);
}

/* Bronze - #3 */
.sales-rank-badge.rank-3 {
  background: rgba(180, 120, 60, 0.2);
  color: #cd7f32;
  border: 1px solid rgba(180, 120, 60, 0.4);
}

/* Everyone else */
.sales-rank-badge.rank-4 {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.stat-divider {
  height: 1px;
  background: rgba(99, 102, 241, 0.15);
  margin: 4px 0;
}

.stat-footer {
  text-align: center;
}

.last-updated {
  font-size: 0.7rem;
  color: #6b7280;
}

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

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.view-stats-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.view-stats-btn:hover {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.view-stats-btn svg {
  width: 18px;
  height: 18px;
}

.call-history-list {
  flex: 1;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}

.call-history-list::-webkit-scrollbar {
  width: 6px;
}

.call-history-list::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 3px;
}

.call-history-list::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 3px;
}

.no-history {
  color: #6b7280;
  text-align: center;
  padding: 40px 20px;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 14px;
  background: #1f2937;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.history-item:hover {
  background: #374151;
}

.history-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.history-icon.outgoing {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.history-icon.connected {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.history-icon.failed {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.history-icon svg {
  width: 18px;
  height: 18px;
}

.history-details {
  flex: 1;
}

.history-number {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.history-time {
  color: #6b7280;
  font-size: 0.8rem;
}

.history-duration {
  color: #22c55e;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 12px;
}

.history-status {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
}

.history-status.connected {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.history-status.no-service,
.history-status.failed {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.history-status.short {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.history-status.busy {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

.history-status.no-answer {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.history-status.declined {
  background: rgba(236, 72, 153, 0.2);
  color: #ec4899;
}

.history-status.cancelled {
  background: rgba(107, 114, 128, 0.2);
  color: #6b7280;
}

.history-status.invalid {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.history-status.not-allowed {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ==================== OVERLAYS ==================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.overlay-content {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.1);
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.overlay-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.overlay-header p {
  color: #6b7280;
  font-size: 0.85rem;
}

.close-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #fff;
}

/* ==================== STATS OVERLAY ==================== */
.stats-overlay-content {
  max-width: 580px;
}

.stats-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #1f2937;
}

.date-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1f2937;
  padding: 8px 16px;
  border-radius: 8px;
}

.date-picker svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.date-picker input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.date-picker input::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

.date-picker span {
  color: #6b7280;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #22c55e;
  font-size: 0.75rem;
  font-weight: 500;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 24px;
}

.stat-card {
  background: #1f2937;
  border-radius: 12px;
  padding: 20px;
  position: relative;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-icon.blue {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.stat-icon.purple {
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
}

.stat-icon.red {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.stat-trend {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.stat-trend.up {
  color: #22c55e;
}

.stat-trend.down {
  color: #ef4444;
}

.stat-label {
  color: #6b7280;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  word-break: break-all;
  line-height: 1.2;
}

.stat-subtext {
  color: #6b7280;
  font-size: 0.75rem;
  margin-top: 8px;
}

.stat-progress {
  height: 4px;
  background: #374151;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.stat-progress-bar {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  transition: width 0.3s;
}

.chart-section {
  padding: 0 24px 24px;
}

.chart-section h3 {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  color: #d1d5db;
}

.chart-container {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 120px;
  padding: 0 8px;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  background: #3b82f6;
  border-radius: 4px 4px 0 0;
  min-height: 0;
  transition: height 0.3s;
}

.chart-bar.connected {
  background: #22c55e;
}

.chart-bar.failed {
  background: #ef4444;
}

.chart-bar:hover {
  opacity: 0.8;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 8px 0;
}

.chart-labels span {
  color: #6b7280;
  font-size: 0.7rem;
}

.view-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 48px);
  margin: 0 24px 24px;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  padding: 14px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.view-all-btn:hover {
  background: #2563eb;
}

.view-all-btn svg {
  width: 18px;
  height: 18px;
}

/* ==================== ALL CALLS OVERLAY ==================== */
.all-calls-overlay-content {
  max-width: 800px;
}

.calls-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #1f2937;
  padding: 10px 16px;
  border-radius: 8px;
  flex: 1;
  max-width: 300px;
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.search-box input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.search-box input::placeholder {
  color: #6b7280;
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1f2937;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  color: #9ca3af;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn svg {
  width: 16px;
  height: 16px;
}

.filter-btn:hover {
  background: #374151;
  color: #fff;
}

.filter-btn.active {
  background: #3b82f6;
  color: #fff;
}

.calls-table {
  padding: 0 24px;
}

.table-header {
  display: grid;
  grid-template-columns: 80px 1fr 100px 140px 80px;
  gap: 16px;
  padding: 12px 16px;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #1f2937;
}

.table-body {
  max-height: 400px;
  overflow-y: auto;
}

.table-body::-webkit-scrollbar {
  width: 6px;
}

.table-body::-webkit-scrollbar-track {
  background: #1f2937;
}

.table-body::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 3px;
}

.call-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px 140px 80px;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #1f2937;
  align-items: center;
}

.call-row:hover {
  background: #1f2937;
}

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

.status-icon svg {
  width: 16px;
  height: 16px;
}

.status-icon.completed {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.status-icon.missed {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.status-icon.outgoing {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.status-icon.voicemail {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

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

.contact-name {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.contact-number {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}

.call-count {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #374151;
  border-radius: 10px;
  font-size: 0.7rem;
  color: #9ca3af;
}

.col-status .status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.connected {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-badge.no-service,
.status-badge.failed,
.status-badge.invalid,
.status-badge.not-allowed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.status-badge.busy {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.status-badge.no-answer {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.status-badge.declined {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
}

.status-badge.cancelled {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
}

.status-badge.short {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.col-duration {
  color: #d1d5db;
  font-size: 0.9rem;
}

.col-datetime {
  color: #6b7280;
  font-size: 0.85rem;
}

.col-actions {
  text-align: center;
}

.action-call {
  width: 32px;
  height: 32px;
  background: rgba(34, 197, 94, 0.15);
  border: none;
  border-radius: 8px;
  color: #22c55e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.action-call svg {
  width: 16px;
  height: 16px;
}

.action-call:hover {
  background: #22c55e;
  color: #fff;
}

.no-calls {
  padding: 40px;
  text-align: center;
  color: #6b7280;
}

.call-duration {
  color: #d1d5db;
  font-size: 0.9rem;
}

.call-datetime {
  color: #6b7280;
  font-size: 0.85rem;
}

.call-actions {
  text-align: center;
}

.call-actions button {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
}

.call-actions button:hover {
  color: #fff;
}

.calls-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #1f2937;
}

.pagination-info {
  color: #6b7280;
  font-size: 0.85rem;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
}

.page-btn {
  width: 32px;
  height: 32px;
  background: #1f2937;
  border: none;
  border-radius: 6px;
  color: #9ca3af;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-btn svg {
  width: 16px;
  height: 16px;
}

.page-btn:hover:not(.disabled) {
  background: #374151;
  color: #fff;
}

.page-btn.active {
  background: #3b82f6;
  color: #fff;
}

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==================== SETTINGS OVERLAY ==================== */
.settings-overlay-content {
  max-width: 400px;
  padding-bottom: 24px;
}

.settings-section {
  padding: 16px 24px;
}

.settings-section h3 {
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #1f2937;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-item:hover {
  background: #374151;
}

.settings-item svg {
  width: 20px;
  height: 20px;
  color: #6b7280;
}

.settings-item span {
  flex: 1;
}

.settings-item .arrow {
  width: 18px;
  height: 18px;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 14px;
  color: #ef4444;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.logout-btn svg {
  width: 20px;
  height: 20px;
}

/* ==================== PASSWORD OVERLAY ==================== */
.password-overlay-content {
  max-width: 400px;
}

.password-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-error {
  color: #ef4444;
  font-size: 0.85rem;
  text-align: center;
}

.form-success {
  color: #22c55e;
  font-size: 0.85rem;
  text-align: center;
}

.submit-btn {
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  padding: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: #2563eb;
}

/* ==================== INTEREST OVERLAY ==================== */
.interest-overlay-content {
  max-width: 350px;
  padding: 40px;
  text-align: center;
}

.interest-header {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.interest-header h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.interest-name {
  color: #fff !important;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  order: 1;
}

.interest-number {
  color: #22c55e !important;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  order: 2;
}

.interest-question {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.interest-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.interest-btn {
  padding: 16px 32px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.interest-btn.interested {
  background: #22c55e;
  color: white;
}

.interest-btn.interested:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

.interest-btn.not-interested {
  background: #ef4444;
  color: white;
}

.interest-btn.not-interested:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* ==================== GENDER OVERLAY ==================== */
.gender-overlay-content {
  max-width: 400px;
  padding: 40px;
  text-align: center;
}

.gender-header {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gender-header h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.gender-client-info {
  font-size: 1rem;
  font-weight: 600;
  color: #6366f1;
  margin-bottom: 8px;
}

.gender-question {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.gender-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gender-btn {
  padding: 16px 32px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.gender-btn.female {
  background: #ec4899;
  color: white;
}

.gender-btn.female:hover {
  background: #db2777;
  transform: translateY(-2px);
}

.gender-btn.male {
  background: #3b82f6;
  color: white;
}

.gender-btn.male:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

.gender-btn.none {
  background: #6b7280;
  color: white;
}

.gender-btn.none:hover {
  background: #4b5563;
  transform: translateY(-2px);
}

/* ==================== TEMPLATE OVERLAY ==================== */
.template-overlay-content {
  max-width: 380px;
  padding: 40px;
  text-align: center;
}

.template-header {
  margin-bottom: 24px;
}

.template-header h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.template-client-info {
  color: #22c55e;
  font-size: 1.1rem;
  font-weight: 600;
}

.template-question {
  color: #9ca3af;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.template-remark-wrapper {
  margin-bottom: 20px;
  text-align: left;
}

.remark-label {
  display: block;
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.remark-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(75, 85, 99, 0.5);
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.remark-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.remark-input::placeholder {
  color: #6b7280;
}

.template-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.template-btn {
  flex: 1;
  padding: 18px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.template-btn.english {
  background: #3b82f6;
  color: white;
}

.template-btn.english:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

.template-btn.chinese {
  background: #ef4444;
  color: white;
}

.template-btn.chinese:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.template-close-btn {
  padding: 12px 32px;
  background: transparent;
  border: 1px solid #4b5563;
  border-radius: 8px;
  color: #9ca3af;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.template-close-btn:hover {
  background: rgba(75, 85, 99, 0.3);
  color: #fff;
}

/* ==================== CONTACTS OVERLAY ==================== */
.contacts-overlay-content {
  max-width: 800px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.contacts-overlay-content .overlay-header {
  flex-shrink: 0;
}

.contacts-overlay-content .contacts-toolbar {
  flex-shrink: 0;
}

.contacts-overlay-content .contacts-pagination {
  flex-shrink: 0;
}

.contacts-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  gap: 16px;
  flex-wrap: wrap;
}

/* Category Filter Buttons */
.category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.category-filter-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #1f2937;
  color: #9ca3af;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-filter-btn:hover {
  background: #374151;
  color: #fff;
  border-color: #4f46e5;
}

.category-filter-btn.active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

/* Contact category badge */
.contact-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #374151;
  color: #9ca3af;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 8px;
}

.contacts-count {
  color: #6b7280;
  font-size: 0.9rem;
}

.contacts-table {
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.contacts-table .table-body {
  max-height: none;
  flex: 1;
  overflow-y: auto;
}

.contacts-table .table-header {
  grid-template-columns: 1fr 150px 120px 100px;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 150px 120px 100px;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid #1f2937;
  align-items: center;
}

.contact-row:hover {
  background: #1f2937;
}

.col-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
}

.contact-name-text {
  font-weight: 500;
  color: #fff;
}

.col-number {
  color: #9ca3af;
  font-size: 0.9rem;
}

.col-date {
  color: #6b7280;
  font-size: 0.85rem;
  line-height: 1.4;
}

.col-date .call-time {
  color: #9ca3af;
  font-size: 0.75rem;
}

.action-delete {
  width: 32px;
  height: 32px;
  background: rgba(239, 68, 68, 0.15);
  border: none;
  border-radius: 8px;
  color: #ef4444;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 8px;
}

.action-delete svg {
  width: 16px;
  height: 16px;
}

.action-delete:hover {
  background: #ef4444;
  color: #fff;
}

.no-contacts {
  padding: 40px;
  text-align: center;
  color: #6b7280;
}

.contacts-service-warning {
  padding: 10px 16px;
  margin-bottom: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #f87171;
  font-size: 0.85rem;
  text-align: center;
}

.contacts-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid #1f2937;
}

/* ==================== ANIMATIONS ==================== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
  .dialer-layout {
    grid-template-columns: 380px 1fr;
  }

  .dialer-layout .current-stats-card {
    display: none;
  }

  .dialpad-card {
    max-width: 380px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

  .stats-cards {
    grid-template-columns: 1fr;
  }

  .table-header,
  .call-row {
    grid-template-columns: 60px 1fr 80px;
  }

  .col-datetime,
  .call-datetime,
  .col-actions,
  .call-actions {
    display: none;
  }

  .filter-buttons {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .top-bar {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  .dialpad-card {
    padding: 16px;
  }

  .digit {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
  }

  .action-btn {
    width: 52px;
    height: 52px;
  }
}

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

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

.notification {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}


/* ==================== MODE SELECTOR ==================== */
.mode-selector {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.mode-toggle {
  display: flex;
  background: rgba(31, 41, 55, 0.8);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.mode-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.mode-icon {
  font-size: 1.1rem;
}

/* ==================== AUTO MODE PANEL ==================== */
.auto-mode-panel {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.auto-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.auto-mode-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

.sim-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #22c55e;
}

.sim-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

.sim-status.sim-busy {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.sim-status.sim-busy .sim-indicator {
  background: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.auto-mode-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.listing-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.listing-selector label {
  font-size: 0.9rem;
  color: #d1d5db;
  white-space: nowrap;
}

.listing-dropdown {
  flex: 1;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

.listing-dropdown:focus {
  outline: none;
  border-color: #6366f1;
}

.refresh-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: rgba(99, 102, 241, 0.2);
}

.auto-progress {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 8px;
  padding: 12px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #9ca3af;
}

.progress-bar {
  height: 6px;
  background: #374151;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.auto-actions {
  display: flex;
  gap: 12px;
}

.auto-btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auto-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.start-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

.start-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.stop-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.stop-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.skip-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

.skip-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.auto-status {
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}

.auto-status.status-info {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  display: block;
}

.auto-status.status-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  display: block;
}

.auto-status.status-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  display: block;
}

.current-call-info {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
}

.call-info-header {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.call-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

.call-info-row:last-child {
  border-bottom: none;
}

.call-info-label {
  font-size: 0.85rem;
  color: #9ca3af;
}

.call-info-value {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 500;
}

/* ==================== AUTO NEXT OVERLAY ==================== */
.auto-next-overlay-content {
  max-width: 400px;
  padding: 32px;
  text-align: center;
}

.auto-next-header h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.auto-next-header p {
  color: #9ca3af;
  font-size: 0.9rem;
}

.auto-next-info {
  background: rgba(31, 41, 55, 0.5);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
}

.next-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.next-info-label {
  color: #9ca3af;
  font-size: 0.9rem;
}

.next-info-value {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}

.auto-next-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.next-call-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.next-call-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.auto-next-actions .interest-btn {
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.auto-next-actions .interest-btn.interested {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.auto-next-actions .interest-btn.interested:hover {
  background: rgba(34, 197, 94, 0.2);
}

.auto-next-actions .interest-btn.not-interested {
  background: rgba(107, 114, 128, 0.1);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.auto-next-actions .interest-btn.not-interested:hover {
  background: rgba(107, 114, 128, 0.2);
  color: #fff;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
  .auto-actions {
    flex-direction: column;
  }

  .listing-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .auto-mode-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}


/* ==================== CATEGORY BADGES ==================== */
.category-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-badge.category-sd {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.category-badge.category-ss {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.category-badge.category-cm {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.category-badge.category-tx {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* Optgroup styling for categories */
optgroup {
  font-weight: 600;
  color: #9ca3af;
  background: #1f2937;
  padding: 5px 10px;
}

optgroup option {
  font-weight: 400;
  color: #e5e7eb;
  padding: 8px 10px;
  background: transparent;
}

/* ==================== PROFILE DROPDOWN ==================== */
.profile-dropdown-wrapper {
  position: relative;
  z-index: 1001;
}

.profile-trigger {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-trigger .dropdown-arrow {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  transition: transform 0.2s;
}

.profile-dropdown-wrapper:hover .dropdown-arrow {
  color: #e5e7eb;
}

.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: rgba(17, 24, 39, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  z-index: 1000;
  overflow: hidden;
}

.profile-dropdown.show {
  display: block;
  animation: dropdownFadeIn 0.15s ease;
}

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

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  background-size: cover;
  background-position: center;
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dropdown-username {
  font-weight: 600;
  font-size: 0.9rem;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-email {
  font-size: 0.75rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.profile-dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #f3f4f6;
}

.profile-dropdown-item svg {
  width: 18px;
  height: 18px;
  color: #9ca3af;
}

.profile-dropdown-item:hover svg {
  color: #a5b4fc;
}

.profile-dropdown-item.logout-item {
  color: #ef4444;
}

.profile-dropdown-item.logout-item:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.profile-dropdown-item.logout-item svg {
  color: #ef4444;
}

.profile-dropdown-item.logout-item:hover svg {
  color: #f87171;
}

/* Call Stats (daily) overlay */
.call-stats-overlay-content {
  max-width: 760px;
  width: 100%;
}

.filter-btn.call-stats-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
}

.filter-btn.call-stats-btn:hover {
  filter: brightness(1.1);
}

.call-stats-range-chips {
  display: flex;
  gap: 8px;
}

.range-chip {
  background: #1f2937;
  color: #9ca3af;
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.range-chip:hover {
  color: #e5e7eb;
  background: #273449;
}

.range-chip.active {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.5);
}

.call-stats-cards {
  grid-template-columns: repeat(4, 1fr);
}

.stat-icon.orange {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

.stat-icon.green {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.stat-card-highlight {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.call-stats-range-display {
  padding: 0 24px 24px;
  color: #9ca3af;
  font-size: 13px;
}

.call-stats-range-display strong {
  color: #e5e7eb;
  margin-left: 6px;
}

@media (max-width: 960px) {
  .call-stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.time-stats-section {
  padding: 0 24px 24px;
}

.time-stats-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.time-stats-header h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #e5e7eb;
}

.time-stats-header p {
  margin: 0;
  color: #9ca3af;
  font-size: 12px;
}

.time-stats-best {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.time-stats-best strong {
  color: #ffffff;
}

.time-stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding: 12px 8px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  overflow-x: auto;
}

.hour-col {
  flex: 1 1 0;
  min-width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.hour-bar-stack {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  align-items: center;
  gap: 1px;
}

.hour-bar {
  width: 80%;
  border-radius: 3px 3px 0 0;
  min-height: 0;
  transition: height 0.25s ease;
}

.hour-bar.answered {
  background: linear-gradient(to top, #16a34a, #22c55e);
}

.hour-bar.rejected {
  background: linear-gradient(to top, #b91c1c, #ef4444);
  opacity: 0.85;
}

.hour-col.best .hour-bar.answered {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.6);
}

.hour-col.best .hour-label {
  color: #86efac;
  font-weight: 600;
}

.hour-label {
  font-size: 10px;
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
}

.time-stats-legend {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-swatch.answered {
  background: linear-gradient(to top, #16a34a, #22c55e);
}

.legend-swatch.rejected {
  background: linear-gradient(to top, #b91c1c, #ef4444);
}

/* ======================== Leaderboard ======================== */

.leaderboard-overlay-content {
  max-width: 980px;
  width: 96%;
  padding: 0;
  overflow: hidden;
  position: relative;
  background: linear-gradient(180deg, #0b0f1a 0%, #131829 55%, #0b0f1a 100%);
  border: 1px solid rgba(251, 191, 36, 0.15);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(251, 191, 36, 0.08);
}

.leaderboard-hero {
  position: relative;
  padding: 26px 28px 10px;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(251, 191, 36, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 0%, rgba(99, 102, 241, 0.18), transparent 55%);
  overflow: hidden;
}

.leaderboard-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -20%, rgba(251, 191, 36, 0.25), transparent 40%);
  filter: blur(6px);
  opacity: 0.9;
  animation: leaderboard-hero-pulse 6s ease-in-out infinite;
}

@keyframes leaderboard-hero-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.leaderboard-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.leaderboard-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, #fbbf24, #fde68a, #fbbf24);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: leaderboard-shimmer 4s linear infinite;
}

@keyframes leaderboard-shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.leaderboard-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
}

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

.leaderboard-refresh-btn {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #e0e7ff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.leaderboard-refresh-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  transform: rotate(180deg);
}

.leaderboard-tabs {
  position: relative;
  display: flex;
  gap: 8px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  width: fit-content;
}

.leaderboard-tab {
  background: transparent;
  border: 0;
  color: rgba(226, 232, 240, 0.7);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.leaderboard-tab:hover {
  color: #f1f5f9;
}

.leaderboard-tab.active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1f2937;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.leaderboard-range-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 28px 6px;
}

.leaderboard-range-chips .range-chip {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: rgba(226, 232, 240, 0.8);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.leaderboard-range-chips .range-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.5);
}

.leaderboard-range-chips .range-chip.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.leaderboard-status {
  margin: 6px 28px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.leaderboard-status--loading {
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.leaderboard-status--error {
  background: rgba(239, 68, 68, 0.1);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ---- Podium ---- */

.podium-stage {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 18px;
  padding: 30px 28px 10px;
  min-height: 320px;
  position: relative;
}

.podium-col {
  flex: 0 1 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: podium-rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}

.podium-col--2 { animation-delay: 0.1s; }
.podium-col--1 { animation-delay: 0s; }
.podium-col--3 { animation-delay: 0.2s; }

@keyframes podium-rise {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.podium-empty {
  flex: 0 1 200px;
  visibility: hidden;
}

.podium-avatar-wrap {
  position: relative;
  margin-bottom: 10px;
}

.podium-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #1e293b;
  border: 3px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.podium-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.podium-col--1 .podium-avatar {
  width: 104px;
  height: 104px;
  border-color: #fbbf24;
  box-shadow:
    0 0 0 4px rgba(251, 191, 36, 0.2),
    0 0 40px rgba(251, 191, 36, 0.5),
    0 14px 40px rgba(0, 0, 0, 0.5);
  animation: leaderboard-glow 2.4s ease-in-out infinite;
}

@keyframes leaderboard-glow {
  0%, 100% {
    box-shadow:
      0 0 0 4px rgba(251, 191, 36, 0.2),
      0 0 40px rgba(251, 191, 36, 0.5),
      0 14px 40px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(251, 191, 36, 0.35),
      0 0 60px rgba(251, 191, 36, 0.75),
      0 14px 40px rgba(0, 0, 0, 0.5);
  }
}

.podium-col--2 .podium-avatar {
  border-color: #d1d5db;
  box-shadow:
    0 0 0 3px rgba(209, 213, 219, 0.18),
    0 0 24px rgba(209, 213, 219, 0.35),
    0 10px 30px rgba(0, 0, 0, 0.45);
}

.podium-col--3 .podium-avatar {
  border-color: #cd7f32;
  box-shadow:
    0 0 0 3px rgba(205, 127, 50, 0.18),
    0 0 24px rgba(205, 127, 50, 0.35),
    0 10px 30px rgba(0, 0, 0, 0.45);
}

.podium-medal {
  position: absolute;
  bottom: -6px;
  right: -6px;
  font-size: 26px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.podium-crown {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  filter: drop-shadow(0 4px 10px rgba(251, 191, 36, 0.6));
  animation: crown-float 2.6s ease-in-out infinite;
}

@keyframes crown-float {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-3deg); }
  50% { transform: translateX(-50%) translateY(-6px) rotate(3deg); }
}

.podium-name {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  margin-bottom: 4px;
}

.podium-col--1 .podium-name {
  font-size: 17px;
  color: #fef3c7;
}

.podium-value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
}

.podium-col--1 .podium-value {
  font-size: 24px;
  background: linear-gradient(135deg, #fbbf24, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.podium-sub {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.6);
  margin: 2px 0 10px;
  text-align: center;
}

.podium-you {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  margin-left: 4px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: 0.6px;
}

.podium-col--me .podium-avatar {
  outline: 3px solid rgba(139, 92, 246, 0.7);
  outline-offset: 3px;
}

.podium-plinth {
  width: 100%;
  max-width: 180px;
  border-radius: 10px 10px 4px 4px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25), 0 -2px 0 rgba(0, 0, 0, 0.3);
  position: relative;
}

.podium-plinth--1 {
  height: 150px;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 55%, #b45309 100%);
}

.podium-plinth--2 {
  height: 110px;
  background: linear-gradient(180deg, #e5e7eb 0%, #9ca3af 55%, #4b5563 100%);
}

.podium-plinth--3 {
  height: 80px;
  background: linear-gradient(180deg, #d97706 0%, #b45309 55%, #7c2d12 100%);
}

.podium-rank {
  font-size: 22px;
  font-weight: 900;
  color: rgba(0, 0, 0, 0.55);
  letter-spacing: 1px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.podium-plinth--1 .podium-rank {
  font-size: 28px;
}

/* ---- Rank list ---- */

.leaderboard-list {
  padding: 4px 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 12px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  position: relative;
}

.rank-row:hover {
  transform: translateX(4px);
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(99, 102, 241, 0.35);
}

.rank-row--me {
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(30, 41, 59, 0.8), rgba(30, 41, 59, 0.8)) padding-box,
    linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899) border-box;
  animation: rank-row-pulse 2.4s ease-in-out infinite;
}

@keyframes rank-row-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 0 18px 2px rgba(139, 92, 246, 0.35); }
}

.rank-number {
  font-size: 16px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.55);
  min-width: 38px;
}

.rank-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  border: 2px solid rgba(148, 163, 184, 0.3);
}

.rank-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-sub {
  font-size: 11px;
  color: rgba(226, 232, 240, 0.55);
  margin-top: 2px;
}

.rank-you {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  margin-left: 4px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border-radius: 4px;
  letter-spacing: 0.6px;
}

.rank-value {
  font-size: 16px;
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
}

.leaderboard-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(226, 232, 240, 0.5);
}

.leaderboard-empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.leaderboard-empty-text {
  font-size: 13px;
  font-weight: 500;
}

.leaderboard-footer {
  padding: 10px 28px 20px;
  text-align: right;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.45);
}

.leaderboard-footer .last-updated {
  font-variant-numeric: tabular-nums;
}

/* ---- Mobile ---- */

@media (max-width: 640px) {
  .leaderboard-overlay-content {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    border-radius: 0;
  }

  .podium-stage {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
    padding: 20px 16px;
    min-height: auto;
  }

  .podium-col, .podium-empty {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
  }

  .podium-empty { display: none; }

  .podium-avatar-wrap { margin-bottom: 0; }
  .podium-col--1 .podium-avatar { width: 70px; height: 70px; }
  .podium-avatar { width: 56px; height: 56px; }
  .podium-crown { top: -22px; font-size: 24px; }
  .podium-plinth { display: none; }
  .podium-name, .podium-col--1 .podium-name { text-align: left; max-width: none; }
  .podium-sub { text-align: left; margin-bottom: 0; }

  .leaderboard-list { padding: 4px 16px 20px; }
  .leaderboard-range-chips { padding: 14px 16px 6px; }
  .leaderboard-hero { padding: 20px 16px 10px; }
}
