/* Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background-color: #ffffff;
  color: #333333;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Top Header (Pitch Black, 48px high, exact Wiki.js Vuetify style)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  height: 48px;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.header-left {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
}

.logo-img {
  height: 24px;
  width: 24px;
  object-fit: contain;
}

.logo-title {
  font-size: 14.5px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Center Search Box (Dark pill, rounded) */
.header-center {
  flex: 1;
  max-width: 480px;
  margin: 0 20px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

#live-search {
  width: 100%;
  height: 32px;
  padding: 0 16px 0 38px;
  font-size: 13px;
  border: 1px solid #333333;
  border-radius: 18px;
  background-color: #242424;
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

#live-search::placeholder {
  color: #8e8e8e;
}

#live-search:focus {
  background-color: #2e2e2e;
  border-color: #555555;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1200;
}

.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid #2d2d2d;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: #e0e0e0;
  transition: background 0.15s;
}

.search-result-item:hover, .search-result-item.selected {
  background: #333333;
}

.search-result-title {
  font-weight: 500;
  font-size: 13.5px;
  color: #ffffff;
}

.search-result-path {
  font-size: 11px;
  color: #888888;
  margin-top: 2px;
}

.search-result-snippet {
  font-size: 12px;
  color: #aaaaaa;
  margin-top: 4px;
}

.search-highlight {
  background-color: #a3c434;
  color: #000000;
  padding: 0 2px;
  border-radius: 2px;
}

.hidden {
  display: none !important;
}

/* Header Right Icons */
.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #cccccc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
}

.btn-icon:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.1);
}

/* User Menu & Dropdown */
.user-menu-container {
  position: relative;
}

.user-badge-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #000000;
}

.user-badge-indicator.admin {
  background-color: #f59e0b;
}

.user-badge-indicator.employee {
  background-color: #10b981;
}

.user-badge-indicator.dealer {
  background-color: #3b82f6;
}

.user-dropdown {
  position: absolute;
  top: 42px;
  right: 0;
  width: 220px;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  padding: 8px 0;
  z-index: 1200;
}

.user-dropdown-header {
  padding: 10px 14px 6px;
}

.user-dropdown-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
}

