/* ════════════════════════════════════════════════════════
       DESIGN SYSTEM – Neuform Ecosystem Visualization
       Primary   : #E48B59  (warm coral-orange)
       Secondary : #ED7B46  (deeper orange)
       BG        : #FFFFFF
       Surface   : #53617A  (slate-blue – sidebar)
       Text-1    : #111827
       Text-2    : #4B5563
       Border    : #D8DADF
       Card r    : 16px
       Control r : 8px
       Pill r    : 9999px
       Spacing   : 8/16/24/80px
       Motion    : ease, staggered, hover-lift
    ════════════════════════════════════════════════════════ */

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

:root {
  --primary: #E48B59;
  --primary-dk: #D4723E;
  --secondary: #ED7B46;
  --bg: #FFFFFF;
  --surface: #53617A;
  --surface-dk: #3f4d62;
  --surface-lt: #647589;
  --text-1: #111827;
  --text-2: #4B5563;
  --border: #D8DADF;
  --r-card: 16px;
  --r-control: 8px;
  --r-pill: 9999px;
  --gap: 16px;
  --ease: cubic-bezier(.25, .1, .25, 1);
}

html,
body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .25);
  border-radius: 99px;
}

#main ::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* ════════════════════════════
       LAYOUT
    ════════════════════════════ */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ════════════════════════════
       SIDEBAR
    ════════════════════════════ */
#sidebar {
  width: 256px;
  min-width: 256px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Subtle ambient gradient */
#sidebar::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(228, 139, 89, .18) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Logo area ── */
#sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex-shrink: 0;
}

/* Logo wrapper – prevents squish */
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.logo-wrap img {
  height: 44px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  object-position: left center;
  display: block;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

/* Fallback badge when img fails */
.logo-fallback {
  display: none;
  align-items: center;
  gap: 8px;
}

.logo-fallback .lf-icon {
  width: 30px;
  height: 30px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  color: #fff;
  letter-spacing: -.5px;
}

.logo-fallback .lf-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
}

/* App name badge */
.app-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-name {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, .95);
  letter-spacing: -.2px;
}

.app-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  background: rgba(228, 139, 89, .25);
  color: #E48B59;
  border: 1px solid rgba(228, 139, 89, .4);
  border-radius: var(--r-pill);
  padding: 2px 7px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── History section ── */
.sidebar-section-hd {
  padding: 16px 20px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .4);
  flex-shrink: 0;
}

#history-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

/* ── History item ── */
.history-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: var(--r-control);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 3px;
  transition: background 300ms var(--ease), border-color 300ms var(--ease);
}

.history-item:hover {
  background: rgba(255, 255, 255, .08);
}

.history-item.active {
  background: rgba(228, 139, 89, .15);
  border-color: rgba(228, 139, 89, .35);
}

.h-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .6);
  font-size: 12px;
  flex-shrink: 0;
  transition: background 300ms var(--ease);
}

.history-item.active .h-icon {
  background: rgba(228, 139, 89, .3);
  color: var(--primary);
}

.h-body {
  flex: 1;
  min-width: 0;
}

.h-name {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  padding-right: 35px;
}

.h-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, .4);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 55px;
}

.h-count {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .6);
  border-radius: var(--r-pill);
  padding: 2px 7px;
  transition: background 300ms;
}

.history-item.active .h-count {
  background: rgba(228, 139, 89, .3);
  color: var(--primary);
}

/* Actions */
.h-actions {
  display: none;
  align-items: center;
  gap: 4px;
  position: absolute;
  bottom: 8px;
  right: 10px;
}

.history-item:hover .h-actions {
  display: flex;
}

.h-copy,
.h-delete {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, .5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 200ms, color 200ms;
}

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

.h-delete:hover {
  background: rgba(239, 68, 68, .25);
  color: #f87171;
}

/* Sidebar footer */
#sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: rgba(255, 255, 255, .3);
  text-align: center;
  flex-shrink: 0;
  letter-spacing: .04em;
}

