﻿/* ============================================================
   InnoLearn — Platform Admin Dashboard Styles
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #5c6ef8;
  --primary-dark: #4757e8;
  --success:      #22c55e;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --gray-50:      #f9fafb;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-400:     #9ca3af;
  --gray-500:     #6b7280;
  --gray-700:     #374151;
  --gray-900:     #111827;
  --sidebar-bg:   #0f172a;
  --sidebar-hover:#1e293b;
  --radius:       10px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
}

/* ── Key Entry Screen ───────────────────────────────────── */
.pa-lock-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.pa-lock-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}

.pa-lock-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin: 0 auto 20px;
}

.pa-lock-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.pa-lock-card p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.pa-lock-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}

.pa-lock-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.pa-key-wrap {
  position: relative;
}

.pa-key-wrap input {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  color: var(--gray-900);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.pa-key-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,110,248,.12);
}

.pa-key-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 14px;
}

.pa-lock-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .2s;
}

.pa-lock-btn:hover { opacity: .9; }
.pa-lock-btn:disabled { opacity: .6; cursor: not-allowed; }

.pa-lock-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 13px;
  color: #b91c1c;
  display: none;
}

/* ── App Shell ──────────────────────────────────────────── */
.pa-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.pa-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.pa-sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.pa-sidebar-brand h1 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pa-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.pa-sidebar-brand p {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  margin-top: 4px;
  margin-left: 42px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.pa-nav {
  flex: 1;
  padding: 12px 0;
}

.pa-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.55);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all .2s;
  border-left: 3px solid transparent;
}

.pa-nav-item:hover { background: var(--sidebar-hover); color: rgba(255,255,255,.85); }
.pa-nav-item.active { background: var(--sidebar-hover); color: #fff; border-left-color: var(--primary); }
.pa-nav-item i { width: 16px; text-align: center; font-size: 13px; }

.pa-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.pa-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,.4);
  font-size: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color .2s;
}

.pa-logout-btn:hover { color: #ef4444; }

/* ── Main ───────────────────────────────────────────────── */
.pa-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pa-topbar {
  padding: 20px 32px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pa-topbar h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.pa-topbar-meta {
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pa-content {
  flex: 1;
  padding: 32px;
}

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

.pa-stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--gray-200);
}

.pa-stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.pa-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 4px;
}

.pa-stat-sub {
  font-size: 12px;
  color: var(--gray-500);
}

/* ── Section card ───────────────────────────────────────── */
.pa-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 24px;
}

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

.pa-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}

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

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

.pa-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.pa-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

.pa-table tr:last-child td { border-bottom: none; }
.pa-table tr:hover td { background: var(--gray-50); }

/* ── Plan badges ────────────────────────────────────────── */
.plan-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.plan-pill.base       { background: #e0f2fe; color: #0369a1; }
.plan-pill.core       { background: #e0f2fe; color: #0369a1; }
.plan-pill.student    { background: #eef0ff; color: #4757e8; }
.plan-pill.standard   { background: #eef0ff; color: #4757e8; }
.plan-pill.family     { background: #faf5ff; color: #7c3aed; }
.plan-pill.premium    { background: #faf5ff; color: #7c3aed; }
.plan-pill.enterprise { background: #f0fdf4; color: #166534; }
.plan-pill.trial      { background: #fff7ed; color: #c2410c; }

/* ── Status dot ─────────────────────────────────────────── */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active::before   { background: var(--success); }
.status-dot.inactive::before { background: var(--gray-400); }
.status-dot.trial::before    { background: var(--warning); }

/* ── Action buttons ─────────────────────────────────────── */
.pa-action-wrap { display: flex; align-items: center; gap: 6px; }

.pa-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-700);
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pa-btn:hover { border-color: var(--gray-400); background: var(--gray-50); }
.pa-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.pa-btn.primary:hover { background: var(--primary-dark); }
.pa-btn.danger  { color: var(--danger); border-color: #fecaca; }
.pa-btn.danger:hover { background: #fef2f2; }
.pa-btn.success { color: var(--success); border-color: #bbf7d0; }
.pa-btn.success:hover { background: #f0fdf4; }

/* ── Form ───────────────────────────────────────────────── */
.pa-form { padding: 20px; display: flex; flex-direction: column; gap: 16px; }

.pa-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.pa-field { display: flex; flex-direction: column; gap: 5px; }

.pa-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}

.pa-field input,
.pa-field select {
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-900);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.pa-field input:focus,
.pa-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92,110,248,.1);
}

/* ── Toast ──────────────────────────────────────────────── */
.pa-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pa-toast {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: fadeSlideIn .3s ease;
}

.pa-toast.success { background: #16a34a; }
.pa-toast.error   { background: #dc2626; }
.pa-toast.info    { background: var(--primary); }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Empty state ────────────────────────────────────────── */
.pa-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
}

.pa-empty i { font-size: 36px; margin-bottom: 12px; display: block; }
.pa-empty p { font-size: 14px; }

/* ── Loading spinner ────────────────────────────────────── */
.pa-loading {
  text-align: center;
  padding: 48px;
  color: var(--gray-400);
  font-size: 14px;
}

/* ── MRR breakdown ──────────────────────────────────────── */
.mrr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 20px;
}

.mrr-item {
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.mrr-item-count { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.mrr-item-plan  { font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; margin: 2px 0; }
.mrr-item-rev   { font-size: 12px; color: var(--gray-600); }

/* ── Impersonate modal overlay ──────────────────────────── */
.pa-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeSlideIn .2s ease;
}

.pa-modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.pa-modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.pa-modal p  { font-size: 13px; color: var(--gray-500); margin-bottom: 20px; line-height: 1.5; }
.pa-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Pending badge ──────────────────────────────────────── */
.pa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ── Pending cards ──────────────────────────────────────── */
.pending-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 20px;
}

.pending-card {
  border: 1.5px solid #fde68a;
  border-radius: 10px;
  background: #fffdf0;
  overflow: hidden;
  transition: box-shadow .2s;
}

.pending-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.pending-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px 12px;
  gap: 16px;
}

.pending-card-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.pending-meta {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.pending-meta i {
  width: 14px;
  margin-right: 5px;
  color: var(--gray-400);
}

.pending-card-right {
  text-align: center;
  flex-shrink: 0;
}

.pending-card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
}

.pa-btn.success {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}
.pa-btn.success:hover {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

/* ── pa-empty ───────────────────────────────────────────── */
.pa-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
  font-size: 14px;
}

.pa-empty i {
  display: block;
  font-size: 36px;
  margin-bottom: 12px;
  color: var(--gray-300);
}

