/* css/admin.css */

/* ==========================================================================
   Mobile-First Admin Base Styles (Default for Mobile)
   ========================================================================== */

.admin-body {
  background-color: #f7f9fa;
  min-height: 100vh;
  overflow-x: hidden;
}

.admin-header {
  background-color: var(--white);
  border-bottom: 2px solid var(--border-light);
  padding: var(--spacing-sm) 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-nav {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: var(--spacing-xs);
  align-items: center;
  width: 100%;
  flex-wrap: nowrap;
  overflow: visible;
}

.admin-title-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  width: auto;
  flex-shrink: 0;
}

.admin-badge {
  background-color: var(--primary-pale);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.admin-menu {
  display: flex;
  gap: 4px;
  list-style: none;
  width: auto;
  flex: 1;
  overflow: visible;
  padding-bottom: 0;
  margin: 0 var(--spacing-xs);
  flex-wrap: nowrap;
}

.admin-menu::-webkit-scrollbar {
  display: none;
}

.admin-menu li {
  flex-shrink: 0;
}

.admin-menu-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  transition: color 0.25s ease, background-color 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .admin-menu-link {
    font-size: 0;
    padding: 8px;
    gap: 0;
  }
  .admin-menu-link i {
    font-size: 14px;
  }
  .admin-badge {
    font-size: 10px;
    padding: 3px 7px;
  }
  .admin-logout-btn {
    font-size: 0 !important;
    padding: 6px;
  }
}

.admin-menu-link:hover, .admin-menu-link.active {
  color: var(--primary-dark);
  background-color: var(--bg-light);
}

.admin-logout-btn {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-weight: 700;
  font-size: 0 !important;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  justify-content: center;
  border: 1px solid var(--border-light);
  margin-top: 0;
  flex-shrink: 0;
}

.admin-logout-btn i {
  font-size: 14px !important;
  margin: 0 !important;
}

.admin-logout-btn:hover {
  background-color: #feebee;
}

/* Stats Dashboard */
.admin-main {
  padding: var(--spacing-md) 0 var(--spacing-2xl) 0;
  flex-grow: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.stats-grid > :nth-child(3) {
  grid-column: 1 / span 2;
}

.stat-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-title {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Content Panels */
.panel {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: var(--spacing-lg);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--spacing-sm);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tables styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.admin-table th {
  background-color: var(--bg-light);
  color: var(--text-secondary);
  padding: 8px 8px;
  font-weight: 700;
  border-bottom: 2px solid var(--border-light);
  font-size: 12px;
}

.admin-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 12px;
}

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

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

/* ===== Mobile Card View (default - mobile first) ===== */
.admin-cards-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.admin-card-mobile {
  background-color: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.admin-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.admin-card-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
}

.admin-card-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: left;
  flex: 1;
  word-break: break-word;
}

.admin-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.admin-card-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background-color: var(--bg-light);
}

.admin-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-actions {
  display: flex;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.admin-card-actions .btn-icon {
  flex: 1;
  height: 36px;
  width: auto;
  border-radius: var(--radius-md);
  font-size: 13px;
  gap: 4px;
}

.admin-card-actions .btn-icon span.btn-text {
  display: inline;
}

.admin-card-actions .btn-icon i {
  font-size: 13px;
}

.admin-table-view {
  display: none;
}

/* Badges for table */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: bold;
}

.status-pending {
  background-color: #fff3e0;
  color: var(--warning);
}

.status-confirmed {
  background-color: #e8f5e9;
  color: var(--success);
}

.status-cancelled {
  background-color: #ffebee;
  color: var(--error);
}

.status-shipped {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.status-delivered {
  background-color: #e0f2f1;
  color: #00695c;
}

/* Dashboard Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.charts-grid-single {
  margin-bottom: var(--spacing-md);
}

.chart-panel {
  padding: 0;
}

.chart-panel .panel-header {
  padding: var(--spacing-md) var(--spacing-lg);
  margin: 0;
  border-bottom: 1px solid var(--border-light);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
  padding: var(--spacing-md);
}

@media (min-width: 768px) {
  .charts-grid {
    grid-template-columns: 2fr 1fr;
  }

  .chart-wrapper {
    height: 320px;
  }
}

@media (min-width: 1024px) {
  .chart-wrapper {
    height: 360px;
  }
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  font-size: 14px;
  flex-direction: column;
  gap: 8px;
}

.chart-empty i {
  font-size: 32px;
  opacity: 0.3;
}

/* ===== Admin Header Layout ===== */
.admin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-title-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Notification Bell ===== */
.notification-bell-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.notification-bell-btn {
  position: relative;
  width: 42px;
  height: 42px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.notification-bell-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
  transform: scale(1.05);
}

.notification-bell-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--error);
  color: #fff;
  border: 2px solid var(--white);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notification-bell-pulse {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: var(--error);
  opacity: 0.4;
  animation: notificationPulse 1.5s ease-out infinite;
  pointer-events: none;
}