.user-dropdown-role {
  margin-top: 4px;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.role-badge.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.role-badge.employee {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.role-badge.dealer {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.role-badge.guest {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.user-dropdown-divider {
  height: 1px;
  background: #2d2d2d;
  margin: 6px 0;
}

.user-dropdown-item {
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.user-dropdown-item:hover {
  background: #2c2c2c;
  color: #ffffff;
}

.user-dropdown-item.logout-btn:hover {
  color: #f87171;
}

/* ==========================================================================
   App Layout & Sidebar (Slate Grey, #595959)
   ========================================================================== */
.app-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 48px);
}

.app-sidebar {
  width: 250px;
  background-color: #595959;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
  position: sticky;
  top: 48px;
  overflow-y: auto;
  user-select: none;
  flex-shrink: 0;
  transition: margin-left 0.25s ease-in-out;
}

@media (min-width: 769px) {
  .app-sidebar.hidden-desktop {
    margin-left: -250px;
  }
}

.sidebar-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
}

.btn-sidebar-home {
  width: 38px;
  height: 34px;
  background-color: #9cb82e;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-sidebar-home:hover {
  background-color: #8ca725;
}

.btn-sidebar-overview {
  flex: 1;
  height: 34px;
  background-color: #9cb82e;
  border: none;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-sidebar-overview:hover {
  background-color: #8ca725;
}

/* Navigation Lists in Sidebar */
.sidebar-section {
  padding: 4px 0;
}

.nav-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  color: #ffffff;
  text-decoration: none;
  font-size: 13.5px;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active > .nav-link {
  background-color: rgba(0, 0, 0, 0.15);
  font-weight: 500;
}

.chevron-icon {
  color: #ffffff;
  flex-shrink: 0;
}

/* Dynamic Catalog Tree Styles */
.catalog-tree-container {
  padding: 0 0 16px;
}

.tree-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tree-sublist {
  list-style: none;
  padding-left: 14px;
  margin: 0;
  display: none;
}

.tree-node.expanded > .tree-sublist {
  display: block;
}

.tree-row {
  display: flex;
  align-items: center;
  padding: 8px 16px 8px 10px;
  color: #ffffff;
  text-decoration: none;
  font-size: 13.5px;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.tree-row:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.tree-node.active > .tree-row {
  background-color: rgba(0, 0, 0, 0.15);
  font-weight: 500;
}

.tree-toggle-btn {
  background: none;
  border: none;
  color: #ffffff;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.tree-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.tree-node.expanded > .tree-row > .tree-toggle-btn svg {
  transform: rotate(90deg);
}

.tree-link-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
  text-decoration: none;
}

.tree-lock-icon {
  width: 13px;
  height: 13px;
  color: #f59e0b;
  flex-shrink: 0;
}

/* Sidebar Edge Toggle Button */
.sidebar-edge-toggle {
  position: relative;
  width: 0;
  z-index: 900;
}

.sidebar-edge-toggle button {
  position: absolute;
  left: 0;
  top: 12px;
  width: 24px;
  height: 40px;
  background-color: #595959;
  color: #ffffff;
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 0 6px rgba(0,0,0,0.2);
  transition: background-color 0.15s, transform 0.15s;
}

.sidebar-edge-toggle button:hover {
  background-color: #7b941e;
}

@media (max-width: 768px) {
  .sidebar-edge-toggle {
    display: none;
  }
}

/* ==========================================================================
   Main Content Area (Pure White)
   ========================================================================== */
.app-main {
  flex: 1;
  background-color: #ffffff;
  overflow-y: auto;
  padding: 24px 32px;
}

.content-wrapper {
  max-width: 1700px;
  margin: 0 auto;
}

/* ==========================================================================
   Breadcrumbs Navigation (Exact match to Wiki.js)
   ========================================================================== */
.breadcrumbs-nav {
  margin: 0 0 10px 0;
  padding: 0;
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.54);
  text-decoration: none;
  transition: color 0.15s;
  padding: 2px;
}

.breadcrumb-home-link:hover {
  color: #1976d2;
}

.breadcrumb-divider {
  color: rgba(0, 0, 0, 0.38);
  font-size: 12px;
  user-select: none;
}

.breadcrumb-link {
  color: rgba(0, 0, 0, 0.87);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
}

.breadcrumb-link:hover {
  color: #1976d2;
  background-color: rgba(0, 0, 0, 0.04);
}

.breadcrumb-link.active {
  font-weight: 600;
  color: rgba(0, 0, 0, 0.87);
}

.page-title {
  font-size: 28px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
  margin: 0 0 24px 0;
}

.page-status-row {
  margin-bottom: 12px;
}

.access-pill-restricted {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Access Denied Box */
.access-denied-box {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 60px 24px;
  text-align: center;
  max-width: 540px;
  margin: 40px auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.lock-circle {
  width: 72px;
  height: 72px;
  background: #ffe4e6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.access-denied-box h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 10px;
}

.access-denied-box p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-primary-login {
  background: #9cb82e;
  color: #ffffff;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary-login:hover {
  background: #8ca725;
}

/* ==========================================================================
   Catalog Cards Grid (#container) & Figure Blocks
   Images display at their natural original file size
   ========================================================================== */
#container {
  text-align: center;
  margin: 16px auto;
}

a,
figure {
  display: inline-block;
}

#container a,
a:has(figure) {
  text-decoration: none;
  vertical-align: top;
  margin: 6px 4px;
}

figure {
  padding: 5px;
  margin: 0;
  vertical-align: top;
  box-sizing: border-box;
}

#container figure,
a figure {
  box-sizing: border-box;
}

figure img,
#container figure img,
a figure img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 2px;
}

/* If height is specified in HTML, scale width proportionally */
figure img[height]:not([width]),
#container figure img[height]:not([width]),
a figure img[height]:not([width]) {
  width: auto;
}

/* If width is specified in HTML, scale height proportionally */
figure img[width]:not([height]),
#container figure img[width]:not([height]),
a figure img[width]:not([height]) {
  height: auto;
}

/* If neither is specified in HTML, use natural original dimensions */
figure img:not([height]):not([width]),
#container figure img:not([height]):not([width]),
a figure img:not([height]):not([width]) {
  width: auto;
  height: auto;
}

figcaption {
  margin: 10px 0 0 0;
  color: #666;
  font-size: 16px;
  line-height: 1.4;
  text-align: center;
  word-break: break-word;
}

/* Hover Scale Animation */
img {
  transition: transform .2s;
  -webkit-transition: -webkit-transform .2s;
  -moz-transition: -moz-transform .2s;
  -o-transition: -o-transform .2s;
}

img:hover {
  transform: scale(1.1);
  -ms-transform: scale(1.1);
  -webkit-transform: scale(1.1);
  -moz-transform: scale(1.1);
  -o-transform: scale(1.1);
}

/* External Link Icon (small square with diagonal arrow) */
a.is-external-link figure figcaption::after,
a.is-external-link figcaption::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.2'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  vertical-align: -1px;
}

/* General Content Styling */
.wiki-content {
  font-size: 14.5px;
  color: #333333;
  line-height: 1.65;
}

.wiki-content h1,
.wiki-content h2,
.wiki-content h3,
.wiki-content h4,
.wiki-content h5,
.wiki-content h6,
.wiki-content .toc-header {
  color: #1f2937;
  text-align: left;
  line-height: 1.3;
}

.wiki-content h1 {
  font-size: 2.1em;
  font-weight: 700;
  margin: 1.2em 0 0.5em;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.3em;
}

.wiki-content h2 {
  font-size: 1.7em;
  font-weight: 600;
  margin: 1.2em 0 0.5em;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.3em;
}

.wiki-content h3,
.wiki-content .toc-header {
  font-size: 1.35em;
  font-weight: 600;
  margin: 1.2em 0 0.5em;
}

.wiki-content h4 {
  font-size: 1.15em;
  font-weight: 600;
  margin: 1.2em 0 0.4em;
  color: #374151;
}

.wiki-content h5 {
  font-size: 1em;
  font-weight: 600;
  margin: 1.2em 0 0.4em;
  color: #4b5563;
}

.wiki-content h6 {
  font-size: 0.9em;
  font-weight: 600;
  color: #6b7280;
  margin: 1.2em 0 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wiki-content p {
  margin-bottom: 1em;
}

.wiki-content a {
  color: #1976d2;
  text-decoration: none;
}

.wiki-content a:hover {
  text-decoration: underline;
}

.wiki-content a img, #container a img {
  cursor: pointer !important;
}

.wiki-content img:not(a img):not(#container img) {
  max-width: 100%;
  border-radius: 4px;
  cursor: zoom-in;
}

.wiki-content img:not(a img):not(#container img):not([height]) {
  height: auto;
}

/* Tables */
.wiki-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13.5px;
}