/* ════════════════════════════
       MAIN
    ════════════════════════════ */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #F9FAFB;
  transition: filter 400ms var(--ease);
}

#main.is-blurred {
  filter: blur(5px);
  pointer-events: none;
}

/* ── Topbar ── */
#topbar {
  height: 56px;
  padding: 0 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

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

.topbar-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  background: #FEF3EC;
  color: var(--primary);
  border: 1px solid #F8D5BC;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.topbar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.2px;
}

.topbar-sub {
  font-size: 11px;
  color: var(--text-2);
}

/* Status pill */
#statusBadge {
  display: none;
  align-items: center;
  gap: 8px;
  background: #FEF3EC;
  border: 1px solid #F8D5BC;
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
}

#statusBadge.visible {
  display: flex;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 1.4s ease infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .35;
    transform: scale(.8);
  }
}

/* ── Content ── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ════════════════════════════
       BENTO CARDS
    ════════════════════════════ */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: var(--gap);
  margin-bottom: 24px;
}

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

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

.bento-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
  transition: box-shadow 300ms var(--ease), transform 300ms var(--ease);
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  box-shadow: 0 8px 32px rgba(17, 24, 39, .07);
  transform: translateY(-2px);
}

/* Accent top stripe */
.bento-card.accent-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 0 0 4px 4px;
  opacity: .8;
}

/* Wide card for URL input */
.bento-card.col-span-2 {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .bento-card.col-span-2 {
    grid-column: span 1;
  }
}

.card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
  letter-spacing: -.1px;
}

/* Stat cards */
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #FEF3EC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 16px;
  margin-bottom: 12px;
  transition: background 300ms;
}

.bento-card:hover .stat-icon {
  background: var(--primary);
  color: #fff;
}

.stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

/* ════════════════════════════
       FORM SECTION
    ════════════════════════════ */
.form-bento {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-card);
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.form-bento::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(228, 139, 89, .15) 0%, transparent 70%);
  pointer-events: none;
}

.form-section-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.form-section-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(228, 139, 89, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
}

.form-section-ttl {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
}

.form-section-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 3fr auto;
  gap: var(--gap);
  align-items: end;
}

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

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

.field-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-control);
  padding: 10px 13px;
  font-size: 13.5px;
  font-family: 'Inter', system-ui, sans-serif;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  outline: none;
  transition: border-color 300ms var(--ease), box-shadow 300ms var(--ease), background 300ms;
}

.field-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.field-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(228, 139, 89, .2);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-control);
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background 300ms var(--ease), box-shadow 300ms var(--ease), transform 200ms var(--ease);
}

.btn-primary:hover {
  background: var(--primary-dk);
  box-shadow: 0 6px 20px rgba(228, 139, 89, .35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ════════════════════════════
       TABLE SECTION
    ════════════════════════════ */
.table-bento {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 24px;
}

.table-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.table-ttl {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -.2px;
}

.table-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ── Empty state ── */
#emptyState {
  padding: 64px 24px;
  text-align: center;
}

.empty-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #FEF3EC;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--primary);
  font-size: 22px;
}

#emptyState p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ════════════════════════════
       DATATABLES OVERRIDES
    ════════════════════════════ */
table.dataTable {
  border-collapse: collapse !important;
  font-size: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-1);
  width: 100% !important;
}

table.dataTable thead th {
  background: #F9FAFB !important;
  color: var(--text-2) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  font-family: 'JetBrains Mono', monospace !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
  padding: 10px 12px !important;
}

table.dataTable tbody tr {
  background: #fff !important;
}

table.dataTable tbody tr:hover td {
  background: #FEF9F5 !important;
}

table.dataTable tbody td {
  border-bottom: 1px solid #F3F4F6 !important;
  padding: 10px 12px !important;
  vertical-align: middle !important;
}

