:root {
  --bg: #0b1020;
  --bg-soft: #111831;
  --surface: #151d38;
  --surface-2: #1b2442;
  --border: #26304f;
  --border-soft: #1f2740;
  --text: #eef1fb;
  --text-soft: #c3cbe4;
  --muted: #8b94b8;
  --primary: #6c5ce7;
  --primary-2: #8e7cf0;
  --accent: #f7b500;
  --accent-2: #ffd95e;
  --green: #2ecc71;
  --red: #e74c3c;
  --orange: #f39c12;
  --blue: #4aa8ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --nav-h: 62px;
  --grad: linear-gradient(135deg, #6c5ce7 0%, #a55eea 60%, #f7b500 140%);
  --card-grad: linear-gradient(160deg, rgba(108, 92, 231, 0.16), rgba(247, 181, 0, 0.08));
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="light"] {
  --bg: #f4f6fc;
  --bg-soft: #e9edf8;
  --surface: #ffffff;
  --surface-2: #f0f3fa;
  --border: #dfe4f0;
  --border-soft: #e8ecf5;
  --text: #161b33;
  --text-soft: #3d4668;
  --muted: #6b7394;
  --shadow: 0 8px 24px rgba(22, 27, 51, 0.08);
  --card-grad: linear-gradient(160deg, rgba(108, 92, 231, 0.07), rgba(247, 181, 0, 0.04));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body { text-align: right; }

a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; }

/* Layout */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.page { padding: 28px 0 80px; min-height: calc(100vh - var(--nav-h)); }
.grid { display: grid; gap: 18px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.split { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 40;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
[data-theme="light"] .nav { background: color-mix(in srgb, var(--surface) 86%, transparent); }
.nav-inner { display: flex; align-items: center; gap: 18px; height: var(--nav-h); }
.brand { font-weight: 800; font-size: 19px; letter-spacing: -0.4px; display: flex; align-items: center; gap: 9px; color: var(--text); }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; color: #0b1020; font-size: 15px;
}
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-soft); padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-right { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; font-size: 16px;
}
.icon-btn:hover { color: var(--text); border-color: var(--primary); }
.icon-btn .badge-count {
  position: absolute; top: -6px; inset-inline-end: -6px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.icon-btn .badge-count.hidden { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-soft); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: 0.15s; font-family: inherit; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--text); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #221600; }
.btn-gold:hover { filter: brightness(1.05); color: #221600; }
.btn-ghost { background: transparent; }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards / surfaces */
.card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.surface-2 { background: var(--surface-2); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.section-title h2 { font-size: 20px; margin: 0; }
.section-title .see-all { font-size: 13.5px; font-weight: 600; }

/* Listing card */
.listing-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  overflow: hidden; transition: 0.18s; position: relative; display: flex; flex-direction: column;
}
.listing-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow); }
.listing-media { aspect-ratio: 5/6; background: var(--card-grad); display: flex; align-items: center; justify-content: center; padding: 14px; cursor: pointer; }
.listing-media img { width: 100%; height: 100%; object-fit: contain; }
.listing-media .placeholder { color: var(--muted); font-size: 34px; }
.listing-media .tag { position: absolute; top: 10px; inset-inline-start: 10px; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.3px; }
.tag.graded { background: rgba(108, 92, 231, 0.18); color: var(--primary-2); }
.tag.trade { background: rgba(247, 181, 0, 0.16); color: var(--accent); }
.tag.sale { background: rgba(46, 204, 113, 0.16); color: var(--green); }
.tag.raw { background: rgba(139, 148, 184, 0.18); color: var(--muted); }
.listing-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-name { font-weight: 700; font-size: 15px; color: var(--text); cursor: pointer; }
.listing-name:hover { color: var(--primary-2); }
.listing-meta { color: var(--muted); font-size: 12.5px; }
.listing-price { font-weight: 800; font-size: 17px; color: var(--accent); }
.listing-seller { display: flex; align-items: center; gap: 7px; margin-top: 7px; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--text-soft); }
.field .hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-family: inherit; font-size: 14.5px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.18); }
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: auto; }
.checkline { display: flex; align-items: center; gap: 9px; font-size: 14px; }

/* Hero */
.hero { padding: 54px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.hero .sub { color: var(--text-soft); font-size: 17px; max-width: 640px; margin: 0 auto 26px; }
.hero-stats { display: flex; justify-content: center; gap: 34px; margin-top: 34px; flex-wrap: wrap; }
.hero-stat .num { font-size: 24px; font-weight: 800; color: var(--accent); }
.hero-stat .lab { color: var(--muted); font-size: 13px; }
.search-hero { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.search-hero input { padding: 14px 16px; font-size: 15px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  background: none; border: none; cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted); padding: 11px 15px; border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--primary); }

