/* ==========================================================================
   SkyGarden - Chef & Admin Panel CSS
   Optimized for Kitchen Tablets, Mobile Phones & Desktops
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. PIN Login Screen
   -------------------------------------------------------------------------- */
.admin-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pin-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: start;
}

.pin-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-gold);
}

.pin-field {
  width: 100%;
  height: 52px;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 22px;
  text-align: center;
  letter-spacing: 0.3em;
  outline: none;
  transition: all var(--transition-fast);
}

.pin-field:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
  background: var(--bg-main);
}

.login-submit-btn {
  height: 50px;
  border-radius: var(--radius-pill);
  background: var(--gold-gradient);
  color: #1a1505;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-gold);
}

.login-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   2. Main Dashboard Layout
   -------------------------------------------------------------------------- */
.admin-app-container {
  max-width: 900px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 80px;
  position: relative;
  z-index: 10;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 68px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-brand-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-header-title {
  font-size: 16px;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
}

.admin-status-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 480px) {
  .btn-text-desktop {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   3. Stats Cards Bar
   -------------------------------------------------------------------------- */
.admin-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.stat-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
}

.stat-num.stat-green {
  color: var(--emerald-accent);
}

.stat-num.stat-red {
  color: var(--ruby-accent);
}

.stat-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   4. Toolbar & Search
   -------------------------------------------------------------------------- */
.admin-toolbar {
  padding: 0 16px 12px 16px;
  display: flex;
  gap: 10px;
}

.admin-search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.add-dish-primary-btn {
  height: 46px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  background: var(--gold-gradient);
  color: #1a1505;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-gold);
}

.admin-category-nav {
  padding: 0 16px 12px 16px;
}

/* --------------------------------------------------------------------------
   5. Admin Dish Cards
   -------------------------------------------------------------------------- */
.admin-dishes-container {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-dish-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: all var(--transition-fast);
}

.admin-dish-card.sold-out {
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.04);
}

.admin-dish-thumb-box {
  width: 75px;
  height: 75px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: var(--bg-surface-elevated);
}

.admin-dish-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sold-out-overlay {
  position: absolute;
  inset: 0;
  background: rgba(244, 63, 94, 0.75);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.admin-dish-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-dish-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-dish-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-dish-category-label {
  font-size: 11px;
  color: var(--text-muted);
}

.admin-dish-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.inline-price-input {
  width: 120px;
  height: 32px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-gold);
  font-size: 13px;
  font-weight: 700;
  padding: 0 8px;
  text-align: start;
}

.inline-price-input:focus {
  border-color: var(--gold-primary);
  background: var(--bg-main);
}

.admin-dish-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Toggle Switch */
.availability-switch-btn {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.availability-switch-btn.available {
  background: var(--emerald-glass);
  color: var(--emerald-accent);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.availability-switch-btn.unavailable {
  background: rgba(244, 63, 94, 0.15);
  color: var(--ruby-accent);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.edit-dish-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-dish-icon-btn:hover {
  border-color: var(--border-highlight);
  color: var(--text-gold);
}

/* --------------------------------------------------------------------------
   6. Editor Modal Sheet & Form
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.dish-editor-sheet {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .dish-editor-sheet {
    border-radius: var(--radius-xl);
  }
}

.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-main);
  border-color: var(--border-highlight);
  color: var(--text-gold);
}

.editor-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.editor-form-scroll {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 580px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
  background: var(--bg-main);
}

.image-upload-preview-box {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

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

.image-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-btn-label {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.upload-btn-label:hover {
  background: var(--gold-gradient-soft);
  border-color: var(--border-highlight);
  color: var(--text-gold);
}

.checkbox-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label input {
  accent-color: var(--gold-primary);
  width: 16px;
  height: 16px;
}

.editor-footer-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.save-dish-btn {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-pill);
  background: var(--gold-gradient);
  color: #1a1505;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-gold);
}

.delete-dish-btn {
  height: 48px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #f43f5e;
  font-size: 13px;
  font-weight: 700;
}
