/* ============================================================
   NUMBER DATABASE — SHARED STYLES
   Theme: Blue & White Soft
   Font: Plus Jakarta Sans (display) + JetBrains Mono (numbers/ids)
   ============================================================ */

:root {
  --bg:         #f5f9ff;
  --surface:    #ffffff;
  --surface-2:  #eef4ff;
  --border:     #dde7f7;
  --blue:       #2563eb;
  --blue-mid:   #3b82f6;
  --blue-light: #93c5fd;
  --blue-pale:  #eef4ff;
  --text:       #0f1f3d;
  --muted:      #5b6b8c;
  --muted-2:    #94a3c0;
  --success:    #16a34a;
  --success-soft: #dcfce7;
  --error:      #dc2626;
  --error-soft: #fee2e2;
  --gray:       #64748b;
  --gray-soft:  #f1f5f9;
  --radius-sm:  10px;
  --radius:     16px;
  --radius-lg:  24px;
  --shadow-sm:  0 1px 4px rgba(37,99,235,.06);
  --shadow:     0 6px 28px rgba(37,99,235,.09);
  --shadow-lg:  0 16px 56px rgba(37,99,235,.13);
  --font:       'Plus Jakarta Sans', sans-serif;
  --mono:       'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #bfdbfe 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .4;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  top: -220px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 560px;
  background: radial-gradient(ellipse, rgba(59,130,246,.13) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main, nav, footer { position: relative; z-index: 1; }

svg.icon { display: block; flex-shrink: 0; }

/* ── particle canvas ── */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: sticky; top: 0;
  background: rgba(245,249,255,.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  height: 66px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 5vw, 56px);
  z-index: 100;
}

.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: .98rem; font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
}

.nav-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 3px 12px rgba(37,99,235,.32);
  flex-shrink: 0;
}

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

.role-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: .76rem; font-weight: 700;
  color: var(--blue);
  background: var(--blue-pale);
  padding: 6px 12px;
  border-radius: 100px;
}
.role-badge svg { width: 12px; height: 12px; }

.btn-logout {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font);
  font-size: .84rem; font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}
.btn-logout:hover { border-color: var(--error); background: var(--error-soft); color: var(--error); }
.btn-logout svg { width: 14px; height: 14px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: .95rem; font-weight: 700;
  padding: 14px 26px;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(37,99,235,.30);
  text-decoration: none;
  transition: background .15s, transform .15s, box-shadow .15s;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(37,99,235,.38);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary svg { width: 17px; height: 17px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; right: 24px; left: 24px;
  max-width: 360px;
  margin: 0 auto;
  background: var(--text); color: #fff;
  font-size: .86rem; font-weight: 500;
  padding: 12px 20px; border-radius: var(--radius-sm);
  box-shadow: 0 10px 36px rgba(0,0,0,.24);
  opacity: 0; transform: translateY(16px);
  transition: opacity .25s, transform .25s;
  pointer-events: none; z-index: 999;
  display: flex; align-items: center; gap: 10px;
}
@media (min-width: 560px) { .toast { left: auto; right: 24px; margin: 0; } }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #7f1d1d; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================================
   SECTION / CARD
   ============================================================ */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 48px) clamp(16px, 5vw, 32px) 80px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 5vw, 32px);
  box-shadow: var(--shadow-lg);
}

.card-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.card-label svg { width: 13px; height: 13px; color: var(--blue); }

/* ── Add number row (input + button, same shape) ── */
.add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.number-input, .search-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  outline: none;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.number-input:focus, .search-input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 4px rgba(59,130,246,.13);
  background: var(--surface);
}
.number-input::placeholder, .search-input::placeholder { color: var(--muted-2); font-weight: 500; }

