/* ==========================================================================
   DaisySMS Direct - Modern Dark Theme & Design System
   ========================================================================== */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1422;
  --bg-card: rgba(19, 26, 42, 0.75);
  --bg-card-hover: rgba(27, 36, 58, 0.85);
  --bg-input: #141b2d;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-glow: rgba(99, 102, 241, 0.25);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.ambient-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4338ca 0%, rgba(67, 56, 202, 0) 70%);
  top: -150px;
  left: 10%;
}

.ambient-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #0891b2 0%, rgba(8, 145, 178, 0) 70%);
  bottom: -200px;
  right: 5%;
}

.ambient-glow-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #7e22ce 0%, rgba(126, 34, 206, 0) 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.2;
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.logo-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.logo-text p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 14px #10b981; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

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

/* ==========================================================================
   Main Grid Layout
   ========================================================================== */
.main-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: start;
}

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

/* Glass Card */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title svg {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
}

.panel-title h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-count {
  font-size: 0.75rem;
  padding: 2px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

/* ==========================================================================
   Left Column: Service Selector
   ========================================================================== */
.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 42px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-normal);
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--border-glow);
  background: rgba(20, 27, 45, 0.95);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 4px;
}

.search-clear:hover {
  color: var(--text-primary);
}

/* Quick Filters */
.quick-tags-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-tags-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.quick-tags-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
  user-select: none;
}

.tag-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.tag-chip.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: #a5b4fc;
}

/* Services Scrollable List */
.services-list-container {
  height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(13, 17, 28, 0.6);
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.services-list-container::-webkit-scrollbar {
  width: 6px;
}

.services-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

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

.service-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.service-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
}

.service-item.selected {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.service-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #c7d2fe;
}

.service-item.selected .service-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
}

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

.service-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
}

.service-code {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
}

.service-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.stock-pill.low {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}

.stock-pill.out {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.2);
}

/* Service Selection Box Summary */
.selected-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

.selected-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.selected-summary-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.selected-summary-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Primary Purchase Action Button */
.btn-purchase {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-purchase:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 50%, #6d28d9 100%);
}

.btn-purchase:active:not(:disabled) {
  transform: translateY(0);
}

.btn-purchase:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-purchase svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
}

/* Spinner inside button */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* ==========================================================================
   Right Column: Active Rental & Live SMS Receiver
   ========================================================================== */
.active-session-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Empty State */
.empty-receiver-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  gap: 16px;
}

.empty-icon-wrapper {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 6px;
}

.empty-icon-wrapper svg {
  width: 36px;
  height: 36px;
}

.empty-receiver-state h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-receiver-state p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.5;
}

/* Live Active State */
.active-receiver-view {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease;
}

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

.active-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.active-service-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #a5b4fc;
}

.countdown-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: monospace;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Phone Number Display Box */
.phone-display-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(30, 41, 69, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  gap: 12px;
  text-align: center;
  position: relative;
}

.phone-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-number-text {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  font-family: 'JetBrains Mono', Consolas, monospace;
  cursor: pointer;
  transition: var(--transition-fast);
}

.phone-number-text:hover {
  color: #818cf8;
}

.btn-copy-number {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-copy-number:hover {
  background: rgba(99, 102, 241, 0.28);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-copy-number svg {
  width: 15px;
  height: 15px;
}

/* SMS Polling Radar Box */
.sms-status-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  position: relative;
  text-align: center;
  gap: 14px;
  transition: var(--transition-normal);
}

.sms-status-box.waiting {
  border-color: rgba(99, 102, 241, 0.3);
}

.sms-status-box.received {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 25px var(--accent-emerald-glow);
}

/* Radar Animation */
.radar-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-core {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 14px var(--primary);
  z-index: 2;
}

.radar-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0.8;
  animation: radar-pulse 2.2s cubic-bezier(0.1, 0.2, 0.7, 1) infinite;
}

.radar-wave:nth-child(2) {
  animation-delay: 0.7s;
}

.radar-wave:nth-child(3) {
  animation-delay: 1.4s;
}

@keyframes radar-pulse {
  0% { width: 14px; height: 14px; opacity: 0.9; }
  100% { width: 68px; height: 68px; opacity: 0; }
}

.sms-status-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sms-status-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Received Code Highlight Box */
.received-code-card {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.received-code-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #34d399;
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
}

.received-code-box {
  padding: 14px 28px;
  background: rgba(16, 185, 129, 0.12);
  border: 2px solid #10b981;
  border-radius: var(--radius-lg);
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #34d399;
  text-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  user-select: all;
  cursor: pointer;
  transition: var(--transition-fast);
}

