/* ============================================================
   DexHub — Digital Mineral Exchange
   assets/css/style.css
   Mobile-first responsive design
   Color Palette:
     Gold:       #D4AF37  /  #C9A96E
     Deep Blue:  #0A2342  /  #001F3F
     Silver:     #A9A9A9  /  #B0B0B0
     White:      #FFFFFF
     Background: #F4F5F7
   ============================================================ */

/* ── CSS Custom Properties ──────────────────────────────── */
:root {
  --gold:         #D4AF37;
  --gold-light:   #C9A96E;
  --gold-dark:    #A67C00;
  --blue-deep:    #0A2342;
  --blue-darker:  #001F3F;
  --silver:       #A9A9A9;
  --silver-light: #E0E0E0;
  --white:        #FFFFFF;
  --bg:           #F4F5F7;
  --text:         #1A1A2E;
  --text-muted:   #5A5A72;
  --success:      #2ECC71;
  --warning:      #F39C12;
  --danger:       #E74C3C;
  --info:         #3498DB;

  --radius:       6px;
  --radius-lg:    12px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.10);
  --shadow-md:    0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.16);
  --transition:   .2s ease;
  --font:         'Inter', system-ui, sans-serif;
  --font-mono:    'Fira Code', monospace;
  --container:    1200px;
}

/* ── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-dark); text-decoration: underline; }
address { font-style: normal; }

/* ── Typography ─────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--blue-deep);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

p  { margin-bottom: 1rem; }

.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }

/* ── Container ──────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active    { transform: scale(.97); }
.btn:hover     { text-decoration: none; }

.btn-primary   { background: var(--gold);       color: var(--blue-deeper, #001F3F); border-color: var(--gold); }
.btn-primary:hover{ background: var(--gold-dark); border-color: var(--gold-dark); color: var(--white); }

.btn-outline   { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline:hover{ background: var(--gold); color: var(--blue-deep); }

.btn-secondary { background: var(--blue-deep); color: var(--white); border-color: var(--blue-deep); }
.btn-secondary:hover{ background: var(--blue-darker); }

.btn-sm  { padding: .35rem .85rem; font-size: .85rem; }
.btn-lg  { padding: .8rem 1.75rem;  font-size: 1.05rem; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group   { margin-bottom: 1.25rem; }
label         { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .9rem; }
input, select, textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1.5px solid var(--silver-light);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,.15);
}
.form-error { color: var(--danger); font-size: .82rem; margin-top: .25rem; }
.inline-form { display: inline; }

/* ── Flash Messages ─────────────────────────────────────── */
.flash {
  padding: .75rem 0;
  font-weight: 500;
  font-size: .95rem;
  border-bottom: 1px solid transparent;
}
.flash--success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.flash--warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.flash--danger  { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.flash--info    { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* ── NEWS TICKER ────────────────────────────────────────── */
.news-ticker {
  background: var(--blue-deep);
  color: var(--white);
  font-size: .8rem;
  height: 34px;
  display: flex;
  align-items: center;
  gap: .75rem;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--gold);
}
.ticker-label {
  background: var(--gold);
  color: var(--blue-deep);
  font-weight: 700;
  padding: .2rem .65rem;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .72rem;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  animation: tickerScroll 30s linear infinite;
  will-change: transform;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item  { color: #dde4ee; }
.ticker-item strong { color: var(--gold); }
.ticker-sep   { color: var(--silver); }
.ticker-news  { color: var(--silver-light); }

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── HEADER ──────────────────────────────────────────────── */
.site-header {
  background: var(--blue-deep);
  color: var(--white);
  position: sticky;
  top: 34px; /* height of ticker */
  z-index: 100;
  border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 64px;
  justify-content: space-between;
}
.header-logo img { height: 44px; width: auto; }

/* ── Navigation ─────────────────────────────────────────── */
.main-nav { display: flex; align-items: center; }

.nav-menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .25rem;
  flex-wrap: wrap;
}
.nav-menu a {
  color: var(--silver-light);
  padding: .4rem .7rem;
  border-radius: var(--radius);
  font-size: .9rem;
  display: block;
  transition: color var(--transition), background var(--transition);
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] { color: var(--gold); background: rgba(255,255,255,.05); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Language Switcher ──────────────────────────────────── */
.lang-switcher { position: relative; }
.lang-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: var(--white);
  padding: .35rem .75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .82rem;
  font-family: var(--font);
  transition: background var(--transition);
  white-space: nowrap;
}
.lang-btn:hover { background: rgba(255,255,255,.16); }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--silver-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  list-style: none;
  min-width: 150px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition);
}
.lang-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.lang-dropdown li a {
  display: block;
  padding: .5rem .9rem;
  font-size: .88rem;
  color: var(--text);
  transition: background var(--transition);
}
.lang-dropdown li a:hover { background: var(--bg); }
.lang-dropdown li[aria-selected="true"] a { color: var(--gold); font-weight: 600; }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--blue-deeper, #001F3F) 60%, var(--gold-dark) 100%);
  color: var(--white);
  padding: 4rem 0 3rem;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}
.hero h1 { color: var(--white); margin-bottom: .75rem; }
.hero-sub { font-size: 1.1rem; color: var(--silver-light); max-width: 520px; margin-bottom: 1.5rem; }
.hero-cta  { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Spot prices card */
.hero-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.price-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: .25rem;
  backdrop-filter: blur(4px);
}
.price-label { font-size: .8rem; color: var(--silver-light); text-transform: uppercase; letter-spacing: .06em; }
.price-value { font-size: 1.6rem; font-weight: 700; color: var(--gold); }
.price-unit  { font-size: .75rem; color: var(--silver); }
.price-change{ font-size: .8rem; font-weight: 600; }
.price-change.up   { color: var(--success); }
.price-change.down { color: var(--danger); }

