/* Hytovia Tools — Dashboard v2 (Partner + Admin) · mobile-first, clean */

:root {
    --bg: #07070a;
    --bg-soft: #0a0a0f;
    --bg-card: #11111a;
    --bg-card-hover: #161624;
    --border: #1f1f2b;
    --border-strong: #2a2a3a;
    --border-hover: #3a3a4f;
    --text: #f4f4f6;
    --text-bright: #ffffff;
    --text-mute: #9c9caf;
    --text-dim: #6e6e7e;
    --accent-violet: #8b5cf6;
    --accent-violet-bright: #a78bfa;
    --accent-cyan: #06b6d4;
    --green: #4ade80;
    --amber: #fbbf24;
    --red: #f87171;
    --radius-sm: 8px;
    --radius: 14px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
    --w: 1500px;
    --w-normal: 980px;
    --w-narrow: 760px;
    --pad-x: clamp(16px, 3vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(139, 92, 246, 0.4); color: var(--text-bright); }
:focus-visible { outline: 2px solid var(--accent-violet); outline-offset: 2px; border-radius: 4px; }

h1 { font-size: clamp(21px, 2.4vw, 26px); font-weight: 600; letter-spacing: -0.02em; color: var(--text-bright); }
h3 { font-size: 16px; font-weight: 600; color: var(--text-bright); margin-bottom: 10px; }
h4.mini-title { font-size: 12.5px; font-weight: 600; color: var(--text-mute); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.sub { color: var(--text-mute); font-size: 14px; margin-top: 4px; }
.mute { color: var(--text-dim); }
.opt { color: var(--text-dim); font-weight: 400; font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.t-right { text-align: right; }
.t-center { text-align: center; }
.pad { padding: 18px; }
.prewrap { white-space: pre-wrap; color: var(--text-mute); font-size: 14px; }
.ellip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--text-dim); font-size: 18px; line-height: 1; }

/* ---- Topnav ---- */
.topnav { border-bottom: 1px solid var(--border); background: rgba(7, 7, 10, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 50; }
.topnav-inner { max-width: var(--w-normal); margin: 0 auto; padding: 0 var(--pad-x); height: 60px; display: flex; align-items: center; gap: 20px; }
.topnav-inner.wide { max-width: var(--w); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15.5px; color: var(--text-bright); white-space: nowrap; }
.brand svg { color: var(--accent-violet-bright); flex-shrink: 0; }
.brand em { font-style: normal; color: var(--accent-violet-bright); }
.brand-lg { font-size: 19px; justify-content: center; margin-bottom: 22px; }
.topnav-links { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-links a { padding: 7px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500; color: var(--text-mute); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.topnav-links a:hover { color: var(--text-bright); background: var(--bg-card); }
.topnav-links a.on { color: var(--text-bright); background: var(--bg-card-hover); }
.badge { background: var(--accent-violet); color: #fff; font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topnav-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.uname { font-size: 13px; color: var(--text-mute); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 10px; border-radius: 9px; }
.uname:hover { color: var(--text-bright); background: var(--bg-card); }

/* ---- Layout ---- */
.container { max-width: var(--w-normal); margin: 0 auto; padding: clamp(20px, 3.5vw, 34px) var(--pad-x) 64px; width: 100%; }
.container.wide { max-width: var(--w); }
.container.narrow { max-width: var(--w-narrow); }
main.container { flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: clamp(16px, 2.5vw, 26px); flex-wrap: wrap; }
.crumb { font-size: 13px; margin-bottom: 6px; }
.crumb a { color: var(--text-dim); }
.crumb a:hover { color: var(--text-bright); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; height: 100%; }

/* ---- Cards ---- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card-title { display: flex; align-items: center; gap: 8px; }
.table-card { padding: 4px 0 0; overflow: hidden; }
.table-card .card-title { padding: 16px 18px 6px; }
.table-card .pad { padding: 14px 18px 18px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; flex-wrap: wrap; }
.card-title-row .card-title { padding: 0; }
.empty { text-align: center; padding: 46px 24px; }
.empty p { color: var(--text-mute); margin: 8px auto 18px; max-width: 420px; }
.state-card { text-align: center; padding: 46px 28px; }
.state-card h1 { margin: 14px 0 8px; }
.state-card p { color: var(--text-mute); max-width: 440px; margin: 0 auto; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; min-height: 86px; justify-content: center; }
.stat-hot { border-color: var(--accent-violet); box-shadow: 0 0 0 1px var(--accent-violet), 0 8px 30px -12px rgba(139, 92, 246, .5); }
.stat-n { font-family: var(--mono); font-size: 27px; font-weight: 500; color: var(--text-bright); line-height: 1.15; }
.stat-l { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }

/* ---- Person / Avatar ---- */
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(6, 182, 212, .25));
    border: 1px solid var(--border-strong);
    color: var(--text-bright); font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
    display: inline-flex; align-items: center; justify-content: center;
}
.avatar-lg { width: 42px; height: 42px; font-size: 14.5px; }
.person-meta { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-weight: 500; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { display: block; font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); font-weight: 500; padding: 11px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tr[data-href] { cursor: pointer; transition: background .12s ease; }
tr[data-href]:hover { background: rgba(139, 92, 246, 0.06); }
tr[data-href]:hover .rowlink { color: var(--accent-violet-bright); }
.rowlink { font-weight: 500; color: var(--text-bright); }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline-block; margin-left: 6px; }
th.t-center, td.t-center { text-align: center; }

/* ---- Pills ---- */
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; padding: 3.5px 11px; border-radius: 99px; border: 1px solid; white-space: nowrap; }
.pill-lg { font-size: 13px; padding: 5px 14px; }
.s-pending { color: var(--amber); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.s-progress { color: var(--accent-cyan); border-color: rgba(6, 182, 212, 0.35); background: rgba(6, 182, 212, 0.08); }
.s-delivered { color: var(--green); border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.s-rejected { color: var(--red); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: var(--font); font-size: 14px; font-weight: 500; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease; min-height: 40px; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent-violet); color: #fff; }
.btn-primary:hover { background: var(--accent-violet-bright); }
.btn-ghost { background: transparent; color: var(--text-mute); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text-bright); border-color: var(--border-hover); background: var(--bg-card-hover); }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--red); border-color: rgba(248, 113, 113, 0.4); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-sm { font-size: 13px; padding: 6px 13px; min-height: 32px; }
.btn-block { width: 100%; }

/* ---- Forms ---- */
label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text); margin-bottom: 15px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="url"], select, textarea {
    display: block; width: 100%; margin-top: 6px;
    background: var(--bg-soft); border: 1px solid var(--border-strong); border-radius: 10px;
    color: var(--text-bright); font-family: var(--font); font-size: 16px; padding: 11px 13px;
    transition: border-color 0.15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); }
