/* ======================================================
   HỆ THỐNG TRANG TIN & HƯỚNG DẪN NỘI BỘ (DOC PORTAL)
   Style Sheet Giao diện Tối Neon Emerald (assets/css/style.css)
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-card: #111827;
  --bg-hover: #1e293b;
  --border-color: #1f2937;
  --border-glow: #10b98133;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-light: rgba(16, 185, 129, 0.12);
  --accent-glow: 0 0 20px rgba(16, 185, 129, 0.25);
  
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  --sidebar-width: 360px;
  --toc-width: 240px;
  --header-height: 64px;
  --radius: 8px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ======================================================
   LAYOUT WRAPPER & HEADER
   ====================================================== */

#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
}

.brand-logo svg {
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent));
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  width: 320px;
  transition: var(--transition);
}

.search-trigger:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.search-trigger kbd {
  margin-left: auto;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-outline-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* MAIN CONTENT CONTAINER */
.app-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ======================================================
   SIDEBAR TREE VIEW (LEFT)
   ====================================================== */

#app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 20px 16px;
  overflow-y: auto;
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
}

.tree-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 16px;
  padding-left: 8px;
}

.tree-list {
  list-style: none;
}

.tree-item {
  margin-bottom: 2px;
}

.tree-folder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.tree-folder-header:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tree-folder-header .folder-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.tree-item.open > .tree-folder-header .folder-arrow {
  transform: rotate(90deg);
}

.tree-sub-list {
  list-style: none;
  padding-left: 16px;
  display: none;
  margin-top: 2px;
}

.tree-item.open > .tree-sub-list {
  display: block;
}

.tree-node-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.tree-node-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tree-node-link.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  border-left: 3px solid var(--accent);
}

.lock-badge {
  color: var(--warning);
  margin-left: auto;
}

/* ======================================================
   ARTICLE VIEW AREA (CENTER & RIGHT TOC)
   ====================================================== */

#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 40px 48px;
  width: 100%;
}

.doc-wrapper {
  max-width: 100%;
  width: 100%;
}

.doc-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.doc-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.doc-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.doc-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* DOCUMENT BODY STYLING */
.doc-body {
  font-size: 1rem;
  color: #cbd5e1;
  line-height: 1.8;
}

.doc-body img, .ql-editor img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 16px auto;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* YOUTUBE VIDEO IFRAME RESPONSIVE & CENTERED STYLING */
.doc-body iframe,
.doc-body .ql-video,
.ql-editor iframe,
.ql-editor .ql-video {
  display: block !important;
  width: 100% !important;
  max-width: 850px !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  min-height: 380px;
  margin: 24px auto !important;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  .doc-body iframe,
  .doc-body .ql-video,
  .ql-editor iframe,
  .ql-editor .ql-video {
    min-height: 220px;
    margin: 16px auto !important;
  }
}

.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4 {
  color: var(--text-primary);
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 16px;
  scroll-margin-top: 80px;
}

.doc-body h2 {
  font-size: 1.5rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.doc-body h3 {
  font-size: 1.25rem;
}

.doc-body p {
  margin-bottom: 20px;
}

.doc-body ul, .doc-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.doc-body li {
  margin-bottom: 8px;
}

.doc-body code {
  font-family: 'Fira Code', monospace;
  background: var(--bg-hover);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.doc-body pre {
  background: #020617;
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 24px;
}

/* STYLING YOUTUBE IFRAMES AND LOCAL MP4 VIDEOS */
.doc-body iframe,
.doc-body video,
.ql-editor iframe,
.ql-editor video,
.ql-video {
  max-width: 100% !important;
  width: 850px !important;
  aspect-ratio: 16 / 9 !important;
  border-radius: 12px !important;
  margin: 24px auto !important;
  display: block !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
  border: 1px solid var(--border-color) !important;
  background: #000 !important;
}

.doc-body pre code {
  background: transparent;
  padding: 0;
  color: #f1f5f9;
}

/* CALLOUT BOXES */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  border-left: 4px solid;
  background: var(--bg-card);
}

.callout-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--accent);
  color: #a7f3d0;
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: var(--warning);
  color: #fde68a;
}

.callout-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
  color: #fecaca;
}