.wiki-content th, .wiki-content td {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

/* ==========================================================================
/* ==========================================================================
   Buttons and Forms in Wiki Content (Styled like signature "Обзор" button)
   ========================================================================== */
.wiki-content button:not(.option-btn):not(.filter-btn):not(.modal-close-btn),
.wiki-content input[type="button"]:not(.filter-btn),
.wiki-content input[type="submit"],
.btn-mgs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: #9cb82e;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  height: 36px;
  box-sizing: border-box;
  vertical-align: middle;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.wiki-content button:not(.option-btn):not(.filter-btn):not(.modal-close-btn):hover,
.wiki-content input[type="button"]:not(.filter-btn):hover,
.wiki-content input[type="submit"]:hover,
.btn-mgs:hover {
  background-color: #8ca725;
}

.wiki-content button:not(.option-btn):not(.filter-btn):not(.modal-close-btn):active,
.wiki-content input[type="button"]:not(.filter-btn):active,
.wiki-content input[type="submit"]:active,
.btn-mgs:active {
  background-color: #7b941e;
  transform: scale(0.98);
}

.wiki-content button:not(.option-btn):not(.filter-btn):not(.modal-close-btn):focus-visible,
.wiki-content input[type="button"]:not(.filter-btn):focus-visible,
.wiki-content input[type="submit"]:focus-visible,
.btn-mgs:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(156, 184, 46, 0.35);
}

/* Option Buttons on Product Cards (ALVIC decors, etc.) - transparent */
.option-btn,
.wiki-content .option-btn,
button.option-btn {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  height: 50px !important;
  width: 70px !important;
  display: inline-block !important;
}

/* Filter Panel Buttons (ALVIC, catalog decors, etc.) */
.filter-panel button,
.wiki-content .filter-panel button,
.filter-btn,
.wiki-content .filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #cccccc !important;
  padding: 8px 18px !important;
  border-radius: 4px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  height: 38px !important;
  margin: 0 4px !important;
  transition: all 0.15s ease !important;
  box-shadow: none !important;
}

.filter-panel button:hover,
.wiki-content .filter-panel button:hover,
.filter-btn:hover,
.wiki-content .filter-btn:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.filter-panel button.active,
.wiki-content .filter-panel button.active,
.filter-btn.active,
.wiki-content .filter-btn.active {
  background-color: #333333 !important;
  color: #ffffff !important;
  border-color: #333333 !important;
}

