/* WorkLynkz theme — colours taken from the logo (navy tile, blue bars, orange arrow, silver WL).
   All colours are tokens here; pages use classes only (no inline styles: the CSP blocks them). */
:root {
  --navy-900: #061430;
  --navy-800: #0a1f44;
  --navy-700: #0f2c5c;
  --navy-600: #173a73;
  --blue-500: #1f7ae0;
  --blue-400: #4aa3ff;
  --orange-500: #f7931e;
  --orange-600: #e07d06;
  --silver-100: #f3f5f9;
  --silver-200: #e3e8f0;
  --silver-400: #a9b4c6;
  --text: #0e1a2f;
  --muted: #5b6b84;
  --ok: #138a52;
  --danger: #c7362d;
  --bg: #f3f5f9;
  --card: #ffffff;
  --border: #dde3ec;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(6, 20, 48, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; font-size: 16px; }
a { color: var(--blue-500); }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: .2px; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--silver-400); letter-spacing: .4px; }
.topbar nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar nav a { color: var(--silver-200); text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 10px; border-radius: 8px; }
.topbar nav a:hover { background: rgba(255,255,255,.08); }

/* ---------- layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
.narrow { max-width: 460px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 6px; font-size: 20px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.lead { color: var(--muted); margin: 0 0 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
input, select { width: 100%; padding: 12px 13px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--blue-400); outline-offset: 1px; border-color: var(--blue-400); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { width: auto; margin-top: 3px; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 10px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--silver-200); color: var(--navy-800); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--blue-500); color: #fff; }
.btn-primary:hover { background: #176ac6; }
.btn-accent { background: var(--orange-500); color: #1d1200; }
.btn-accent:hover { background: var(--orange-600); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--navy-700); }
.btn-danger { background: #fdecea; color: var(--danger); }
.btn-block { width: 100%; margin-top: 16px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form .row, input + .row, .msg + .row { margin-top: 12px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.univera-btn { background: #fff7ec; color: #8a4b00; border: 1px solid #f5c98a; }
.univera-btn:hover { background: #ffefd8; }

/* ---------- messages ---------- */
.msg { border-radius: 10px; padding: 11px 13px; font-size: 14px; margin: 12px 0 0; }
.msg-error { background: #fdecea; color: #8e231c; }
.msg-ok { background: #e7f6ee; color: #0d6b3f; }
.msg-info { background: #eaf3ff; color: #134c8f; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-ok { background: #e7f6ee; color: var(--ok); }
.badge-univera { background: #fff1de; color: #9a5300; }
.badge-muted { background: var(--silver-200); color: var(--muted); }
.badge-danger { background: #fdecea; color: var(--danger); }

/* ---------- hero (landing) ---------- */
.hero { background: radial-gradient(1200px 500px at 80% -10%, rgba(74,163,255,.35), transparent 60%),
        linear-gradient(160deg, var(--navy-900), var(--navy-700)); color: #fff; }
.hero-inner { max-width: 1080px; margin: 0 auto; padding: 56px 16px 64px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; margin: 0 0 14px; }
.hero h1 span { color: var(--orange-500); }
.hero p { color: var(--silver-200); font-size: 18px; margin: 0 0 24px; }
.hero-logo { justify-self: center; width: min(260px, 70%); filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); border-radius: 36px; }
@media (max-width: 760px) { .hero-inner { grid-template-columns: 1fr; padding-top: 36px; } .hero-logo { width: 150px; order: -1; } }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.feature h3 { margin: 4px 0 6px; }
.feature .icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: #eaf3ff; }
.soon { font-size: 11px; font-weight: 700; color: var(--orange-600); text-transform: uppercase; letter-spacing: .5px; }
.footer { color: var(--muted); font-size: 13px; text-align: center; padding: 24px 16px 40px; }

/* ---------- header extras ---------- */
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--orange-500); color: #1d1200; font-size: 11px; font-weight: 800; text-align: center; }
@media (max-width: 560px) { .topbar nav a { padding: 8px 6px; font-size: 13px; } .brand small { display: none; } .topbar nav { gap: 2px; } }
@media (max-width: 480px) { .brand > span { display: none; } } /* logo icon only, so the menu fits */
.topbar nav { overflow-x: auto; scrollbar-width: none; }
.topbar nav a { white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile b { display: block; font-size: 22px; color: var(--navy-700); }
.tile span { color: var(--muted); font-size: 13px; }
.task { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.reward { font-size: 22px; font-weight: 800; color: var(--ok); white-space: nowrap; }
.copy { display: flex; gap: 6px; }
.copy input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.unit { font-size: 13px; font-weight: 600; color: var(--muted); }
.stars { color: #d98b00; font-weight: 700; }
.tick { color: var(--blue-500); font-weight: 800; }

/* ---------- listing cards ---------- */
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
@media (max-width: 560px) { .lgrid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.lcard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .12s; }
.lcard:hover { transform: translateY(-2px); }
.lcard-img { aspect-ratio: 1 / 1; background: var(--silver-100); display: grid; place-items: center; font-size: 40px; }
.lcard-img img { width: 100%; height: 100%; object-fit: cover; }
.lcard-body { padding: 10px 12px 12px; }
.lcard-title { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcard-price { color: var(--navy-700); font-weight: 800; margin: 4px 0; }
.lcard-meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- browse ---------- */
.searchbar { display: flex; gap: 8px; }
.searchbar input { flex: 1; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.filters select, .filters input { padding: 10px 11px; font-size: 14px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 10px 0; }
.chip { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--navy-700); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---------- listing detail ---------- */
.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 760px) { .detail { grid-template-columns: 1fr; } }
.gallery-main { aspect-ratio: 1 / 1; background: var(--silver-100); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; font-size: 64px; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumbs button { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumbs button.on { border-color: var(--blue-500); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.price-big { font-size: 26px; font-weight: 800; color: var(--navy-700); margin: 6px 0 10px; }
.specs { width: 100%; font-size: 14px; }
.specs td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.specs td:first-child { color: var(--muted); width: 40%; }
.store-mini { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--text); }
.store-mini img, .avatar { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--silver-200); display: grid; place-items: center; font-size: 24px; flex: none; }
.notice { background: #fff8ec; border: 1px solid #f5d6a6; color: #7a4a05; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.review { border-top: 1px solid var(--border); padding: 12px 0; }
.review .reply { background: var(--silver-100); border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 14px; }
.star-pick { display: flex; gap: 4px; }
.star-pick button { font-size: 26px; background: none; border: 0; cursor: pointer; color: var(--silver-400); padding: 0 2px; }
.star-pick button.on { color: #f0a000; }
.pre { white-space: pre-wrap; }
textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--border); border-radius: 10px; font: inherit; min-height: 90px; resize: vertical; }

/* ---------- store page ---------- */
.store-cover { height: 180px; background: linear-gradient(135deg, var(--navy-800), var(--blue-500)); border-radius: var(--radius); overflow: hidden; }
.store-cover img { width: 100%; height: 100%; object-fit: cover; }
.store-head { display: flex; gap: 16px; align-items: flex-end; margin: -40px 16px 16px; }
.store-head .avatar { width: 88px; height: 88px; border: 4px solid #fff; border-radius: 18px; font-size: 38px; }
.store-head > div { padding-top: 44px; min-width: 0; } /* name sits below the cover, never on it */
.store-head h2 { margin: 0 0 4px; line-height: 1.2; }

/* ---------- seller dashboard ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--navy-700); border-bottom-color: var(--orange-500); }
.mylist { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mylist img, .mylist .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--silver-100); display: grid; place-items: center; flex: none; }
.mylist .grow { flex: 1; min-width: 0; }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-row .ph { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--silver-100); }
.photo-row .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-row .ph button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.photo-add { width: 84px; height: 84px; border-radius: 10px; border: 2px dashed var(--border); display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 28px; }
.spec-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-bottom: 8px; }
.status-pending_review { background: #fff1de; color: #9a5300; }
.status-active { background: #e7f6ee; color: var(--ok); }
.status-rejected, .status-removed { background: #fdecea; color: var(--danger); }
.status-hidden { background: var(--silver-200); color: var(--muted); }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
@media (max-width: 760px) { .inbox { grid-template-columns: 1fr; } .inbox.open .threads { display: none; } .inbox:not(.open) .chat { display: none; } }
.threads { padding: 0; overflow: hidden; }
.thread { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.thread.on { background: #eef5ff; }
.thread.unread .t-title::before { content: "● "; color: var(--orange-500); }
.t-title { font-weight: 700; font-size: 14px; }
.t-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { display: flex; flex-direction: column; min-height: 60vh; }
.bubbles { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 6px 0 12px; overflow-y: auto; max-height: 60vh; }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; background: var(--silver-100); align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.bubble.mine { align-self: flex-end; background: var(--blue-500); color: #fff; }
.bubble small { display: block; font-size: 11px; opacity: .7; margin-top: 3px; }
.composer { display: flex; gap: 8px; }
.composer textarea { min-height: 46px; height: 46px; }

dialog.card { width: min(440px, calc(100vw - 32px)); border: 0; }

/* ---------- sponsored, banner, plans ---------- */
.lcard.sponsored { position: relative; border-color: #f5c98a; }
.sp-tag { position: absolute; top: 8px; left: 8px; z-index: 1; background: rgba(6,20,48,.78); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.banner { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; text-decoration: none; color: #fff; border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px; background: linear-gradient(120deg, var(--navy-800), var(--blue-500)); position: relative; overflow: hidden; }
.banner img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; }
.banner b { display: block; font-size: 20px; }
.banner .sp-tag { position: static; display: inline-block; margin-bottom: 6px; background: rgba(255,255,255,.18); }
@media (max-width: 560px) { .banner { grid-template-columns: 1fr; } .banner img { width: 100%; height: 140px; } }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; gap: 6px; }
.plan.current { outline: 3px solid var(--orange-500); }
.plan .price-big { margin: 0; }
.plan ul { padding-left: 18px; margin: 6px 0 12px; color: var(--muted); font-size: 14px; flex: 1; }
.receipt { max-width: 560px; margin: 0 auto; }
.receipt td { padding: 6px 0; }
@media print { .topbar, .no-print { display: none !important; } body { background: #fff; } .card { box-shadow: none; border: 0; } }
dialog::backdrop { background: rgba(6, 20, 48, .55); }

/* ---------- admin ---------- */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
.sidebar { background: var(--navy-800); padding: 16px 10px; }
.sidebar a { display: block; color: var(--silver-200); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.sidebar a.active, .sidebar a:hover { background: var(--navy-600); color: #fff; }
.admin-main { padding: 22px; min-width: 0; }
@media (max-width: 760px) { .admin-layout { grid-template-columns: 1fr; } .sidebar { display: flex; overflow-x: auto; gap: 4px; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat b { display: block; font-size: 28px; color: var(--navy-700); }
.stat span { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f7f9fc; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.qr { display: inline-block; background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--border); }