/* TABLES */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 24px;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.doc-table th, .doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.doc-table th {
  background: var(--bg-sidebar);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.doc-table tr:last-child td {
  border-bottom: none;
}

/* ======================================================
   RIGHT SIDEBAR - TOC (TABLE OF CONTENTS)
   ====================================================== */

#app-toc {
  width: var(--toc-width);
  padding: 40px 20px;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.toc-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.toc-list {
  list-style: none;
  border-left: 1px solid var(--border-color);
}

.toc-item a {
  display: block;
  padding: 6px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-left: 2px solid transparent;
  margin-left: -1px;
}

.toc-item a:hover, .toc-item a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

/* ======================================================
   MODAL WINDOWS & OVERLAYS
   ====================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card.modal-lg {
  max-width: 860px;
}

.modal-card.modal-xl {
  max-width: 1100px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
}
.modal-close:hover {
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

/* IMPORT FILE DRAG & DROP ZONE */
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  background: var(--bg-main);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 16px;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* TOAST NOTIFICATION (TAILWIND STYLE) */
#toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
  max-width: 380px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  animation: slideToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success {
  border-left-color: var(--accent);
}

.toast-error, .toast-danger {
  border-left-color: var(--danger);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-info {
  border-left-color: var(--info);
}

@keyframes slideToastIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* LOGS TABLE BADGES */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-info { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }

/* ======================================================
   QUILL WYSIWYG EDITOR DARK MODE OVERRIDES
   ====================================================== */
.ql-toolbar.ql-snow {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  position: sticky;
  top: -28px;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.ql-container.ql-snow {
  background: var(--bg-main) !important;
  border-color: var(--border-color) !important;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.95rem;
}

.ql-editor {
  min-height: 280px;
  max-height: 450px;
  overflow-y: auto;
}

.ql-editor.ql-blank::before {
  color: var(--text-muted) !important;
}

/* Toolbar Buttons & Icons */
.ql-snow .ql-stroke {
  stroke: var(--text-secondary) !important;
}

.ql-snow .ql-fill {
  fill: var(--text-secondary) !important;
}

.ql-snow .ql-picker {
  color: var(--text-secondary) !important;
}

.ql-snow .ql-picker-options {
  background-color: var(--bg-hover) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.ql-snow .ql-picker-item {
  color: var(--text-secondary) !important;
}

.ql-snow .ql-picker-item:hover,
.ql-snow .ql-picker-item.ql-selected {
  color: var(--accent) !important;
}

.ql-snow button:hover .ql-stroke,
.ql-snow button.ql-active .ql-stroke,
.ql-snow .ql-picker-label:hover .ql-stroke,
.ql-snow .ql-picker-label.ql-active .ql-stroke {
  stroke: var(--accent) !important;
}

.ql-snow button:hover .ql-fill,
.ql-snow button.ql-active .ql-fill,
.ql-snow .ql-picker-label:hover .ql-fill,
.ql-snow .ql-picker-label.ql-active .ql-fill {
  fill: var(--accent) !important;
}

/* ======================================================
   RESPONSIVE DESIGN (MOBILE & TABLET OPTIMIZATIONS)
   ====================================================== */

.brand-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#mobile-menu-toggle {
  display: none;
}

#mobile-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#mobile-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-only-admin-panel {
  display: none;
}

/* TABLET & MOBILE BREAKPOINT (<= 1024px) */
@media (max-width: 1024px) {
  .mobile-only-admin-panel {
    display: block;
  }

  .desktop-only-btn {
    display: none !important;
  }

  #mobile-menu-toggle {
    display: inline-flex;
  }

  #app-header {
    padding: 0 12px;
    gap: 8px;
  }

  .brand-container {
    gap: 6px;
    flex-shrink: 0;
  }

  #brand-site-title {
    font-size: 0.95rem;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
  }

  .search-trigger {
    width: 120px;
    padding: 5px 8px;
    font-size: 0.78rem;
    flex-shrink: 1;
  }

  .search-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-trigger kbd {
    display: none;
  }

  #app-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  #app-sidebar.mobile-open {
    transform: translateX(0);
  }

  #main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 20px 12px !important;
  }

  #app-toc {
    display: none !important;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .header-actions .btn {
    padding: 6px 10px;
    font-size: 0.78rem;
    white-space: nowrap;
  }
}

/* SMALL PHONE BREAKPOINT (<= 480px) */
@media (max-width: 480px) {
  #brand-site-title {
    max-width: 90px;
    font-size: 0.88rem;
  }

  .search-trigger {
    width: 95px;
    padding: 4px 6px;
  }

  .header-actions .btn-text {
    display: inline-block;
  }

  .doc-title {
    font-size: 1.4rem;
  }

  .doc-meta {
    font-size: 0.75rem;
    gap: 8px;
  }
}

/* ======================================================
   TOP PROGRESS BAR & SKELETON SHIMMER LOADER
   ====================================================== */

#top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #34d399, #059669);
  box-shadow: 0 0 12px var(--accent);
  z-index: 99999;
  opacity: 0;
  transition: width 0.25s ease-out, opacity 0.3s ease;
}

#top-progress-bar.loading {
  opacity: 1;
}