.dataTables_wrapper {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-1);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border) !important;
  border-radius: var(--r-control) !important;
  padding: 6px 10px !important;
  font-size: 12px;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-1);
  background: #F9FAFB;
  outline: none;
  transition: border-color 300ms;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_info {
  color: var(--text-2) !important;
  font-size: 11px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  padding: 4px 10px !important;
  font-size: 12px;
  color: var(--text-2) !important;
  transition: all 250ms;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
  background: #FEF3EC !important;
  border-color: #F8D5BC !important;
  color: var(--primary) !important;
}

/* DT Buttons */
.dt-buttons {
  display: flex;
  gap: 8px;
}

div.dt-buttons button.dt-button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #000000 !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--r-control) !important;
  padding: 8px 16px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: background 300ms, box-shadow 300ms, transform 200ms !important;
}

div.dt-buttons button.dt-button:hover {
  background: var(--primary-dk) !important;
  box-shadow: 0 4px 16px rgba(228, 139, 89, .3) !important;
  transform: translateY(-1px) !important;
}

/* ════════════════════════════
       FILTER BAR
    ════════════════════════════ */
#filterBar {
  padding: 10px 0px 12px;
  border-radius: 14px 14px 0 0;
}

.fb-row {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

/* Each group is its own pill container */
.fb-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
}

/* VERİ group – neutral light bg */
.fb-group:first-of-type {}

/* CRM group – #cfd2d9, pushed right */
.fb-group:last-of-type {
  margin-left: auto;
}

.fb-group-label {
  font-size: 10px;
  font-weight: 800;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-right: 6px;
  white-space: nowrap;
}

.fb-group:last-of-type .fb-group-label {
  color: #374151;
}

.fb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 300ms var(--ease);
  user-select: none;
  background: #F3F4F6;
}

.fb-chip input[type=checkbox] {
  display: none;
}

.fb-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.fb-chip-on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff !important;
}

.fb-chip.fb-crm {
  border-style: dashed;
}

.fb-chip.fb-crm.fb-chip-on {
  border-style: solid;
}

.fb-stats {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.fb-stat-active {
  color: var(--primary);
}

/* ════════════════════════════
       CRM AKSIYONLAR
    ════════════════════════════ */
.crm-wrap {
  display: flex;
  gap: 5px;
  align-items: center;
}

.crm-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  color: #9CA3AF;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 240ms var(--ease);
  flex-shrink: 0;
}

.crm-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #FEF3EC;
}

/* Active states per action type */
.crm-btn[data-action="called"].crm-active {
  background: #DBEAFE;
  border-color: #3B82F6;
  color: #2563EB;
}

.crm-btn[data-action="wa"].crm-active {
  background: #D1FAE5;
  border-color: #10B981;
  color: #059669;
}

.crm-btn[data-action="catalog"].crm-active {
  background: #EDE9FE;
  border-color: #8B5CF6;
  color: #7C3AED;
}

/* Row background based on CRM score */
#resultsTable tbody tr.crm-s1 {
  background: #FFFBEB !important;
}

#resultsTable tbody tr.crm-s2 {
  background: #FFF7ED !important;
}

#resultsTable tbody tr.crm-s3 {
  background: #F0FDF4 !important;
  border-left: 3px solid #10B981;
}

#resultsTable tbody tr.crm-s3 td:first-child {
  color: #059669 !important;
  font-weight: 700;
}

/* DataTable layout */
.dt-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-top: 4px;
}

.dt-search-modern {
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}

/* Hide DataTables auto-generated "Ara:" label text */
.dt-search-modern label,
.dataTables_filter label {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
}

.dt-search-modern label>span,
.dt-search-modern label>br,
.dataTables_filter label>span {
  display: none !important;
}

.dt-search-modern input[type=search],
.dataTables_filter input[type=search] {
  width: 300px !important;
  padding: 9px 14px 9px 38px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-family: 'Inter', sans-serif !important;
  color: var(--text-1) !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 13px center !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 250ms ease, box-shadow 250ms ease !important;
}

.dt-search-modern input[type=search]:focus,
.dataTables_filter input[type=search]:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(228, 139, 89, .12) !important;
}

.dt-search-modern input[type=search]::placeholder {
  color: #9CA3AF;
  font-style: italic;
}

