/* ===========================
   ADMIN PANEL CSS
   =========================== */

/* ── Admin Layout ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.admin-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--forest-mid);
  border-right: 1px solid rgba(109, 181, 111, 0.1);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(109, 181, 111, 0.1);
}
.sidebar-logo {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--moss-light);
}
.sidebar-sub { font-family: var(--font-body); font-size: 0.68rem; font-weight: 500; color: var(--muted); letter-spacing: 0.5px; margin-top: 0.2rem; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-section-label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(138, 147, 166, 0.5);
  padding: 1rem 1.5rem 0.4rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar-link .icon {
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.04);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.sidebar-link:hover {
  color: var(--cream);
  background: rgba(0,0,0,0.03);
}
.sidebar-link:hover .icon { background: rgba(109,181,111,0.1); }
.sidebar-link.active {
  color: var(--moss-light);
  background: rgba(109,181,111,0.06);
  border-left-color: var(--moss);
}
.sidebar-link.active .icon {
  background: rgba(109,181,111,0.14);
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(109,181,111,0.1);
}
.admin-user {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--moss-dark), var(--moss));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700;
  color: var(--cream); flex-shrink: 0;
}
.admin-user-info { overflow: hidden; }
.admin-user-name { font-size: 0.85rem; font-weight: 600; color: var(--cream); }
.admin-user-role { font-size: 0.72rem; color: var(--muted); }

/* ── Main Content ── */
.admin-main {
  margin-left: 260px;
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.admin-topbar {
  background: rgba(208, 227, 208, 0.521);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(109,181,111,0.08);
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: 1.3rem; font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em;}
.admin-topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-badge {
  background: rgba(109,181,111,0.08);
  border: 1px solid rgba(109,181,111,0.2);
  color: var(--moss-light);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.28rem 0.8rem;
  border-radius: 100px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.admin-content { padding: 2rem; flex: 1; }

/* ── Dashboard Stats ── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid rgba(109,181,111,0.1);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex; align-items: flex-start; justify-content: space-between;
  transition: var(--transition);
}
.stat-card:hover { border-color: rgba(109,181,111,0.25); transform: translateY(-2px); }
.stat-card-info { flex: 1; }
.stat-card-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.stat-card-value {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--cream);
  line-height: 1;
}
.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.icon-gold { background: rgba(109,181,111,0.1); }
.icon-blue { background: rgba(79, 140, 255, 0.12); }
.icon-green { background: rgba(62, 207, 142, 0.12); }
.icon-red { background: rgba(224, 84, 84, 0.12); }
.stat-card-change {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  color: var(--success);
}
.stat-card-change.down { color: var(--danger); }

/* ── Admin Tables ── */
.admin-table-wrap {
  background: var(--card-bg);
  border: 1px solid rgba(109,181,111,0.1);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
}
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.table-header h3 { font-size: 1.1rem; }
.table-search {
  display: flex; align-items: center; gap: 0.5rem;
}
.table-search input {
  width: 220px;
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-sm);
  color: var(--cream);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
}
.table-search input:focus { border-color: var(--moss); outline: none; }

table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  background: rgba(0,0,0,0.02);
  text-align: left;
  padding: 0.8rem 1.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  white-space: nowrap;
}
tbody td {
  padding: 0.9rem 1.2rem;
  font-size: 0.87rem;
  color: var(--cream);
  border-bottom: 1px solid rgba(0,0,0,0.03);
  vertical-align: middle;
}
tbody tr:hover { background: rgba(0,0,0,0.02); }
tbody tr:last-child td { border-bottom: none; }