@keyframes notificationPulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.8); opacity: 0; }
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 30px);
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1200;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.notification-dropdown.show {
  opacity: 1;
  transform: translateY(0);
}

.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-light);
}

.notification-dropdown-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.notification-mark-read {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.notification-mark-read:hover {
  background: var(--primary-light);
}

.notification-dropdown-body {
  max-height: 360px;
  overflow-y: auto;
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  gap: 8px;
}

.notification-empty i {
  font-size: 32px;
  opacity: 0.3;
}

.notification-empty span {
  font-size: 13px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  transition: background 0.15s ease;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--bg-light);
}

.notification-item.unseen {
  background: rgba(233, 30, 99, 0.04);
}

.notification-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.notification-item.unseen .notification-item-icon {
  background: var(--primary);
  color: #fff;
}

.notification-item-body {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.notification-item-title strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  flex-shrink: 0;
}

.notification-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.notification-item-dot {
  position: absolute;
  top: 14px;
  left: 6px;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.notification-dropdown-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-light);
  text-align: center;
}

.notification-dropdown-footer a {
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.notification-dropdown-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .notification-dropdown {
    width: calc(100vw - 20px);
    left: -10px;
  }
}

/* ===== Product Gallery Admin (3 image slots) ===== */
.product-gallery-admin {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.gallery-slot {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-light);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-slot:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.gallery-slot.has-image {
  border-style: solid;
  border-color: var(--primary);
  background: var(--white);
}

.gallery-slot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 8px;
  pointer-events: none;
}

.gallery-slot-empty i {
  font-size: 22px;
  color: var(--primary);
}

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

.gallery-slot-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  background: var(--error);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  font-family: inherit;
}

.gallery-slot-remove:hover {
  background: #b71c1c;
  transform: scale(1.1);
}

@media (min-width: 768px) {
  .product-gallery-admin {
    gap: 10px;
  }
  .gallery-slot-empty i {
    font-size: 28px;
  }
}

/* Order Filter Bar */
.order-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--spacing-md);
  padding: 10px;
  background: var(--bg-light);
  border-radius: var(--radius-md);
}

.order-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.order-filter-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.order-filter-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.order-filter-btn i {
  font-size: 12px;
}

.order-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.order-filter-btn.active .order-filter-count {
  background: rgba(255, 255, 255, 0.25);
}

/* Order Status Actions in Details Modal */
.order-status-actions {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-light);
}

.order-status-actions-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.order-status-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-status-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.order-status-action-btn:hover:not(:disabled) {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.order-status-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bg-light);
}

.order-status-action-btn.current {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* Table Operations Buttons */
.actions-cell {
  display: flex;
  gap: 4px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background-color: var(--white);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  font-size: 14px;
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background-color: var(--bg-light);
}

.btn-icon-danger:hover {
  border-color: var(--error);
  color: var(--error);
  background-color: #feebee;
}

/* Modals */
.admin-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(51, 51, 51, 0.3);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  animation: fadeIn 0.25s ease;
  padding: 15px;
}

.admin-modal {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  margin-bottom: 80px;
}

.admin-modal-header {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

.admin-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
}

.admin-modal-close:hover {
  color: var(--error);
}

.admin-modal-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
}

.admin-modal-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: var(--spacing-sm);
  justify-content: flex-end;
  background-color: var(--bg-light);
  flex-wrap: wrap;
}

/* Form Styles */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  font-size: 13px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-row .form-group {
  width: 100%;
}

/* Upload Area */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  background-color: var(--bg-light);
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
}

.upload-area:hover {
  border-color: var(--primary);
  background-color: var(--white);
  color: var(--primary-dark);
  box-shadow: 0 0 0 4px rgba(255,105,180,0.1);
}

.upload-area:active {
  transform: scale(0.98);
}

.upload-area i {
  font-size: 28px;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.upload-area:hover i {
  transform: translateY(-3px);
}

.upload-area.has-file {
  border-color: var(--success);
  background-color: #F0FFF0;
  color: var(--success);
}

.upload-area.has-file i {
  color: var(--success);
}

/* Image Selection */
.image-options {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: 4px;
}

.image-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  margin-top: var(--spacing-xs);
  background-color: var(--bg-light);
  display: none;
}

