/* ============================================================
   Veyrahub DriverHUB — dark truck-instrument theme
   ============================================================ */

:root {
  --bg: #070a0f;
  --bg-2: #0b1017;
  --panel: #101722;
  --panel-2: #141d2a;
  --panel-3: #192433;
  --line: #1e2a3a;
  --line-2: #2a3a50;
  --text: #e9f0f8;
  --muted: #93a6bd;
  --dim: #6a7f96;
  --amber: #ffa62b;
  --amber-2: #ff7a18;
  --cyan: #38bdf8;
  --green: #34d399;
  --red: #f87171;
  --purple: #3f9dc4;
  --yellow: #facc15;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --sidebar-w: 248px;
  --titlebar-h: 34px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 8% -8%, rgba(255, 166, 43, 0.1), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(56, 189, 248, 0.08), transparent 55%),
    linear-gradient(180deg, #080c12 0%, #070a0f 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 80%);
  z-index: 0;
}

/* Electron 自定义标题栏 */
body.desktop-shell {
  padding-top: var(--titlebar-h);
  background: #060f15;
}
body.desktop-shell .shell {
  min-height: calc(100vh - var(--titlebar-h));
}
body.desktop-shell .sidebar {
  top: var(--titlebar-h);
  height: calc(100vh - var(--titlebar-h));
}
body.desktop-shell .topbar {
  top: var(--titlebar-h);
}
.desktop-titlebar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 9px;
  height: var(--titlebar-h);
  padding: 0 152px 0 12px;
  overflow: hidden;
  border-bottom: 1px solid rgba(30, 42, 58, 0.9);
  background: #060f15;
  -webkit-app-region: drag;
  user-select: none;
}
.desktop-titlebar-icon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}
.desktop-titlebar-brand {
  color: #d7e1ed;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.desktop-titlebar-route {
  min-width: 0;
  overflow: hidden;
  color: var(--dim);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desktop-titlebar-route::before {
  content: "·";
  margin-right: 8px;
  color: #3d4f64;
}
.desktop-titlebar-route:empty::before {
  content: "";
  margin: 0;
}

::selection {
  background: rgba(255, 166, 43, 0.3);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #223046;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: #2e405c;
  background-clip: padding-box;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

svg {
  display: block;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  background: var(--panel-3);
  border-color: #3a5273;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(180deg, var(--amber) 0%, #f08a12 100%);
  border-color: #ffb95e;
  color: #1a1205;
  box-shadow: 0 6px 20px rgba(255, 140, 26, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ffb54d 0%, #ff941f 100%);
  border-color: #ffd08a;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: transparent;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #ffb4b4;
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.6);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
  gap: 6px;
}
.btn-sm svg {
  width: 14px;
  height: 14px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--line);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.icon-btn.active {
  color: var(--amber);
  background: rgba(255, 166, 43, 0.12);
  border-color: rgba(255, 166, 43, 0.28);
}

/* ------------------------------------------------------------- inputs */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.field .hint {
  font-size: 11.5px;
  color: var(--dim);
}
input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: #0b111a;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
textarea {
  height: auto;
  min-height: 92px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.55;
}

/* 只读展示（例如活动名称）：看起来仍是字段，但不可编辑 */
input[readonly] {
  cursor: default;
  color: var(--dim);
  background: #090e15;
}
input::placeholder,
textarea::placeholder {
  color: #51667d;
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 166, 43, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 166, 43, 0.13);
  background: #0d141e;
}
input[type="date"],
input[type="datetime-local"] {
  color-scheme: dark;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2393a6bd' stroke-width='2' stroke-linecap='round'><path d='M4 6l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #0b111a;
  border: 1px solid var(--line);
  gap: 2px;
}
.seg button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.seg button:hover {
  color: var(--text);
}
.seg button.on {
  background: var(--panel-3);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.seg button.on.ets2 {
  color: #ffcf7a;
}
.seg button.on.ats {
  color: #8fd8ff;
}

/* --------------------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 23, 34, 0.9), rgba(9, 13, 19, 0.92));
  backdrop-filter: blur(14px);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 2px 8px 20px;
}
.brand-logo-wrap {
  width: 122px;
  height: 99px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.brand-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(47, 155, 255, 0.28));
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(255, 166, 43, 0.2), rgba(255, 122, 24, 0.05));
  border: 1px solid rgba(255, 166, 43, 0.35);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.brand-mark svg {
  width: 24px;
  height: 24px;
  color: var(--amber);
}
.brand-name {
  display: none;
}
.brand-sub {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1px;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding-right: 2px;
}
.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 14px 12px 6px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: 0.85;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
  color: #ffd79a;
  background: linear-gradient(90deg, rgba(255, 166, 43, 0.16), rgba(255, 166, 43, 0.03));
  border-color: rgba(255, 166, 43, 0.22);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--amber);
  box-shadow: 0 0 12px rgba(255, 166, 43, 0.7);
}
.nav-item .badge-dot {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 0;
}
.user-chip:hover {
  border-color: var(--line-2);
  background: rgba(255, 255, 255, 0.04);
}
.user-chip .who {
  min-width: 0;
  flex: 1;
}
.user-chip .who strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip .who span {
  font-size: 10.5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.avatar {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  color: #0a0d12;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: visible;
}
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}
.avatar.sm {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 11px;
}
.avatar.lg {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  font-size: 19px;
}
.avatar .presence-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #0b111a;
  background: var(--dim);
}
.avatar .presence-dot.on {
  background: var(--green);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.82);
  backdrop-filter: blur(16px);
}
.topbar .hamburger {
  display: none;
}
.topbar-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}
.topbar-spacer {
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.clock {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  letter-spacing: 0.04em;
}

.view {
  padding: 26px 28px 60px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  animation: fadeUp 0.28s ease;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------- page head */

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-title .accent {
  color: var(--amber);
}
.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
  max-width: 720px;
}
.page-head .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- cards */

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(21, 30, 43, 0.75), rgba(15, 22, 32, 0.75));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
}
.card.pad-0 {
  padding: 0;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-head .right {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-dash {
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}
.grid-live {
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
}

.span-2 {
  grid-column: span 2;
}

/* ---------------------------------------------------------------- stats */

.stat {
  padding: 16px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 108px;
}
.stat-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-label {
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
}
.stat-icon {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--muted);
}
.stat-icon svg {
  width: 16px;
  height: 16px;
}
.stat-value {
  font-family: var(--mono);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.stat-value small {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: 0;
}
.stat-meta {
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 6px;
}
.goal-bar {
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.goal-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  opacity: 0.9;
  transition: width 0.4s ease;
}
.stat.amber .goal-bar-fill { color: var(--amber); }
.stat.green .goal-bar-fill { color: var(--green); }
.stat.cyan .goal-bar-fill { color: var(--cyan); }
.stat.purple .goal-bar-fill { color: var(--purple); }
.stat.amber .stat-icon {
  color: var(--amber);
  background: rgba(255, 166, 43, 0.1);
  border-color: rgba(255, 166, 43, 0.25);
}
.stat.cyan .stat-icon {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
}
.stat.green .stat-icon {
  color: var(--green);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
}
.stat.purple .stat-icon {
  color: var(--purple);
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.25);
}

/* --------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.ets2 {
  color: #ffcf7a;
  background: rgba(255, 166, 43, 0.12);
  border-color: rgba(255, 166, 43, 0.3);
}
.badge.ats {
  color: #8fd8ff;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.32);
}
.badge.rank-owner,
.badge.rank-founder {
  color: #ffd166;
  background: rgba(250, 204, 21, 0.1);
  border-color: rgba(250, 204, 21, 0.3);
}
.badge.rank-co-founder,
.badge.rank-ceo,
.badge.rank-coo {
  color: #ffc48a;
  background: rgba(255, 159, 28, 0.1);
  border-color: rgba(255, 159, 28, 0.3);
}
.badge.rank-dev-manager,
.badge.rank-developer-team {
  color: #9ad7ff;
  background: rgba(63, 157, 196, 0.12);
  border-color: rgba(63, 157, 196, 0.3);
}
.badge.rank-media-manager,
.badge.rank-pr-manager {
  color: #a8f0e0;
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.3);
}
.badge.rank-event-team,
.badge.rank-media-team,
.badge.rank-pr-team {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line-2);
}
.badge.rank-senior-hr,
.badge.rank-hr-manager,
.badge.rank-hr-team {
  color: #ff9db5;
  background: rgba(255, 111, 145, 0.1);
  border-color: rgba(255, 111, 145, 0.3);
}
.badge.rank-senior-event-manager,
.badge.rank-event-manager,
.badge.rank-event-team {
  color: #86e3b4;
  background: rgba(61, 220, 151, 0.1);
  border-color: rgba(61, 220, 151, 0.28);
}
.badge.rank-manager {
  color: #9ad7ff;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.28);
}
.badge.rank-driver {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-2);
}
.badge.pending {
  color: #ffd67a;
  background: rgba(250, 204, 21, 0.1);
  border-color: rgba(250, 204, 21, 0.3);
}
.badge.approved,
.badge.going {
  color: #86efac;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
}
.badge.rejected,
.badge.declined {
  color: #ffb0b0;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.3);
}
.badge.maybe {
  color: #b9dcf0;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.3);
}
.badge.live {
  color: #86efac;
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.35);
}
.badge.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ---------------------------------------------------------------- table */

.table-wrap {
  overflow-x: auto;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(8, 12, 18, 0.5);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(30, 42, 58, 0.65);
  vertical-align: middle;
  white-space: nowrap;
}
.table tbody tr {
  transition: background 0.12s ease;
}
.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.table .route {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.table .route svg {
  width: 13px;
  height: 13px;
  color: var(--dim);
}
.table .driver {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table .strong {
  color: var(--text);
  font-weight: 600;
}
.table .sub {
  color: var(--dim);
  font-size: 11.5px;
}

/* ----------------------------------------------------------------- list */

.rows {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(30, 42, 58, 0.6);
}
.row:last-child {
  border-bottom: 0;
}
.row .grow {
  flex: 1;
  min-width: 0;
}
.row .title {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.row .title > svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--dim);
}
.row .meta {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.row .meta b {
  font-weight: 600;
  color: var(--muted);
}
.row .end {
  text-align: right;
  flex: 0 0 auto;
}
.row .end .big {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}
.row .end .small {
  font-size: 11px;
  color: var(--dim);
}

/* ---------------------------------------------------------------- empty */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 46px 20px;
  color: var(--dim);
  gap: 10px;
}
.empty .glyph {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.empty .glyph svg {
  width: 22px;
  height: 22px;
}
.empty strong {
  color: var(--muted);
  font-size: 14px;
}
.empty p {
  font-size: 12.5px;
  max-width: 380px;
}

/* ------------------------------------------------------------------ chart */

.chart-box {
  position: relative;
  width: 100%;
}
.chart-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
}
.legend .item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend .swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

/* --------------------------------------------------------------- login */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.auth-hero {
  position: relative;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(900px 500px at 20% 20%, rgba(255, 166, 43, 0.14), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(56, 189, 248, 0.1), transparent 60%),
    linear-gradient(135deg, #0d141e, #070a0f);
  overflow: hidden;
}
.auth-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -60px;
  width: 520px;
  height: 520px;
  border: 70px solid rgba(255, 166, 43, 0.05);
  border-radius: 50%;
}
.auth-hero .brand {
  padding: 0;
}
.auth-hero h1 {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin-bottom: 18px;
  max-width: 520px;
}
.auth-hero h1 em {
  font-style: normal;
  color: var(--amber);
}
.auth-hero p {
  color: var(--muted);
  max-width: 460px;
  font-size: 14px;
  line-height: 1.7;
}
.hero-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}
.hero-point {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: 13px;
}
.hero-point .tick {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 166, 43, 0.12);
  border: 1px solid rgba(255, 166, 43, 0.3);
  color: var(--amber);
}
.hero-point .tick svg {
  width: 13px;
  height: 13px;
}
.hero-stats {
  display: flex;
  gap: 34px;
  margin-top: 34px;
}
.hero-stats .n {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.hero-stats .l {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
}

/* 单栏登录：大卡片、居中品牌标、只有一个 Discord 入口 */
.auth-solo {
  grid-template-columns: minmax(0, 1fr);
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(56, 132, 214, 0.18), transparent 65%),
    radial-gradient(700px 480px at 85% 110%, rgba(255, 166, 43, 0.09), transparent 62%),
    linear-gradient(160deg, #0a1a2b 0%, #070e17 55%, #05090f 100%);
}
.auth-card-solo {
  width: 100%;
  max-width: 860px;
  padding: 46px 56px 34px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  background: linear-gradient(180deg, #111722, #0d121a);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.auth-logo {
  width: 168px;
  height: 118px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 26px rgba(47, 155, 255, 0.35));
}
.auth-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f2f6fc;
  margin: 0;
}
.auth-subtitle {
  margin: 10px 0 32px;
  font-size: 14px;
  color: #8ea3bd;
}
.auth-tmp-head {
  max-width: 420px;
  margin: 0 auto 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: #dbe4f0;
}
.auth-tmp-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  text-align: left;
}
.auth-tmp-form .auth-label {
  margin-bottom: 0;
}
.auth-tmp-form .auth-signin {
  margin-top: 2px;
}
.auth-tmp-hint {
  max-width: 420px;
  margin: 10px auto 0;
  text-align: left;
}
.auth-or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 22px auto 16px;
  color: #6f829b;
  font-size: 12px;
}
.auth-or-line::before,
.auth-or-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.auth-divider {
  margin: 0 auto 16px;
  max-width: 420px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #c8d3e3;
}
.btn.auth-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid #5865f2;
  color: #b3bdff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(88, 101, 242, 0.18);
}
.btn.auth-discord svg {
  color: #8b9bff;
}
.btn.auth-discord:hover {
  background: rgba(88, 101, 242, 0.2);
  border-color: #6c78f5;
  color: #d3d9ff;
}
.auth-discord.is-loading {
  opacity: 0.75;
  pointer-events: none;
}
.auth-hint {
  margin-top: 20px;
  color: #6f829b;
  font-size: 12px;
  line-height: 1.6;
}
.auth-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 44px;
  margin-top: 30px;
  text-align: left;
  align-items: start;
}
.auth-label {
  font-size: 13px;
  font-weight: 600;
  color: #dbe4f0;
  margin-bottom: -6px;
}
.auth-form input {
  height: 46px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #1a2130;
  color: #edf2fa;
  padding: 0 14px;
  font-size: 13.5px;
}
.auth-form input::placeholder {
  color: #6f829b;
}
.auth-form input:focus {
  outline: none;
  border-color: #2f9bff;
  box-shadow: 0 0 0 3px rgba(47, 155, 255, 0.12);
}
.auth-card-solo .auth-signin {
  height: 48px;
  width: 100%;
  margin-top: 6px;
  font-weight: 600;
  background: linear-gradient(180deg, #2b9bf5, #1a7fd6);
  border: 1px solid #2b9bf5;
  color: #fff;
  box-shadow: 0 8px 24px rgba(43, 155, 245, 0.25);
}
.auth-card-solo .auth-signin:hover {
  background: linear-gradient(180deg, #3aa7ff, #2189e0);
}
.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
}
.auth-or {
  font-size: 13px;
  font-weight: 600;
  color: #c8d3e3;
  margin-bottom: 2px;
}
.btn.auth-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  width: 100%;
  background: #171e2a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e6ecf5;
  text-decoration: none;
  font-weight: 600;
}
.btn.auth-provider:hover {
  background: #1d2533;
  border-color: rgba(255, 255, 255, 0.2);
}
.btn.auth-provider svg {
  color: #9fb0c6;
}
.btn.auth-provider-discord {
  background: rgba(88, 101, 242, 0.1);
  border-color: #5865f2;
  color: #b3bdff;
}
.btn.auth-provider-discord:hover {
  background: rgba(88, 101, 242, 0.2);
  border-color: #6c78f5;
}
.btn.auth-provider-discord svg {
  color: #8b9bff;
}
.auth-provider.is-loading,
.auth-signin:disabled {
  opacity: 0.7;
  pointer-events: none;
}
.auth-discord-solo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  width: 100%;
  max-width: 420px;
  margin: 8px auto 0;
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid #5865f2;
  color: #b3bdff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 4px 24px rgba(88, 101, 242, 0.18);
}
.auth-discord-solo svg {
  color: #8b9bff;
}
.auth-discord-solo:hover {
  background: rgba(88, 101, 242, 0.22);
  border-color: #6c78f5;
  color: #d3d9ff;
}
.auth-discord-solo.is-loading {
  opacity: 0.75;
  pointer-events: none;
}
.auth-lang {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
}
.auth-card h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.auth-card .sub {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 24px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form .btn {
  height: 44px;
  margin-top: 4px;
}
.auth-switch {
  text-align: center;
  font-size: 12.5px;
  color: var(--dim);
  margin-top: 20px;
}
.auth-switch button {
  background: none;
  border: 0;
  color: var(--amber);
  cursor: pointer;
  font-weight: 700;
  padding: 0 2px;
}
.demo-box {
  margin-top: 22px;
  border-radius: 11px;
  border: 1px dashed var(--line-2);
  padding: 12px 14px;
  font-size: 11.5px;
  color: var(--dim);
  line-height: 1.8;
}
.demo-box b {
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 600;
}
.auth-error {
  display: none;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #ffb4b4;
  font-size: 12.5px;
}
.auth-error.show {
  display: block;
}

/* ---------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 7, 11, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 18px 40px;
  overflow-y: auto;
  animation: fadeIn 0.16s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.modal {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(180deg, #131c28, #0e1520);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
  overflow: hidden;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}
.modal.wide {
  max-width: 720px;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  font-size: 16px;
  font-weight: 700;
}
.modal-head .icon-btn {
  margin-left: auto;
}
.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
}
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  background: rgba(8, 12, 18, 0.4);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full {
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------------- toast */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: 11px;
  background: #141e2b;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--text);
  animation: toastIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: auto;
}
.toast.out {
  animation: toastOut 0.2s ease forwards;
}
.toast .ico {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.toast .ico svg {
  width: 13px;
  height: 13px;
}
.toast.ok .ico {
  background: rgba(52, 211, 153, 0.16);
  color: var(--green);
}
.toast.err .ico {
  background: rgba(248, 113, 113, 0.16);
  color: var(--red);
}
.toast.info .ico {
  background: rgba(56, 189, 248, 0.16);
  color: var(--cyan);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}
@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(18px);
  }
}