/* Inputs in Wiki Content */
.wiki-content input[type="text"],
.wiki-content input[type="number"],
.wiki-content input[type="search"] {
  height: 36px;
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  vertical-align: middle;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wiki-content input[type="text"]:focus,
.wiki-content input[type="number"]:focus,
.wiki-content input[type="search"]:focus {
  border-color: #9cb82e;
  box-shadow: 0 0 0 3px rgba(156, 184, 46, 0.2);
}

/* ==========================================================================
   Blockquotes & Callout Alerts (Wiki.js Vuetify style)
   ========================================================================== */
.wiki-content blockquote {
  padding: 14px 20px;
  background-color: #eceff1;
  border-left: 55px solid #607d8b;
  border-radius: 8px;
  margin: 16px 0;
  position: relative;
  box-sizing: border-box;
  color: #37474f;
}

.wiki-content blockquote::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  position: absolute;
  top: 50%;
  left: -39.5px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

.wiki-content blockquote p {
  margin: 4px 0;
  color: inherit;
  font-size: 14.5px;
  line-height: 1.55;
}

.wiki-content blockquote p:first-child {
  margin-top: 0;
}

.wiki-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Info (Blue) */
.wiki-content blockquote.is-info {
  background-color: #e3f2fd;
  border-left: 55px solid #64b5f6;
  color: #0d47a1;
}

.wiki-content blockquote.is-info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.85)' d='M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,16.5V10H13V16.5H11M12,6.5A1.5,1.5 0 0,1 13.5,8A1.5,1.5 0 0,1 12,9.5A1.5,1.5 0 0,1 10.5,8A1.5,1.5 0 0,1 12,6.5Z'/%3E%3C/svg%3E");
}

/* Success (Green) */
.wiki-content blockquote.is-success {
  background-color: #e8f5e9;
  border-left: 55px solid #81c784;
  color: #1b5e20;
}

.wiki-content blockquote.is-success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.85)' d='M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z'/%3E%3C/svg%3E");
}

/* Warning (Amber / Orange) */
.wiki-content blockquote.is-warning {
  background-color: #fff3e0;
  border-left: 55px solid #ffb74d;
  color: #b33f00;
}

.wiki-content blockquote.is-warning::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.85)' d='M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z'/%3E%3C/svg%3E");
}

/* Danger / Error (Red) */
.wiki-content blockquote.is-danger,
.wiki-content blockquote.is-error {
  background-color: #ffebee;
  border-left: 55px solid #e57373;
  color: #b71c1c;
}

.wiki-content blockquote.is-danger::before,
.wiki-content blockquote.is-error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.85)' d='M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Floating Action Button (FAB) - Bottom right pencil icon
   ========================================================================== */
.fab-edit {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: #545454;
  color: #ffffff;
  border: none;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  transition: background 0.15s, transform 0.15s;
}

.fab-edit:hover {
  background-color: #444444;
  transform: scale(1.05);
}

/* ==========================================================================
   Admin In-Browser Page Editor Modal
   ========================================================================== */
.editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.editor-container {
  width: 95vw;
  height: 94vh;
  background: #1e1e1e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
  overflow: hidden;
  border: 1px solid #333333;
}

.editor-header {
  height: 52px;
  background: #252526;
  border-bottom: 1px solid #333333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}

.editor-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.editor-label {
  font-size: 13px;
  font-weight: 600;
  color: #9cdcfe;
  white-space: nowrap;
}

.editor-title-input {
  flex: 1;
  max-width: 480px;
  height: 32px;
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  color: #ffffff;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
}

.editor-title-input:focus {
  border-color: #007acc;
}

.editor-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-roles-group {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #282828;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid #3c3c3c;
}

.editor-roles-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #9cdcfe;
  margin-right: 2px;
}

.editor-role-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cccccc;
  cursor: pointer;
  user-select: none;
}

.editor-role-checkbox:hover {
  color: #ffffff;
}

