/* ==========================================================================
   Google Maps Scraper - Modern Minimal SaaS Design System
   Dual Theme (Dark / Light) with Clean Typographic & Spatial Hierarchy
   ========================================================================== */

/* Theme Variables */
:root, [data-theme="dark"] {
  --bg-page: #0b0f19;
  --bg-card: #121927;
  --bg-card-sub: #182234;
  --bg-input: #0e1420;
  --bg-hover: #1c273c;
  
  --border-color: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-focus: #6366f1;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #64748b;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --wa-green: #25d366;
  --wa-bg: rgba(37, 211, 102, 0.12);
  --wa-border: rgba(37, 211, 102, 0.35);

  --amber: #f59e0b;
  --danger: #ef4444;

  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --table-header-bg: #101623;
  --table-row-hover: #162032;
}

[data-theme="light"] {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-sub: #f1f5f9;
  --bg-input: #ffffff;
  --bg-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #4f46e5;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-dim: #94a3b8;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.15);

  --wa-green: #16a34a;
  --wa-bg: #dcfce7;
  --wa-border: #86efac;

  --amber: #d97706;
  --danger: #dc2626;

  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  --table-header-bg: #f8fafc;
  --table-row-hover: #f8fafc;
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.app-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px;
}

/* App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--primary-glow);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.app-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-title-group h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.app-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Status Pill */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.status-badge.running {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #818cf8;
}