/* --------------------------------------------------------------- gauges */

.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.gauge {
  position: relative;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1.55;
}
.gauge svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.gauge .track {
  stroke: #1b2839;
  stroke-width: 10;
  fill: none;
  stroke-linecap: round;
}
.gauge .value-arc {
  stroke: url(#gaugeGrad);
  stroke-width: 10;
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  filter: drop-shadow(0 0 7px rgba(255, 166, 43, 0.45));
}
.gauge .ticks line {
  stroke: #2c3d55;
  stroke-width: 2;
  stroke-linecap: round;
}
.gauge .needle {
  stroke: var(--amber);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px rgba(255, 166, 43, 0.7));
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  transform-origin: 100px 100px;
}
.gauge .needle-cap {
  fill: var(--amber);
}
.gauge-read {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16%;
  text-align: center;
}
.gauge-read .v {
  font-family: var(--mono);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}
.gauge-read .u {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 4px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
}
.metric .l {
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}
.metric .v {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  margin-top: 3px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.metric .v small {
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--dim);
  font-weight: 600;
}

.bar {
  height: 7px;
  border-radius: 4px;
  background: #1b2839;
  overflow: hidden;
  position: relative;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--amber-2), var(--amber));
  transition: width 0.4s ease;
}
.bar.green > i {
  background: linear-gradient(90deg, #0f9d6f, var(--green));
}
.bar.red > i {
  background: linear-gradient(90deg, #b91c1c, var(--red));
}
.bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bar-row .top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}
.bar-row .top b {
  font-family: var(--mono);
  color: var(--text);
  font-size: 12px;
}

.live-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.live-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.live-head .grow {
  min-width: 0;
  flex: 1;
}
.live-head .name {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.live-head .truck {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 1px;
}
.job-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
}
.job-strip .city {
  font-weight: 700;
}
.job-strip .arrow {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px);
  position: relative;
}
.job-strip .arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border: 4.5px solid transparent;
  border-left-color: var(--line-2);
}
.job-strip .rem {
  font-family: var(--mono);
  color: var(--amber);
  font-weight: 700;
  white-space: nowrap;
}
.live-grid-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.live-grid-mini .mini {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.live-grid-mini .mini .l {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.live-grid-mini .mini .v {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}

.live-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

/* --------------------------------------------------------------- events */

.event-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(21, 30, 43, 0.7), rgba(15, 22, 32, 0.5));
  position: relative;
  overflow: hidden;
}
.event-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--amber);
  opacity: 0.8;
}
.event-card.ats::before {
  background: var(--cyan);
}
.event-card.past {
  opacity: 0.66;
}
.event-card.past::before {
  background: var(--dim);
}
.event-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.event-date svg {
  width: 13px;
  height: 13px;
}
.event-title {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.event-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.event-meta .line {
  display: flex;
  align-items: center;
  gap: 7px;
}
.event-meta svg {
  width: 13px;
  height: 13px;
  color: var(--dim);
  flex: 0 0 auto;
}
.event-desc {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}
.event-foot .counts {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--dim);
}
.event-foot .counts b {
  color: var(--muted);
  font-family: var(--mono);
}
.event-foot .rsvp {
  margin-left: auto;
  display: flex;
  gap: 5px;
}