/* Tables (admin) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: start; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tr:hover td { background: var(--surface-2); }

/* Misc */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.verified { background: rgba(74, 168, 255, 0.16); color: var(--blue); }
.badge.trust { background: rgba(108, 92, 231, 0.16); color: var(--primary-2); }
.badge.gold { background: rgba(247, 181, 0, 0.16); color: var(--accent); }
.badge.red { background: rgba(231, 76, 60, 0.14); color: var(--red); }
.badge.green { background: rgba(46, 204, 113, 0.15); color: var(--green); }
.badge.blue { background: rgba(74, 168, 255, 0.14); color: var(--blue); }
.badge.muted { background: var(--surface-2); color: var(--muted); }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: inline-flex; align-items: center; justify-content: center; color: #0b1020; font-weight: 800; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 66px; height: 66px; font-size: 24px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }

.stars { color: var(--accent); letter-spacing: 1px; }
.stars .off { color: var(--border); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.center { text-align: center; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.divider { border: 0; border-top: 1px solid var(--border-soft); margin: 22px 0; }

/* Toast */
#toasts { position: fixed; bottom: 22px; inset-inline-end: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--primary);
  padding: 13px 16px; border-radius: 11px; box-shadow: var(--shadow); min-width: 260px; max-width: 360px; animation: pop 0.2s ease;
  font-size: 14px;
}
.toast.success { border-inline-start-color: var(--green); }
.toast.error { border-inline-start-color: var(--red); }
.toast.info { border-inline-start-color: var(--blue); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(5, 8, 18, 0.62); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 460px; box-shadow: var(--shadow); animation: pop 0.18s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border-soft); }
.modal-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; }

/* Filter pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pill.active { border-color: var(--primary); color: var(--primary-2); background: rgba(108, 92, 231, 0.1); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }

/* Skeleton loading */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.alert { padding: 12px 15px; border-radius: 10px; font-size: 14px; border: 1px solid var(--border); }
.alert.info { background: rgba(74, 168, 255, 0.1); border-color: rgba(74, 168, 255, 0.3); color: var(--blue); }
.alert.warn { background: rgba(247, 181, 0, 0.1); border-color: rgba(247, 181, 0, 0.3); color: var(--accent); }
.alert.error { background: rgba(231, 76, 60, 0.1); border-color: rgba(231, 76, 60, 0.3); color: var(--red); }
.alert.success { background: rgba(46, 204, 113, 0.1); border-color: rgba(46, 204, 113, 0.3); color: var(--green); }

/* Footer */
.footer { border-top: 1px solid var(--border-soft); padding: 34px 0 40px; margin-top: 40px; color: var(--muted); font-size: 13.5px; }
.footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 22px; }
.footer h4 { color: var(--text-soft); font-size: 14px; margin-bottom: 9px; }
.footer a { display: block; margin-bottom: 6px; color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer .bottom { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border-soft); text-align: center; }

/* Auth page */
.auth-wrap { max-width: 430px; margin: 30px auto; }
.auth-logo { font-size: 15px; margin-bottom: 18px; }

/* Profile */
.profile-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.profile-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 8px; }
.profile-stats .pstat .num { font-weight: 800; font-size: 19px; }
.profile-stats .pstat .lab { color: var(--muted); font-size: 12.5px; }

/* Rating summary */
.rating-summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; max-width: 260px; }
.rating-summary .bar { height: 7px; border-radius: 4px; background: var(--border); overflow: hidden; }
.rating-summary .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* Gallery */
.gallery { display: grid; gap: 12px; }
.gallery-main { aspect-ratio: 5/6; background: var(--card-grad); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumbs img { width: 64px; height: 80px; object-fit: contain; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; background: var(--surface-2); padding: 4px; }
.gallery-thumbs img.active { border-color: var(--primary); }

/* Notification list */
.notif-item { display: flex; gap: 12px; padding: 12px; border-radius: 10px; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.notif-item .dot.read { background: var(--border); }

/* Chat bubbles */
.msg-row { display: flex; margin-bottom: 10px; }
.msg-row.mine { justify-content: flex-end; }
.msg-bubble { max-width: 74%; padding: 9px 13px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border-soft); white-space: pre-wrap; }
.msg-row.mine .msg-bubble { background: rgba(108, 92, 231, 0.18); border-color: rgba(108, 92, 231, 0.35); }
.msg-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }

