/* ============================================================
   NANUSHTY ADMIN — Custom additions for new Bootstrap panel
   Matches new panel: Geist font, plain cards, light bg-body
   Only adds what Bootstrap doesn't already provide.
   ============================================================ */

/* Prevent newsletter editor cells from collapsing on mobile */

.badge {
  color: var(--bs-primary)!important;
  height: max-content;
}

.bg-secondary {
  background: var(--bs-primary-bg-subtle)!important;
}

.colimg {
  min-height: 90px;
  border: 1.5px dashed #c4b5d8;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

/* Prevent mobile collapse */

.nl-col-row td > div {
  min-width: 90px;
  min-height: 90px;
  position: relative;
}

/* Upload label */

.nl-cell-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 90px;
  color: #c4b5d8;
  font-size: .72rem;
  pointer-events: auto;
  user-select: none;
  transition: color .15s;
}

.colimg:hover .nl-cell-upload-label {
  color: #a855f7;
}

/* Image */

.colimg img {
  width: 100% !important;
  height: auto !important;
  display: block;
  border-radius: 5px;
  cursor: pointer;
}

/* Hover overlay */

.colimg:has(img):hover::after {
  content: '✎ double-click to swap';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: .6rem;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.45);
  padding: 2px 0;
  pointer-events: none;
}

/* Make upload label always centered and tappable */

/* Ensure images scale properly */

/* chat */

.invoice-letter {
  width: 8.5in;
  min-height: 11in;
  padding: 1in;
  background: white;
  color: black;
  font-family: Arial, sans-serif;
}

.invoice-header img {
  object-fit: contain;
}

.invoice-section {
  margin-top: 25px;
}

.invoice-footer {
  margin-top: 40px;
}

.admin-chat-img {
  max-width: 150px;
  border-radius: 20px;
}

:root {
  --bs-font-family: 'Geist', sans-serif;
}

body {
  font-family: 'Geist', sans-serif;
}

/* ---------- Page Loader ---------- */

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bs-body-bg, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

#page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

#page-loader .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bs-border-color, #dee2e6);
  border-top-color: var(--bs-primary, #0d6efd);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ---------- Sidebar layout (matches new panel col structure) ---------- */

.sidebar-col {
  max-width: 260px;
  min-width: 220px;
}

/* Sidebar nav collapse arrow rotation */

.btn-link .arrow {
  transition: transform .2s;
}

.btn-link[aria-expanded="true"] .arrow {
  transform: rotate(90deg);
}

/* ---------- Stat Cards — new panel style ---------- */

/* No custom card class needed — uses plain .card .card-body p-3
   These helpers just make the stat value prominent */

.stat-value {
  font-size: 1cqi;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--bs-secondary-color, #6c757d);
}

.stat-subtext {
  font-size: 1cqi;
  color: var(--bs-secondary-color, #6c757d);
  margin-top: 0.4rem;
}

/* Mini order-status cards — plain colored badges in new panel style */

.order-status-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.order-status-card .status-count {
  font-size: 1cqi;
  font-weight: 700;
}

/* ---------- Status Badges (Orders table) ---------- */

.status-badge {
  display: inline-block;
  padding: .25em .6em;
  border-radius: .375rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.status-in-process {
  background: #fff3cd;
  color: #664d03;
}

.status-shipped {
  background: #cff4fc;
  color: #055160;
}

.status-delivered {
  background: #d1e7dd;
  color: #0a3622;
}

.status-canceled {
  background: #e2e3e5;
  color: #41464b;
}

.status-returned {
  background: #fde8d8;
  color: #7b3600;
}

.status-refunded {
  background: #f8d7da;
  color: #58151c;
}

.status-pending {
  background: #cfe2ff;
  color: #052c65;
}

/* ---------- Product table custom cells ---------- */

.prod-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: .375rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
}

.prod-name {
  font-weight: 600;
  font-size: 1cqi;
}

.prod-meta {
  font-size: 1cqi;
  color: var(--bs-secondary-color, #6c757d);
}

.stock-badge {
  display: inline-block;
  padding: .2em .55em;
  border-radius: .375rem;
  font-size: 12px;
  font-weight: 600;
  min-width: 100px;
}

.in-stock {
  background: #d1e7dd;
  color: #0a3622;
}

.low-stock {
  background: #fff3cd;
  color: #664d03;
}

.out-of-stock {
  background: #f8d7da;
  color: #58151c;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  justify-content: center;
}

.toggle-label {
  font-size: 14px;
  font-weight: 600;
}

.toggle-label.on {
  color: #a3a3a3;
}

.toggle-label.off {
  color: #6c757d;
}

.btn-action {
  border: none;
  border-radius: .375rem;
  padding: .3rem .5rem;
  font-size: .8rem;
  cursor: pointer;
  transition: opacity .15s;
  line-height: 1;
}

.btn-action:hover {
  opacity: .75;
}

.btn-action.edit {
  background: #cfe2ff;
  color: #084298;
}

.btn-action.delete {
  background: #f8d7da;
  color: #842029;
}

/* ---------- Product Add/Edit form (dark card retained since it's a form) ---------- */

/* The form pages use a dark card matching old panel since they are deep-edit pages.
   Login is also dark. Everything else is light like the new panel. */

.admin-card-dark {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .75rem;
  width: 100%;
  max-width: 860px;
  color: #f8f9fa;
}

.admin-card-dark .form-control, .admin-card-dark .form-select {
  background: #16213e;
  border-color: rgba(255,255,255,.15);
  color: #f8f9fa;
}

.admin-card-dark .form-control:focus, .admin-card-dark .form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.25);
  background: #16213e;
  color: #f8f9fa;
}

.admin-card-dark label {
  color: #ced4da;
  font-size: 1cqi;
  margin-bottom: .3rem;
  display: block;
}

.admin-card-dark .form-text {
  color: #adb5bd;
}

.admin-card-dark .form-check-label {
  color: #ced4da;
}

/* Quill dark overrides */

.admin-card-dark .ql-toolbar {
  background: #16213e;
  border-color: rgba(255,255,255,.15);
}

.admin-card-dark .ql-container {
  background: #16213e;
  border-color: rgba(255,255,255,.15);
  color: #f8f9fa;
  min-height: 120px;
}

.admin-card-dark .ql-editor.ql-blank::before {
  color: #6c757d;
}

/* Category manager */

.cat-manager {
  background: rgba(255,255,255,.04);
  border-radius: .5rem;
  padding: 1rem;
  margin-top: .75rem;
  display: none;
}

.cat-manager.open {
  display: block;
}

/* Image upload grid */

#uploadedImages, #existingImages {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.uploaded-image {
  position: relative;
  border-radius: .5rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: #16213e;
  width: 130px;
}