.editor-role-checkbox input[type="checkbox"] {
  accent-color: #9cb82e;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.btn-editor-action {
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.btn-editor-action.btn-validate {
  background: #3a3d41;
  color: #cccccc;
}

.btn-editor-action.btn-validate:hover {
  background: #4e5157;
  color: #ffffff;
}

.btn-editor-action.btn-cancel {
  background: transparent;
  color: #aaaaaa;
  border: 1px solid #4a4a4a;
}

.btn-editor-action.btn-cancel:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.btn-editor-action.btn-save {
  background: #0e639c;
  color: #ffffff;
}

.btn-editor-action.btn-save:hover {
  background: #1177bb;
}

.editor-workspace {
  flex: 1;
  position: relative;
  display: flex;
  background: #191919;
  overflow: hidden;
}

/* ==========================================================================
   CodeMirror Custom Theme: techno-dark (Exact match to screenshot)
   ========================================================================== */
.editor-workspace .CodeMirror,
.cm-s-techno-dark.CodeMirror {
  width: 100%;
  height: 100%;
  font-family: Consolas, "Fira Code", "Courier New", monospace !important;
  font-size: 13.5px !important;
  line-height: 1.55 !important;
  background: #191919 !important;
  color: #d4d4d4 !important;
}

.cm-s-techno-dark .CodeMirror-gutters {
  background: #191919 !important;
  border-right: 1px solid #252525 !important;
  padding-right: 2px;
}

.cm-s-techno-dark .CodeMirror-linenumber {
  color: #3f3f3f !important;
  font-family: Consolas, monospace !important;
}

.cm-s-techno-dark .CodeMirror-cursor {
  border-left: 2px solid #ffffff !important;
}

.cm-s-techno-dark .CodeMirror-selected {
  background: #333333 !important;
}

.cm-s-techno-dark .CodeMirror-focused .CodeMirror-selected {
  background: #3a3a3a !important;
}

.cm-s-techno-dark .CodeMirror-line::selection,
.cm-s-techno-dark .CodeMirror-line > span::selection,
.cm-s-techno-dark .CodeMirror-line > span > span::selection {
  background: #3a3a3a !important;
}

/* Tag names and angle brackets: <div, <a, <figure, <img, >, </tag> (Coral/Terracotta Red) */
.cm-s-techno-dark .cm-tag,
.cm-s-techno-dark .cm-bracket {
  color: #b8433d !important;
  font-weight: normal;
}

/* Attribute names: id, href, target, src, height, class (Olive/Sage Green) */
.cm-s-techno-dark .cm-attribute {
  color: #8cb358 !important;
}

/* Equal signs and operators */
.cm-s-techno-dark .cm-operator,
.cm-s-techno-dark .cm-punctuation {
  color: #cccccc !important;
}

/* String attribute values: "container", "manual_pdf", "200" (Warm Amber/Yellow) */
.cm-s-techno-dark .cm-string {
  color: #f2bc65 !important;
}

/* Plain text content inside tags */
.cm-s-techno-dark .cm-text {
  color: #d4d4d4 !important;
}

/* HTML Comments */
.cm-s-techno-dark .cm-comment {
  color: #6a6a6a !important;
  font-style: italic;
}

/* Active line background */
.cm-s-techno-dark .CodeMirror-activeline-background {
  background: #202020 !important;
}

.editor-footer {
  background: #252526;
  border-top: 1px solid #333333;
  padding: 8px 16px;
  max-height: 120px;
  overflow-y: auto;
}

.validation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.val-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
}

