/* ================================================
   SECTIONS PLATFORM — BEE HUB
   Dark theme: #09090b background, #8b5cf6 accent
   ================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sec-bg: #09090b;
  --sec-surface: #18181b;
  --sec-surface-2: #27272a;
  --sec-border: rgba(255,255,255,0.08);
  --sec-accent: #8b5cf6;
  --sec-accent-hover: #7c3aed;
  --sec-accent-soft: rgba(139,92,246,0.12);
  --sec-green: #22c55e;
  --sec-red: #ef4444;
  --sec-yellow: #f59e0b;
  --sec-text: #fafafa;
  --sec-muted: #a1a1aa;
  --sec-muted-2: #71717a;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --transition: all 0.2s ease;
}

html, body {
  height: 100%;
  background: var(--sec-bg);
  color: var(--sec-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ---- LAYOUT ---- */
.sec-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- SIDEBAR ---- */
.sec-sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sec-surface);
  border-right: 1px solid var(--sec-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
  z-index: 100;
}

.sec-sidebar.collapsed { width: 60px; min-width: 60px; }
.sec-sidebar.collapsed .sidebar-text { display: none; }
.sec-sidebar.collapsed .sidebar-logo-text { display: none; }
.sec-sidebar.collapsed .sidebar-section-label { display: none; }
.sec-sidebar.collapsed .menu-item { justify-content: center; padding: 0.65rem; }
.sec-sidebar.collapsed .menu-item svg { flex-shrink: 0; }

.sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--sec-border);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--sec-text);
  line-height: 1.2;
}
.sidebar-logo-text small {
  display: block;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--sec-muted);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--sec-surface-2) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--sec-surface-2); border-radius: 2px; }

.sidebar-section { padding: 0 0.75rem; margin-bottom: 1rem; }

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sec-muted-2);
  padding: 0.5rem 0.5rem 0.3rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.55rem 0.625rem;
  border-radius: var(--radius);
  color: var(--sec-muted);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.855rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
}

.menu-item:hover { background: rgba(255,255,255,0.04); color: var(--sec-text); }
.menu-item.active { background: var(--sec-accent-soft); color: var(--sec-accent); }

.menu-badge {
  margin-left: auto;
  background: var(--sec-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  line-height: 1.4;
}

/* sidebar footer */
.sidebar-footer {
  border-top: 1px solid var(--sec-border);
  padding: 0.875rem 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sec-user-widget {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
}

.sec-user-widget:hover { background: rgba(255,255,255,0.04); }

.sec-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sec-accent), #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sec-user-info { overflow: hidden; }
.sec-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sec-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sec-user-role { font-size: 0.7rem; color: var(--sec-muted); }

/* ---- MAIN AREA ---- */
.sec-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sec-bg);
}

/* ---- TOP BAR ---- */
.sec-topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--sec-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  background: var(--sec-bg);
  flex-shrink: 0;
}

.topbar-toggle {
  background: transparent;
  border: 1px solid var(--sec-border);
  color: var(--sec-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.topbar-toggle:hover { border-color: var(--sec-accent); color: var(--sec-accent); }

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search-input {
  width: 100%;
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  color: var(--sec-text);
  font-size: 0.855rem;
  font-family: inherit;
  transition: var(--transition);
}

.topbar-search-input::placeholder { color: var(--sec-muted-2); }
.topbar-search-input:focus { outline: none; border-color: var(--sec-accent); background: rgba(139,92,246,0.05); }

.topbar-search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sec-muted-2);
  pointer-events: none;
}

.topbar-search-kbd {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--sec-muted-2);
  background: var(--sec-surface-2);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  line-height: 1.5;
  pointer-events: none;
}

.topbar-spacer { flex: 1; }

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--sec-border);
  background: transparent;
  color: var(--sec-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.topbar-icon-btn:hover { color: var(--sec-text); border-color: var(--sec-accent); }

.topbar-notif-dot {
  width: 7px;
  height: 7px;
  background: var(--sec-accent);
  border-radius: 50%;
  position: absolute;
  top: 5px;
  right: 5px;
  border: 1.5px solid var(--sec-bg);
}

/* ---- CONTENT AREA ---- */
.sec-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem;
}
.sec-content::-webkit-scrollbar { width: 6px; }
.sec-content::-webkit-scrollbar-track { background: transparent; }
.sec-content::-webkit-scrollbar-thumb { background: var(--sec-surface-2); border-radius: 3px; }

/* ---- VIEWS ---- */
.sec-view { display: none; }
.sec-view.active { display: block; }

/* ---- PAGE HEADER ---- */
.sec-page-header {
  margin-bottom: 1.75rem;
}
.sec-page-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sec-text);
  margin-bottom: 0.25rem;
}
.sec-page-header p { color: var(--sec-muted); font-size: 0.875rem; }

