@import url('fonts.css');

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  transition: background .25s ease, color .25s ease;
}
:root {
  --bg: #080c10;
  --bg-2: #0c1218;
  --panel: #101820;
  --panel-2: #16212b;
  --panel-3: #1b2833;
  --line: rgba(255,255,255,.075);
  --line-strong: rgba(255,255,255,.14);
  --text: #e9f0f6;
  --muted: #8a9caa;
  --muted-2: #62747f;
  --accent: #12b886;
  --accent-2: #0ea47a;
  --accent-ink: #04140f;
  --accent-soft: rgba(18,184,134,.14);
  --gold: #e2b74a;
  --danger: #ef4444;
  --warn: #f59e0b;
  --in-bubble: #16212b;
  --out-bubble: linear-gradient(135deg, #0f7a5f 0%, #12a67e 100%);
  --out-text: #ffffff;
  --shadow: 0 18px 48px rgba(0,0,0,.45);
  --radius: 18px;
  --head-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #eaeef2;
  --bg-2: #f2f5f8;
  --panel: #ffffff;
  --panel-2: #f4f7f9;
  --panel-3: #e9eef2;
  --line: rgba(9,30,44,.09);
  --line-strong: rgba(9,30,44,.16);
  --text: #0c1b25;
  --muted: #5f7381;
  --muted-2: #8296a3;
  --accent: #0f9d74;
  --accent-2: #0b7f5d;
  --accent-soft: rgba(15,157,116,.12);
  --in-bubble: #ffffff;
  --out-bubble: linear-gradient(135deg, #d8fdd0 0%, #c8f7c0 100%);
  --out-text: #08251a;
  --shadow: 0 18px 40px rgba(12,40,58,.12);
  color-scheme: light;
}

button { font-family: inherit; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--accent); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(140,160,175,.28); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }

/* ---------------- splash ---------------- */
#splash {
  position: fixed; inset: 0; display: grid; place-items: center; gap: 18px;
  background: radial-gradient(120% 90% at 50% 0%, #0f2a24 0%, #070b0e 60%);
  z-index: 100; transition: opacity .4s ease, visibility .4s;
}
#splash.out { opacity: 0; visibility: hidden; }
#splash .mark { width: 104px; height: 104px; border-radius: 28px; box-shadow: 0 22px 60px rgba(18,184,134,.35); animation: pop .7s cubic-bezier(.2,.9,.3,1.3); }
#splash .name { font-weight: 800; font-size: 26px; letter-spacing: .5px; color: #eaf6f1; }
#splash .tag { color: #7fa79b; font-size: 13px; }
@keyframes pop { from { transform: scale(.7); opacity: 0 } to { transform: scale(1); opacity: 1 } }

/* ---------------- auth ---------------- */
.auth-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1fr; place-items: center; padding: 22px; position: relative; overflow: hidden; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.auth-bg i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; animation: float 14s ease-in-out infinite alternate; }
.auth-bg i:nth-child(1) { width: 340px; height: 340px; background: #0e7f61; top: -80px; right: -60px; }
.auth-bg i:nth-child(2) { width: 300px; height: 300px; background: #0b4a6b; bottom: -100px; left: -80px; animation-delay: -6s; }
.auth-bg i:nth-child(3) { width: 220px; height: 220px; background: #6b4b12; top: 40%; left: 55%; opacity: .25; animation-delay: -3s; }
@keyframes float { from { transform: translate3d(0,0,0) scale(1) } to { transform: translate3d(20px,-30px,0) scale(1.12) } }
.auth-card {
  position: relative; z-index: 1; width: min(430px, 100%); background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line); border-radius: 26px; padding: 30px 26px 26px; box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand img { width: 78px; height: 78px; border-radius: 22px; box-shadow: 0 14px 34px rgba(18,184,134,.3); }
.auth-brand h1 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: .3px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); border-radius: 14px; padding: 4px; margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 10px; border-radius: 11px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; transition: .2s; }
.tabs button.on { background: var(--panel-3); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input {
  width: 100%; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--panel-2); color: var(--text); font-size: 15px; outline: none; transition: border-color .18s, box-shadow .18s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: var(--muted-2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 13px 18px; border-radius: 14px; font-weight: 700; font-size: 15px; background: var(--panel-2); color: var(--text);
  transition: transform .12s ease, filter .2s, background .2s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.975); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04140f; box-shadow: 0 12px 26px rgba(18,184,134,.28); }
.btn-primary:disabled { opacity: .55; box-shadow: none; }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); }
.btn-danger { background: rgba(239,68,68,.12); color: #ff7b7b; border: 1px solid rgba(239,68,68,.3); }
.btn-block { width: 100%; }
.auth-note { margin-top: 14px; font-size: 12px; color: var(--muted-2); text-align: center; line-height: 1.7; }
.err { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.28); color: #ff9b9b; padding: 10px 13px; border-radius: 12px; font-size: 13px; margin-bottom: 12px; }
.ok-note { background: var(--accent-soft); border: 1px solid rgba(18,184,134,.3); color: var(--accent); padding: 10px 13px; border-radius: 12px; font-size: 13px; }

/* ---------------- shell ---------------- */
.shell { display: grid; grid-template-columns: 380px 1fr; height: 100dvh; overflow: hidden; background: var(--bg); }
.sidebar { display: flex; flex-direction: column; background: var(--panel); border-inline-end: 1px solid var(--line); min-height: 0; }
.side-head { display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--safe-t)) 16px 10px; }
.side-head .brand-mini { display: flex; align-items: center; gap: 10px; margin-inline-end: auto; }
.side-head .brand-mini img { width: 34px; height: 34px; border-radius: 11px; }
.side-head .brand-mini b { font-size: 17px; letter-spacing: .3px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; border: 1px solid transparent; background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; cursor: pointer; transition: .18s; position: relative;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.dot::after { content: ''; position: absolute; top: 8px; inset-inline-end: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.search-wrap { padding: 4px 14px 10px; }
.search { display: flex; align-items: center; gap: 9px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 13px; }
.search svg { width: 18px; height: 18px; color: var(--muted-2); flex: 0 0 auto; }
.search input { border: 0; background: transparent; outline: none; color: var(--text); width: 100%; font-size: 14.5px; }
.chat-list { flex: 1; overflow-y: auto; padding: 2px 8px 20px; min-height: 0; }
.chat-item { display: flex; gap: 12px; padding: 10px 10px; border-radius: 16px; cursor: pointer; align-items: center; transition: background .15s; }
.chat-item:hover { background: var(--panel-2); }
.chat-item.on { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.chat-item .meta { flex: 1; min-width: 0; }
.chat-item .row1 { display: flex; align-items: center; gap: 6px; }
.chat-item .name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .time { margin-inline-start: auto; font-size: 11px; color: var(--muted-2); flex: 0 0 auto; }
.chat-item .preview { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; margin-top: 3px; }
.chat-item .preview span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .preview .tick { color: var(--accent); flex: 0 0 auto; }
.unread { margin-inline-start: 6px; background: var(--accent); color: #04140f; font-size: 11.5px; font-weight: 800; min-width: 21px; height: 21px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; flex: 0 0 auto; }
.list-empty { padding: 60px 26px; text-align: center; color: var(--muted-2); font-size: 13.5px; line-height: 1.9; }
.list-empty .big { font-size: 34px; margin-bottom: 10px; }

/* ---------------- avatar + frames ---------------- */
.av { position: relative; flex: 0 0 auto; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; }
.av .inner { position: absolute; inset: 0; z-index: 2; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #1d3a33, #14332b); color: #bff3e2; font-weight: 800; font-size: 18px; }
.av .inner img { width: 100%; height: 100%; object-fit: cover; }
.av .ring { position: absolute; inset: -4px; border-radius: 50%; z-index: 1; pointer-events: none; }
.av .ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 3px transparent; }
.av .ring-img { position: absolute; inset: -7px; background-size: contain; background-repeat: no-repeat; background-position: center; z-index: 3; pointer-events: none; }
.av.sm { width: 38px; height: 38px; }
.av.sm .inner { font-size: 14px; }
.av.lg { width: 74px; height: 74px; }
.av.lg .inner { font-size: 26px; }
.av.xl { width: 108px; height: 108px; }
.av.xl .inner { font-size: 38px; }
.av .status-dot { position: absolute; bottom: 1px; inset-inline-start: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2.5px solid var(--panel); z-index: 3; }
.av.sm .status-dot { width: 10px; height: 10px; }
@keyframes esk-spin { to { transform: rotate(360deg); } }
.verified { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #3b9dff; color: #fff; flex: 0 0 auto; }
.verified svg { width: 10px; height: 10px; }
.verified.big { width: 19px; height: 19px; }
.verified.big svg { width: 12px; height: 12px; }

/* ---------------- chat pane ---------------- */
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg-2); position: relative; }
.pane-bg { position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: radial-gradient(circle at 20% 10%, rgba(18,184,134,.06), transparent 45%), radial-gradient(circle at 85% 80%, rgba(14,90,120,.08), transparent 50%);
}
.chat-head { display: flex; align-items: center; gap: 11px; padding: calc(10px + var(--safe-t)) 14px 10px; background: color-mix(in srgb, var(--panel) 92%, transparent); border-bottom: 1px solid var(--line); z-index: 3; backdrop-filter: blur(14px); min-height: calc(var(--head-h) + var(--safe-t)); }
.chat-head .who { flex: 1; min-width: 0; cursor: pointer; }
.chat-head .who .nm { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15.5px; }
.chat-head .who .sub { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .sub.typing { color: var(--accent); }
.messages { flex: 1; overflow-y: auto; padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 3px; position: relative; z-index: 1; scroll-behavior: smooth; }
.day-sep { align-self: center; margin: 14px 0 8px; background: var(--panel-2); color: var(--muted); font-size: 11.5px; padding: 5px 13px; border-radius: 20px; border: 1px solid var(--line); }
.sys-msg { align-self: center; background: var(--panel-2); color: var(--muted); font-size: 12px; padding: 6px 13px; border-radius: 12px; margin: 4px 0; border: 1px solid var(--line); text-align: center; max-width: 80%; }
.msg { display: flex; gap: 8px; max-width: min(78%, 620px); align-self: flex-start; margin: 2px 0; margin-inline-end: auto; margin-inline-start: 0; position: relative; }
.msg.out { align-self: flex-end; flex-direction: row-reverse; margin-inline-start: auto; margin-inline-end: 0; }
.msg .bubble {
  background: var(--in-bubble); border-radius: 16px; padding: 8px 12px 7px; position: relative; min-width: 74px;
  box-shadow: 0 2px 8px rgba(0,0,0,.16); word-break: break-word; border: 1px solid var(--line);
}
.msg.out .bubble { background: var(--out-bubble); color: var(--out-text); border-color: transparent; border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.msg.out .bubble, .msg.in .bubble { border-top-left-radius: 16px; border-top-right-radius: 16px; }
.msg .txt { font-size: 14.5px; line-height: 1.62; white-space: pre-wrap; }
.msg .meta-line { display: flex; align-items: center; gap: 5px; justify-content: flex-end; margin-top: 3px; font-size: 10.5px; opacity: .72; }
.msg .meta-line .tick { display: inline-flex; }
.msg.out .meta-line .tick.read { color: #6fe3ff; opacity: 1; }
.msg .sender { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.msg .reply-q { border-inline-start: 3px solid var(--accent); background: rgba(0,0,0,.18); border-radius: 8px; padding: 5px 9px; margin-bottom: 5px; font-size: 12.5px; opacity: .9; }
.msg img.photo { max-width: 100%; border-radius: 12px; display: block; cursor: zoom-in; max-height: 380px; object-fit: cover; }
.msg .file-card { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.msg .file-card .fi { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.msg .file-card .fn { font-size: 13.5px; font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .file-card .fs { font-size: 11px; opacity: .7; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 190px; padding: 3px 0; }
.voice button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: inherit; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.msg.out .voice button { background: rgba(0,0,0,.16); }
.voice .wave { display: flex; align-items: center; gap: 2px; flex: 1; height: 26px; }
.voice .wave i { width: 3px; border-radius: 2px; background: currentColor; opacity: .45; }
.voice .dur { font-size: 11px; opacity: .75; min-width: 32px; text-align: center; }
.msg .call-log { display: flex; align-items: center; gap: 9px; padding: 2px 0; font-size: 13.5px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 9px 12px calc(9px + var(--safe-b)); background: color-mix(in srgb, var(--panel) 94%, transparent); border-top: 1px solid var(--line); z-index: 3; }
.composer .grow { flex: 1; display: flex; align-items: flex-end; background: var(--panel-2); border: 1px solid var(--line); border-radius: 22px; padding: 4px 6px 4px 12px; }
.composer textarea { flex: 1; border: 0; background: transparent; color: var(--text); outline: none; resize: none; font-size: 15px; line-height: 1.5; padding: 9px 4px; max-height: 130px; min-height: 22px; }
.composer .send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04140f; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px rgba(18,184,134,.3); flex: 0 0 auto; transition: transform .15s; }
.composer .send:active { transform: scale(.94); }
.composer .send svg { width: 22px; height: 22px; }
.mic-rec { display: flex; align-items: center; gap: 12px; flex: 1; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); border-radius: 22px; padding: 8px 14px; }
.mic-rec .dot { width: 11px; height: 11px; border-radius: 50%; background: #ff4d4d; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25 } }
.empty-pane { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted-2); padding: 30px; }
.empty-pane .box { max-width: 320px; }
.empty-pane img { width: 84px; opacity: .9; margin-bottom: 14px; }
.empty-pane h3 { color: var(--text); margin: 0 0 6px; font-size: 19px; }
.empty-pane p { margin: 0; font-size: 13.5px; line-height: 1.8; }

/* ---------------- sheets / modals ---------------- */
.backdrop { position: fixed; inset: 0; background: rgba(2,6,9,.62); backdrop-filter: blur(6px); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0 } }
.sheet { width: min(560px, 100%); max-height: 92dvh; overflow-y: auto; background: var(--panel); border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0; padding: 8px 18px calc(22px + var(--safe-b)); animation: up .28s cubic-bezier(.2,.9,.3,1); }
@keyframes up { from { transform: translateY(40px); opacity: .6 } }
.sheet.wide { width: min(900px, 100%); }
.sheet-grip { width: 44px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 6px auto 14px; }
.sheet h2 { font-size: 19px; margin: 2px 0 4px; }
.sheet .hint { color: var(--muted); font-size: 13px; margin: 0 0 16px; line-height: 1.7; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; flex: 1; }
@media (min-width: 720px) {
  .backdrop { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line); }
}
.row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 14.5px; }
.row .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.switch { width: 46px; height: 27px; border-radius: 20px; background: var(--panel-3); position: relative; transition: .2s; flex: 0 0 auto; border: 1px solid var(--line); }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch.on { background: var(--accent-soft); border-color: rgba(18,184,134,.45); }
.switch.on::after { inset-inline-start: 22px; background: var(--accent); }

/* ---------------- toasts ---------------- */
#toasts { position: fixed; inset-inline: 0; bottom: calc(24px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; }
.toast { background: var(--panel-3); color: var(--text); padding: 11px 18px; border-radius: 14px; font-size: 13.5px; box-shadow: var(--shadow); border: 1px solid var(--line-strong); animation: up .25s ease; max-width: 90vw; }
.toast.err { border-color: rgba(239,68,68,.45); color: #ffb4b4; }

/* ---------------- store ---------------- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.frame-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px 10px 12px; text-align: center; position: relative; transition: .2s; }
.frame-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.frame-card .av { margin: 0 auto 12px; }
.frame-card .fname { font-size: 13.5px; font-weight: 700; }
.frame-card .fprice { font-size: 12px; color: var(--muted); margin-top: 3px; }
.frame-card .fprice b { color: var(--gold); }
.frame-card.owned { border-color: rgba(18,184,134,.4); }
.frame-card .tag { position: absolute; top: 8px; inset-inline-start: 8px; font-size: 10px; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.frame-card .btn { margin-top: 10px; padding: 8px 12px; font-size: 12.5px; border-radius: 11px; width: 100%; }
.badge-card { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, rgba(59,157,255,.12), rgba(18,184,134,.08)); border: 1px solid rgba(59,157,255,.28); border-radius: 20px; padding: 16px; margin-bottom: 18px; }
.badge-card .grow { flex: 1; }
.badge-card h3 { margin: 0 0 4px; font-size: 16px; }
.badge-card p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.pay-box { background: var(--panel-2); border: 1px dashed var(--line-strong); border-radius: 16px; padding: 14px; margin: 12px 0; }
.pay-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 14px; }
.pay-line .k { color: var(--muted); font-size: 13px; }
.pay-line .v { font-weight: 700; direction: ltr; font-family: ui-monospace, monospace; }
.copy-btn { border: 1px solid var(--line-strong); background: transparent; color: var(--accent); border-radius: 9px; padding: 4px 9px; font-size: 11.5px; cursor: pointer; }
.seg { display: flex; gap: 6px; background: var(--panel-2); padding: 4px; border-radius: 13px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 10px; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--panel-3); color: var(--text); }
.order-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 9px; font-weight: 700; }
.pill.pending { background: rgba(245,158,11,.14); color: #f5b843; }
.pill.approved { background: var(--accent-soft); color: var(--accent); }
.pill.rejected { background: rgba(239,68,68,.14); color: #ff8a8a; }

/* ---------------- admin ---------------- */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.admin-tabs button { border: 0; background: transparent; color: var(--muted); padding: 8px 13px; border-radius: 11px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.admin-tabs button.on { background: var(--accent-soft); color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 15px; padding: 13px; }
.stat b { display: block; font-size: 21px; font-weight: 800; }
.stat span { font-size: 11.5px; color: var(--muted); }
.admin-list { display: flex; flex-direction: column; }
.admin-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.admin-row .grow { flex: 1; min-width: 0; }
.admin-row .t { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.admin-row .s { color: var(--muted); font-size: 12px; direction: ltr; text-align: right; }
.mini-btn { border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.mini-btn.danger { color: #ff8a8a; border-color: rgba(239,68,68,.35); }
.mini-btn.ok { color: var(--accent); border-color: rgba(18,184,134,.4); }
.field-inline { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.field-inline .input { padding: 10px 12px; font-size: 14px; }
textarea.input { min-height: 70px; resize: vertical; }

/* ---------------- call overlay ---------------- */
.call-overlay { position: fixed; inset: 0; z-index: 80; background: radial-gradient(120% 80% at 50% 0%, #0d3b30 0%, #060a0d 70%); display: flex; flex-direction: column; padding: calc(22px + var(--safe-t)) 18px calc(22px + var(--safe-b)); }
.call-overlay .top { text-align: center; }
.call-overlay .top .nm { font-size: 23px; font-weight: 800; margin-top: 14px; }
.call-overlay .top .st { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.call-stage { flex: 1; position: relative; margin: 18px 0; border-radius: 22px; overflow: hidden; background: #0a1014; border: 1px solid var(--line); }
.call-stage video { width: 100%; height: 100%; object-fit: cover; }
.call-stage .remote-video { position: absolute; inset: 0; }
.call-stage .local-video { position: absolute; inset-inline-end: 12px; top: 12px; width: 30%; max-width: 130px; aspect-ratio: 3/4; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow); background: #000; }
.call-stage .local-video video { object-fit: cover; }
.call-avatar-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.call-actions { display: flex; justify-content: center; gap: 16px; }
.call-btn { width: 60px; height: 60px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(255,255,255,.1); color: #fff; transition: .18s; }
.call-btn svg { width: 25px; height: 25px; }
.call-btn.end { background: #ef4444; }
.call-btn.off { background: rgba(255,255,255,.22); }
.call-btn.on { background: rgba(18,184,134,.85); }
.call-participants { position: absolute; bottom: 10px; inset-inline-start: 10px; background: rgba(0,0,0,.45); color: #fff; font-size: 11.5px; padding: 4px 10px; border-radius: 10px; }

/* ---------------- lightbox / misc ---------------- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 85; display: grid; place-items: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; }
.lightbox .close { position: absolute; top: 18px; inset-inline-end: 18px; }
.skeleton { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 12px; }
@keyframes shimmer { from { background-position: 100% 0 } to { background-position: 0 0 } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg) } }
.fab { position: absolute; inset-inline-end: 18px; bottom: calc(20px + var(--safe-b)); width: 56px; height: 56px; border-radius: 19px; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04140f; display: grid; place-items: center; cursor: pointer; box-shadow: 0 14px 30px rgba(18,184,134,.35); z-index: 5; }
.fab svg { width: 26px; height: 26px; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .pane { position: fixed; inset: 0; z-index: 20; transform: translateX(-102%); transition: transform .26s cubic-bezier(.2,.9,.3,1); }
  html[dir="rtl"] .pane { transform: translateX(102%); }
  .pane.open, html[dir="rtl"] .pane.open { transform: translateX(0); }
  .msg { max-width: 86%; }
  .sidebar { position: relative; }
}
@media (min-width: 901px) {
  .back-btn { display: none; }
}