.status-badge.completed {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.status-badge.running .status-dot {
  background: #6366f1;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

/* History Toggle Button & Badge */
.history-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.history-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

/* Main Card */
.main-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: var(--card-shadow);
}

.card-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* 4-Column Responsive Grid */
.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.input-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-block label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ui-input {
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.ui-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.select-wrapper {
  position: relative;
}

.ui-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg2+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.ui-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Form Footer Row */
.form-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.quick-keywords-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mini-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.quick-tags-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-chip {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-chip:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.actions-and-toggles {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.toggles-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ui-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.ui-checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.limit-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.limit-input {
  width: 80px;
  height: 34px;
  padding: 0 8px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-group-primary {
  display: flex;
  gap: 10px;
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-main {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-main:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.btn-danger-outline:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.12);
}

/* Stats Cards */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--card-shadow);
  transition: transform 0.15s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
}

.stat-box-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-total { background: rgba(99, 102, 241, 0.12); color: #818cf8; }
.icon-wa { background: rgba(37, 211, 102, 0.12); color: #22c55e; }
.icon-web { background: rgba(6, 182, 212, 0.12); color: #06b6d4; }
.icon-rating { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }

.stat-number {
  display: block;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.stat-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Progress Box */
.progress-box {
  margin-bottom: 18px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.query-tag {
  font-weight: 600;
  color: var(--primary);
}

.progress-track {
  width: 100%;
  height: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #06b6d4, #22c55e);
  width: 0%;
  transition: width 0.3s ease;
}

/* Table Card & Toolbar */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.search-input-wrapper {
  position: relative;
  min-width: 260px;
  flex: 1;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  height: 36px;
  padding-left: 36px;
  font-size: 13px;
  border-radius: 8px;
}

.inline-filters {
  display: flex;
  gap: 8px;
}

.mini-select {
  height: 36px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 8px;
  min-width: 120px;
  cursor: pointer;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.sort-select {
  height: 36px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 8px;
  min-width: 140px;
  cursor: pointer;
}

.export-btn-group {
  display: flex;
  gap: 6px;
}

.btn-export-excel {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--wa-green);
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 600;
}

.btn-export-excel:hover {
  background: var(--wa-green);
  color: #ffffff;
}

.btn-export-sub {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 500;
}

.btn-export-sub:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  font-weight: 500;
}

.btn-export:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Secondary Subtoolbar (Filter Chips & WhatsApp Template) */
.table-subtoolbar {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--bg-card-sub);
  border-bottom: 1px solid var(--border-color);
}

.status-pills-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.filter-chip.chip-wa.active {
  background: var(--wa-green);
  border-color: var(--wa-green);
  color: #ffffff;
}

/* Inline WhatsApp Template Input */
.wa-template-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 500px;
}

.wa-inline-icon {
  font-size: 15px;
}

.wa-inline-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.wa-template-input {
  height: 32px;
  font-size: 12px;
  padding: 0 10px;
  border-radius: 6px;
  flex: 1;
}

.wa-inline-tip {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Table */
.table-responsive {
  overflow-x: auto;
  max-height: 600px;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.modern-table th {
  background: var(--table-header-bg);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
}

.th-sortable:hover {
  color: var(--primary);
}

.sort-arrow {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 3px;
}

.modern-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.modern-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.modern-table tbody tr:hover {
  background-color: var(--table-row-hover);
}

/* Place Cell Layout */
.place-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.place-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.place-title {
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.place-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Badges */
.badge-sector {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
  white-space: nowrap;
}

.phone-link {
  color: #10b981;
  text-decoration: none;
  font-weight: 500;
}
.phone-link:hover { text-decoration: underline; }

.web-link {
  color: #06b6d4;
  text-decoration: none;
  font-weight: 500;
}
.web-link:hover { text-decoration: underline; }

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--amber);
}

/* Distinct WhatsApp Cell Button */
.btn-whatsapp-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  color: var(--wa-green);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-whatsapp-cell:hover {
  background: #22c55e;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Empty State */
.empty-state-cell {
  padding: 70px 20px;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-state-icon svg {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Modal Window */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  transform: translateY(16px);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.modal-cover {
  width: 100%;
  height: 200px;
  background: var(--bg-card-sub);
  overflow: hidden;
}

.modal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-inner {
  padding: 22px;
}

.modal-headline {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.modal-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.badge-accent {
  background: var(--primary-glow);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
}

.badge-rating {
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
}

.badge-reviews {
  font-size: 12.5px;
  color: var(--text-muted);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.detail-item {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  padding: 9px 12px;
  background: var(--bg-card-sub);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.detail-label {
  color: var(--text-muted);
  width: 110px;
  flex-shrink: 0;
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
  word-break: break-word;
}

.modal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-wa-chat {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.btn-wa-chat:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

/* Toast Container */
.toast-wrapper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease;
}

@keyframes toastIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   History Drawer (Son 30 Günlük Tarama Arşivi)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.active .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
}

.drawer-title-group h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-close-btn {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.drawer-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-search-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-date-tabs {
  display: flex;
  gap: 6px;
}

.hist-tab {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hist-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.hist-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.history-stats-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--bg-card-sub);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.retention-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: all 0.15s ease;
}

.history-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.hist-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hist-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.hist-status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.hist-status-pill.completed {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.hist-status-pill.stopped {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.hist-status-pill.running {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
}

.hist-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hist-card-loc {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.hist-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 8px;
}

.hist-items-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 3px 8px;
  border-radius: 6px;
}

.hist-card-actions {
  display: flex;
  gap: 6px;
}

.btn-hist-load {
  background: var(--primary);
  color: #ffffff;
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-hist-load:hover {
  background: var(--primary-hover);
}

.btn-hist-excel {
  background: rgba(34, 197, 94, 0.12);
  color: var(--wa-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.btn-hist-excel:hover {
  background: var(--wa-green);
  color: #ffffff;
}

.btn-hist-delete {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 11.5px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-hist-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .form-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-layout {
    padding: 16px;
  }
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .form-footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions-and-toggles {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-group-primary {
    width: 100%;
  }
  .btn-group-primary .btn {
    flex: 1;
  }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-left, .toolbar-right {
    width: 100%;
  }
  .search-input-wrapper {
    max-width: 100%;
  }
}

/* ==========================================================================
   LİSANS YÖNETİMİ & AKTİVASYON MODALI STİLLERİ
   ========================================================================== */
.license-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  outline: none;
  font-family: inherit;
}

.license-badge-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.license-badge-btn.active:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

.license-badge-btn.warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
}

.license-badge-btn.unlicensed,
.license-badge-btn.expired {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
  animation: pulse-border 2s infinite ease-in-out;
}

@keyframes pulse-border {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.35);
  }
}

.license-modal-card {
  max-width: 520px;
  width: 90%;
  background: var(--bg-card, #161b22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(59, 130, 246, 0.15);
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(16px);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.license-modal-header {
  padding: 24px 24px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.license-modal-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.license-modal-title-group h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary, #f0f6fc);
}

.license-modal-title-group span {
  font-size: 13px;
  color: var(--text-muted, #8b949e);
  margin-top: 2px;
  display: block;
}

.license-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.license-alert-box {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.license-alert-box.info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}

.license-alert-box.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.license-alert-box.success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.license-details-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.license-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.license-detail-row .detail-label {
  color: var(--text-muted, #8b949e);
  font-weight: 500;
  width: auto;
}

.license-detail-row .detail-val {
  color: var(--text-primary, #f0f6fc);
}

.license-detail-row .badge-active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.font-bold {
  font-weight: 700;
  color: #10b981 !important;
}

.license-input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #f0f6fc);
  margin-bottom: 6px;
  display: block;
}

.license-input-group {
  display: flex;
  gap: 8px;
}

.license-key-input {
  flex: 1;
  background: rgba(13, 17, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #58a6ff;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s ease;
  outline: none;
}

.license-key-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: rgba(13, 17, 23, 1);
}

.license-paste-btn {
  padding: 0 16px;
  font-size: 16px;
}

.license-input-hint {
  font-size: 12px;
  color: var(--text-muted, #8b949e);
  margin-top: 6px;
  display: block;
}

.license-action-buttons {
  margin-top: 14px;
}

.license-submit-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.license-submit-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.license-footer-note {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted, #8b949e);
}

.license-contact-link {
  color: #22c55e;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.license-contact-link:hover {
  color: #4ade80;
  text-decoration: underline;
}

/* ==========================================================================
   Multi-Sector Chips, Autocomplete Dropdown & Bulk Scraping Styles
   ========================================================================== */

.sector-input-block {
  position: relative;
}

.input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.sector-mode-hint {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: help;
}

.sector-chips-wrapper {
  min-height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 4px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: text;
  width: 100%;
}

.sector-chips-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.sector-tags-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sector-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(99, 102, 241, 0.16);
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.4);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  user-select: none;
  animation: chipPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chipPopIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.sector-tag-chip .remove-chip-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s ease;
}

.sector-tag-chip .remove-chip-btn:hover {
  color: var(--danger, #ef4444);
}

.sector-input-field {
  flex: 1;
  min-width: 130px;
  height: 32px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 4px !important;
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
}

/* Autocomplete Dropdown List */
.sector-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(16px);
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sector-dropdown.hidden {
  display: none;
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--bg-card-sub);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.count-badge {
  font-size: 10px;
  background: var(--primary-glow);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.suggestions-list {
  max-height: 290px;
  overflow-y: auto;
  padding: 6px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.1s ease;
  gap: 10px;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--bg-hover);
}

.suggestion-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-item mark {
  background: transparent;
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
}

.suggestion-cat-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Quick chip bulk button */
.chip-bulk {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
  font-weight: 700 !important;
}

.chip-bulk:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
}

/* Global Hidden Utility */
.hidden {
  display: none !important;
}

/* Modal Overlay & Dialog Styles */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(11, 15, 25, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.15);
  overflow: hidden;
  position: relative;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-header-left .modal-icon {
  font-size: 24px;
}

.modal-header-left h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.modal-close-btn {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 22px 24px;
}

/* Bulk Modal Specific */
.bulk-modal {
  max-width: 540px;
}

.bulk-info-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.bulk-textarea {
  width: 100%;
  height: auto;
  min-height: 150px;
  padding: 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  resize: vertical;
  margin-bottom: 16px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.bulk-textarea:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.bulk-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Table Sector Pill Badge */
.sector-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* ----------------- R10 Demo & Purchase Modal Styles ----------------- */
.license-badge-btn.demo {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.2));
  border-color: rgba(168, 85, 247, 0.4);
  color: #c084fc;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

.license-badge-btn.demo-exhausted {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
  animation: pulseExhausted 2s infinite ease-in-out;
}

@keyframes pulseExhausted {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 16px 4px rgba(239, 68, 68, 0.25); }
}

.demo-exhausted-card {
  max-width: 600px;
  width: 92%;
  background: var(--bg-card, #161b22);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.12);
  overflow: hidden;
  position: relative;
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.demo-exhausted-header {
  padding: 30px 24px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.demo-badge-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.demo-exhausted-header h2 {
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

.demo-exhausted-subtitle {
  font-size: 13.5px;
  color: var(--text-muted, #8b949e);
  max-width: 440px;
}

.demo-exhausted-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.demo-summary-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.demo-box-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.demo-box-text strong {
  display: block;
  font-size: 14px;
  color: #34d399;
  margin-bottom: 4px;
}

.demo-box-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary, #c9d1d9);
  line-height: 1.5;
}

.demo-features-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #f0f6fc);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.demo-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.feat-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.feat-item strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary, #f0f6fc);
  margin-bottom: 2px;
}

.feat-item p {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted, #8b949e);
  line-height: 1.4;
}

.demo-purchase-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.btn-wa-purchase {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 10px 25px -5px rgba(34, 197, 94, 0.4);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-wa-purchase:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(34, 197, 94, 0.5);
  background: linear-gradient(135deg, #25d366 0%, #15803d 100%);
  color: #fff;
}

.demo-key-btn {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #c9d1d9);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.demo-key-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}




/* ==========================================================================
   xYedek / Sahibinden-Bot Style Upgrade & Admin / Auth Extensions
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Montserrat', 'Inter', system-ui, -apple-system, sans-serif;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --brand-blue: #2563eb;
  --brand-amber: #f46b2a;
}

body {
  font-family: var(--font-main) !important;
  background:
    radial-gradient(circle at 0 0, rgba(37, 99, 235, .12), transparent 32rem),
    radial-gradient(circle at 100% 18%, rgba(244, 107, 42, .10), transparent 28rem),
    var(--bg-page) !important;
}

/* ── Login Overlay & Card ──────────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 20px;
}

[data-theme="light"] .login-overlay {
  background: rgba(248, 250, 252, 0.88);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: loginFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .login-card {
  box-shadow: 0 24px 60px rgba(72, 40, 18, 0.12);
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-logo-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  margin-bottom: 6px;
}

.login-header h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
}

.login-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-wrap .field-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-submit-btn {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 4px 0;
}

.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.demo-quick-btn {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

[data-theme="light"] .demo-quick-btn {
  background: #fef3c7;
  border-color: #fde68a;
  color: #b45309;
}

.demo-quick-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  transform: translateY(-1px);
}

.login-alert {
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}

.login-alert.error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.login-alert.info {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.login-footer-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.login-footer-hint a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

/* ── Top Navigation Tabs (xYedek Style) ────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-nav-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.main-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-sub);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.main-nav-tab {
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.main-nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.main-nav-tab.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.main-nav-tab.tab-admin.active {
  background: linear-gradient(135deg, #f46b2a 0%, #d94d13 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(244, 107, 42, 0.35);
}

/* User Info Pill in Header */
.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-size: 13px;
}

.user-email-text {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.user-badge.admin {
  background: rgba(244, 107, 42, 0.15);
  color: #ff8c42;
  border: 1px solid rgba(244, 107, 42, 0.35);
}

.user-badge.active {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.user-badge.demo {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.user-badge.expired {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.logout-icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.logout-icon-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* ── Demo Warning Banner ───────────────────────────────────────────────── */
.demo-banner-strip {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18) 0%, rgba(245, 158, 11, 0.06) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  color: #fbbf24;
  font-size: 13.5px;
}

.demo-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.demo-banner-btn {
  padding: 6px 14px;
  background: #f59e0b;
  color: #000;
  font-weight: 700;
  font-size: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

/* ── Admin Panel Content Views ─────────────────────────────────────────── */
.admin-tab-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 4px 0;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-stat-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}

.admin-stat-icon-wrap.users { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.admin-stat-icon-wrap.active { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.admin-stat-icon-wrap.expired { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.admin-stat-icon-wrap.places { background: rgba(244, 107, 42, 0.15); color: #ff8c42; }

.admin-stat-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-stat-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}

.admin-card-title-group h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.admin-card-title-group p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 3px 0 0 0;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-admin-action {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-admin-primary {
  background: linear-gradient(135deg, #f46b2a 0%, #d94d13 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(244, 107, 42, 0.3);
}

.btn-admin-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(244, 107, 42, 0.4);
}

.btn-admin-secondary {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-admin-secondary:hover {
  background: var(--bg-hover);
}

/* Modern Admin Table */
.admin-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.admin-table th {
  background: var(--table-header-bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: var(--table-row-hover);
}

.user-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-email-bold {
  font-weight: 700;
  color: var(--text-primary);
}

.user-username-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.table-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-mini-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-sub);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-mini-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-mini-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Modals */
.admin-modal-card {
  max-width: 500px !important;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-input-field {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13.5px;
}

.modal-input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}


/* ==========================================================================
   xYedek / Sahibinden Bot Design System Integration
   Typography: Manrope | Palette: Warm Orange (#f46b2a), Lime (#ddeb66), Deep Navy (#1d2934)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f7f5f1;
  --bg-page: var(--bg);
  --surface: rgba(255, 255, 255, .88);
  --surface-solid: #ffffff;
  --surface-soft: #f1eee8;
  --bg-card: var(--surface);
  --bg-card-sub: var(--surface-soft);
  --bg-input: var(--surface-solid);
  --bg-hover: var(--surface-soft);
  
  --text: #1d1b19;
  --text-primary: var(--text);
  --text-secondary: #413d39;
  --muted: #726d66;
  --text-muted: var(--muted);
  --line: rgba(40, 31, 24, .09);
  --border-color: var(--line);
  --border-subtle: rgba(40, 31, 24, .05);
  
  --brand: #f46b2a;
  --brand-dark: #d94d13;
  --brand-soft: #fff0e7;
  --primary: var(--brand);
  --primary-hover: var(--brand-dark);
  --primary-glow: rgba(244, 107, 42, .24);
  
  --lime: #ddeb66;
  --navy: #1d2934;
  --success: #21865e;
  --danger: #c7473e;
  --warning: #c88720;
  --wa-green: #25d366;
  --wa-bg: rgba(37, 211, 102, 0.12);
  --wa-border: rgba(37, 211, 102, 0.35);

  --shadow: 0 24px 60px rgba(72, 40, 18, .12);
  --shadow-sm: 0 10px 28px rgba(72, 40, 18, .08);
  --card-shadow: var(--shadow-sm);
  
  --radius: 20px;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

[data-theme="dark"] {
  --bg: #151718;
  --bg-page: var(--bg);
  --surface: rgba(31, 34, 35, .88);
  --surface-solid: #202324;
  --surface-soft: #292d2e;
  --bg-card: var(--surface);
  --bg-card-sub: var(--surface-soft);
  --bg-input: #1a1c1d;
  --bg-hover: var(--surface-soft);
  
  --text: #f6f2ec;
  --text-primary: var(--text);
  --text-secondary: #ded8cf;
  --muted: #aaa59d;
  --text-muted: var(--muted);
  --line: rgba(255, 255, 255, .08);
  --border-color: var(--line);
  --border-subtle: rgba(255, 255, 255, .04);
  
  --brand: #ff7836;
  --brand-dark: #f46b2a;
  --brand-soft: #3a261e;
  --primary: var(--brand);
  --primary-hover: var(--brand-dark);
  --primary-glow: rgba(244, 107, 42, .3);
  
  --lime: #ddeb66;
  --navy: #e4edf2;
  --shadow: 0 24px 60px rgba(0, 0, 0, .35);
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, .22);
  --card-shadow: var(--shadow-sm);
}

/* Base Body Styling */
body {
  margin: 0;
  padding: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(244, 107, 42, .14), transparent 32rem),
    radial-gradient(circle at 100% 18%, rgba(221, 235, 102, .13), transparent 28rem),
    var(--bg) !important;
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell & Dikey Sidebar (xYedek Layout) ─────────────────────────── */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 275px minmax(0, 1fr);
  width: 100%;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 20px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 50;
  box-sizing: border-box;
}

[data-theme="dark"] .sidebar {
  background: rgba(21, 23, 24, .65);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f46b2a 0%, #d94d13 100%);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 8px 20px rgba(244, 107, 42, .3);
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.1;
}

.brand-title em {
  color: var(--brand);
  font-style: normal;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

/* Dikey Menü Butonları */
.sidebar .nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.nav-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all .18s ease;
  width: 100%;
}

.nav-button:hover {
  color: var(--text);
  background: var(--surface-soft);
  transform: translateX(2px);
}

.nav-button.active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(244, 107, 42, 0.12);
}

.nav-button.tab-admin-btn.active {
  color: #ff7836;
  background: rgba(244, 107, 42, 0.16);
  border: 1px solid rgba(244, 107, 42, 0.32);
}

.nav-icon {
  font-size: 17px;
  display: grid;
  place-items: center;
  width: 20px;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}

.nav-spacer {
  flex: 1;
}

/* Upgrade Card (Lisans Kutusu) */
.upgrade-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(29, 41, 52, .96), rgba(50, 50, 42, .88)),
    var(--navy);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, .08);
}

.upgrade-card::after {
  position: absolute;
  right: -18px;
  bottom: -24px;
  width: 80px;
  height: 80px;
  border: 1px solid rgba(221, 235, 102, .25);
  border-radius: 50%;
  content: "";
}

.upgrade-card h3 {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: -.02em;
  position: relative;
  z-index: 1;
}

.upgrade-card p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, .7);
  font-size: 11px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.upgrade-card .btn-small {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 11.5px;
  background: var(--lime);
  color: #1d1b19;
  font-weight: 800;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  transition: transform .18s ease;
}

.upgrade-card .btn-small:hover {
  transform: translateY(-1px);
}

/* Account Pill */
.account {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #f46b2a 0%, #d94d13 100%);
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(244, 107, 42, .25);
}

.account-info {
  flex: 1;
  min-width: 0;
}

.account-info strong {
  display: block;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-info small {
  font-size: 11px;
  color: var(--brand);
  font-weight: 700;
}

/* ── Sağ Ana Gövde (Main Content) ───────────────────────────────────────── */
.main {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 36px) 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -24px calc(clamp(18px, 3vw, 36px) * -1) 12px;
  padding: 18px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 241, .82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

[data-theme="dark"] .topbar {
  background: rgba(21, 23, 24, .82);
}

.topbar-left h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
}

.topbar-left span {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(33, 134, 94, .14);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 15px;
  transition: all .18s ease;
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: rgba(244, 107, 42, .3);
  transform: translateY(-1px);
}

/* ── Kartlar & Bölümler (xYedek Card Styling) ──────────────────────────── */
.main-card,
.table-card,
.admin-card {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 24px !important;
  transition: all .2s ease;
}

.main-card:hover,
.table-card:hover,
.admin-card:hover {
  border-color: rgba(244, 107, 42, .2) !important;
}

/* Butonlar (xYedek Renkleri) */
.btn-primary {
  background: linear-gradient(135deg, #f46b2a 0%, #d94d13 100%) !important;
  color: #fff !important;
  font-weight: 750 !important;
  border: none !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 22px rgba(244, 107, 42, .28) !important;
  transition: all .18s ease !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff7836 0%, #e05417 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 12px 28px rgba(244, 107, 42, .38) !important;
}

.btn-secondary {
  border: 1px solid var(--line) !important;
  background: var(--surface-solid) !important;
  color: var(--text) !important;
  border-radius: 14px !important;
  transition: all .18s ease !important;
}

.btn-secondary:hover {
  background: var(--surface-soft) !important;
  border-color: rgba(244, 107, 42, .25) !important;
}

/* Responsive & Mobil Alt Menü */
.bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    display: block !important;
    padding-bottom: 74px !important;
  }
  .sidebar {
    display: none !important;
  }
  .main {
    padding: 16px 14px 24px !important;
  }
  .topbar {
    margin: -16px -14px 16px !important;
    padding: 14px !important;
  }
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
  }
  .bottom-nav .nav-button {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    padding: 6px 10px;
    min-height: auto;
    border-radius: 10px;
  }
}


/* ── Geniş ve Dar Görünüm (Wide & Narrow Layout Toggle) ──────────────────── */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 275px minmax(0, 1fr);
  width: 100%;
  transition: grid-template-columns 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dar Görünüm (Standart - Kompakt 1440px) */
.app-shell.layout-narrow .main {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Geniş Görünüm (Tam Ekran Akışkan 100%) */
.app-shell.layout-wide .main {
  max-width: 100% !important;
  margin: 0 !important;
  width: 100% !important;
}

/* Dikey Menü Daraltma (Collapsed Slim Sidebar) */
.app-shell.sidebar-collapsed {
  grid-template-columns: 78px minmax(0, 1fr) !important;
}

.app-shell.sidebar-collapsed .sidebar {
  padding: 24px 10px !important;
  align-items: center !important;
}

.app-shell.sidebar-collapsed .brand-title,
.app-shell.sidebar-collapsed .brand-sub,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-badge,
.app-shell.sidebar-collapsed .upgrade-card,
.app-shell.sidebar-collapsed .account-info,
.app-shell.sidebar-collapsed #sidebarLogoutBtn {
  display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-logo {
  justify-content: center !important;
  padding: 0 !important;
}

.app-shell.sidebar-collapsed .nav-button {
  justify-content: center !important;
  padding: 0 !important;
  width: 48px !important;
  height: 48px !important;
  margin: 0 auto !important;
  border-radius: 12px !important;
}

.app-shell.sidebar-collapsed .nav-icon {
  font-size: 20px !important;
  margin: 0 !important;
}

.app-shell.sidebar-collapsed .account {
  padding: 6px !important;
  border-radius: 14px !important;
  justify-content: center !important;
  width: 48px !important;
}

/* Tooltip for collapsed buttons */
.layout-btn-active {
  color: var(--brand) !important;
  border-color: rgba(244, 107, 42, .35) !important;
  background: var(--brand-soft) !important;
}


/* ==========================================================================
   MONTSERRAT TYPOGRAPHY, SLIM FONT-WEIGHTS, DUAL THEME & MODAL OVERHAUL
   ========================================================================== */

*, body, button, input, select, textarea, .nav-button, .btn, .brand-title, h1, h2, h3, h4, h5, h6 {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

body {
  font-weight: 350 !important;
  letter-spacing: -0.012em;
}

h1, h2, h3, h4 {
  font-weight: 600 !important;
  letter-spacing: -0.025em;
}

.brand-title {
  font-weight: 700 !important;
}

.nav-button, .btn, .icon-button {
  font-weight: 500 !important;
}

.status-badge, .status-pill, .badge {
  font-weight: 500 !important;
}

/* ── Modal & Backdrop Fixes (Guaranteed Visibility & Smooth Centering) ─ */
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(14, 17, 21, 0.72) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  padding: 20px !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease !important;
}

.modal-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-card.admin-modal-card {
  width: 100% !important;
  max-width: 580px !important;
  background: var(--surface-solid, #ffffff) !important;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.08)) !important;
  border-radius: 22px !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35) !important;
  padding: 28px !important;
  max-height: 92vh !important;
  overflow-y: auto !important;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.modal-backdrop.active .modal-card.admin-modal-card {
  transform: scale(1) translateY(0) !important;
}

/* ── Duration Preset Pills ─────────────────────────────────────────────── */
.btn-preset-day {
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.btn-preset-day:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}

.btn-preset-day.active {
  background: var(--brand) !important;
  color: #ffffff !important;
  border-color: var(--brand) !important;
  box-shadow: 0 3px 10px rgba(244, 107, 42, 0.32);
}

.modal-input-field {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.18s ease;
  box-sizing: border-box;
}

.modal-input-field:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(244, 107, 42, 0.15);
}

/* ── Dual Theme Polish (Aydınlık & Koyu Tema) ─────────────────────────── */
[data-theme="light"] {
  --bg: #f8f6f0 !important;
  --bg-page: var(--bg) !important;
  --surface: rgba(255, 255, 255, 0.94) !important;
  --surface-solid: #ffffff !important;
  --surface-soft: #f4efe7 !important;
  --bg-card: var(--surface) !important;
  --bg-card-sub: var(--surface-soft) !important;
  --bg-input: #ffffff !important;
  --bg-hover: #ede7dc !important;
  --text: #1f2937 !important;
  --text-primary: var(--text) !important;
  --text-secondary: #4b5563 !important;
  --muted: #6b7280 !important;
  --text-muted: var(--muted) !important;
  --line: rgba(40, 31, 24, 0.09) !important;
  --border-color: var(--line) !important;
  --shadow: 0 20px 50px rgba(72, 40, 18, 0.08) !important;
  --shadow-sm: 0 8px 24px rgba(72, 40, 18, 0.05) !important;
}

[data-theme="dark"] {
  --bg: #121417 !important;
  --bg-page: var(--bg) !important;
  --surface: rgba(26, 29, 34, 0.94) !important;
  --surface-solid: #1b1e23 !important;
  --surface-soft: #23282f !important;
  --bg-card: var(--surface) !important;
  --bg-card-sub: var(--surface-soft) !important;
  --bg-input: #171a1e !important;
  --bg-hover: #262c34 !important;
  --text: #f3f4f6 !important;
  --text-primary: var(--text) !important;
  --text-secondary: #9ca3af !important;
  --muted: #6b7280 !important;
  --text-muted: var(--muted) !important;
  --line: rgba(255, 255, 255, 0.08) !important;
  --border-color: var(--line) !important;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}


/* ==========================================================================
   WHATSAPP CAMPAIGN & BATCH SENDER STYLES
   ========================================================================== */

.btn-wa-campaign {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-wa-campaign:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(37, 211, 102, 0.42);
}

.btn-wa-campaign .btn-badge {
  background: rgba(255, 255, 255, 0.26);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.btn-wa-subtoolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #128c7e;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.3);
  cursor: pointer;
  transition: all 0.18s ease;
  margin-left: auto;
}

[data-theme="dark"] .btn-wa-subtoolbar {
  color: #25d366;
  background: rgba(37, 211, 102, 0.15);
}

.btn-wa-subtoolbar:hover {
  background: rgba(37, 211, 102, 0.24);
  border-color: #25d366;
}

.wa-modal-card {
  width: 100% !important;
  max-width: 960px !important;
  padding: 24px 28px !important;
  box-sizing: border-box;
}

.wa-campaign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 14px;
}

@media (max-width: 820px) {
  .wa-campaign-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.wa-card-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-upload-zone {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-soft);
  transition: all 0.18s ease;
}

.wa-upload-zone:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.wa-image-preview-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  max-height: 160px;
  display: none;
}

.wa-image-preview-wrap img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.wa-btn-remove-img {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.wa-var-chip {
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.wa-var-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.wa-chat-preview-box {
  background: #e5ddd5;
  background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 0);
  background-size: 16px 16px;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  justify-content: flex-end;
  border: 1px solid rgba(0,0,0,0.08);
  min-height: 130px;
}

[data-theme="dark"] .wa-chat-preview-box {
  background: #0b141a;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 0);
  border-color: rgba(255,255,255,0.08);
}

.wa-chat-bubble {
  background: #d9fdd3;
  color: #111b21;
  border-radius: 10px 0 10px 10px;
  padding: 8px 10px;
  max-width: 88%;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
}

[data-theme="dark"] .wa-chat-bubble {
  background: #005c4b;
  color: #e9edef;
}

.wa-chat-bubble-img {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
  display: none;
}

.wa-bubble-time {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  color: rgba(17, 27, 33, 0.55);
  margin-top: 3px;
}

[data-theme="dark"] .wa-bubble-time {
  color: rgba(233, 237, 239, 0.55);
}

.wa-queue-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wa-progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.wa-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #25d366, #128c7e);
  transition: width 0.25s ease;
}

.wa-btn-send-main {
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.wa-btn-send-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.wa-btn-send-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wa-queue-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.wa-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.wa-queue-item:last-child {
  border-bottom: none;
}

.wa-queue-item.active {
  background: rgba(37, 211, 102, 0.1);
  font-weight: 600;
}

.wa-queue-item.sent {
  opacity: 0.6;
}

/* ==========================================================================
   WhatsApp Template Studio (Dedicated Tab View)
   ========================================================================== */

.wa-studio-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.25s ease;
}

.wa-studio-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--card-shadow);
}

.wa-studio-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wa-studio-header-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.2), rgba(18, 140, 126, 0.2));
  border: 1px solid rgba(37, 211, 102, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #25d366;
  flex-shrink: 0;
}

.wa-studio-header-text h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-studio-header-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.wa-studio-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wa-preset-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
}

.wa-preset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wa-preset-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: rgba(37, 211, 102, 0.4);
}

.wa-preset-btn.active {
  background: rgba(37, 211, 102, 0.15);
  border-color: #25d366;
  color: #25d366;
  font-weight: 600;
}

.wa-studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 992px) {
  .wa-studio-grid {
    grid-template-columns: 1fr;
  }
}

.wa-editor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wa-editor-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.wa-phone-mockup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wa-phone-frame {
  background: #0b141a;
  border: 6px solid #202c33;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
}

[data-theme="light"] .wa-phone-frame {
  border-color: #e9edef;
  background: #efeae2;
}

.wa-phone-topbar {
  background: #202c33;
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

[data-theme="light"] .wa-phone-topbar {
  background: #008069;
}

.wa-phone-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.wa-phone-contact-info {
  flex: 1;
  min-width: 0;
}

.wa-phone-contact-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-phone-contact-status {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.7);
}

.wa-phone-chat-body {
  flex: 1;
  padding: 16px;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow-y: auto;
  min-height: 360px;
}

[data-theme="light"] .wa-phone-chat-body {
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

.wa-phone-bubble {
  max-width: 90%;
  margin-left: auto;
  background: #005c4b;
  color: #e9edef;
  border-radius: 12px 12px 2px 12px;
  padding: 8px 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-size: 12.5px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 6px;
  word-break: break-word;
  white-space: pre-wrap;
}

[data-theme="light"] .wa-phone-bubble {
  background: #d9fdd3;
  color: #111b21;
}

.wa-phone-bubble-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.wa-phone-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

[data-theme="light"] .wa-phone-bubble-meta {
  color: rgba(0, 0, 0, 0.45);
}

.wa-phone-input-bar {
  background: #202c33;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="light"] .wa-phone-input-bar {
  background: #f0f2f5;
}

.wa-phone-fake-input {
  flex: 1;
  background: #2a3942;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .wa-phone-fake-input {
  background: #fff;
  color: #667781;
}

.wa-phone-send-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