.td-img {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.td-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-gold   { background: rgba(109,181,111,0.1); color: var(--moss-light); }
.badge-green  { background: rgba(92,184,92,0.1); color: var(--success); }
.badge-red    { background: rgba(224,84,84,0.12); color: var(--danger); }
.badge-blue   { background: rgba(79,140,255,0.12); color: #4F8CFF; }
.badge-muted  { background: rgba(138,147,166,0.1); color: var(--muted); }

.action-btns { display: flex; gap: 0.4rem; }
.action-btn {
  width: 30px; height: 30px;
  border: none; border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.action-edit { background: rgba(79,140,255,0.1); color: #4F8CFF; }
.action-edit:hover { background: rgba(79,140,255,0.2); }
.action-delete { background: rgba(224,84,84,0.1); color: var(--danger); }
.action-delete:hover { background: rgba(224,84,84,0.2); }
.action-toggle { background: rgba(62,207,142,0.1); color: var(--success); }
.action-toggle:hover { background: rgba(62,207,142,0.2); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.empty-state .empty-icon {
  font-size: 3rem; margin-bottom: 1rem; opacity: 0.3;
}
.empty-state p { font-size: 0.9rem; }

/* ── Admin Login ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -30%; left: -20%;
  width: 60%; height: 80%;
  background: radial-gradient(ellipse, rgba(109,181,111,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -15%;
  width: 50%; height: 60%;
  background: radial-gradient(ellipse, rgba(201,168,76,0.05) 0%, transparent 70%);
  pointer-events: none;
}
.login-card {
  background: var(--card-bg);
  border: 1px solid rgba(109,181,111,0.18);
  border-radius: var(--radius-xl);
  padding: 3rem;
  width: 100%; max-width: 420px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-moss), var(--shadow-card);
  animation: fadeUp 0.6s ease both;
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo .logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, rgba(109,181,111,0.18), rgba(109,181,111,0.05));
  border: 2px solid rgba(109,181,111,0.35);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1rem;
}
.login-logo h2 { font-size: 1.8rem; }
.login-logo p { font-size: 0.85rem; margin-top: 0.3rem; }
.login-error {
  background: rgba(224,84,84,0.1);
  border: 1px solid rgba(224,84,84,0.3);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}
.login-error.show { display: block; }
.show-password {
  position: relative;
}
.show-password input { padding-right: 2.5rem; }
.toggle-pw {
  position: absolute; right: 0.8rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 0.9rem; padding: 0.2rem;
}

/* ── Settings Panel ── */
.settings-section {
  background: var(--card-bg);
  border: 1px solid rgba(109,181,111,0.1);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}
.settings-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* ── Toggle Switch ── */
.toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0;
}
.toggle-switch {
  position: relative;
  width: 44px; height: 24px;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.1);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: var(--muted);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--moss-dark); }
.toggle-switch input:checked + .toggle-slider::before {
  background: var(--cream);
  transform: translateX(20px);
}

/* ── Admin Mobile ── */
.admin-mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 200;
  background: var(--moss-dark);
  color: var(--cream);
  border: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-mobile-toggle { display: flex; align-items: center; justify-content: center; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-content { padding: 1rem; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .login-card { padding: 2rem 1.5rem; }
}

/* ── Forgot / OTP Recovery ── */
.forgot-link {
  background: none;
  border: none;
  color: var(--moss-light);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  opacity: 0.85;
}
.forgot-link:hover {
  opacity: 1;
  background: rgba(109, 181, 111, 0.08);
}

/* Modal box */
.forgot-modal-box {
  max-width: 420px;
  width: 100%;
  padding: 2rem;
  animation: fadeUp 0.3s ease both;
}

/* Modal Header */
.forgot-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.forgot-modal-header h3 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}
.forgot-modal-header p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}
.forgot-icon {
  width: 56px; height: 56px;
  background: rgba(109, 181, 111, 0.1);
  border: 2px solid rgba(109, 181, 111, 0.25);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
  color: var(--moss-light);
}

/* Email hint row */
.otp-email-display {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(109, 181, 111, 0.06);
  border: 1px solid rgba(109, 181, 111, 0.2);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.88rem;
  color: var(--cream);
}
.otp-email-display iconify-icon {
  color: var(--moss-light);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.otp-email-display strong {
  color: var(--moss-light);
}

/* No-email warning */
.otp-no-email-warn {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: rgba(224, 84, 84, 0.08);
  border: 1px solid rgba(224, 84, 84, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.83rem;
  color: var(--danger);
  line-height: 1.55;
}
.otp-no-email-warn iconify-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

/* Cancel button */
.forgot-cancel-btn {
  width: 100%;
  background: none;
  border: 1px solid rgba(138, 147, 166, 0.2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.forgot-cancel-btn:hover {
  border-color: rgba(138, 147, 166, 0.4);
  color: var(--cream);
}

/* OTP digit boxes */
.otp-boxes-wrap {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 0.5rem 0 1rem;
}
.otp-box {
  width: 48px; height: 56px;
  background: rgba(0,0,0,0.06);
  border: 2px solid rgba(109,181,111,0.18);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cream);
  caret-color: var(--moss-light);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.otp-box:focus {
  border-color: var(--moss-light);
  background: rgba(109,181,111,0.06);
}
.otp-box.otp-box-error {
  border-color: var(--danger);
  background: rgba(224,84,84,0.08);
  animation: shake 0.4s ease;
}
.otp-box.otp-box-ok {
  border-color: var(--success);
  background: rgba(62,207,142,0.08);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* Timer + resend row */
.otp-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.otp-timer {
  font-size: 0.78rem;
  color: var(--muted);
}
.otp-timer strong { color: var(--cream); }
.otp-resend-btn {
  background: none;
  border: none;
  color: var(--moss-light);
  font-family: var(--font-body);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: background 0.2s;
  text-decoration: underline;
}
.otp-resend-btn:hover:not(:disabled) { background: rgba(109,181,111,0.08); }
.otp-resend-btn:disabled { color: var(--muted); cursor: not-allowed; text-decoration: none; }

/* OTP error bar */
.forgot-reset-error {
  background: rgba(224, 84, 84, 0.1);
  border: 1px solid rgba(224, 84, 84, 0.3);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
  display: none;
}

/* Back button */
.forgot-back-btn {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(138, 147, 166, 0.2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; gap: 0.35rem;
  transition: all 0.2s ease;
}
.forgot-back-btn:hover {
  border-color: rgba(138, 147, 166, 0.4);
  color: var(--cream);
}

/* Btn loading state */
.btn-loading {
  opacity: 0.7;
  cursor: wait !important;
}

/* Success state */
.forgot-success {
  text-align: center;
  padding: 0.5rem 0 1rem;
}
.forgot-success h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.forgot-success > p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}
.forgot-success-icon {
  font-size: 3.5rem;
  color: var(--success);
  margin-bottom: 0.8rem;
}
.success-anim {
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes successPop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Redirect progress bar */
.otp-redirect-bar {
  height: 4px;
  background: rgba(109,181,111,0.12);
  border-radius: 100px;
  overflow: hidden;
  margin: 0.8rem 0 0.4rem;
}
.otp-redirect-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--moss-dark), var(--moss-light));
  border-radius: 100px;
}
.otp-redirect-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* OTP icon animation */
.otp-icon-anim {
  animation: fadeUp 0.4s ease both;
}