textarea { resize: vertical; }
input[type="file"] { display: block; margin-top: 8px; color: var(--text-mute); font-size: 13.5px; max-width: 100%; }
input[type="file"]::file-selector-button { background: var(--bg-card-hover); color: var(--text); border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 13px; margin-right: 10px; font-family: var(--font); font-size: 13px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.upload-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.upload-row input[type="file"] { margin-top: 0; flex: 1; min-width: 180px; }
.saved-note { font-size: 12.5px; margin-left: 10px; }
.action-row { margin-bottom: 16px; }
.danger-details { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.danger-details summary { cursor: pointer; color: var(--text-dim); font-size: 13.5px; }
.danger-details form { margin-top: 12px; }

/* ---- Alerts ---- */
.alert { border-radius: 10px; padding: 12px 15px; font-size: 14px; margin: 14px 0; border: 1px solid; }
.alert-ok { color: var(--green); border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.07); }
.alert-err { color: var(--red); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.07); }
.alert-info { color: var(--accent-violet-bright); border-color: rgba(139, 92, 246, 0.35); background: rgba(139, 92, 246, 0.07); }
.alert-info a { color: var(--accent-violet-bright); text-decoration: underline; }
.topnav + .container .alert { margin: 16px 0 0; }

/* ---- Auth ---- */
.auth-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: stretch; max-width: 400px; width: 100%; margin: 0 auto; padding: 44px 20px; }
.auth-card { padding: 26px; }
.auth-card h1 { font-size: 21px; margin-bottom: 4px; }
.auth-card .sub { margin-bottom: 18px; }
.auth-card form { margin-top: 4px; }
.auth-alt { font-size: 13.5px; color: var(--text-dim); margin-top: 16px; text-align: center; }
.auth-alt a { color: var(--accent-violet-bright); }

