/*
 * LogiLink UA - Premium Delivery CRM CSS
 * Styling for the MVP Delivery Dashboard & Telegram Bot Simulator
 */

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

:root {
  /* Color Palette */
  --bg-color: #08090d;
  --bg-gradient-start: #0a0b12;
  --bg-gradient-end: #12101f;
  
  --panel-bg: rgba(18, 20, 32, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-hover-border: rgba(255, 255, 255, 0.15);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.3);
  --primary-hover: #4f46e5;
  
  /* Brand colors */
  --color-comfy: #ff7a00;
  --color-comfy-glow: rgba(255, 122, 0, 0.15);
  --color-allo: #e30613;
  --color-allo-glow: rgba(227, 6, 19, 0.15);
  --color-moyo: #00e5ff;
  --color-moyo-glow: rgba(0, 229, 255, 0.15);
  --color-foxtrot: #ff007a;
  --color-foxtrot-glow: rgba(255, 0, 122, 0.15);
  
  /* Status Colors */
  --status-pending: #f59e0b;
  --status-pending-glow: rgba(245, 158, 11, 0.15);
  --status-assigned: #3b82f6;
  --status-assigned-glow: rgba(59, 130, 246, 0.15);
  --status-intransit: #8b5cf6;
  --status-intransit-glow: rgba(139, 92, 246, 0.15);
  --status-delivered: #10b981;
  --status-delivered-glow: rgba(16, 185, 129, 0.15);
  --status-returned: #ef4444;
  --status-returned-glow: rgba(239, 68, 68, 0.15);
  
  /* Fonts */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Grid/Spacing */
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at 10% 20%, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 9, 13, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

/* Premium Top Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2rem;
  background: rgba(10, 11, 18, 0.6);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.logo-icon::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg);
  animation: shine 4s infinite;
}

@keyframes shine {
  0% { transform: translate(-50%, -50%) rotate(45deg); }
  20% { transform: translate(50%, 50%) rotate(45deg); }
  100% { transform: translate(50%, 50%) rotate(45deg); }
}

.logo-text h1 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(to right, #fff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.logo-text span {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  margin-top: -2px;
}

/* Role Selector Styles */
.role-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--panel-border);
}

.role-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
}

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

.role-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Main Workspace Grid */
.main-content {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  padding: 1.5rem;
  flex: 1;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1300px) {
  .main-content {
    grid-template-columns: 1fr;
  }
  .phone-simulation-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    width: 100%;
    max-width: 380px;
  }
}

/* Views Wrapper */
.view-panel {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

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

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

/* Glass Panel Styling */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: border-color var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--panel-hover-border);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.panel-header h2 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Buttons */
.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-danger {
  background: var(--status-returned);
  border-color: transparent;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

/* Dispatcher Dashboard Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-card.comfy::before { background: var(--color-comfy); }
.stat-card.allo::before { background: var(--color-allo); }
.stat-card.moyo::before { background: var(--color-moyo); }
.stat-card.success::before { background: var(--status-delivered); }
.stat-card.returned::before { background: var(--status-returned); }

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 1px;
}

.stat-value {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: var(--text-primary);
}

.stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Main Dashboard Controls and Tables */
.dashboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-input-wrapper input, .api-key-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem 0.5rem 2.2rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.search-input-wrapper input:focus, .api-key-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: var(--transition-fast);
}

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

.filter-btn.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Orders Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

#dispatcher-view table {
  min-width: 850px;
}

#store-view table {
  min-width: 550px;
}

th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-title);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  vertical-align: middle;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* Tags and Badges */
.store-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.store-tag.comfy { background: var(--color-comfy-glow); color: var(--color-comfy); border: 1px solid rgba(255, 122, 0, 0.3); }
.store-tag.allo { background: var(--color-allo-glow); color: var(--color-allo); border: 1px solid rgba(227, 6, 19, 0.3); }
.store-tag.moyo { background: var(--color-moyo-glow); color: var(--color-moyo); border: 1px solid rgba(0, 229, 255, 0.3); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-badge.pending { background: var(--status-pending-glow); color: var(--status-pending); }
.status-badge.pending::before { background: var(--status-pending); }

.status-badge.assigned { background: var(--status-assigned-glow); color: var(--status-assigned); }
.status-badge.assigned::before { background: var(--status-assigned); }

.status-badge.intransit { background: var(--status-intransit-glow); color: var(--status-intransit); }
.status-badge.intransit::before { background: var(--status-intransit); }

.status-badge.delivered { background: var(--status-delivered-glow); color: var(--status-delivered); }
.status-badge.delivered::before { background: var(--status-delivered); }

.status-badge.returned { background: var(--status-returned-glow); color: var(--status-returned); }
.status-badge.returned::before { background: var(--status-returned); }

/* Form Elements */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group.full-width {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .form-group.full-width {
    grid-column: span 1;
  }
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

/* AI Parser Specific Styles */
.ai-parser-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(167, 139, 250, 0.05));
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.ai-parser-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-title);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.ai-badge {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-textarea {
  width: 100%;
  height: 100px;
  background: rgba(8, 9, 13, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  resize: vertical;
  outline: none;
  margin-bottom: 0.75rem;
  transition: var(--transition-fast);
}

.ai-textarea:focus {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.ai-loading-container {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.ai-loading-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.ai-loading-step i {
  color: var(--text-muted);
}

.ai-loading-step.active {
  color: var(--primary);
}

.ai-loading-step.active i {
  color: var(--primary);
  animation: spin 1s linear infinite;
}

.ai-loading-step.done {
  color: var(--status-delivered);
}

.ai-loading-step.done i {
  color: var(--status-delivered);
}

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

/* Dispatcher Dashboard Grid Layout */
.grid-two-cols {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .grid-two-cols {
    grid-template-columns: 1fr;
  }
}

/* Expeditor Card List */
.expeditor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.expeditor-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-fast);
}

.expeditor-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--panel-hover-border);
}

