@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root[data-theme="light"] {
  --bg: #F2F6FC;
  --surf: #FFFFFF;
  --surf-2: #F8FAFE;
  --txt: #0A1830;
  --soft: #5A6B85;
  --mut: #8A97AC;
  --line: #DCE3F0;
  --blue: #2A55FF;
  --blue-dk: #1B3AC4;
  --glow: #00C2FF;
  --hero: #0A1830;
  --danger: #C4335A;
  --star: #FFB020;
  --wa: #25D366;
  --shadow: 0 1px 2px rgba(10,24,48,.04);
}
:root[data-theme="dark"] {
  --bg: #060A14;
  --surf: #0E1730;
  --surf-2: #0B1226;
  --txt: #EAF0FF;
  --soft: #8DA0C4;
  --mut: #5C6C8C;
  --line: #1E2A47;
  --blue: #4C7FFF;
  --blue-dk: #3A63E0;
  --glow: #00E1FF;
  --hero: #0B1226;
  --danger: #E15C82;
  --star: #FFB020;
  --wa: #25D366;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
body { min-height: 100vh; }

.brand { font-family: 'Space Grotesk', sans-serif; font-weight: 600; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo img { display: block; border-radius: 50%; object-fit: cover; }

/* Bouton d'installation PWA dans le header */
.install-app-btn {
  flex: 0 0 auto;
}
.install-app-btn svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 520px) {
  .install-app-btn {
    width: 40px;
    height: 40px;
    padding: 0;
  }
}
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
button { font-family: 'Inter', sans-serif; cursor: pointer; border: none; background:none; }
input, textarea, select { font-family: 'Inter', sans-serif; font-size: 15px; }
a { color: inherit; text-decoration:none; }


.view { display: none; opacity: 0; }
.view.active { display: block; animation: viewIn .25s ease forwards; }
#view-auth.active { display: flex; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.product-card { position: relative; }
.condition-badge { position: absolute; top: 10px; left: 10px; background: rgba(10,24,48,.72); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 7px; z-index: 2; backdrop-filter: blur(2px); }
.pro-badge { position: absolute; top: 10px; right: 10px; background: var(--glow); color: var(--hero); font-size: 10.5px; font-weight: 700; padding: 4px 7px; border-radius: 7px; z-index: 2; }

.skeleton-card { background: var(--surf); border: 0.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.skeleton-thumb, .skeleton-line { background: linear-gradient(90deg, var(--surf-2) 25%, var(--line) 37%, var(--surf-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton-thumb { aspect-ratio: 1; }
.skeleton-line { height: 10px; border-radius: 4px; margin: 10px 12px; }
.skeleton-line.short { width: 50%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

#loading-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--hero); z-index: 999; flex-direction: column; gap: 14px;
}
#loading-screen .brand { font-size: 28px; color: #fff; }
#loading-screen .brand b { color: var(--glow); }
#loading-screen .brand-logo img { width: 56px; height: 56px; }
.spinner { width: 22px; height: 22px; border: 2.5px solid rgba(255,255,255,.2); border-top-color: var(--glow); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Auth ---------- */
#view-auth { min-height: 100vh; align-items: center; justify-content: center; padding: 24px; background: var(--hero); }
.auth-card { width: 100%; max-width: 380px; background: var(--surf); border: 0.5px solid var(--line); border-radius: 18px; padding: 40px 32px; box-shadow: var(--shadow); }
.auth-card .brand { font-size: 30px; text-align: center; margin-bottom: 4px; color: var(--txt); display: flex; justify-content: center; }
.auth-card .brand b { color: var(--blue); }
.auth-card .brand-logo img { width: 44px; height: 44px; }
.auth-tagline { text-align: center; color: var(--soft); font-size: 14px; margin-bottom: 28px; }
.btn-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--surf); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 15px; font-weight: 500; color: var(--txt); transition: border-color .15s; }
.btn-google:hover { border-color: var(--blue); }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--mut); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.field { margin-bottom: 14px; }
.field-label-top { display:block; font-size: 13px; color: var(--soft); margin-bottom: 8px; }
.field label { display: block; font-size: 13px; color: var(--soft); margin-bottom: 5px; }
.field input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surf-2); color: var(--txt); }
.field input:focus { outline: none; border-color: var(--blue); }
.btn-primary { width: 100%; background: var(--blue); color: #fff; padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 600; margin-top: 6px; transition: background .15s; text-align:center; }
.btn-primary:hover { background: var(--blue-dk); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.auth-switch { text-align: center; font-size: 13px; color: var(--soft); margin-top: 20px; }
.auth-switch button { background: none; color: var(--blue); font-weight: 600; text-decoration: underline; padding: 0; }
.auth-error { background: rgba(196,51,90,.1); border: 1px solid var(--danger); color: var(--danger); font-size: 13px; padding: 9px 12px; border-radius: 10px; margin-bottom: 14px; display: none; }
.auth-error.show { display: block; }

/* ---------- App shell ---------- */
#view-app { min-height: 100vh; padding-bottom: 76px; }
.topbar { position: sticky; top: 0; z-index: 50; background: var(--hero); }
.topbar-row { display: flex; align-items: center; gap: 10px; max-width: 900px; margin: 0 auto; padding: 14px 20px 0; }
.topbar .brand { font-size: 21px; color: #fff; flex-shrink: 0; }
.topbar .brand b { color: var(--glow); }
.topbar .brand-logo img { width: 32px; height: 32px; }
.icon-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: #fff; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.icon-btn svg { width: 16px; height: 16px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 22px; padding: 9px 14px; min-width:0; }
.search-box svg { width: 16px; height: 16px; color: rgba(255,255,255,.6); flex-shrink: 0; }
.search-box input { border: none; background: none; width: 100%; font-size: 14px; color: #fff; min-width:0; }
.search-box input::placeholder { color: rgba(255,255,255,.5); }
.search-box input:focus { outline: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; cursor: pointer; }
.pill-row { display: flex; gap: 8px; overflow-x: auto; max-width: 900px; margin: 0 auto; padding: 14px 20px; scrollbar-width: none; }
.pill-row::-webkit-scrollbar { display: none; }
.pill { flex-shrink: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: 7px 15px; font-size: 13px; color: rgba(255,255,255,.85); white-space: nowrap; }
.pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.filter-panel { display: none; max-width: 900px; margin: 0 auto; padding: 0 20px 14px; flex-direction: column; gap: 8px; }
.filter-panel.show { display: flex; }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-row select, .filter-row input { flex: 1; min-width: 100px; padding: 9px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; font-size: 13px; }
.filter-row select option { color: #000; }
.filter-row input::placeholder { color: rgba(255,255,255,.5); }
.filter-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255,255,255,.85); white-space: nowrap; }
.filter-clear { color: var(--glow); font-size: 13px; text-decoration: underline; margin-left: auto; }

.content { max-width: 900px; margin: 0 auto; padding: 22px 20px; }
.hero-card { background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dk) 100%); border-radius: 18px; padding: 28px 24px; margin-bottom: 20px; color: #fff; }
.hero-card h2 { font-size: 22px; margin-bottom: 6px; }
.hero-card p { font-size: 14px; opacity: .85; margin: 0 0 16px; max-width: 420px; }
.hero-btn { background: #fff; color: var(--blue-dk); border-radius: 22px; padding: 10px 20px; font-size: 14px; font-weight: 600; }

.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.tile { background: var(--surf); border: 0.5px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; height: 96px; cursor: pointer; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--blue); }
.tile span { font-size: 14px; font-weight: 600; }
.tile svg { width: 22px; height: 22px; color: var(--blue); }

.content-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.content-header h2 { font-size: 19px; }
.result-count { font-size: 13px; color: var(--mut); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.product-card { background: var(--surf); border: 0.5px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; box-shadow: var(--shadow); }
.product-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.product-thumb { width: 100%; aspect-ratio: 4 / 3.4; display: flex; align-items: center; justify-content: center; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px; color: rgba(255,255,255,.95); text-align: center; padding: 10px; background: var(--blue); position:relative; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-count-badge { position:absolute; bottom:8px; right:8px; background:rgba(10,24,48,.72); color:#fff; font-size:11px; font-weight:600; padding:3px 7px; border-radius:7px; }
.product-card-body { padding: 12px 14px 14px; }
.product-title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-meta { font-size: 12.5px; color: var(--mut); }
.product-price { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; color: var(--blue); margin-top: 5px; }
.product-stars { font-size: 12px; color: var(--star); margin-top:3px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--soft); }
.empty-state h3 { color: var(--txt); margin-bottom: 8px; font-size: 18px; }
.empty-state p { font-size: 14px; margin-bottom: 18px; }

/* Menu bas — position:fixed fonctionne car il n'est plus jamais dans un ancêtre avec transform */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surf); border-top: 0.5px solid var(--line); display: flex; z-index: 200; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav button { flex: 1; background: none; padding: 10px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--mut); position: relative; }
.bottom-nav button.active { color: var(--blue); }
.bottom-nav svg { width: 20px; height: 20px; }
.badge-dot { position:absolute; top:4px; right: calc(50% - 16px); width:8px; height:8px; border-radius:50%; background:var(--danger); }

/* ---------- Detail ---------- */
.detail-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--hero); position: sticky; top: 0; z-index: 40; }
.detail-header .brand { color: #fff; font-size: 17px; }
.detail-header .brand-logo img { width: 28px; height: 28px; }
.back-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: #fff; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; flex-shrink:0; }
.back-btn svg { width: 18px; height: 18px; }
.chat-header-name { color:#fff; font-size:14px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-header-product { color:rgba(255,255,255,.6); font-size:11.5px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.detail-photo-wrap { position: relative; width:100%; max-height: 420px; overflow:hidden; }
.detail-photo { display: flex; width:100%; aspect-ratio: 1; max-height: 420px; transition: transform .3s ease; }
.detail-photo .slide { min-width:100%; display:flex; align-items:center; justify-content:center; font-family:'Space Grotesk',sans-serif; font-weight:600; color:rgba(255,255,255,.95); font-size:20px; background: var(--blue); }
.detail-photo .slide img { width:100%; height:100%; object-fit:cover; }
.carousel-dots { position:absolute; bottom:10px; left:0; right:0; display:flex; justify-content:center; gap:6px; }
.carousel-dots span { width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,.5); }
.carousel-dots span.active { background:#fff; width:16px; border-radius:4px; }
.carousel-arrow { position:absolute; top:50%; transform:translateY(-50%); width:32px; height:32px; border-radius:50%; background:rgba(10,24,48,.5); color:#fff; font-size:20px; display:flex; align-items:center; justify-content:center; }
.carousel-arrow.left { left:10px; } .carousel-arrow.right { right:10px; }

.detail-body { max-width: 640px; margin: 0 auto; padding: 22px 20px 40px; }
.detail-cat { font-size: 12px; color: var(--blue); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; font-weight: 600; }
.detail-title { font-size: 24px; margin-bottom: 8px; }
.detail-price { font-family: 'Space Grotesk', sans-serif; font-size: 28px; color: var(--blue); font-weight: 600; margin-bottom: 18px; }
.detail-desc { font-size: 14.5px; line-height: 1.6; color: var(--txt); margin-bottom: 24px; white-space: pre-wrap; }
.seller-row { display: flex; align-items: center; gap: 10px; padding: 14px; background: var(--surf); border: 0.5px solid var(--line); border-radius: 14px; margin-bottom: 22px; }
.seller-row .avatar { width: 38px; height: 38px; }
.seller-name { font-size: 14px; font-weight: 600; }
.seller-sub { font-size: 12px; color: var(--mut); }
.stars-line { font-size:12px; color: var(--star); margin-top:2px; }
.detail-actions { display: flex; gap: 10px; margin-bottom: 28px; }
.btn-outline { flex: 1; background: var(--surf); border: 1px solid var(--blue); color: var(--blue); padding: 13px; border-radius: 12px; font-weight: 600; font-size: 14.5px; text-align:center; }
.detail-actions .btn-primary { flex: 1.4; margin-top: 0; }
.own-badge { background: var(--glow); color: var(--hero); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; display: inline-block; margin-bottom: 18px; }
.offers-section { margin-bottom: 26px; }
.offers-section h3 { font-size: 16px; margin-bottom: 12px; }
.offer-card { border: 0.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--surf); }
.offer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.offer-buyer { font-size: 13px; font-weight: 600; }
.offer-amount { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: var(--blue); font-size: 16px; }
.offer-status { font-size: 12px; color: var(--mut); }
.offer-status.accepted { color: var(--blue); font-weight: 600; }
.offer-status.declined { color: var(--danger); }
.offer-actions { display: flex; gap: 8px; margin-top: 8px; }
.offer-actions button { font-size: 12.5px; padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.btn-accept { background: var(--blue); color: #fff; }
.btn-decline { background: var(--surf-2); color: var(--soft); border: 1px solid var(--line); }

.btn-whatsapp { display:flex; align-items:center; gap:6px; background: var(--wa); color:#fff; font-size:12.5px; font-weight:600; padding:9px 12px; border-radius:20px; flex-shrink:0; }
.btn-whatsapp.small { padding:6px 10px; font-size:11.5px; }

.star-input { font-size: 26px; color: var(--line); margin-bottom: 10px; letter-spacing: 4px; cursor:pointer; }
.star-input span.filled { color: var(--star); }
.review-card { border: 0.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--surf); }
.review-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.review-author { font-size:13px; font-weight:600; }
.review-stars { color: var(--star); font-size: 13px; }
.review-comment { font-size:13.5px; color: var(--txt); line-height:1.5; }
.rating-summary { display:flex; align-items:center; gap:8px; margin: 18px 0; font-size:14px; color: var(--soft); }
.rating-summary .big-star { color: var(--star); font-size: 20px; }

/* ---------- Checkout ---------- */
.checkout-product { display:flex; align-items:center; gap:12px; padding:14px; background: var(--surf); border:0.5px solid var(--line); border-radius:14px; margin-bottom:22px; box-shadow: var(--shadow); }
.checkout-product-thumb { width:56px; height:56px; border-radius:10px; overflow:hidden; flex-shrink:0; display:flex; align-items:center; justify-content:center; background: var(--blue); }
.checkout-product-thumb img { width:100%; height:100%; object-fit:cover; }
.checkout-product-title { font-size:14px; font-weight:600; }
.checkout-product-price { font-family:'Space Grotesk',sans-serif; font-size:16px; font-weight:600; color: var(--blue); margin-top:2px; }
.checkout-sub { font-size:13px; color: var(--soft); margin: 0 0 20px; line-height:1.5; }

/* ---------- Sell ---------- */
.sell-body { max-width: 480px; margin: 0 auto; padding: 22px 20px 40px; }
.photo-row { display:flex; gap:10px; overflow-x:auto; margin-bottom: 18px; }
.photo-slot { position:relative; flex-shrink:0; width: 92px; height: 92px; border-radius:14px; overflow:hidden; border:1.5px dashed var(--line); display:flex; align-items:center; justify-content:center; background: var(--surf); color: var(--soft); font-size:11px; cursor:pointer; }
.photo-slot img { width:100%; height:100%; object-fit:cover; }
.photo-slot input { position:absolute; inset:0; opacity:0; cursor:pointer; }
.photo-slot .remove-x { position:absolute; top:3px; right:3px; width:18px; height:18px; border-radius:50%; background:rgba(10,24,48,.75); color:#fff; font-size:12px; display:flex; align-items:center; justify-content:center; z-index:2; }
.field textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surf-2); color: var(--txt); resize: vertical; min-height: 80px; }
.field select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surf-2); color: var(--txt); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); background: var(--txt); color: var(--bg); padding: 11px 20px; border-radius: 10px; font-size: 13.5px; z-index: 300; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; }

.profile-header { display: flex; align-items: center; gap: 14px; padding: 24px 20px 18px; background: var(--hero); }
.profile-header .avatar { width: 56px; height: 56px; font-size: 20px; }
.profile-header h2 { font-size: 19px; margin-bottom: 3px; color: #fff; }
.profile-header .seller-sub { font-size: 13px; color: rgba(255,255,255,.6); }
.profile-actions { padding: 14px 20px 0; }
.btn-logout { background: var(--surf); border: 1px solid var(--line); color: var(--danger); padding: 10px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }

.settings-card { background: var(--surf); border: 0.5px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 20px; }
.settings-card h3 { font-size: 15px; margin-bottom: 8px; }
.settings-card p { font-size: 13px; color: var(--soft); margin: 0 0 12px; }
.notif-status-row { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.notif-status-text { font-size:12.5px; color: var(--soft); }
.notif-status-text b { color: var(--txt); }

.notif-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border: 0.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surf); font-size: 13.5px; }
.notif-row .amt { color: var(--blue); font-weight: 600; font-family: 'Space Grotesk', sans-serif; }

/* ---------- Messages / threads ---------- */
.thread-card { display:flex; align-items:center; gap: 12px; padding: 12px 14px; border: 0.5px solid var(--line); border-radius: 14px; margin-bottom: 8px; background: var(--surf); cursor:pointer; }
.thread-card:hover { border-color: var(--blue); }
.thread-info { flex:1; min-width:0; }
.thread-top { display:flex; justify-content:space-between; gap:8px; }
.thread-name { font-size: 14px; font-weight:600; }
.thread-time { font-size:11px; color: var(--mut); flex-shrink:0; }
.thread-preview { font-size: 12.5px; color: var(--soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.thread-product { font-size: 11.5px; color: var(--blue); margin-bottom:2px; }

/* ---------- Chat ---------- */
#view-chat { display:none; }
#view-chat.active { display:flex; flex-direction:column; height:100vh; }
.chat-messages { flex:1; overflow-y:auto; padding: 16px 16px 90px; display:flex; flex-direction:column; gap:8px; }
.msg-row { display:flex; }
.msg-row.mine { justify-content:flex-end; }
.msg-bubble { max-width: 75%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height:1.4; }
.msg-row:not(.mine) .msg-bubble { background: var(--surf); border: 0.5px solid var(--line); border-bottom-left-radius:4px; }
.msg-row.mine .msg-bubble { background: var(--blue); color:#fff; border-bottom-right-radius:4px; }
.msg-row.system { justify-content:center; }
.msg-row.system .msg-bubble { background: var(--surf-2); color: var(--soft); font-size:12.5px; border-radius:10px; }
.msg-time { font-size:10px; color: var(--mut); margin-top:3px; text-align:right; }
.msg-row.mine .msg-time { color: rgba(255,255,255,.7); }
.chat-input-bar { position: fixed; bottom:0; left:0; right:0; display:flex; gap:8px; padding: 10px 14px; background: var(--surf); border-top: 0.5px solid var(--line); padding-bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 200; }
.chat-input-bar input { flex:1; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--surf-2); color: var(--txt); }
.chat-input-bar button { width:40px; height:40px; border-radius:50%; background: var(--blue); color:#fff; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.chat-input-bar button svg { width:18px; height:18px; }
/* ---------- Presence / professional chat ---------- */
.presence-dot { display:inline-block; width:7px; height:7px; border-radius:50%; margin:0 5px 1px 0; }
.presence-dot.online { background:#22c55e; box-shadow:0 0 0 3px rgba(34,197,94,.12); }
.presence-dot.offline { background:var(--mut); }
.chat-header-status { color:rgba(255,255,255,.62); font-size:10.5px; margin-top:2px; }
.chat-image-btn { width:40px; height:40px; border-radius:50%; background:var(--surf-2); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }
.chat-image-btn input { display:none; }
.chat-image { display:block; max-width:240px; max-height:280px; border-radius:12px; object-fit:cover; }
.image-bubble { padding:4px !important; overflow:hidden; }
.unread-pill { font-size:10px; font-weight:700; color:#fff; background:var(--blue); padding:4px 7px; border-radius:10px; flex-shrink:0; }
.btn-admin-ghost { background:linear-gradient(135deg,var(--hero),#152a54); color:#fff; border:1px solid rgba(255,255,255,.14); padding:9px 13px; border-radius:10px; font-size:12.5px; font-weight:700; margin-right:8px; }

/* ---------- Premium admin ---------- */
#view-admin.active { min-height:100vh; background:var(--bg); }
.admin-chip { font-size:9px; letter-spacing:.08em; color:var(--glow); border:1px solid rgba(0,225,255,.35); padding:3px 6px; border-radius:6px; vertical-align:middle; }
.admin-refresh { margin-left:auto; width:34px; height:34px; border-radius:50%; color:#fff; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.18); font-size:18px; }
.admin-shell { max-width:1100px; margin:0 auto; padding:24px 20px 60px; }
.admin-hero { display:flex; justify-content:space-between; align-items:center; gap:18px; background:linear-gradient(135deg,var(--hero),#152a54); color:#fff; border-radius:22px; padding:28px; margin-bottom:18px; box-shadow:0 16px 40px rgba(10,24,48,.14); }
.admin-kicker { font-size:10px; text-transform:uppercase; letter-spacing:.12em; color:var(--glow); font-weight:800; }
.admin-hero h1 { font-size:26px; margin:5px 0 6px; }
.admin-hero p { margin:0; color:rgba(255,255,255,.62); font-size:13px; }
.admin-lock { border:1px solid rgba(255,255,255,.16); border-radius:12px; padding:10px 12px; font-size:10px; letter-spacing:.1em; font-weight:800; color:rgba(255,255,255,.75); }
.admin-stats { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-bottom:18px; }
.admin-stats > div { background:var(--surf); border:1px solid var(--line); border-radius:16px; padding:16px 18px; }
.admin-stats b { display:block; font:700 26px 'Space Grotesk',sans-serif; color:var(--blue); }
.admin-stats span { font-size:12px; color:var(--mut); }
.admin-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.admin-card { background:var(--surf); border:1px solid var(--line); border-radius:18px; padding:16px; box-shadow:var(--shadow); }
.admin-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.admin-card-head h2 { font-size:16px; }
.admin-card-head span { font-size:10px; color:var(--mut); text-transform:uppercase; letter-spacing:.08em; }
.admin-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 0; border-top:1px solid var(--line); }
.admin-row > div { min-width:0; }
.admin-row b { display:block; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.admin-row small { display:block; color:var(--mut); font-size:10.5px; margin-top:2px; }
.admin-danger { background:rgba(196,51,90,.1); color:var(--danger); border:1px solid rgba(196,51,90,.25); padding:7px 10px; border-radius:8px; font-size:11px; font-weight:700; flex-shrink:0; }
.admin-message-card { grid-column:1/-1; }
.admin-message-card input,.admin-message-card textarea { width:100%; margin-bottom:10px; padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surf-2); color:var(--txt); font:14px Inter,sans-serif; }
.admin-message-card textarea { min-height:100px; resize:vertical; }
.admin-gate { max-width:430px; margin:14vh auto; padding:30px 22px; text-align:center; background:var(--surf); border:1px solid var(--line); border-radius:22px; box-shadow:0 18px 50px rgba(10,24,48,.1); }
.admin-gate-icon { width:52px; height:52px; border-radius:16px; margin:0 auto 14px; display:flex; align-items:center; justify-content:center; background:var(--hero); color:var(--glow); font-size:24px; }
.admin-gate h2 { font-size:21px; margin-bottom:7px; }
.admin-gate p { color:var(--soft); font-size:13px; margin-bottom:18px; }
@media(max-width:700px){ .admin-grid{grid-template-columns:1fr}.admin-message-card{grid-column:auto}.admin-hero{padding:22px}.admin-hero h1{font-size:22px} }
.card-wa-wrap { position:absolute; right:8px; bottom:8px; z-index:4; }
.card-wa { display:inline-flex; align-items:center; gap:4px; background:var(--wa); color:#fff; border-radius:16px; padding:6px 9px; font-size:10.5px; font-weight:800; box-shadow:0 4px 12px rgba(0,0,0,.15); }
.card-wa:hover { filter:brightness(.95); }


/* ---------- BOULKA PRO UPGRADE ---------- */
.filter-row select { flex:1; min-width:130px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surf-2); color:var(--txt); }
.status-badge { position:absolute; right:10px; bottom:10px; z-index:5; padding:5px 9px; border-radius:8px; font-size:10.5px; font-weight:800; background:rgba(10,24,48,.78); color:#fff; }
.status-available { background:rgba(22,130,82,.9); } .status-reserved { background:rgba(190,125,25,.94); } .status-sold { background:rgba(100,100,110,.94); }
.favorite-btn,.favorite-detail { border:1px solid var(--line); background:rgba(255,255,255,.92); color:var(--hero); width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:19px; z-index:8; cursor:pointer; }
.favorite-btn { position:absolute; right:10px; top:10px; } .favorite-btn.active,.favorite-detail.active { color:#d33a65; }
.detail-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:10px 0 6px; }
.detail-status { display:inline-flex; padding:5px 9px; border-radius:8px; background:var(--surf-2); color:var(--soft); font-size:11px; font-weight:700; }
.detail-status-wrap { display:none; align-items:center; gap:8px; margin:10px 0; }
.detail-status-wrap label { font-size:12px; color:var(--mut); }
.detail-status-wrap select { padding:8px 10px; border:1px solid var(--line); border-radius:9px; background:var(--surf-2); color:var(--txt); }
.btn-report { margin:12px 20px 0; padding:9px 12px; border-radius:9px; border:1px solid rgba(196,51,90,.25); background:rgba(196,51,90,.08); color:var(--danger); font-size:11.5px; font-weight:700; }
.btn-secondary { width:100%; margin:0 0 18px; padding:11px; border:1px solid var(--line); border-radius:10px; background:var(--surf); color:var(--txt); font-weight:700; }
.seller-dashboard { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:12px 0 12px; }
.seller-dashboard > div { background:var(--surf); border:1px solid var(--line); border-radius:12px; padding:11px 8px; text-align:center; }
.seller-dashboard b { display:block; font:700 20px 'Space Grotesk',sans-serif; color:var(--blue); } .seller-dashboard span { font-size:10px; color:var(--mut); }
.activity-card { display:flex; gap:10px; align-items:flex-start; padding:12px 14px; background:var(--surf); border:1px solid var(--line); border-radius:13px; margin-bottom:8px; }
.activity-card.unread { border-color:var(--blue); } .activity-icon { width:32px;height:32px;border-radius:10px;background:var(--surf-2);display:flex;align-items:center;justify-content:center;flex-shrink:0; }
.activity-card b { font-size:13px; } .activity-card p { margin:3px 0; color:var(--soft); font-size:12px; } .activity-card small { color:var(--mut); font-size:10px; }
.empty-mini { padding:25px 12px; color:var(--mut); text-align:center; font-size:13px; }
.admin-search { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--surf-2); color:var(--txt); margin-bottom:10px; }
@media(max-width:700px){ .seller-dashboard{grid-template-columns:repeat(2,1fr);} .filter-row{flex-wrap:wrap;} }

.photo-lightbox { position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.88); display:none; align-items:center; justify-content:center; padding:20px; }
.photo-lightbox.show { display:flex; } .photo-lightbox img { max-width:95vw; max-height:90vh; object-fit:contain; border-radius:12px; }
.photo-lightbox button { position:absolute; top:18px; right:18px; width:42px; height:42px; border-radius:50%; background:rgba(255,255,255,.12); color:#fff; font-size:30px; line-height:1; }

/* ---------- Notifications ---------- */
.notif-toggle-btn { display:flex; align-items:center; gap:8px; }
.icon-btn.has-alert::after { content:''; position:absolute; top:-2px; right:-2px; width:9px; height:9px; border-radius:50%; background:var(--danger); border:2px solid var(--hero); }
