/* ═══════════════════════════════════════════════════════════════════════════
   PIVO Admin Dashboard — Styles
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --bg-card: #13131a;
  --bg-card-hover: #1a1a24;
  --bg-sidebar: #0e0e15;
  --bg-input: #1a1a24;
  --border: #23232f;
  --text: #e8e8ed;
  --text-dim: #8888a0;
  --text-dimmer: #555568;
  --accent: #7c5cfc;
  --accent-glow: #7c5cfc44;
  --accent-hover: #6a4ae8;
  --red: #ef4444;
  --red-bg: #ef444418;
  --green: #22c55e;
  --green-bg: #22c55e18;
  --yellow: #f59e0b;
  --yellow-bg: #f59e0b18;
  --orange: #f97316;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ─── Login ─── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, var(--accent-glow), transparent 60%), var(--bg);
}

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

.login-logo {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent);
  margin-bottom: 4px;
}

.login-card h2 {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-dimmer);
  margin-bottom: 28px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#login-form input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

#login-form input:focus {
  border-color: var(--accent);
}

#login-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  margin-top: 4px;
}

#login-form button:hover { background: var(--accent-hover); }
#login-form button:disabled { opacity: .5; cursor: wait; }

.error-text {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-dimmer);
  font-size: 12px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 8px;
}

.oauth-btn:hover {
  border-color: var(--text-dimmer);
  background: var(--bg-card-hover);
}

.oauth-btn:disabled {
  opacity: .5;
  cursor: wait;
}

/* ─── Dashboard Layout ─── */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--accent);
  padding: 0 24px;
}

.sidebar-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dimmer);
  padding: 0 24px;
  margin-bottom: 32px;
}

.nav-list {
  list-style: none;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s;
  position: relative;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg-card);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
  border-right: 3px solid var(--accent);
}

.badge {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: auto;
}

.sidebar-bottom {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.admin-name {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
}

.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px 40px;
  max-width: 1200px;
}

.page h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 { margin-bottom: 0; }

/* ─── Stats Grid ─── */
.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: var(--radius);
  padding: 24px;
  transition: border-color .2s;
}

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

.stat-card.accent {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-glow), var(--bg-card));
}

.stat-number {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-dim);
}

/* ─── Two Column Layout ─── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dim);
}

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

.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.mini-item .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-input);
  object-fit: cover;
  flex-shrink: 0;
}

.mini-item .name { font-weight: 500; }
.mini-item .sub { color: var(--text-dimmer); font-size: 12px; }

/* ─── Search Input ─── */
.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  color: var(--text);
  font-size: 13px;
  width: 280px;
  outline: none;
  transition: border-color .2s;
}

.search-input:focus { border-color: var(--accent); }

.filter-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* ─── Table ─── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dimmer);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover { background: var(--bg-card-hover); }

.table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-input);
  object-fit: cover;
}

.table-img {
  width: 56px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  object-fit: cover;
}

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

.status-active {
  background: var(--green-bg);
  color: var(--green);
}

.status-banned {
  background: var(--red-bg);
  color: var(--red);
}

.status-verified {
  background: linear-gradient(135deg, #7c5cfc, #6366f1);
  color: #fff;
  font-weight: 600;
}

.role-admin {
  background: var(--accent-glow);
  color: var(--accent);
}

.role-user {
  background: var(--bg-input);
  color: var(--text-dim);
}

/* ─── Action Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  background: none;
  color: var(--text-dim);
  white-space: nowrap;
}

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

.btn-danger {
  border-color: var(--red);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red-bg);
}

.btn-success {
  border-color: var(--green);
  color: var(--green);
}

.btn-success:hover {
  background: var(--green-bg);
}

.btn-verify {
  background: linear-gradient(135deg, #7c5cfc, #6366f1);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 20px;
  padding: 6px 16px;
}

.btn-verify:hover {
  background: linear-gradient(135deg, #6a4ce0, #5558e6);
  color: #fff;
}

.btn-verified {
  background: linear-gradient(135deg, #7c5cfc, #6366f1);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 20px;
  padding: 6px 16px;
  opacity: 0.9;
}

.btn-verified:hover {
  background: linear-gradient(135deg, #6a4ce0, #5558e6);
  color: #fff;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

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

.btn-group {
  display: flex;
  gap: 6px;
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}

.pagination button:hover { border-color: var(--accent); color: var(--accent); }
.pagination button:disabled { opacity: .3; cursor: default; }
.pagination button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.pagination .page-info {
  font-size: 13px;
  color: var(--text-dimmer);
}

/* ─── Reports List ─── */
.reports-list { display: flex; flex-direction: column; gap: 12px; }

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .2s;
}

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

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.report-reason {
  font-weight: 600;
  font-size: 14px;
  text-transform: capitalize;
}