/* ---------------------------------------------------------------- leave */

.leave-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.leave-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.leave-item .top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.leave-item .who {
  font-weight: 700;
  font-size: 13px;
}
.leave-item .range {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: 5px;
}
.leave-item .reason {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.leave-item .foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.leave-item .foot .spacer {
  flex: 1;
}
.leave-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --------------------------------------------------------------- members */

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
/* TMP VTC 花名册：分区 + 方形头像卡 */
.roster-body {
  transition: opacity 0.2s ease;
}
.roster-body.is-loading {
  opacity: 0.6;
}
.roster-section {
  margin: 34px 0 44px;
  text-align: center;
}
.roster-title {
  display: inline-block;
  margin: 0 0 20px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--amber);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #f4f7fc;
}
.roster-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.roster-card {
  width: 172px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.15s ease;
}
.roster-card:hover {
  transform: translateY(-3px);
}
.roster-avatar {
  width: 172px;
  height: 172px;
  border-radius: 10px;
  object-fit: cover;
  background: #101722;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  font-weight: 800;
  color: #4b5d75;
}
.roster-name {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 800;
  color: #f2f6fc;
  line-height: 1.25;
  max-width: 172px;
  overflow-wrap: anywhere;
}
.roster-role {
  margin-top: 3px;
  font-size: 12px;
  color: #8ea3bd;
}
.roster-source {
  margin: 10px 0 30px;
  text-align: center;
  font-size: 11.5px;
  color: var(--dim);
}
/* 成员管理：横向名单 + 行内身份组选择 */
.member-manage-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.member-manage-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}
.member-manage-count {
  flex-shrink: 0;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}
