/* ════════════════════════════════════════════════════════════
   Vehicle Exchange — User Panel Stylesheet
   ════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────── */
.user-layout {
  display: flex;
  min-height: calc(100vh - 72px);
  background: var(--bg-dark);
}

.user-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border-soft);
  padding: 28px 0 40px;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.user-sidebar::-webkit-scrollbar { width: 4px; }
.user-sidebar::-webkit-scrollbar-track { background: transparent; }
.user-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 4px; }

.user-main {
  flex: 1;
  padding: 36px 40px;
  min-width: 0;
  max-width: 1100px;
}

@media (max-width: 991px) {
  .user-layout { flex-direction: column; }
  .user-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    padding: 16px 0;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
  }
  .user-sidebar nav { display: flex; overflow-x: auto; padding: 0 12px; gap: 4px; }
  .user-sidebar .sidebar-section-label { display: none; }
  .user-main { padding: 24px 20px; }
}

/* ── Sidebar Nav ────────────────────────────────────────────── */
.user-sidebar-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 24px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-avatar-img {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  margin-bottom: 10px;
}
.sidebar-avatar-placeholder {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}
.sidebar-user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  text-align: center;
  line-height: 1.3;
}
.sidebar-user-email {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(112,144,184,.5);
  padding: 16px 20px 6px;
}

.sidebar-nav-list { list-style: none; padding: 0 10px; margin: 0; }
.sidebar-nav-list + .sidebar-section-label { margin-top: 8px; }

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  white-space: nowrap;
}
.sidebar-nav-link i { font-size: 1.05rem; width: 20px; flex-shrink: 0; }
.sidebar-nav-link:hover { color: var(--text); background: rgba(76,110,247,.1); }
.sidebar-nav-link.active {
  color: var(--primary-h);
  background: rgba(76,110,247,.15);
  font-weight: 600;
}
.sidebar-nav-link.active i { color: var(--primary); }
.sidebar-nav-link.danger { color: #ff4d6d; }
.sidebar-nav-link.danger:hover { background: rgba(255,77,109,.1); }

/* ── Page Header ────────────────────────────────────────────── */
.up-page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}
.up-page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -.4px;
}
.up-page-sub { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover { border-color: var(--border); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }
.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.stat-card-icon.blue   { background: rgba(76,110,247,.15); color: var(--primary); }
.stat-card-icon.teal   { background: rgba(0,212,180,.15);  color: var(--accent); }
.stat-card-icon.purple { background: rgba(156,89,240,.15); color: var(--purple); }
.stat-card-icon.orange { background: rgba(255,176,32,.15); color: #ffb020; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* ── Content Panels ─────────────────────────────────────────── */
.up-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.up-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.up-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.up-card-body { padding: 24px; }
.up-card-body.no-pad { padding: 0; }

/* ── Transaction Table ───────────────────────────────────────── */
.tx-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.tx-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-soft);
}
.tx-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 14px;
  vertical-align: middle;
}
.tx-table tbody tr:last-child td { border-bottom: none; }
.tx-table tbody tr:hover td { background: rgba(76,110,247,.05); }

/* ── Status Pill ────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}
.status-pill.success { background: rgba(0,212,180,.12);  color: var(--accent);    border: 1px solid rgba(0,212,180,.25); }
.status-pill.warning { background: rgba(255,176,32,.12); color: #ffb020;          border: 1px solid rgba(255,176,32,.25); }
.status-pill.danger  { background: rgba(255,77,109,.12); color: #ff4d6d;          border: 1px solid rgba(255,77,109,.25); }
.status-pill.info    { background: rgba(76,110,247,.12); color: var(--primary-h); border: 1px solid rgba(76,110,247,.25); }
.status-pill.muted   { background: rgba(112,144,184,.1); color: var(--text-muted);border: 1px solid rgba(112,144,184,.18); }

/* ── Auth Pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--bg-dark);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 48px 40px;
  box-shadow: var(--shadow);
}
@media (max-width: 480px) { .auth-card { padding: 32px 24px; } }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo i { font-size: 2.5rem; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--text); text-align: center; margin-bottom: 6px; letter-spacing: -.4px; }
.auth-sub { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 32px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-soft); }
.auth-divider span { font-size: 12px; color: var(--text-muted); }

/* ── Profile ────────────────────────────────────────────────── */
.profile-avatar-wrap {
  position: relative;
  width: 100px; height: 100px;
  margin: 0 auto 20px;
}
.profile-avatar-img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}
.profile-avatar-placeholder {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fff;
  font-weight: 700;
  border: 3px solid var(--primary);
}
.profile-avatar-edit {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .8rem;
  cursor: pointer;
  border: 2px solid var(--bg-card);
}

