.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }
.admin-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.btn-act { background: #ff6b00; color: #ffffff; border: 0; font-weight: 700; padding: 9px 16px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-decoration: none; transition: background 0.2s, transform 0.2s; box-shadow: 0 4px 14px rgba(255, 107, 0, 0.25); }
.btn-act:hover { background: #ea580c; transform: translateY(-1px); }
.btn-sec { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.12); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; }
.btn-sec:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.22); }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* Quick Stats Bar */
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #12141a; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 16px 20px; }
.stat-card .label { font-size: 12px; color: #94a3b8; margin-bottom: 6px; }
.stat-card .val { font-size: 24px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }
.stat-card .sub { font-size: 11px; color: #f97316; margin-top: 4px; }

/* Dashboard Settings Box */
.settings-box { background: #12141a; border: 1px solid rgba(255,107,0,0.25); border-radius: 14px; padding: 22px; margin-bottom: 28px; position: relative; }
.settings-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

/* Courses Section */
.courses-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-search-wrap { position: relative; flex: 1; max-width: 400px; }
.admin-search-wrap input { width: 100%; background: #12141a; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 9px 14px 9px 36px; color: #fff; font-size: 13px; box-sizing: border-box; }
.admin-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); stroke: #64748b; }

.course-card-admin { background: #12141a; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 18px; margin-bottom: 16px; transition: border-color 0.2s; }
.course-card-admin:hover { border-color: rgba(255,255,255,0.18); }
.course-head-admin { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.badge-num { font-family: 'Space Mono', monospace; font-size: 11px; background: rgba(255,107,0,0.12); color: #f97316; padding: 3px 8px; border-radius: 4px; font-weight: 700; }
.lessons-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(255,255,255,0.1); }
.lesson-row-admin { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: rgba(255,255,255,0.02); border-radius: 6px; margin-bottom: 6px; gap: 10px; }

/* Modals */
.modal-admin { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center; padding: 16px; }
.modal-admin.show { display: flex; }
.modal-box { background: #161922; border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; width: 100%; max-width: 540px; padding: 24px; max-height: 90vh; overflow-y: auto; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: #94a3b8; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group textarea { width: 100%; background: #0c0e14; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #fff; padding: 9px 12px; font-size: 13px; font-family: inherit; box-sizing: border-box; }
.form-group textarea { min-height: 70px; resize: vertical; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: #ff6b00; color: #ffffff; font-weight: 700; font-size: 13px; padding: 12px 18px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); opacity: 0; pointer-events: none; transform: translateY(12px); transition: all 0.25s ease; z-index: 2000; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Pulse Indicator */
.pulse-dot { width: 8px; height: 8px; background: #ff6b00; border-radius: 50%; display: inline-block; box-shadow: 0 0 8px #ff6b00; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* ============================================================
   LIGHT THEME OVERRIDES FOR ADMIN PANEL
   ============================================================ */
html[data-theme="light"] .admin-wrap {
  color: #0f172a;
}
html[data-theme="light"] .stat-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .stat-card .label {
  color: #475569 !important;
  font-weight: 600;
}
html[data-theme="light"] .stat-card .val {
  color: #0f172a !important;
}
html[data-theme="light"] .settings-box {
  background: #ffffff !important;
  border: 1px solid #fed7aa !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .settings-box h2,
html[data-theme="light"] .settings-box h3,
html[data-theme="light"] .admin-bar h1,
html[data-theme="light"] .admin-bar h2 {
  color: #0f172a !important;
}
html[data-theme="light"] .course-card-admin {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .course-card-admin:hover {
  border-color: #ff6b00 !important;
}
html[data-theme="light"] .course-card-admin h4 {
  color: #0f172a !important;
}
html[data-theme="light"] .course-card-admin p {
  color: #64748b !important;
}
html[data-theme="light"] .btn-sec {
  background: #1e293b !important;
  border-color: #1e293b !important;
  color: #ffffff !important;
}
html[data-theme="light"] .btn-sec:hover {
  background: #0f172a !important;
}
html[data-theme="light"] .lessons-box {
  border-top-color: #e2e8f0 !important;
}
html[data-theme="light"] .lesson-row-admin {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0;
}
html[data-theme="light"] .lesson-row-admin span {
  color: #0f172a !important;
}
html[data-theme="light"] .admin-search-wrap input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .admin-search-wrap input:focus {
  border-color: #ff6b00 !important;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}
html[data-theme="light"] .modal-admin .modal-box {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}
html[data-theme="light"] .modal-admin h3 {
  color: #0f172a !important;
}

/* Admin Tabs */
.admin-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-tab-btn {
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.admin-tab-btn:hover {
  color: #ffffff;
}
.admin-tab-btn.active {
  color: #ff6b00;
  border-bottom-color: #ff6b00;
}
.admin-tab-pane {
  display: none;
}
.admin-tab-pane.active {
  display: block;
}

/* Toolkit Admin Cards */
.tool-card-admin {
  background: #12141a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transition: all 0.2s;
}
.tool-card-admin:hover {
  border-color: rgba(255, 107, 0, 0.35);
}
.tool-info-admin {
  flex: 1;
  min-width: 250px;
}
.tool-info-admin h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-info-admin p {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 0 0 6px;
  line-height: 1.5;
}
.tool-meta-admin {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-space-mono), monospace;
}
.tool-meta-admin a {
  color: #ff6b00;
  text-decoration: underline;
}
.tool-actions-admin {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Light mode overrides for admin tabs and tools */
html[data-theme="light"] .admin-tabs-nav {
  border-bottom-color: #e2e8f0;
}
html[data-theme="light"] .admin-tab-btn {
  color: #64748b;
}
html[data-theme="light"] .admin-tab-btn:hover {
  color: #0f172a;
}
html[data-theme="light"] .admin-tab-btn.active {
  color: #ff6b00;
  border-bottom-color: #ff6b00;
}
html[data-theme="light"] .tool-card-admin {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
html[data-theme="light"] .tool-card-admin:hover {
  border-color: #ff6b00;
}
html[data-theme="light"] .tool-info-admin h4 {
  color: #0f172a;
}
html[data-theme="light"] .tool-info-admin p {
  color: #475569;
}

