/* ===================================================================
   استایل پنل مدیریت (ورود + داشبورد سفارش‌ها)
   =================================================================== */

/* ---------- صفحه ورود ---------- */
.admin-login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--espresso); padding: 24px;
}
.login-card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 32px; max-width: 380px; width: 100%; text-align: center;
}
.login-logo { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 24px; }
.login-error {
  background: #F6DEDE; color: #A23131; padding: 10px 14px; border-radius: 10px;
  font-size: 0.9rem; margin-bottom: 16px; font-weight: 700;
}
.login-form { display: flex; flex-direction: column; gap: 16px; text-align: right; }
.login-form label { font-weight: 700; font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }
.login-form input {
  font-family: inherit; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--espresso);
  font-size: 1rem;
}
.login-form .btn { border: none; cursor: pointer; margin-top: 8px; font-size: 1rem; }

/* ---------- چیدمان کلی پنل ---------- */
.admin-page { background: var(--cream); min-height: 100vh; }
.admin-header { background: var(--espresso); color: var(--cream); }
.admin-header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.admin-header .brand-name { color: var(--cream); }
.admin-header .brand-logo { width: 38px; height: 38px; }

.admin-nav { display: flex; align-items: center; gap: 20px; }
.admin-nav a { font-weight: 700; color: rgba(246,241,228,0.8); }
.admin-nav a.active, .admin-nav a:hover { color: var(--copper); }
.admin-user { font-size: 0.9rem; color: rgba(246,241,228,0.7); }
.logout-form { margin: 0; }
.logout-btn {
  background: none; border: 1.5px solid rgba(246,241,228,0.4); color: var(--cream);
  padding: 6px 16px; border-radius: 999px; cursor: pointer; font-family: inherit; font-weight: 700;
}
.logout-btn:hover { border-color: var(--copper); color: var(--copper); }

.admin-main { padding: 32px 24px; max-width: 1200px; }
.admin-main-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-main-header-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.sound-toggle-btn {
  font-family: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--ink-muted);
  background: var(--paper); color: var(--ink-muted); transition: all .15s ease;
}
.sound-toggle-btn[data-enabled="true"] {
  border-color: var(--leaf); color: var(--leaf); background: #E4EEDD;
}
.sound-toggle-btn:hover { border-color: var(--copper); }

.alert-interval-form {
  display: flex; align-items: center; gap: 8px; margin: 0;
  background: var(--paper); border-radius: 999px; padding: 6px 14px; box-shadow: var(--shadow);
}
.alert-interval-form label { font-size: 0.8rem; font-weight: 700; color: var(--ink-muted); white-space: nowrap; }
.alert-interval-form select {
  font-family: inherit; font-weight: 700; font-size: 0.85rem; border: none; background: transparent;
  color: var(--espresso); cursor: pointer;
}
.alert-interval-form select:focus { outline: none; }

.live-dot {
  display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 700; color: var(--leaf);
}
.live-dot span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--leaf);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(107,115,80,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(107,115,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(107,115,80,0); }
}

