:root {
  --menu-shadow: 0 1rem 2.5rem rgba(44, 62, 80, 0.08);
  --soft-border: rgba(44, 62, 80, 0.12);
}

body {
  min-height: 100vh;
}

html[data-bs-theme="light"] .menu-category-toggle {
  color: #2c3e50;
  background: #ffffff;
}

html[data-bs-theme="dark"] body {
  background: #17212b;
  color: #eaf2f7;
}

html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .modal-content,
html[data-bs-theme="dark"] .print-sheet,
html[data-bs-theme="dark"] .menu-category-toggle,
html[data-bs-theme="dark"] .product-card,
html[data-bs-theme="dark"] .admin-product-mobile-card,
html[data-bs-theme="dark"] .theme-toggle-btn {
  background: #22313f;
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .menu-category-toggle {
  color: #eef5fb;
}

html[data-bs-theme="dark"] .navbar,
html[data-bs-theme="dark"] .announcement-strip {
  background: #1f2b36 !important;
}

html[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #eaf2f7;
  --bs-table-border-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .text-body-secondary {
  color: rgba(234, 242, 247, 0.72) !important;
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
  background: #18222d;
  border-color: rgba(255, 255, 255, 0.12);
  color: #eaf2f7;
}

html[data-bs-theme="dark"] .compact-search {
  background: #22313f;
  color: #eaf2f7;
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-bs-theme="dark"] .btn-outline-primary {
  color: #dce9f5;
  border-color: rgba(106, 186, 255, 0.42);
}

html[data-bs-theme="dark"] .btn-outline-primary:hover,
html[data-bs-theme="dark"] .btn-outline-primary:focus,
html[data-bs-theme="dark"] .btn-outline-primary:active {
  color: #ffffff;
}

html[data-bs-theme="dark"] .btn-outline-secondary {
  color: #dde8f2;
  border-color: rgba(255, 255, 255, 0.24);
}

html[data-bs-theme="dark"] .nav-link {
  color: rgba(234, 242, 247, 0.86);
}

html[data-bs-theme="dark"] .nav-link.active,
html[data-bs-theme="dark"] .nav-link:focus,
html[data-bs-theme="dark"] .nav-link:hover {
  color: #ffffff;
}

html[data-bs-theme="dark"] .theme-toggle-btn {
  color: #f6fbff;
  border-color: rgba(255, 255, 255, 0.16);
}

html[data-bs-theme="dark"] .theme-toggle-btn:hover,
html[data-bs-theme="dark"] .theme-toggle-btn:focus {
  background: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .form-check-input {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 0.75rem;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 1rem;
}

.admin-nav-scroll {
  overflow-x: auto;
  white-space: nowrap;
}

.metric-card {
  box-shadow: var(--menu-shadow);
  border: 0;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
}

.theme-toggle-btn {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(44, 62, 80, 0.16);
  background: rgba(255, 255, 255, 0.95);
  color: var(--bs-body-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 0.35rem 1rem rgba(44, 62, 80, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.theme-toggle-btn:hover,
.theme-toggle-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 0.5rem 1.2rem rgba(44, 62, 80, 0.14);
}

.theme-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.theme-icon-sun,
html[data-bs-theme="dark"] .theme-icon-moon {
  display: none;
}

html[data-bs-theme="dark"] .theme-icon-sun,
.theme-icon-moon {
  display: inline-block;
}

.category-pill-wrap,
.category-scroll {
  display: flex;
  gap: 0.75rem;
}

.category-scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.admin-product-category-wrap {
  flex-wrap: wrap;
}

.compact-search {
  border-radius: 999px;
  padding-inline: 1rem;
  height: 48px;
}

.announcement-strip {
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  box-shadow: var(--menu-shadow);
  line-height: 1.55;
}

.menu-category {
  margin-bottom: 0.85rem;
}

.menu-category-toggle {
  width: 100%;
  border: 1px solid var(--soft-border);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bs-body-bg);
  color: #2c3e50;
}

.menu-category-toggle span {
  color: inherit;
}

.accordion-arrow {
  transition: transform 0.2s ease;
  color: inherit;
}

.menu-category-toggle.is-open .accordion-arrow {
  transform: rotate(180deg);
}

.menu-category-body {
  padding-top: 0.75rem;
}

.product-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--soft-border);
  border-radius: 1rem;
  box-shadow: var(--menu-shadow);
  margin-bottom: 0.75rem;
}

.product-image,
.admin-product-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 1rem;
  flex: 0 0 auto;
}

.product-name {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.product-description {
  color: var(--bs-secondary-color);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.45rem;
  font-size: 0.95rem;
  line-height: 1.18;
}

.product-description.is-empty {
  min-height: 3.45rem;
}

.product-price-column {
  font-weight: 700;
  white-space: nowrap;
  font-size: 1.1rem;
  align-self: center;
}

.menu-footer a {
  text-decoration: none;
}

.social-icons {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.social-icons a {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(32, 107, 196, 0.12);
  color: inherit;
}

.drag-cell {
  width: 56px;
  cursor: grab;
  font-size: 1.2rem;
  text-align: center;
  font-weight: 700;
}

.row-passive {
  opacity: 0.68;
}

.description-clamp-admin {
  color: var(--bs-secondary-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  min-height: 2.8rem;
}

.product-search {
  width: min(320px, 100%);
}

.bulk-toolbar-card .btn,
.admin-product-category-wrap .btn,
.category-scroll .btn {
  font-weight: 500;
}

.admin-product-category-wrap .btn,
.category-scroll .btn {
  white-space: nowrap;
  width: auto;
  flex: 0 0 auto;
}

.category-scroll .btn {
  padding-inline: 1rem;
  min-height: 48px;
}

html[data-bs-theme="dark"] .category-scroll .btn.btn-outline-primary,
html[data-bs-theme="dark"] .admin-product-category-wrap .btn.btn-outline-primary,
html[data-bs-theme="dark"] .bulk-toolbar-card .btn.btn-outline-primary {
  color: #f3f8fd;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
}

html[data-bs-theme="dark"] .category-scroll .btn.btn-primary,
html[data-bs-theme="dark"] .admin-product-category-wrap .btn.btn-primary,
html[data-bs-theme="dark"] .bulk-toolbar-card .btn.btn-primary {
  color: #ffffff;
}

.product-table-card {
  overflow: hidden;
}

.admin-product-table {
  table-layout: fixed;
}

.admin-product-table thead th,
.admin-product-table tbody td {
  vertical-align: middle;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.admin-product-table .description-head {
  width: 34%;
}

.admin-product-table .description-cell {
  padding-right: 1.2rem;
}

.admin-product-table .product-name-cell {
  padding-right: 1rem;
}

.admin-product-table .product-price-cell {
  white-space: nowrap;
  font-weight: 600;
}

.admin-product-table .product-row-actions {
  flex-wrap: nowrap;
}

.admin-product-table .product-status-form {
  min-height: 0;
}

.admin-product-table .bulk-checkbox {
  width: 1.1rem;
  height: 1.1rem;
}

.admin-product-mobile-list {
  display: grid;
  gap: 0.85rem;
}

.admin-product-mobile-card {
  border: 1px solid var(--soft-border);
  border-radius: 1rem;
  box-shadow: var(--menu-shadow);
  padding: 0.9rem;
}

.mobile-card-header {
  display: flex;
  gap: 0.85rem;
}

.mobile-price {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.mobile-description {
  margin-top: 0.45rem;
  color: var(--bs-secondary-color);
  font-size: 0.88rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-card-meta,
.mobile-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.mobile-card-actions {
  justify-content: flex-end;
}

.mobile-order-controls {
  display: flex;
  gap: 0.5rem;
}


#productModal .modal-dialog {
  max-width: min(820px, calc(100vw - 1rem));
  margin: 0.5rem auto;
}

#productModal .modal-content {
  overflow: hidden;
}

#productModal .modal-body {
  padding: 1.15rem 1.15rem 0.75rem;
}

.modal-footer-sticky {
  position: sticky;
  bottom: 0;
  background: inherit;
  border-top: 1px solid var(--soft-border);
  z-index: 1;
}

.print-sheet {
  max-width: 980px;
  margin-inline: auto;
}

.print-cover-page {
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.print-cover-inner {
  width: 100%;
}

.print-cover-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
}

.print-logo {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 1.25rem;
}

.print-menu-pages {
  padding-bottom: 2.2rem;
}

.print-category-block {
  margin-bottom: 1rem;
}

.print-category-title {
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(44, 62, 80, 0.16);
  padding-bottom: 0.35rem;
  margin-bottom: 0.55rem;
}

.print-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.28rem 0;
  border-bottom: 1px dashed rgba(44, 62, 80, 0.14);
}

.print-product-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
}

.print-product-description {
  min-height: 1rem;
  color: var(--bs-secondary-color);
  font-size: 0.76rem;
  line-height: 1.25;
  margin-top: 0.1rem;
}

.print-product-price {
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.88rem;
  line-height: 1.2;
}

.print-footer-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  line-height: 1.2;
  padding-top: 0.5rem;
}

@media (max-width: 991.98px) {
  .admin-nav-scroll {
    padding-bottom: 0.35rem;
  }

  .bulk-toolbar-card .card-body {
    align-items: stretch;
  }

  .product-search {
    width: 100%;
  }

  .admin-product-mobile-card {
    padding: 1rem;
  }
}

@media (max-width: 767.98px) {
  .theme-toggle-btn {
    width: 42px;
    height: 42px;
  }

  .product-card {
    grid-template-columns: 60px minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 0.8rem;
  }

  .product-description,
  .product-description.is-empty {
    -webkit-line-clamp: 4;
    font-size: 0.8rem;
    line-height: 1.18;
    min-height: calc(0.8rem * 1.18 * 4);
    max-height: calc(0.8rem * 1.18 * 4);
    overflow: hidden;
  }

  .product-name {
    font-size: 1rem;
  }

  .product-price-column {
    font-size: 1rem;
  }

  .category-scroll {
    gap: 0.6rem;
  }

  .category-scroll .btn {
    padding-inline: 0.9rem;
  }

  .announcement-strip {
    font-size: 0.98rem;
  }

  .mobile-card-meta,
  .mobile-card-actions {
    flex-wrap: wrap;
  }

  #productModal .modal-dialog {
    max-width: calc(100vw - 0.5rem);
    margin: 0.25rem auto;
  }

  #productModal .modal-body {
    padding: 1rem 1rem 0.5rem;
  }
}

@page {
  size: A4;
  margin: 14mm 14mm 18mm;
}

@media print {
  html,
  body {
    background: white !important;
    color: #1a1a1a !important;
  }

  .print-hide,
  nav,
  .modal,
  .btn,
  .navbar,
  .admin-body > main::before {
    display: none !important;
  }

  main.container-fluid {
    padding: 0 !important;
  }

  .print-sheet {
    box-shadow: none !important;
    max-width: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .print-cover-page {
    min-height: calc(297mm - 32mm);
    page-break-after: always;
    break-after: page;
  }

  .print-menu-pages {
    padding-bottom: 10mm;
  }

  .print-category-block {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .print-footer-note {
    position: fixed;
    left: 14mm;
    right: 14mm;
    bottom: 6mm;
    justify-content: center;
    border-top: 1px solid rgba(44, 62, 80, 0.16);
    background: #fff;
    padding-top: 3mm;
  }
}