.member-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-manage-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 196px;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}
.member-manage-row .avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 14px;
}
.member-manage-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.member-manage-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.member-manage-name strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: #f2f6fc;
}
.member-manage-name .badge {
  flex-shrink: 0;
}
.member-manage-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
  font-size: 11px;
}
.member-manage-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.member-role-select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  font-size: 11.5px;
}
.member-role-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.member-role-note {
  color: var(--dim);
  font-size: 10px;
  line-height: 1.35;
}
@media (max-width: 620px) {
  .member-manage-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .member-manage-side {
    grid-column: 1 / -1;
  }
}

/* TMP ID account administration */
.account-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.account-create {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.018);
}
.account-create-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #f2f6fc;
}
.account-create-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.account-create-grid .field {
  margin: 0;
}
.account-list-title {
  font-size: 13px;
  font-weight: 700;
  color: #dbe4f0;
}
.account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 2px;
}
.account-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 150px auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.014);
}
.account-row .avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 12px;
}
.account-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.account-row-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #f2f6fc;
}
.account-row-main .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.account-tmp-input {
  height: 34px;
  font-family: var(--mono);
  font-size: 12px;
}
@media (max-width: 760px) {
  .account-create-grid {
    grid-template-columns: 1fr;
  }
  .account-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .account-row .account-tmp-input,
  .account-row .btn {
    grid-column: 2;
  }
}
/* 司机等级与出席积分 */
.levels-page {
  margin: 4px 0 28px;
}
.level-ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 14px;
}
.level-step {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--dim);
}
.level-step strong {
  font-size: 10px;
  font-weight: 700;
}
.level-step-min {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--amber);
}
.level-step.rookie strong { color: #aebccd; }
.level-step.initiate strong { color: #7fd4a8; }
.level-step.journey strong { color: #4fd1b5; }
.level-step.licensed strong { color: #4ecbf0; }
.level-step.regular strong { color: #58a6ff; }
.level-step.experienced strong { color: #7b8cff; }
.level-step.skilled strong { color: #a78bfa; }
.level-step.expert strong { color: #c084fc; }
.level-step.master strong { color: #f472b6; }
.level-step.veteran strong { color: var(--amber); }
.level-step.legendary strong { color: #ffd76a; }
.level-note {
  margin: 0 0 12px;
  font-size: 11.5px;
  color: var(--dim);
}
.level-rule {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
}
.level-event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 10px;
}
.level-event-card {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}
.level-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.level-event-head strong {
  font-size: 12px;
  line-height: 1.4;
}
.level-event-points {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--amber);
  white-space: nowrap;
}
.level-event-card p {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.5;
}
.level-event-card.is-multiplier {
  border-color: rgba(255, 215, 106, 0.36);
  background: linear-gradient(135deg, rgba(255, 215, 106, 0.09), rgba(255, 140, 0, 0.035));
}
.level-event-card.is-multiplier .level-event-points {
  color: #ffd76a;
}
.level-guide-foot {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  color: var(--dim);
  font-size: 11px;
  line-height: 1.6;
}
.level-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}
.level-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}
.level-main {
  flex: 1;
  min-width: 0;
}
.level-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.level-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.level-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #aebccd;
  background: rgba(255, 255, 255, 0.07);
}
.level-badge.rookie { color: #aebccd; background: rgba(174, 188, 205, 0.1); }
.level-badge.initiate { color: #7fd4a8; background: rgba(127, 212, 168, 0.1); }
.level-badge.journey { color: #4fd1b5; background: rgba(79, 209, 181, 0.1); }
.level-badge.licensed { color: #4ecbf0; background: rgba(78, 203, 240, 0.1); }
.level-badge.regular { color: #58a6ff; background: rgba(88, 166, 255, 0.1); }
.level-badge.experienced { color: #7b8cff; background: rgba(123, 140, 255, 0.1); }
.level-badge.skilled { color: #a78bfa; background: rgba(167, 139, 250, 0.12); }
.level-badge.expert { color: #c084fc; background: rgba(192, 132, 252, 0.12); }
.level-badge.master { color: #f472b6; background: rgba(244, 114, 182, 0.12); }
.level-badge.veteran { color: var(--amber); background: rgba(255, 166, 43, 0.1); }
.level-badge.legendary { color: #ffd76a; background: linear-gradient(135deg, rgba(255, 215, 106, 0.18), rgba(255, 140, 0, 0.12)); }
.level-points {
  margin-left: auto;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #f4f7fc;
}
.level-meta {
  margin: 3px 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  color: var(--dim);
}
.level-track {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}
.level-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9f1c, #ffd76a);
  transition: width 0.35s ease;
}
/* 活动证明 / Event Evidence */
.evidence-modal,
.evidence-review-panel {
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.btn.evidence-review {
  border-color: rgba(52, 211, 153, 0.36);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.14), rgba(52, 211, 153, 0.05));
  color: #b8f5dc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn.evidence-review svg {
  color: var(--green);
}
.btn.evidence-review:hover {
  border-color: rgba(52, 211, 153, 0.68);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.22), rgba(52, 211, 153, 0.09));
  color: #ecfdf5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(52, 211, 153, 0.08);
}
.evidence-textarea {
  min-height: 70px;
  resize: vertical;
}
.evidence-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -2px 0 2px;
}
.evidence-file {
  max-width: 100%;
  color: var(--dim);
  font-size: 11px;
}
.evidence-file::file-selector-button {
  margin-right: 9px;
  padding: 6px 9px;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.evidence-preview {
  display: grid;
  place-items: center;
  min-height: 120px;
  overflow: hidden;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}
.evidence-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}
.evidence-preview.is-empty {
  color: var(--dim);
  font-size: 11.5px;
}
.evidence-section-title {
  margin-top: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.evidence-list,
.evidence-reviewed-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.evidence-mine-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}
.evidence-mine-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.evidence-mine-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.evidence-mine-side {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}
.evidence-meta {
  overflow: hidden;
  color: var(--dim);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evidence-note {
  color: #c5d1df;
  font-size: 11px;
  line-height: 1.5;
}
.evidence-points {
  flex: 0 0 auto;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.evidence-thumb {
  display: block;
  flex: 0 0 auto;
  width: 78px;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
}
.evidence-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.evidence-thumb.is-empty {
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 11px;
}
.evidence-review-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}
.evidence-review-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.evidence-review-head .grow {
  min-width: 0;
}
.evidence-review-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.evidence-review-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.evidence-review-actions {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
}
.evidence-review-actions .field {
  margin: 0;
}
.evidence-review-btns {
  display: flex;
  gap: 7px;
  padding-bottom: 1px;
}
.evidence-points-input {
  width: 100%;
}
.evidence-reviewed-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-bottom: 1px dashed var(--line);
  color: var(--dim);
  font-size: 11px;
}
.evidence-reviewed-row:last-child {
  border-bottom: 0;
}
.evidence-reviewed-name {
  flex: 0 0 130px;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 620px) {
  .evidence-review-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .evidence-reviewed-name {
    flex-basis: 90px;
  }
}
.member-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.018);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.member-card .top {
  display: flex;
  align-items: center;
  gap: 11px;
}
.member-card .nm {
  font-weight: 700;
  font-size: 14px;
}
.member-card .un {
  font-size: 11px;
  color: var(--dim);
  font-family: var(--mono);
}
.member-card .stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}
.member-card .stats .s .l {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.member-card .stats .s .v {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
}
.invite-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed rgba(255, 166, 43, 0.4);
  border-radius: 11px;
  background: rgba(255, 166, 43, 0.05);
  flex-wrap: wrap;
}
.invite-strip code {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--amber);
}
.invite-strip .lbl {
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* -------------------------------------------------------------- settings */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.steam-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 6px;
}
.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.readonly-value {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.field-hint {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: -4px;
}
.country-select-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.country-flag-preview {
  width: 52px;
  height: 36px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.settings-actions .btn {
  min-width: 120px;
}
.steam-id {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}
.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(30, 42, 58, 0.6);
}
.setting-row:last-child {
  border-bottom: 0;
}
.setting-row .grow {
  flex: 1;
  min-width: 0;
}
.setting-row .t {
  font-weight: 600;
  font-size: 13px;
}
.setting-row .d {
  font-size: 11.5px;
  color: var(--dim);
  margin-top: 2px;
  line-height: 1.5;
}
.token-box {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.token-box code {
  flex: 1;
  min-width: 180px;
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #0b111a;
  color: var(--amber);
  overflow-wrap: anywhere;
}
.code-block {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--muted);
  overflow-x: auto;
  line-height: 1.75;
  white-space: pre;
}

/* --------------------------------------------------------------- helper */

.muted {
  color: var(--muted);
}
.dim {
  color: var(--dim);
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.nowrap {
  white-space: nowrap;
}
.flex {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flex-wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.hidden {
  display: none !important;
}
.text-right {
  text-align: right;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.skeleton {
  background: linear-gradient(90deg, #141d2a 25%, #1a2534 37%, #141d2a 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.mobile-backdrop {
  display: none;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-dash {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-live {
    grid-template-columns: minmax(0, 1fr);
  }
  .settings-grid,
  .leave-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-w: 240px;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-104%);
    transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
    width: var(--sidebar-w);
    box-shadow: var(--shadow);
  }
  .shell.nav-open .sidebar {
    transform: none;
  }
  .shell.nav-open .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(4, 7, 11, 0.6);
    backdrop-filter: blur(2px);
  }
  .topbar {
    padding: 0 16px;
  }
  .topbar .hamburger {
    display: inline-flex;
  }
  .view {
    padding: 18px 16px 50px;
  }
  .auth-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-hero {
    display: none;
  }
}

@media (max-width: 640px) {
  .auth-card-solo {
    padding: 32px 20px 26px;
    border-radius: 18px;
  }
  .auth-title {
    font-size: 27px;
  }
  .auth-logo {
    width: 130px;
    height: 92px;
    margin-bottom: 18px;
  }
  .auth-lang {
    top: 14px;
    right: 14px;
  }
  .auth-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
  .auth-providers {
    padding-top: 0;
  }
  .roster-card,
  .roster-avatar {
    width: 128px;
  }
  .roster-avatar {
    height: 128px;
    font-size: 34px;
  }
  .roster-name {
    font-size: 14px;
    max-width: 128px;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-title {
    font-size: 21px;
  }
  .page-head .actions {
    width: 100%;
    margin-left: 0;
  }
  .page-head .actions .btn {
    flex: 1;
  }
  .stat-value {
    font-size: 23px;
  }
  .topbar .clock {
    display: none;
  }
  .modal-body {
    max-height: calc(100vh - 180px);
  }
  .toast-root {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
  .toast {
    max-width: none;
  }
  .table td,
  .table th {
    padding: 10px 11px;
  }
  .live-grid-mini {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Avatar and Banner ───────────────────────────────────────────── */
.ab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ab-layout.with-queue {
  grid-template-columns: minmax(0, 1fr) 350px;
}

.ab-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ab-hero {
  position: relative;
  height: 178px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(120deg, #11202f, #0b111a 55%, #152433);
}

.ab-hero-banner {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.ab-hero-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.ab-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 10, 15, 0.04) 0%, rgba(7, 10, 15, 0.12) 42%, rgba(7, 10, 15, 0.86) 100%);
  pointer-events: none;
}

.ab-hero-id {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.ab-hero-id .avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), 0 12px 26px rgba(0, 0, 0, 0.45);
  flex: 0 0 auto;
}

.ab-hero-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.65);
}

.ab-hero-name strong {
  font-size: 20px;
  line-height: 1.15;
  color: #fff;
}

.ab-hero-name span {
  color: rgba(233, 240, 248, 0.66);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ab-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ab-pickers {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.ab-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.ab-picker-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.ab-picker-head strong {
  font-size: 13px;
}

.ab-picker-head .dim {
  font-size: 11px;
}

.ab-drop {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  aspect-ratio: 1920 / 350;
  padding: 0;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(25, 36, 51, 0.7), rgba(12, 18, 27, 0.7));
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.ab-drop:hover {
  border-color: var(--amber);
  background: linear-gradient(160deg, rgba(255, 166, 43, 0.12), rgba(12, 18, 27, 0.8));
}

.ab-drop.is-avatar {
  width: 100%;
  aspect-ratio: 1;
}

.ab-drop-empty {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
  font-size: 12px;
  pointer-events: none;
}

.ab-drop-empty svg {
  color: var(--amber);
}

.ab-drop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ab-picker-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.ab-picker-row .input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
}

.ab-generate {
  width: 100%;
  justify-content: center;
}

.ab-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1920 / 350;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(25, 36, 51, 0.7), rgba(12, 18, 27, 0.7));
  overflow: hidden;
}

.ab-preview.is-avatar {
  aspect-ratio: 1;
}

.ab-preview-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  max-width: 240px;
  padding: 0 16px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.ab-preview-empty svg {
  color: var(--amber);
}

.ab-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ab-preview.is-banner .ab-preview-img {
  object-fit: contain;
}

.ab-output {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(10, 16, 24, 0.45);
}

.ab-output-label {
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ab-output-url {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ab-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ab-actions-row {
  display: flex;
  gap: 7px;
}

.ab-actions-row .btn {
  flex: 1 1 0;
  justify-content: center;
}

.ab-discord-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.55;
}

.ab-discord-note svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.ab-flag {
  padding: 2px 7px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ab-note-field {
  display: grid;
  gap: 6px;
}

.ab-note-field .input {
  resize: vertical;
}

.ab-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.ab-form-foot .dim {
  font-size: 12px;
}

.ab-history {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ab-request {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(16, 23, 34, 0.55);
}

.ab-request-media,
.ab-queue-media {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.ab-thumb {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
}

.ab-thumb.is-banner {
  width: 103px;
}

.ab-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
  border-style: dashed;
}

.ab-request-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ab-request-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ab-status {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.1);
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ab-status.approved {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
  color: var(--green);
}

.ab-status.rejected {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
  color: var(--red);
}

.ab-request-note {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.ab-review-note {
  color: var(--cyan);
  font-size: 11px;
}

.ab-queue {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ab-queue-item {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(16, 23, 34, 0.6);
}

.ab-queue-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ab-queue-head strong {
  display: block;
  font-size: 13px;
}

.ab-queue-head .dim {
  font-size: 11px;
}

.ab-queue-actions {
  display: flex;
  gap: 7px;
}

.ab-queue-actions .btn {
  flex: 1 1 0;
  justify-content: center;
}

@media (max-width: 1180px) {
  .ab-layout.with-queue {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .ab-pickers {
    grid-template-columns: minmax(0, 1fr);
  }

  .ab-drop.is-avatar {
    width: 100%;
    aspect-ratio: 1;
  }

  .ab-request {
    grid-template-columns: minmax(0, 1fr);
  }
}
