/* ═══════════════════════════════════════════════════════════
   نشمي Dashboard — Design System v2 (ProBot-style RTL)
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #0b0e17;
  --bg-soft: #10142a;
  --panel: #141937;
  --panel-2: #1a2044;
  --panel-hover: #1e2550;
  --line: #262d55;
  --line-2: #323a69;
  --text: #eef1ff;
  --text-2: #aab2d8;
  --text-3: #6b7499;
  --primary: #7c5cff;
  --primary-2: #9b7cff;
  --primary-soft: rgba(124, 92, 255, 0.14);
  --green: #2dd4a7;
  --green-soft: rgba(45, 212, 167, 0.14);
  --red: #ff5c7a;
  --red-soft: rgba(255, 92, 122, 0.13);
  --amber: #ffb020;
  --amber-soft: rgba(255, 176, 32, 0.14);
  --blue: #4c9aff;
  --blue-soft: rgba(76, 154, 255, 0.14);
  --pink: #ff6ac1;
  --pink-soft: rgba(255, 106, 193, 0.14);
  --cyan: #35d0f0;
  --cyan-soft: rgba(53, 208, 240, 0.13);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 10px 34px rgba(3, 5, 16, 0.45);
  --tr: all .22s cubic-bezier(.4, 0, .2, 1);
  --sidebar-w: 272px;
  --topbar-h: 68px;
}

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

body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(124, 92, 255, .13), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(53, 208, 240, .07), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2c3361; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ═══════════ App Layout ═══════════ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, #0e1226 0%, #0b0f20 100%);
  border-left: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #4cc9f0);
  display: grid; place-items: center;
  font-size: 20px; color: #fff;
  box-shadow: 0 6px 18px rgba(124, 92, 255, .4);
}
.brand-text { font-weight: 900; font-size: 15.5px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* Guild block in sidebar */
.side-guild {
  margin: 14px 14px 6px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(53,208,240,.07));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  transition: var(--tr);
  position: relative;
}
.side-guild:hover { border-color: var(--primary); transform: translateY(-1px); }
.side-guild img, .side-guild .g-letter {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  flex-shrink: 0;
}
.side-guild .g-letter {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: grid; place-items: center;
  font-weight: 900; font-size: 18px; color: #fff;
}
.side-guild .g-name {
  font-weight: 800; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 150px;
}
.side-guild .g-members { font-size: 11.5px; color: var(--text-2); display: flex; gap: 5px; align-items: center; }
.guild-switcher {
  position: absolute; top: calc(100% + 6px); right: 14px; left: 14px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  max-height: 260px; overflow: auto; display: none; z-index: 60; box-shadow: var(--shadow);
}
.guild-switcher.show { display: block; }
.guild-switcher a {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px;
  color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid rgba(38, 45, 85, .5);
  transition: var(--tr);
}
.guild-switcher a:hover { background: var(--panel-hover); color: var(--text); }
.guild-switcher a.active { color: var(--primary-2); background: var(--primary-soft); }
.guild-switcher img { width: 28px; height: 28px; border-radius: 8px; }

.nav { flex: 1; overflow-y: auto; padding: 10px 12px 20px; }
.nav-label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px;
  color: var(--text-3); text-transform: uppercase;
  margin: 16px 10px 6px;
  display: flex; align-items: center; gap: 8px;
}
.nav-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.8px;
  margin-bottom: 2px;
  position: relative;
  transition: var(--tr);
}
.nav a i { font-size: 16.5px; width: 22px; text-align: center; }
.nav a:hover { background: var(--panel-hover); color: var(--text); }
.nav a.active {
  background: linear-gradient(90deg, var(--primary-soft), transparent 90%);
  color: #fff;
  font-weight: 700;
}
.nav a.active::before {
  content: '';
  position: absolute; right: -12px; top: 20%; bottom: 20%; width: 3.5px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--cyan));
  box-shadow: 0 0 12px var(--primary);
}
.nav .pill {
  margin-inline-start: auto;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 10.5px; font-weight: 800;
  padding: 1.5px 8px; border-radius: 20px;
}
.nav .pill.on { background: var(--green-soft); color: var(--green); border-color: transparent; }

