/* Admin Dashboard Styling */
:root {
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-text: #94a3b8;
  --admin-sidebar-active: #ffffff;
  --admin-content-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-primary: #2563eb;
  --admin-primary-hover: #1d4ed8;
}

body.admin-body {
  background-color: var(--admin-content-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--admin-sidebar-bg);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 1.5rem 1rem;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--admin-sidebar-text);
  transition: all 0.2s;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--admin-sidebar-active);
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--admin-border);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.admin-content {
  padding: 2rem;
  flex: 1;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 4px;
}

/* Admin Table */
.admin-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 16px;
  font-size: 0.9375rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: #fbfcfe;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.9375rem;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--admin-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--admin-primary-hover);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--admin-border);
  color: #334155;
}

.btn-secondary:hover {
  background: #f8fafc;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fecaca;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.alert-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.alert-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Analytics & Tracking Badges */
.badge-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-web {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-play {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-apple {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

.badge-qr {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.ip-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  background: #f1f5f9;
  color: #334155;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.analytics-grid-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 992px) {
  .analytics-grid-split {
    grid-template-columns: 1fr;
  }
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--admin-primary);
  transition: width 0.3s ease;
}