/* ---- Case detail ---- */
.delivered-banner { border-color: rgba(74, 222, 128, 0.4); background: linear-gradient(180deg, rgba(74, 222, 128, 0.06), var(--bg-card)); }
.reject-banner { border-color: rgba(248, 113, 113, 0.4); }
.info-banner { border-color: var(--border-strong); }
.info-banner p { color: var(--text-mute); }
.info-banner strong { color: var(--text); }
.linkrow { display: flex; align-items: stretch; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.dlink { color: var(--accent-violet-bright); word-break: break-all; }
.dlink:hover { text-decoration: underline; }
.linkrow .dlink { font-family: var(--mono); font-size: 14px; background: var(--bg-soft); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 13px; flex: 1; min-width: 0; display: flex; align-items: center; }
.adminmsg { color: var(--text-mute); font-size: 13.5px; margin-top: 10px; font-style: italic; }
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; font-size: 14px; margin-bottom: 6px; }
.dl dt { color: var(--text-dim); }
.dl dd { color: var(--text); word-break: break-word; }
.filelist { list-style: none; }
.filelist li { padding: 9px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.filelist li:last-child { border-bottom: none; }
.filelist a { color: var(--accent-violet-bright); word-break: break-all; }
.filelist a:hover { text-decoration: underline; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.head-actions form { display: inline; }

/* ---- Tabs & Filter ---- */
.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filterbar .tabs { margin-bottom: 0; }
.merchant-filter select { width: auto; min-width: 190px; margin-top: 0; font-size: 14px; padding: 9px 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a, .tab { padding: 7px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 500; color: var(--text-mute); border: 1px solid var(--border); background: transparent; font-family: var(--font); cursor: pointer; transition: all .15s ease; }
.tabs a:hover, .tab:hover { color: var(--text-bright); border-color: var(--border-hover); }
.tabs a.on, .tab.on { color: var(--text-bright); background: var(--bg-card-hover); border-color: var(--border-strong); }

/* ---- Menu (settings etc. reuse) ---- */
.menu-panel { padding: clamp(22px, 4vw, 44px); }
.menu-list { display: none; }
.menu-list.on { display: block; }
.menu-note { font-style: italic; font-size: 15px; color: var(--text-mute); margin-bottom: 18px; }
.mi { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px dashed rgba(244, 244, 246, .1); }
.mi:last-child { border-bottom: none; }

/* ---- Chat ---- */
.chat-page { display: flex; flex-direction: column; }
.chat { display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: clamp(480px, calc(100dvh - 170px), 760px); }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--bg-card-hover); }
.chat-head-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-head h2 { font-size: 15.5px; font-weight: 600; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sub { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { font-size: 13px; color: var(--text-mute); white-space: nowrap; padding: 6px 10px; border-radius: 8px; }
.chat-back:hover { color: var(--text-bright); background: var(--bg-card); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat-empty { color: var(--text-dim); text-align: center; margin: auto; font-size: 14px; line-height: 1.6; }
.chat-empty-ico { font-size: 34px; display: block; margin-bottom: 10px; }

.msg { display: flex; }
.msg-mine { justify-content: flex-end; }
.msg-them { justify-content: flex-start; }
.bubble { max-width: min(78%, 480px); padding: 9px 13px 7px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; }
.msg-them .bubble { background: var(--bg-card-hover); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg-mine .bubble { background: var(--accent-violet); color: #fff; border-bottom-right-radius: 5px; }
.msg + .msg { margin-top: 2px; }
.msg-them + .msg-mine, .msg-mine + .msg-them { margin-top: 12px; }
.msg-who { font-size: 11.5px; font-weight: 600; color: var(--accent-violet-bright); margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-time { font-size: 10.5px; opacity: 0.65; margin-top: 3px; text-align: right; }
.msg-case { display: inline-flex; align-items: center; margin-top: 7px; font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 9px; background: rgba(0, 0, 0, 0.22); color: inherit; }
.msg-them .msg-case { background: var(--bg-soft); color: var(--accent-violet-bright); border: 1px solid var(--border-strong); }
.msg-case:hover { text-decoration: underline; }

.chat-compose { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--bg-card-hover); }
.chat-case { width: fit-content; max-width: 100%; margin-top: 0; font-size: 13px; padding: 7px 11px; border-radius: 9px; color: var(--text-mute); }
.chat-inputrow { display: flex; gap: 9px; align-items: flex-end; }
.chat-inputrow textarea { flex: 1; margin-top: 0; resize: none; line-height: 1.45; max-height: 130px; border-radius: 20px; padding: 11px 16px; min-height: 44px; }
.chat-send {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; border: none; cursor: pointer;
    background: var(--accent-violet); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease, transform .1s ease;
}
.chat-send:hover { background: var(--accent-violet-bright); }
.chat-send:active { transform: scale(.94); }
.chat-send:disabled { opacity: .55; cursor: default; }

/* ---- Conversation-Liste ---- */
.conv-list { list-style: none; }
.conv-list li { border-bottom: 1px solid var(--border); }
.conv-list li:last-child { border-bottom: none; }
.conv { display: flex; align-items: center; gap: 13px; padding: 13px 18px; transition: background .12s ease; }
.conv:hover { background: rgba(139, 92, 246, 0.06); }
.conv-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.conv-name { font-weight: 500; color: var(--text-bright); display: flex; align-items: center; gap: 8px; }
.conv-last { font-size: 13px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.conv-time { font-size: 12px; }

/* ---- Footer ---- */
.dash-foot { border-top: 1px solid var(--border); padding: 18px var(--pad-x); display: flex; justify-content: space-between; gap: 12px; max-width: var(--w); margin: 0 auto; width: 100%; font-size: 12.5px; color: var(--text-dim); flex-wrap: wrap; }
.dash-foot a { color: var(--text-dim); }
.dash-foot a:hover { color: var(--text-bright); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-2 > .card { height: auto; }
    .ellip { max-width: 170px; }
}
@media (max-width: 640px) {
    .hide-m { display: none !important; }
    .topnav-inner { gap: 10px; padding: 0 14px; }
    .uname { display: none; }
    .container { padding: 18px 14px 56px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .page-head .btn { width: 100%; }
    .head-actions { width: 100%; }
    .head-actions .btn, .head-actions form { flex: 1; }
    .head-actions form .btn { width: 100%; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 9px; }
    .stat { padding: 13px 14px; min-height: 76px; }
    .stat-n { font-size: 23px; }
    .form-row { grid-template-columns: 1fr; }
    .dl { grid-template-columns: 1fr; gap: 2px; }
    .dl dt { margin-top: 10px; }
    .dl dd { margin-bottom: 2px; }
    h1 { font-size: 21px; }
    th, td { padding-left: 13px; padding-right: 13px; }
    .table-card .card-title, .card-title-row { padding-left: 14px; padding-right: 14px; }
    .actions-cell form { margin-left: 4px; }
    .actions-cell .btn-sm { padding: 7px 11px; }
    .filterbar { align-items: stretch; flex-direction: column; }
    .merchant-filter select { width: 100%; }
    .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tabs a, .tab { white-space: nowrap; flex-shrink: 0; }
    .chat { height: calc(100dvh - 148px); border-radius: 12px; }
    .container.narrow.chat-page { padding-bottom: 16px; }
    .bubble { max-width: 86%; }
    .upload-row input[type="file"] { min-width: 0; width: 100%; }
    .upload-row .btn { width: 100%; }
    .linkrow .dlink { min-width: 100%; }
    .linkrow .btn { width: 100%; }
    .form-actions .btn { flex: 1; }
    .b-tel { font-size: 17px; }
}

/* ---- Gamification (v5.2) ---- */
.gamify { background: linear-gradient(135deg, rgba(139, 92, 246, .12), rgba(6, 182, 212, .06)), var(--bg-card); border-color: rgba(139, 92, 246, .35); }
.g-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.g-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.g-lvl {
    flex-shrink: 0; width: 56px; height: 56px; border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-violet), var(--accent-cyan));
    color: #fff; font-weight: 700; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 26px -10px rgba(139, 92, 246, .7);
}
.g-meta { display: flex; flex-direction: column; min-width: 0; }
.g-title { font-size: 19px; font-weight: 600; color: var(--text-bright); line-height: 1.3; }
.g-xp { font-size: 13.5px; color: var(--text-mute); }
.g-rank {
    flex-shrink: 0; font-size: 14px; font-weight: 600; color: var(--text-bright);
    background: var(--bg-soft); border: 1px solid var(--border-strong);
    padding: 9px 15px; border-radius: 12px; transition: border-color .15s ease, transform .15s ease;
}
.g-rank:hover { border-color: var(--accent-violet); transform: translateY(-2px); }
.g-rank-of { color: var(--text-dim); font-weight: 400; }
.g-bar { height: 10px; border-radius: 6px; background: var(--bg-soft); border: 1px solid var(--border); overflow: hidden; margin: 16px 0 4px; }
.g-bar span {
    display: block; height: 100%; border-radius: 6px;
    background: linear-gradient(90deg, var(--accent-violet), var(--accent-cyan));
    position: relative; overflow: hidden;
    transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.g-bar span::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    animation: shine 2.6s ease-in-out infinite;
}
@keyframes shine { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }
.g-badges { display: flex; gap: 6px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.g-badges::-webkit-scrollbar { display: none; }
.g-badge {
    flex: 0 0 auto; width: 86px; text-align: center; padding: 10px 6px 9px;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px;
    opacity: .45; filter: grayscale(1);
    transition: transform .15s ease;
}
.g-badge.earned { opacity: 1; filter: none; border-color: rgba(139, 92, 246, .4); background: rgba(139, 92, 246, .08); }
.g-badge.earned:hover { transform: translateY(-3px); }
.g-badge-ico { display: block; font-size: 22px; line-height: 1.2; }
.g-badge-name { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-mute); margin-top: 4px; line-height: 1.25; }
.g-badge.earned .g-badge-name { color: var(--text); }

.alert-xp {
    color: var(--accent-violet-bright);
    border-color: rgba(139, 92, 246, .5);
    background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(6, 182, 212, .08));
    font-weight: 600;
    animation: xpPop .5s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes xpPop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.lvl-chip {
    display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
    color: var(--accent-violet-bright); background: rgba(139, 92, 246, .1);
    border: 1px solid rgba(139, 92, 246, .35); padding: 3px 10px; border-radius: 99px; white-space: nowrap;
}

.lb-me { background: rgba(139, 92, 246, .1) !important; box-shadow: inset 3px 0 0 var(--accent-violet); }
.lb-rank { font-size: 16px; }
.lb-you { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-violet-bright); background: rgba(139, 92, 246, .15); border-radius: 6px; padding: 2px 7px; margin-left: 6px; }
.lb-xp { font-weight: 600; color: var(--text-bright); }
.xp-rules h3 { margin-bottom: 14px; }
.xp-list { list-style: none; display: grid; gap: 10px; }
.xp-list li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--text-mute); }
.xp-pill {
    flex-shrink: 0; min-width: 56px; text-align: center; font-family: var(--mono); font-size: 13.5px; font-weight: 600;
    color: var(--accent-cyan); background: rgba(6, 182, 212, .1); border: 1px solid rgba(6, 182, 212, .35);
    padding: 4px 10px; border-radius: 9px;
}
.xp-pill-big { color: var(--green); background: rgba(74, 222, 128, .1); border-color: rgba(74, 222, 128, .4); }

@media (max-width: 640px) {
    .g-lvl { width: 48px; height: 48px; border-radius: 13px; font-size: 13.5px; }
    .g-title { font-size: 17px; }
    .g-rank { width: 100%; text-align: center; order: 3; }
    .g-badge { width: 78px; }
}

/* ---- v5.3: UX-Fixes + Gamify-Ausbau ---- */
.me-link { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 99px; transition: background .15s ease; }
.me-link:hover { background: var(--bg-card); }
.me-link .uname { padding: 0; max-width: 130px; }
.me-link:hover .uname { background: transparent; color: var(--text-bright); }
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }

.g-goal { margin-top: 12px; font-size: 13.5px; color: var(--text-mute); }
.g-goal strong { color: var(--text-bright); font-weight: 600; }

.xp-note { margin-top: 14px; font-size: 13px; color: var(--text-dim); border-top: 1px dashed rgba(244, 244, 246, .12); padding-top: 12px; }

.alert { transition: opacity .55s ease, transform .55s ease; }
.alert-out { opacity: 0; transform: translateY(-8px); }

.confetti {
    position: fixed; top: -12px; z-index: 300; pointer-events: none;
    border-radius: 2px;
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(560deg); opacity: .7; }
}

.chat-compose { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.dash-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 640px) {
    .me-link .uname { display: none; }
    .me-link { padding: 4px; }
}

/* ---- v5.4: Icons statt Emojis, Glow & Motion ---- */
.ico { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; display: inline-block; }
.g-badge-ico { width: 21px; height: 21px; stroke: var(--text-mute); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; display: block; margin: 0 auto; }
.g-badge.earned .g-badge-ico { stroke: var(--accent-violet-bright); filter: drop-shadow(0 0 6px rgba(139, 92, 246, .6)); }
.g-badge.earned { box-shadow: 0 0 18px -6px rgba(139, 92, 246, .45); }
.chat-empty-ico { width: 34px; height: 34px; stroke: var(--text-dim); stroke-width: 1.6; fill: none; display: block; margin: 0 auto 10px; }

.rank-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border-radius: 50%; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text-dim); }
.rank-1 { background: linear-gradient(135deg, #fbbf24, #b45309); color: #1a1200; box-shadow: 0 0 16px -4px rgba(251, 191, 36, .7); }
.rank-2 { background: linear-gradient(135deg, #e5e7eb, #6b7280); color: #111; box-shadow: 0 0 14px -5px rgba(229, 231, 235, .55); }
.rank-3 { background: linear-gradient(135deg, #f59e0b, #92400e); color: #1a0e00; box-shadow: 0 0 14px -5px rgba(245, 158, 11, .55); }

/* Glow & Motion */
.gamify { position: relative; }
.gamify::after { content: ''; position: absolute; inset: -1px; border-radius: var(--radius); pointer-events: none; box-shadow: 0 0 34px -10px rgba(139, 92, 246, .5); animation: glowPulse 3.6s ease-in-out infinite; }
@keyframes glowPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.g-bar span { animation: barGrow .9s cubic-bezier(.2, .8, .2, 1); transform-origin: left; }
@keyframes barGrow { from { transform: scaleX(0); } }
.btn-primary:hover { box-shadow: 0 6px 22px -6px rgba(139, 92, 246, .75); }
.chat-send:hover { box-shadow: 0 6px 20px -6px rgba(139, 92, 246, .8); }
.stat { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.stat:hover { transform: translateY(-3px); border-color: var(--border-hover); box-shadow: 0 14px 34px -16px rgba(139, 92, 246, .35); }
.card { transition: border-color .2s ease; }
tr[data-href]:hover { box-shadow: inset 3px 0 0 var(--accent-violet); }
.me-link:hover .avatar { box-shadow: 0 0 0 2px var(--accent-violet), 0 0 14px -2px rgba(139, 92, 246, .8); }
.avatar { transition: box-shadow .2s ease; }

main.container > * { animation: riseIn .5s cubic-bezier(.2, .8, .2, 1) both; }
main.container > *:nth-child(1) { animation-delay: .02s; }
main.container > *:nth-child(2) { animation-delay: .07s; }
main.container > *:nth-child(3) { animation-delay: .12s; }
main.container > *:nth-child(4) { animation-delay: .17s; }
main.container > *:nth-child(5) { animation-delay: .22s; }
main.container > *:nth-child(n+6) { animation-delay: .27s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
    main.container > *, .g-bar span, .gamify::after { animation: none !important; }
}