.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.chart .col { flex: 1; background: var(--primary); border-radius: 5px 5px 0 0; min-height: 2px; opacity: 0.85; }
.chart .col:hover { opacity: 1; }

.hidden { display: none !important; }

/* =====================================================================
   Components that were referenced by the pages but previously unstyled
   ===================================================================== */

.normal { font-weight: 400; }

.avatar.xl { width: 92px; height: 92px; font-size: 34px; }

.profile-banner {
  height: 180px;
  background: var(--grad);
  overflow: hidden;
}
.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-head { margin-top: -44px; position: relative; z-index: 1; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: start;
  color: var(--text);
  font-family: inherit;
}
button.stat { cursor: pointer; transition: 0.15s; }
button.stat:hover { border-color: var(--primary); transform: translateY(-2px); }
.stat .num { font-size: 22px; font-weight: 800; line-height: 1.2; }
.stat .lab { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.listing-split { grid-template-columns: minmax(0, 1fr) 380px; }

.messages-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 16px;
  align-items: start;
}

.suggest { position: relative; }
.suggest-it {
  display: block;
  width: 100%;
  text-align: start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 6px;
  color: var(--text-soft);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
}
.suggest-it:hover { border-color: var(--primary); color: var(--text); }

.table { min-width: 560px; }
.table th, .table td { white-space: nowrap; }

.tabs button { white-space: nowrap; flex: 0 0 auto; }
.pills { overflow-x: auto; padding-bottom: 2px; }

/* =====================================================================
   Member dashboard
   ===================================================================== */

.dash-head {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.14), rgba(247, 181, 0, 0.06)), var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 4px;
}
.dash-head .who { flex: 1; min-width: 200px; }
.dash-head .who h1 { margin: 0; font-size: 22px; }
.dash-head .meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 13px; }
.dash-head .rating { display: inline-flex; align-items: center; gap: 6px; }
.dash-head .dash-cta { display: flex; gap: 8px; flex-wrap: wrap; }

.stat { position: relative; overflow: hidden; }
.stat .ico {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 8px; background: var(--surface-2); color: var(--text-soft);
}
.stat.c-primary { border-inline-start: 3px solid var(--primary); }
.stat.c-accent { border-inline-start: 3px solid var(--accent); }
.stat.c-green { border-inline-start: 3px solid var(--green); }
.stat.c-blue { border-inline-start: 3px solid var(--blue); }
.stat.c-red { border-inline-start: 3px solid var(--red); }
.stat.c-primary .ico { background: rgba(108, 92, 231, 0.16); color: var(--primary-2); }
.stat.c-accent .ico { background: rgba(247, 181, 0, 0.16); color: var(--accent); }
.stat.c-green .ico { background: rgba(46, 204, 113, 0.16); color: var(--green); }
.stat.c-blue .ico { background: rgba(74, 168, 255, 0.16); color: var(--blue); }
.stat.c-red .ico { background: rgba(231, 76, 60, 0.16); color: var(--red); }

.dash-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.dash-toolbar .dash-search { flex: 1; min-width: 180px; max-width: 340px; }
.dash-toolbar select { width: auto; }

.dash-split { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }

.dash-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.dash-action { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.dash-action .ico { font-size: 18px; width: auto; }
.dash-action:hover { border-color: var(--primary); text-decoration: none; }

.expander { padding: 0; overflow: hidden; }
.expander > summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: center; gap: 12px; }
.expander > summary::-webkit-details-marker { display: none; }
.expander > summary .chev { margin-inline-start: auto; color: var(--muted); transition: transform 0.15s; }
.expander[open] > summary .chev { transform: rotate(180deg); }
.expander > summary:hover { background: var(--surface-2); }
.expander .expander-body { padding: 14px 18px 16px; border-top: 1px solid var(--border-soft); }

.trade-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 4px; }
.ti-group h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.ti { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border-soft); margin-bottom: 6px; font-size: 13.5px; }
.ti .qty { margin-inline-start: auto; color: var(--muted); font-weight: 700; }

.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: 6px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }

.tx-steps { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.tx-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tx-step .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.tx-step.done .dot { background: var(--green); }
.tx-step.current .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(247, 181, 0, 0.2); }
.tx-step.done, .tx-step.current { color: var(--text-soft); }