/* ---- LIBRARY TOOLBAR ---- */
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.library-search {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.library-search-input {
  width: 100%;
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  color: var(--sec-text);
  font-size: 0.85rem;
  font-family: inherit;
  transition: var(--transition);
}
.library-search-input::placeholder { color: var(--sec-muted-2); }
.library-search-input:focus { outline: none; border-color: var(--sec-accent); }
.library-search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sec-muted-2);
}

.library-sort {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--sec-text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding-right: 2rem;
  transition: var(--transition);
}
.library-sort:focus { outline: none; border-color: var(--sec-accent); }

.view-toggle-group {
  display: flex;
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-toggle-btn {
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  color: var(--sec-muted-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.view-toggle-btn.active { background: var(--sec-accent-soft); color: var(--sec-accent); }
.view-toggle-btn:hover:not(.active) { background: rgba(255,255,255,0.04); color: var(--sec-text); }

/* ---- LIBRARY GRID ---- */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* SECTION CARD */
.sec-card {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.sec-card:hover {
  border-color: var(--sec-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139,92,246,0.12);
}

.sec-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--sec-surface-2);
  display: block;
}

.sec-card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--sec-surface-2), rgba(139,92,246,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
}

.sec-card-body { padding: 0.875rem; }

.sec-card-tags {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.sec-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid;
}

.sec-tag-type {
  color: var(--sec-accent);
  border-color: rgba(139,92,246,0.3);
  background: var(--sec-accent-soft);
}

.sec-tag-cat {
  color: var(--sec-muted);
  border-color: var(--sec-border);
  background: rgba(255,255,255,0.03);
}

.sec-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sec-text);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.sec-card-desc {
  font-size: 0.8rem;
  color: var(--sec-muted);
  line-height: 1.5;
  margin-bottom: 0.625rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sec-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sec-card-price-free {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sec-green);
}

.sec-card-price-paid {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sec-text);
}

.sec-card-favorite, .sec-card-copy {
  width: 28px;
  height: 28px;
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--sec-muted-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.sec-card-favorite:hover, .sec-card-favorite.active {
  color: #f43f5e;
  border-color: rgba(244,63,94,0.4);
  background: rgba(244,63,94,0.08);
}
.sec-card-favorite.active svg { fill: #f43f5e; }

.sec-card-copy:hover {
  color: var(--sec-accent);
  border-color: rgba(139,92,246,0.4);
  background: var(--sec-accent-soft);
}

.spinner-tiny {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--sec-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* LIST VIEW CARD */
.sec-list-card {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  transition: var(--transition);
  cursor: pointer;
}
.sec-list-card:hover { border-color: var(--sec-accent); }

.sec-list-thumb {
  width: 100px;
  min-width: 100px;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--sec-surface-2);
}

.sec-list-body { flex: 1; min-width: 0; }
.sec-list-title { font-size: 0.9rem; font-weight: 600; color: var(--sec-text); margin-bottom: 0.2rem; }
.sec-list-desc { font-size: 0.8rem; color: var(--sec-muted); line-height: 1.4; }

.sec-list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ---- SECTION DETAIL ---- */
.sec-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.82rem;
  color: var(--sec-muted);
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  background: transparent;
  border: none;
  padding: 0;
}
.sec-detail-back:hover { color: var(--sec-accent); }

.sec-detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}

.sec-detail-preview {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sec-detail-preview img {
  width: 100%;
  display: block;
}

.sec-detail-preview-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--sec-surface-2), rgba(139,92,246,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
}

.sec-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sec-detail-card {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.sec-detail-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--sec-text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.sec-detail-desc {
  font-size: 0.855rem;
  color: var(--sec-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.sec-detail-price {
  font-size: 1.5rem;
  font-weight: 800;
}

.sec-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--sec-border);
  border-bottom: 1px solid var(--sec-border);
}

.sec-detail-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.sec-detail-meta-label { color: var(--sec-muted); }
.sec-detail-meta-val { color: var(--sec-text); font-weight: 500; }

/* Buttons */
.btn-sec-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--sec-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}
.btn-sec-primary:hover { background: var(--sec-accent-hover); }
.btn-sec-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sec-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem;
  background: transparent;
  color: var(--sec-text);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-sec-outline:hover { border-color: var(--sec-accent); color: var(--sec-accent); background: var(--sec-accent-soft); }

.btn-sec-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.875rem;
  background: transparent;
  color: var(--sec-muted);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-sec-ghost:hover { color: var(--sec-text); border-color: var(--sec-muted); }