.btn-add {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: .92rem; font-weight: 700;
  padding: 13px 22px;
  border: none;
  border-radius: var(--radius-sm); /* matches number-input radius exactly */
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37,99,235,.26);
  transition: background .14s, transform .14s;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-add:hover:not(:disabled) { background: #1d4ed8; transform: translateY(-1px); }
.btn-add:disabled { opacity: .55; cursor: not-allowed; }
.btn-add svg { width: 16px; height: 16px; }

.form-hint { font-size: .78rem; color: var(--muted-2); margin-bottom: 6px; }
.form-hint.error { color: var(--error); font-weight: 600; }

/* ── Search box (below add, same visual weight) ── */
.search-row {
  position: relative;
  margin-top: 22px;
}
.search-row svg.search-icon {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted-2);
  pointer-events: none;
}
.search-row .search-input { padding-left: 42px; width: 100%; }

/* ============================================================
   NUMBER LIST
   ============================================================ */
.list-section { margin-top: 28px; }

.list-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.list-heading-title {
  font-size: .82rem; font-weight: 700; color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.list-heading-title svg { width: 13px; height: 13px; color: var(--blue); }
.list-count {
  font-family: var(--mono);
  font-size: .74rem; font-weight: 700;
  color: var(--blue);
  background: var(--blue-pale);
  padding: 3px 10px;
  border-radius: 100px;
}

.number-list { display: flex; flex-direction: column; gap: 10px; }

.number-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .14s, box-shadow .14s, opacity .2s;
}
.number-item:hover { box-shadow: var(--shadow); }

.number-item.is-blacklisted { opacity: .68; background: var(--gray-soft); }

.number-item-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--blue-pale);
  color: var(--blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.number-item-icon svg { width: 17px; height: 17px; }
.number-item.is-blacklisted .number-item-icon { background: var(--gray-soft); color: var(--gray); }

.number-item-info { flex: 1; min-width: 0; }
.number-item-number {
  font-family: var(--mono);
  font-size: .93rem; font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.number-item-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
}

.status-dot {
  display: flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700;
}
.status-dot .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.online { color: var(--success); }
.status-dot.online .dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-dot.offline { color: var(--muted-2); }
.status-dot.offline .dot { background: var(--muted-2); }

.blacklist-tag {
  display: flex; align-items: center; gap: 4px;
  font-size: .7rem; font-weight: 700;
  color: var(--gray);
  background: var(--gray-soft);
  padding: 2px 8px;
  border-radius: 100px;
}
.blacklist-tag svg { width: 10px; height: 10px; }

.number-item-date {
  font-size: .72rem; color: var(--muted-2);
  margin-top: 3px;
}

.number-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 9px;
  cursor: pointer;
  transition: background .14s, transform .14s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:active { transform: scale(.92); }

.icon-btn-delete { background: var(--error-soft); color: var(--error); }
.icon-btn-delete:hover { background: #fecaca; }

.icon-btn-blacklist { background: var(--gray-soft); color: var(--gray); }
.icon-btn-blacklist:hover { background: #e2e8f0; }
.icon-btn-blacklist.active { background: var(--gray); color: #fff; }

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted-2);
}
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: .88rem; }

.loading-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 32px;
  color: var(--muted);
  font-size: .88rem;
}
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-card {
  max-width: 400px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(32px, 7vw, 42px);
  text-align: center;
}

.login-icon {
  width: 60px; height: 60px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(37,99,235,.3);
}
.login-icon svg { width: 28px; height: 28px; }

.login-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; color: var(--text); }
.login-sub { font-size: .86rem; color: var(--muted); margin-bottom: 28px; }

.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }

.field-label {
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
  display: block;
}

.login-input-wrap { position: relative; }
.login-input-wrap svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted-2);
}
.login-input {
  width: 100%;
  font-family: var(--font);
  font-size: .95rem;
  padding: 13px 16px 13px 42px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  outline: none;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
.login-input:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 4px rgba(59,130,246,.13);
  background: var(--surface);
}

.login-error {
  display: none;
  align-items: center; gap: 9px;
  background: var(--error-soft);
  color: var(--error);
  font-size: .84rem; font-weight: 600;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
}
.login-error.active { display: flex; }
.login-error svg { width: 15px; height: 15px; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  [data-aos] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .spinner { animation: none; }
  .status-dot.online .dot { box-shadow: none; }
}
