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

:root {
  --sidebar-w: 230px;
  --accent: #0071e3;
  --bg: #f5f5f7;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --sidebar-bg: #1d1d1f;
  --sidebar-text: #aeaeb2;
  --sidebar-active: #0071e3;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Shell wrapper ─────────────────────────────────────────────────────────── */
#user-shell {
  display: flex;
  min-height: 100vh;
}

.us-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.us-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.us-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--sidebar-active);
  letter-spacing: -0.5px;
}

.us-logo-sub {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.35);
  margin-left: 4px;
}

.us-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.us-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}

.us-nav-item:hover   { background: rgba(255,255,255,.06); color: #fff; }
.us-nav-item.active  { background: rgba(0,113,227,.15); color: #fff; border-left-color: var(--sidebar-active); }

.us-nav-icon { font-size: 16px; line-height: 1; }

.us-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.us-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.us-user-info { flex: 1; min-width: 0; }

.us-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.us-user-meta {
  font-size: 11px;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.us-signout {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.us-signout:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ── Content area ──────────────────────────────────────────────────────────── */
.us-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 36px;
  max-width: 900px;
}

@media (max-width: 640px) {
  #user-shell { display: block; }
  .us-sidebar {
    width: 100%;
    position: static;
    min-height: auto;
  }
  .us-logo { padding: 16px; }
  .us-nav {
    display: flex;
    overflow-x: auto;
    padding: 4px 8px 10px;
  }
  .us-nav-item {
    flex: 0 0 auto;
    border-left: 0;
    border-bottom: 3px solid transparent;
    padding: 9px 11px;
  }
  .us-nav-item.active { border-left-color: transparent; border-bottom-color: var(--sidebar-active); }
  .us-sidebar-footer { padding: 10px 14px; }
  .us-content {
    margin-left: 0;
    padding: 24px 16px;
    max-width: none;
  }
  .vm-item, .us-ch-row { align-items: flex-start; flex-wrap: wrap; }
  .vm-actions { width: 100%; }
  audio { max-width: 100%; }
}

.us-page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.us-page-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.us-card {
  background: var(--card);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.us-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ── Form elements ─────────────────────────────────────────────────────────── */
.us-form-group { margin-bottom: 14px; }
.us-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.us-input { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.us-input:focus { border-color: var(--accent); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.us-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: opacity .15s; }
.us-btn:hover:not(:disabled) { opacity: .85; }
.us-btn:disabled { opacity: .4; cursor: not-allowed; }
.us-btn-primary  { background: var(--accent); color: #fff; }
.us-btn-ghost    { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.us-btn-danger   { background: #ff3b30; color: #fff; }
.us-btn-sm       { padding: 6px 12px; font-size: 12px; }

/* ── Status badges ─────────────────────────────────────────────────────────── */
.us-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 20px; }
.us-badge-green  { background: #d1fae5; color: #065f46; }
.us-badge-amber  { background: #fef3c7; color: #92400e; }
.us-badge-red    { background: #fee2e2; color: #991b1b; }
.us-badge-gray   { background: #f1f5f9; color: #475569; }
.us-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Permission denied ─────────────────────────────────────────────────────── */
.us-permission-denied {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 50vh; gap: 12px; color: var(--muted); text-align: center;
}
.us-permission-denied h2 { font-size: 20px; font-weight: 700; color: var(--text); }

/* ── Coming soon ───────────────────────────────────────────────────────────── */
.us-coming-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 50vh; gap: 12px; color: var(--muted); text-align: center;
}
.us-coming-soon-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fef9c3; color: #854d0e;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 20px; border: 1px solid #fde68a;
}
.us-coming-soon h2 { font-size: 20px; font-weight: 700; color: var(--text); }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.us-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 24px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 999;
}
.us-toast.show { opacity: 1; }

/* ── Login page (index.html) ───────────────────────────────────────────────── */
.us-login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #1d1d1f 0%, #0a2540 100%);
}

.us-login-card {
  background: #fff; border-radius: 16px; padding: 48px 40px;
  width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.us-login-logo { font-size: 28px; font-weight: 800; letter-spacing: -1px; color: var(--accent); margin-bottom: 4px; }
.us-login-sub  { color: var(--muted); font-size: 13px; margin-bottom: 32px; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; border: 1.5px solid var(--border); border-radius: 8px;
  background: white; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--text);
  transition: background .15s, border-color .15s;
}
.btn-google:hover { background: #f8fafc; border-color: #94a3b8; }
.btn-google:disabled { opacity: .4; cursor: not-allowed; }

.us-login-error {
  margin-top: 16px; padding: 10px; background: #fef2f2;
  border: 1px solid #fecaca; border-radius: 6px; color: #dc2626; font-size: 13px; display: none;
}
