@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Sora:wght@300;400;500;600&display=swap');

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

:root {
  --bg:           #0a0c0f;
  --bg2:          #111317;
  --bg3:          #171a1f;
  --bg4:          #1e2128;
  --bg5:          #252830;
  --border:       #2a2d35;
  --border2:      #383c46;
  --border3:      #454a56;
  --text:         #e8eaf0;
  --text2:        #9196a6;
  --text3:        #5a5f6e;
  --accent:       #4ade80;
  --accent2:      #22c55e;
  --accent-bg:    rgba(74,222,128,0.08);
  --accent-brd:   rgba(74,222,128,0.22);
  --blue:         #60a5fa;
  --blue-bg:      rgba(96,165,250,0.08);
  --blue-brd:     rgba(96,165,250,0.22);
  --red:          #f87171;
  --red-bg:       rgba(248,113,113,0.08);
  --red-brd:      rgba(248,113,113,0.22);
  --amber:        #fbbf24;
  --amber-bg:     rgba(251,191,36,0.08);
  --amber-brd:    rgba(251,191,36,0.22);
  --purple:       #a78bfa;
  --purple-bg:    rgba(167,139,250,0.08);
  --r:            8px;
  --rl:           12px;
  --rxl:          16px;
}

html { font-size: 14px; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border3); }

h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 500; }
p  { color: var(--text2); }

.app        { display: flex; flex-direction: column; min-height: 100vh; }
.main-wrap  { display: flex; flex: 1; }
.main       { flex: 1; padding: 28px 32px; max-width: 1140px; margin: 0 auto; width: 100%; }
.page       { display: none; animation: fadeIn 0.2s ease; }
.page.active{ display: block; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 58px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}
.logo-signal {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
}
.logo-signal span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.logo-signal span:nth-child(1) { height: 6px; }
.logo-signal span:nth-child(2) { height: 11px; }
.logo-signal span:nth-child(3) { height: 18px; }
.logo-label em { color: var(--accent); font-style: normal; }

.topbar-nav { display: flex; gap: 2px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  background: transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.nav-btn i { font-size: 15px; }
.nav-btn:hover { color: var(--text); background: var(--bg3); }
.nav-btn.active {
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid var(--accent-brd);
}

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

.sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 10px 4px;
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  color: var(--text2);
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.sidebar-btn i { font-size: 15px; }
.sidebar-btn:hover { color: var(--text); background: var(--bg3); }
.sidebar-btn.active { color: var(--accent); background: var(--accent-bg); font-weight: 500; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge i { font-size: 10px; }
.badge.green  { background: var(--accent-bg);  color: var(--accent); border: 1px solid var(--accent-brd); }
.badge.blue   { background: var(--blue-bg);    color: var(--blue);   border: 1px solid var(--blue-brd); }
.badge.red    { background: var(--red-bg);     color: var(--red);    border: 1px solid var(--red-brd); }
.badge.amber  { background: var(--amber-bg);   color: var(--amber);  border: 1px solid var(--amber-brd); }
.badge.purple { background: var(--purple-bg);  color: var(--purple); }
.badge.gray   { background: var(--bg4);        color: var(--text2);  border: 1px solid var(--border2); }

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 22px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-header h2,
.card-header h3 { margin: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 18px 20px;
}
.stat-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.stat-num {
  font-size: 30px;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1;
}
.stat-num.green  { color: var(--accent); }
.stat-num.blue   { color: var(--blue); }
.stat-num.amber  { color: var(--amber); }
.stat-num.red    { color: var(--red); }
.stat-sub { font-size: 11px; color: var(--text3); margin-top: 6px; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.form-group { margin-bottom: 14px; }
.form-row   { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.form-row3  { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }

label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74,222,128,0.1);
}
input::placeholder, textarea::placeholder { color: var(--text3); }
select option { background: var(--bg3); color: var(--text); }
textarea { resize: vertical; min-height: 90px; }

.input-hint { font-size: 11px; color: var(--text3); margin-top: 5px; }
.char-count  { font-size: 11px; color: var(--text3); margin-top: 5px; text-align: right; }
.char-count.warn { color: var(--amber); }
.char-count.over { color: var(--red); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r);
  border: 1px solid var(--border2);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg3);
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn i { font-size: 15px; }
.btn:hover { background: var(--bg4); border-color: var(--border3); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}
.btn.primary:hover { background: var(--accent2); border-color: var(--accent2); }

.btn.danger  { background: var(--red-bg); border-color: var(--red-brd); color: var(--red); }
.btn.ghost   { background: transparent; border-color: transparent; color: var(--text2); }
.btn.ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--border); }