/* ── Sections ───────────────────────────────────────────── */
.section { padding: 3.5rem 0; }
.section--dark { background: var(--blue-deep); color: var(--white); }
.section--dark .section-title { color: var(--gold); }

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: .75rem;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

/* ── Steps / How It Works ───────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.step-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--silver-light);
  transition: box-shadow var(--transition), transform var(--transition);
}
.step-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.step-num {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--gold);
  color: var(--blue-deep);
  border-radius: 50%;
  font-size: .8rem; font-weight: 700;
  margin-bottom: .5rem;
}
.step-icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.step-card h3 { margin-bottom: .4rem; }
.step-card p  { font-size: .9rem; color: var(--text-muted); margin-bottom: 0; }

/* ── Listings Grid ──────────────────────────────────────── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.listing-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--silver-light);
  display: flex; flex-direction: column; gap: .5rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.listing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.listing-mineral {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  width: fit-content;
}
.mineral--gold   { background: #FFF3CC; color: #7A5C00; }
.mineral--copper { background: #FFE8D9; color: #7A3400; }
.mineral--other  { background: #E8E8E8; color: #444;    }
.listing-qty, .listing-price { font-size: .9rem; color: var(--text-muted); }
.listing-price { font-size: 1rem; font-weight: 600; color: var(--gold-dark); }

/* ── Trust Badges ───────────────────────────────────────── */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
}
.badge-item {
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.04);
}
.badge-item span { font-size: 2.2rem; display: block; margin-bottom: .5rem; }
.badge-item p    { font-size: .88rem; color: var(--silver-light); margin: 0; }

/* ── Empty State ────────────────────────────────────────── */
.empty-state { text-align: center; color: var(--text-muted); padding: 2rem; }

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--blue-deeper, #001F3F);
  color: var(--silver-light);
  padding: 3rem 0 1.5rem;
  border-top: 2px solid var(--gold);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand p { font-size: .88rem; color: var(--silver); margin-top: .75rem; max-width: 240px; }
