/* ============================================================
   Silver Book — تنسيق لوحة الطلبات
   ============================================================ */

.admin { background: #f4f5f7; }
.admin-main { padding: 30px 0 60px; }

.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head h1 { margin: 0; font-size: 27px; font-weight: 900; }
.admin-head p { margin: 2px 0 0; font-size: 13.5px; }
.admin-tools { display: flex; gap: 10px; }
.admin-tools input {
  height: 40px; min-width: 260px; border-radius: 11px; border: 1px solid var(--line);
  padding: 0 14px; font-family: inherit; font-size: 13.5px; outline: none; background: #fff;
}
.admin-tools input:focus { border-color: #8b93a1; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.stat strong { font-size: 23px; font-weight: 900; letter-spacing: -.3px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.tag { font-size: 11.5px; font-weight: 700; color: var(--gold-dark); background: #fbf5e6; border: 1px solid #efe2c4; padding: 3px 10px; border-radius: 999px; }

.table-wrap { overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
.orders-table th {
  text-align: start; font-size: 11.5px; color: #6b7280; font-weight: 800;
  padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc;
}
.orders-table td { padding: 12px 10px; border-bottom: 1px solid #f1f3f5; vertical-align: top; }
.orders-table tr:last-child td { border-bottom: 0; }
.orders-table .oid { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; font-weight: 700; direction: ltr; display: inline-block; }
.orders-table .items-cell { font-size: 12.5px; color: #4b5563; max-width: 260px; }
.orders-table .items-cell span { display: block; }
.orders-table .total-cell { font-weight: 900; white-space: nowrap; }
.status-select {
  font-family: inherit; font-size: 12px; padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; min-width: 150px;
}
.status-select.st-new { background: #fff7e6; border-color: #f2d9a6; color: #8a5a00; }
.status-select.st-paid { background: #eaf4ff; border-color: #c3ddfb; color: #12467f; }
.status-select.st-shipped { background: #eef3ff; border-color: #ccd7fb; color: #2b3f9e; }
.status-select.st-done { background: #e7f3ec; border-color: #c3e2d0; color: #17603c; }
.status-select.st-cancel { background: #fdecec; border-color: #f7cdcd; color: #a11a1a; }

.note-panel h2 { margin: 0 0 8px; font-size: 16px; }
.note-panel ul { margin: 0; padding-inline-start: 20px; font-size: 13px; color: #4b5563; line-height: 1.85; }
.note-panel code { background: var(--silver-2); padding: 1px 6px; border-radius: 5px; font-size: 12px; direction: ltr; display: inline-block; }

/* PIN gate */
.pin-gate { position: fixed; inset: 0; z-index: 100; background: rgba(12, 14, 18, .72); display: grid; place-items: center; padding: 20px; }
.pin-card { background: #fff; border-radius: 18px; padding: 26px; width: min(380px, 100%); box-shadow: var(--shadow-lg); }
.pin-card h2 { margin: 0 0 6px; font-size: 20px; }
.pin-card p { font-size: 12.5px; margin: 0 0 16px; }
.pin-card form { display: flex; flex-direction: column; gap: 10px; }
.pin-card input {
  height: 46px; border-radius: 11px; border: 1px solid var(--line); text-align: center;
  font-family: inherit; font-size: 18px; letter-spacing: 4px; outline: none;
}
.pin-card input:focus { border-color: #8b93a1; }
.pin-card code { background: var(--silver-2); padding: 1px 5px; border-radius: 5px; direction: ltr; display: inline-block; font-size: 11.5px; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .admin-tools input { min-width: 0; width: 100%; }
  .admin-tools { width: 100%; }
}

/* ===== إدارة المنتجات ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prod-form { display: flex; flex-direction: column; gap: 12px; }
.modal-card.wide { width: min(640px, 100%); }
.check.small { font-size: 12.5px; }

.orders-table .thumb {
  width: 44px; height: 56px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); display: block; background: #f3f4f6;
}
.orders-table .thumb-empty { display: grid; place-items: center; color: #b9bec6; font-size: 12px; }
.orders-table .row-actions { white-space: nowrap; }
.orders-table .row-actions .link-btn { margin-inline-end: 10px; font-size: 12.5px; }
.orders-table .link-btn.danger { color: #a11a1a; }

.img-row { display: flex; gap: 14px; margin-top: 10px; align-items: flex-start; }
.img-preview {
  width: 92px; height: 118px; border-radius: 10px; border: 1px dashed #cfd4dc;
  background: #fafbfc; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto;
}
.img-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-side { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.img-side input {
  height: 40px; border-radius: 10px; border: 1px solid var(--line);
  padding: 0 12px; font-family: inherit; font-size: 13px; outline: none; background: #fff;
}
.muted.small { font-size: 12px; }

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