.image-preview.active {
  display: block;
}

/* Details list for modals */
.details-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
}

.details-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 13px;
}

.details-label {
  font-weight: bold;
  color: var(--text-secondary);
}

.details-value {
  color: var(--text-primary);
}

.details-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--spacing-xs);
}

.details-items-table th {
  padding: 6px;
  background-color: var(--bg-light);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}

.details-items-table td {
  padding: 6px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}

#dashboardSplit {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

/* ==========================================================================
   Responsive Scaling (Media Queries for larger screens)
   ========================================================================== */

@media (min-width: 768px) {
  .admin-nav {
    flex-direction: row;
    justify-content: space-between;
  }

  .admin-title-wrapper {
    width: auto;
  }

  .admin-menu {
    width: auto;
    overflow-x: visible;
  }

  .admin-menu-link {
    font-size: 14px;
    padding: 8px 12px;
    gap: 6px;
  }

  .admin-logout-btn {
    width: auto;
    height: auto;
    border-radius: var(--radius-md);
    border: none;
    font-size: 13px !important;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .admin-logout-btn i {
    font-size: 13px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .stats-grid > :nth-child(3) {
    grid-column: auto;
  }

  .stat-card {
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
  }

  .stat-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .stat-value {
    font-size: 26px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .admin-badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .panel-title {
    font-size: 16px;
  }

  .form-row {
    flex-direction: row;
    gap: var(--spacing-md);
  }

  .panel {
    padding: var(--spacing-lg);
  }

  /* On tablet+ show tables, hide cards */
  .admin-table-view {
    display: block;
  }

  .admin-cards-view {
    display: none;
  }

  .admin-card-actions .btn-icon {
    flex: 0 0 32px;
    height: 32px;
    width: 32px;
    padding: 0;
  }

  .admin-card-actions .btn-icon span.btn-text {
    display: none;
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  #dashboardSplit {
    flex-direction: row;
    align-items: flex-start;
  }

  #dashboardSplit > :first-child {
    flex: 3;
  }

  #dashboardSplit > :last-child {
    flex: 1;
  }
}

@media (min-width: 1200px) {
  .stats-grid {
    gap: var(--spacing-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Admin Bottom Navigation
   ========================================================================== */
body.has-admin-bottom-nav {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
}

.admin-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background-color: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.admin-bottom-nav .bottom-nav-item {
  min-height: 64px;
}

.admin-bottom-nav .bottom-nav-item i {
  font-size: 19px;
}

.admin-bottom-nav .bottom-nav-item span:not(.bottom-nav-badge) {
  font-size: 10px;
}

/* Admin More Action Sheet */
.admin-more-sheet {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.admin-more-sheet.show {
  display: flex;
}

.admin-more-sheet-content {
  background-color: var(--white);
  width: 100%;
  max-width: 500px;
  border-radius: 20px 20px 0 0;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0));
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 80vh;
  overflow-y: auto;
}

.admin-more-sheet-handle {
  width: 40px;
  height: 4px;
  background-color: var(--border);
  border-radius: 4px;
  margin: 0 auto 14px;
}

.admin-more-sheet-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-light);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  transition: background-color 0.15s ease;
}

.admin-more-sheet-item:last-of-type {
  border-bottom: none;
}

.admin-more-sheet-item:active {
  background-color: var(--bg-light);
}

.admin-more-sheet-item i {
  font-size: 18px;
  color: var(--primary-dark);
  width: 24px;
  text-align: center;
}

.admin-more-sheet-logout {
  color: var(--error);
}

.admin-more-sheet-logout i {
  color: var(--error);
}

.admin-more-sheet-cancel {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  background-color: var(--bg-light);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease;
}

.admin-more-sheet-cancel:active {
  background-color: var(--border-light);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Hide bottom nav when modal is open */
body.modal-open .admin-bottom-nav {
  display: none;
}

body.modal-open {
  padding-bottom: 0 !important;
}

/* Logo card (in admin dashboard) */
.logo-admin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.logo-admin-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  background-color: var(--bg-light);
  box-shadow: var(--shadow-sm);
}

.logo-admin-preview.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 36px;
  background-color: var(--bg-light);
}

.logo-admin-upload-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  background-color: var(--bg-light);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.logo-admin-upload-area:hover {
  border-color: var(--primary);
  background-color: var(--primary-pale);
}

.logo-admin-upload-area i {
  font-size: 24px;
  color: var(--primary);
}

.logo-admin-upload-area span {
  font-size: 13px;
  color: var(--text-secondary);
}
