/* ==========================================================================
   RD DEHYDRATED FOODS - ADMIN DASHBOARD STYLES
   ========================================================================== */

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--header-height));
  background-color: #F7F5F0;
}

.admin-sidebar {
  background-color: var(--color-white);
  border-right: 1px solid var(--color-border);
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-nav-item:hover, .admin-nav-item.active {
  background-color: var(--color-olive-soft);
  color: var(--color-primary);
}

.admin-main {
  padding: 2.5rem;
  overflow-y: auto;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.admin-stat-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.stat-card-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-card-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
}

.admin-table-container {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background-color: #FAF8F5;
  padding: 1rem 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
}

.admin-table td {
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

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

.admin-table tr:hover td {
  background-color: #FAF8F5;
}

.table-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background-color: #FAF8F5;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.status-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pending { background-color: #FEF3C7; color: #92400E; }
.status-processing { background-color: #DBEAFE; color: #1E40AF; }
.status-shipped { background-color: #E0E7FF; color: #3730A3; }
.status-delivered { background-color: #DEF7EC; color: #03543F; }

/* Admin Modal */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(16, 37, 23, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10005;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.admin-modal-overlay.active {
  display: flex;
}

.admin-modal {
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 2.2rem;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 0.8rem;
  }
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   ADMIN PIN SECURITY LOCK SCREEN
   ========================================================================== */

.admin-lock-screen {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: radial-gradient(circle at center, #F5F1E8 0%, #EBE5D8 100%);
}

.admin-lock-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(25, 56, 34, 0.12);
  max-width: 440px;
  width: 100%;
  padding: 3rem 2.5rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.admin-lock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold), var(--color-olive));
}

.admin-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--color-olive-soft);
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.2rem;
}

.admin-lock-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  padding: 3px;
  border: 2px solid var(--color-gold);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  display: block;
}

.admin-lock-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}

.admin-lock-subtitle {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 1.8rem;
  line-height: 1.5;
}

.admin-pin-field-wrapper {
  margin-bottom: 1.2rem;
}

.admin-pin-input {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 1.2rem;
  text-align: center;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-primary);
  background-color: #FAF8F5;
  transition: all var(--transition-fast);
  font-family: monospace;
}

.admin-pin-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(25, 56, 34, 0.12);
  background-color: var(--color-white);
}

.admin-pin-error {
  display: none;
  background-color: #FDF2F2;
  color: #991B1B;
  border: 1px solid #F87171;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.admin-pin-error.active {
  display: block;
  animation: shakePin 0.4s ease-in-out;
}

@keyframes shakePin {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Keypad Grid */
.admin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  max-width: 260px;
  margin: 0 auto 1.6rem;
}

.keypad-btn {
  background-color: #F8F6F1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  padding: 0.7rem 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.keypad-btn:hover {
  background-color: var(--color-olive-soft);
  color: var(--color-primary);
  border-color: var(--color-olive);
}

.keypad-btn:active {
  transform: scale(0.94);
}

.keypad-btn.action-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Admin Product Image Uploader & Gallery Picker
   ========================================================================== */
.admin-image-uploader-box {
  margin-bottom: 1.2rem;
}

.image-upload-dropzone {
  border: 2px dashed #D4C9B8;
  border-radius: var(--radius-lg);
  padding: 1.4rem 1rem;
  text-align: center;
  background-color: #FAF8F5;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.image-upload-dropzone:hover,
.image-upload-dropzone.dragover {
  border-color: var(--color-primary);
  background-color: #F3EFE6;
  box-shadow: 0 4px 12px rgba(25, 56, 34, 0.08);
}

.image-upload-dropzone.dragover {
  border-style: solid;
  transform: scale(1.01);
}

.dropzone-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-olive-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  transition: transform var(--transition-fast);
}

.image-upload-dropzone:hover .dropzone-icon-circle {
  transform: translateY(-2px);
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}

.dropzone-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--color-primary);
  color: #ffffff !important;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  margin: 0.4rem 0 0.3rem;
  box-shadow: 0 2px 6px rgba(25, 56, 34, 0.18);
  pointer-events: none;
}

.dropzone-hint {
  font-size: 0.76rem;
  color: var(--color-text-muted);
}

/* Image Preview Card */
.image-upload-preview-card {
  display: none;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem;
  background-color: #FAF8F5;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: 0.6rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.image-upload-preview-card.active {
  display: flex;
}