/* Excel button – indigo */
.dt-buttons .dt-button {
  background: #4F46E5 !important;
  border-color: #4F46E5 !important;
  color: #fff !important;
}

.dt-buttons .dt-button:hover {
  background: #4338CA !important;
  border-color: #4338CA !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, .3) !important;
}

/* WhatsApp Template button - green */
.dt-buttons .dt-button.btn-wa-template {
  background: #10B981 !important;
  border-color: #10B981 !important;
}

.dt-buttons .dt-button.btn-wa-template:hover {
  background: #059669 !important;
  border-color: #059669 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, .3) !important;
}

/* Hide "Ara:" search label text – aggressive */
.dataTables_filter label,
.dt-search-modern label {
  display: flex !important;
  align-items: center !important;
  font-size: 0 !important;
  /* hides text nodes */
}

.dataTables_filter label input,
.dt-search-modern label input {
  font-size: 13px !important;
}

.dataTables_filter label>span,
.dt-search-modern label>span,
.dt-search-modern label>br,
.dataTables_filter label>br {
  display: none !important;
}

.dt-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dt-len {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
}

.dt-inf {
  font-size: 12px;
  color: #9CA3AF;
}

.dt-pag {
  display: flex;
}

/* ════════════════════════════
       TABLE CELL COMPONENTS
    ════════════════════════════ */
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #22c55e;
  color: #fff !important;
  text-decoration: none;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  transition: background 250ms, transform 200ms;
}

.wa-btn:hover {
  background: #16a34a;
  transform: scale(1.04);
}

.cat-pill {
  display: inline-block;
  background: #FEF3EC;
  border: 1px solid #F8D5BC;
  border-radius: var(--r-control);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
}

.map-link {
  font-size: 11.5px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 250ms;
}

.map-link:hover {
  color: var(--primary-dk);
  text-decoration: underline;
}

.mono-sm {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}

/* ════════════════════════════
       SWEETALERT2 THEME
    ════════════════════════════ */
.swal2-popup {
  border-radius: var(--r-card) !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  padding: 32px !important;
  box-shadow: 0 20px 60px rgba(17, 24, 39, .12) !important;
}

.swal2-title {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: var(--text-1) !important;
  letter-spacing: -.2px !important;
}

.swal2-html-container {
  font-size: 13.5px !important;
  color: var(--text-2) !important;
  line-height: 1.65 !important;
}

.swal2-confirm {
  background: var(--primary) !important;
  border-radius: var(--r-control) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 10px 22px !important;
  box-shadow: none !important;
  transition: background 300ms, box-shadow 300ms !important;
}

.swal2-confirm:hover {
  background: var(--primary-dk) !important;
  box-shadow: 0 4px 16px rgba(228, 139, 89, .3) !important;
}

.swal2-confirm:focus {
  box-shadow: 0 0 0 3px rgba(228, 139, 89, .25) !important;
}

.swal2-cancel {
  background: #F9FAFB !important;
  color: var(--text-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-control) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  padding: 10px 22px !important;
}

.swal2-deny {
  background: #ef4444 !important;
  border-radius: var(--r-control) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 10px 22px !important;
}

.swal2-backdrop-show {
  background: rgba(17, 24, 39, .4) !important;
  backdrop-filter: blur(3px);
}

.swal2-loader {
  border-color: var(--primary) transparent var(--primary) transparent !important;
}

/* ════════════════════════════
       SCRAPE OVERLAY
    ════════════════════════════ */
#scrapeOverlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  /* Dark tint only – NO backdrop-filter so sidebar stays sharp */
  background: rgba(17, 24, 39, .45);
}

#scrapeOverlay.open {
  display: flex;
}

#scrapeModal {
  background: #fff;
  border-radius: 20px;
  padding: 36px;
  width: 540px;
  max-width: 94vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(17, 24, 39, .22);
  animation: fadeUp 380ms var(--ease) both;
}

/* Icon */
.sm-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #FEF3EC;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 22px;
  margin-bottom: 18px;
  flex-shrink: 0;
  transition: background 400ms, color 400ms;
}

