/* ==========================================================================
   maibit-admin.css
   Shared base styles - originally admin-*.html only, now also linked from
   the client-facing pages (wallet, support, order-detail, profile, the
   legal pages, ...). Name is legacy; consider renaming to maibit-shared.css
   next time this file is touched, since it's no longer admin-only.

   Scope: reset, page shell, and the handful of status/empty-state/card
   components that recur across both the admin panel and the client app,
   either byte-identical or close enough that unifying them is an
   imperceptible nudge, not a redesign.

   Cascade note: this file is linked BEFORE each page's own <style> block,
   so any page-specific override with the same selector still wins. Adding
   this link is therefore non-breaking even on pages not yet cleaned up.

   NOT included here - real design differences, not measurement drift,
   left in each page's own <style>:
     .btn / .btn-primary / .btn-outline / .tab-btn base colors - two
       genuine button archetypes (pill vs rounded-rect, ~9px vs 999px
       radius) coexist across the app. Averaging them produces a button
       that matches neither.
     .av - two real sizes (34-38px row avatar vs 68-72px profile hero)
       plus context-specific background colors.
     .head h1 - admin pages consistently use 1.4rem/800 weight, client
       pages consistently use ~1.3rem/700. Consistent *within* each group,
       different *between* them - reads as intentional (authoritative admin
       vs lighter client tone), so left alone rather than picked for you.
     .alert.ok - most pages use the brand steel-blue for a success state,
       but support.html, seller-api.html, and dispute.html use green instead
       (3 files now, consistently). Green-for-success is such a strong
       convention that this might be intentional (or might be pre-rebrand
       leftovers copied across those 3) - flagging rather than silently
       recoloring a "your action succeeded" indicator.
     .btn-primary/.btn-secondary on listing-detail.html - uses display:block;
       width:100% with margin-bottom to stack the buttons vertically in a
       sidebar, unlike the inline pair everywhere else. Real layout need,
       not drift - left local.
     chat.html, kyc.html, header.html - self-contained component styles
       (two-pane chat layout, a standalone KYC form flow, the site header
       partial) that don't use the .page/.card/.head shell at all. Only
       linked/touched where their body rule matched (kyc, chat); header.html
       untouched entirely since it's likely injected as a fragment rather
       than loaded as its own document.
     .card variants on shop-team.html/workspace.html (lighter translucent
       card, 14px radius), order-chat.html (full-height chat panel),
       index/browse/favorites (edge-to-edge grid-thumbnail card, no
       padding - the .cover/.body/.meta/.title/.price pieces inside it
       are shared, see below), and edit-listing/create-listing/
       listing-detail (0.9rem radius, asymmetric top/bottom padding for
       a form-step card) - four more genuinely different .card roles
       reusing the same class name.
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: #050816;
  color: #e5e7eb;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Page shell used by every admin-*.html */
.page {
  padding: 1.6rem 0 2.5rem;
}

.head h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.head p {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-bottom: 1.2rem;
}

.back {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.8rem;
  display: inline-block;
}

/* Access-denied / role-gate message */
.denied {
  padding: 3rem;
  text-align: center;
}

/* Empty-state and loading placeholders */
.empty {
  padding: 2rem;
  text-align: center;
  opacity: 0.65;
  font-size: 0.88rem;
}

.loading {
  padding: 2rem;
  text-align: center;
  opacity: 0.7;
}

/* Generic dark card container.
   Padding updated from 0.5rem/1rem to the system-wide average (0.8rem/1.1rem)
   once client pages were folded in - admin cards used the tighter value,
   client cards mostly used a roomier one; this splits the difference.
   Effect: every admin page's cards get ~4-5px more padding than before -
   a visible but modest change, not a redesign. */
.card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(31, 41, 55, 0.95);
  border-radius: 0.85rem;
  padding: 0.8rem 1.1rem;
}

/* --------------------------------------------------------------------------
   Below: components that were NOT byte-identical across pages - each page
   had its own slightly-drifted padding/font-size/gap. Values here are the
   average across every page that used the selector, rounded to a sane
   number. Visually this is a small, uniform nudge (a few px either way),
   not a redesign. If a page looks slightly off after this, it's one of
   these - override the selector back in that page's own <style> block.
   -------------------------------------------------------------------------- */

/* Underline-style tab row (kyc, withdrawals, staff, user, ...) */
.tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.tab.active {
  color: #7dd3fc;
  border-bottom-color: #38bdf8;
}

/* Pill-style tab row (reports, disputes, users, audit, ...) */
.tab-btn {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #cbd5e1;
}

.tab-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.6);
  color: #7dd3fc;
  font-weight: 600;
}

/* Small status badge. Values re-averaged across admin + client pages
   (13 files) once client's own .pill usage was folded in. */
.pill {
  font-size: 0.7rem;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Text input used on search/filter pages */
.search-bar {
  width: 100%;
  background: #0f1729;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  color: #e5e7eb;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Row of action buttons under a card/list item.
   Note: admin-user.html keeps its own .actions - it uses
   margin-left:auto to right-align, a real layout choice, not drift. */
.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

/* Stat-card grid used on dashboards/reports */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.3rem;
}

.stat-label {
  font-size: 0.76rem;
  opacity: 0.65;
  margin-bottom: 0.3rem;
}

/* .stat-card / .stat-num: only the structural part is shared here.
   background/border color and the number's color are left in each page's
   own <style> because they carry meaning (e.g. revenue page's blue accent) -
   not just measurement drift. */
.stat-card {
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
}

/* Inline form alert box (shown/hidden via JS toggling display).
   Base shape only - error/ok color modifiers below. */
.alert {
  padding: 0.55rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 0.8rem;
  display: none;
}

.alert.error {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #fca5a5;
}

/* .alert.ok intentionally omitted - see note at top of file (green vs
   brand-blue split across pages needs a decision, not a silent pick). */

/* Disabled-state helper for the various button classes across the app.
   Just opacity/cursor - doesn't touch color or shape, so it's safe to
   share even though the buttons themselves aren't unified yet. */
.btn-primary:disabled,
.btn-outline:disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Centered text column for long-form pages (terms, privacy, refund-policy,
   seller-api docs). */
.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 4rem;
}

/* --------------------------------------------------------------------------
   Form components shared by every single-focus form page (login, signup,
   dispute, create/edit-listing, reset-password, support ticket, ...). */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
}

.form-group label {
  font-size: 0.82rem;
  color: rgba(226, 232, 240, 0.92);
}

/* The .btn-primary/.btn-secondary PAIR (as opposed to bare .btn - see the
   note at the top of this file) is consistently pill-shaped across every
   single-focus form page that declares them together. Colors stay local
   (each page sets its own .btn-primary / .btn-secondary background). */
.btn-primary,
.btn-secondary {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.45rem 1.3rem;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
}

/* --------------------------------------------------------------------------
   Listing-grid card (used on index/browse/favorites/profile's "my listings"
   grid). This is a different .card than the generic content .card above -
   these pages give the grid card its own rule with overflow/cursor/hover,
   so it's left local; only the inner pieces below are shared. */
.cover {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(91, 139, 196, 0.14)), #0b1228;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  position: relative;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.15);
}

.meta {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}

.title {
  font-size: 0.87rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}

.price {
  font-size: 1rem;
  font-weight: 700;
  color: #8badd6;
}

.body {
  padding: 0.73rem 0.85rem 0.88rem;
}

/* Small overlay badge on a listing cover. Position/color stay local since
   each page places and colors its badge differently (sold/hot/auto/etc) -
   only the cosmetic shape is shared. */
.card-badge {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
}