.btn.sm { padding: 5px 11px; font-size: 12px; }
.btn.sm i { font-size: 13px; }
.btn.lg { padding: 12px 24px; font-size: 14px; }
.btn.full { width: 100%; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
thead tr { border-bottom: 1px solid var(--border2); }
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg3); }

.progress-wrap {
  width: 100%;
  background: var(--bg4);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.4s ease;
}
.progress-bar.warn   { background: var(--amber); }
.progress-bar.danger { background: var(--red); }

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-brd);
}

.log-list { display: flex; flex-direction: column; }
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.log-item:last-child { border-bottom: none; }
.log-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.log-icon i  { font-size: 11px; }
.log-icon.ok { background: var(--accent-bg); color: var(--accent); }
.log-icon.err{ background: var(--red-bg);    color: var(--red); }
.log-icon.info{background: var(--blue-bg);   color: var(--blue); }
.log-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--text3);
  min-width: 72px;
  padding-top: 2px;
}
.log-body   { flex: 1; min-width: 0; }
.log-msg    { font-size: 13px; font-weight: 500; color: var(--text); }
.log-detail { font-size: 11px; color: var(--text3); margin-top: 2px; }

.link-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.link-copy:hover { border-color: var(--blue); }
.link-copy span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.link-copy i { font-size: 13px; color: var(--text3); flex-shrink: 0; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.section-header-left h1 { margin-bottom: 4px; }
.section-header-left p  { font-size: 13px; }

.client-hero {
  text-align: center;
  padding: 40px 0 30px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.client-hero-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--accent-bg);
  border: 1px solid var(--accent-brd);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 22px;
  color: var(--accent);
}
.client-hero h1 { font-size: 24px; margin-bottom: 6px; }
.client-hero p   { font-size: 13px; }

.limit-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  padding: 18px 22px;
  margin-bottom: 22px;
}
.limit-bar-nums {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: 'IBM Plex Mono', monospace;
}
.limit-big   { font-size: 26px; font-weight: 600; }
.limit-sep   { font-size: 20px; color: var(--text3); }
.limit-total { font-size: 20px; color: var(--text3); }
.limit-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.limit-bar-track { flex: 1; }

#numbers-input {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.9;
  min-height: 180px;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--rxl);
  padding: 26px;
  width: 500px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform: scale(0.96) translateY(8px); } to { opacity:1; transform: none; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.modal-close:hover { color: var(--text); background: var(--bg3); }

.api-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
}

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--rl);
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 420px;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.ok  { border-color: var(--accent-brd); color: var(--accent); }
#toast.err { border-color: var(--red-brd);    color: var(--red); }
#toast.info{ border-color: var(--blue-brd);   color: var(--blue); }
#toast i   { font-size: 15px; }

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.live-dot::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: livepulse 2s infinite;
}
@keyframes livepulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--text3);
}
.empty-state i { font-size: 36px; margin-bottom: 14px; display: block; opacity: 0.35; }
.empty-state h3 { color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 12px; }

.action-row { display: flex; gap: 6px; }

.phone-count-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-brd);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 500;
}

.result-card {
  border-radius: var(--rl);
  padding: 16px 18px;
  margin-top: 14px;
  font-size: 13px;
  display: none;
}
.result-card.ok  { background: var(--accent-bg); border: 1px solid var(--accent-brd); color: var(--accent); }
.result-card.err { background: var(--red-bg);    border: 1px solid var(--red-brd);    color: var(--red); }
.result-card.show{ display: block; }

@media (max-width: 768px) {
  .main       { padding: 18px 16px; }
  .topbar     { padding: 0 16px; }
  .grid2,.grid3 { grid-template-columns: 1fr; }
  .form-row,.form-row3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar    { display: none; }
  table       { table-layout: auto; }
}

#file-drop-zone:hover {
  border-color: var(--blue);
  color: var(--text);
}
#file-drop-zone:hover i {
  color: var(--blue);
}