/**
 * ============================================================================
 * THE POINTE CAFE — STAFF MENU MANAGER STYLES (admin.css)
 * ============================================================================
 */

:root {
  --admin-bg: #F4F6F9;
  --admin-card: #FFFFFF;
  --admin-border: #E2E8F0;
  --admin-navy: #001641;
  --admin-gold: #D4AF37;
  --admin-gold-hover: #E5C158;
  --admin-text: #1E293B;
  --admin-muted: #64748B;
  --admin-radius: 12px;
}

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.admin-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Admin Header ───────────────────────────────────────────── */
.admin-header {
  background: var(--admin-navy);
  color: #fff;
  border-bottom: 2px solid var(--admin-gold);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-brand .brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--admin-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

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

/* ── PIN Gate Modal ─────────────────────────────────────────── */
.pin-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 22, 65, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.pin-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: pinPop 240ms ease-out;
}

@keyframes pinPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.pin-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--admin-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.pin-card h2 {
  font-family: var(--font-display);
  color: var(--admin-navy);
  font-size: 1.4rem;
  margin: 0 0 8px;
}

.pin-card p {
  color: var(--admin-muted);
  font-size: 0.88rem;
  margin: 0 0 24px;
}

.pin-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--admin-border);
  border-radius: 10px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.pin-input-wrap input:focus {
  border-color: var(--admin-gold);
  outline: none;
}

.pin-hint {
  font-size: 0.78rem;
  color: #94A3B8;
  margin-top: 14px;
}

/* ── Main Content ───────────────────────────────────────────── */
.admin-main {
  padding: 32px 0 64px;
}

.admin-banner {
  background: linear-gradient(135deg, var(--admin-navy) 0%, #002878 100%);
  color: #fff;
  border-radius: var(--admin-radius);
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.admin-banner h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 6px;
}

.admin-banner p {
  margin: 0;
  color: #CBD5E1;
  font-size: 0.92rem;
}

.banner-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ── Grid Layout ────────────────────────────────────────────── */
.admin-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 32px;
}

@media (max-width: 992px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.admin-card {
  background: var(--admin-card);
  border-radius: var(--admin-radius);
  border: 1px solid var(--admin-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 24px;
}

/* ── Form Mode Switcher Tabs ─────────────────────────────────── */
.form-mode-tabs {
  display: flex;
  background: #F1F5F9;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--admin-border);
}

.form-mode-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.form-mode-btn:hover {
  color: var(--admin-navy);
}

.form-mode-btn.active {
  background: #fff;
  color: var(--admin-navy);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ── Existing Item Picker Dropdown ──────────────────────────── */
.existing-picker-wrap {
  background: #FFFDF5;
  border: 1.5px solid var(--admin-gold);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 22px;
  animation: fadeInBanner 0.2s ease-out;
}

.existing-picker-wrap label {
  font-weight: 800;
  color: var(--admin-navy);
  margin-bottom: 8px;
  display: block;
}

.choose-item-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--admin-navy);
  background: #fff;
  transition: all 0.2s;
  cursor: pointer;
}

.choose-item-select:focus {
  border-color: var(--admin-gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.card-header {
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 4px;
  color: var(--admin-navy);
}

.card-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--admin-muted);
}

/* ── Form Controls ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--admin-navy);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-group .req {
  color: #DC2626;
}

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

.price-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 14px;
  font-weight: 700;
  color: var(--admin-muted);
}

.price-input-wrap input {
  padding-left: 28px !important;
}

input[type="text"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid var(--admin-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--admin-text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--admin-navy);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 22, 65, 0.1);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--admin-muted);
  margin: 0 0 10px;
}

/* ── Radio Chips ────────────────────────────────────────────── */
.radio-chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #F8FAFC;
  border: 1.5px solid var(--admin-border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--admin-text);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.radio-chip input {
  display: none;
}

.radio-chip:hover {
  border-color: #CBD5E1;
  background: #F1F5F9;
}

.radio-chip.active {
  background: var(--admin-navy);
  color: #fff;
  border-color: var(--admin-navy);
}

/* ── Preset Image Gallery ───────────────────────────────────── */
.preset-images-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .preset-images-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.preset-img-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  background: #F8FAFC;
  border: 2px solid var(--admin-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.preset-img-btn img {
  width: 100%;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 4px;
}

.preset-img-btn span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--admin-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.preset-img-btn:hover {
  border-color: #94A3B8;
  transform: translateY(-1px);
}

.preset-img-btn.active {
  border-color: var(--admin-gold);
  background: rgba(212, 175, 55, 0.1);
}

.custom-url-details {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--admin-muted);
}

.custom-url-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── Live Preview Styles ────────────────────────────────────── */
.preview-card {
  position: sticky;
  top: 96px;
}

.preview-block {
  margin-bottom: 24px;
}

.preview-mode-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-gold);
  background: rgba(0, 22, 65, 0.9);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.preview-card-wrap {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  padding: 16px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
}