.footer-col h4 { color: var(--gold); font-size: .9rem; margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.footer-col ul a { color: var(--silver); font-size: .88rem; }
.footer-col ul a:hover { color: var(--gold); }
.footer-col address p { font-size: .88rem; color: var(--silver); }
.footer-col address a { color: var(--silver); }
.footer-col address a:hover { color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 1rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-size: .8rem; color: var(--silver);
}
.footer-version { opacity: .5; }

/* ── MAIN CONTENT area ──────────────────────────────────── */
.site-main { min-height: 60vh; }

/* ── Utility classes ────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS (mobile-first)
   ═══════════════════════════════════════════════════════════ */

/* ── Tablet: 640px+ ─────────────────────────────────────── */
@media (min-width: 640px) {
  .hero-inner { grid-template-columns: 1fr 1fr; }
  .price-card { padding: 1.5rem; }
}

/* ── Desktop: 1024px+ ───────────────────────────────────── */
@media (min-width: 1024px) {
  .container { padding-inline: 2rem; }
  .hero { padding: 5rem 0 4rem; }
  .section { padding: 5rem 0; }
}

/* ── Mobile only: <768px ────────────────────────────────── */
@media (max-width: 767px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--blue-deeper, #001F3F);
    flex-direction: column;
    gap: 0;
    padding: .5rem 0 1rem;
    border-bottom: 2px solid var(--gold);
    box-shadow: var(--shadow-md);
    z-index: 200;
  }
  .nav-menu.open { display: flex; }
  .nav-menu a { padding: .65rem 1.25rem; font-size: 1rem; border-radius: 0; }

  .lang-switcher { position: static; }
  .lang-dropdown { left: 0; right: auto; }

  .hero-prices { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .header-inner { position: relative; } /* needed for absolute nav dropdown */
}

@media (max-width: 480px) {
  .hero-cta { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════
   AUTH PAGES — Login / Register
   ════════════════════════════════════════════════════════════ */

.auth-page {
  min-height: calc(100vh - 98px - 64px); /* viewport minus ticker+header */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  background: linear-gradient(160deg, var(--blue-deep) 0%, #0e2d52 50%, var(--bg) 100%);
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 460px;
  border-top: 4px solid var(--gold);
}
.auth-card--wide { max-width: 720px; }

.auth-card__header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-logo {
  display: inline-block;
  margin-bottom: .75rem;
}
.auth-card__header h1 {
  font-size: 1.5rem;
  color: var(--blue-deep);
  margin-bottom: .25rem;
}
.auth-tagline {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 0;
}

/* ── Alert box ──────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9rem;
  font-weight: 500;
}
.alert--danger  { background: #fdf0f0; color: #922; border: 1px solid #f5c6cb; }
.alert--success { background: #f0fdf4; color: #155724; border: 1px solid #c3e6cb; }
.alert--info    { background: #eff8ff; color: #0c5474; border: 1px solid #bee5eb; }

/* ── Form fields (auth-specific overrides) ──────────────── */
.auth-form .form-group { margin-bottom: 1.1rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label .label-link {
  float: right;
  font-weight: 400;
  font-size: .82rem;
  color: var(--gold-dark);
}

.form-hint {
  font-weight: 400;
  font-size: .78rem;
  color: var(--text-muted);
  margin-left: .35rem;
}

.input-error {
  border-color: var(--danger) !important;
  background: #fff8f8;
}
.input-error:focus {
  box-shadow: 0 0 0 3px rgba(231,76,60,.12) !important;
}

/* ── Password field with toggle button ──────────────────── */
.password-field {
  position: relative;
  display: flex;
}
.password-field input {
  padding-right: 2.75rem; /* room for the eye icon */
}
.pwd-toggle {
  position: absolute;
  right: .6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: .55;
  transition: opacity var(--transition);
  line-height: 1;
  padding: 0;
}
.pwd-toggle:hover { opacity: .9; }

/* ── Password strength bar ──────────────────────────────── */
.pwd-strength {
  height: 4px;
  border-radius: 2px;
  margin-top: .35rem;
  font-size: .75rem;
  font-weight: 600;
  transition: background var(--transition);
}
.pwd-weak   { background: var(--danger);  color: var(--danger);  }
.pwd-fair   { background: var(--warning); color: var(--warning); }
.pwd-good   { background: var(--info);    color: var(--info);    }
.pwd-strong { background: var(--success); color: var(--success); }

/* ── Role Selector ──────────────────────────────────────── */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  margin-top: .35rem;
}
.role-card {
  position: relative;
  border: 2px solid var(--silver-light);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}
.role-card input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.role-card:hover { border-color: var(--gold-light); background: #fffbef; }
.role-card--active {
  border-color: var(--gold);
  background: #fffdf0;
  box-shadow: 0 0 0 3px rgba(212,175,55,.15);
}
.role-card__icon  { font-size: 2rem; }
.role-card__title { font-weight: 700; font-size: .95rem; color: var(--blue-deep); }
.role-card__desc  { font-size: .78rem; color: var(--text-muted); }

/* ── Terms checkbox ─────────────────────────────────────── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-weight: 400;
  font-size: .88rem;
  cursor: pointer;
  line-height: 1.5;
}
.checkbox-label input[type=checkbox] {
  width: auto;
  flex-shrink: 0;
  margin-top: .2rem;
}

/* ── Full-width button ──────────────────────────────────── */
.btn-block { width: 100%; justify-content: center; margin-top: .5rem; }

/* ── Auth footer link ───────────────────────────────────── */
.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: .88rem;
}
.auth-switch a { color: var(--gold-dark); font-weight: 600; }

/* ── Mobile: stacked form rows ──────────────────────────── */
@media (max-width: 600px) {
  .auth-card { padding: 2rem 1.25rem; }
  .form-row   { grid-template-columns: 1fr; }
  .role-selector { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .role-selector { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   DASHBOARD
   ════════════════════════════════════════════════════════════ */

.dashboard-page { padding: 2rem 0 3rem; }

.text-muted { color: var(--text-muted); }

/* ── Welcome banner ─────────────────────────────────────── */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--silver-light);
}
.dash-welcome h1 { margin-bottom: .25rem; }

/* ── KYC notice banner ──────────────────────────────────── */
.kyc-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  font-size: .9rem;
}
.kyc-notice__icon { font-size: 1.5rem; flex-shrink: 0; margin-top: .1rem; }
.kyc-notice strong { display: block; margin-bottom: .2rem; }
.kyc-notice p { margin-bottom: .5rem; color: inherit; }

.kyc-notice--pending   { background: #fff9e6; border: 1px solid #f0c829; color: #7a5c00; }
.kyc-notice--submitted { background: #e8f4ff; border: 1px solid #74b9e8; color: #0c4070; }
.kyc-notice--rejected  { background: #fff0f0; border: 1px solid #f5a0a0; color: #7a1c1c; }
.kyc-notice--prominent { border-width: 2px; }

/* ── Stats grid ─────────────────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--silver-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex; flex-direction: column; gap: .35rem;
  box-shadow: var(--shadow-sm);
}
.stat-icon  { font-size: 1.75rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--gold-dark); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── Dashboard panel grid ───────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.dash-panel {
  background: var(--white);
  border: 1px solid var(--silver-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.dash-panel h3 {
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--gold);
  font-size: 1rem;
  color: var(--blue-deep);
}

/* ── Quick links list ───────────────────────────────────── */
.dash-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.dash-links a {
  display: block;
  padding: .6rem .75rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: .92rem;
  transition: background var(--transition), color var(--transition);
}
.dash-links a:hover { background: var(--bg); color: var(--gold-dark); text-decoration: none; }
.dash-links .link-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   KYC + ADMIN — Step 3
   ========================================================================== */

/* ── Shared page layout ─────────────────────────────────────────────────── */
.kyc-upload-page,
.kyc-status-page,
.admin-page {
  padding: 2.5rem 0 4rem;
}
.page-header {
  margin-bottom: 2rem;
}
.page-header h1 {
  font-size: 1.75rem;
  color: var(--navy);
  margin-bottom: .4rem;
}
.page-header p {
  color: var(--text-muted);
  max-width: 56ch;
}
.kyc-section {
  margin-top: 2.5rem;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 2px solid var(--gold);
  padding-bottom: .45rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.section-title .badge {
  background: var(--gold);
  color: #000;
  font-size: .7rem;
  font-weight: 700;
  padding: .15em .55em;
  border-radius: 9999px;
}

/* ── KYC progress tracker ────────────────────────────────────────────────── */
.kyc-tracker {
  display: flex;
  gap: 0;
  margin: 1.5rem 0 2.5rem;
  position: relative;
}
.kyc-tracker::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.kyc-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  position: relative;
  z-index: 1;
}
.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: var(--text-muted);
  transition: all .2s;
}
.step-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}
.kyc-step--active .step-num {
  border-color: var(--gold);
  background: var(--gold);
  color: #000;
}
.kyc-step--active .step-label { color: var(--navy); font-weight: 700; }
.kyc-step--done .step-num {
  border-color: var(--success, #16a34a);
  background: var(--success, #16a34a);
  color: #fff;
}
.kyc-step--done .step-label { color: var(--success, #16a34a); }
.kyc-step--rejected .step-num {
  border-color: var(--danger, #dc2626);
  background: var(--danger, #dc2626);
  color: #fff;
}

/* ── File upload zone ────────────────────────────────────────────────────── */
.kyc-upload-zone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg);
}
.kyc-upload-zone:hover,
.kyc-upload-zone.is-dragover {
  border-color: var(--gold);
  background: #fffdf2;
}
.upload-zone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-zone__text {
  margin: .6rem 0 .25rem;
  font-weight: 600;
  color: var(--navy);
}
.upload-zone__hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Document grid & cards ───────────────────────────────────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.doc-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--card-bg, #fff);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: box-shadow .2s;
}
.doc-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.doc-card--approved { border-left: 3px solid #16a34a; }
.doc-card--rejected { border-left: 3px solid #dc2626; }
.doc-card--pending  { border-left: 3px solid var(--gold); }
.doc-card__icon     { color: var(--silver); }
.doc-card__type     { font-size: .78rem; color: var(--text-muted); margin: 0; }
.doc-card__name     { font-size: .88rem; font-weight: 600; color: var(--navy); margin: 0; }
.doc-card__meta     { font-size: .74rem; color: var(--text-muted); margin: 0; }
.doc-card__foot     { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem; }
.doc-card__note     { font-size: .78rem; background: #fff8e1; border-radius: 4px; padding: .4rem .6rem; color: #92400e; border-left: 3px solid #d97706; }

/* ── Status badge ────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: .2em .6em;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-badge--pending   { background: #fef3c7; color: #92400e; }
.status-badge--submitted { background: #dbeafe; color: #1e40af; }
.status-badge--approved  { background: #dcfce7; color: #15803d; }
.status-badge--rejected  { background: #fee2e2; color: #b91c1c; }

/* ── Doc type badge ──────────────────────────────────────────────────────── */
.doc-type-badge {
  display: inline-block;
  font-size: .72rem;
  padding: .2em .55em;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--navy);
  font-weight: 600;
}
.doc-type-badge--seller { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }
.doc-type-badge--buyer  { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.doc-type-badge--admin  { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

/* ── Submit-for-review callout ───────────────────────────────────────────── */
.kyc-review-section { border-top: 1px solid var(--border); padding-top: 2rem; }
.review-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef9ec 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  flex-wrap: wrap;
}
.review-callout__text h3 { margin: 0 0 .25rem; color: var(--navy); }
.review-callout__text p  { margin: 0; color: var(--text-muted); font-size: .88rem; }

/* ── KYC status hero ────────────────────────────────────────────────────── */
.status-hero {
  text-align: center;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}
.status-hero--pending   { background: #fffbeb; }
.status-hero--submitted { background: #eff6ff; }
.status-hero--approved  { background: #f0fdf4; border-color: #86efac; }
.status-hero--rejected  { background: #fef2f2; border-color: #fca5a5; }
.status-hero__icon { font-size: 3rem; line-height: 1; margin-bottom: .5rem; }
.status-hero__title { font-size: 1.6rem; color: var(--navy); margin: 0 0 .5rem; }
.status-hero__desc  { color: var(--text-muted); max-width: 50ch; margin: 0 auto 1.25rem; }

/* ── Admin table ─────────────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.admin-table th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: .65rem 1rem;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.admin-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: var(--bg); }
.text-sm   { font-size: .82rem; }
.text-muted { color: var(--text-muted); }

/* ── Admin user info card ────────────────────────────────────────────────── */
.user-info-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.user-info-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-info-card__body h2 { margin: 0 0 .15rem; color: var(--navy); }
.user-info-card__meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}

/* ── Admin approve / reject panels ─────────────────────────────────────── */
.admin-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 640px) { .admin-actions-row { grid-template-columns: 1fr; } }
.admin-action-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.admin-action-card--approve { border-top: 3px solid #16a34a; }
.admin-action-card--reject  { border-top: 3px solid #dc2626; }
.admin-action-card h3 { margin: 0 0 .35rem; font-size: 1rem; color: var(--navy); }
.btn-success {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.btn-success:hover { background: #15803d; border-color: #15803d; }
.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-full { width: 100%; justify-content: center; }

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state p { margin: .75rem 0 0; font-size: .95rem; }

/* ── Back link ──────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--navy);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  margin-bottom: 1.5rem;
  opacity: .8;
  transition: opacity .15s;
}
.back-link:hover { opacity: 1; text-decoration: underline; }

/* ==========================================================================
   LISTINGS — Step 4
   ========================================================================== */

/* ── Browse page layout ─────────────────────────────────────────────────── */
.listings-page { padding: 2.5rem 0 4rem; }

/* ── Mineral type chips ─────────────────────────────────────────────────── */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}
.chip {
  display: inline-block;
  padding: .3em .85em;
  border-radius: 9999px;
  border: 1px solid var(--border);
  font-size: .8rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.chip:hover      { border-color: var(--gold); color: var(--gold-dark); }
.chip--active    { background: var(--gold); border-color: var(--gold); color: #000; }
/* per-mineral accent colours */
.chip--gold      { border-color: #d4af37; }
.chip--copper    { border-color: #b87333; }
.chip--silver    { border-color: #a9a9a9; }
.chip--cobalt    { border-color: #0047ab; }
.chip--lithium   { border-color: #7b68ee; }
.chip--tantalum  { border-color: #708090; }

/* ── Filter row ─────────────────────────────────────────────────────────── */
.listings-filters { margin-bottom: 1.5rem; }
.filter-row {
  display: flex;
  gap: .75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.filter-search { flex: 1 1 220px; }
.filter-price  {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;
}
.filter-price .form-control { width: 110px; }
.filter-sep { color: var(--text-muted); font-size: .85rem; }

/* ── Results meta ───────────────────────────────────────────────────────── */
.results-meta { margin-bottom: 1rem; }

/* ── Listing card grid ──────────────────────────────────────────────────── */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.listing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg, #fff);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .15s;
  overflow: hidden;
}
.listing-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.listing-card__img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg);
}
.listing-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.listing-card:hover .listing-card__img img { transform: scale(1.04); }
.listing-card__no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-card__body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.listing-card__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.listing-card__meta { font-size: .78rem; color: var(--text-muted); }
.listing-card__price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold-dark);
  display: flex;
  align-items: baseline;
  gap: .3rem;
  flex-wrap: wrap;
}
.per-kg       { font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.negotiable-tag {
  font-size: .68rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  padding: .15em .5em;
  border-radius: 9999px;
}
.listing-card__seller { margin-top: auto; }

/* ── Mineral badge ──────────────────────────────────────────────────────── */
.mineral-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: .25em .65em;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
/* positioned over card image */
.listing-card__img .mineral-badge {
  position: absolute;
  top: .6rem;
  left: .6rem;
}
.mineral-badge--gold     { background: #fef3c7; color: #92400e; }
.mineral-badge--copper   { background: #fde8d0; color: #7c3a0d; }
.mineral-badge--silver   { background: #f3f4f6; color: #374151; }
.mineral-badge--cobalt   { background: #dbeafe; color: #1e40af; }
.mineral-badge--lithium  { background: #ede9fe; color: #5b21b6; }
.mineral-badge--tantalum { background: #e5e7eb; color: #374151; }
.mineral-badge--other    { background: #f3f4f6; color: #374151; }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--navy);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.page-btn:hover       { border-color: var(--gold); background: #fffbeb; }
.page-btn--active     { background: var(--gold); border-color: var(--gold); color: #000; }

/* ── Listing detail page ────────────────────────────────────────────────── */
.listing-detail-page { padding: 2rem 0 4rem; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); }

.listing-status-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
}
.listing-status-bar--approved { border-color: #86efac; background: #f0fdf4; }
.listing-status-bar--rejected { border-color: #fca5a5; background: #fef2f2; }
.listing-status-bar--submitted { border-color: #93c5fd; background: #eff6ff; }
.admin-note-inline { font-size: .82rem; color: #92400e; }

.listing-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .listing-detail-layout { grid-template-columns: 1fr; }
}

/* ── Gallery ─────────────────────────────────────────────────────────────── */
.gallery-main {
  aspect-ratio: 16/11;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.gallery-thumbs {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
  flex-wrap: wrap;
}
.thumb {
  width: 64px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: border-color .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb--active { border-color: var(--gold); }
.gallery-placeholder {
  aspect-ratio: 16/11;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .85rem;
}

/* ── Listing detail info ─────────────────────────────────────────────────── */
.listing-detail__title { font-size: 1.5rem; color: var(--navy); margin: 0 0 .75rem; }
.listing-detail__price {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.price-main { font-size: 1.9rem; font-weight: 800; color: var(--gold-dark); }
.price-unit { font-size: .85rem; color: var(--text-muted); }

.listing-specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .4rem 1rem;
  font-size: .88rem;
  margin-bottom: 1.25rem;
}
.listing-specs dt { color: var(--text-muted); white-space: nowrap; }
.listing-specs dd { font-weight: 600; color: var(--navy); margin: 0; }

.listing-detail__seller {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.seller-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.seller-name { font-weight: 700; color: var(--navy); margin: 0; font-size: .9rem; }

.listing-cta { margin-top: .5rem; }

.listing-description {
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text-body, #374151);
  max-width: 70ch;
}

.admin-decision-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.admin-decision-panel h3 { margin: 0 0 1rem; font-size: .95rem; color: var(--navy); }

/* ── Listing form page ──────────────────────────────────────────────────── */
.listing-form-page { padding: 2.5rem 0 4rem; }
.container--narrow  { max-width: 720px; margin: 0 auto; }
.form-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.form-card__title { font-size: 1rem; font-weight: 700; color: var(--navy); margin: 0 0 1.25rem; }
.form-card__desc  { font-size: .82rem; color: var(--text-muted); margin: -.75rem 0 1rem; }

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: .5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ── Image preview grid ─────────────────────────────────────────────────── */
.img-preview-grid, .existing-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .75rem;
}
.img-preview, .existing-img {
  position: relative;
  width: 100px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.img-preview img, .existing-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-preview__name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: .65rem;
  padding: .15rem .3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.img-preview__primary {
  position: absolute;
  top: .25rem;
  left: .25rem;
  background: var(--gold);
  color: #000;
  font-size: .6rem;
  font-weight: 800;
  padding: .1em .4em;
  border-radius: 3px;
}
.img-delete-btn {
  position: absolute;
  top: .2rem;
  right: .2rem;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Listing status-bar / sold colours ─────────────────────────────────── */
.status-badge--sold    { background: #f3f4f6; color: #6b7280; }
.status-badge--expired { background: #f3f4f6; color: #9ca3af; }

/* ── Page header flex variant ───────────────────────────────────────────── */
.page-header--flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── My listings table actions ──────────────────────────────────────────── */
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: .25rem; }
.table-link { color: var(--navy); font-weight: 600; text-decoration: none; }
.table-link:hover { text-decoration: underline; }

/* ==========================================================================
   BIDS — Step 5
   ========================================================================== */

/* ── Pages ──────────────────────────────────────────────────────────────────── */
.bid-place-page,
.bid-my-page,
.bid-received-page { padding: 2.5rem 0 4rem; }

/* ── Listing summary card on place form ───────────────────────────── */
.bid-listing-summary {
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.bid-listing-summary h2 {
  font-size: 1.05rem;
  color: var(--navy);
  margin: .4rem 0 .25rem;
}

/* ── Total preview ─────────────────────────────────────────────────────── */
.bid-total-preview {
  margin-top: .75rem;
  padding: .6rem 1rem;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  font-size: .9rem;
  color: #92400e;
}
.bid-total-preview strong { font-size: 1.1rem; }

/* ── Input with prefix/suffix ───────────────────────────────────────────── */
.input-prefix-wrap,
.input-suffix-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.input-prefix-wrap:focus-within,
.input-suffix-wrap:focus-within { border-color: var(--gold); }
.input-prefix,
.input-suffix {
  padding: 0 .75rem;
  background: var(--bg);
  color: var(--text-muted);
  font-size: .9rem;
  display: flex;
  align-items: center;
  border: none;
  white-space: nowrap;
}
.input-prefix { border-right: 1px solid var(--border); }
.input-suffix { border-left:  1px solid var(--border); }
.form-control.input-prefixed,
.form-control.input-suffixed {
  border: none;
  flex: 1;
  border-radius: 0;
}
.form-control.input-prefixed:focus,
.form-control.input-suffixed:focus { box-shadow: none; }

/* ── Bid stats bar on listing view ─────────────────────────────────────── */
.bid-stats-bar {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: .55rem .85rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  font-size: .85rem;
  color: #78350f;
  margin-bottom: .75rem;
}

/* ── Badge count on button (e.g. “View Offers (3)”) ─────────────────────── */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--gold);
  color: #000;
  font-size: .7rem;
  font-weight: 800;
  border-radius: 9999px;
  margin-left: .4rem;
}

/* ── Bid card list (received view) ──────────────────────────────────── */
.bids-list { display: flex; flex-direction: column; gap: 1rem; }

.bid-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg, #fff);
  overflow: hidden;
}
.bid-card--approved  { border-left: 4px solid #22c55e; }
.bid-card--rejected  { border-left: 4px solid #ef4444; }
.bid-card--warning   { border-left: 4px solid #f59e0b; }
.bid-card--pending   { border-left: 4px solid var(--gold); }
.bid-card--expired   { border-left: 4px solid #9ca3af; }

.bid-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.bid-card__buyer {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.bid-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: .6rem 0;
}
.bid-spec {
  flex: 1 0 120px;
  padding: .5rem 1rem;
  border-right: 1px solid var(--border);
}
.bid-spec:last-child { border-right: none; }
.bid-spec__label { display: block; font-size: .73rem; color: var(--text-muted); margin-bottom: .2rem; }
.bid-spec__value { font-size: .95rem; font-weight: 700; color: var(--navy); }
.bid-spec__value--total { color: var(--gold-dark); font-size: 1.05rem; }

.bid-card__message {
  padding: .65rem 1rem;
  font-size: .88rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-body, #374151);
}

.bid-card__counter {
  padding: .65rem 1rem;
  font-size: .88rem;
  border-top: 1px solid var(--border);
  background: #fffbeb;
  color: #78350f;
}

.bid-card__actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.bid-card__counter-form {
  padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.bid-card__counter-form.hidden { display: none; }

/* ── Danger outline button variant ──────────────────────────────────────────── */
.btn-danger-outline {
  border-color: #ef4444;
  color: #ef4444;
}
.btn-danger-outline:hover {
  background: #ef4444;
  color: #fff;
}

/* ==========================================================================
   MESSAGES — Step 6
   ========================================================================== */

/* ── Pages ──────────────────────────────────────────────────────────────── */
.messages-page { padding: 2.5rem 0 4rem; }

/* ── Thread list (inbox) ────────────────────────────────────────────────── */
.thread-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.thread-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
  position: relative;
}
.thread-item:last-child { border-bottom: none; }
.thread-item:hover      { background: var(--bg); }
.thread-item--unread    { background: #fffbeb; }
.thread-item--unread .thread-name { font-weight: 800; }

.thread-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.thread-avatar--lg { width: 48px; height: 48px; font-size: 1.2rem; }

.thread-body { flex: 1; min-width: 0; }
.thread-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
}
.thread-name  { font-size: .92rem; font-weight: 600; color: var(--navy); }
.thread-time  { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.thread-listing {
  margin: .15rem 0 .2rem;
}
.thread-listing-chip {
  display: inline-block;
  font-size: .72rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: .1em .6em;
  color: var(--text-muted);
}
.thread-preview {
  font-size: .83rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.thread-you { color: var(--navy); }

.thread-unread-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--gold);
  color: #000;
  font-size: .7rem;
  font-weight: 800;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: .2rem;
}

/* ── Thread view header ─────────────────────────────────────────────────── */
.thread-header {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

/* ── Message bubbles ────────────────────────────────────────────────────── */
.msg-thread {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-height: 520px;
  overflow-y: auto;
  padding: .5rem 0 1rem;
  scroll-behavior: smooth;
}
.msg-bubble {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}
.msg-bubble--mine   { align-self: flex-end; align-items: flex-end; }
.msg-bubble--theirs { align-self: flex-start; align-items: flex-start; }

.msg-bubble__body {
  padding: .65rem .9rem;
  border-radius: 18px;
  font-size: .9rem;
  line-height: 1.55;
  word-break: break-word;
}
.msg-bubble--mine   .msg-bubble__body { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble--theirs .msg-bubble__body { background: var(--bg); border: 1px solid var(--border); color: var(--navy); border-bottom-left-radius: 4px; }

.msg-bubble__meta {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .25rem;
  padding: 0 .25rem;
}
.msg-read-tick { color: var(--gold); font-weight: bold; }

/* ── Reply form ─────────────────────────────────────────────────────────── */
.msg-reply-form {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: .5rem;
}
.msg-reply-form .form-control {
  resize: none;
  min-height: 72px;
  transition: height .1s;
}
.msg-reply-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: .6rem;
}

/* ── Nav messages badge ─────────────────────────────────────────────────── */
.nav-messages-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.nav-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  border-radius: 9999px;
}


/* -- Step 7 � Admin Dashboard ------------------------------------------- */

/* Admin nav tabs */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
  padding: .75rem 0;
  border-bottom: 2px solid var(--gold-dark, #b8860b);
}
.admin-nav__link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: 6px;
  background: var(--bg-card, #1a1a2e);
  color: var(--text-muted, #aaa);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.admin-nav__link:hover {
  background: var(--bg-hover, #252540);
  color: var(--text, #f0f0f0);
}
.admin-nav__link--active {
  background: var(--gold, #d4a017);
  color: #0a0a1a;
}
.admin-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--silver, #888);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  border-radius: 9999px;
}
.admin-nav__badge--alert {
  background: #ef4444;
}

/* Stats sections */
.admin-stats-section {
  margin-bottom: 2.5rem;
}
.admin-stats-section__heading {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted, #aaa);
  margin-bottom: 1rem;
}
.stats-grid {
  display: grid;
  gap: 1rem;
}
.stats-grid--2 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); max-width: 500px; }
.stats-grid--3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* Large stat card variant */
.stat-card--large {
  padding: 1.5rem 1.25rem;
}
.stat-card--large .stat-card__num {
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 800;
  display: block;
  margin-bottom: .35rem;
}
.stat-card--large .stat-card__label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted, #aaa);
}
.stat-card--link {
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.stat-card--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.stat-card__num--gold  { color: var(--gold, #d4a017); }
.stat-card__num--green { color: #22c55e; }
.stat-card__num--red   { color: #ef4444; }
.stat-card__num--blue  { color: #60a5fa; }

/* Activity table */
.activity-table td,
.activity-table th {
  font-size: .83rem;
}
.action-badge {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 4px;
  background: var(--bg-hover, #252540);
  color: var(--text, #f0f0f0);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Users table */
.admin-users-table .row--disabled td {
  opacity: .5;
}
.admin-filter-form {
  margin-bottom: 1.5rem;
}
.admin-filter-form__fields {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}
.admin-filter-form__search {
  flex: 1 1 250px;
  min-width: 180px;
}
.admin-filter-form__role {
  width: 130px;
}

/* Generic badges */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.4;
}
.badge--green  { background: rgba(34,197,94,.15);  color: #22c55e; }
.badge--gold   { background: rgba(212,160,23,.15); color: #d4a017; }
.badge--red    { background: rgba(239,68,68,.15);  color: #ef4444; }
.badge--blue   { background: rgba(96,165,250,.15); color: #60a5fa; }
.badge--purple { background: rgba(168,85,247,.15); color: #a855f7; }
.badge--gray   { background: rgba(160,160,160,.15);color: #9ca3af; }

/* Danger/success ghost buttons */
.btn-danger-ghost {
  border: 1px solid #ef4444;
  color: #ef4444;
  background: transparent;
  padding: .3rem .65rem;
  border-radius: 5px;
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-danger-ghost:hover { background: rgba(239,68,68,.1); }
.btn-success-ghost {
  border: 1px solid #22c55e;
  color: #22c55e;
  background: transparent;
  padding: .3rem .65rem;
  border-radius: 5px;
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-success-ghost:hover { background: rgba(34,197,94,.1); }

/* Page header with flex row */
.page-header--flex {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem;
}

/* Dash item list (recent listings / recent bids in role dashboards) */
.dash-item-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.dash-item-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .5rem .65rem;
  background: var(--bg-hover, #252540);
  border-radius: 6px;
}
.dash-item-list__title {
  text-decoration: none;
  color: var(--text, #f0f0f0);
  font-size: .875rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-item-list__title:hover { color: var(--gold, #d4a017); }

/* Stat cards as links inside dash-stats */
.dash-stats .stat-card--link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
}

/* -- Step 8 � Market Page ---------------------------------------------- */

.market-page { padding: 2rem 0 4rem; }
.market-page .section-subtitle {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted, #aaa);
  margin-bottom: 1.25rem;
}

/* Spot price card grid */
.market-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.market-price-card {
  background: var(--bg-card, #1a1a2e);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 10px;
  padding: 1.25rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.market-price-card--na {
  opacity: .55;
}
.market-price-card__header {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.market-price-card__icon   { font-size: 1.6rem; line-height: 1; }
.market-price-card__name   { display: block; font-weight: 700; font-size: .95rem; }
.market-price-card__sym    { display: block; font-size: .72rem; color: var(--text-muted, #aaa); }
.market-price-card__price  { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.market-price-card__unit   { font-size: .75rem; color: var(--text-muted, #aaa); margin-left: .25rem; }
.market-price-card__change { font-size: .82rem; }

/* Market table */
.market-table th,
.market-table td { font-size: .85rem; }
.market-table .mineral-label { font-weight: 600; }

/* Price change colours (reused across pages) */
.price-change.up   { color: #22c55e; }
.price-change.down { color: #ef4444; }
.price-change.flat { color: var(--text-muted, #aaa); }

/* Disclaimer */
.market-disclaimer {
  margin-top: 2.5rem;
  padding: .85rem 1rem;
  background: var(--bg-card, #1a1a2e);
  border-left: 3px solid var(--border, #2a2a4a);
  border-radius: 4px;
  font-size: .78rem;
  color: var(--text-muted, #aaa);
}
.market-refreshed { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.market-unavailable { padding: 2rem; text-align: center; color: var(--text-muted, #aaa); }

/* Admin market form */
.admin-market-form .form-control--sm { padding: .3rem .5rem; font-size: .87rem; }
.admin-market-hint {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card, #1a1a2e);
  border-radius: 8px;
  border-left: 3px solid var(--gold, #d4a017);
  font-size: .85rem;
}
.admin-market-hint p { margin: .35rem 0 .5rem; color: var(--text-muted, #aaa); }
.code-inline {
  display: inline-block;
  padding: .2rem .55rem;
  background: rgba(255,255,255,.06);
  border-radius: 4px;
  font-family: monospace;
  font-size: .82rem;
}

/* ============================================================
   Step 9 — Contracts / Transactions
   ============================================================ */

/* Contracts index page */
.contracts-page {
  padding: 2rem 0 4rem;
}

/* Contract detail page */
.contract-view-page {
  padding: 2rem 0 4rem;
}

/* Status banner strip at top of contract detail */
.contract-status-banner {
  display: flex;
  align-items: center;
  padding: .75rem 1.25rem;
  border-radius: 8px;
  background: rgba(var(--color-neutral-rgb, 100,116,139),.08);
  border: 1px solid rgba(var(--color-neutral-rgb, 100,116,139),.15);
}

/* Larger status badge variant */
.status-badge--lg {
  font-size: .88rem;
  padding: .3rem .8rem;
}

/* Compact definition list used in contract detail cards */
.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem 1rem;
  font-size: .9rem;
  margin: 0;
}
.detail-list dt {
  color: var(--color-muted, #64748b);
  font-weight: 500;
  white-space: nowrap;
}
.detail-list dd {
  margin: 0;
}

/* Filter tabs (shared with admin pages) */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.filter-tab {
  display: inline-block;
  padding: .3rem .75rem;
  border-radius: 20px;
  border: 1px solid var(--color-border, #e2e8f0);
  font-size: .82rem;
  color: var(--color-muted, #64748b);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.filter-tab:hover {
  background: var(--color-surface, #f8fafc);
  color: var(--color-text, #1e293b);
}
.filter-tab--active {
  background: var(--color-primary, #1a56db);
  color: #fff;
  border-color: var(--color-primary, #1a56db);
}

/* Dispute details/summary toggle */
.contract-dispute-details > summary {
  list-style: none;
}
.contract-dispute-details > summary::-webkit-details-marker {
  display: none;
}

/* Admin transactions stat cards — alert variant */
.stat-card--alert {
  border-color: rgba(239,68,68,.3);
}
.stat-card--alert .stat-card__value {
  color: #ef4444;
}

/* Responsive contract grid */
@media (max-width: 640px) {
  .contract-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Legal pages (Privacy Policy / Terms of Service) ─────────────────────── */
.legal-page {
  padding-bottom: 2rem;
}
.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 .6rem;
  color: var(--color-text, #1e293b);
  border-bottom: 2px solid var(--color-primary, #1a56db);
  padding-bottom: .35rem;
}
.legal-content h3 {
  font-weight: 600;
  color: var(--color-text, #1e293b);
}
.legal-section {
  margin-bottom: 1.5rem;
  line-height: 1.75;
}
.legal-section p {
  margin-bottom: .75rem;
  color: var(--color-text-muted, #475569);
}
.legal-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: .75rem;
  color: var(--color-text-muted, #475569);
}
.legal-list li {
  margin-bottom: .4rem;
  line-height: 1.65;
}
.legal-content address a,
.legal-section a {
  color: var(--color-primary, #1a56db);
  text-decoration: underline;
}
@media (max-width: 640px) {
  .legal-content {
    padding: 0 .5rem 3rem;
  }
  .legal-content h2 {
    font-size: 1.1rem;
  }
}