.received-code-box:hover {
  transform: scale(1.03);
}

.btn-copy-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  background: #10b981;
  border: none;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: var(--transition-fast);
}

.btn-copy-code:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.6);
}

.full-sms-message {
  font-size: 0.84rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  word-break: break-word;
}

/* Actions Row */
.active-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-action-cancel {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-action-cancel:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #ffffff;
}

.btn-action-complete {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-action-complete:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #ffffff;
}

/* ==========================================================================
   Bottom Section: History Table
   ========================================================================== */
.history-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.history-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(13, 17, 28, 0.5);
}

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

.history-table th {
  padding: 12px 16px;
  background: rgba(20, 27, 45, 0.6);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.history-table tr:last-child td {
  border-bottom: none;
}

.history-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.history-phone {
  font-family: monospace;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-code {
  font-family: monospace;
  font-weight: 700;
  color: #34d399;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.history-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ==========================================================================
   Modals & Drawers
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-content {
  width: 100%;
  max-width: 480px;
  background: #111726;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

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

.form-input {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.btn-secondary {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

.btn-primary {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  background: var(--primary);
  border: none;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

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

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: var(--transition-fast);
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #f43f5e;
}

.toast.info {
  border-left: 4px solid #6366f1;
}

@keyframes toastIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   API Documentation Modal & Proxy UI
   ========================================================================== */
.btn-api-docs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-api-docs:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-api-docs svg {
  width: 15px;
  height: 15px;
}

/* Docs Modal Content */
.docs-modal-content {
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.docs-modal-body {
  overflow-y: auto;
  max-height: calc(90vh - 180px);
  padding-right: 6px;
}

/* Tabs */
.docs-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.docs-tab-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.docs-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.docs-tab-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
}

.docs-tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.docs-tab-pane.active {
  display: flex;
}

/* Banner */
.proxy-url-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
}

.proxy-url-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a5b4fc;
}

.proxy-url-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.proxy-url-display code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.92rem;
  color: #38bdf8;
  word-break: break-all;
}

/* Endpoint Card */
.endpoint-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-method {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.badge-method.get {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.endpoint-path {
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  flex-grow: 1;
}

.endpoint-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.btn-run-test {
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-run-test:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

/* Parameter Table */
.param-table-wrapper {
  overflow-x: auto;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.param-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.param-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.param-table code {
  font-family: monospace;
  color: #a5b4fc;
}

/* Code Snippet Blocks */
.code-block-wrapper {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #090d16;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.code-snippet {
  padding: 14px;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}

.btn-copy-mini {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-copy-mini:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* Live Test Output */
.docs-test-output-wrapper {
  background: #090d16;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}

.test-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(99, 102, 241, 0.1);
  font-size: 0.75rem;
  color: #a5b4fc;
  font-weight: 600;
}

.test-output-pre {
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #38bdf8;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Guide Box */
.guide-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
}

/* ==========================================================================
   Admin Authentication & Login Portal
   ========================================================================== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  background-color: var(--bg-dark);
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 10;
  animation: loginAppear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginAppear {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 36px 32px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(99, 102, 241, 0.15);
}

.login-header {
  text-align: center;
  margin-bottom: 26px;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.3));
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a5b4fc;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
}

.login-logo-icon svg {
  width: 28px;
  height: 28px;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: dotPulse 1.8s infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-header p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.login-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.login-alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #f87171;
}

.login-alert.shake {
  animation: alertShake 0.4s ease-in-out;
}

@keyframes alertShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: var(--text-muted);
  pointer-events: none;
  transition: var(--transition-fast);
}

.input-with-icon input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  transition: var(--transition-fast);
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-with-icon input:focus + .input-icon,
.input-with-icon:focus-within .input-icon {
  stroke: var(--primary-light);
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

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

.btn-toggle-pwd svg {
  width: 18px;
  height: 18px;
}

.form-row-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

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

.remember-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-login {
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
}

.btn-login:active:not(:disabled) {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.btn-login .btn-arrow {
  width: 18px;
  height: 18px;
  transition: var(--transition-fast);
}

.btn-login:hover .btn-arrow {
  transform: translateX(4px);
}

.login-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.security-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.security-note svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-muted);
}

/* ==========================================================================
   Header User Pill & Logout Button
   ========================================================================== */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: #c7d2fe;
  font-weight: 500;
}

.user-pill svg {
  width: 14px;
  height: 14px;
  stroke: #818cf8;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-full);
  color: #fda4af;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-logout svg {
  width: 14px;
  height: 14px;
  stroke: #f43f5e;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  color: #ffffff;
  transform: translateY(-1px);
}


