/* ===========================
   ADMIN DESIGN TOKENS
=========================== */
:root {
  --primary: #C8502A;
  --primary-dark: #A83E1F;
  --accent: #F5A623;
  --bg: #F7F4F0;
  --bg-card: #FFFFFF;
  --text: #2C1A0E;
  --text-muted: #7A6355;
  --text-light: #B09880;
  --border: #E8DDD4;
  --danger: #E53935;
  --danger-light: #FFEBEE;
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --divider-bg: #FFF8F0;
  --divider-border: #F5E0CC;
  --shadow-sm: 0 2px 8px rgba(44,26,14,0.07);
  --shadow-md: 0 6px 24px rgba(44,26,14,0.11);
  --shadow-lg: 0 16px 48px rgba(44,26,14,0.16);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===========================
   LOGIN SCREEN
=========================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #FDF8F3 0%, #F9EDE0 50%, #F5E0CC 100%);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '🍲';
  position: absolute;
  font-size: 200px;
  opacity: 0.04;
  top: -40px;
  right: -40px;
  pointer-events: none;
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  font-size: 3.5rem;
  margin-bottom: 20px;
  line-height: 1;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 6px;
}
.login-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}
.login-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 14px;
  text-align: center;
  letter-spacing: 0.15em;
}
.login-input:focus { border-color: var(--primary); background: white; }
.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
}
.login-btn:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 20px;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-8px); }
  75%      { transform: translateX(8px); }
}
.login-back {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color var(--transition);
}
.login-back:hover { color: var(--primary); }

/* ===========================
   ADMIN WRAPPER
=========================== */
.admin-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===========================
   HEADER
=========================== */
.adm-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.adm-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.adm-header__icon { font-size: 2rem; line-height: 1; }
.adm-header__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
  line-height: 1.2;
}
.adm-header__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.adm-header__actions { display: flex; gap: 10px; }

/* ===========================
   ADMIN TABS
=========================== */
.adm-tabs {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 28px;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.adm-tab {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
}
.adm-tab:hover { color: var(--text); }
.adm-tab--active { color: var(--primary); border-bottom-color: var(--primary); }
.adm-tab__count {
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  padding: 0 6px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
}

/* ===========================
   BUTTONS
=========================== */
.adm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.adm-btn--primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 3px 12px rgba(200,80,42,0.3);
}
.adm-btn--primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,80,42,0.4); }
.adm-btn--secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
}
.adm-btn--secondary:hover { border-color: var(--primary); color: var(--primary); }
.adm-btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.adm-btn--ghost:hover { border-color: var(--text-muted); color: var(--text); }
.adm-btn--red { color: var(--danger) !important; }
.adm-btn--red:hover { border-color: var(--danger) !important; background: var(--danger-light) !important; }
.adm-btn--save {
  background: var(--success);
  color: white;
  padding: 12px 32px;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(46,125,50,0.3);
}
.adm-btn--save:hover { background: #1B5E20; transform: translateY(-1px); }

/* ===========================
   MAIN
=========================== */
.adm-main {
  flex: 1;
  padding: 32px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.adm-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.adm-page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 4px;
}
.adm-page-sub { font-size: 0.88rem; color: var(--text-muted); }
.adm-toolbar__btns { display: flex; gap: 10px; }

/* ===========================
   ORDERS
=========================== */
.adm-toolbar--orders { align-items: center; }
.adm-refresh-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: white;
  font-size: 1.25rem;
}
.adm-refresh-btn:hover { border-color: var(--primary); color: var(--primary); }
.adm-refresh-btn[disabled] { opacity: 0.5; cursor: wait; }
.adm-orders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.adm-orders-empty {
  padding: 64px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text-muted);
  text-align: center;
}
.adm-orders-empty--error { color: var(--danger); }
.adm-order {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.adm-order__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #FAFAF8;
}
.adm-order__header > div { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.adm-order__number { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.adm-order__date { font-size: 0.78rem; color: var(--text-light); }
.adm-order__total { color: var(--primary); font-size: 1.08rem; white-space: nowrap; }
.adm-order__customer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.adm-order__customer > div { display: flex; flex-direction: column; min-width: 0; }
.adm-order__address { grid-column: 1 / -1; }
.adm-order__customer strong,
.adm-order__customer a {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.adm-order__customer a:hover { color: var(--primary); }
.adm-order__label {
  display: block;
  margin-bottom: 3px;
  color: var(--text-light);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.adm-order__items { padding: 10px 20px; }
.adm-order__item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  color: var(--text-muted);
  font-size: 0.84rem;
}
.adm-order__item strong { color: var(--text); white-space: nowrap; }
.adm-order__comment {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--divider-bg);
}
.adm-order__comment p { color: var(--text-muted); font-size: 0.84rem; overflow-wrap: anywhere; }

/* ===========================
   MENU LIST
=========================== */
.adm-list-wrap {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.adm-list { display: flex; flex-direction: column; }

.adm-list-empty {
  padding: 60px;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}
.adm-list-empty span { font-size: 3rem; opacity: 0.4; }
.adm-list-empty p { font-size: 1rem; }

/* List items */
.adm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  gap: 12px;
}
.adm-item:last-child { border-bottom: none; }
.adm-item:hover { background: #FAFAF8; }

.adm-item--divider {
  background: var(--divider-bg);
  border-bottom: 1px solid var(--divider-border);
}
.adm-item--divider:hover { background: #FFF3E8; }

.adm-item__left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

/* Move buttons */
.adm-item__move {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.adm-move-btn {
  width: 26px;
  height: 22px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}
.adm-move-btn:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); background: rgba(200,80,42,0.06); }
.adm-move-btn[disabled] { opacity: 0.3; cursor: not-allowed; }

/* Divider item */
.adm-item__divider-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: rgba(200,80,42,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.adm-item__divider-label {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Dish item */
.adm-item__emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 46px;
  text-align: center;
}
.adm-item__photo {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.adm-item__info { flex: 1; min-width: 0; }
.adm-item__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-item__meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-item__price { color: var(--primary); font-weight: 600; }
.adm-item__weight { color: var(--text-light); }
.adm-item__desc { color: var(--text-light); }

/* Action buttons */
.adm-item__actions { display: flex; gap: 6px; flex-shrink: 0; }
.adm-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  background: transparent;
}
.adm-action-btn--edit { color: var(--text-muted); }
.adm-action-btn--edit:hover { background: #EEF2FF; color: #3949AB; }
.adm-action-btn--del  { color: var(--text-light); }
.adm-action-btn--del:hover  { background: var(--danger-light); color: var(--danger); }

/* ===========================
   SAVE BAR
=========================== */
.adm-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ===========================
   MODAL
=========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.adm-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -60%);
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: var(--radius-lg);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-lg);
}
.adm-modal.active {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%);
}

.adm-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.adm-modal__title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--text);
}
.adm-modal__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.adm-modal__close:hover { background: var(--danger-light); color: var(--danger); }