.side-foot {
  padding: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-foot img, .side-foot .u-letter { width: 38px; height: 38px; border-radius: 50%; }
.side-foot .u-letter { background: linear-gradient(135deg, var(--primary), var(--pink)); display: grid; place-items: center; color: #fff; font-weight: 800; }
.side-foot .u-name { font-size: 12.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.side-foot .u-sub { font-size: 10.5px; color: var(--text-3); }
.side-foot .exit {
  margin-inline-start: auto;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--text-3); text-decoration: none;
  transition: var(--tr);
  border: 1px solid transparent;
}
.side-foot .exit:hover { color: var(--red); background: var(--red-soft); }

/* Bot connection pill */
.conn {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800;
  padding: 5px 11px;
  border-radius: 20px;
  margin: 0 14px 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-3);
}
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.conn.ok { color: var(--green); border-color: rgba(45, 212, 167, .3); background: var(--green-soft); }
.conn.ok .dot { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.conn.bad { color: var(--red); border-color: rgba(255, 92, 122, .3); background: var(--red-soft); }
.conn.bad .dot { background: var(--red); }
@keyframes pulse { 50% { opacity: .4; } }

/* ═══════════ Main ═══════════ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 23, .75);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 { font-size: 17px; font-weight: 900; }
.topbar .sub { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer; text-decoration: none;
  transition: var(--tr);
  font-size: 15px;
}
.icon-btn:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }

.content { padding: 26px; max-width: 1330px; width: 100%; margin: 0 auto; flex: 1; }

/* ═══════════ Buttons ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9.5px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  text-decoration: none;
  transition: var(--tr);
  white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: var(--primary); transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), #6246ea);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 92, 255, .35);
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 8px 22px rgba(124, 92, 255, .45); }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.btn.green:hover { background: var(--green); color: #06281e; }
.btn.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn.xs { padding: 3px 9px; font-size: 11px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════ Hero (page header) ═══════════ */
.hero {
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 200px at 90% 0%, rgba(124, 92, 255, .18), transparent 60%),
    radial-gradient(400px 160px at 5% 100%, rgba(53, 208, 240, .09), transparent 60%),
    linear-gradient(180deg, #171c3d, #121733);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.hero .h-logo {
  width: 64px; height: 64px; border-radius: 18px; object-fit: cover;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  border: 2px solid rgba(255, 255, 255, .14);
}
.hero .h-title { font-size: 20px; font-weight: 900; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero .h-desc { color: var(--text-2); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.hero .h-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.hero .h-actions { margin-inline-start: auto; }

/* ═══════════ Cards ═══════════ */
.card {
  background: linear-gradient(180deg, var(--panel), #121832);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 11px;
}
.card-head h3 { font-size: 14.5px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.card-head h3 i { color: var(--primary-2); }
.card-head .head-side { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

/* Feature row (toggle rows like ProBot) */
.feat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(38, 45, 85, .55);
  transition: var(--tr);
}
.feat:last-child { border-bottom: 0; }
.feat:hover { background: rgba(30, 37, 80, .35); }
.feat .f-ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.feat .f-info { flex: 1; min-width: 0; }
.feat .f-name { font-weight: 800; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feat .f-desc { font-size: 11.8px; color: var(--text-2); margin-top: 1px; }
.feat .f-actions { display: flex; align-items: center; gap: 10px; }

/* Tiles (stats) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile {
  background: linear-gradient(180deg, var(--panel), #111630);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  transition: var(--tr);
  position: relative;
  overflow: hidden;
}
.tile::after {
  content: '';
  position: absolute; top: -40px; left: -40px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,255,.16), transparent 70%);
  pointer-events: none;
}
.tile:hover { border-color: #3a4390; transform: translateY(-2px); }
.tile .t-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.tile .t-label { font-size: 11.5px; color: var(--text-2); font-weight: 700; }
.tile .t-value { font-size: 21px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile .t-note { font-size: 10.5px; color: var(--text-3); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-guild { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.row-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid-2, .row-split { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
.mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 20px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }

/* ═══════════ Switch ═══════════ */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: #2a3057; border-radius: 30px;
  cursor: pointer;
  transition: var(--tr);
  border: 1px solid var(--line);
}
.switch .track::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px; right: 2.5px; top: 2px;
  border-radius: 50%;
  background: #8a92bd;
  transition: var(--tr);
}
.switch input:checked + .track { background: linear-gradient(90deg, var(--green), #1fb98d); border-color: transparent; }
.switch input:checked + .track::before { transform: translateX(-20px); background: #fff; }
.switch.lg { width: 54px; height: 30px; }
.switch.lg .track::before { width: 24px; height: 24px; }
.switch input:disabled + .track { opacity: .45; cursor: not-allowed; }

/* ═══════════ Chips / badges ═══════════ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800;
  padding: 3.5px 11px;
  border-radius: 20px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.chip.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.chip.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.chip.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.chip.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.chip.purple { background: var(--primary-soft); color: var(--primary-2); border-color: transparent; }
.chip.pink { background: var(--pink-soft); color: var(--pink); border-color: transparent; }
.chip.cyan { background: var(--cyan-soft); color: var(--cyan); border-color: transparent; }
.chip i { font-size: 11px; }

/* ═══════════ Forms ═══════════ */
.field { display: block; }
.field > label { display: block; font-size: 12px; font-weight: 800; color: var(--text-2); margin-bottom: 7px; }
.field > label .hint { font-weight: 600; color: var(--text-3); font-size: 10.5px; margin-inline-start: 6px; }
.inp, select.inp, textarea.inp {
  width: 100%;
  background: var(--bg-soft);
  border: 1.5px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-family: inherit;
  font-size: 13.3px;
  font-weight: 600;
  outline: none;
  transition: var(--tr);
}
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3.5px var(--primary-soft); }
.inp::placeholder { color: var(--text-3); font-weight: 500; }
textarea.inp { resize: vertical; min-height: 90px; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(0% + 16px) 55%, calc(0% + 21px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }
@media (max-width: 700px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.range { width: 100%; appearance: none; height: 6px; border-radius: 6px; background: #2a3057; outline: none; }
.range::-webkit-slider-thumb {
  appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 3px solid #fff2;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(124, 92, 255, .5);
}
.field-check { display: flex; gap: 10px; align-items: center; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 13px; cursor: pointer; transition: var(--tr); }
.field-check:hover { border-color: var(--line-2, #323a69); }
.field-check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.field-check span { font-size: 12.5px; font-weight: 700; color: var(--text-2); }

/* Section inside card */
.sec-title {
  font-size: 11px; font-weight: 900; letter-spacing: 1px;
  color: var(--primary-2); text-transform: uppercase;
  margin: 22px 0 12px;
  display: flex; align-items: center; gap: 9px;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.sec-title:first-child { margin-top: 0; }

/* ═══════════ Table ═══════════ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: right;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
  color: var(--text-3);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 20, 42, .6);
  white-space: nowrap;
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid rgba(38, 45, 85, .5); color: var(--text-2); font-weight: 600; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: var(--tr); }
.tbl tbody tr:hover { background: rgba(30, 37, 80, .3); }
.tbl .u-cell { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.tbl .u-cell img { width: 32px; height: 32px; border-radius: 50%; }

/* ═══════════ Tabs ═══════════ */
.tabs { display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--line); padding: 5px; border-radius: 13px; width: fit-content; margin-bottom: 20px; flex-wrap: wrap; }
.tabs .tab {
  padding: 8px 18px;
  font-size: 12.5px; font-weight: 800;
  color: var(--text-3);
  background: transparent; border: 0; border-radius: 9px;
  cursor: pointer; font-family: inherit;
  transition: var(--tr);
  display: inline-flex; gap: 7px; align-items: center;
}
.tabs .tab:hover { color: var(--text-2); }
.tabs .tab.active { background: linear-gradient(135deg, var(--primary), #6246ea); color: #fff; box-shadow: 0 4px 12px rgba(124, 92, 255, .35); }
.tabpane { display: none; }
.tabpane.active { display: block; animation: fadeSlide .25s ease; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(6px); } }

/* ═══════════ Members list ═══════════ */
.member-row {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(38, 45, 85, .5);
  transition: var(--tr);
  position: relative;
}
.member-row:hover { background: rgba(30, 37, 80, .3); }
.member-row:last-child { border-bottom: 0; }
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-wrap img, .avatar-wrap .m-letter { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.avatar-wrap .m-letter { background: linear-gradient(135deg, var(--primary), var(--cyan)); display: grid; place-items: center; font-weight: 900; color: #fff; }
.presence {
  position: absolute; bottom: -1px; left: -1px;
  width: 13px; height: 13px; border-radius: 50%;
  border: 2.5px solid var(--panel);
}
.presence.online { background: var(--green); }
.presence.idle { background: var(--amber); }
.presence.dnd { background: var(--red); }
.presence.offline { background: #565f85; }
.m-info { flex: 1; min-width: 0; }
.m-name { font-weight: 800; font-size: 13.8px; display: flex; align-items: center; gap: 7px; }
.m-name .bot-tag { background: var(--blue-soft); color: var(--blue); font-size: 9px; font-weight: 900; padding: 1px 6px; border-radius: 5px; }
.m-sub { font-size: 11px; color: var(--text-3); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-roles { display: flex; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
.m-roles .mini-role { font-size: 9.5px; font-weight: 800; padding: 1px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2); }
.m-roles .mini-role.more { background: var(--primary-soft); color: var(--primary-2); border-color: transparent; }

/* ═══════════ Ticket cards ═══════════ */
.tk {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 15px 17px;
  margin-bottom: 12px;
  transition: var(--tr);
}
.tk:hover { border-color: #3a4390; }
.tk-head { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.tk-sub { font-size: 11.5px; color: var(--text-3); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.tk-actions { margin-inline-start: auto; display: flex; gap: 7px; flex-wrap: wrap; }

/* ═══════════ Modal ═══════════ */
.scrim {
  position: fixed; inset: 0;
  background: rgba(5, 7, 18, .78);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.scrim.show { display: flex; }
.modal {
  background: linear-gradient(180deg, #171c3d, #121733);
  border: 1px solid var(--line-2, #323a69);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: popIn .22s cubic-bezier(.34, 1.4, .64, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.modal-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { font-size: 15px; font-weight: 900; flex: 1; }
.modal-body { padding: 20px; }
.modal-foot { padding: 15px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-start; }

/* ═══════════ Toast ═══════════ */
.toasts { position: fixed; bottom: 22px; left: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px; max-width: 380px;
  background: linear-gradient(180deg, #181d40, #121733);
  border: 1px solid var(--line-2, #323a69);
  border-radius: 13px;
  padding: 13px 16px;
  display: flex; gap: 11px; align-items: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  animation: toastIn .3s cubic-bezier(.34, 1.3, .64, 1);
  font-size: 13px; font-weight: 700;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-30px); } }
.toast.out { opacity: 0; transform: translateX(-30px); transition: var(--tr); }
.toast i { font-size: 17px; }
.toast.success i { color: var(--green); } .toast.success { border-color: rgba(45, 212, 167, .4); }
.toast.error i { color: var(--red); } .toast.error { border-color: rgba(255, 92, 122, .4); }
.toast.info i { color: var(--blue); }
.toast.warn i { color: var(--amber); }

/* ═══════════ Empty / Skeleton / misc ═══════════ */
.empty { text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty i { font-size: 42px; margin-bottom: 12px; display: block; opacity: .55; }
.empty h4 { color: var(--text-2); font-size: 15px; font-weight: 800; margin-bottom: 5px; }
.empty p { font-size: 12.5px; max-width: 380px; margin: 0 auto; }
.skel { background: linear-gradient(90deg, #1a2044 25%, #21285a 50%, #1a2044 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 9px; color: transparent !important; user-select: none; }
@keyframes shimmer { 0% { background-position: 200% 0; } }
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.banner {
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 12.8px; font-weight: 700;
  display: flex; gap: 10px; align-items: center;
  border: 1px solid;
  margin-bottom: 16px;
}
.banner.warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(255, 176, 32, .3); }
.banner.bad { background: var(--red-soft); color: var(--red); border-color: rgba(255, 92, 122, .3); }
.banner.ok { background: var(--green-soft); color: var(--green); border-color: rgba(45, 212, 167, .3); }
.banner.blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(76, 154, 255, .3); }

.code-cell { font-family: 'Cascadia Code', Consolas, monospace; font-size: 11.5px; direction: ltr; unicode-bidi: plaintext; }
.text-dim { color: var(--text-3); }
.text-mid { color: var(--text-2); }
.fw800 { font-weight: 800; }
.num { font-variant-numeric: tabular-nums; }
.w-100 { width: 100%; }
.flex { display: flex; gap: 10px; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Guild card (servers list) */
.gcard {
  background: linear-gradient(180deg, var(--panel), #121832);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--tr);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 13px;
  position: relative;
  overflow: hidden;
}
.gcard::before {
  content: '';
  position: absolute; inset-inline: 0; top: 0; height: 3.5px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  opacity: 0;
  transition: var(--tr);
}
.gcard:hover { transform: translateY(-4px); border-color: #3d4687; box-shadow: 0 18px 44px rgba(0, 0, 0, .5); }
.gcard:hover::before { opacity: 1; }
.gcard img, .gcard .g-letter { width: 58px; height: 58px; border-radius: 16px; object-fit: cover; }
.gcard .g-letter { background: linear-gradient(135deg, var(--primary), var(--cyan)); display: grid; place-items: center; font-weight: 900; font-size: 22px; color: #fff; }
.gcard .g-name { font-weight: 900; font-size: 15.5px; }
.gcard .g-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.gcard .enter { margin-top: auto; display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 800; color: var(--primary-2); }

/* Mobile */
.mobile-btn { display: none; }
@media (max-width: 960px) {
  .sidebar {
    position: fixed; inset-inline-start: 0; top: 0; bottom: 0;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, .5);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-btn { display: grid; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
}