/* =====================================================================
   Mobile bottom bar (app-style navigation)
   ===================================================================== */

.mobile-bar {
  position: fixed; z-index: 45; inset-inline: 0; bottom: 0;
  display: flex; justify-content: center;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}
.mobile-bar .mb-inner {
  pointer-events: auto;
  display: flex; align-items: stretch; justify-content: space-between;
  width: 100%; max-width: 540px;
  padding: 5px 6px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.mobile-bar a {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 6px 2px; border-radius: 14px;
  color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 700;
  transition: color 0.15s;
}
.mobile-bar a:hover { color: var(--text-soft); text-decoration: none; }
.mobile-bar a.active { color: var(--primary-2); }
.mobile-bar .mb-ico { font-size: 19px; line-height: 1; }
.mobile-bar .mb-lab { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-bar a.mb-add .mb-ico {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 20px rgba(108, 92, 231, 0.45);
}
.mobile-bar a.mb-add { color: var(--primary-2); }

body { padding-bottom: 84px; }

/* =====================================================================
   Responsive
   ===================================================================== */

#nav-toggle { display: none; }

@media (max-width: 980px) {
  .nav-inner { flex-wrap: wrap; }
  #nav-toggle { display: inline-flex; margin-inline-start: auto; order: 2; }
  .nav-links, .nav-right { display: none; }
  .nav.menu-open { height: auto; }
  .nav.menu-open .nav-inner { height: auto; padding-top: 10px; padding-bottom: 12px; }
  .nav.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    order: 3;
    gap: 2px;
    padding-top: 8px;
  }
  .nav.menu-open .nav-links a { padding: 11px 14px; border-radius: 10px; }
  .nav.menu-open .nav-right {
    display: flex;
    flex-basis: 100%;
    order: 4;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
  }
  .nav.menu-open .nav-right #nav-auth { display: flex; gap: 8px; flex-wrap: wrap; }

  .split { grid-template-columns: 1fr; }
  .dash-split { grid-template-columns: 1fr; }
  .listing-split { grid-template-columns: 1fr; }
  .listing-split > aside { position: static !important; }
  .messages-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .container { padding: 0 14px; }
  .page { padding: 18px 0 60px; }

  .flex { flex-wrap: wrap; }
  .flex > .field { flex: 1 1 100% !important; }
  .form-grid { grid-template-columns: 1fr; }

  .hero { padding: 34px 0 26px; }
  .hero-stats { gap: 20px; }
  .search-hero { flex-direction: column; }
  .search-hero .btn { width: 100%; }

  .section-title { flex-wrap: wrap; }
  .card { padding: 15px; }

  #toasts { inset-inline: 12px; bottom: 92px; }
  .toast { min-width: 0; max-width: none; }

  .modal-overlay { padding: 3vh 10px 10px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }

  .stat .num { font-size: 20px; }
  table { font-size: 12.5px; }
  th, td { padding: 8px; }

  .dash-head { padding: 15px; }
  .dash-toolbar .dash-search { max-width: none; }
  .dash-toolbar select { width: 100%; }

  .mobile-bar { padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .mobile-bar .mb-inner { max-width: none; border-radius: 18px; }
  .mobile-bar .mb-lab { font-size: 10px; }
}

/* =====================================================================
   Admin console (staff back office)
   ===================================================================== */

body.admin-mode { padding-bottom: 0; }
body.admin-mode .nav,
body.admin-mode .footer,
body.admin-mode .mobile-bar { display: none !important; }
body.admin-mode .page { padding: 0; min-height: 100vh; }

.admin-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

/* Sidebar */
.admin-side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px;
  background: var(--bg-soft);
  border-inline-end: 1px solid var(--border-soft);
  z-index: 50;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.4px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.admin-brand .logo { color: var(--primary-2); }
.admin-brand-sub {
  margin-inline-start: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.admin-nav { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.admin-nav-group { display: flex; flex-direction: column; gap: 3px; }
.admin-nav-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  padding: 0 9px 5px;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
}
.admin-nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.admin-nav-item.active { background: var(--primary); color: #fff; }
.admin-nav-ico { width: 20px; text-align: center; font-size: 15px; flex: 0 0 auto; }
.admin-side-foot { padding-top: 12px; border-top: 1px solid var(--border-soft); }

/* Main column */
.admin-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.admin-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 22px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
[data-theme="light"] .admin-top { background: color-mix(in srgb, var(--surface) 88%, transparent); }
.admin-page-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
  white-space: nowrap;
}
.admin-title-ico { font-size: 17px; }
.admin-search { position: relative; margin-inline-start: auto; width: 100%; max-width: 340px; }
.admin-search .input { width: 100%; }
.admin-search-results {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline: 0;
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.admin-search-it {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 13.5px;
}
.admin-search-it:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.admin-top-right { display: flex; align-items: center; gap: 10px; }
.admin-me { white-space: nowrap; }
.admin-burger { display: none; }
.admin-content { flex: 1; min-width: 0; padding: 22px; }
.admin-overlay { display: none; }

/* Dashboard grid + charts */
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.admin-grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.admin-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-chart {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.admin-chart-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.admin-chart .chart { height: 90px; }
.admin-side-cards { display: flex; flex-direction: column; gap: 14px; }
.admin-health { display: flex; flex-direction: column; gap: 6px; }
.admin-delta { font-size: 11.5px; font-weight: 700; }
.admin-delta.up { color: var(--green); }
.admin-delta.down { color: var(--red); }
.admin-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-inline-end: 7px;
  vertical-align: middle;
}
.stat.c-gold { border-inline-start: 3px solid var(--accent); }

/* Mini rows (small key/value lists) */
.admin-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
  color: var(--text);
}
.admin-mini-row:last-child { border-bottom: none; }
.admin-mini-name { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); }
a.admin-mini-row, a.admin-mini-name { text-decoration: none; }
a.admin-mini-row:hover { text-decoration: none; background: var(--surface-2); }
button.admin-mini-row {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: start;
  border-radius: 8px;
  padding-inline: 8px;
}
button.admin-mini-row:hover { background: var(--surface-2); }

/* List toolbar */
.admin-list-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.admin-filters .input { width: auto; min-width: 150px; }
.admin-bulkbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.admin-bulkbar .input { width: auto; min-width: 130px; }
.admin-table-host { min-height: 120px; }
.admin-checkcol { width: 36px; }
.admin-rowactions { text-align: end; white-space: nowrap; }
.admin-rowactions .btn + .btn { margin-inline-start: 6px; }

/* User / detail headers */
.admin-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--muted);
}
.admin-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.admin-user-head-main { display: flex; align-items: center; gap: 14px; }
.admin-user-head-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-user-cell { display: flex; align-items: center; gap: 10px; color: var(--text); }

