/* ── Admin Panel Styles ── */
:root {
  --primary-blue: #448AFF;
  --primary-purple: #7C4DFF;
  --bg-light: #F8F9FA;
  --sidebar-bg: #1E1E2D;
  --sidebar-hover: #2A2A3D;
  --text-light: #B5B5C3;
  --text-white: #FFFFFF;
  --border-color: #E4E6EF;
  --card-shadow: 0 0 20px rgba(0,0,0,0.05);
  --radius-sm: 6px;
  --radius-md: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-light);
  color: #333;
  min-height: 100vh;
}

/* ── Gradient Button ── */
.btn-gradient {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  color: white;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-gradient:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-gradient:active { transform: translateY(0); }
.btn-gradient.sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-gradient.xs { padding: 3px 10px; font-size: 11px; border-radius: 5px; }

/* ── Outline Button ── */
.btn-outline {
  background: transparent;
  color: #555;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-outline:hover { border-color: var(--primary-blue); color: var(--primary-blue); }

/* ── Cards ── */
.card {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: 20px;
}

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: #F4F6FA;
  color: #555;
  font-weight: 600;
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-color);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #F0F0F5;
  vertical-align: middle;
}
tbody tr:hover { background: #FAFBFF; }

/* ── Status Badges ── */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-active { background: #E8F5E9; color: #2E7D32; }
.badge-banned { background: #FFEBEE; color: #C62828; }
.badge-pending { background: #FFF3E0; color: #E65100; }
.badge-premium { background: #E8EAF6; color: #283593; }

/* ── Action Icons ── */
.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
}
.action-icon svg {
  width: 16px;
  height: 16px;
}
.action-icon.view { color: var(--primary-blue); }
.action-icon.view:hover { background: #E3F2FD; }
.action-icon.edit { color: #FF9800; }
.action-icon.edit:hover { background: #FFF3E0; }
.action-icon.delete { color: #F44336; }
.action-icon.delete:hover { background: #FFEBEE; }
.action-icon.ban { color: #F44336; }
.action-icon.ban:hover { background: #FFEBEE; }
.action-icon.unban { color: #4CAF50; }
.action-icon.unban:hover { background: #E8F5E9; }

/* ── Form Inputs ── */
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #D1D5DB;
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: white;
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(68, 138, 255, 0.1);
}

/* ── Stats Cards ── */
.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
/* ── Stat Icons ── */
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.stat-icon svg {
  width: 22px;
  height: 22px;
}

/* ── Sidebar ── */
.sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform 0.3s;
  overflow-y: auto;
}
.sidebar .logo {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar .logo span {
  font-size: 20px;
  font-weight: 700;
  color: white;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar .nav-item:hover { background: var(--sidebar-hover); color: white; }
.sidebar .nav-item.active {
  background: rgba(68, 138, 255, 0.1);
  color: var(--primary-blue);
  border-left-color: var(--primary-blue);
}
.sidebar .nav-section {
  padding: 16px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
}

/* ── Main Content ── */
.main-content { margin-left: 250px; min-height: 100vh; }

/* ── Header Notification ── */
.header-notif { position: relative; }
.notif-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #666;
  position: relative;
  border-radius: 8px;
  transition: background 0.2s;
  display: flex;
}
.notif-btn:hover { background: #F5F5F5; color: #333; }
.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #F44336;
  border-radius: 50%;
  border: 2px solid white;
}
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.13);
  border: 1px solid #F0F0F5;
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown.show { display: block; }
.notif-dropdown-header {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #222;
  border-bottom: 1px solid #F0F0F5;
}
.notif-item {
  display: flex;
  align-items: start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #F8F8FA;
  transition: background 0.15s;
  cursor: pointer;
}
.notif-item:last-of-type { border-bottom: none; }
.notif-item:hover { background: #FAFAFE; }
.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-item-content { flex: 1; min-width: 0; }
.notif-item-text {
  font-size: 12px;
  color: #333;
  line-height: 1.3;
}
.notif-item-time {
  font-size: 10px;
  color: #999;
  margin-top: 2px;
}

/* ── Header Profile ── */
.header-profile { position: relative; }
.profile-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 1px solid #E8E8E8;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.profile-box:hover { border-color: #448AFF; background: #FAFAFE; }
.profile-avatar-header {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(135deg, #448AFF, #7C4DFF);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.profile-info-header { flex: 1; min-width: 0; }
.profile-name-header {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  line-height: 1.2;
}
.profile-role-header {
  font-size: 10px;
  color: #999;
}
.profile-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 180px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.13);
  border: 1px solid #F0F0F5;
  z-index: 200;
  overflow: hidden;
}
.profile-dropdown.show { display: block; }
.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  color: #444;
  text-decoration: none;
  transition: background 0.15s;
}
.profile-dropdown-item:hover { background: #F5F5FA; }
.profile-dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.profile-dropdown-divider {
  height: 1px;
  background: #F0F0F5;
  margin: 0;
}
.header {
  background: white;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header .page-title { font-size: 20px; font-weight: 700; color: #222; }
.header .right { display: flex; align-items: center; gap: 16px; }

/* ── Page Content ── */
.page-content { padding: 24px 28px; }

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: 12px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.login-card h2 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.login-card p { color: #666; font-size: 14px; margin-bottom: 28px; }

/* ── Login: input same height as button ── */
.login-form input {
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
}
.login-form .btn-gradient {
  height: 48px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Filter Box ── */
.filter-box {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: 20px;
  width: 100%;
}
.filter-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}
.filter-group {
  flex: 1;
  min-width: 160px;
}
.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}
.filter-group select,
.filter-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #D1D5DB;
  border-radius: var(--radius-md);
  font-size: 13px;
  background: white;
  outline: none;
  cursor: pointer;
}
.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(68,138,255,0.1);
}
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

/* ── Bulk Action Bar ── */
.bulk-bar {
  display: none;
  background: #E3F2FD;
  border: 1px solid #BBDEFB;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.bulk-bar.show { display: flex; }
.bulk-bar .count { font-size: 13px; font-weight: 600; color: #1565C0; }
.bulk-bar .actions { display: flex; gap: 8px; }

/* ── Chart Bars ── */
.chart-container {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 180px;
  padding-top: 10px;
}
.chart-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: height 0.4s ease;
}
.chart-bar .bar-label {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #888;
  white-space: nowrap;
}
.chart-bar .bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: #333;
}

/* ── Mini Stat ── */
.mini-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #F8F9FA;
  border-radius: var(--radius-md);
}
.mini-stat .ms-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}
.mini-stat .ms-icon svg { width: 18px; height: 18px; }
.mini-stat .ms-info h4 { font-size: 15px; font-weight: 700; color: #222; }
.mini-stat .ms-info p { font-size: 11px; color: #888; }

/* ── User Detail Page ── */
.profile-header {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: 30px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.profile-info h2 { font-size: 22px; font-weight: 700; color: #222; }
.profile-info .meta { font-size: 13px; color: #888; margin-top: 4px; }
.profile-info .meta span { margin-right: 16px; display: inline-flex; align-items: center; gap: 4px; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.info-item .label { font-size: 11px; color: #888; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
.info-item .value { font-size: 14px; color: #222; font-weight: 600; }

.activity-timeline {
  position: relative;
  padding-left: 20px;
}
.activity-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #E4E6EF;
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
  padding-left: 16px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--primary-blue);
  background: white;
}
.timeline-item .time { font-size: 11px; color: #999; }
.timeline-item .desc { font-size: 13px; color: #333; }

/* ── Sub Menu Items ── */
.sidebar .nav-item.sub-item {
  padding-left: 44px;
  font-size: 13px;
}

/* ── Dropdown toggle for Reports ── */
.nav-dropdown-toggle.active,
.nav-dropdown-toggle.active:hover {
  background: rgba(68, 138, 255, 0.1) !important;
  color: var(--primary-blue) !important;
  border-left-color: var(--primary-blue) !important;
}
.nav-dropdown-toggle svg:last-child {
  transition: transform 0.3s ease;
}
.nav-dropdown-toggle svg:last-child.open {
  transform: rotate(180deg);
}
.nav-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-dropdown-content.open {
  max-height: 200px;
}

/* ── Settings Tabs ── */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid #F0F0F5;
  padding-bottom: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.settings-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
.settings-tab:hover { color: #448AFF; }
.settings-tab.active {
  color: #448AFF;
  border-bottom-color: #448AFF;
}
.settings-tab svg { width: 16px; height: 16px; }

/* ── Settings Section Card ── */
.settings-section {
  display: none;
}
.settings-section.active {
  display: block;
}
.settings-group {
  margin-bottom: 20px;
}
.settings-group-title {
  font-size: 13px;
  font-weight: 600;
  color: #444;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F0F0F5;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #F5F5F5;
  gap: 16px;
}
.setting-row:last-child { border-bottom: none; }
.setting-label {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}
.setting-desc {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}
.setting-input {
  flex: 1;
  max-width: 320px;
}
.setting-input input, .setting-input select, .setting-input textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #E0E0E0;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  background: white;
  box-sizing: border-box;
}
.setting-input input:focus, .setting-input select:focus, .setting-input textarea:focus {
  border-color: #448AFF;
}
.setting-input textarea {
  min-height: 70px;
  resize: vertical;
}
.setting-input input[type="file"] {
  padding: 6px 0;
  border: none;
}

/* ── Toggle Switch ── */
.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #CCC;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #448AFF, #7C4DFF);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ── Social Links Table ── */
.social-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 15px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .header { padding: 12px 16px; }
  .page-content { padding: 16px; }
  .stat-card { padding: 14px 16px; }
  .login-card { padding: 28px 24px; }
  .table-wrap { font-size: 12px; }
  thead th, tbody td { padding: 8px 10px; }
  .sidebar .logo { padding: 14px 16px; }
  .sidebar .logo span { font-size: 17px; }
}

/* Hamburger toggle for mobile */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  padding: 4px;
}
@media (max-width: 768px) {
  .hamburger { display: block; }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* User avatar in table */
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
}
