/* ============================================================
   Phone Number Filter Pro AI  —  Design System
   Dark mode · glassmorphism · modern SaaS dashboard
   ============================================================ */

/* ---- Fonts ---------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Outfit:wght@300;400;500;600&display=swap');

/* ---- Design tokens ------------------------------------------- */
:root {
  /* surfaces */
  --bg-0:        #0a0c10;
  --bg-1:        #0f1218;
  --bg-2:        #141823;
  --surface:     rgba(23, 27, 38, 0.72);
  --surface-2:   rgba(31, 36, 50, 0.85);
  --border:      rgba(255, 255, 255, 0.07);
  --border-2:    rgba(255, 255, 255, 0.12);

  /* text */
  --text:        #eef1f6;
  --text-dim:    #a4adbe;
  --text-faint:  #6b7387;

  /* brand — teal/emerald accent (not the cliché purple) */
  --accent:      #2dd4bf;
  --accent-2:    #14b8a6;
  --accent-glow: rgba(45, 212, 191, 0.28);
  --indigo:      #6366f1;
  --amber:       #f5b945;
  --rose:        #f43f6e;
  --sky:         #38bdf8;

  /* feedback */
  --ok:          #34d399;
  --warn:        #fbbf24;
  --err:         #f87171;

  /* shape */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* effects */
  --shadow:      0 18px 48px -12px rgba(0, 0, 0, 0.65);
  --shadow-sm:   0 6px 20px -6px rgba(0, 0, 0, 0.5);
  --blur:        18px;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body:    'Outfit', system-ui, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* atmospheric background mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(620px 420px at 8% -4%,  rgba(45, 212, 191, 0.13), transparent 70%),
    radial-gradient(680px 480px at 100% 0%, rgba(99, 102, 241, 0.12), transparent 72%),
    radial-gradient(720px 560px at 60% 108%, rgba(56, 189, 248, 0.08), transparent 72%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--accent-glow); color: #fff; }

/* ---- Scrollbar ----------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.16); background-clip: padding-box; }

/* ---- Typography helpers -------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.text-dim   { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.mono       { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

/* ============================================================
   LAYOUT — sidebar + topbar shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

/* ---- Sidebar ------------------------------------------------- */
.sidebar {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 22px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  box-shadow: 0 8px 22px -6px var(--accent-glow);
  flex-shrink: 0;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -0.03em; }
.brand-sub  { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; }

.nav-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-faint);
  padding: 16px 10px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.16s, color 0.16s, transform 0.16s;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, var(--accent-glow), transparent);
  color: var(--text);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 8px;
  border-radius: 20px;
  color: var(--text-dim);
}

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.plan-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.plan-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }

/* ---- Main column --------------------------------------------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.72);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 { font-size: 19px; }
.topbar .subtitle { font-size: 13px; color: var(--text-faint); }
.topbar-spacer { flex: 1; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.icon-btn svg { width: 18px; height: 18px; }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo), var(--accent));
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
}

.content { padding: 30px; max-width: 1500px; width: 100%; }

/* mobile menu toggle (hidden on desktop) */
.menu-toggle { display: none; }

/* ============================================================
   CARDS & SURFACES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 15px; }
.card-head .text-faint { font-size: 12.5px; }

/* stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.stat:hover { transform: translateY(-3px); border-color: var(--border-2); }
.stat::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface-2);
  margin-bottom: 14px;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.stat-label { font-size: 13px; color: var(--text-faint); margin-top: 2px; }
.stat-trend { font-size: 12px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up   { color: var(--ok); }
.stat-trend.down { color: var(--err); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s, background 0.16s, border-color 0.16s, box-shadow 0.16s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04201c;
  border-color: transparent;
  box-shadow: 0 10px 26px -10px var(--accent-glow);
}
.btn-primary:hover { background: linear-gradient(135deg, #43e0cd, var(--accent)); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-danger { background: rgba(244, 63, 110, 0.12); border-color: rgba(244, 63, 110, 0.3); color: #ff8aa6; }
.btn-danger:hover { background: rgba(244, 63, 110, 0.2); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.textarea { resize: vertical; min-height: 110px; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 14px;
}
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-dim);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-ok    { background: rgba(52, 211, 153, 0.13); color: var(--ok); }
.badge-warn  { background: rgba(251, 191, 36, 0.13); color: var(--warn); }
.badge-err   { background: rgba(248, 113, 113, 0.13); color: var(--err); }
.badge-info  { background: rgba(56, 189, 248, 0.13); color: var(--sky); }
.badge-accent{ background: var(--accent-glow); color: var(--accent); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  font-weight: 600;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
table.data tbody tr { transition: background 0.12s; }
table.data tbody tr:hover { background: var(--surface); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .col-check { width: 40px; }

/* ============================================================
   UPLOAD / DROPZONE
   ============================================================ */
.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--r-lg);
  padding: 48px 28px;
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.dropzone .dz-icon {
  width: 58px; height: 58px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--surface-2);
  display: grid; place-items: center;
}
.dropzone .dz-icon svg { width: 28px; height: 28px; }

/* file chips */
.file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-top: 10px;
}
.file-chip .fc-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--surface-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.file-chip .fc-meta { flex: 1; min-width: 0; }
.file-chip .fc-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .fc-size { font-size: 12px; color: var(--text-faint); }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
  height: 8px;
  background: var(--bg-2);
  border-radius: 20px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--sky));
  border-radius: 20px;
  width: 0;
  transition: width 0.4s ease;
  position: relative;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-faint);
}
.empty .empty-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid; place-items: center;
}
.empty .empty-icon svg { width: 30px; height: 30px; opacity: 0.6; }
.empty h3 { color: var(--text-dim); margin-bottom: 6px; }

.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skel 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================================================
   TOASTS
   ============================================================ */
.toast-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 17px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
  min-width: 260px;
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.out { animation: toast-out 0.25s forwards; }
.toast .t-bar { width: 3px; align-self: stretch; border-radius: 3px; }
.toast.ok   .t-bar { background: var(--ok); }
.toast.err  .t-bar { background: var(--err); }
.toast.info .t-bar { background: var(--sky); }
@keyframes toast-in  { from { opacity: 0; transform: translateX(40px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(40px); } }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.74);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 20px;
}
.modal-overlay.show { display: flex; animation: fade-in 0.2s; }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modal-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-head {
  display: flex; align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 24px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}
@keyframes fade-in  { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(0.97); } }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-art {
  background: linear-gradient(150deg, var(--bg-1), var(--bg-0));
  border-right: 1px solid var(--border);
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-art::before {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  top: -120px; right: -140px;
}
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-card { width: 100%; max-width: 400px; }
.feature-row { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.feature-row .fr-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}

/* ============================================================
   MISC LAYOUT HELPERS
   ============================================================ */
.row { display: flex; gap: 14px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { align-items: center; }
.grow { flex: 1; }
.gap-sm { gap: 8px; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 26px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title h2 { font-size: 18px; }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: var(--r-sm);
  margin-bottom: 20px;
  width: fit-content;
}
.tab {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab.active { background: var(--surface-2); color: var(--text); }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* fade-in-up entrance for page content */
.reveal { animation: reveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.reveal:nth-child(1) { animation-delay: 0.04s; }
.reveal:nth-child(2) { animation-delay: 0.10s; }
.reveal:nth-child(3) { animation-delay: 0.16s; }
.reveal:nth-child(4) { animation-delay: 0.22s; }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 256px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .content { padding: 18px; }
  .topbar { padding: 14px 18px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
  }
  .sidebar-backdrop.show { display: block; }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 24px; }
  .modal { border-radius: var(--r-lg); }
}
