/* SR Worlds Shop — Admin-only styles.
   This file is loaded ONLY by views/layouts/admin.php and never by the public
   storefront. It complements (does not modify) Cursor's shop.css. */

.admin-header { position: sticky; top: 0; z-index: 40; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0 10px; flex-wrap: wrap;
}
.admin-brandwrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-brand { font-size: 1.05rem; }
.admin-logout { margin: 0; }

.env-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
  font-size: .72rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
}

.admin-nav a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none;
  color: var(--ink, #12263f); font-weight: 700; font-size: .92rem;
}
.admin-nav a:hover { background: var(--surface-2, #eef2f7); }
.admin-nav a.is-active { background: #102a43; color: #fff; }

/* Group panels visually and give section headings clear separation. */
.panel h2 { margin-top: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line, #e2e8f0); }
.panel + .panel { margin-top: 18px; }

/* Required-field hint: labels inside a .field whose input is [required]. */
.field input[required] + .req, .field.required label::after { content: ""; }

/* Sticky primary save action inside the main product/settings form. */
form.panel > button[type="submit"] {
  position: sticky; bottom: 12px; z-index: 5;
  box-shadow: 0 6px 20px rgba(16, 42, 67, .18);
}

.notice.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.notice { margin: 12px 0; }

.pager { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }

.admin-thumb { max-width: 140px; height: auto; border-radius: 8px; border: 1px solid var(--line, #e2e8f0); }
.admin-thumb.tiny { max-width: 46px; }
.image-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* Responsive: single-column forms on tablets and phones. */
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 24px 0 12px; }
  .admin-topbar { padding-bottom: 8px; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .admin-nav { gap: 6px; }
  .admin-nav a { padding: 7px 9px; font-size: .86rem; }
  .check-row { gap: 12px; }
  .table th, .table td { padding: 8px 6px; font-size: .86rem; }
  form.panel > button[type="submit"] { width: 100%; }
}

/* =====================================================================
   Phase 2C.2 — Order management admin UI
   ===================================================================== */

/* Flash messages (survive redirect) */
.admin-flashes { display: grid; gap: 8px; margin: 14px 0; }
.admin-flash { padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: .92rem; border: 1px solid transparent; }
.admin-flash--success { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.admin-flash--error { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.admin-flash--warning { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.admin-flash--info { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .01em; border: 1px solid transparent; white-space: nowrap; }
.badge--ok { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
.badge--warn { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.badge--danger { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.badge--info { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }
.badge--muted { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.badge--neutral { background: #f8fafc; color: #334155; border-color: #e2e8f0; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Quick nav chips + filter reset */
.order-quicknav { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { padding: 6px 12px; border-radius: 999px; background: #eef2f7; color: #334155; text-decoration: none; font-weight: 700; font-size: .84rem; border: 1px solid #e2e8f0; }
.chip:hover { background: #e2e8f0; }
.chip.is-active { background: #102a43; color: #fff; border-color: #102a43; }
.order-filters__actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.btn-ghost { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: #102a43; text-decoration: none; font-weight: 700; cursor: pointer; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-primary { background: #102a43; color: #fff; border: 1px solid #102a43; }
.btn-primary:hover { background: #1c3d5c; }
.btn-danger { background: #fff; color: #991b1b; border: 1px solid #fca5a5; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 10px; font-size: .82rem; border-radius: 7px; }

/* Bulk action bar */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 12px; }
.bulk-bar select { padding: 7px 10px; }

/* Order table */
.order-table-wrap { overflow-x: auto; }
.order-table { width: 100%; }
.order-table .order-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-form { display: inline; margin: 0; }
.needs-tip { cursor: help; text-decoration: underline dotted; }

/* Order detail layout */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.order-main { display: grid; gap: 18px; min-width: 0; }
.order-side { position: sticky; top: 92px; }
.order-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.order-toplinks { display: flex; gap: 10px; flex-wrap: wrap; }
.amount-breakdown { margin-top: 12px; max-width: 360px; margin-left: auto; }
.summary-row { display: flex; justify-content: space-between; gap: 20px; padding: 4px 0; }
.summary-total { border-top: 1px solid #e2e8f0; margin-top: 6px; padding-top: 8px; font-size: 1.05rem; }
.action-cluster { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.action-cluster .stack-form { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.inline-reason { margin-bottom: 4px; }
.field-full, .field.full { grid-column: 1 / -1; }
.internal-notes { white-space: pre-wrap; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; font-family: inherit; font-size: .9rem; }

/* Eligibility checklist */
.checklist { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.checklist li { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.checklist li.ok { color: #065f46; }
.checklist li.bad { color: #991b1b; font-weight: 600; }
.checklist li span { font-weight: 800; }
.sr-status, .sr-status-panel { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.sr-details { margin: 8px 0; }
.sr-status-panel p { width: 100%; }

/* Timeline */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; border-left: 2px solid #e2e8f0; }
.timeline__item { position: relative; padding: 8px 0 8px 18px; }
.timeline__item::before { content: ""; position: absolute; left: -7px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: #102a43; }
.timeline__time { display: block; font-size: .78rem; color: #64748b; }
.timeline__body { display: block; font-size: .92rem; }
.timeline__body em { font-style: normal; margin-left: 8px; font-size: .8rem; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #93c5fd; outline-offset: 2px;
}

@media (max-width: 1024px) {
  .order-layout { grid-template-columns: 1fr; }
  .order-side { position: static; }
}
@media (max-width: 768px) {
  .order-table thead { display: none; }
  .order-table, .order-table tbody, .order-table tr, .order-table td { display: block; width: 100%; }
  .order-table tr { border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 12px; padding: 6px 10px; }
  .order-table td { display: flex; justify-content: space-between; gap: 12px; border: none; padding: 6px 0; text-align: right; }
  .order-table td::before { content: attr(data-label); font-weight: 700; color: #475569; text-align: left; }
  .order-table .order-actions { justify-content: flex-end; }
}