/* ---------- کارت‌های سفارش ---------- */
.orders-board {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px;
}
.order-card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; border-right: 6px solid var(--ink-muted);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease;
}
.order-card.status-pending { border-right-color: #B5793A; }
.order-card.status-preparing { border-right-color: var(--copper); }
.order-card.status-ready { border-right-color: var(--leaf); }
.order-card.status-delivered { border-right-color: #999; opacity: 0.6; }
.order-card.status-cancelled { border-right-color: #B23A3A; opacity: 0.6; }
.order-card.just-updated { animation: flash 1s ease; }
@keyframes flash { 0% { transform: scale(1.03); } 100% { transform: scale(1); } }

.order-card-header { display: flex; align-items: center; justify-content: space-between; }
.order-table { font-weight: 900; font-size: 1.15rem; }
.order-time { font-size: 0.8rem; color: var(--ink-muted); }

.order-card-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.order-card-items li { font-size: 0.92rem; }

.order-card-note { font-style: italic; color: var(--ink-muted); font-size: 0.85rem; }
.order-card-total { font-weight: 700; color: var(--copper-dark); margin-top: auto; }

.status-select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--espresso);
  font-family: inherit; font-weight: 700; background: var(--cream); cursor: pointer;
}

/* ===================================================================
   فرم‌های مدیریت محتوا / وبلاگ / منو / میزها
   =================================================================== */

.save-banner {
  background: #E4EEDD; color: var(--leaf); font-weight: 700;
  padding: 12px 18px; border-radius: 10px; margin-bottom: 20px;
}

.admin-form { max-width: 720px; display: flex; flex-direction: column; gap: 24px; }

.form-section {
  background: var(--paper); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.form-section h2 { font-size: 1.05rem; margin: 0 0 4px; }

.admin-form label, .form-section label {
  display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.9rem;
}
.admin-form input[type="text"],
.admin-form input[type="number"],
.admin-form textarea,
.form-section input[type="text"],
.form-section input[type="number"],
.form-section textarea {
  font-family: inherit; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #D8CFB8;
  background: var(--cream); font-size: 0.95rem; resize: vertical; font-weight: 400;
}
.admin-form input[type="file"], .form-section input[type="file"] { font-family: inherit; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 0.82rem; color: var(--ink-muted); margin: 0; }

.current-image-preview {
  width: 160px; height: 100px; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow);
}

.checkbox-field { flex-direction: row !important; align-items: center; gap: 8px !important; cursor: pointer; }
.checkbox-field input { width: 18px; height: 18px; }

.save-btn { align-self: flex-start; border: none; cursor: pointer; padding: 12px 32px; font-size: 1rem; }

.back-link { color: var(--copper-dark); font-weight: 700; display: inline-block; margin-bottom: 12px; }

/* ---------- جدول‌های مدیریتی ---------- */
.admin-table-wrap {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow-x: auto; margin-bottom: 20px;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid #EDE6D3; }
.admin-table th { font-size: 0.82rem; color: var(--ink-muted); font-weight: 700; }
.admin-table tr:last-child td { border-bottom: none; }

.table-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge-green { background: #E4EEDD; color: var(--leaf); }
.badge-gray { background: #EAE5D8; color: var(--ink-muted); }

.table-actions { display: flex; gap: 14px; align-items: center; }
.link-edit { color: var(--copper-dark); font-weight: 700; cursor: pointer; background: none; border: none; font-family: inherit; font-size: 0.9rem; }
.link-delete { color: #B23A3A; font-weight: 700; cursor: pointer; background: none; border: none; font-family: inherit; font-size: 0.9rem; }
.inline-form { margin: 0; display: inline; }
.inline-form-row { display: flex; gap: 10px; max-width: 420px; }
.inline-form-row input { flex: 1; font-family: inherit; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #D8CFB8; }

/* ---------- بخش مدیریت منو ---------- */
.menu-admin-category { margin-bottom: 32px; }
.menu-admin-category-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 10px;
}
.menu-admin-category-header h2 { flex: 1; margin: 0; font-size: 1.1rem; }

.quick-name-en-form { margin: 0; }
.quick-name-en-form input {
  font-family: inherit; padding: 6px 10px; border-radius: 8px; border: 1.5px dashed #D8CFB8;
  background: var(--cream); font-size: 0.82rem; width: 140px; color: var(--ink-muted);
}
.quick-name-en-form input:focus { border-style: solid; border-color: var(--copper); outline: none; }

.bulk-price-section { border: 1.5px dashed var(--copper); }

/* ---------- دکمه‌ی سریع تغییر عکس (روی دسته و روی آیتم) ---------- */
.category-thumb-wrap { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.item-thumb-wrap { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.category-thumb {
  width: 56px; height: 56px; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow);
}
.quick-image-form { margin: 0; }
.quick-image-btn {
  position: absolute; bottom: -6px; left: -6px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--copper); display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.25); border: 2px solid var(--paper);
}
.quick-image-btn input[type="file"] { display: none; }
.quick-image-btn-sm { width: 20px; height: 20px; font-size: 0.65rem; bottom: -4px; left: -4px; }

.item-edit-form {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px;
}
.item-edit-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 700; min-width: 140px; }
.item-edit-form input[type="text"], .item-edit-form input[type="number"] {
  font-family: inherit; padding: 8px 10px; border-radius: 8px; border: 1.5px solid #D8CFB8;
}
.item-edit-form .btn { padding: 8px 20px; font-size: 0.85rem; }

/* ---------- قیمت قابل‌ویرایش سریع داخل جدول ---------- */
.quick-price-form { margin: 0; }
.quick-price-input {
  width: 90px; font-family: inherit; font-weight: 700; padding: 7px 8px; border-radius: 8px;
  border: 1.5px solid #D8CFB8; background: var(--cream); font-size: 0.9rem;
}
.quick-price-input:focus { border-color: var(--copper); outline: none; }

.add-item-details {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px;
}
.add-item-details summary { cursor: pointer; font-weight: 700; color: var(--copper-dark); }
.add-item-details form { margin-top: 14px; }

code {
  background: #EFE9D8; padding: 2px 8px; border-radius: 6px; font-size: 0.85rem;
}
