/* ============================================
   STICKERBOOK ADMIN - STYLES
   ============================================ */

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

:root {
  --bg-dark: #0a0a0a;
  --bg-card: #141414;
  --bg-input: #1a1a1a;
  --border: #2a2a2a;
  --border-hover: #3a3a3a;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent-purple: #6d28d9;
  --accent-teal: #14b8a6;
  --accent-green: #22c55e;
  --accent-yellow: #eab308;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --gradient: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ============ LOGIN SCREEN ============ */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-dark);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 32px;
  color: var(--text-secondary);
}

.login-card .form-field {
  margin-bottom: 16px;
  text-align: left;
}

.login-card label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.login-card input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.login-card input:focus {
  outline: none;
  border-color: var(--accent-teal);
}

.login-error {
  color: var(--accent-red);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

.login-footer {
  margin-top: 32px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ============ BUTTONS ============ */

.btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient);
  color: white;
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.btn-full { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 12px; }

/* ============ HEADER ============ */

.header {
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 16px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.badge {
  padding: 4px 10px;
  background: var(--accent-purple);
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.admin-email {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ NAVIGATION ============ */

.nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  overflow-x: auto;
}

.tab {
  padding: 14px 20px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s;
}

.tab:hover { color: var(--text-secondary); }

.tab.active { color: var(--text-primary); }

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient);
}

.tab.has-badge::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
}

/* ============ CONTENT ============ */

.content {
  padding: 32px;
  max-width: 1600px;
  margin: 0 auto;
}

.panel { display: none; }
.panel.active { display: block; }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.panel-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.panel-actions {
  display: flex;
  gap: 12px;
}

/* ============ STATS CARDS ============ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-change {
  font-size: 12px;
  margin-top: 6px;
}

.stat-change.positive { color: var(--accent-green); }
.stat-change.negative { color: var(--accent-red); }
.stat-change.neutral { color: var(--text-muted); }

/* ============ ALERTS ============ */

.alerts-section {
  margin-bottom: 32px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.alert-card.urgent { border-left: 3px solid var(--accent-red); }
.alert-card.warning { border-left: 3px solid var(--accent-yellow); }
.alert-card.info { border-left: 3px solid var(--accent-blue); }

.alert-content { flex: 1; }
.alert-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.alert-description { font-size: 13px; color: var(--text-muted); }

/* ============ DATA TABLE ============ */

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.table-filters input,
.table-filters select {
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  min-width: 150px;
}

.table-filters input { flex: 1; min-width: 200px; max-width: 400px; }
.table-filters input:focus,
.table-filters select:focus {
  outline: none;
  border-color: var(--accent-teal);
}

.table-count {
  font-size: 13px;
  color: var(--text-muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.data-table .actions {
  display: flex;
  gap: 8px;
}

.data-table .btn {
  padding: 6px 12px;
  font-size: 11px;
}

/* ============ STATUS BADGES ============ */

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status.live { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.status.active { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.status.pending { background: rgba(234,179,8,0.15); color: var(--accent-yellow); }
.status.under_review { background: rgba(234,179,8,0.15); color: var(--accent-yellow); }
.status.restricted { background: rgba(249,115,22,0.15); color: #f97316; }
.status.archived { background: rgba(113,113,122,0.15); color: var(--text-muted); }
.status.rejected { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.status.suspended { background: rgba(239,68,68,0.15); color: var(--accent-red); }

/* ============ CARD GRID ============ */

.card-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-hover); }

.card-image {
  aspect-ratio: 1;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-body { padding: 16px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.card-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions .btn { flex: 1; }

/* ============ MODAL ============ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal.large { max-width: 900px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title { font-size: 18px; font-weight: 600; }

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg-input);
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============ FORM FIELDS ============ */

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-teal);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ============ TABS (INLINE) ============ */

.inline-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.inline-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.inline-tab:hover { color: var(--text-secondary); }

.inline-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ============ TOAST ============ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--accent-green); color: var(--accent-green); }
.toast.error { border-color: var(--accent-red); color: var(--accent-red); }

/* ============ EMPTY STATE ============ */

.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  margin-bottom: 20px;
}

/* ============ LOADING ============ */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ USER/CREATOR PROFILE ============ */

.profile-header {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-info { flex: 1; }
.profile-name { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.profile-email { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }

.profile-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-meta-item {
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-meta-label {
  color: var(--text-muted);
}

/* ============ QUICK ACTIONS ============ */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.quick-action {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.quick-action:hover {
  border-color: var(--accent-teal);
  background: rgba(20, 184, 166, 0.05);
}

.quick-action-icon {
  font-size: 24px;
}

.quick-action-label {
  font-size: 14px;
  font-weight: 500;
}

/* ============ VIEW TOGGLE ============ */

.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 8px;
}

.view-toggle button {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.view-toggle button:hover { color: var(--text-secondary); }
.view-toggle button.active { background: var(--border); color: var(--text-primary); }

/* ============ PAGINATION ============ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}

.pagination button:hover { border-color: var(--border-hover); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination button.active { background: var(--accent-purple); border-color: var(--accent-purple); color: white; }

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 12px;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1024px) {
  .content { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .header { padding: 12px 16px; }
  .nav { padding: 0 16px; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-filters { flex-direction: column; }
  .table-filters input { max-width: none; }
  .admin-email { display: none; }
}