.preview-card-wrap .menu-card {
  max-width: 320px;
  width: 100%;
  margin: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.preview-board-wrap {
  background: #111827;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid #374151;
}

.preview-board-wrap .board-item-row {
  margin: 0;
}

.preview-board-wrap .board-item-name {
  color: #fff;
}

.preview-board-wrap .board-item-desc {
  color: #9CA3AF;
}

.preview-board-wrap .board-item-dots {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.preview-board-wrap .board-item-price {
  color: var(--gold);
}

/* ── Active Items Section ───────────────────────────────────── */
.active-items-section {
  margin-top: 16px;
}

.items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Edit Banner */
.edit-banner {
  background: linear-gradient(135deg, #1E293B 0%, var(--admin-navy) 100%);
  border: 1px solid var(--admin-gold);
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  animation: fadeInBanner 0.25s ease-out;
}

@keyframes fadeInBanner {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.edit-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-banner-badge {
  background: var(--admin-gold);
  color: var(--admin-navy);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.edit-banner-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Dynamic New Category Input */
.new-category-wrap {
  background: #F8FAFC;
  border: 1px dashed var(--admin-gold);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 10px;
  animation: fadeInBanner 0.2s ease-out;
}

/* Items Toolbar */
.items-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-border);
}

.search-input-wrap {
  position: relative;
  flex-grow: 1;
  max-width: 380px;
  min-width: 240px;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-muted);
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  font-size: 0.88rem;
  transition: all 0.2s;
  background: #fff;
}

.search-input-wrap input:focus {
  border-color: var(--admin-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
  outline: none;
}

.admin-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-tab {
  background: #F1F5F9;
  border: 1px solid transparent;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.admin-tab:hover {
  background: #E2E8F0;
  color: #1E293B;
}

.admin-tab.active {
  background: var(--admin-navy);
  color: #fff;
  border-color: var(--admin-navy);
}

.active-items-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.active-item-card {
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  position: relative;
}

.active-item-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: #CBD5E1;
}

.active-item-card.is-editing {
  border-color: var(--admin-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
  background: #FFFDF5;
}

.active-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #E2E8F0;
}

.active-item-info {
  flex-grow: 1;
  min-width: 0;
}

.active-item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.active-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #0F172A;
}

.active-item-origin-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.origin-custom {
  background: #FEF3C7;
  color: #92400E;
}

.origin-core {
  background: #F1F5F9;
  color: #475569;
}

.active-item-meta {
  font-size: 0.78rem;
  color: var(--admin-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.active-item-price {
  font-weight: 700;
  color: var(--admin-navy);
}

.active-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-edit-item {
  background: #F8FAFC;
  color: var(--admin-navy);
  border: 1px solid #CBD5E1;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-edit-item:hover {
  background: var(--admin-navy);
  color: #fff;
  border-color: var(--admin-navy);
}

.btn-delete-item {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-delete-item:hover {
  background: #DC2626;
  color: #fff;
  border-color: #DC2626;
}

.no-items-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 20px;
  color: var(--admin-muted);
  font-size: 0.9rem;
  background: #F8FAFC;
  border-radius: 8px;
  border: 1px dashed var(--admin-border);
}

/* ── Toast Notifications ────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--admin-navy);
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  border-left: 4px solid var(--admin-gold);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.24s ease;
}

.admin-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