/* Skeleton Shimmer Animation */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

.skeleton-box {
  background: linear-gradient(90deg, #111827 25%, #1e293b 50%, #111827 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius);
}

.skeleton-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.skeleton-title {
  height: 42px;
  width: 75%;
  margin-bottom: 20px;
}

.skeleton-meta {
  display: flex;
  gap: 16px;
}

.skeleton-badge {
  height: 24px;
  width: 120px;
}

.skeleton-paragraph {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line {
  height: 18px;
  width: 100%;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-card {
  height: 120px;
  width: 100%;
  margin-bottom: 30px;
}

/* ======================================================
   IMAGE LIGHTBOX MODAL STYLES
   ====================================================== */

.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.lightbox-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(17, 24, 39, 0.85);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
}

.lightbox-caption {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

.lightbox-body {
  max-width: 90vw;
  max-height: 80vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.lightbox-body img {
  max-width: 88vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  cursor: zoom-in;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-body img.zoomed {
  transform: scale(1.6);
  cursor: zoom-out;
}

.lightbox-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

/* Cursor pointer on article images */
.doc-body img {
  cursor: zoom-in !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.spin-icon {
  display: inline-block;
  vertical-align: middle;
}

/* ======================================================
   UNIFIED ADMIN CENTER TAB SYSTEM
   ====================================================== */
.admin-tab-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.admin-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.admin-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab-btn.active {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

/* ======================================================
   USER AVATAR STYLES (HEADER, ARTICLE, PROFILE, TABLES)
   ====================================================== */
.user-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.avatar-xs {
  width: 22px;
  height: 22px;
  font-size: 0.65rem;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.avatar-md {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.avatar-lg {
  width: 90px;
  height: 90px;
  font-size: 2rem;
  border-width: 3px;
}

.user-avatar-initials {
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* ======================================================
   FUTURISTIC TECH PRELOADER (3s OVERLAY)
   ====================================================== */
.tech-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #0B0F19;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-sans);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-loader-overlay.tech-loader-finished {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.tech-loader-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tech-grid-pattern {
  position: absolute;
  inset: -50%;
  background-image: 
    linear-gradient(to right, rgba(16, 185, 129, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16, 185, 129, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridMove 20s linear infinite;
  transform: perspective(500px) rotateX(60deg);
}

@keyframes gridMove {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(40px); }
}

.tech-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 6s ease-in-out infinite alternate;
}

.tech-glow-orb.orb-1 {
  width: 350px;
  height: 350px;
  background: #10B981;
  top: 20%;
  left: 25%;
}

.tech-glow-orb.orb-2 {
  width: 400px;
  height: 400px;
  background: #06B6D4;
  bottom: 15%;
  right: 20%;
  animation-delay: -3s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 30px) scale(1.15); }
}

.tech-loader-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  width: 90%;
  padding: 36px 28px;
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(16, 185, 129, 0.1);
}

/* HOLO REACTOR SPINNER */
.holo-reactor {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.holo-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.ring-outer {
  inset: 0;
  border-top-color: #10B981;
  border-right-color: rgba(16, 185, 129, 0.2);
  animation: holoRotate 1.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.ring-middle {
  inset: 12px;
  border-bottom-color: #06B6D4;
  border-left-color: rgba(6, 182, 212, 0.2);
  animation: holoRotateRev 1.3s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.ring-inner {
  inset: 24px;
  border-top-color: #3B82F6;
  border-bottom-color: rgba(59, 130, 246, 0.2);
  animation: holoRotate 0.9s linear infinite;
}

.holo-core {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, rgba(11, 15, 25, 0.8) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #10B981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  animation: corePulse 1.5s ease-in-out infinite alternate;
}

.holo-icon {
  width: 24px;
  height: 24px;
}

@keyframes holoRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes holoRotateRev {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes corePulse {
  0% { transform: scale(0.9); box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
  100% { transform: scale(1.1); box-shadow: 0 0 25px rgba(16, 185, 129, 0.8); }
}

/* BRAND & STATUS */
.tech-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 8px;
  display: inline-block;
}

.tech-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  margin: 4px 0 12px 0;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.tech-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.tech-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: dotBlink 1s infinite alternate;
}

@keyframes dotBlink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* PROGRESS BAR */
.tech-progress-box {
  width: 100%;
}

.tech-progress-track {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.tech-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10B981, #06B6D4);
  border-radius: 10px;
  box-shadow: 0 0 10px #10B981;
  transition: width 0.05s linear;
}

.tech-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-family: monospace;
}

.tech-code {
  color: var(--text-muted);
}

.tech-percentage {
  font-weight: 700;
  color: #10B981;
  font-size: 0.9rem;
}