form { padding: 24px 28px; }

.adm-form-group { margin-bottom: 18px; }
.adm-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.adm-optional { color: var(--text-light); font-weight: 400; }
.adm-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: border-color var(--transition);
}
.adm-input:focus { border-color: var(--primary); }
.adm-input--emoji {
  width: 72px;
  text-align: center;
  font-size: 1.4rem;
  padding: 8px;
  margin-right: 12px;
}
.adm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.adm-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 8px;
}

/* Dish photo */
.adm-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.adm-photo-picker {
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 150px;
  max-height: 220px;
  display: block;
  overflow: hidden;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.adm-photo-picker:hover {
  border-color: var(--primary);
  background: rgba(200,80,42,0.05);
}
.adm-photo-input:focus + .adm-photo-picker {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200,80,42,0.12);
}
.adm-photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.adm-photo-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.adm-photo-empty__icon { font-size: 2rem; }
.adm-photo-actions {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.adm-photo-actions .adm-hint { margin-top: 0; }
.adm-photo-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 0;
  cursor: pointer;
  white-space: nowrap;
}
.adm-photo-remove:hover { text-decoration: underline; }

/* Emoji picker */
.emoji-row { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px; }
.emoji-picks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.emoji-group { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.emoji-group__label {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-right: 2px;
  white-space: nowrap;
  min-width: 50px;
}
.emoji-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  width: 32px; height: 32px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.emoji-btn:hover { border-color: var(--primary); background: rgba(200,80,42,0.08); transform: scale(1.15); }

.adm-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ===========================
   TOAST
=========================== */
.adm-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1A1A1A;
  color: white;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.adm-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===========================
   SCROLLBAR
=========================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 600px) {
  .adm-main { padding: 20px 16px; }
  .adm-header { padding: 0 16px; }
  .adm-toolbar { flex-direction: column; align-items: flex-start; }
  .adm-form-row { grid-template-columns: 1fr; }
  .adm-save-bar { flex-direction: column-reverse; }
  .adm-btn--save { width: 100%; justify-content: center; }
  .adm-item__desc { display: none; }
  form { padding: 20px; }
  .adm-tabs { justify-content: flex-start; gap: 24px; padding: 0 16px; }
  .adm-order__header { align-items: flex-start; padding: 14px 16px; }
  .adm-order__header > div { flex-direction: column; gap: 2px; }
  .adm-order__customer { grid-template-columns: 1fr; gap: 12px; padding: 14px 16px; }
  .adm-order__items { padding: 8px 16px; }
  .adm-order__item { align-items: flex-start; }
  .adm-order__item span { overflow-wrap: anywhere; }
  .adm-order__comment { padding: 12px 16px 14px; }
}
