:root {
  --bg: #050817;
  --bg-2: #081126;
  --surface: rgba(12, 21, 49, .82);
  --surface-strong: rgba(18, 31, 68, .95);
  --surface-soft: rgba(19, 28, 60, .62);
  --stroke: rgba(129, 156, 255, .18);
  --stroke-strong: rgba(53, 205, 255, .42);
  --text: #f7f9ff;
  --muted: #8f9cbc;
  --cyan: #09ddf3;
  --blue: #1787ff;
  --violet: #7a40ff;
  --magenta: #e000ff;
  --green: #36e2a0;
  --yellow: #ffc84b;
  --red: #ff587a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 16px 44px rgba(0, 0, 0, .34);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); overscroll-behavior-y: none; }
body { min-height: 100dvh; overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

#ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.orb { position: absolute; width: 320px; height: 320px; filter: blur(90px); opacity: .18; border-radius: 50%; }
.orb-cyan { background: var(--cyan); top: -170px; right: -100px; }
.orb-purple { background: var(--magenta); bottom: 5%; left: -190px; opacity: .12; }
.grid-glow { position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(28, 82, 148, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(28, 82, 148, .12) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 72%); }

.app-shell { position: relative; z-index: 1; width: min(100%, 760px); margin: 0 auto; min-height: 100dvh; padding: calc(var(--safe-top) + 8px) max(14px, var(--safe-right)) calc(94px + var(--safe-bottom)) max(14px, var(--safe-left)); }
.splash { min-height: 86dvh; display: grid; place-items: center; align-content: center; gap: 22px; text-align: center; color: var(--muted); }
.splash-logo { width: min(72vw, 320px); height: auto; filter: drop-shadow(0 0 30px rgba(37, 114, 255, .28)); }
.loading-bar { width: 180px; height: 4px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.loading-bar span { display: block; height: 100%; width: 45%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue), var(--magenta)); animation: load 1.15s ease-in-out infinite alternate; }
@keyframes load { from { transform: translateX(120%); } to { transform: translateX(-120%); } }

.topbar { position: sticky; top: calc(var(--safe-top) + 4px); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 8px 4px 14px; backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; min-width: 0; flex: 1; }
.brand img { width: 122px; height: 62px; object-fit: contain; object-position: center; margin-inline-start: -10px; filter: drop-shadow(0 0 14px rgba(16, 148, 255, .24)); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--stroke); background: rgba(12, 22, 49, .72); display: grid; place-items: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); cursor: pointer; }
.icon-btn:active { transform: scale(.96); }
.user-chip { min-width: 0; max-width: 150px; height: 42px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--stroke); background: rgba(12,22,49,.72); color: #eaf2ff; display: flex; align-items: center; gap: 7px; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.user-chip:active { transform: scale(.97); }
.user-dot { color: var(--cyan); font-size: 13px; flex: 0 0 auto; }
.user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; font-size: 11px; font-weight: 800; }
.language-switch { height: 42px; padding: 3px; display: flex; align-items: center; gap: 2px; border-radius: 13px; border: 1px solid var(--stroke); background: rgba(12,22,49,.72); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.flag-btn { width: 32px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: 19px; line-height: 1; cursor: pointer; opacity: .52; filter: saturate(.78); }
.flag-btn.active { opacity: 1; filter: none; border-color: rgba(45,222,255,.36); background: linear-gradient(135deg,rgba(9,221,243,.12),rgba(120,60,255,.16)); box-shadow: 0 0 14px rgba(33,158,255,.1); }
.flag-btn:active { transform: scale(.92); }

.screen { animation: screen-in .18s ease-out; }
@keyframes screen-in { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.hero { position: relative; overflow: hidden; min-height: 162px; padding: 22px; border-radius: 24px; border: 1px solid rgba(83, 134, 255, .28); background: radial-gradient(circle at 90% 12%, rgba(0, 226, 255, .22), transparent 32%), radial-gradient(circle at 5% 100%, rgba(221, 0, 255, .18), transparent 34%), linear-gradient(135deg, #0b1834, #0a0b24 55%, #17103c); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; inset: -1px; background: linear-gradient(120deg, transparent 25%, rgba(14,221,243,.12), transparent 55%); transform: translateX(-100%); animation: shine 6s ease-in-out infinite; }
@keyframes shine { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.hero-kicker { color: var(--cyan); font-size: 12px; letter-spacing: .12em; font-weight: 800; }
.hero h1 { margin: 8px 0 8px; font-size: clamp(22px, 7vw, 34px); line-height: 1.3; }
.hero p { margin: 0; color: #a9b5d4; line-height: 1.85; font-size: 13px; max-width: 86%; }
.hero-actions { display: flex; gap: 9px; margin-top: 17px; }

.btn { border: 0; min-height: 44px; padding: 0 16px; border-radius: 13px; font-weight: 800; cursor: pointer; transition: transform .12s ease, opacity .12s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(100deg, var(--cyan), var(--blue) 42%, var(--violet) 72%, var(--magenta)); color: #fff; box-shadow: 0 10px 30px rgba(50, 99, 255, .22); }
.btn-soft { background: rgba(22, 37, 75, .9); border: 1px solid rgba(100, 134, 218, .22); color: #dce5ff; }
.btn-danger { background: rgba(255, 69, 108, .12); border: 1px solid rgba(255, 85, 120, .28); color: #ff7893; }
.btn-block { width: 100%; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 24px 3px 12px; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head p, .section-head button { margin: 0; color: var(--muted); font-size: 12px; }
.section-head button { border: 0; background: none; color: #7d8dff; padding: 4px; }

.search { position: relative; margin-top: 15px; }
.search input { width: 100%; height: 50px; border-radius: 16px; border: 1px solid var(--stroke); background: rgba(9, 17, 39, .86); color: var(--text); outline: none; padding: 0 46px 0 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.025); }
.search input:focus { border-color: rgba(30, 206, 255, .48); box-shadow: 0 0 0 3px rgba(9, 221, 243, .06); }
.search::before { content: "⌕"; position: absolute; right: 17px; top: 9px; font-size: 25px; color: #69789d; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--stroke); background: rgba(13, 22, 48, .82); color: #aab7d5; min-height: 38px; white-space: nowrap; padding: 0 14px; border-radius: 12px; cursor: pointer; }
.chip.active { color: #fff; border-color: rgba(17, 208, 255, .5); background: linear-gradient(120deg, rgba(9,221,243,.16), rgba(113,55,255,.18)); box-shadow: 0 5px 22px rgba(21,126,255,.1); }

.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.listing-card { position: relative; overflow: hidden; min-width: 0; border: 1px solid var(--stroke); border-radius: 18px; background: linear-gradient(160deg, rgba(18, 31, 68, .92), rgba(7, 13, 32, .96)); box-shadow: 0 12px 28px rgba(0,0,0,.16); cursor: pointer; }
.listing-card:active { transform: scale(.985); }
.card-image { aspect-ratio: 1.22 / 1; background: linear-gradient(135deg, #101d3c, #1a0e39); overflow: hidden; position: relative; }
.card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-image .no-image { width: 100%; height: 100%; display: grid; place-items: center; color: #566585; font-size: 32px; background: radial-gradient(circle at 50% 30%, rgba(34,129,255,.18), transparent 50%); }
.card-body { padding: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 8px; font-size: 10px; font-weight: 800; color: #83edff; background: rgba(11, 214, 239, .1); border: 1px solid rgba(11,214,239,.14); }
.card-title { font-size: 13px; font-weight: 850; margin: 9px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { color: var(--muted); font-size: 10px; min-height: 28px; line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.price-line { display: flex; align-items: center; gap: 7px; margin-top: 10px; direction: ltr; justify-content: flex-end; }
.price { font-size: 15px; font-weight: 900; color: #fff; }
.price-discount { color: #ff54e7; font-weight: 900; }
.price-old { color: #6f7d9e; text-decoration: line-through; font-size: 11px; }

.panel { border: 1px solid var(--stroke); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; backdrop-filter: blur(18px); }
.panel + .panel { margin-top: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.stat { text-align: center; padding: 12px 5px; border-radius: 13px; background: rgba(14, 25, 56, .74); border: 1px solid rgba(115,145,230,.12); }
.stat strong { display: block; font-size: 18px; background: linear-gradient(90deg, var(--cyan), #8e78ff); -webkit-background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: 9px; }

.page-title { margin: 5px 2px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-title h1 { font-size: 22px; margin: 0; }
.page-title p { color: var(--muted); font-size: 12px; margin: 5px 0 0; }

.detail-gallery { border-radius: 22px; overflow: hidden; border: 1px solid var(--stroke); background: #0b1430; aspect-ratio: 1.5/1; }
.detail-gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 9px; }
.gallery-thumb { flex: 0 0 64px; width: 64px; height: 52px; border-radius: 11px; overflow: hidden; border: 1px solid var(--stroke); padding: 0; background: #0c1731; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(9,221,243,.08); }
.detail-price { margin: 14px 0 6px; display: flex; align-items: baseline; gap: 10px; direction: ltr; justify-content: flex-end; }
.detail-price strong { font-size: 28px; }
.detail-values { display: grid; gap: 8px; }
.value-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 46px; padding: 10px 12px; border-radius: 12px; background: rgba(11, 21, 48, .68); }
.value-row span { color: var(--muted); font-size: 12px; }
.value-row strong { font-size: 13px; text-align: left; overflow-wrap: anywhere; }

.form-progress { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 4px 0 18px; }
.form-progress span { height: 4px; border-radius: 99px; background: rgba(255,255,255,.08); }
.form-progress span.active { background: linear-gradient(90deg,var(--cyan),var(--blue),var(--magenta)); }
.form-field { margin-bottom: 14px; }
.form-field label { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: #c9d4ef; margin: 0 2px 7px; }
.form-field label em { color: var(--red); font-style: normal; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--stroke); background: rgba(7, 15, 35, .88); color: var(--text); border-radius: 13px; outline: none; padding: 0 13px; }
.input, .select { height: 48px; }
.textarea { min-height: 112px; resize: vertical; padding-top: 12px; line-height: 1.75; }
.input:focus, .textarea:focus, .select:focus { border-color: rgba(9,221,243,.46); box-shadow: 0 0 0 3px rgba(9,221,243,.06); }
.help { color: var(--muted); font-size: 10px; line-height: 1.65; margin: 5px 2px 0; }
.boolean-row, .option-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.option { flex: 1 1 auto; min-width: 82px; min-height: 44px; border: 1px solid var(--stroke); border-radius: 12px; background: rgba(11,22,49,.8); color: #b9c5df; padding: 7px 11px; }
.option.selected { color: #fff; border-color: rgba(31,211,255,.5); background: linear-gradient(130deg,rgba(0,218,244,.16),rgba(118,46,255,.18)); }
.save-state { color: var(--green); font-size: 10px; min-height: 15px; }

.upload-zone { border: 1px dashed rgba(24, 201, 255, .46); border-radius: 16px; padding: 20px 14px; text-align: center; background: rgba(7, 26, 55, .48); }
.upload-zone .upload-icon { font-size: 30px; }
.upload-zone p { margin: 7px 0 2px; font-size: 13px; font-weight: 800; }
.upload-zone small { color: var(--muted); }
.image-strip { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; }
.image-item { flex: 0 0 74px; width: 74px; height: 64px; border-radius: 11px; overflow: hidden; border: 1px solid var(--stroke); }
.image-item img { width: 100%; height: 100%; object-fit: cover; }

.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 13px; background: rgba(11,22,49,.72); border: 1px solid var(--stroke); }
.check-row input { width: 20px; height: 20px; accent-color: var(--blue); flex: 0 0 auto; }
.check-row span { font-size: 12px; line-height: 1.8; color: #c6d0e7; }
.rules-box { max-height: 180px; overflow: auto; white-space: pre-wrap; line-height: 1.9; font-size: 12px; color: #b8c3df; background: rgba(4,10,25,.6); border-radius: 12px; padding: 13px; margin-bottom: 11px; }

.list-stack { display: grid; gap: 10px; }
.list-row { width: 100%; border: 1px solid var(--stroke); background: rgba(10, 20, 45, .78); color: var(--text); border-radius: 15px; padding: 13px; display: flex; align-items: center; gap: 12px; text-align: right; cursor: pointer; }
.list-row:active { transform: scale(.988); }
.list-row-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(140deg,rgba(0,219,244,.13),rgba(140,45,255,.18)); font-size: 20px; flex: 0 0 auto; }
.list-row-main { min-width: 0; flex: 1; }
.list-row-main strong { display: block; font-size: 13px; margin-bottom: 4px; }
.list-row-main span { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.status { min-height: 25px; border-radius: 8px; display: inline-flex; align-items: center; padding: 0 8px; font-size: 9px; font-weight: 800; }
.status-PUBLISHED, .status-COMPLETED, .status-ACTIVE { background: rgba(54,226,160,.12); color: var(--green); }
.status-PENDING_REVIEW, .status-PROCESSING, .status-WAITING_FOR_ADMIN { background: rgba(255,200,75,.1); color: var(--yellow); }
.status-REJECTED, .status-CANCELLED, .status-BLOCKED { background: rgba(255,88,122,.11); color: #ff7893; }
.status-EDIT_REQUIRED, .status-RESTRICTED { background: rgba(172,100,255,.12); color: #bc8cff; }
.status-SOLD { background: rgba(73,169,255,.12); color: #6fbaff; }

.ticket-thread { display: grid; gap: 9px; margin: 14px 0; }
.bubble { max-width: 86%; padding: 10px 12px; border-radius: 15px; font-size: 12px; line-height: 1.75; }
.bubble-client { margin-right: auto; background: linear-gradient(135deg, #126de7, #5d3cf0); border-bottom-left-radius: 5px; }
.bubble-staff { margin-left: auto; background: rgba(20, 32, 65, .92); border: 1px solid var(--stroke); border-bottom-right-radius: 5px; }
.bubble time { display: block; opacity: .55; font-size: 9px; margin-top: 4px; }
.compose { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(82px + var(--safe-bottom)); z-index: 10; padding-top: 8px; }
.compose textarea { flex: 1; min-height: 47px; max-height: 120px; resize: none; }
.compose .btn { width: 48px; height: 48px; padding: 0; flex: 0 0 48px; }

.profile-card { text-align: center; padding: 24px 18px 18px; position: relative; overflow: hidden; }
.avatar { width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 24px; display: grid; place-items: center; font-size: 28px; background: linear-gradient(135deg, rgba(3,219,243,.28), rgba(129,53,255,.42)); border: 1px solid rgba(82,208,255,.35); box-shadow: 0 0 30px rgba(67,68,255,.15); }
.profile-card h2 { margin: 0; }
.profile-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; direction: ltr; }
.role-badges { margin-top: 10px; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }

.staff-banner { margin-top: 14px; border: 1px solid rgba(201,83,255,.25); background: linear-gradient(130deg,rgba(29,37,82,.8),rgba(70,18,92,.55)); border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 11px; cursor: pointer; }
.staff-banner strong { display: block; font-size: 13px; }
.staff-banner span { color: #bba8d5; font-size: 10px; }

.empty { padding: 38px 20px; text-align: center; color: var(--muted); }
.empty-icon { font-size: 40px; opacity: .7; margin-bottom: 10px; }
.empty h3 { color: #dae3fa; margin: 0 0 7px; font-size: 15px; }
.empty p { margin: 0; font-size: 11px; line-height: 1.8; }

.skeleton { border-radius: 13px; background: linear-gradient(100deg, rgba(255,255,255,.03) 20%, rgba(255,255,255,.08) 35%, rgba(255,255,255,.03) 50%); background-size: 300% 100%; animation: skeleton 1.4s infinite; }
@keyframes skeleton { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.bottom-nav { position: fixed; z-index: 40; width: min(calc(100% - 18px), 730px); bottom: max(8px, var(--safe-bottom)); left: 50%; transform: translateX(-50%); min-height: 70px; padding: 7px; border-radius: 22px; border: 1px solid rgba(91, 116, 200, .22); background: rgba(5, 10, 26, .88); backdrop-filter: blur(24px); box-shadow: 0 18px 54px rgba(0,0,0,.42); display: grid; grid-template-columns: repeat(5,1fr); }
.nav-btn { border: 0; background: transparent; color: #697793; border-radius: 15px; display: grid; place-items: center; align-content: center; gap: 2px; min-width: 0; padding: 5px 2px; }
.nav-btn b { font-size: 20px; font-weight: 500; line-height: 1; }
.nav-btn span { font-size: 9px; font-weight: 700; white-space: nowrap; }
.nav-btn.active { color: #4ce9ff; background: linear-gradient(180deg, rgba(9,221,243,.12), rgba(86,60,255,.08)); }

.toast-root { position: fixed; z-index: 1000; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%); width: min(90%, 520px); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 11px 14px; border-radius: 13px; background: rgba(10,17,36,.96); border: 1px solid var(--stroke); box-shadow: var(--shadow); color: #eaf0ff; font-size: 11px; animation: toast-in .2s ease-out; }
.toast.error { border-color: rgba(255,88,122,.35); color: #ff9bad; }
.toast.success { border-color: rgba(54,226,160,.35); color: #88f0c5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.auth-error { min-height: 85dvh; display: grid; place-items: center; text-align: center; padding: 24px; }
.auth-error .panel { max-width: 420px; }
.auth-error img { width: 210px; margin-bottom: 12px; }
.auth-error h2 { margin: 0 0 8px; }
.auth-error p { color: var(--muted); font-size: 12px; line-height: 1.8; }

@media (max-width: 390px) {
  .app-shell { padding-inline: 10px; }
  .topbar { gap: 6px; }
  .brand img { width: 94px; height: 52px; }
  .top-actions { gap: 5px; }
  .user-chip { max-width: 92px; height: 38px; padding-inline: 8px; }
  .language-switch { height: 38px; }
  .flag-btn { width: 28px; height: 30px; font-size: 17px; }
  .icon-btn { width: 38px; height: 38px; }
  .cards-grid { gap: 9px; }
  .card-body { padding: 10px; }
  .hero { padding: 18px; }
  .stat-grid { gap: 5px; }
  .stat strong { font-size: 16px; }
}

@media (min-width: 700px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .hero { min-height: 185px; padding: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

.row-thumb { width:100%; height:100%; object-fit:cover; border-radius:12px; display:block; }
.bottom-nav.nav-count-1 { grid-template-columns: 1fr; }
.bottom-nav.nav-count-2 { grid-template-columns: repeat(2, 1fr); }
.bottom-nav.nav-count-3 { grid-template-columns: repeat(3, 1fr); }
.bottom-nav.nav-count-4 { grid-template-columns: repeat(4, 1fr); }
.bottom-nav.nav-count-5 { grid-template-columns: repeat(5, 1fr); }

.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}
