/* Minimal shared stylesheet for the internal testing frontend. */

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1a1a2e;
  background: #f5f6f8;
  padding-bottom: 3rem; /* room for the inspector bar */
}

main { max-width: 1080px; margin: 0 auto; padding: 1rem; }

a { color: #0b5fff; text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.3rem; } h2 { font-size: 1.05rem; }

code { background: #eef0f4; padding: 0 3px; border-radius: 3px; }
pre {
  background: #f0f2f6; border: 1px solid #dfe3ea; border-radius: 4px;
  padding: .5rem; overflow: auto; max-height: 260px; font-size: 12px;
}
.muted { color: #6b7280; font-size: .85em; }

/* Header / nav */
header.nav {
  background: #14213d; color: #fff;
  display: flex; align-items: center; gap: 1rem;
  padding: .5rem 1rem; flex-wrap: wrap;
}
header.nav .brand { font-weight: 700; color: #fca311; }
header.nav a { color: #dbe2f0; padding: .2rem .4rem; border-radius: 4px; }
header.nav a.active, header.nav a:hover { background: #1f2f56; color: #fff; text-decoration: none; }
header.nav .spacer { flex: 1; }
header.nav .who { color: #9fb0d0; font-size: .85em; }

/* Cards / grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.card {
  background: #fff; border: 1px solid #e2e6ee; border-radius: 6px; padding: .8rem;
}
.card .price { font-weight: 700; }
.layout { display: flex; gap: 1rem; align-items: flex-start; }
.sidebar { flex: 0 0 220px; }
.content { flex: 1; min-width: 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid #e7eaf0; vertical-align: top; }
th { background: #eef1f6; font-weight: 600; }
tr:hover td { background: #fafbfd; }
/* Whole-row attention flag (e.g. DELIVERY_FAILED/REFUSED suborders in an
   unfiltered list) — placed after tr:hover so the tint wins on hover too;
   a full-row scan signal is the point, a lost hover cue is an acceptable cost. */
tr.row-attn td { background: #fff1f2; }

/* Forms */
label { display: block; margin: .5rem 0 .15rem; font-weight: 600; font-size: .85em; }
input, select, textarea {
  width: 100%; max-width: 420px; padding: .4rem .5rem;
  border: 1px solid #c9d0dc; border-radius: 4px; font: inherit;
}
input[type="checkbox"] { width: auto; }
fieldset { border: 1px solid #dfe3ea; border-radius: 6px; margin: 0 0 1rem; background: #fff; }

button, .btn {
  display: inline-block; padding: .4rem .8rem; margin: .2rem .2rem .2rem 0;
  border: 1px solid #0b5fff; border-radius: 4px; cursor: pointer;
  background: #0b5fff; color: #fff; font: inherit;
}
button.secondary, .btn.secondary { background: #fff; color: #0b5fff; }
button.danger { background: #c1121f; border-color: #c1121f; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* Badges */
.badge {
  display: inline-block; padding: 0 .45rem; border-radius: 8px;
  background: #dfe3ea; color: #333; font-size: .8em; font-weight: 600;
}
.badge.ok { background: #d1fae5; color: #065f46; }
.badge.err { background: #fee2e2; color: #991b1b; }
.badge.warn { background: #fef3c7; color: #92400e; }

.status-PENDING_PAYMENT, .status-CONFIRMED, .status-DELIVERY_FAILED { background: #fef3c7; color: #92400e; }
.status-COD_CONFIRMED, .status-PROCESSING, .status-PREPARING,
.status-READY_FOR_PICKUP, .status-IN_TRANSIT { background: #dbeafe; color: #1e40af; }
.status-DELIVERED, .status-COMPLETED { background: #d1fae5; color: #065f46; }
.status-CANCELLED, .status-RETURNED, .status-EXPIRED, .status-REFUSED, .status-FAILED { background: #fee2e2; color: #991b1b; }
.status-OPEN { background: #dbeafe; color: #1e40af; }
.status-CONVERTED { background: #d1fae5; color: #065f46; }

/* Impersonation banner (admin B03) — loud, fixed, unmissable. */
.imp-banner {
  position: sticky; top: 0; z-index: 60;
  background: #7c2d12; color: #fff;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .45rem 1rem; font-size: .9em;
  border-bottom: 2px solid #fca311;
}
.imp-banner .imp-countdown { color: #fed7aa; font-variant-numeric: tabular-nums; }
.imp-banner .imp-exit {
  margin: 0 0 0 auto; background: #fff; color: #7c2d12;
  border-color: #fff; padding: .2rem .6rem;
}

/* Terminal-bad domain banners (e.g. a refused COD shipment) — same tone as
   error-banner but non-dismissible, informational rather than an API error. */
.banner-terminal-bad {
  background: #fef2f2; border: 1px solid #fca5a5; border-radius: 4px;
  padding: .5rem .7rem; margin: .5rem 0; color: #991b1b;
}

/* Notes & errors */
.note {
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 4px;
  padding: .5rem .7rem; margin: .6rem 0; font-size: .9em;
}
.error-banner {
  position: relative; background: #fef2f2; border: 1px solid #fca5a5;
  border-radius: 4px; padding: .5rem 2rem .5rem .7rem; margin: .5rem 0;
}
.error-banner .dismiss {
  position: absolute; top: .2rem; right: .2rem;
  background: none; border: none; color: #991b1b; font-size: 1rem; padding: .1rem .4rem;
}
.error-banner .corr { display: block; color: #6b7280; font-size: .8em; margin-top: .2rem; }

/* Inspector */
#lz-inspector {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #14213d; color: #e5e7eb; font-size: 12px;
}
#lz-inspector-toggle {
  background: #14213d; border: none; color: #fca311; margin: 0;
  width: 100%; text-align: left; padding: .35rem 1rem; border-radius: 0;
}
#lz-inspector-body { max-height: 45vh; overflow: auto; padding: .3rem 1rem .6rem; }
#lz-inspector-body details { border-bottom: 1px solid #2b3a5e; padding: .25rem 0; }
#lz-inspector-body summary { cursor: pointer; display: flex; gap: .5rem; align-items: center; }
#lz-inspector-body code { background: transparent; color: #e5e7eb; }
#lz-inspector-body pre { background: #0e1830; color: #c9d4ea; border-color: #2b3a5e; }
#lz-inspector-body .corr { color: #8fa2c8; }

[x-cloak] { display: none !important; }