.preview-img-container {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-info {
  flex: 1;
  min-width: 0;
}

.preview-filename {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

.preview-details-line {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.preview-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: #DEF7EC;
  color: #03543F;
}

.preview-actions-bar {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.btn-img-action {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-img-action:hover {
  background-color: var(--color-olive-soft);
  color: var(--color-primary);
  border-color: var(--color-olive);
}

.btn-img-action.btn-danger-action {
  color: #B91C1C;
}

.btn-img-action.btn-danger-action:hover {
  background-color: #FEE2E2;
  border-color: #F87171;
}

.manual-image-toggle-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.4rem 0 0.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.manual-image-toggle-btn:hover {
  color: var(--color-olive);
}

.manual-image-box {
  display: none;
  margin-top: 0.6rem;
  padding: 0.8rem;
  background-color: #F5F2EB;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.manual-image-box.active {
  display: block;
}

/* ==========================================================================
   Dynamic Weight Variants Manager & Offer Settings Styles
   ========================================================================== */
.variant-row {
  display: grid;
  grid-template-columns: 105px 1fr 100px 100px 36px;
  gap: 0.5rem;
  align-items: center;
  background: #ffffff;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.variant-row:hover {
  border-color: var(--color-olive);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.btn-remove-variant {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #DC2626;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  transition: all var(--transition-fast);
}

.btn-remove-variant:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}

.btn-weight-preset,
.btn-offer-preset {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-weight-preset:hover {
  background: var(--color-olive-soft);
  color: var(--color-primary);
  border-color: var(--color-olive);
}

.btn-offer-preset {
  border-color: #FCD34D;
  background: #FFFDF5;
  color: #92400E;
}

.btn-offer-preset:hover {
  background: #FEF3C7;
  border-color: #F59E0B;
}

@media (max-width: 600px) {
  .variant-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
}

/* ==========================================================================
   Media Library & Product Image Gallery Modal Styles
   ========================================================================== */
.dropzone-actions-group {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0.5rem 0 0.3rem;
  z-index: 2;
}

.dropzone-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--color-primary);
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(25, 56, 34, 0.18);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.dropzone-pill-btn:hover {
  background-color: #122b1a;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(25, 56, 34, 0.25);
}

.dropzone-pill-btn.btn-gallery-pill {
  background-color: #ffffff;
  color: var(--color-primary) !important;
  border-color: var(--color-primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.dropzone-pill-btn.btn-gallery-pill:hover {
  background-color: var(--color-olive-soft);
  color: var(--color-primary) !important;
}

.gallery-modal-card {
  max-width: 880px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow: hidden;
  background: #ffffff;
  border-radius: var(--radius-lg);
}

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

.gallery-modal-close-btn {
  font-size: 1.4rem;
  color: var(--color-text-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.gallery-modal-close-btn:hover {
  background: #f1f5f9;
  color: var(--color-text);
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.gallery-search-wrap {
  flex: 1;
  min-width: 220px;
}

.gallery-search-input {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  width: 100%;
}

.gallery-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.gallery-filter-pills .btn {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
}

.gallery-dropzone-banner {
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  text-align: center;
  background: #F8FAFC;
  color: var(--color-text);
  font-size: 0.82rem;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all var(--transition-fast);
}

.gallery-dropzone-banner:hover,
.gallery-dropzone-banner.dragover {
  border-color: var(--color-primary);
  background: #F0FDF4;
  color: var(--color-primary);
}

.gallery-grid-container {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.9rem;
  padding: 0.4rem 0.2rem 1rem;
  min-height: 240px;
  max-height: 380px;
}

.gallery-item-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.gallery-item-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.gallery-item-card.selected {
  border-color: #16A34A;
  background: #F0FDF4;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.gallery-item-thumb-box {
  width: 100%;
  height: 110px;
  background: #FAF8F5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.gallery-item-card:hover .gallery-item-thumb-box img {
  transform: scale(1.05);
}

.gallery-item-meta {
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-item-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-item-tag {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  text-transform: capitalize;
}

.gallery-check-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #16A34A;
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.gallery-item-card.selected .gallery-check-badge {
  display: flex;
}

.gallery-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.9rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.gallery-selection-preview {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gallery-sel-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.table-img-picker-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.table-img-picker-wrap:hover .table-img-badge {
  opacity: 1;
  transform: translateY(0);
}

.table-img-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(25, 56, 34, 0.92);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
  opacity: 0;
  transform: translateY(3px);
  transition: all var(--transition-fast);
  pointer-events: none;
}