/* ── 2FA / Settings ─────────────────────────────────────────── */
.two-fa-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 28px;
  border: 1px solid var(--border);
}
.two-fa-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
}
.two-fa-status.on  { background: rgba(0,212,180,.12); color: var(--accent); border: 1px solid rgba(0,212,180,.28); }
.two-fa-status.off { background: rgba(255,77,109,.12); color: #ff4d6d; border: 1px solid rgba(255,77,109,.28); }
.qr-container {
  text-align: center;
  padding: 20px;
  background: var(--bg-dark);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.qr-container img { border-radius: 8px; border: 4px solid #fff; }

/* ── Chat Interface ─────────────────────────────────────────── */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.chat-header {
  padding: 16px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-header i { color: var(--primary); font-size: 1.1rem; }
.chat-header strong { color: var(--text); font-size: 14px; }
.chat-header span { color: var(--text-muted); font-size: 12px; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 80%;
}
.chat-msg.own { flex-direction: row-reverse; align-self: flex-end; }
.chat-msg.system { max-width: 100%; align-self: center; }
.chat-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
  align-self: flex-end;
}
.chat-avatar.buyer  { background: rgba(76,110,247,.25); color: var(--primary-h); }
.chat-avatar.seller { background: rgba(0,212,180,.2); color: var(--accent); }
.chat-avatar.admin  { background: rgba(156,89,240,.25); color: var(--purple); }
.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 100%;
  word-break: break-word;
}
.chat-msg.own .chat-bubble {
  background: linear-gradient(135deg, rgba(76,110,247,.35), rgba(76,110,247,.25));
  border: 1px solid rgba(76,110,247,.3);
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.chat-msg:not(.own) .chat-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.system .chat-bubble {
  background: rgba(76,110,247,.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  padding: 6px 12px;
}
.chat-sender {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text-muted);
}
.chat-msg.own .chat-sender { text-align: right; }
.chat-time {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 3px;
  opacity: .7;
}
.chat-msg.own .chat-time { text-align: right; }
.chat-file-attach {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,.2);
  border-radius: 8px;
  margin-top: 6px;
  text-decoration: none;
  color: var(--primary-h);
  font-size: 12.5px;
  transition: opacity var(--transition);
}
.chat-file-attach:hover { opacity: .8; color: var(--primary-h); }
.chat-input-area {
  padding: 14px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-soft);
}
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--bg-dark);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: border-color var(--transition);
  font-family: inherit;
}
.chat-input:focus { outline: none; border-color: var(--primary); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-attach-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(76,110,247,.12);
  border: 1.5px solid var(--border);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.chat-attach-btn:hover { background: rgba(76,110,247,.2); }
.chat-send-btn {
  height: 40px;
  border-radius: 10px;
  background: var(--gradient);
  border: none;
  color: #fff;
  padding: 0 18px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(76,110,247,.4); }
.chat-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(76,110,247,.1);
  border: 1px solid rgba(76,110,247,.2);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--primary-h);
}
.chat-file-preview .remove-file { cursor: pointer; margin-left: auto; color: #ff4d6d; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; opacity: .3; display: block; margin-bottom: 16px; }
.empty-state h6 { color: var(--text); font-weight: 700; margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ── Notification Toggle ────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px; height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(112,144,184,.2);
  border-radius: 24px;
  cursor: pointer;
  transition: .3s;
  border: 1px solid var(--border);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 50%; transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: .3s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(76,110,247,.3); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translate(22px, -50%); background: var(--primary); }

/* ── Transaction Detail ─────────────────────────────────────── */
.txd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 768px) { .txd-grid { grid-template-columns: 1fr; } }
.txd-item .txd-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin-bottom: 4px; }
.txd-item .txd-value { font-size: 1rem; font-weight: 600; color: var(--text); }
.txd-amount { font-size: 1.6rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