.uploaded-image img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  display: block;
}

.image-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.6);
  padding: .3rem;
  text-align: center;
}

.primary-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--bs-primary);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
}

.sort-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0,0,0,.55);
  color: #ccc;
  font-size: .62rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
}

.drag-handle {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 1.1rem;
  color: rgba(255,255,255,.55);
  cursor: grab;
  user-select: none;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-item.dragging {
  opacity: .4;
}

.sortable-item.drag-over {
  box-shadow: 0 0 0 3px var(--bs-primary);
}

/* ---------- Login Page ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bs-body-bg);
}

.auth-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 24px var(--bs-gray-700);
}

.auth-card .biglogo {
  max-width: 160px;
  margin: 0 auto 1rem;
  display: block;
}

.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: .2rem;
  color: var(--bs-primary);
}

.auth-subtitle {
  font-size: .875rem;
  color: var(--bs-secondary-color);
  text-align: center;
  margin-bottom: 1.5rem;
}

.loginput {
  width: 100%;
  padding: .6rem .9rem;
  margin-bottom: .75rem;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
  color: var(--bs-body-color);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.loginput:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .2rem rgba(13,110,253,.2);
}

.loginput::placeholder {
  color: var(--bs-secondary-color);
}

.auth-btn {
  width: 100%;
  padding: .65rem;
  background: var(--bs-primary);
  color: var(--bs-secondary);
  border: none;
  border-radius: .375rem;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s;
}

.auth-btn:hover {
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
}

.auth-error {
  font-size: .85rem;
  padding: .5rem .75rem;
  margin-bottom: .75rem;
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
  border-radius: .375rem;
  display: none;
}

.auth-links {
  text-align: center;
  margin-top: .9rem;
}

.auth-links a {
  font-size: .83rem;
  color: var(--bs-gray-600);
  text-decoration: none;
}

/* ---------- Bundle settings card ---------- */

.bundle-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  padding: 2rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Footer (new panel style) ---------- */

footer.nano-footer {
  text-align: center;
  padding: 2.5rem 1rem;
}

.dropdown-toggle-no-caret::after {
  display: none !important;
}

.products-tabs .nav-link {
  color: var(--bs-secondary-color);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .65rem 1.25rem;
  font-weight: 500;
  transition: color .15s, border-color .15s;
}

.products-tabs .nav-link:hover {
  color: var(--bs-body-color);
}

.products-tabs .nav-link.active {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
  background: transparent;
}

.products-tabs {
  border-bottom: 1px solid var(--bs-border-color);
}

/* Edit tab hidden until a product is selected */

#tab-edit-btn {
  display: none;
}

/* Image upload grid */

/* Cat manager */

.cat-manager-box {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
  padding: 1rem;
  margin-top: .5rem;
  display: none;
}

.cat-manager-box.open {
  display: block;
}

/* Quill in light theme */

.ql-toolbar {
  border-radius: .375rem .375rem 0 0 !important;
}

.ql-container {
  border-radius: 0 0 .375rem .375rem !important;
  min-height: 130px;
}

@media (max-width: 768px) {
  .make-primary-btn {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    font-size: .75rem;
    padding: 3px 6px;
  }
}

[data-bs-theme="dark"] .NDlogo {
  display: block;
  max-width: 200px;
}

[data-bs-theme="dark"] .NLlogo {
  display: none;
}

.logos {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-bottom: 20px;
}

.NDlogo {
  display: none;
}

.NLlogo {
  display: block;
  max-width: 200px;
}

.link-primary {
  color: var(--bs-primary-rgb)!important;
}

.N-Ebtn {
  width: 55px;
  margin: 2px;
}

.form-check-input:checked {
  background-color: #56aa1d;
}

.form-check-input {
  margin: 0;
  border-radius: 50%;
}

.nabody {
  background: #2b2b2b!important;
}

