/* ============================================================
   Akusha platform — design system
   Premium dark, red signal accent, glass + depth.
   ============================================================ */
:root {
  --bg: #0a0608;
  --bg-2: #0f0a0c;
  --panel: #141013;
  --panel-2: #1a1519;
  --panel-3: #221a1f;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ececf0;
  --muted: #9aa0aa;
  --faint: #6b6b74;
  --accent: #df1734;
  --accent-2: #ff2d49;
  --accent-soft: rgba(223, 23, 52, 0.14);
  --good: #3ad07a;
  --warn: #ffb03d;
  --bad: #ff4d5e;
  --info: #4da3ff;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font); color: var(--text);
  background:
    radial-gradient(1200px 700px at 82% -10%, rgba(223, 23, 52, 0.16), transparent 60%),
    radial-gradient(900px 600px at 8% 108%, rgba(123, 63, 242, 0.12), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); gap: 10px; font-size: 14px; }
.boot__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }
.hidden { display: none !important; }

/* ---------- auth screens ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.auth__card {
  width: min(430px, 100%); background: linear-gradient(180deg, rgba(26, 21, 25, 0.92), rgba(15, 10, 12, 0.96));
  border: 1px solid var(--line); border-radius: 22px; padding: 34px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.auth__card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.auth__logo { display: flex; align-items: center; gap: 11px; margin-bottom: 4px; }
.auth__logo b { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(150deg, var(--accent-2), #650713); display: grid; place-items: center; font-weight: 800; box-shadow: 0 0 22px rgba(255, 45, 73, 0.5); }
.auth__logo span { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; }
.auth h1 { font-size: 23px; margin: 18px 0 4px; }
.auth p.sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line-2); border-radius: 11px;
  padding: 12px 13px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn {
  width: 100%; padding: 12px 16px; border-radius: 11px; font-weight: 700; letter-spacing: 0.02em;
  background: linear-gradient(150deg, var(--accent-2), #7d0a1a); box-shadow: 0 8px 24px rgba(223, 23, 52, 0.32);
  transition: transform 0.12s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn--ghost { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); box-shadow: none; }
.btn--sm { width: auto; padding: 8px 13px; font-size: 13px; }
.btn--danger { background: linear-gradient(150deg, #ff4d5e, #7d0a12); }
.btn--good { background: linear-gradient(150deg, #3ad07a, #0a5b34); }
.auth__switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 13px; }
.auth__switch b { color: var(--accent-2); cursor: pointer; }
.auth__tabs { display: flex; gap: 6px; margin-bottom: 18px; background: rgba(0,0,0,0.3); padding: 4px; border-radius: 11px; }
.auth__tabs button { flex: 1; padding: 9px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.auth__tabs button.on { background: var(--accent-soft); color: var(--text); }
.form-error { background: rgba(255, 77, 94, 0.12); border: 1px solid rgba(255, 77, 94, 0.35); color: #ff9ba4; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.form-ok { background: rgba(58, 208, 122, 0.12); border: 1px solid rgba(58, 208, 122, 0.3); color: #8ff0b8; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 74px 248px 1fr; height: 100vh; }
.rail { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 8px; overflow-y: auto; }
.rail__logo { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(150deg, var(--accent-2), #650713); display: grid; place-items: center; font-weight: 800; box-shadow: 0 0 20px rgba(255, 45, 73, 0.45); margin-bottom: 6px; }
.rail__sep { width: 30px; height: 1px; background: var(--line); margin: 4px 0; }
.rail-item { position: relative; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: var(--muted); background: rgba(255, 255, 255, 0.04); transition: all 0.16s; }
.rail-item:hover { background: var(--accent-soft); color: var(--text); border-radius: 13px; }
.rail-item.on { background: linear-gradient(150deg, var(--accent), #7d0a1a); color: #fff; border-radius: 13px; }
.rail-item.on::before { content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 5px; height: 26px; background: #fff; border-radius: 0 4px 4px 0; }
.rail-item .badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-2); font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg-2); }
.rail-item svg { width: 22px; height: 22px; }
.rail__spacer { flex: 1; }

/* sidebar */
.side { background: var(--bg-2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.side__head { padding: 16px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.side__scroll { flex: 1; overflow-y: auto; padding: 10px 8px; }
.cat { margin: 12px 6px 4px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.chan { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-size: 14.5px; transition: background 0.12s, color 0.12s; }
.chan:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.chan.on { background: var(--accent-soft); color: #fff; }
.chan .hash { color: var(--faint); font-weight: 700; }
.chan.voice .hash { color: var(--info); }
.chan .badge { margin-left: auto; background: var(--accent-2); font-size: 11px; padding: 1px 7px; border-radius: 9px; font-weight: 700; }

/* self dock */
.dock { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 10px; background: rgba(0, 0, 0, 0.3); }
.dock .who { min-width: 0; flex: 1; }
.dock .who b { font-size: 13.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock .who small { color: var(--good); font-size: 11.5px; }
.dock .icons { display: flex; gap: 4px; }
.dock .icons button { width: 32px; height: 32px; border-radius: 9px; color: var(--muted); display: grid; place-items: center; }
.dock .icons button:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* avatars */
.av { border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; background: var(--accent); overflow: hidden; position: relative; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av--sm { width: 34px; height: 34px; font-size: 13px; }
.av--md { width: 42px; height: 42px; font-size: 15px; }
.av--lg { width: 84px; height: 84px; font-size: 30px; }
.av--xl { width: 116px; height: 116px; font-size: 40px; border-radius: 28px; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg-2); position: absolute; right: -1px; bottom: -1px; background: var(--faint); }
.dot.on { background: var(--good); }

/* main */
.main { min-width: 0; display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(20,16,19,0.4), transparent 200px); }
.topbar { height: 56px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 18px; flex: none; }
.topbar .title { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.topbar .topic { color: var(--muted); font-size: 13px; border-left: 1px solid var(--line); padding-left: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar .tb-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.topbar .tb-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.content { flex: 1; overflow-y: auto; }
.pad { padding: 24px; }

/* messages */
.msgs { display: flex; flex-direction: column; padding: 16px 18px 8px; gap: 2px; }
.msg { display: flex; gap: 12px; padding: 6px 8px; border-radius: 10px; position: relative; }
.msg:hover { background: rgba(255, 255, 255, 0.03); }
.msg__body { min-width: 0; flex: 1; }
.msg__head { display: flex; align-items: baseline; gap: 8px; }
.msg__head b { font-size: 14.5px; }
.msg__head .bot-tag { background: var(--accent-soft); color: var(--accent-2); font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 5px; letter-spacing: 0.05em; }
.msg__head time { color: var(--faint); font-size: 11.5px; }
.msg__text { font-size: 14.5px; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; }
.msg__text.deleted { color: var(--faint); font-style: italic; }
.msg__actions { position: absolute; top: -10px; right: 10px; display: none; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.msg:hover .msg__actions { display: flex; }
.msg__actions button { width: 28px; height: 28px; border-radius: 6px; color: var(--muted); display: grid; place-items: center; }
.msg__actions button:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.reacts { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.react { background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 20px; padding: 2px 8px; font-size: 12.5px; display: flex; gap: 4px; align-items: center; }
.typing { color: var(--muted); font-size: 12.5px; padding: 2px 24px; height: 20px; }
.composer { padding: 12px 18px 18px; flex: none; }
.composer__box { display: flex; align-items: flex-end; gap: 10px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px 10px; }
.composer textarea { flex: 1; background: none; border: none; outline: none; resize: none; max-height: 160px; padding: 6px 4px; font-size: 14.5px; }
.composer .send { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; flex: none; }

/* cards / grids */
.grid { display: grid; gap: 16px; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: transform 0.15s, border-color 0.15s; }
.card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.usercard { text-align: center; cursor: pointer; }
.usercard .banner { height: 64px; border-radius: 10px; margin: -4px -4px 0; background: linear-gradient(120deg, var(--accent), #3a0a12); }
.usercard .av { margin: -34px auto 8px; border: 3px solid var(--panel); }
.usercard b { display: block; }
.usercard small { color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.chip { background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 20px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.badge-verified { color: var(--info); }

.section-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.section-sub { color: var(--muted); margin-bottom: 18px; font-size: 14px; }

/* profile */
.profile__banner { height: 180px; border-radius: 18px; background: linear-gradient(120deg, var(--accent), #2a0710); position: relative; }
.profile__bar { display: flex; align-items: flex-end; gap: 18px; margin-top: -46px; padding: 0 20px; }
.profile__meta { flex: 1; padding-bottom: 6px; }
.profile__meta h2 { font-size: 24px; display: flex; align-items: center; gap: 8px; }
.profile__meta .handle { color: var(--muted); }
.stat-row { display: flex; gap: 22px; margin: 16px 0; }
.stat b { font-size: 19px; }
.stat small { color: var(--muted); display: block; font-size: 12px; }

/* tables (admin) */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,0.03); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.active { background: rgba(58,208,122,0.15); color: var(--good); }
.pill.suspended { background: rgba(255,176,61,0.15); color: var(--warn); }
.pill.banned { background: rgba(255,77,94,0.15); color: var(--bad); }
.pill.role { background: var(--accent-soft); color: var(--accent-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { padding: 10px 15px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat-card .n { font-size: 26px; font-weight: 800; }
.stat-card .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* voice */
.voice-stage { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 24px; }
.vtile { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 20px; text-align: center; transition: border-color 0.1s; }
.vtile.speaking { border-color: var(--good); box-shadow: 0 0 22px rgba(58,208,122,0.3); }
.vtile .av { margin: 0 auto 10px; }
.vtile b { display: block; }
.vtile .vstate { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; gap: 6px; justify-content: center; }
.voice-bar { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.3); }
.voice-bar .vb { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--text); }
.voice-bar .vb.on { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent); }
.voice-bar .vb.leave { background: rgba(255,77,94,0.16); color: var(--bad); margin-left: auto; }

/* modal / toast */
.modal-layer { position: fixed; inset: 0; background: rgba(5,3,4,0.66); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 60; padding: 20px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: 88vh; overflow-y: auto; background: linear-gradient(180deg, var(--panel-2), var(--bg-2)); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal__head h3 { font-size: 17px; }
.modal__body { padding: 20px; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.x { width: 32px; height: 32px; border-radius: 9px; color: var(--muted); display: grid; place-items: center; }
.x:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 12px; padding: 12px 16px; min-width: 240px; box-shadow: var(--shadow); animation: slidein 0.2s; font-size: 14px; }
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.row { display: flex; gap: 10px; align-items: center; }
.wrap { display: flex; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .fw { width: 100%; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
label.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; margin: 8px 0; }
label.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.mobile-tab { display: none; }

/* responsive */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; top: auto; flex-direction: row; height: 62px; width: 100%; z-index: 40; padding: 0 8px; justify-content: space-around; border-top: 1px solid var(--line); border-right: none; }
  .rail__logo, .rail__sep, .rail__spacer, .rail-item.desktop-only { display: none; }
  .side { position: fixed; inset: 0 auto 62px 0; width: 84%; max-width: 320px; z-index: 45; transform: translateX(-100%); transition: transform 0.2s; }
  .side.open { transform: none; }
  .main { padding-bottom: 62px; }
  .mobile-tab { display: grid; }
}