.report-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.report-status.open { background: var(--yellow-bg); color: var(--yellow); }
.report-status.reviewed { background: var(--accent-glow); color: var(--accent); }
.report-status.resolved { background: var(--green-bg); color: var(--green); }
.report-status.dismissed { background: var(--bg-input); color: var(--text-dimmer); }

.report-details {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}

.report-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-dimmer);
  margin-bottom: 12px;
}

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

/* ─── Logs ─── */
.logs-list { display: flex; flex-direction: column; gap: 8px; }

.log-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.log-action {
  font-weight: 600;
  min-width: 120px;
}

.log-action.ban { color: var(--red); }
.log-action.unban { color: var(--green); }
.log-action.delete { color: var(--orange); }
.log-action.resolve { color: var(--accent); }

.log-details { color: var(--text-dim); flex: 1; }
.log-time { color: var(--text-dimmer); font-size: 12px; white-space: nowrap; }

/* ─── Push Form ─── */
.push-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}
.push-form .field { display: flex; flex-direction: column; gap: 4px; }
.push-form .field-label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.push-form textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.push-form textarea:focus { border-color: var(--accent); outline: none; }
.log-meta { font-size: 12px; color: var(--text-dimmer); white-space: nowrap; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-dimmer);
  font-size: 14px;
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.modal-header h3 { font-size: 16px; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
}

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

.modal-body {
  padding: 24px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

.modal-body .field {
  margin-bottom: 14px;
}

.modal-body .field-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dimmer);
  margin-bottom: 4px;
}

.modal-body .field-value {
  color: var(--text);
}

.modal-body textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  outline: none;
}

.modal-body textarea:focus { border-color: var(--accent); }

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

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .sidebar { width: 60px; min-width: 60px; }
  .sidebar-logo, .sidebar-sub, .nav-item span, .sidebar-bottom .admin-name { display: none; }
  .nav-item { justify-content: center; padding: 14px 0; }
  .nav-item svg { width: 20px; height: 20px; }
  .main-content { margin-left: 60px; padding: 24px 20px; }
  .two-col { grid-template-columns: 1fr; }
  .search-input { width: 100%; }
}

/* ─── Loading Spinner ─── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

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

/* ─── Toasts ─── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn .3s ease;
  max-width: 360px;
}

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

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Push composer ───────────────────────────────────────────────────────── */

.push-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.field-hint {
  font-size: 12px;
  color: var(--text-dimmer);
  margin-top: 6px;
}

/* Template picker */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.tpl {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: left;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.tpl:hover { background: var(--bg-card-hover); border-color: var(--accent); }

.tpl.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.tpl-emoji { font-size: 16px; line-height: 1; }

/* Phone preview */
.push-preview-col { position: sticky; top: 24px; }

.phone {
  background: linear-gradient(160deg, #2a2140 0%, #1b2a44 100%);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 18px 12px 26px;
  min-height: 220px;
}

.phone-time {
  text-align: center;
  color: #fff;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -1px;
  margin: 6px 0 18px;
}

.notif {
  display: flex;
  gap: 10px;
  background: rgba(245, 245, 250, 0.92);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7C3AED, #3B82F6);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-text { min-width: 0; flex: 1; }

.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.notif-app {
  font-size: 11px;
  font-weight: 600;
  color: #6b6b76;
  letter-spacing: .4px;
}

.notif-ago { font-size: 11px; color: #8e8e98; }

.notif-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0b0b12;
  margin-top: 1px;
  word-wrap: break-word;
}

.notif-body {
  font-size: 13px;
  color: #33333f;
  line-height: 1.35;
  word-wrap: break-word;
}

.notif-body:empty { display: none; }

@media (max-width: 900px) {
  .push-layout { grid-template-columns: 1fr; }
  .push-preview-col { position: static; max-width: 320px; }
}