/* ---- ADMIN STATS ---- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat-card {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.admin-stat-card h4 { font-size: 0.75rem; color: var(--sec-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.admin-stat-card .stat-val { font-size: 2rem; font-weight: 800; color: var(--sec-text); }
.admin-stat-card .stat-sub { font-size: 0.75rem; color: var(--sec-muted); margin-top: 0.25rem; }

/* ---- TABS ---- */
.sec-tabs {
  display: flex;
  border-bottom: 1px solid var(--sec-border);
  margin-bottom: 1.5rem;
  gap: 0.25rem;
}

.sec-tab {
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sec-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.sec-tab.active { color: var(--sec-accent); border-bottom-color: var(--sec-accent); }
.sec-tab:hover:not(.active) { color: var(--sec-text); }

/* ---- FORM ---- */
.sec-form-group { margin-bottom: 1rem; }
.sec-form-label { display: block; font-size: 0.82rem; color: var(--sec-muted); margin-bottom: 0.4rem; }
.sec-form-label span { color: var(--sec-red); }

.sec-input {
  width: 100%;
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  color: var(--sec-text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}
.sec-input:focus { outline: none; border-color: var(--sec-accent); }
.sec-input::placeholder { color: var(--sec-muted-2); }

.sec-textarea {
  width: 100%;
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  color: var(--sec-text);
  font-size: 0.82rem;
  font-family: 'Fira Code', 'Courier New', monospace;
  transition: var(--transition);
  resize: vertical;
  min-height: 120px;
}
.sec-textarea:focus { outline: none; border-color: var(--sec-accent); }

.sec-select {
  width: 100%;
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  padding: 0.625rem 0.75rem;
  color: var(--sec-text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
  appearance: none;
  cursor: pointer;
}
.sec-select:focus { outline: none; border-color: var(--sec-accent); }

.sec-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ---- TABLE ---- */
.sec-table-wrap {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.855rem;
}

.sec-table thead th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--sec-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--sec-border);
}

.sec-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--sec-text);
}

.sec-table tbody tr:last-child td { border-bottom: none; }
.sec-table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-free { background: rgba(34,197,94,0.12); color: var(--sec-green); }
.badge-paid { background: rgba(139,92,246,0.12); color: var(--sec-accent); }
.badge-admin { background: rgba(239,68,68,0.12); color: var(--sec-red); }
.badge-member { background: rgba(255,255,255,0.06); color: var(--sec-muted); }

/* ---- EMPTY STATE ---- */
.sec-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--sec-muted);
}

.sec-empty svg { opacity: 0.3; margin-bottom: 1rem; }
.sec-empty h3 { color: var(--sec-text); font-size: 1rem; margin-bottom: 0.5rem; }
.sec-empty p { font-size: 0.875rem; }

/* ---- TOAST ---- */
.sec-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9999;
}

.sec-toast {
  background: var(--sec-surface-2);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--sec-text);
  animation: toastIn 0.3s ease;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.sec-toast.success { border-left: 3px solid var(--sec-green); }
.sec-toast.error { border-left: 3px solid var(--sec-red); }
.sec-toast.info { border-left: 3px solid var(--sec-accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---- MODAL ---- */
.sec-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.sec-modal {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease;
}

.sec-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.sec-modal-title { font-size: 1.1rem; font-weight: 700; color: var(--sec-text); }

.sec-modal-close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius);
  color: var(--sec-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.sec-modal-close:hover { color: var(--sec-text); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ---- SPINNER ---- */
.sec-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- PROFILE & SETTINGS ---- */
.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sec-accent), #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.profile-card {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* ---- TUTORIAL CARD ---- */
.tutorial-card {
  background: var(--sec-surface);
  border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}
.tutorial-card:hover { border-color: var(--sec-accent); transform: translateY(-2px); }

.tutorial-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--sec-surface-2), rgba(139,92,246,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tutorial-play {
  width: 48px;
  height: 48px;
  background: rgba(139,92,246,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.tutorial-body { padding: 0.875rem; }
.tutorial-title { font-size: 0.9rem; font-weight: 600; color: var(--sec-text); margin-bottom: 0.25rem; }
.tutorial-meta { font-size: 0.75rem; color: var(--sec-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .sec-detail-layout { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sec-sidebar { position: fixed; left: -100%; top: 0; bottom: 0; z-index: 200; transition: left 0.3s ease; }
  .sec-sidebar.mobile-open { left: 0; }
  .sec-content { padding: 1rem; }
  .sec-form-row { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
  .library-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .library-grid { grid-template-columns: 1fr; }
  .admin-stats-grid { grid-template-columns: 1fr; }
}

/* ---- SCROLLBAR GLOBAL ---- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--sec-surface-2) transparent;
}
