/* ── Base ──────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }

/* ── Sidebar Nav ───────────────────────────────────────────────────── */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: #64748b; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.nav-item:hover { background: #1e293b; color: #cbd5e1; }
.nav-item.active { background: #064e3b; color: #6ee7b7; font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ── Stat Cards ────────────────────────────────────────────────────── */
.stat-card {
  background: white; border-radius: 18px;
  border: 1px solid #f1f5f9;
  padding: 22px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 0 0 0 transparent;
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

/* ── Chart Card ────────────────────────────────────────────────────── */
.chart-card {
  background: white; border-radius: 18px;
  border: 1px solid #f1f5f9;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* ── Table ─────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { position: sticky; top: 0; z-index: 1; }
.data-table th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  color: #94a3b8; text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px; color: #334155;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafafa; }

.table-wrap {
  background: white; border-radius: 16px;
  border: 1px solid #f1f5f9;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* ── Badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-active  { background: #d1fae5; color: #065f46; }
.badge-paused  { background: #fef3c7; color: #92400e; }
.badge-android { background: #dcfce7; color: #166534; }
.badge-ios     { background: #dbeafe; color: #1e40af; }
.badge-web     { background: #ede9fe; color: #5b21b6; }
.badge-all     { background: #f0fdf4; color: #14532d; }

/* ── Modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.modal-box {
  background: white; border-radius: 20px; padding: 32px;
  width: 560px; max-width: calc(100vw - 40px);
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 32px 64px rgba(0,0,0,.18);
  animation: slideUp 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
  color: #64748b; text-transform: uppercase; margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid #e2e8f0; font-size: 13.5px; color: #1e293b;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  background: #f8fafc; font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #10b981; background: white;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  padding: 9px 20px; border-radius: 10px; font-size: 13px;
  font-weight: 600; cursor: pointer; border: none;
  transition: all 0.15s; font-family: inherit; display: inline-flex;
  align-items: center; gap: 7px;
}
.btn:active { transform: scale(0.97); }
.btn-primary   { background: #10b981; color: white; }
.btn-primary:hover { background: #059669; }
.btn-danger    { background: #fef2f2; color: #dc2626; }
.btn-danger:hover  { background: #fee2e2; }
.btn-ghost     { background: #f1f5f9; color: #475569; }
.btn-ghost:hover   { background: #e2e8f0; }
.btn-icon {
  padding: 6px; border-radius: 8px; border: none; cursor: pointer;
  background: transparent; transition: all 0.15s; font-family: inherit;
  display: inline-flex; align-items: center;
}
.btn-icon:hover { background: #f1f5f9; }
.btn-icon.danger:hover { background: #fef2f2; color: #dc2626; }

/* ── Toggle ────────────────────────────────────────────────────────── */
.toggle {
  position: relative; width: 38px; height: 22px;
  display: inline-block; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 100px;
  background: #e2e8f0; cursor: pointer; transition: background 0.2s;
}
.toggle input:checked + .toggle-track { background: #10b981; }
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* ── Loading ───────────────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px; border: 3px solid #e2e8f0;
  border-top-color: #10b981; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm {
  width: 18px; height: 18px; border-width: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-cell {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; flex-direction: column; gap: 10px;
  color: #94a3b8; font-size: 13px;
}

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast {
  padding: 12px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 500; max-width: 320px;
  animation: toastIn 0.2s ease; display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.toast-success { background: #064e3b; color: #6ee7b7; }
.toast-error   { background: #7f1d1d; color: #fca5a5; }
.toast-info    { background: #1e3a5f; color: #93c5fd; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }

/* ── Section header ────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title { font-size: 15px; font-weight: 700; color: #1e293b; }

/* ── Empty state ───────────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 64px 32px; gap: 12px;
  color: #94a3b8; text-align: center;
}
.empty-state svg { opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ── Color swatch ──────────────────────────────────────────────────── */
.color-swatch {
  width: 18px; height: 18px; border-radius: 5px; display: inline-block;
  border: 1px solid rgba(0,0,0,0.1); flex-shrink: 0;
}

/* ── Divider ───────────────────────────────────────────────────────── */
.modal-divider { border: none; border-top: 1px solid #f1f5f9; margin: 20px 0; }