.sm-icon-wrap.spinning i {
  animation: iconSpin 1.1s linear infinite;
}

.sm-icon-wrap.done {
  background: #D1FAE5;
  color: #059669;
}

.sm-icon-wrap.error {
  background: #FEE2E2;
  color: #DC2626;
}

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

.sm-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -.3px;
  margin-bottom: 4px;
}

.sm-phase {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 22px;
  line-height: 1.55;
  min-height: 20px;
}

/* Progress bar */
.sm-bar-wrap {
  height: 7px;
  border-radius: 999px;
  background: #F3F4F6;
  overflow: hidden;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.sm-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 999px;
  transition: width 700ms var(--ease);
  min-width: 3%;
}

.sm-bar-label {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 18px;
  flex-shrink: 0;
}

.sm-count {
  color: var(--primary);
  font-weight: 700;
}

/* Live feed */
.sm-live {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  margin-bottom: 14px;
  background: #F9FAFB;
  min-height: 120px;
  max-height: 260px;
}

.sm-live-empty {
  padding: 32px 16px;
  text-align: center;
  color: #9CA3AF;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.sm-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #F0F0F0;
  background: #fff;
  animation: slideIn 280ms var(--ease) both;
}

.sm-item:last-child {
  border-bottom: none;
}

.sm-item:first-child {
  border-radius: 11px 11px 0 0;
}

.sm-item-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #D1FAE5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  margin-top: 1px;
}

.sm-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
}

.sm-item-meta {
  font-size: 11.5px;
  color: #6B7280;
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

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

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sm-note {
  font-size: 11.5px;
  color: #9CA3AF;
  text-align: center;
  flex-shrink: 0;
}



/* Splash Screen */
#splashScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1), visibility 600ms;
}

.splash-box {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 48px 40px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  width: 380px;
  text-align: center;
  animation: splashScaleUp 600ms cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.splash-box::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at top, rgba(228, 139, 89, 0.15), transparent 70%);
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes splashScaleUp {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.splash-box img {
  height: 40px;
  margin: 0 auto 24px auto;
  display: block;
  filter: brightness(0) invert(1);
}

.splash-box h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #fff;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.splash-box p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 32px;
  line-height: 1.6;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.splash-auth-step {
  display: none;
  animation: fadeUp 400ms var(--ease);
}

.splash-auth-step.active {
  display: block;
}

#splashPass {
  width: 100%;
  margin-bottom: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 12px;
  transition: all 200ms;
  outline: none;
}

#splashPass::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

#splashPass:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(228, 139, 89, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

#splashBtn,
#splashInitBtn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 300ms var(--ease);
}

#splashBtn:hover,
#splashInitBtn:hover {
  background: var(--primary-dk);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(228, 139, 89, 0.3);
}

/* ════════════════════════════
       ENTRANCE ANIMATIONS
    ════════════════════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 500ms var(--ease) both;
}

.fade-up-d1 {
  animation-delay: 80ms;
}

.fade-up-d2 {
  animation-delay: 160ms;
}

.fade-up-d3 {
  animation-delay: 240ms;
}

.fade-up-d4 {
  animation-delay: 320ms;
}

/* ════════════════════════════
   SIDEBAR TOGGLE & RESPONSIVE
════════════════════════════ */
.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-control);
  transition: background 200ms, color 200ms;
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-1);
}

#sidebar {
  transition: transform 0.3s var(--ease), width 0.3s var(--ease), margin-left 0.3s var(--ease);
}

/* Desktop Sidebar Collapse */
@media (min-width: 901px) {
  body.sidebar-closed #sidebar {
    margin-left: -256px;
  }
}

/* Mobile Sidebar behavior */
@media (max-width: 900px) {
  #sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9999;
    box-shadow: 4px 0 24px rgba(0,0,0,0.2);
    transform: translateX(-100%);
  }
  
  body.sidebar-mobile-open #sidebar {
    transform: translateX(0);
  }

  body.sidebar-mobile-open::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
  }
}