/* ============================================================
   Admin Panel Stylesheet
   ============================================================ */

/* ── Admin Layout ───────────────────────────────────────────── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.admin-sidebar {
  width: 250px;
  background: #1a2438;
  color: #a0aec0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .3s ease;
}

.admin-sidebar .sidebar-brand {
  padding: 20px 24px;
  background: #131c2e;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.admin-sidebar .sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--wa-primary, #008069);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}
.admin-sidebar .sidebar-brand h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.admin-sidebar .sidebar-brand span {
  font-size: 11px;
  color: #64748b;
}

.admin-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #4a5568;
  padding: 12px 24px 6px;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: #a0aec0;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.admin-nav-link:hover {
  background: rgba(255,255,255,.05);
  color: #fff;
}
.admin-nav-link.active {
  background: rgba(0,128,105,.15);
  color: #00a884;
  border-left-color: #00a884;
}
.admin-nav-link i { font-size: 17px; }

.admin-sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.admin-sidebar-footer .admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-sidebar-footer .admin-avatar {
  width: 34px;
  height: 34px;
  background: var(--wa-primary, #008069);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.admin-sidebar-footer .admin-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}
.admin-sidebar-footer .logout-link {
  font-size: 12px;
  color: #64748b;
  text-decoration: none;
  transition: color .2s;
}
.admin-sidebar-footer .logout-link:hover { color: #ef4444; }

/* ── Main Content ───────────────────────────────────────────── */
.admin-main {
  flex: 1;
  margin-left: 250px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.admin-header .breadcrumb {
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-content {
  flex: 1;
  padding: 28px;
}

/* ── Stats Cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #e2e8f0;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.green   { background: #dcfce7; color: #16a34a; }
.stat-icon.blue    { background: #dbeafe; color: #2563eb; }
.stat-icon.purple  { background: #f3e8ff; color: #9333ea; }
.stat-icon.orange  { background: #fff7ed; color: #ea580c; }
.stat-icon.teal    { background: #ccfbf1; color: #0d9488; }

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}
.stat-card .stat-change {
  font-size: 12px;
  margin-top: 4px;
}
.stat-card .stat-change.up   { color: #16a34a; }
.stat-card .stat-change.down { color: #dc2626; }

/* ── Data Table ─────────────────────────────────────────────── */
.admin-table-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.table-toolbar h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.search-admin {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  width: 240px;
  outline: none;
  transition: border-color .2s;
}
.search-admin:focus { border-color: #008069; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748b;
}
.admin-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: #334155;
  vertical-align: middle;
}

.admin-table .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-table .user-cell img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.admin-table .user-cell .user-name  { font-weight: 600; color: #1e293b; font-size: 14px; }
.admin-table .user-cell .user-email { font-size: 12px; color: #94a3b8; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-admin.active   { background: #dcfce7; color: #166534; }
.badge-admin.inactive { background: #fee2e2; color: #991b1b; }
.badge-admin.online   { background: #dcfce7; color: #166534; }
.badge-admin.offline  { background: #f1f5f9; color: #64748b; }

/* ── Action Buttons ─────────────────────────────────────────── */
.action-btns { display: flex; align-items: center; gap: 6px; }
.btn-action {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all .2s;
}
.btn-action.view    { background: #eff6ff; color: #2563eb; }
.btn-action.edit    { background: #fefce8; color: #ca8a04; }
.btn-action.delete  { background: #fef2f2; color: #dc2626; }
.btn-action.disable { background: #fff7ed; color: #ea580c; }
.btn-action:hover   { opacity: .8; transform: scale(.96); }

/* ── Modal ──────────────────────────────────────────────────── */
.admin-modal-header { background: #1a2438; color: #fff; padding: 16px 20px; }
.admin-modal-header .btn-close { filter: invert(1); }

/* ── Pagination ─────────────────────────────────────────────── */
.admin-pagination {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: between;
  gap: 16px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
}
.page-info { font-size: 13px; color: #64748b; }

/* ── Chart Container ────────────────────────────────────────── */
.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  border: 1px solid #e2e8f0;
}
.chart-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px;
}

/* ── Admin Login ─────────────────────────────────────────────── */
.admin-login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #131c2e 0%, #1a2438 50%, #1e3a5f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.admin-login-card .admin-logo {
  text-align: center;
  margin-bottom: 32px;
}
.admin-login-card .admin-logo .shield {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, #008069, #00a884);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 30px;
  color: #fff;
}
.admin-login-card h1 { font-size: 22px; font-weight: 800; color: #1e293b; margin: 0; }
.admin-login-card p  { font-size: 13px; color: #94a3b8; margin: 4px 0 0; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 992px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 16px; }
}