.exp-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.exp-avatar {
  width: 36px;
  height: 36px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.exp-details h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.exp-details p {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.exp-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.exp-load {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Interactive Phone Simulator */
.phone-simulation-container {
  display: flex;
  flex-direction: column;
}

.phone-simulator {
  width: 100%;
  height: 680px;
  background: #0f1015;
  border: 10px solid #1f2029;
  border-radius: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Phone notch */
.phone-simulator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 25px;
  background: #1f2029;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  z-index: 10;
}

/* Telegram Bot View inside Simulator */
.tg-header {
  background: #17212b;
  padding: 1.8rem 1rem 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  z-index: 5;
}

.tg-back-btn {
  color: #64b5f6;
  cursor: pointer;
  display: none;
}

.tg-avatar {
  width: 38px;
  height: 38px;
  background: #2b5278;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}

.tg-bot-info h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.tg-bot-info p {
  font-size: 0.7rem;
  color: #7f91a4;
}

.tg-body {
  flex: 1;
  background: #0e1621;
  background-image: radial-gradient(circle, rgba(23, 33, 43, 0.5) 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Message Bubbles */
.tg-message {
  max-width: 85%;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  line-height: 1.4;
  position: relative;
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.tg-message.bot {
  background: #182533;
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.tg-message.user {
  background: #2b5278;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.tg-time {
  font-size: 0.65rem;
  color: #7f91a4;
  text-align: right;
  margin-top: 0.25rem;
  display: block;
}

/* Bot Inline Buttons */
.tg-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
  width: 100%;
}

.tg-btn {
  background: #24303f;
  color: #64b5f6;
  border: none;
  padding: 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-family: var(--font-body);
}

.tg-btn:hover {
  background: #2e3e52;
}

/* Custom TG Driver Selector input */
.tg-login-select {
  width: 100%;
  background: #24303f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: 6px;
  outline: none;
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

/* Delivery Job Card inside Telegram Bot */
.tg-job-card {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--primary);
  padding: 0.5rem 0.65rem;
  border-radius: 4px;
  margin: 0.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tg-job-card.comfy { border-left-color: var(--color-comfy); }
.tg-job-card.allo { border-left-color: var(--color-allo); }
.tg-job-card.moyo { border-left-color: var(--color-moyo); }

.tg-job-title {
  font-weight: 700;
  font-size: 0.75rem;
}

/* Bottom Input Bar for simulation */
.tg-footer {
  background: #17212b;
  padding: 0.6rem 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tg-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: #fff;
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  outline: none;
  font-family: var(--font-body);
}

.tg-send-btn {
  background: transparent;
  border: none;
  color: #64b5f6;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.tg-send-btn:hover {
  transform: scale(1.1);
}

/* Notification Popups (Toast) */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: rgba(18, 20, 32, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  color: #fff;
  font-size: 0.8rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

.toast.success { border-color: var(--status-delivered); }
.toast.info { border-color: var(--status-assigned); }
.toast.warning { border-color: var(--status-pending); }
.toast.danger { border-color: var(--status-returned); }

/* Details modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  background: #11131e;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

/* History Timeline */
.timeline {
  margin-top: 1rem;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 5px;
  width: 2px;
  height: 90%;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-item {
  position: relative;
  margin-bottom: 0.85rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #11131e;
}

.timeline-item.delivered::before { background: var(--status-delivered); }
.timeline-item.returned::before { background: var(--status-returned); }
.timeline-item.intransit::before { background: var(--status-intransit); }

.timeline-time {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.timeline-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Route list styling for map simulator */
.map-simulator {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  height: 250px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.map-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(#151622 15%, transparent 20%),
    radial-gradient(#1c1e30 15%, transparent 20%);
  background-size: 30px 30px;
  background-position: 0 0, 15px 15px;
  opacity: 0.6;
}

.map-point {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
  z-index: 2;
}

.map-point:hover {
  transform: scale(1.3);
}

.map-point.comfy { background: var(--color-comfy); box-shadow: 0 0 10px var(--color-comfy); }
.map-point.allo { background: var(--color-allo); box-shadow: 0 0 10px var(--color-allo); }
.map-point.moyo { background: var(--color-moyo); box-shadow: 0 0 10px var(--color-moyo); }

.map-point::after {
  content: attr(data-label);
  position: absolute;
  top: 15px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.map-line {
  position: absolute;
  background: rgba(99, 102, 241, 0.2);
  height: 2px;
  transform-origin: 0 50%;
  pointer-events: none;
  z-index: 1;
}

/* API Setup Widget */
.api-setup {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* Interactive elements & utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.space-between { justify-content: space-between; }
.align-center { align-items: center; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.1);
}

.tabs-container {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 1rem;
  gap: 1rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 0.2rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

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

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
}

/* District Grid Helper */
.district-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.district-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.district-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