.val-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.val-dot.green {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.val-dot.red {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.val-dot.yellow {
  background: #f59e0b;
}

.editor-shortcut-hint {
  font-size: 11px;
  color: #6e7681;
}

.val-errors-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.val-error-item {
  font-size: 12px;
  color: #f87171;
  font-family: Consolas, monospace;
  padding: 2px 0;
}

/* ==========================================================================
   Login Modal
   ========================================================================== */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(2px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 380px;
  background: #ffffff;
  border-radius: 12px;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
}

.login-close-btn:hover {
  color: #111827;
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-logo {
  height: 36px;
  margin-bottom: 8px;
}

.login-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.login-header p {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: #9cb82e;
  box-shadow: 0 0 0 3px rgba(156, 184, 46, 0.15);
}

.login-error-msg {
  color: #dc2626;
  font-size: 12px;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: #fee2e2;
  border-radius: 4px;
}

.login-btn {
  width: 100%;
  background: #9cb82e;
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.login-btn:hover {
  background: #8ca725;
}

.login-hints {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.5;
}

.hint-item {
  margin-bottom: 2px;
}

/* ==========================================================================
   Lightbox Image Zoom Modal
   ========================================================================== */
.image-modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-content {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 24px;
  color: #f1f1f1;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
}

.modal-caption {
  margin-top: 12px;
  color: #ffffff;
  font-size: 14px;
  text-align: center;
  max-width: 80%;
}

/* ==========================================================================
   Mobile & Tablet Responsive Styles (Media Queries)
   ========================================================================== */

/* Floating Hamburger Menu Button for Mobile */
.fab-menu {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #595959;
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 1050;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s, transform 0.1s;
}

.fab-menu:hover {
  background: #444444;
}

.fab-menu:active {
  transform: scale(0.95);
}

.fab-edit {
  background: #595959;
}

.fab-edit:hover {
  background: #444444;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1080;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.mobile-search-btn {
  display: none;
}

@media (max-width: 900px) {
  .app-sidebar {
    width: 220px;
  }
}

@media (max-width: 768px) {
  /* Top App Bar */
  .app-header {
    padding: 0 8px;
    height: 48px;
  }

  .header-left .logo-title {
    font-size: 13.5px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-left .logo-img {
    height: 22px;
  }

  .header-center {
    display: none;
  }

  .mobile-search-btn {
    display: flex;
  }

  .search-box.mobile-open {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #000000;
    z-index: 1050;
    border-radius: 0;
    max-width: 100%;
    padding: 0 12px;
    border: none;
  }

  .search-box.mobile-open input {
    font-size: 14px;
    color: #ffffff;
  }

  .search-dropdown {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - 48px);
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }

  .header-right {
    gap: 2px;
  }

  .btn-icon {
    padding: 4px;
  }

  /* Sidebar Drawer on Mobile */
  .fab-menu {
    display: flex;
  }

  .app-sidebar {
    position: fixed;
    top: 48px;
    left: -270px;
    width: 250px;
    height: calc(100vh - 48px);
    z-index: 1100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .app-sidebar.open {
    left: 0;
  }

  /* Main Content Area */
  .app-main {
    width: 100%;
    min-height: calc(100vh - 48px);
  }

  .content-wrapper {
    padding: 14px 12px 80px 12px;
  }

  .page-title,
  .wiki-content h1 {
    font-size: 20px;
    margin-bottom: 14px;
    line-height: 1.35;
    word-break: break-word;
  }

  /* Breadcrumbs */
  .breadcrumbs-nav {
    margin-bottom: 8px;
  }

  .breadcrumbs-list {
    font-size: 11.5px;
    gap: 4px;
  }

  /* Catalog Cards Grid on Mobile */
  #container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px auto;
  }

  #container a,
  a:has(figure) {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 10px auto;
    text-align: center;
  }

  figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    padding: 4px;
  }

  figure img,
  #container figure img,
  a figure img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
  }

  figcaption {
    font-size: 13.5px;
    text-align: center;
    margin-top: 6px;
  }

  /* Tables horizontal scroll */
  .wiki-content table {
    display: block;
    overflow-x: auto;
    width: 100%;
    margin: 14px 0;
    -webkit-overflow-scrolling: touch;
    font-size: 12.5px;
  }

  /* Blockquotes */
  .wiki-content blockquote {
    padding: 12px 12px 12px 14px;
    border-left-width: 44px;
    font-size: 13px;
    margin: 12px 0;
  }

  .wiki-content blockquote::before {
    left: -34px;
    width: 20px;
    height: 20px;
  }

  /* Floating Edit Button */
  .fab-edit {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  /* Modals */
  .login-card {
    width: calc(100% - 32px);
    padding: 24px 18px;
    margin: 16px;
  }

  .editor-modal {
    padding: 0;
  }

  .editor-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-width: 100vw;
    max-height: 100vh;
  }

  .editor-header {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 10px;
    gap: 8px;
  }

  .editor-header-left,
  .editor-header-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .editor-title-input {
    max-width: 100%;
  }

  .editor-roles-group {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 6px 8px;
    font-size: 11px;
  }

  /* Kitchen Calc on Mobile */
  .kitchen-calc .main-container {
    flex-direction: column;
  }

  .kitchen-calc .left-panel,
  .kitchen-calc .right-panel {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid var(--calc-border);
    padding: 14px 10px;
  }

  .kitchen-calc table {
    display: block;
    overflow-x: auto;
    width: 100%;
    font-size: 11px;
  }

  .kitchen-calc .footer-panel {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .kitchen-calc .total-badge {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* ==========================================================================
   Backup Button & Toast Notifications
   ========================================================================== */
.backup-btn {
  color: #9cb82e !important;
  background: rgba(156, 184, 46, 0.15) !important;
  border-radius: 6px;
  margin-right: 4px;
  border: 1px solid rgba(156, 184, 46, 0.3) !important;
}

.backup-btn:hover {
  background: rgba(156, 184, 46, 0.3) !important;
  color: #b0cf34 !important;
}

.backup-btn.loading svg,
.backup-trigger-btn.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 420px;
  padding: 12px 18px;
  border-radius: 8px;
  background: #23272d;
  color: #ffffff;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-success {
  background: #1e3a29;
  border-left: 4px solid #9cb82e;
  color: #f0fdf4;
}

.toast.toast-info {
  background: #1e293b;
  border-left: 4px solid #38bdf8;
  color: #f8fafc;
}

.toast.toast-error {
  background: #3f1d24;
  border-left: 4px solid #ef4444;
  color: #fef2f2;
}

.toast-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.toast-close:hover {
  color: #ffffff;
}

/* ==========================================================================
   User Management Modal & Table
   ========================================================================== */
.users-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.users-modal-card {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: modalFadeIn 0.2s ease-out;
}

.users-modal-header {
  background: #23272d;
  color: #ffffff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #374151;
}

.users-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  color: #f3f4f6;
}

.users-modal-title svg {
  color: #9cb82e;
}

.users-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-primary-add {
  background: #9cb82e;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary-add:hover {
  background: #8ca725;
}

.users-modal-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.15s;
}

.users-modal-close:hover {
  color: #ffffff;
}

.users-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.users-table-container {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.users-table th {
  background: #f9fafb;
  color: #4b5563;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  color: #1f2937;
}

.users-table tr:last-child td {
  border-bottom: none;
}

.users-table tr:hover {
  background: #f9fafb;
}

.user-cell-login {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #111827;
}

.user-cell-name {
  color: #374151;
}

.user-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.btn-action-icon {
  background: transparent;
  border: 1px solid #e5e7eb;
  padding: 5px 8px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: #4b5563;
}

.btn-action-icon.edit:hover {
  background: #f0fdf4;
  border-color: #86efac;
  color: #16a34a;
}

.btn-action-icon.delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-action-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.user-edit-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 3500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.user-edit-card {
  max-width: 440px;
  position: relative;
  z-index: 3510;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.user-edit-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ==========================================================================
   Dark Theme Overrides
   ========================================================================== */
body.dark-theme {
  background-color: #121212;
  color: #e0e0e0;
}
body.dark-theme .app-main {
  background-color: #121212;
}
body.dark-theme .page-title,
body.dark-theme .wiki-content h1,
body.dark-theme .wiki-content h2,
body.dark-theme .wiki-content h3,
body.dark-theme .wiki-content h4,
body.dark-theme .wiki-content h5,
body.dark-theme .wiki-content h6,
body.dark-theme .wiki-content .toc-header {
  color: #f3f4f6;
}
body.dark-theme .wiki-content {
  color: #d1d5db;
}
body.dark-theme .wiki-content h1,
body.dark-theme .wiki-content h2 {
  border-bottom-color: #374151;
}
body.dark-theme .wiki-content a {
  color: #60a5fa;
}
body.dark-theme .wiki-content th, 
body.dark-theme .wiki-content td {
  border-color: #374151;
}
body.dark-theme .breadcrumb-link {
  color: #9ca3af;
}
body.dark-theme .breadcrumb-link.active {
  color: #e5e7eb;
}
body.dark-theme .breadcrumb-link:hover,
body.dark-theme .breadcrumb-home-link:hover {
  color: #60a5fa;
  background-color: rgba(255, 255, 255, 0.1);
}
body.dark-theme .breadcrumb-divider,
body.dark-theme .breadcrumb-home-link {
  color: #6b7280;
}
body.dark-theme .access-denied-box {
  background: #1f2937;
  border-color: #374151;
}
body.dark-theme .access-denied-box h2 {
  color: #e5e7eb;
}
body.dark-theme .access-denied-box p {
  color: #9ca3af;
}
body.dark-theme .lock-circle {
  background: rgba(225, 29, 72, 0.2);
}
body.dark-theme .login-card,
body.dark-theme .users-modal-card,
body.dark-theme .user-edit-card,
body.dark-theme .editor-container {
  background: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}
body.dark-theme .login-header h3,
body.dark-theme .users-modal-title,
body.dark-theme .editor-label {
  color: #f3f4f6;
}
body.dark-theme .login-header p,
body.dark-theme .form-hint {
  color: #9ca3af;
}
body.dark-theme .form-input,
body.dark-theme .form-select,
body.dark-theme .editor-title-input,
body.dark-theme .editor-textarea {
  background: #111827;
  color: #e5e7eb;
  border-color: #374151;
}
body.dark-theme .users-table th {
  border-bottom-color: #374151;
  color: #9ca3af;
}
body.dark-theme .users-table td {
  border-bottom-color: #374151;
}
body.dark-theme .user-cell-login {
  color: #e5e7eb;
}
body.dark-theme .user-cell-name {
  color: #d1d5db;
}
body.dark-theme .btn-action-icon,
body.dark-theme .login-close-btn,
body.dark-theme .users-modal-close {
  color: #9ca3af;
}
body.dark-theme .btn-action-icon:hover,
body.dark-theme .login-close-btn:hover,
body.dark-theme .users-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
body.dark-theme .editor-header,
body.dark-theme .editor-footer {
  background: #1f2937;
  border-color: #374151;
}

/* ==========================================================================
   Admin Dashboard Styles
   ========================================================================== */
.dashboard-modal-container {
  max-width: 900px;
}

.dashboard-modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.dashboard-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.dark-theme .dashboard-card {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.dashboard-card .card-title {
  font-size: 0.85rem;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

body.dark-theme .dashboard-card .card-title {
  color: #9ca3af;
}

.dashboard-card .card-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #111827;
}

body.dark-theme .dashboard-card .card-value {
  color: #f3f4f6;
}

.dashboard-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.dashboard-list-container h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

body.dark-theme .dashboard-list-container h4 {
  color: #e5e7eb;
}

.dashboard-list {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

body.dark-theme .dashboard-list {
  background: #111827;
  border-color: #374151;
}

.dashboard-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  font-size: 0.9rem;
}

body.dark-theme .dashboard-list-item {
  background: #1f2937;
  color: #d1d5db;
}

.auto-refresh-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #4b5563;
  cursor: pointer;
  margin-right: 16px;
}

body.dark-theme .auto-refresh-label {
  color: #9ca3af;
}

.auto-refresh-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

/* --- Image Manager --- */
.image-manager-body {
  padding: 0;
  display: flex;
  flex: 1;
  overflow: hidden;
}
.img-manager-layout {
  display: flex;
  width: 100%;
  height: 100%;
}
.img-manager-left {
  width: 40%;
  min-width: 300px;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  background-color: #f9fafb;
}
body.dark-theme .img-manager-left {
  background-color: #1f2937;
  border-color: #374151;
}
.img-manager-right {
  width: 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  padding: 24px;
  position: relative;
}
body.dark-theme .img-manager-right {
  background-color: #111827;
}
.img-manager-toolbar {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  background: white;
}
body.dark-theme .img-manager-toolbar {
  background: #1f2937;
  border-color: #374151;
}
.img-manager-toolbar input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
}
body.dark-theme .img-manager-toolbar input {
  background-color: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}
.img-manager-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.img-list-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.img-list-item:hover {
  background-color: #e5e7eb;
}
.img-list-item.active {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: 500;
}
body.dark-theme .img-list-item:hover {
  background-color: #374151;
}
body.dark-theme .img-list-item.active {
  background-color: #1e3a8a;
  color: #93c5fd;
}
.img-list-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  margin-right: 12px;
  font-size: 0.9rem;
}
.img-list-item-size {
  font-size: 0.8rem;
  color: #6b7280;
}
body.dark-theme .img-list-item-size {
  color: #9ca3af;
}
.img-manager-upload-zone {
  padding: 24px;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  background-color: white;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom-left-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
body.dark-theme .img-manager-upload-zone {
  background-color: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}
.img-manager-upload-zone.dragover {
  background-color: #eff6ff;
  color: #2563eb;
}
body.dark-theme .img-manager-upload-zone.dragover {
  background-color: #1e3a8a;
  color: #bfdbfe;
}
.img-preview-empty {
  color: #9ca3af;
  font-size: 1.1rem;
}
.img-preview-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
}
.img-preview-image {
  max-width: 100%;
  max-height: calc(100% - 120px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  margin-bottom: 24px;
}
.img-preview-info {
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 500px;
}
body.dark-theme .img-preview-info {
  background: #1f2937;
}
.img-preview-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 4px;
  word-break: break-all;
}
.img-preview-meta {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
body.dark-theme .img-preview-meta {
  color: #9ca3af;
}
.img-preview-actions {
  display: flex;
  gap: 12px;
}
.btn-rename {
  padding: 8px 16px;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  flex: 1;
  transition: all 0.2s;
  color: #374151;
}
.btn-rename:hover {
  background-color: #e5e7eb;
}
body.dark-theme .btn-rename {
  background-color: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}
body.dark-theme .btn-rename:hover {
  background-color: #4b5563;
}
.btn-delete-img {
  padding: 8px 16px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  flex: 1;
  transition: all 0.2s;
}
.btn-delete-img:hover {
  background-color: #fee2e2;
}
body.dark-theme .btn-delete-img {
  background-color: #7f1d1d;
  border-color: #991b1b;
  color: #fca5a5;
}
body.dark-theme .btn-delete-img:hover {
  background-color: #991b1b;
}