.admin-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}
.admin-kv:last-child { border-bottom: none; }
.admin-kv span { color: var(--muted); }
.admin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.admin-inline-form .input { flex: 1; min-width: 140px; }

/* Notes */
.admin-notes { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.admin-note {
  position: relative;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
}
.admin-note-body { white-space: pre-wrap; margin-bottom: 6px; }
.admin-note .btn { position: absolute; top: 8px; inset-inline-end: 8px; }
.admin-note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.admin-note-form textarea { min-height: 70px; }

/* Timeline */
.admin-timeline { display: flex; flex-direction: column; }
.admin-tl-item { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.admin-tl-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
}
.admin-tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: 22px;
  bottom: -8px;
  width: 2px;
  background: var(--border);
}

/* Queue */
.admin-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
}
.admin-queue-item:last-child { border-bottom: none; }
.admin-queue-item:hover { text-decoration: none; background: var(--surface-2); }

/* Roles & permissions */
.admin-perms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin: 14px 0;
  max-height: 340px;
  overflow-y: auto;
}
.admin-perm-group { display: flex; flex-direction: column; gap: 4px; }

/* Announcements */
.admin-ann-list { display: flex; flex-direction: column; gap: 12px; }
.admin-ann-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.admin-ann-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Settings tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}
.admin-tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.admin-tabs button.active { color: var(--text); border-bottom-color: var(--primary); }
.admin-toggle { display: flex; flex-direction: column; }

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

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: 272px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  [dir="rtl"] .admin-side { transform: translateX(100%); }
  .admin-side.open { transform: translateX(0); }
  .admin-burger { display: inline-flex; }
  .admin-overlay.show {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.5);
  }
  .admin-search { max-width: none; }
  .admin-me { display: none; }
  .admin-content { padding: 16px; }
  .admin-top { padding: 10px 14px; }
}

@media (max-width: 620px) {
  .admin-content { padding: 12px; }
  .admin-filters .input,
  .admin-filters .btn { width: 100%; }
  .admin-user-head-main { align-items: flex-start; }
  .admin-user-actions .btn { flex: 1 1 auto; }
  .admin-note .btn { position: static; margin-top: 6px; }
}
